I decided to use some Dynamixel AX-12A motors for a project, and ended up having to code a library for them, so I figured I would share what I learned.
Despite being a bit more expensive, this motor has a couple of advantages over the more commonly found TowerPro motors.
Mainly, the Dynamixel motors are stronger, daisy-chainable, and have a robust control system with feedback that reports position, temperature, torque, etc.
Step 1: Manuals
There are two different manuals for the AX-12A motors online. This manual from 2006 is a little outdated: some of the spec values are outdated (operating voltage range, for example), and some of the initial values reported in the Control Table are not correct, but it goes into detail about how to send instructions to the motor and how to read its response.
This other manual has more accurate values for specs and initial conditions, but lacks some of the detailing of the communication protocol.
It was useful to have both of them.
Step 2: Other Resources
These were invaluable while learning about these motors:
- An Arduino library and tutorial
- Controlling Dynamixels with a Raspberry Pi
- Jesse Merritt’s Python library
Step 3: The Joy of UART Communication
Unlike other servos, the Dynamixel doesn’t respond to PWM signals, but a slightly more complicated protocol of instructions for reading and writing onto its memory. This communication happens over a half-duplex UART port, using only one wire for both sending and receiving.
What this means is that we need to build a small circuit that converts full-duplex into half-duplex, if we want to use a Raspberry Pi or an Arduino (or another microcontroller with a full-duplex serial interface) to control these motors.
For more detail: How to drive Dynamixel AX-12A servos (with a RaspberryPi)
Current Project / Post can also be found using:
- Controlling an AX-12 Dynamixel Servo with c on a Raspberry Pi
- dynamixel raspi library ax12