Leanerd's Sensors

Home Mechanical Sensors Electronics Control Laws Software

 

by Troy Carter

(last updated 4/20/2007)


Contents


Sensor Overview

Leanerd relies on a variety of sensors to provide feedback to his control system.  The following sensors are included:

Contents


Inertial Sensors

The two inertial sensor assemblies each consist of an accelerometer and an angular rate gyro.    Both the rate gyro and the accelerometer are used to estimate the angle of the sensor assembly with respect to the direction of gravity. 

The accelerometer is an ADXL203 precision ±1.7g dual axis accelerometer from Analog Devices.  Even though this is a dual axis accelerometer, this robot only uses one axis on each accelerometer to estimate the angle of the sensor assembly with respect to gravity.  The gyro is an ADXRS150 yaw rate gyro from Analog Devices.  The angular rate gyro outputs a voltage proportional to angular velocity about an axis.

Since both of these devices come in leadless packages which are difficult to solder, I chose to use the evaluation board versions.  The devices come soldered to a prototyping board as shown below.  The gyro is installed in a right angle socket to align the sensor axis with Leanerd's axis of rotation.

One of Leanerd's inertial sensor assemblies.

Both the accelerometer and the rate gyro are used to estimate the angle of the chassis.  The accelerometer measures acceleration along an axis.  This sensor can be used to measure the angle with respect to gravity, but any accelerations cause by Leanerd's movement, or bumps in the road will introduce large errors in this measurement.  The rate gyro output can be integrated to provide an angular position measurement, but this signal will drift over time due to accumulated sensor errors and quantization errors.

Since the accelerometer provides accurate angle measurements at low frequencies and the integrated gyro provides accurate measurements at high frequencies, these two signals can be filtered and combined using a number of algorithms including complimentary filtering and Kalman filtering.

Because of it's simplicity, I chose to start out using a complimentary filtering algorithm for Leanerd's inertial measurements.  A good description of how complimentary filtering works in a similar application may be found here.

The charts below show actual data logged from Leanerd using the Bluetooth serial port described in the Electronics section.  The charts show the raw angle estimates from the accelerometer and integrated gyro along with the combined measurement using the complimentary filter algorithm with different cross-over frequencies.  While logging data, the robot was rotated back and forth slowly a couple of times and then shaken up and down to provide higher frequency accelerometer errors.  An accurate inertial sensor should measure the angle of the robot and ignore the shaking.  The first two plots show data using the complimentary filtering scheme described in the paper above.  The last plot shows data using a slightly modified complimentary filter arrangement that seams to provide better results in this application.  The filter arrangement was modified to provide a steeper cut-off of the accelerometer output.

Complimentary filter results using 2.0 second cross-over frequency.  Note that much of the high frequency signal has been removed from the accelerometer output.  Much of the drift has been removed from the integrated gyro, but there is still significant drift that can be seen on the right side of the chart.

 

Complimentary filter results using 0.5 second cross-over frequency.  Note that not very much of the high frequency signal has been removed from the accelerometer output, although there is very little drift. 

Complimentary filter results using a 1.0 second cross-over frequency and a slightly modified filter arrangement.  Note that most of the high frequency signal has been removed from the accelerometer output and there is very little drift.

Contents


Encoders

Each of the wheel motors includes an Agilent HEDS 550 five hundred count encoder.  The encoder can be used to measure the speed, direction, and position of the motors.  Leanerd uses the encoders to measure only speed and direction. 

 

One of Leanerd's wheel motors.  The encoder comes mounted to the back of the motor.

Contents


Mast/Chassis Angle Sensor

The mast/chassis angle sensor is used to measure the angle of the mast with respect to the chassis.  The angle sensor consists of a 50kΩ potentiometer mounted to the chassis.  A plywood control arm and a piano wire linkage connect the potentiometer to the mast.  Although the leaning feature and stabilization of the mast can be implemented using only the inertial sensors, the angle sensor will be very handy while testing and debugging the software.  The angle sensor allows a mode of operation in which the angle between the mast and chassis is "locked" at 90 degrees (using feedback control).  This will allow me to focus on optimizing the control laws in the forward/backward direction without having to worry about the leaning axis.  Once Leanerd balances well in the forward/backward direction, I can optimize the control laws that make Leanerd lean into turns and stay vertical on uneven surfaces. 

The mast/chassis angle sensor.

Contents


Comments

Please email comments to troy@troys-toys.net (please use this link or type Leanerd Comments in the comment section of your email).

Contents


Home Mechanical Sensors Electronics Control Laws Software