# How can I detect ground collision, for an hexapod robot?

I'm planning to build a small (probably around 30 centimeters in diameter, at rest) hexapod robot, but, currently, it would only be able to walk on even ground. To improve this, I would have to, somehow, detect when each leg collides with the ground.

Ideally, I would be able to know how much weight each leg is supporting, so that I could both balance the weight and adapt to moving (up or down) terrain (so, if you put a finger below one leg and lifted it, the leg would go up); however, if that's not possible, a simple binary signal would do.

Is there a simple and compact method to do this?

• Could you try weight sensors on each foot? Commented Jan 11, 2016 at 17:07
• @Matt Do you happen to know of a specific one, or of a place where I can sea4ch for? I seem to not be able to find anything (on eBay)... Commented Jan 11, 2016 at 17:29
• If your transmission is backdrivable you can compare your expected motor torque with actual torque (as represented by motor current or motor voltage, depending on what type of motor and controller you use). Commented Jan 12, 2016 at 4:49
• @hauptmech Interesting. I'm planning to use 9g servos, so I don't think it's possible, though. Do you know of any small servo that can do that? Commented Jan 12, 2016 at 7:07
• Dynamixel servos have toque contoll, you might be able to access the current torque value and use that to detect ground contact...robotis.com/xe/dynamixel_en
– 50k4
Commented Jan 14, 2016 at 13:33

You could put a strain gage on each leg. Used in a Wheatstone bridge configuration, it outputs a voltage proportional to the force in the leg. This could accomplish everything you want, and assuming you have relatively low accuracy requirements, the circuit is an op-amp and some resistors to give an analog input to a microcontroller or ADC.

• Right, I've seen those around, but they would look very silly. I don't suppose I can, like, wrap/bend them around the leg and have them still working, right? Commented Jan 12, 2016 at 8:10
• Strain gauge foils are usually glued/taped to a part of a structure and measure the (slight) flex in that structure. So you could glue them on the side of a servo bracket for example... (just thinking out loud.) Remember to read up on the electronics required first though.
– Andy
Commented Jan 12, 2016 at 8:53
• @someonewithpc - I'm not sure what you mean when you say they look silly. I believe you can paint over them (but I would certainly ask the manufacturer to ensure the solvent doesn't damage the strain gage), and they only use two wires. If you put the gage and wiring on the under side of the leg I doubt anyone would ever see it. And, as Andy mentions, they don't have to be on the legs exactly, either; anything to which an individual leg transfers load will work either, but mounting brackets typically have odd shapes and tight tolerances, so you may find it difficult to mount there.
– Chuck
Commented Jan 12, 2016 at 12:49
• @Chuck How big are they, approximately? Commented Jan 12, 2016 at 12:59
• @someonewithpc - They vary, but the ones I've worked with before were maybe 0.5cm x 1cm (0.25in x 0.5in)
– Chuck
Commented Jan 12, 2016 at 13:07