|
Objective
The intent of this project is to balance a
robot on two wheels, similar to the segway
but on a much smaller scale.
Design
The initial robot for this application was
the Gamadome
robot. This robot was already on two
wheels but also had two deodorant sticks
supporting it on the other axis. My
task was to make it stand without the
deodorant sticks. What was special
about the gamadome is that it had already
incorporated into it two Gamoto motor
controllers. The brains for this
robot was a simple cricket.
The cricket
controlled the motors through its bus
interface. In the scheme of things,
the cricket is the controller and the
motors/wheels the actuators. So the
one thing not discussed so far is how the
robot knows if its balanced. One
would typically use a tilt sensor for this
type of task, but being on a limited
budget I had to do with less expensive
devices. I considered an infrared
sensor, specifically the Sharp GP2D02
optical distance sensor, and on a separate
path an accelerometer, Analog Devices
ADXL202 device. After some
consideration I gave up on the use of an
accelerometer as the robot was not
stationary but also moved, hence the
sensor reading would add the acceleration
associated with motion of the robot to
that of its downward acceleration, the
latter being gravity of course, making it
unclear whether the reading was due to
downward motion or due to sideway motion.
I went on with using the Sharp optical
distance sensor but soon found out that
the robot would not balance itself as it
was. I tried to shift the
center of mass of the robot by taking it
apart and moving the center of mass a bit
higher by putting the battery pack on top.
This involved unscrewing everything, then
unsoldering some connections to be able to
put parts in different locations. Then
after everything was put together I needed
to solder all the connections back. After
all this, there was no improvement in its
balancing. I tried further weight
shifting, but nothing changed. After
some further research and analysis I found
out that the sensor readings from the
Sharp sensor take about 40ms, hence the
sensor data read could be 40ms old.
This was not acceptable for this
application and I had to come up with a
new approach.
At this point a few colleagues sent me
some links to web pages of similar
projects. One of these, and the most
basic, was the
Legway. It was able not only to
balance but to move as well while
balancing itself on two wheels. It
used the RCX 1.0. The RCX is a
programmable, microcontroller-based brick
that can simultaneously operate three
motors, three sensors, and an infrared
serial communications interface (not from
an official source). The Legway uses
an EOPD (Electro-Optical Proximity
Detector) from HiTechnic Sensors to
balance. The EOPD goes for about $40
at the time of this writing and I didn't
want to spend another $40 on this project,
so I tried using the Infrared Proximity
Sensor (Model IR1021) also from HiTechnic.
I already had access to this sensor so
there was no extra cost or time delay for
ordering and shipping.
In the final state, the trembling cricket,
as my robot was called, had wheels and
motors from a lego mindstorms kit, just
like the Legway. As I
mentioned earlier, the robot had the
cricket for its brains and for the tilt
sensor I used the Infrared Proximity
Sensor. After days of calibration,
that is, taking measurements from the
sensor and proportionately moving the
wheels to counter the tilt, I was seeing
some possibility of this working.
However, there were three limiting
factors. For one, the cricket loop
to balance the robot was taking close to a
hundred milliseconds, which doesn't allow
too much resolution in control.
Second, the motors used are not powerful
at all, they don't have that much torque
to offset the fall of the trembling
cricket once it falls x number of degrees.
And third, which I believe was the most
limiting factor, is that the sensor I used
to measure tilt isn't really made for this
application. Not only that, but its
resolution wasn't that great and it wasn't
linear.
At the end of the day the trembling
cricket is seen as trying to balance
itself but not always successfully.
At one point I had it balancing for
minutes, but that was just on one
occasion. Most of the time it
balances for only a few seconds and then
falls over. Thats when it goes from
a trembling cricket to its other name, the
hidden dragon.
stance sensor |