Close

On the awesome state of stepper motor controllers

A project log for HaRoCo @ The DesignLab

Emotive Support Robots

richardrichard 06/09/2018 at 00:460 Comments

Stepper motors are pretty great for low speed, high precision, multi-rotation applications, but they have some serious downsides. They're heavy, expensive, and if you actually want the precision feature then you have to significantly overspec the motor so it doesn't lose steps under load.

Using steppers has also been an awkward pain in the butt. In the simplest configuration you clumsily bang MOSFETs on and off. Better setups use a stepper driver, like the much-beloved and -used TMC2130, but the interface is basic and requires constantly-outputting clumsy firmware to set the DIR pin and toggle the STEP pin to get motion. 

Enter the TMC5xxx line of stepper controllers. These do all kinds of fancy dynamic things while driving the motor, from saving power to running near-silently. The most interesting improvement is that you no longer DIR/STEP the motors... you connect via SPI and tell it a target. The target is how many steps you want it to travel, positive or negative to specify CW vs CCW. From there, it calculates and executes beautiful acceleration curves, all configurable. It also senses and adapts to the specific motor that's connected, and tracks (and I think compensates for) missed steps. No microcontroller overhead. They also have inputs for encoders and limit switches.

Now the downsides. The ICs cost about $10 apiece in single quantities, though that goes down to $5 in volume, and up to $20 for breakout boards. The configuration is deeply unpleasant, requiring 100-200 bits of registers set with no good defaults and complex, non-obvious interdependencies between the settings.

However! I'm working on a library to make these chips easier to use, and hope to release a version that works for the TMC5041, TMC5130, and TMC5160 in the next couple of months.

Discussions