So here's a picture of the kit Paul sent. I've already attached servo horns to some pieces.
Here's my progress so far.
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.
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.)
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!
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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?
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.
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!!!!
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.
Over on Let's Make Robots member Aniss1001 posted some information and questions about inverse kinematics. He also posted this image:
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.
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.
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.
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.
Comments
From post #4
So here's a picture of the kit Paul sent. I've already attached servo horns to some pieces.
Here's my progress so far.
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.
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.)
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.
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.
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.
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.
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.
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.
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,
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.
http://www.hitecrcd.com/support/faqs/faqs/servos/digital-servos/can-i-use-loctite-with-my-karbonite-gears.html
Paul,
Thanks for posting the updated code.
You ought to checkout Lonesock's floating point object F32.
By making this change to your code:
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.
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.
There's a contest on, for cripe's sake!
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.
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.
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.
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.
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.
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.
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.
I need to find time to continue with my hexapod.
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.
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.
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.
Don't get too excited. These are vintage HXT900 servos. Well over two years old.