Tote Robot Leg

Use smarter legs for your robot.

Similar projects worth following

Inverse kinematics is the bane of walking robot builders. That fiddly trigonometry is hard to get right, and then you also have to take care of the correct movement profile and generating the servo signals over time to execute the motion. Why not use legs that have a tiny little microcontroller built into them, which takes care of all that stuff for you?

Just attach them to your robot, connect them over I2C, and send commands telling them to what position they should move. The leg will take care of it, without you having to worry about it.

But there is more. Hardwired movement is not good enough for your robot. Give it the sense of proprioception! By attaching additional wires inside the servo, you can turn it into an encoder and a force sensor. This way your robot will always know what positions its legs are in, and what forces are acting on them. Why is this useful? Well, you can make it respond to pushes and shoves, you can detect when it's about to walk off a table, you can can make it stand up after being flipped over, etc.

  • First Assembly

    ðeshipu4 days ago 0 comments

    The PCBs arrived a while ago, but I've been busy with other projects. Today I finally took the time to assemble it:

    There isn't really much there. The Attiny24, a few pin headers, a grove connector, and the servo horns. I will probably move the grove connector on this side of the PCB, next to the servo pins — but mounted flat, soldered to SMD pads instead of holes. This way the back side of the PCB will be flat and the pins won't interfere with the servo horn. Here's an assembled leg:

    So I think that mechanically I have it pretty much where I want to have it, the next step is software — first, PWM and I²C, and then the more advanced features, if they fit (I might need to switch to Attiny44 at some point).

  • First Stab at the PCB

    ðeshipu03/16/2018 at 14:14 1 comment

    Last night I couldn't sleep, so I did what I usually do in such a situation — designed a PCB.

    From this quick and dirty attempt I already see that either I will need to make it bigger, give up on the standard servo sockets, or get really creative with edge mounting them.

    Or perhaps forget about the idea of making the PCB a mechanical part of the leg, and design it on a normal PCB that just get attached to the leg with some mounting holes.

  • Mechanics

    ðeshipu03/15/2018 at 23:34 0 comments

    I already tested the idea of using a PCB for the femur of a robot leg:

    This solves a number of problems at once:

    • The leg is more rigid than with just the servo horns.
    • The leg has predefined size and shape.
    • Cable management becomes much simpler — you only need 4 wires for all legs  instead of 15 per leg.
    • Debugging is easier, as you can test each leg separately.

    However, there are still some problems I need to find a solution for:

    • Each leg needs a different I²C address, but I have no free pins to do address selection. For now the addresses will be hardcoded in the firmware, and to change them you will need to reflash the chip.
    • I am not sure I can fit all the servo sockets on such a small PCB.
    • Even if I do fit them, the default servo cables are way too long — it might be easier to just cut them and solder the wires directly to the PCB?
    • No free pins mean there is no debug output from the chip — maybe I can have a debug mode when the analog pins are not used?

    Further research is required.

  • Pins

    ðeshipu03/15/2018 at 01:16 0 comments

    I'm going to use an attiny for this, but the usual tiny*5 doesn't have enough pins to do 3 servos, I²C and possibly also all the sensing, so I think I'm going to go with tiny*4. Here's a pinout of one of those:

    We can use 11 pins. Pins PA4 and PA6 are going to be used by I²C. The remaining 6 analog pins are needed for the sensing of the three servos, one for the pot (position) and one for the motor (force), for each. That leaves PB0, PB1 and PB2 for the servo output. PB3 is not usable without the high-voltage programmer, so I will leave it for reset.

    But wait, the PB0 and PB1 pins don't have any timers associated with them! That means I will need to generate the servo signal in software. Fortunately at 50Hz that should be doable. There is going to be some trickery to make sure it's not disturbed by the I²C communication, though.

  • Prior Art

    ðeshipu03/12/2018 at 17:19 0 comments

    This is going to be based on my work on the spider-like robots such as #Tote and #D1 Mini Tote. I will also probably re-use the code I wrote for #Mechatronic Ears' servos and for #Micro:Boy's buttons. The proprioception stuff will hopefully let me realize the goals of #Ensmarten Your Servos.

    I plan to use an ATtiny24 microcontroller, and a long thin PCB with servo mounting holes, that can double as a physical part of the leg's construction. Communication over I²C, probably with Seeedstudio's "grove" connectors.

View all 5 project logs

Enjoy this project?



Bharbour wrote 03/16/2018 at 03:10 point

There is a lot of appeal to keeping it to a single chip if possible.

I got that trick from digging around inside a few RC receivers, and it worked well with what I was trying to do with my project.

  Are you sure? yes | no

Bharbour wrote 03/16/2018 at 00:19 point

If you are willing to add another IC, the 4017 is a 1 of 10 counter that you can use for servo driving with only 2 signals, a clock and a reset. After Reset, output 0 is high and the other nine outputs are low. Each time you pulse the clock, the next output goes high and the current one goes low, up to 9 times or until you hit the reset signal. I did a servo controller for 9 servos driven from the PRU in a Beaglebone, and it worked well.

  Are you sure? yes | no

ðeshipu wrote 03/16/2018 at 01:09 point

Nice trick, but I think I will try to keep it as simple as possible for now, with a minimal parts count. I can also always switch to a bigger chip, like attiny23...

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates