My First Hexapod

I have built a couple of rudimentary 2-wheeled rovers before, nothing special, but I really fancied trying a hexapod.  So here it is/will be.  It will be an autonomous 2 DOF hexapod, with the primary "brain" being an Atmega 328 with Arduino bootloader, and a separate servo controller based on a pic16f74. All parts are going to be made myself, mostly to reduce cost, no Lynxmotion SES brackets or similar.

Servo Controller: 

Based upon a pic16f74 @ 20mhz, and programmed in SourceBoost BoostBasic (because it's free and I'm lazy), this was built from parts I had already.  It accepts a very rudimentary set of commands over serial, sent in a 3-byte block with a following "run" character, and a buffer for 24 characters (8 commands).  The commands consist of a start-byte (255), the servo to control (1-20) and the angle (10-170').  The "run" character is 254. It has a DIL switch for setting the baud rate or test mode, which sets all servos to 90' every 5 seconds.

It has an unregulated supply for the servos, a regulated (5V) supply for logic, or the ICSP programming headers can be used to send a 5V supply.  There is a MAX232 on board, with headers for either rs232 or TTL level signals.

Servo Controller

In my limited testing, it seems to run fine.  Originally I had a 4mhz crystal for testing (all I had at the time), but this wasn't very accurate on the timings.

[Update] spent a BIG portion of last weekend working on the code for the servo controller. Now it supports setting a duration for the move, like the SSC-32 - any servo move (bar the first), can be made to take a set period of time, in 1/10ths of a second.  Should help with some of the gait timings.

[Update - 28/02] Got the slow moves working really well now, except ran out of RAM on the pic16f74, and can only control up to 16 servos; fortunately that's enough for now. I've got some pic16F77 to try (double the RAM, but the free compiler won't accept it :( I will include the schematics and code when I'm happy with them

 

 

Servo Brackets:

I've built 6 of the 12 servo brackets that I need for the legs.  Here are the steps I used to make them:

 

Step 1: Cut 100mm of aluminium angle, 30mm x 20m. Anneal this, allow to cool, then mark the narrow side at 10mm and 50mm.

  Step 1

 

Step 2: Cut the short side out to the 50mm line, and 10mm line. The short cut end should cut into the wide side about 10mm to, to end up like:

2

 

Step 3: Bend the short end to 90 degrees. Then trim this to ~5mm. I kept it long in the first instance to aid the bending.

3 4

 

Step 4: Bend the long end at the 50mm mark, then again at 70mm.  This last bed is the tricky one, I had to get a block of steel angle trimmed to 20mm to bend around.

5 6

 

Step 5: Test the fit of your servos

7

6 of the little buggers:

8


Step 6: Mark the bottom of the bracket, directly opposite the servo horn, and drill for the pivot.  I'm using m4 screws for the pivots. 

9 10

 

The long side of the angle will need trimming by a few mm to give some clearance, I'll using strong, thick foam double-sided tape to affix the servos in place when it's all finished.

 

Legs:

So far, I've finished the prototype for one leg.  I've used 6mm Sintra(?) for the leg itself, and 20mm alu strip for the extension from the front-to-back pivot servo.  So far it seems like it should all work, although it's going to need quite a bit of clearance to lift these things.

Leg 2

 

Body:

[Update 28/02] Busy weekend.  Made the body, two sheets of 3mm Sintra cut with the scroll saw, and 50mm standoffs made from 8mm Nylon rod, drilled and tapped for m3 screws.  I've completed and painted three of the legs, and got them loosely fitted too, to test.  I think that the Hitec HS322-HD aren't going to be quite strong enough for the "knee" joints, so I think I'll go with the HS-48HB instead.  Tested a few moves via the serial connection on the PC, so far so good (video above).

 

3 legs

 

[Update 15/04] been busy working with strength issues on the servos.  The planned HS-322HDs for the knee joints have been replaced with stronger HS-485HBs, but I still had to shorten the legs to reduce the load.  He's turning out to be a bit heavier than I anticipated.  After much tweaking, prodding and playing I've come to the conclusion that a significant part of my trouble has been around the use of standard AA NiMH batteries for power; they just can't get the juice out quick enough to drive 12 servos.  I've now got a nice fat 3700mAh NiMH battery pack, rated at 30A max discharge rate.  Initial testing looks like this should make a huge difference. 

I've also added springs to the legs pulling inwards, which reduces the effort for the servos to keep the 'bot standing, although it does increase the effort to lift the legs.  A bit like these: http://bit.ly/ddzlgz . This should help reduce the standing load on the servos.

[Update 24/04] it's alive! (video above) still a few issues with the servo controller but it's getting better. I'm waiting on a delivery of some 220ohm resistors to hopefully help there.  The control is a ridiculously basic VBScript program, but it gets things moving. There's still a lot of work to do on the gait however.

I'm also thinking of simplifying the leg arrangement, and making the femur (?) shorter and single-sided only to reduce forces and weight; hopefully the standard servo horns have enough strength to support the full weight without upgrading to metal horns. Below is a close-up of the spring-loaded legs.

 

Spring loaded

Hopefully wander around and avoid obstacles

  • Actuators / output devices: 12 (2-DOF) Hitec HS322-HD servos
  • Control method: autonomous
  • CPU: Arduino 328 (primary), pic16f74 (servo controller)
  • Operating system: Arduino
  • Power source: unknown
  • Sensors / input devices: SRF05
  • Target environment: indoor, outdoor

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/my-first-hexapod

Nice
Very neat work and design! The pivots on the servo brackets (opposite the output shaft) should give solid legs. And a DIY servo controller, sweet.

thanks. I’m thinking I might
thanks. I’m thinking I might need to augment the legs with springs, pulling inwards, to help take some of the load off the servos. it depends on the final weigt of the 'bot I guess.

super cool.

ive always wanted to make a Hexapod, because they look so damn cool. unfortunatly though i know that hexapods = moneys, how much did the servos that ur using cost? in thinking of making a mini hexapod with microservos but im not sure they will be strong enough.

oh and by the way those legs look slammin’ :slight_smile:

cost

I’m trying to keep the cost as low as possible. I’ve managed to source these servos for £6.50, I just hope they’re strong enough. The “ideal” servo looks to be the Hitec HS-645MG, which is £25+; There’s no way I can sneak that past the wife :slight_smile: I’d have loved to do a 3 DoF, with 18 servos, but 2 DoF was another way to keep the cost low.

As for everything else, so far I’ve spent about £40 on aluminium and plastic, and I don’t imagine I’ll need too much more. I’m hoping to keep this below £150. Although I suspect I will expand it further later on, adding sensors or upgrading servos as needed.

 

 

If you add springs to help

If you add springs to help pull the legs in, won’t the servos just have to fight the springs to move the legs out?

I wasn’t thinking
I wasn’t thinking particularly strong springs, just something to help combat the outward pull from any potential weight. Overcoming the strength of the springs would be less than overcoming the pull from the weight of the body, particularly with the leverage of the long legs.

beautiful design
beautiful design

thanks
wish I could take credit for it all, but it’s the result of much plagiarism :slight_smile:

Very Nice!

Awesome hexapod so far! Can’t wait to see it with a full complement of legs and moves. Very nice step by step photos too.

Great work; awesome bot overall - keep the updates coming!

 

Very creative the way you

Very creative the way you build the brackets for the servos ! great job.

thanks

Thanks. took a while to get the hang of building them.  The tolerances aren’t quite up to the spec of the lynxmotion SES brackets :stuck_out_tongue: but they seem to be doing the job.  The whole thing has ended up a bit heavier than anticipated though, so I might have to look at doing something lighter-weight when I’ve got the movement sussed.

thanks

I’ll do my best. I’m having some major issues with the servo control at the moment, which I think all come back to my homemade controller.  It seems to be suffering from a brownout with load on some of the pins, which seems odd to me as the pic itself shouldn’t be doing much; theres a separate power supply for the servos themselves.

Once I’ve got to the bottom of this, and if my controller starts to behave, I will post up the full details (schematic and horrible code).

I’m not sure if you’ll need

I’m not sure if you’ll need springs. I built a 3DOF hexapod using HXT900 servos, and the problem isn’t the strength of the servos so much as the rigidity of the legs, especially if you design the legs carefully. Having a pivot on the coxa servo will make all the difference. You should try to have the femur servo, tibia servo and foot vertically aligned. Then the load is taken by the leg parts rather than the servo motors. 

Like this:

                     0

                    |  |

          0--------0  |  

                        |

                        0

 Rather than:

    0 0 ---------------------0

                               |

                               | 

                               0

Hi. I’m not sure I’m

Hi. I’m not sure I’m following.  I’m building a 2DOF hex, if that makes any difference.  At some point one of the servos has to be pressing down for each leg, and it’s that action I’m trying to assist with the spring.  In my case the femur (I think) is fixed vertically and the tibia rotates up and down.

Wide legs

What he tries to say, I think, is that the reason why your servo’s are fighting to keep the legs in place is because your legs are mounted very wide. I’ll explain with the next picture which I’ve just drawn in paint, so sorry for the quality :smiley:

PODLEGSFORCE.png

In the picture above, everything starts with the mass of your robot, this mass multiplied by the earths gravition gives you the amount of force that your pod puts on the floor. This gravitational force is divided between the legs and in the picture above this force is shown by the vector Fz. This force is divided over the two parts of the leg: vectors F1 and F2. These two forces are pushing the legs sidewards (F3 and F4) as well as downwards (pink vector without a name).

The force we are interested in is the force that pushes your two pieces of leg away from eachother (and thus make the servo fight to keep it's position) or in other words: F3 and F4. The bigger these are, the more force has to be applied by the servo's to keep te legs in the right position.

When you mount your legs less wide (or more vertical), F3 and F4 will become smaller (I hope you can see that, otherwise I'll make a new drawing).

Hope this helps.

 

PS: if you add a spring the servo would still be fighting, but now in the opposite direction ;)

WRONG ABOUT THE SPRINGS

Sorry, after thinkikng it through again, the springs would probably help a bit to keep the legs from being pushed sideways, but what you must consider with them is that they will make your servo fight to extend the legs… unless the springs are very weak, and not enough to keep the legs from sliding outwards on there own

light-bulb moment

Thanks, that really helps to clear things up.  I think I can do something there.  I was never really happy with the legs anyway, think they look good but don’t work as well as I’d hoped.

I think I will concentrate on getting him to move as-is first, which he is somewhat managing, and then have a look at optimising the leg design.

weak springs

The springs I’ve got are pretty weak, but they do seem to help. Hopefully I should be able to get some video of staggering this weekend.

Looking forward

I,m ansolutely looking forward to seeing this beast doing some real work :slight_smile: