Driver
DYNAMIXEL Driver¶
A C++20 bus-master driver for ROBOTIS DYNAMIXEL servos. It speaks protocol 1.0 and 2.0 over a half-duplex UART, finds the servos, reads and writes their control tables by name, and runs Sync, Bulk and Fast reads, on any MCU.
The driver has no platform code. You give it a small class that moves bytes on your UART; it does the rest: packet framing and byte stuffing, CRC-16 and checksums, finding the reply in the received bytes, retries, the per-register decoding of 9 families of servos and the per-servo outcome of a Sync or Fast read.
- Function
- Servo with a control table of registers; position, velocity, current and PWM control
- Interface
- Half-duplex TTL or RS-485 UART, 8N1, 9 600 to 4.5 Mbit/s; one line shared by every servo
- Protocols
- 2.0 (CRC-16, byte stuffing) and 1.0 (checksum); one per bus
- Instructions
- Ping, Read, Write, Reg Write, Action, Reboot, Factory Reset, Clear, Backup, Sync, Bulk and the Fast reads
- Catalogue
- 47 model numbers in 9 control-table families: AX, RX, DX, MX (1.0 and 2.0), XL-320, XL330, XL430, XM, XH, XD, XW
What you get¶
- One object per bus.
DYNAMIXEL<YourPort>takes a reference to your port and does no I/O untilEnsureInitialized(). See API guide. - Errors you can act on. Every call returns
Result<T>with anErrorsuch asTimeout,LineFault,EchoMismatchorDeviceError, and the raw reply is kept for inspection. See API guide. - Typed registers.
ReadRegister(),WriteRegister()andReadFeedback()use one name per register for every family, with decoding, range checks and units. See Control tables. - One outcome per servo. A Sync, Bulk or Fast read fills a
DeviceReplyper ID: a truncated or corrupted packet still delivers the servos whose part arrived whole. - A safe stop.
DisableTorque()is never refused: not before the bus is initialised, not when the input flush fails. - Zero-overhead portability. The port is a CRTP class checked by a concept: five hooks, plus optional baud and logging hooks found at compile time. See Porting.
- No heap, no exceptions, no RTTI. The host tests build with
-fno-exceptions -fno-rtti. See Contract.
Where to start¶
| You want to | Read |
|---|---|
| Move a servo from your PC or MCU in a few minutes | Quickstart |
| Wire the bus and set the direction control | Hardware |
| Write the UART port for your platform | Porting |
| Know the packets and the reply search | Protocol |
| Know the registers of your servo | Control tables |
| Read, write and read many servos at once | API guide |
| Find out why nothing answers | Troubleshooting |
| See what is tested, fuzzed and mutated | Testing and CI |
Status¶
Version 0.1.0. The behaviour is checked against a model of the bus that is written separately from the driver, by unit tests, fuzzing and mutation testing (Testing and CI). It has not been run against a servo yet. Four points the e-Manual does not specify are listed in the Contract.
| Document | Revision | Get it |
|---|---|---|
| Protocol specification: DYNAMIXEL Protocol 2.0 (e-Manual) (ROBOTIS e-Manual, DYNAMIXEL Protocol 2.0) | web page, no revision mark, 2026-11-12 | vendor page |
| Protocol specification: DYNAMIXEL Protocol 1.0 (e-Manual) (ROBOTIS e-Manual, DYNAMIXEL Protocol 1.0) | web page, no revision mark, 2026-11-12 | vendor page |
| Protocol specification: CRC Calculation (e-Manual) (ROBOTIS e-Manual, CRC Calculation) | web page, no revision mark, 2026-11-12 | vendor page |
| Servo manual: XM430-W350 (e-Manual): the X series reference (ROBOTIS e-Manual, XM430-W350) | web page, no revision mark, 2026-11-12 | vendor page |
| Servo manual: AX-12A (e-Manual): the protocol 1.0 reference (ROBOTIS e-Manual, AX-12A) | web page, no revision mark, 2026-11-12 | vendor page |
| Servo manual: XL-320 (e-Manual) (ROBOTIS e-Manual, XL-320) | web page, no revision mark, 2026-11-12 | vendor page |
Written against these revisions; the SHA-256 of each file is in docs/datasheets.yml. Where each part
of the driver is in the datasheet: Datasheet map.