Shop OBEX P1 Docs P2 Docs Learn Events
Hexapod Build Log — Parallax Forums

Hexapod Build Log

Duane DegnDuane Degn Posts: 10,588
edited 2014-09-25 23:51 in Robotics
Hexapod Build Log

Reserved for best video so far.

[No videos yet.]
«1

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-09 12:00
    Reserved for best picture so far.

    From post #4

    attachment.php?attachmentid=90418&d=1331321825
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-09 12:00
    Reserved for other stuff.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-09 12:01
    Reserved for first build log.

    So here's a picture of the kit Paul sent. I've already attached servo horns to some pieces.

    attachment.php?attachmentid=90417&d=1331321808

    Here's my progress so far.

    attachment.php?attachmentid=90418&d=1331321825

    I used a sharp tipped soldering iron to melt holes in the pastic servo arms. The soldering tip was too sharp to solder with but it's great for melting holes.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2022-01-14 18:04
    Some historical background.

    A while back I saw this post by Paul K.. I watch his amazing YouTube video which got me thinking about what it would take to control a robot like that.

    A while later I learned about the inexpensive servos available from HobbyKing. After trying some of their inexpensive HKT900 I found they worked pretty well so I ordered more and started trying to make a hexapod.

    I didn't want to spend a lot of money on the hexapod so I tried to make it out of popsicle sticks. As I feared the legs were much to long for the servos to support the hexapod's body. I was able to get some video of the popsicle stick bot walking with a tether and with a very high stance which reduced the torque on the servos.

    I ended my last video say that the robot would need some major redesigning before it would walk again. This where Paul comes back into the story. He sends be a private message saying he thinks my hexapod was cool and did I want a PCB of a board he had made but decided not to sell. Of course I agreed to getting free stuff.

    Not only does he send me a two bare PCBs with all the parts expect a Propeller chip (which I buy 50 at a time now so they don't cost me much anyway) but he also sends a populated board. An this is just the beginning. He also sent a hexapod set!

    I'm assuming Paul plans to start selling these sets and wanted to get a couple of people to test them out. How cool is that?, I'm a robot tester now! (The answer is WHY COOL to that last question.)
  • ercoerco Posts: 20,244
    edited 2012-03-09 13:01
    XLNT thread. I ordered a kit knowing it will sit on my shelf for a while (no time!) but I will build vicariously through this thread. Paul's video is very impressive!
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-09 13:01
    You can't beat free stuff! Should be neat to watch this take shape.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-10 09:41
    Today is our pack's Pinewood Derby race (I'm the cubmaster). No time for a big update.

    I attached servos to the long leg pieces yesterday. Paul mentioned he made this kit initially for HighTec servos (IIRC). The HXT900 servos I'm using are a different size. The 2-56 hardware he includes works but it can be a tight fit in places. The 2-56 bolts splay the servo mount out by 0.12mm, slightly stressing the plastic.

    I have some 2M nuts and bolts and tried it with the leg hardware. I thought the 2M hardware was easier to install (I didn't have to force the bolt through) and it didn't stress the plastic. I'll likely order enough of SCMS2008 from this page to use instead of 2-56 hardware. The long leg pieces will require two bags of these parts. I normally don't like to mix non-metric parts with metric parts but in this case the metric parts work significantly better.

    Another concern I have is the instruction to use 2-56 hardware to secure servo horns to the servo.

    The servos come with small self tapping screws. When I was making the popsicle stick bot, I avoided using these screws very frquently. I only screwed them in once I was confident the servo horn wouldn't need to be repositioned. I was afraid if I used the screws too many times, it would strip out the threads in the servo.

    The threads on the small screw are very different from the threads on 2-56 hardware. I'm concerned that once the hole has a new set of threads cut into it, the servo wont be able to use the original screw again. I'm also concerned the 2-56 threads wont hold as well as the original threads since it will be the second set of threads cut into the same hole.

    I'll likely wait a bit before making a final decision about what screw to use to secure the servo horn. For now, I'll use the original screw.

    If Paul makes a kit for the larger HX12K servos, this wont be a problem since the servo horn is held in place with a 3M screw.

    I'll likely add pictures of my progress when I've recovered from the Pinewood Derby.
  • Paul K.Paul K. Posts: 150
    edited 2012-03-10 11:01
    Duane since you threaded the servos with the self tapping screw then stick with that type of screw. Get longer ones if need be.
    I screwed the self tapping one in then tried to go with the 2-56 and it will strip that out. That servo is now useless except for extra parts. They do sell replacement gears but they cost the same as a new servo.

    It really doesn't matter which one you use but don't over tighten them or you will blow out the threads. Snug is good and if they become loose over time just tweak them snug again.

    I don't plan on making this exact kit but a newer design is something I'd like to do in the next few months.

    I posted some finished pics and one of the new body designs. Just a little bigger but cooler looking.
    Just prototyping some ideas at the moment.
    745 x 823 - 68K
    628 x 583 - 79K
    900 x 675 - 142K
    900 x 675 - 120K
    900 x 675 - 109K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-10 12:02
    Paul K. wrote: »
    Duane since you threaded the servos with the self tapping screw then stick with that type of screw.

    I just realized the servos don't come with a servo horn attached. I had forgotten I was the one to first put the screw into the servo. I found an unused servo just to check, and sure enough no servo horn and no threads cut into the servo.

    I'm going to order some new HXT900 servos and use them with the 2-56 hardware. I figure the stuff you gave me is worth much more than what I'd spend in getting new servos. I'll save these other servos for a remake of the popsicle stick robot. I still want to see if I could get that to work.
    Paul K. wrote: »
    I posted some finished pics and one of the new body designs. Just a little bigger but cooler looking.
    Just prototyping some ideas at the moment.

    Those are very nice looking bots. I still shocked you gave me so much cool stuff.

    Thanks for posting those pictures. It really helps be so see how the parts are used and fit together.

    It also made me realize I had put the servos in upside down inside the long leg piece (I had the servo horn connect farther away from the foot). I'm glad I hadn't taken and posted pictures. (Don't tell anyone, it's kind of embarassing.) I did remember to make three right and three left versions.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-14 14:11
    @Paul,

    What kind of Loctite do you use on the hip pivots (red or blue)?

    It turn out the screws that come with the HXT900 to mount the servo have the same thread pitch as the self threading servo horn screws. It was nice to have some longer screws to use with this.

    Is IK Engine V3.1 the latest software? I've noticed a few places I think I could speed it up a little (I think a couple calls to FP methods could be avoided by changing order of some calculations) but I didn't want to start modifing it if you have a newer version.
  • Paul K.Paul K. Posts: 150
    edited 2012-03-14 17:16
    I use blue as I believe the red is stronger and I never tried it for that reason. Plus, not sure how good the washer will hold up to the Red type.

    As for the changes your right. I Have a V3.4 which I have slimmed the code down, added xbee, and got rid of unused Var/Con and reworked a few things. I've trimmed down some 400 longs of the code.
    I also started a cog to run the input portion of the code for XBee or PS2. Since you looked over the the code, next thing I'm trying to see what can be done with the Tang PRI at the end of the code.
    I think the IK solution can be reworked but left that to the end since I know they work at the moment.

    With the FP methods I don't think to much can be done with them. Its something I want to look into as well.

    There are some changes because of the xbee portion. I'll remake it for PS2 too.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-14 18:26
    Paul K. wrote: »
    I use blue as I believe the red is stronger and I never tried it for that reason. Plus, not sure how good the washer will hold up to the Red type.

    As for the changes your right. I Have a V3.5 which I have slimmed the code down, added xbee, and got rid of unused Var/Con and reworked a few things. I've trimmed down some 400 longs of the code.
    I also started a cog to run the input portion of the code for XBee or PS2. Since you looked over the the code, next thing I'm trying to see what can be done with the Tang PRI at the end of the code.
    I think the IK solution can be reworked but left that to the end since I know they work at the moment.

    With the FP methods I don't think to much can be done with them. Its something I want to look into as well.

    I will replace the old version with the new one in a few hours.

    Thanks for the update Paul.

    I think your XBee code will be easier for me to convert to use with the Nordic nRF24L01+ modules I like, than using the code that reads directly from the PlayStation 2 controller.

    Have you made the switch to using Lonesock's F32 instead of the other floating point objects? (Don't answer that, I can wait a few hours.)

    I figure I'll make comments and ask questions that are about your program in general in the other thread. I'll try to keep specific questions about this kit in this thread.

    This hexapod has been a lot of fun so far. I hope to have time to take and post some newer pictures soon.

    Thanks again,
  • photomankcphotomankc Posts: 943
    edited 2012-03-15 06:58
    Paul K. wrote: »
    I use blue as I believe the red is stronger and I never tried it for that reason. Plus, not sure how good the washer will hold up to the Red type.

    Red is 'permanent' on a screw that small it would be next to impossible to remove it. I have the bearing journal on my CNC mill threaded into the Y axis table ballscrew since it was easier to do that than machine the ball-screw material which is case-hardened. Used red to lock that in place so it can't screw back out when the motor running the table reverses. I could not reasonably break that bond after 24 hours with a vice and channel locks so I figured it was plenty strong enough. On small stuff im sure you'd strip the fastener long before you could break the bond.
  • ercoerco Posts: 20,244
    edited 2012-03-15 10:28
    I'm probably preaching to the choir, but don't use loctite on servo horn screws going into nylon or karbonite splined output shafts:

    http://www.hitecrcd.com/support/faqs/faqs/servos/digital-servos/can-i-use-loctite-with-my-karbonite-gears.html
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-15 20:19
    Paul K. wrote: »
    I Have a V3.4 which I have slimmed the code down, added xbee, and got rid of unused Var/Con and reworked a few things. I've trimmed down some 400 longs of the code.

    Paul,

    Thanks for posting the updated code.

    You ought to checkout Lonesock's floating point object F32.

    By making this change to your code:
    OBJ
       SERVO : "Servo32v7"
       F     : "F32" '"Float32full"
       XB    : "XBee_Object_2"
       MM2125        : "Memsic2125_v1.2"            
    '---------------------------------------------------------------------
    

    It frees up 438 longs and one cog. Not too bad.

    F32 is also faster than the previous floating point objects. I don't know if the OBEX has been updated with the most recent bug fix or not so I'm attaching it here.

    I think F32 ought to be part of the normal Prop Tool library.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-11 01:39
    I finally got around to finishing this hexapod. I think I've had the hexapod finished for over a week.

    I decided to write the inverse kinematic algorithms from scratch (mainly to see if I could). I'm far from done with the software. It can kind of travel in an arc and it can move sideways but not well. I'm planning on writing code to let it rotate and travel in any direction.

    Right now the three servos attached to the body on each side are parallel with each other. I'm planning on turning the corner servos so they are turned 60 degrees from their current position. I think if I turn the servos away from each other the hexapod would be able to use longer strides without having the legs hit each other.

    I've miss placed my usual camera so I used my "HD Wing Camera 1280x720p 30fps 5MP CMOS" from HobbyKing.

    The camera doesn't have much of a mic so I didn't attempt to narrate the video.

    [video=youtube_share;g0sDRiz-CPg]

    For now the only control is from a serial connection with a PC. I'm using a Wixel in order to communicate with and program the robot wirelessly.

    The robot only walks forward in the video.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-12-11 06:04
    Looking good. After writing inverse kinematics for a single limb (an arm), I can't imagine the complexity requires for six limbs.
  • ercoerco Posts: 20,244
    edited 2012-12-11 11:10
    Sweet, now throw a Santa hat and some flashing LEDs on that bad boy to Hack the Halls.

    There's a contest on, for cripe's sake! :)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-20 10:48
    Here's the latest video. (It's the same one I posted in erco's figure 8 thread.)

    The three legs on each side of the body were all parallel with each other. I'm attempting to have each leg set 60 degrees from each other as these pictures show.

    attachment.php?attachmentid=98092&d=1356027992

    Hexapod121220b.jpg


    When I had the robot try a figure 8 with the updated positions, it just danced in place (it managed to peal one of the sticky notes up). The above figure 8 gave me hope I had done the IK calculations correctly (I'm using my own algorithm), but I'm obviously doing something wrong with my effort to have the legs spaced apart from each other.

    I realized I hadn't uploaded any photos of the (semi) completed bot so I took the above photos. I still need to add some sort of remote control (and get the legs to move correctly).

    Once I'm satisfied with my IK algorithm, I'll compare (the clock cycles to compute positions) with other algorithms available to see how well I did.

    As I mentioned in the F32 thread, F32 has a problem with its ATan2 method. I posted a patched version in the thread.
    582 x 513 - 136K
    540 x 537 - 130K
  • Paul K.Paul K. Posts: 150
    edited 2012-12-20 21:24
    Really nice work Duane.

    Your IK program looks great. I don't think their is a problem in the IK program itself, include a home/end position in your program. I had to do the same thing.

    It simply shuffles the legs into a final position after moving the bot around.

    Paul

    *Edit*
    After I posted I realized what you meant by the legs not being at the right angles. Your equation is off a little, I'm guessing you need to tweak the start points of each of the corner legs on the hex. Another issue might/could be that each leg should have its own set of equations for figuring out the IK solution.
    Have you tried rotating the body?

    Can you post your code?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-21 01:01
    Paul K. wrote: »
    Really nice work Duane.

    Your IK program looks great. I don't think their is a problem in the IK program itself, include a home/end position in your program. I had to do the same thing.

    It simply shuffles the legs into a final position after moving the bot around.

    Paul

    *Edit*
    After I posted I realized what you meant by the legs not being at the right angles. Your equation is off a little, I'm guessing you need to tweak the start points of each of the corner legs on the hex. Another issue might/could be that each leg should have its own set of equations for figuring out the IK solution.
    Have you tried rotating the body?

    Can you post your code?

    Paul,

    Looking back at post #20, I see I wasn't very clear in what I was describing. Post #20 shows the robot in two different configurations. The video shows a leg configuration where the default (or home) positions have the legs on one side all parallel with each other. The photographs show an alternative configuration where each leg is points 60 degrees from its neighboring legs. I didn't make a video of the robot "dancing" in place.

    In the coordinate system I'm using, straight ahead for the robot is 90 degrees (the positive Y axis). Zero degrees is to the robot's right. The hexapod's right middle leg makes a zero degree angle with this coordinate system when the servo is centered. The front right leg is at 60 degrees when centered. The front left leg is at 120 degrees when centered. The angle of the other legs increase by 60 degrees with each position counter clockwise from the previous leg. These positions describe the way the hexapod is configured in the still photographs in post #20.

    The configuration used in the video of post #20 has the default position of all three legs on the right set to zero degrees. The default position of the legs on the left (of the configuration shown in the video) is 180 degrees.

    The servo positions of each of the six legs are calculated independently. These calculations include a parameter for the leg's default angle. The equations appear to give the correct positions when the default angles are zero or 180 degrees, but default angles of 60, 120, 240 and 300 produce errors in the servo positions.

    As I mentioned previously, I'm trying to come up with my own IK equations. I'm not ready to ask for help yet; I want to see if I can figure out this IK stuff on my own. I was planning on posting the software once I am satisfied I have the IK calculations working correctly. I'm very willing to post the code before it's bug free and before I've cleaned it up if you or anyone else is interested in seeing it. As the code is now, I don't think it would be useful to anyone.

    Again, I'm very willing to post the current code and I'll do so if someone requests it. Just don't tell me what I'm doing wrong until I say "uncle".

    I agree that adding a "home" position would be a good idea. I'm relatively confident I can figure out how to do this. I also plan to write code to have the robot turn in place. I have programmed in the ability to have the robot walk in an arc but I doubt this feature works with the legs in their current configuration.

    I also want to add a lot of the cool moves I've seen your robots perform like twisting, tilting, raising and lowering. We'll see how far I get before I give in and use the program you posted.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-01-22 17:16
    Does anyone have drawings of the parts needed for the Hexapod? I would like to have a go at it but want to see if I can make the parts myself. No, I do not have a mill but I have a bandsaw, grinder and dremel!!!!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2022-01-14 18:05
    NWCCTV wrote: »
    Does anyone have drawings of the parts needed for the Hexapod? I would like to have a go at it but want to see if I can make the parts myself. No, I do not have a mill but I have a bandsaw, grinder and dremel!!!!

    I'm pretty sure Paul is thinking of making more of these. I've been trying to think of ways he could improve it (at his request) but I've been having a hard time finding any problems.

    If you can talk Paul into selling you a kit, I'd suggest going that route.

    While I really like Paul's kit, I do think building a hexapod on your own is possible. My first attempt at building my own hexapod wasn't very successful, but I think the popsicle stick method would work if one either used shorter sticks for each leg segment or if one used more powerful servos.

    I'm seriously considering building another popsicle stick hexapod with HobbyKing's metal geared servos.

    Edit(4/19/20): Fix servo link.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-16 09:41
    Over on Let's Make Robots member Aniss1001 posted some information and questions about inverse kinematics. He also posted this image:
    inverse2.jpg
    The diagram is from page 13 of a paper Quadrupedal Walking Robots. As the title suggests, the book is about quadruped robots but of course the IK section also applies to hexapods.

    Paul K. has already posted code for controlling a hexapod which works great but I wanted to write my own IK hexapod code. I had originally wanted to derive the IK section myself but my attempts to use my IK equations with legs 60 degrees about from each other didn't work well. I finally decided to cheat and use the equations from the quadruped book. These are the equations which go with the above diagram.

    inverse3.jpg

    The only change I made to the above equations was to invert the x and y in the "gamma" calculation. I wanted a zero degree angle to be aligned with the x-axis instead of the y-axis.

    The above equations take a shortcut by using h0 instead of Z. If the robot is tilted, an additional transformation between h0 and Z will be required.

    Here's my interpretation of the above equations in Spin.
    PUB ComputeAngles(legIndex) | localComp, fNumerator, fDenominator, fXSquared, fYSquared, {
    } fH0Squared, fXYDistance, fXYDistanceMinusCoxa, fGamma, fA0, fA1, {
    } fBeta, fXYDistMinusCoxaSquared, servoIndex, {
    } adjustedGamma, adjustedAlpha, adjustedBeta ' these three need to stay in order
    
    
      fXSquared := F32.FMul(fTargetX[legIndex], fTargetX[legIndex])
      fYSquared := F32.FMul(fTargetY[legIndex], fTargetY[legIndex])
      fH0Squared := F32.FMul(fTargetZ[legIndex], fTargetZ[legIndex])  ' not correct if tilted
      h0[legIndex] := F32.FNeg(fTargetZ[legIndex])
      fXYDistance := ComputeDistance2DFromSquares(fXSquared, fYSquared)
      fXYDistanceMinusCoxa := F32.FSub(fXYDistance, Header#F_COXA)
      fXYDistMinusCoxaSquared := F32.FMul(fXYDistanceMinusCoxa, fXYDistanceMinusCoxa) 
    
    
      fGamma := F32.Atan2(fTargetY[legIndex], fTargetX[legIndex]) 
      fA0 := F32.Atan2(fXYDistanceMinusCoxa, h0[legIndex]) ' not correct if tilted 
      fNumerator := F32.FSub(F32.FAdd(F32.FAdd(Header#F_FEMUR_SQUARED, fXYDistMinusCoxaSquared), fH0Squared), Header#F_TIBIA_SQUARED)
      fDenominator := F32.Fmul(Header#F_TWO_FEMUR, F32.FSqr(F32.FAdd(fXYDistMinusCoxaSquared, fH0Squared))) 
      fA1 := F32.Acos(F32.Fdiv(fNumerator, fDenominator))
      fNumerator := F32.FSub(F32.FSub(Header#F_SUM_SQUARES_FEMUR_TIBIA  , fH0Squared), fXYDistMinusCoxaSquared)
      fBeta := F32.Acos(F32.FDiv(fNumerator, Header#F_TWO_FEMUR_TIBIA))
    
    
      
      adjustedGamma := AngleToPulse(fGamma)
      adjustedAlpha := AngleToPulse(F32.FAdd(fA0, fA1))
      adjustedAlpha -= Header#US_PER_QUARTER_TAU
      adjustedBeta := AngleToPulse(fBeta)
      adjustedBeta -= Header#US_PER_QUARTER_TAU
    
    
      servoIndex := legIndex * 3
      repeat 3
        servoPosition[servoIndex] := centerPosition[servoIndex] + (directionNew[servoIndex] * adjustedGamma[result++])
        servoIndex++
    
    PUB AngleToPulse(fAngle)                       
    '' Return integer pulse length based on floating point angle (in radians).
    
    
      result := F32.FRound(F32.FMul(fAngle, Header#F_US_PER_RADIAN)) 
       
    

    As I mention in a couple of comments, the above code assumes the robot is level.

    To test the code I wrote a simple walking algorithm which computes each leg's xyz coordinates as it walks in a straight line. I made the stride as long as I could without having the legs hit into each other. This turned out to be 80mm. In my earlier figure 8 video, I'm pretty sure the stride was 40mm. Here's the video.

    I think the robot would do better with a shorter stride and probably a higher stance.

    It's fun to have the little hexapod up and moving again. Hopefully I'll have it doing something a little more interesting in the near future.
  • ercoerco Posts: 20,244
    edited 2014-09-16 10:39
    Amazing bot, Duane!
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-09-16 10:46
    Cool bot Duane!

    I need to find time to continue with my hexapod.
  • PublisonPublison Posts: 12,366
    edited 2014-09-16 10:48
    Nice work Duane! I can't even spell I K, let alone understand it. :)
  • ercoerco Posts: 20,244
    edited 2014-09-16 11:03
    Those are all HXT900 servos, Duane? If so, Hobby King stock is on the rise!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-16 11:28
    erco wrote: »
    Amazing bot, Duane!


    Thanks erco. Just to be clear, this is the same hexapod Paul K. gave me two and a half years ago. I'm just getting back to programming it again.

    Cool bot Duane!

    I need to find time to continue with my hexapod.


    Thanks Bill. I'm pretty sure your hexapod adventures put the bug back into me.

    I purchased one of the larger hexapod sets. I've just barely started working on it.

    Publison wrote: »
    Nice work Duane! I can't even spell I K, let alone understand it. :)


    Thanks, but I feel like I'm cheating by using equations from a book. I also cheat by (usually) letting Chrome fix my spelling of inverse kinimatics. See, it's telling me I got it wrong again. There's supposed to be an "e" in there somewhere.

    erco wrote: »
    Those are all HXT900 servos, Duane? If so, Hobby King stock is on the rise!

    Don't get too excited. These are vintage HXT900 servos. Well over two years old.
  • DiverBobDiverBob Posts: 1,090
    edited 2014-09-16 16:47
    Good job! Nice to see it walking
Sign In or Register to comment.