Dual-Differential RPM
Sensing or a Melty
Brain/Translational
Drift Rob t
● by Rob Glidden
While there are many ways to tell your Melty bot’s
microcontroller how fast it’s
spinning, an on-board accelerometer
is a particularly compact solution
that can be built right onto the
control board. The accelerometer
measures the centrifugal force which
is a function of the angular velocity
(RPM) of the bot. From this, one can
time each rotation precisely using
the µC. My first Melty bot was based
on Rich Olsen’s single-accelerometer
tracking mechanism, but I wasn’t
quite happy with the amount of
calibration steps required. I’ve found
an elegant way to address this issue
that I think has some merit in a bot.
In single-accelerometer tracking,
the RPM is given by RPM = k √α1/r1,
where k is a constant, α is the
centrifugal acceleration, and r is the
distance to the center of mass —
theoretically it’s also a constant, but
in practice this is not true. You must
know the distance to the Melty bot’s
center of mass (projected along
the axis of the accelerometer). If
you don’t know it, your bot won’t
track properly. The actual value of
r1 is hard to predict even if you
build your bot perfectly, and
merely replacing the batteries or
moving a couple wires can force you
to re-estimate in smaller bots.
(α2 - α1) when the robot is spinning,
however. The simple solution is to
connect the two accelerometers
The physical hardware might look like this
image. The two 16-pin SOICs in the lower
left hand corner of the board are a pair of
MMA2301EG accelerometers produced by
Freescale; each rated for ±200 g. Their
sensitive axes are aligned, and they are
separated by a fixed distance of 0.50 inches.
This distance is a constant regardless of
where the board is located in the bot. Dual-differential control will actually work just
fine with no code changes, even if the
accelerometer’s axes are not directly
pointed towards the center of mass.
In this example, a Texas Instruments
INA121UA instrumentation amplifier takes
the difference in the signals and boosts
it by a gain factor of 2. This gain can be
varied with different resistors at R15,
allowing you to tune the output signal to
make use of the full range on your ADC.
Here, ACL1_ST and ACL2_ST are the
self-test pins for the two accelerometers.
ADC6 is the main output and ADC7 is
included just in case one wants to revert to
single-accelerometer tracking. AVCC is + 5
VDC. Each accelerometer’s output is RC
filtered to help eliminate noise.
SERVO 06.2010 33