Robot Inverse Kinematics With A Hexapod Leg

Поделиться
HTML-код
  • Опубликовано: 21 июл 2024
  • This video has a detailed inverse kinematic solution for a 3 axis robot and videos of it in action applying the solution. There are also some mistakes that I cover that happened along the way and crucially unlike most other videos the arm segments are NOT the same length.
    The code can be found here and is free to use and adapt:
    github.com/JustAnotherMakerCh...
    3D Print files: www.thingiverse.com/thing:646...
    Music from #Uppbeat (free for Creators!):
    uppbeat.io/t/danger-lion-x/gh...
  • НаукаНаука

Комментарии • 141

  • @pieterpennings9371
    @pieterpennings9371 Год назад +7

    really cool. I am in the process of making my own hexapod and other projects that include inverse kinematics and I got this video suggested randomly and it's really well made.

  • @JamesNewton
    @JamesNewton Год назад +14

    Excellent video! I expect I will use it with students in the future. I agree with others that less bubble popping would be good. I'm also not into cartoon violence. Love the "why didnt that work" bit in the middle because students often give up at those points and it great that you modeled working through it.

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  Год назад +3

      Thank you for the kind words and the honest feedback. I’m very glad to hear that you might use it to teach with, I had actually hoped someone would use for that very purpose! In the future (this year I hope) i’m going to explore the solutions for a 6 DOF robot and build one, maybe create my own programming language for it, and an interpreter, controller, teach pendant etc. I have experience with them in industry and I think there are a lot of barriers to people gaining an understanding of how it all fits together and how it works.

  • @GuilhermeLimait
    @GuilhermeLimait 5 месяцев назад +2

    The most simple way to learn it that I’ve seen so far, thanks for it❤

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  5 месяцев назад +1

      You're very welcome! Thank you so much, I really appreciate the comment :)

  • @onurkarakas2814
    @onurkarakas2814 Год назад

    This video is very epic, thanks for sparing time to make such a video.

  • @maurovianna4702
    @maurovianna4702 Год назад +1

    Thanks for the great explanation! I already saw a code for such a robot but now I finally understood it due to the math and interpolation.

  • @jeremiahbullfrog9288
    @jeremiahbullfrog9288 Год назад +1

    Fascinating. Thank you for showing how to derive the formulas, this stuff seems like magic but it all comes down to maths.

  • @BrickRoom7
    @BrickRoom7 8 месяцев назад +1

    This is the best IK tutorial video on RUclips, at least I think so. Thank you for this. Can you do a video on transformation and rotations?

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  6 месяцев назад

      Thank you so much, I'm planning to do a video on a 6 axis robot using Denavit-Hartenberg and it has a lot of matrix mathematics with transformations and rotations.

  • @GCKteamKrispy
    @GCKteamKrispy 7 месяцев назад +1

    Just some basic geometry, but my professor had to talk in some complicated engineering language. Thank you so much, very helpful

  • @gabrielpiazza8463
    @gabrielpiazza8463 Год назад +1

    This is awesome, you explained everything so well, thank you for the good and clear content sir. Keep it up.

  • @mohanadebada2298
    @mohanadebada2298 9 месяцев назад +1

    thank you for the math part btw its really fresh to see some math in things like this

  • @grahamnichols1416
    @grahamnichols1416 6 месяцев назад

    That is really well explained = an instant subscription. Tada!

  • @Indonesia01ian
    @Indonesia01ian 11 месяцев назад

    Really awesome. Thanks for sharing this video

  • @oluwaferanmi100
    @oluwaferanmi100 Год назад

    This guy is low key funny, nice video by the way. Keep it up.

  • @tijnvanraak7711
    @tijnvanraak7711 Год назад

    Thanks, best IK explanation I am able to find!

  • @user-tb9xv3fy8n
    @user-tb9xv3fy8n Год назад +2

    Man just came into my recommendation and saved me
    Tnx G! Subbed

  • @Algardraug
    @Algardraug 10 месяцев назад

    Really cool video and great explanation! Although I wish you had spent some extra time on the interpolation part as I don't understand how that helps when the distance that the servos have to travel doesn't change?

  • @jilliebean613
    @jilliebean613 Месяц назад

    Awesome project! I am so impressed you were able to get those plastic servos working for this project. For me, those servos break when I look at them wrong.

  • @MrEnkelmagnus
    @MrEnkelmagnus Год назад +1

    Cool, that was really helpful.

  • @ahmedbenyoucef3238
    @ahmedbenyoucef3238 Год назад

    Thank you for your great explanation. In fact, it was very cool.

  • @sulesmith897
    @sulesmith897 Год назад

    Amaxing work!😊

  • @fnsociety2827
    @fnsociety2827 Год назад

    Thanks a lot bro, i found the best IK explaination,
    waiting for trajectory from your video ❤

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  Год назад

      Thank you, you can see it's first steps here: ruclips.net/video/7dOrBUcmLVY/видео.html
      I'll be working on the walking some more and making it remote control soon :)

    • @fnsociety2827
      @fnsociety2827 Год назад +1

      @@JustAnotherMakerChannel Cool. I'll wait for it.
      I'd suggest you use a dynamixel servo for smoother things. But the important thing your explaination in math robotic is very nice, keep'it up!

  • @dadi3125
    @dadi3125 9 месяцев назад +1

    Nice video. I learned a lot from it.

  • @durgeshbg
    @durgeshbg 4 месяца назад +1

    03:11 that's where i lost track, cool work btw might get into robotics sometime in the future, thanks

  • @a330turbinex7
    @a330turbinex7 3 месяца назад +1

    Superb!!!

  • @andres154525452
    @andres154525452 8 месяцев назад +1

    Good video!

  • @arevindmohan3523
    @arevindmohan3523 Год назад

    Thank you very much bruv! This helped me out a ton..❤

  • @hashiragamingyt2162
    @hashiragamingyt2162 Год назад

    You deserve more likes and subs

  • @SALSN
    @SALSN Год назад

    Very nice. I'll put this video in my build playlist, and get to it in a decade or two :-p

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  Год назад +1

      I know the feeling! I have so many things on my list too :)

    • @SALSN
      @SALSN Год назад

      @@JustAnotherMakerChannel I have at least 5 projects that are on hold somewhere in the making process :-p
      Quad copter, drone plane, new split keyboard, mini solar boat, and a remote controlled pick up truck, just of the top of my head :-p
      Oh well, summer vacation soon :-)

  • @stefanguiton
    @stefanguiton Год назад

    Great video!

  • @anton4ik55
    @anton4ik55 Год назад +51

    nice video, but those bubble sounds are waaaay too loud, gets very annoying to watch

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  Год назад +13

      Thanks you and thanks for the feedback, I’ll definitely use them less and at lower volume in future :)

    • @bernard2735
      @bernard2735 Год назад +4

      I agree. Your content is great - clear images, a calm voice, and nice stepwise explanations - so you don’t need anything else. I subscribed ☺️

    • @timothysands5537
      @timothysands5537 9 месяцев назад +1

      All the sound effects are too loud I think. But I like them if they were 1/3 their volume

    • @Maleko48
      @Maleko48 9 месяцев назад

      I didn't even notice any bubble sounds

    • @The-KP
      @The-KP 5 месяцев назад +1

      ​@@JustAnotherMakerChannel No need to use sound effects at all, the value of your information outweighs any added interest you might believe a sound effect provides. It's just a distraction. Watch the videos of Mathologer and Veritasium. No sound effects, just narration and some animation. Thanks for making an otherwise EXCELLENT video on hexapod kinematics.

  • @swannschilling474
    @swannschilling474 8 месяцев назад +1

    Great Video!!! 🎉🎉🎉

  • @Sjeedughait
    @Sjeedughait 5 месяцев назад

    Maybe reverse engineer in algorytme and iterations something touchable. Like start and stop animations. Moving a robot engine by hand can be recored by software as steps. With or without a rhyme or repeatative steps in it. It is basically acting and can be started with dancing lessons. Like walse and rumba. Some rhyme can be distellid from that for your robot. Overlapping formulas can be used for more complex movements. Just coordinates with two equals signs.

  • @katierobinson5399
    @katierobinson5399 Год назад

    You are incredible

  • @Hyun_.18
    @Hyun_.18 Год назад

    how can i code at 10:33 to servo move on 40mm like that?i understand what you said about algorithm but how to write command line to make servo move like this, thanks you

  • @evil_lime4378
    @evil_lime4378 5 месяцев назад +1

    How did you calculate the C angle at 10:15? Only part of the (excellent) vid that stumped me

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  5 месяцев назад +1

      My apologies for not being clearer, that angle is measured from the design, the reason being that the servo arm is not aligned with the leg. Really though it could have been designed in line and the angle C would not be needed at all!

  • @sub2seany
    @sub2seany Год назад +4

    My brain has exploded

  • @TubeClemens
    @TubeClemens 4 месяца назад +1

    Excellent video clear explanation. I build a hexapood myself. One question if I have a J1L=60 how does this affect the code?

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  4 месяца назад

      Hi @TubeClemens, Do you mean you wish to have J2 not directly above and inline with J1 and call this offset J1L? If so then as a quick shot at this you would need to think about the following:
      @3:30 the Y value would need to have 60 taken off as this would be a fixed offset by J1L=60, similar to @9:41 where we apply an offset to Y to account for the leg resting position, but I think the real answer is below.
      @11:53 when we go back and substitute H in, we would substitute (H - J1L).
      For a quick look I think that would be the solution you are asking for.
      Hope this helps :)

    • @TubeClemens
      @TubeClemens 4 месяца назад +1

      @@JustAnotherMakerChannel Thank you very much this is exactly what I meant. I wil give it a try.

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  4 месяца назад +1

      Great @TubeClemens, I’m glad I could help, please let me know how it goes :)

  • @as2gmvenom835
    @as2gmvenom835 5 месяцев назад +1

    Interesting video with a good explanation. I want to mention that you can use the same rules to make the leg move in a straight line rather than an arc instead of using interpolation.
    How:
    Use the variable names at 3:50 and 11:30 as a reference.
    Let J0 be the third angle of the triangle J3-J2-J0 at the cross point of J2 (Y) and J3L.
    Get the lines j3, j2, and j0.
    *You have to calculate the j3, j2, and j0 lines when the leg is in the stand position.
    Now you can calculate the angles J3, J2, and J0 from the given j3, j2, and j0 lines.
    The trick is to make the j3 line equal = j3/CosJ1.
    now the angles J3 and J2 will depends on J1
    You just need to set J3 and J2 in the code.
    J3 = ArcCos((j2^2+j0^2-(j3/cosJ1)^2)/2*j2*j0)
    J2 = ArcCos(((j3/CosJ1)^2+j0^2-j2^2)/2*(j3/CosJ1)*j0)
    Boooom you got a straight line.
    Thank you!

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  5 месяцев назад

      Thank you, some interesting information that I’ll make the time to digest when I’m less tired. I don’t think it’s the IK solution that causes the arced motion rather the mechanical system, I have no direct control over the speed of the servos and thus when all changed at once from their respective starting angles to end angles they all move as fast as possible which is not necessarily linear. Since I have no influence over the servos speed, interpolation gives a very simple way to get an approximated linear move that can be refined by taking more smaller steps. I can’t immediately see how a change in end point calculation could achieve anything else?

    • @as2gmvenom835
      @as2gmvenom835 5 месяцев назад

      @@JustAnotherMakerChannel
      11:40 You used Pythagoras to get H so that's why the leg caused a rotary motion (arc) instead of a straight line.
      Because you calculated the radius of a circle with J1 its centre
      Description:

      Let's be in the same view by agreeing this.
      ******************************************************************************************************
      - the joint J1 causes the arc motion because it has to rotate the leg causing circular motion (an arc).
      - [To convert an arc to a straight line] >> you must increase the radius (for each increase in angle) ~ exponentially.
      Ex.
      if J1 = 0 degree, radius = 10 cm

      when J1 = 15 degree, radius must be = 10.3528 cm
      when J1 = 60 degree, radius must be = 20 cm
      How to increase the radius (you called it H)
      >> [the radius length increase(+)] >> by decreasing(-) the angle of J2 and increasing(+) the angle of J3
      assume the lower and the upper bones = 20 cm and J3=60 degree and J2 = 60 degree
      the radius = [upper_bone_cm / cos(180-J3-J2)] + [lower_bone_cm /cos (J2)]
      * (radius is result of looking at the leg from top view) *
      >> 20/cos(180-60-60) + 20/cos(60)
      >> 10 + 10
      >> the radius = 20 cm
      [The equation] >> to convert the arc into a straight line
      radius = 20 / cos(J1)
      ** but you need to know the angles of J2 & J3 to adjust the radius changing its length in the code **
      [you have to create an algorithm]>> that changes the angle values of J2 and J3 (this causes a change in the length of the radius) depending on the angle value of J1 using a loop
      for( J1 = 0 degree ; J1 < 60 degree ; J1 +1 degree each cycle)
      {
      total_length_or_radius_cm = (upper_bone_cm / cos(180-J3-J2)) + (lower_bone_cm /cos (J2))
      J3= Arccos (((lower_bone_cm^2 + upper_bone_cm^2 - (total_length_or_radius_cm / cos(J1))) / 2 * upper_bone_cm * lower_bone_cm)
      J2= Arccos (((total_length_or_radius_cm/cos(J1))^2 + upper_bone_cm^2 - lower_bone_cm^2 ) / 2 * upper_bone_cm * (total_length_or_radius_cm / cos(J1)))
      or
      J3 = ArcCos((j2^2+j0^2-(j3/cosJ1)^2)/2*j2*j0)
      J2 = ArcCos(((j3/CosJ1)^2+j0^2-j2^2)/2*(j3/CosJ1)*j0)
      delay = 100 ms
      \\increase the value of delay to decrease the motion speed and the vibration that caused by the momentum.
      }
      app.gemoo.com/share/image-annotation/615760982094012416?codeId=vzxdG9ZpE6o7n
      if you didn't get me or the images links dose not work type a guest account so i can send you images or a video

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  5 месяцев назад

      [QUOTED]"11:40 You used Pythagoras to get H so that's why the leg caused a rotary motion (arc) instead of a straight line.
      Because you calculated the radius of a circle with J1 its centre "[QUOTED]
      The solution I presented is correct, the value of H will change depending on the X & Y co-ordinate of the position required and therefore does not to be manually increased or manipulated. To achieve a positional deviation in X, all 3 joints require motion. This is accounted for in the video by substituting Y @11:57 for H to allow the J2 & J3 kinematics to be calculated on the plane projected by J1's changing angle, which ultimately accounts for the arced path of J1.
      The TOP-VIEW diagram you have presented in the link is exactly what we are doing @ 11:40, H is calculated using X & Y with Pythagoras, I can see that the underlying semi-transparent image does not make that too clear as I've arbitrarily drawn a vertical line from the Y axis, the value H shown @11:40 is exactly what you are referring to as 'H+L' in the link, which we cannot calculate from cos(J1) namely because we are trying to calculate J1, it is unknown.
      The example of arced motion shown @12:19 has no J1 involvement, no X or Z movement, only Y movement from 1 singular point to another singular point, the motion is arced because both J2 & J3 need to move by different amounts and travel at an uncontrolled speed and the inability to maintain position during the deceleration of the other axes. It's not very easy to see but @12:24 J2 completes it's movement in a fraction of the time that J3 takes, this causes the leg to plunge downwards from J2 moving and then upwards to the correct position as J3 catches up (then some overshoot and oscillation)
      I really appreciate all of the time and effort you have spent with your responses and the link and pictures too, I had to look through it a good few times and for a moment I was questioning whether my solution was correct!
      Let me know if you have and other questions :)

    • @as2gmvenom835
      @as2gmvenom835 5 месяцев назад

      @@JustAnotherMakerChannel
      I used trigonometry to calculate the H, and you used pythagoras to calculate the H.
      Sorry, I just misunderstood you, You are right! I was confident because I made a hexapod and used this equation with mg996r and it was working. now i realize that if I am right, that does not mean you are wrong I was too hasty.
      Thank you, I have learned a lot because of you.

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  5 месяцев назад +1

      Thank you, I really appreciate all your comments :)

  • @tshebeletsotjabane4979
    @tshebeletsotjabane4979 8 месяцев назад

    What about the horizontal YX kinematics?

  • @shark5651
    @shark5651 10 месяцев назад

    hi do you have a link to the 3d printed parts?

  • @mohanadebada2298
    @mohanadebada2298 9 месяцев назад

    can you create a pnuematic wall climbing hexapod ?

  • @brandonheat5262
    @brandonheat5262 Год назад

    Best explaination in the world! Could you do one video of inverse kinematics for robot dog?

  • @daleyarrow5358
    @daleyarrow5358 Год назад +2

    Well that made for some interesting bed time entertainment…my brain is now scrambled and I have a new found respect for your infinite knowledge. I hereby dub thee, a wizard.

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  Год назад

      Thank you, thank you, I’m definitely going to be applying this to a robot arm with more axes and hopefully more accuracy, so watch this space!

    • @daltongabriel-9258
      @daltongabriel-9258 Год назад +1

      I find this rather sarcastic 😂

  • @AlecThe1st
    @AlecThe1st Месяц назад +1

    what are the libraries used in the code?

  • @messerschmidtfpv4419
    @messerschmidtfpv4419 6 месяцев назад +1

    Hello, thanks for the tutorial. where can I find the STL file to print myself?

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  6 месяцев назад +1

      I will have a look back for the files and try to get them online in the next week - though it is not the best design.

  • @brandonheat5262
    @brandonheat5262 3 месяца назад

    does it matter if J1 has offset away from J2? I see there are many designs of 3 dof leg in this way.

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  3 месяца назад

      Yes it would have an effect on the XY solution, I think you would need to calculate the angle for J1 first, then using that angle and the offset to J2 calculate the X and Y value for where J2 is now located and subtract those from the X and Y used to calculate J2 and J3

  • @guilhermeconstantinov
    @guilhermeconstantinov 3 месяца назад

    should the angle really be negative? depending on the value, the J3 is negative

  • @user-mf6ij8ps2z
    @user-mf6ij8ps2z 7 месяцев назад +1

    you have to implement PID regulation algorithm

  • @bruteforce8744
    @bruteforce8744 Год назад +1

    Make a video on inverse kinematics of 3 wheel omni drive

  • @senaalfarabi4077
    @senaalfarabi4077 4 месяца назад

    I want ask something, in minute 3:25 . Are L variable is range between servo 2 and the lowest point of foot point can be?

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  4 месяца назад

      L is from servo 2 to the position of the foot, where we want to position it, there will be a range of motion that can be achieved depending on the lengths J2L and J3L. I hope this answers your question :)

    • @senaalfarabi4077
      @senaalfarabi4077 3 месяца назад

      Another question at 9:37 , where you can get y,90 and z,-60?

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  3 месяца назад

      No problem, those are physical measurements, I obtained them from the CAD model of the design with the leg in the 'resting' position that I wanted.

    • @senaalfarabi4077
      @senaalfarabi4077 2 месяца назад

      Thank you for the explaination sir

  • @Kingnauta
    @Kingnauta 7 дней назад

    What is the name given to this inverse kinematics method? I would like to research further

  • @rezageraldy-gn1jw
    @rezageraldy-gn1jw 3 месяца назад

    could i ask you sir. we kinda have problem when it comes to writing j3 and j2 arduino. we use your formula but the output show nan. we are not missing any single information for video even though it only one mistake. so pls help us this for high school project.

  • @guilhermeconstantinov
    @guilhermeconstantinov 3 месяца назад

    why were these values added?
    const double Y_Rest = 70.0;
    const double Z_Rest = -80.0;

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  3 месяца назад

      These values were added so that the movements can be made relative to a ‘resting’ position, without them it’s not as practical to plan movements from the centre of J1.

    • @guilhermeconstantinov
      @guilhermeconstantinov 3 месяца назад

      @@JustAnotherMakerChannel got it, thanks for the explanation

  • @jamesgilmour7984
    @jamesgilmour7984 Год назад +1

    could this math be used for a biped reversed knee style robot?

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  Год назад

      I think you could use it for any similar configuration, might need to re-orientate the co-ordinate system, I’ll look into it and maybe do a video

    • @jamesgilmour7984
      @jamesgilmour7984 Год назад

      @@JustAnotherMakerChannel also how much harder would the math/ coding be with 2 more servos/axis added?

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  Год назад

      Well it depends on how the axes are oriented, it could become quite a bit more complex, with some 5 and 6 DOF (degree of freedom) robot arms there can be infinite solutions for a single point in space, I am planning to to a 6 DOF robot arm in the future but I’m having to brush up on my matrices math and manipulation first!

  • @tsheringphuntsho2325
    @tsheringphuntsho2325 Год назад +1

    i would be thankful if you could share me the components parts links so that it will easier for me to print

  • @angelgomez9944
    @angelgomez9944 8 месяцев назад

    where can I get the design ?

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  5 месяцев назад

      Sorry for the delay, the files can be found here: www.thingiverse.com/thing:6463619

  • @blankblank6889
    @blankblank6889 Год назад +1

    As a high school student it is nice seeing geometry being applied 😅😅

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  Год назад +1

      I think it would be more constructive if geometry was applied/taught using examples like this, half the battle is knowing what to apply and when rather than how to do it IMO

    • @tawsifulislam5208
      @tawsifulislam5208 10 месяцев назад

      ​@@JustAnotherMakerChannelAbsolutely agree with you

  • @moon-gc2go
    @moon-gc2go 6 месяцев назад

    Theres a way to not make it jittery just add i2c bus or library in arduino

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  6 месяцев назад

      Thanks for the feedback, I do use the servo and ramp libraries but I didn't make any special effort to think about the servo slew rates or PID.
      There is definitely an element of variability between the servos that is more noticeable when trying to coordinate motion with them.

  • @panmaneecnc
    @panmaneecnc 2 месяца назад

    Thank you very much for your information and I have taken your information to study and adapted it into python for learning. If anyone is interested, you can follow and test and try it at this link. colab.research.google.com/drive/1tpKsER2IazlSDh9AVQmRVnxvxA4uU8Hm?usp=sharing

    • @JustAnotherMakerChannel
      @JustAnotherMakerChannel  2 месяца назад +1

      Thank you for the positive feedback and thank you for this contribution!

    • @panmaneecnc
      @panmaneecnc 2 месяца назад

      @@JustAnotherMakerChannel You are amazing. I will continue to share the knowledge you have given me with my friends.

  • @rezaravanbakhsh8772
    @rezaravanbakhsh8772 11 месяцев назад

    This popup sound is really annoying

  • @saveusfromidiocracy35
    @saveusfromidiocracy35 3 месяца назад +2

    Hexapod with Parkinsons 😂. Good effort. Try using better servos