Author Topic: Inverse kinematics  (Read 4257 times)

0 Members and 1 Guest are viewing this topic.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Inverse kinematics
« on: October 25, 2011, 11:53:56 pm »
Basically, I have a robotic arm (shown below), unfortunately the one I got is broken and I can't input XYZ coordinates directly so I have to convert them to angles for each of the joints.



I know you need to use inverse kinematics for that (it gave headaches to my teacher), so I'm wondering if someone here knows about them. If so, please help me, thanks.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Inverse kinematics
« Reply #1 on: October 26, 2011, 12:34:11 am »
If you were to for example call the arm between joints 2 and three 2_3 and you wanted joint 3 at the xyz coordinate of (2,4,-8) in relation to joint 2, you would need to compute the inverse tangent to find the angle. To do so you need a right triangle with one angle at joint 2 and the other joint 3. Because this triangle is not aligned with the axis's you will need to break it down into 2 other triangles, one for y and the other for xz with their hypotenuses forming the legs of your final triangle. so if you solve for the Pythagorean theorem for x and z you get 8.246. Then because the xz leg is the opposite of the angle your solving for, you put it above the y leg which is the adjacent. So you would solve for the inverse tangent of 8.246/4 which equals 64.1 degrees. Now that is only part of the solution as you still need to find the rotation degree which is defined by x and z. Solving the inverse tangent for z over x yields a result of -75.96 degrees which is in the clockwise direction. So your final movement needs to be a clockwise rotation of 75.96 degrees and the arm needs to be bent to an angle of 64.1 degrees. The full formula for the bending angle is tan(-1)( sqrt((x)^2 + (z)^2) / y ) and the formula for rotation is tan(-1)( z / x ) All of this calculated with my trusty Prizm

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Inverse kinematics
« Reply #2 on: October 26, 2011, 12:42:43 am »
Well, say the base frame is (0,0,0) and the tool frame is (2,4,-8), each of the articulations is, say, 20cm, and that's all I know (I don't care of XYZ positions of the angles in between), there's some way to calculate the 4 angles?

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Inverse kinematics
« Reply #3 on: October 26, 2011, 12:54:48 am »
Well, say the base frame is (0,0,0) and the tool frame is (2,4,-8), each of the articulations is, say, 20cm, and that's all I know (I don't care of XYZ positions of the angles in between), there's some way to calculate the 4 angles?
Hmm that's far beyond my own knowledge of physics. It seems like either way you will have to calculate the xyz coordinate of each joint and have them all add up to your destination. You know that the points joint 3 for example could be forms a hollow sphere and each point upon that sphere is the center of another hollow sphere with each of those points being a possible position of joint 4 and the total shape is now a solid sphere with a diameter of 40 cm. How to calculate the individual angles though is something I can't figure out.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Inverse kinematics
« Reply #4 on: October 26, 2011, 01:06:17 am »
Thanks for helping anyway. I wonder if it's related to polar coordinates?

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Inverse kinematics
« Reply #5 on: October 27, 2011, 12:47:55 pm »
Bump. I guess I'll just download a C++ library for that.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Inverse kinematics
« Reply #6 on: October 27, 2011, 01:16:49 pm »
The thing about inverse kinematics, is that the more joints you have, the more possible solutions for any given position.  I personally have only ever done 1 joint kinematics, and that's just simple trig, i have no idea how to do more x.x
« Last Edit: October 27, 2011, 01:16:56 pm by Builderboy »

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Inverse kinematics
« Reply #7 on: October 27, 2011, 02:51:38 pm »
I guess that you have to take 2 fixed points so you can simply solve the last one.
but obviously, you have a looooot of solutions for a given (x,y) point.
« Last Edit: October 27, 2011, 02:51:52 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Inverse kinematics
« Reply #8 on: October 27, 2011, 05:24:10 pm »
I think what you will need to do given the coordinates of the tool bench is to first generate a list of possible coordinates for each joint and then you can calculate the angles. Finding the angles is pure math but for finding possible coordinates you may have to use a guess and check approach. If given the tool bench coordinates the first thing you should do is find the distance between it and the base. Then knowing that each segment is 20cm and there were 5 of them that makes the distance 100cm when fully extended. With the comparison between the lengths then you can either approximate or exactly calculate what angles are needed to produce that distance using vector math. From there you could use a brute force approach to find to which joint each angle is acossiated with to match the original coordinates

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Inverse kinematics
« Reply #9 on: November 01, 2011, 06:22:41 pm »
Update: Forget inverse kinematics, I don't need it anymore. My final project will involve controlling the arm with a Wiimote, which doesn't need any XYZ coordinate. It also have the side effect to be rather awesome. :P

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55823
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Inverse kinematics
« Reply #10 on: November 01, 2011, 06:34:37 pm »
Hmm a wiimote sounds interesting. I unfortunately cannot help, though, because I know absolutely nothing about robotics, except that Protoss Collosi is OP (jk).
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF



T-Shirt store | Reverbnation | Facebook | Youtube | Twitter

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Inverse kinematics
« Reply #11 on: November 01, 2011, 06:37:17 pm »
Yeah I don't need help either, just telling you guys it'll be awesome ^_^ I'll try to record videos.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.