The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using...

42
The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde (Also of Team 1073 TheForceTeam.com )

Transcript of The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using...

Page 1: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

The World Leader in High Performance Signal Processing Solutions

Inertial SensorsUsing Accelerometers & Gyro’s

for FIRST Robotics

Jan 6, 2007Chris Hyde

(Also of Team 1073 TheForceTeam.com )

Page 2: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

During the Game (particularly Autonomous)Things you might like to know

How far has the Robot traveled?Did it turn? How much?Where is it now? Where is it pointing (orientation)?Is it level or on an incline (or on it’s side)?Did it hit something?

Things Inertial Measurements can Answer

Page 3: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

F ma

avt

2xt 2

Page 4: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

“I LOVE THE SMELL OF PHYSICS IN THE MORNING” (with regrets to Coopola)

Newton’s 1st Law“Every body continues in its state of rest, or uniform motion in a

straight line, unless it is compelled to change that state by forces impressed on it”

Newton’s 2nd Law“Acceleration is proportional to the resultant force and is in the

same direction as this force”Which translates to…

F = ma = mf + mgWhere f = Acceleration from force F, other than gravitational

acceleration (g)

Page 5: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Inertial Measurements

What do you need to measure?Tilt (inclination) - AccelerometerAcceleration (speed & distance via integration) - Accelerometer

Shock - AccelerometerVibration - AccelerometerAngular rate (rotational) - Gyroscope

Page 6: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Inertial Sensors 101

Measurement of static gravitational forcee.g. Tilt and inclination

Measurement of dynamic acceleratione.g. Vibration and shock measurement

Inertial measurement of velocity and positionAcceleration single integrated for velocityAcceleration double integrated for position

What Does an Accelerometer do?

Page 7: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

How Do Accelerometers Work?

Acceleration can be measured using a simple mass/spring system.Force = Mass * AccelerationForce = Displacement * Spring ConstantSo Displacement = Mass * Acceleration / Spring Constant

MASS

Add Acceleration

MASS

Change in Displacement

Page 8: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

The World Leader in High Performance Signal Processing Solutions

So What’s all this MEM’s Stuff ?

Micro Electro-Mechanical Systems

Silicon that Moves

Page 9: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

How Do MEM’s Accelerometers Work?

We use Silicon to make the spring and mass, and add fingers to make a variable differential capacitor

We measure change in displacement by measuring change in differential capacitance

MASS

SPRING

SENSOR AT REST

FIXEDOUTERPLATES

ANCHOR TOSUBSTRATE

CS1 < CS2

APPLIEDACCELERATION

RESPONDING TO AN APPLIED ACCELERATION(MOVEMENT SHOWN IS GREATLY EXAGGERATED)

Page 10: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Silicon that MovesSuspended Structures

Page 11: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

MEM’s Accelerometer

Source: Great MEMS education sitewww.ett.bme.hu/memsedu/

Page 12: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

C to V conversion

UNIT CELL

MOVABLE BEAM

AC

CE

LER

AT

ION

AMP

SYNCHRONOUS DEMODULATOR

CLOCK A

CLOCK B

~100KHz

RECTIFIED VOLTAGE OUTPUT

Page 13: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

ADXL203 2D Accelerometer Die Photo

Page 14: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

ADXL 2D Proof Mass & Springs

All anchors placed close to the beam center

Stoppers at the outside of beam

Self-test elements at the outside of beam

ADI Proprietary Information

Page 15: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Determining RotationCoriolis Effect and Acceleration

Left Image Source: Wikipediahttp://en.wikipedia.org/wiki/Coriolis_effect

Acor = 2 * (v) = applied angular rate

v = Velocity

vAcor

Page 16: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Gyro

Measures angular rate (how fast it is turning around its axis).

Measures change of inclination or change of direction by integration of angular rate.

What Does a Gyro Do?

Page 17: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Gyro Principle of OperationHow does it measure angular rate?

By measuring the Coriolis forceWhat is the Coriolis force?

When an object is moving in a periodic fashion (either oscillating or rotating), rotating the object in an orthogonal plane to its periodic motion causes a translational force in the other orthogonal direction.

OSCILLATION

MASS

ROTATION

CORIOLIS FORCE

Page 18: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

MEM’s Gyro Operation

Accelerometer tether

Resonator tether

Accelerometer frame

Resonator

Coriolis acceleration

Resonator motionApplied Rotation

Coriolis Sense Fingers

Resonator Drive Fingers

Page 19: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

MEM’s Comb Drive

Source: www.ett.bme.hu/memsedu/

Page 20: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Gyro Animation

Source: www.ett.bme.hu/memsedu/

Page 21: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

ADXRS150 Gyro Family Beam Structure

Resolve 12 x10-21 farads(ZeptoFarads)

Beam movements 16 femtometers(0.000116 Angstroms)

Hydrogen 0.5 A Diameter

Page 22: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

iMEMs - Integrated IC with MEM’s

Page 23: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Resonator Control Loop

Drive

Sense

Trans-resistance Amp Clipping Amplifier

= +90°

Page 24: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Coriolis Measurement Signal Chain

Fixed Finger @ +12V

Moving Fingers @ ~+1.5V

Beam

Trans-Capacitance Amp

Gain proportional

to temperature

+12V

Page 25: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Coriolis Measurement Signal Chain

Max Out ~ 300uV

Beam 1

Trans-Capacitance Amp

Beam 2

…How it really works

Large common mode signals (shock) are removed before amplification, so huge dynamic range is available

Page 26: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

The World Leader in High Performance Signal Processing Solutions

Applying Accelerometers and Gyros in the Robot

Some things to do, don’t do, etc.

Page 27: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Placement & Mounting

Q: Does it matter where & how they are mounted?A: Yes and No.

Best sensitivity when mounted in proper orientationKeep level for Navigation, Mount on side for tilt

Avoid vibration & places that flex - Makes measurements easierDoesn’t need to be at center of rotationKeep them “electrically close” to the controller

Wire parasitic resistance will reduce performanceKeep wires short

Page 28: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Limits on Rotation Rate

The kit gyro is an +/- 80 degree/sec deviceUse in Autonomous mode is OK with slow turnsRotation > 80 deg/s will not be shown at the outputWhile there is a work around if you had access to the pins of the

gyro, the FIRST board doesn’t have that access.If you did you could put a 60.4K resistor in the feedback of the on chip

output amplifier (pins 1B to 1C), shich would give 320 deg/sBuy ADXRS300EB or ADXRS150EB Evaluation boards from

DigiKey and use them (300 or 150 deg/s)www.digikey.com

Page 29: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Getting the data into the controller

Voltage outputs need to be sampled by the controller A/D converter. Must sample at > 2 x the highest frequency (Bandwidth) Should sample more

Use added samples to do some averaging to reduce noise, errorsCan increase resolution by oversampling (>> 2X freq)

Supported in EZ-C

Good insight and details at Kevin Watson’s wonderful site www.kevin.org/frc

Also www.Chiefdelphi.com

READ THE DATA SHEETS !!!

Page 30: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

What to do with the data?

To get distance traveled, integrate twice the accelerometer data.

To get rotational change, integrate gyro once.Good white papers at www.chiefdelphi.com

Use in PID control to guide your robot

Page 31: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

PID Algorithm

P - Proportional - The amount of correction (Gain) is based on (proportional to) the error between where we are and where we want to be

I - Integral - The amount of correction (Gain) is based on the amount of time the error has gone uncorrected

D - Differential - The amount of correction (Gain) is based on how fast the error is changing - Anticipate the future

Page 32: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

What do the Gains do?

The Gain terms define how important each of the PID terms are.

Kp - Proportional Gain - Determines how fast your system reacts to error

Ki - Integral Gain - Determines how hard your system will push to overcome error.

Kd - Differential Gain - Limits the change in response to error. Helps to dampen or smooth the reactions.

Page 33: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

How do I Tune my PID Control System ?

Start by setting the Proportional gain (Kp) lowSet the Integral and Diferential gains (Ki, Kd) to zero

Increase Kp until the system starts to react quickly enough. It will overshoot if you set it too high.

Now increase Kd to compensate for overshoot. Now the system should react smoothly.

Page 34: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

How do I Tune my PID Control System ? But you might notice that it never reaches the goal.

That is because resistance in the system is holding it back and as you near the goal, the proportional term gets smaller and doesn’t provide enough force to move the mass.

Now it is time to increase Ki. Over time the error will build and the I term allows the system to overcome resistance.

You’ll probably need to go back and tune each of the terms to get the response you want in the time you have.

Page 35: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

The World Leader in High Performance Signal Processing Solutions

Thanks and Good Luck !

Extra support material follows

Page 36: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Common Questions – Accelerometer & Gyro

Why is there a maximum shock rating?Inertial sensors have moving parts inside. If you shock them hard

enough, you can break them.What happens if I exceed the maximum shock rating

Generally nothing. Most of our inertial sensors can handle very large shocks (tens of thousands of g) several times. But do it often enough and you may cause damage.

What does the output do during high shock events?The output may rail for a short time (time constant determined by

filter bandwidth)Occasionally output may be stuck at rail until power is cycled

Page 37: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Common Questions – Accelerometer & Gyro

What is temperature hysteresis?All MEMS sensors (and most sensors in general) have some

degree of temperature hysteresis.The zero point varies depending on whether the part goes

from cold to hot, or hot to cold (see graph)The amount of hysteresis for a given part depends on the

magnitude of the temperature excursion.Offset vs. Temperature

XL203 AB3902Lot C05788W1

-20

-15

-10

-5

0

5

10

-60°C -40°C -20°C 0°C 20°C 40°C 60°C 80°C 100°C 120°C 140°C

Temp C (part going hot first, then cold) 5 degrees per minute going down, 10 degrees per minute going up

ZgB

(mV

) with

res

pect

to in

itial

ZgB X1

X2

X3

X4

X5

X6

X7

X8

Temperature Hysteresis

Page 38: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Common Questions - Accelerometer

Why is the output not Vdd/2 (or 50% for PWM outputs) at zero g?Initial zero g output varies from part-to-part, and also over

temperature. Each part number has a specified initial zero g output on the data sheet.

Why is the initial zero g output different on the X and Y axes?The 2 axes are independent. Both axes zero g output will comply

with the spec sheet.Why does the zero g tempco, self test response, initial zero g

output, you-name-it, vary from part-to-part?Because it does. Sorry, you have to live with it. We offer a broad

array of parts with varying levels of accuracy. Choose one that has the performance you want.

Page 39: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Common Questions - Accelerometer

I am only interested in tilt information. Why does acceleration information corrupt the output (or vice versa – I want acceleration, but tilt disturbs me)?Tilt and acceleration are indistinguishable to the accelerometer.

They are both acceleration. They only differ in frequency content. One can use a filter (high or low pass) to remove the undesirable frequency content, but no filter is perfect. It is very hard to pick out a few mg of tilt information from dozens of g of vibration, for example.

Page 40: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Common Questions – Gyro

Explain noise density, and how does that relate to random angle walk?Noise on our gyros is expressed in degrees/second/root Hz because the

noise is Gaussian (equivalent noise energy at all frequencies). So the total output noise depends on the bandwidth chosen by the user.

Random angle walk is expressed in degrees/second/second, so if we look at a 1 second period, the random angle walk is equivalent to the noise density

So can I reduce the bandwidth to almost zero and get virtually no noise?No. Reducing the bandwidth below the 1/f frequency (0.3Hz) of the output

amplifier offers no further improvement. So how can I reduce the noise further?

You can average the output if several gyros. For n gyros the noise will reduce by a factor of SQRT(n).

Page 41: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Common Questions - Gyro

If I integrate the output over time the zero position drifts. Why is this, and how much drift can I expect?Integrating the gyro output over time allows errors to accumulate and

grow.All gyros experience this effect. It is usually referred to as Null Stability,

and expressed in degrees/hour.There are 2 sources of error that impact null stability over time

Null stability over temperature Allen variance

Null drift due to temperature is the dominant mechanism A 3 point temperature compensation scheme will give you about 300

degrees/hour null stability. More points will do better.Allen variance is an expression of the average over the sum of the

squares of the differences between successive readings of the null output sampled over the sampling period. ADXRS150/300 Allen variance settles to about 75 degrees/hour This is as good as you’ll get, even with perfect temperature compensation

Page 42: The World Leader in High Performance Signal Processing Solutions Inertial Sensors Using Accelerometers & Gyro’s for FIRST Robotics Jan 6, 2007 Chris Hyde.

Common Questions - Gyro

Why is your gyro so noisy compared to ……Our gyro might appear noisy on the bench, but…Our design is very resistant to external shock and vibration. Virtually all of our competitors are very sensitive to external shock

and vibration. It adds a lot of noise to their output.As a result, in the real world our noise performance is usually

better than our competitors. Often by a wide margin.