■ FIGURE 4. Dynamixel interface schematic.
with 1K between the Propeller pin and the pull-up will
work, too (see the object code for the alternate
■ FIGURE 5.
After downloading the program, open a terminal
window and then press a key. You'll see a menu for setting
the baud rate for the driver — press  for 1,000,000 baud
(unless you know your actuators have been set to a
different rate). After that, the code uses a method called
scan to document any devices connected to the Propeller.
In the middle of the scan method, you'll find this loop
which uses the driver's ping method:
■ FIGURE 6.
repeat id from $00 to $FD
if (dy.ping(id) == id)
devices += 1
This code loops through all possible IDs, pings
each, and if there is a successful response it is noted
on the output. When complete, the number of
devices detected is displayed. Figure 5 shows the
result of the program running on my test setup.
Note that there is a 50 ms delay between
packets. While talking with Kyle at Trossen Robotics, I
got the impression that Dynamixels — even with their
crazy-fast default baud rate — don't want to deal with
more than about 30 packets per second. While I
cannot find any documentation to support this, the
guys at Trossen have a lot of experience with the
Dynamixels and have been incredibly helpful when
I've called. This helps explain the use of Sync Write;
while a bit fussy to set up, it allows one to update
registers in several actuators using a single packet.
While ping is useful to inventory devices
connected to a system, that's about where its utility
ends. To do useful things with the Dynamixel, we
need to read and write registers. The driver includes
low-level methods called read_data and write_data.
16 November 2013