FIGURE 5. Devices that are attached to
the I2C communications bus (dotted lines
represent devices that are
not currently installed).
was repurposed from a newer incarnation of
Pooh Bear Bot. The Dynamixel AX- 12+ servos
have position, temperature, voltage control,
and feedback, and are used for arms and
pan/tilt functionality. A LIDAR was removed
from a used Neato that was purchased on
eBay. Our RoboMagellan robot was
controlled by an OLPC XO-1 which
performed poorly when task switching and
experienced high latency when accessing USB devices.
Learning from our mistakes, PR Lite is equipped with an i7
quad-core processor and other spare computer parts to
make our high-end “Frankenstein computer.”
PR Lite is designed to offload all timing-critical functions
such as PID speed control loops, linear actuator controllers,
and the emergency stop capability onto microcontrollers
rather than using the Linux kernel real time capabilities like
PR2. All our microcontrollers use the ATmega328p because
it is sufficiently powerful, used in the Arduino, and has
hardware support for I²C. The TQFP surface-mount version
is used because we intend to manufacture custom PCBs.
Cheap TQFP breakout boards are used for prototyping.
To interconnect the microcontrollers and the PR Lite
computer, we chose I²C. However, instead of using I²C in
the traditional device and register protocol, it is used to
transmit packets of data like UDP. Because the I²C repeated
start condition effectively allows a node to hold the bus —
forcing other nodes to wait — support for request-response
packets is also added.
We utilize the wire-OR nature of I²C to construct a low
latency multi-master bus. All the microcontrollers can
transmit broadcast or unicast packets onto the bus at any
time. The wire-OR allows collision detection, and packets
are re-transmitted. The bus runs at 400 kHz.
Each packet has a checksum. If the checksum is wrong,
the receiver will discard the packet. The transmitter should
then re-transmit the packet, but this has not yet been
implemented. The theoretical latency of this bus is in the
range of milliseconds which was considered low enough.
I²C operates at the TTL level and is susceptible to noise.
We place all the microcontrollers close together with short
wires to reduce the noise interference. We use modified
USB cables which are shielded for this purpose. We
modified a USB hub to be our I²C bus hub by removing the
USB hub IC from it and soldering wires to form an I²C bus
inside the USB hub chassis. The noise interference is low
with this construction but the USB hub IC is surprisingly
fragile and unreliable.
To connect the i7 central computer to the
microcontrollers, we used a USB-to-serial module to connect
to yet another microcontroller — the bridge controller. This
bridge controller takes one mega baud serial from the PC
USB module and converts the commands to the modified
I²C bus for all other microcontrollers. The bridge controller
also receives all the status from the microcontrollers and
relays them back to the PC.
The Parallax wheels are distance controlled. These
needed to be modified to be velocity controlled to be
compatible with ROS. The Flash in the microcontroller
embedded in the Parallax wheel is near full, so we added
our own faster microcontroller with larger Flash for velocity
and PID control. To utilize the existing Parallax wheel
encoders, we did not remove the wheel controller board.
Instead, wires are soldered onto the existing optical
encoders and connected to our own microcontroller board,
bypassing the Parallax controller.
We use two microcontrollers to control four wheels;
one for the front wheels and one for the back wheels. Each
wheel is individually controlled by the central i7 computer.
The long wires from the optical encoders pick up noise
from the motors and can cause problems for our
microcontrollers. We use optoisolators to isolate the
encoder wires from the microcontroller digital inputs.
The two linear actuators are controlled by one
ATmega328p microcontroller. We use two relays for
controlling each of the two linear actuators. The two relays
allow the microcontroller to provide positive 12V, negative
12V, or no power to the linear actuator. The microcontroller
can control the linear actuator to move in forward
direction, in reverse direction, or to stop.
The linear actuator has a variable resistor as a feedback
mechanism. The variable resistor is connected to the input
of the microcontroller’s built-in analog-to-digital converter.
By reading the A/D value, the microcontroller software
constantly monitors exactly where the linear actuator is
positioned. When the i7 central computer programs or
commands the linear actuator microcontroller to move the
linear actuator to a desired position, the microcontroller
drives the relays to provide proper power to the linear
actuator. When the linear actuator reaches the desired
position, the microcontroller tells the relays to provide no
power and thus stop the linear actuator at the desired
SERVO 12.2011 65