fundamentals of attitude estimation - mitindia.edu

51
Fundamentals of attitude Estimation A.Kaviyarasu Assistant Professor Department of Aerospace Engineering Madras Institute Of Technology Chromepet, Chennai Prepared by

Upload: others

Post on 26-Mar-2022

25 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fundamentals of attitude Estimation - mitindia.edu

Fundamentals of attitude Estimation

A.Kaviyarasu

Assistant Professor

Department of Aerospace Engineering

Madras Institute Of Technology

Chromepet, Chennai

Prepared

by

Page 2: Fundamentals of attitude Estimation - mitindia.edu

• Basically an IMU can used for two main purposes– To measure aircraft attitude information ( Pitch, Roll and yaw)

• Accelerometers to measure pith and roll information• Gyroscope to measure pitch, roll and yaw information• Magnetometer to measure pitch and roll information

– To measure aircraft position information (Dead Reckoning)• Stable platform (Gyros and Accelerometer are mounted on a gimbal platform)• Strap down platform (Gyros and Accelerometer are Strapped it on body of an

aircraft)

Kaviyarasu A, MIT Aerospace, Chennai

Page 3: Fundamentals of attitude Estimation - mitindia.edu

Pitch Roll Yaw

Kaviyarasu A, MIT Aerospace, Chennai

Page 4: Fundamentals of attitude Estimation - mitindia.edu

• Three-axis accelerometer can be modeled as

Estimation of Angle with Accelerometer

1

m ga F Fm

measured acceleration

mass of the body

sum of all forces acts on body expressed in bodyframe

(includesgravity)

Force due to gravity expressed in bodyframe

m

g

a

m

F

F

Kaviyarasu A, MIT Aerospace, Chennai

Page 5: Fundamentals of attitude Estimation - mitindia.edu

we assume that F=0 then the output of accelerometer is

gm

Fa

m

0

In inertial frame force of gravity is expressed as 0

mg

0 - sin( )

0 cos( )sin( )

cos( )cos( )

Bg I

mg

F R mg

mg mg

Rotating the gravity into the body frame of the sensor

Kaviyarasu A, MIT Aerospace, Chennai

Page 6: Fundamentals of attitude Estimation - mitindia.edu

• The expected accelerometer data in the body frame is defined by

• Let the component of acceleration is defined by its axis

sin( )

- cos( )sin( )

- cos( )cos( )

m

g

a g

g

arcsin

arctan

mxaccel

myaccel

mz

a

g

a

a

Kaviyarasu A, MIT Aerospace, Chennai

Page 7: Fundamentals of attitude Estimation - mitindia.edu

• The measured angles are only the estimated angles not the actual angels.• This method provides quick and very simple way of estimating pitch and roll

angle from the accelerometer.• However we assumed that the forces acting on the accelerometer was only

gravity.• Vibration and other external forces will affect our pitch and roll angle

measurement.

Kaviyarasu A, MIT Aerospace, Chennai

Page 8: Fundamentals of attitude Estimation - mitindia.edu

Estimation of Angle with Gyroscope

• Rate gyro can also be used to measure the attitude of vehicle. unlikeaccelerometer rate gyros are not affect by external acceleration and externalforces. Gyro based measurement is immune to external forces.

• Since roll, pitch, and yaw each occur in different reference frames, we need totake the rate gyro outputs and rotate them into the appropriate frames in order toget the Euler's rate.

Kaviyarasu A, MIT Aerospace, Chennai

Page 9: Fundamentals of attitude Estimation - mitindia.edu

This method helps to use rate gyros to estimate angles that are not sensitive to vibrationand other external forces. However rate gyros are noisy and imperfect, every time weadd new gyro measurements, we add errors to our angle estimates. Over time, errors willaccumulate, causing our gyro-based angles estimates to drift over time.

.

.

.

qsin tan( ) cos tan( )

cos sin

sin cos

cos cos

p r

q r

q r

.

.

.

( * )

( * )

( * )

gyro gyro

gyro gyro

gyro gyro

dt

dt

dt

Kaviyarasu A, MIT Aerospace, Chennai

Page 10: Fundamentals of attitude Estimation - mitindia.edu

Combining accelerometer and rate Gyro data

• Angle estimate based on rate gyros alone drift over time, making them unreliablein the long-term purpose or application.

• Angle estimates based on accelerometers do not cause angle estimates to drift, butthey are sensitive to external forces like vibration, making short-term estimatesunreliable.

• Here we are going to discuss about how to combine the outputs of both types ofsensor to produce angle estimates that are resistant to both vibration and immuneto long-term drift.

• Here the step is classified into two types– Prediction (by using gyroscope reading to measure incremental changes in the

angle).Kaviyarasu A, MIT Aerospace, Chennai

Page 11: Fundamentals of attitude Estimation - mitindia.edu

• Estimation (by means of using accelerometer reading to correct the rate gyrodrift).

• In updating step we assume accelerometer based angle estimation is close to truevalue .

• We take the measured angle (from the accelerometers) and the predicted angle(from the rate gyros), compute the difference, and add a portion of the differenceto the final angle estimate.

estimate accelgyro gyro

estimate accelgyro gyro

estimate maggyro gyro

L

L

L

Kaviyarasu A, MIT Aerospace, Chennai

Page 12: Fundamentals of attitude Estimation - mitindia.edu

• L is numeric value between 0 and 1.

• As approaches L=1, the accelerometers are trusted more and the rate gyros are trustedless. This makes the angle estimates less sensitive to rate gyro noise and biases, butmore sensitive to vibration and other external forces.

• As approaches L=0, rate gyros are trusted more and the accelerometers are trustedless. This makes the angle estimates more sensitive to rate gyro noise and biases, butless sensitive to vibration and other external forces.

0 gyro based angle mesurement is used

(accelerometer measurment become zero)

1 accelerometer based angle mesurement is used

(gyros measurment become z

if L

if L

ero)

Kaviyarasu A, MIT Aerospace, Chennai

Page 13: Fundamentals of attitude Estimation - mitindia.edu

• This formulation can be called a “fixed-gain observer” and it looks similar to thatof Complementry Filter and Kalman Filter.

• The main difference is that in a Kalman Filter, the observer gain is selectedoptimally using known characteristics of the physical system.

• In addition, a Kalman Filter can exploit knowledge of the physical system so thataccelerometer data (and other data) needn’t be converted to angles before using itto make corrections to the angle estimates.

Kaviyarasu A, MIT Aerospace, Chennai

Page 14: Fundamentals of attitude Estimation - mitindia.edu

Complementary filter

angle = 0.98*(angle+gyrodata*dt) +0.02*(accData);

Kaviyarasu A, MIT Aerospace, Chennai

Page 15: Fundamentals of attitude Estimation - mitindia.edu

Is Accelerometer helps to measure velocity

and position?

Kaviyarasu A, MIT Aerospace, Chennai

Page 16: Fundamentals of attitude Estimation - mitindia.edu

• The answer is yes…… and no……….• It depends upon how much accuracy we are in needed for our application.• The low cost accelerometer are very less in accuracy result in every poor

estimation in position and velocity.• The accuracy not only because of low cost sensor but also for misalignment of

sensor position in the body frame. Small misalignment errors may leads to higherrors in acceleration measurement, which translate into more error in velocityestimation and much more error in position estimate.

Kaviyarasu A, MIT Aerospace, Chennai

Page 17: Fundamentals of attitude Estimation - mitindia.edu

Estimation of Position and velocity

i i

i i

V a

P a

i

i

i

V inertial frame Velocity

P inertial frame Position

a Inertial frame acceleration

( * )

*

( * )

*

i i i

i i

i i i

i i

V V dt a

V dt a

P P dt V

P dt V

But in practical

Kaviyarasu A, MIT Aerospace, Chennai

Page 18: Fundamentals of attitude Estimation - mitindia.edu

Expected Accuracy of Velocity and Position Estimates

Kaviyarasu A, MIT Aerospace, Chennai

Page 19: Fundamentals of attitude Estimation - mitindia.edu

How to reduce the error?

• Reduce the Distortions caused by an Accelerometer.• Reduce the Distortions caused by gyroscope.• Reduce the Distortions caused by Magnetometer.• By using any sensor fusion technique. (Eg.GPS INS Integration).

Kaviyarasu A, MIT Aerospace, Chennai

Page 20: Fundamentals of attitude Estimation - mitindia.edu

Distortions by Accelerometer

• The simplified accelerometer mentioned in the above equation will notconsider the account of cross-axis misalignment, temperature varyingoutput bias and scale factors. All these factor will affects accelerometersensor output and affect accuracy of velocity and positionmeasurement.

• The more complete model of the accelerometer is given below

g1

( )(F F ) (t)m a aa M S Tm

acceleration misalignment matrix

(t) Vector of temperature varying bias

( ) Diagonal temperature varying accelerometer

Sensitivity matrix

a

a

M

S T

Kaviyarasu A, MIT Aerospace, Chennai

Page 21: Fundamentals of attitude Estimation - mitindia.edu

• The sensitivity matrix encodes expected accelerometer raw output for a given measured acceleration.

• The misalignment matrix describes the effect of cross-axismisalignment unlike bias and sensitivity terms, it is not affected betemperature.

0 0

( ) 0 0

0 0

ax

a ay

az

S

S T S

S

Kaviyarasu A, MIT Aerospace, Chennai

Page 22: Fundamentals of attitude Estimation - mitindia.edu

• When using accelerometer data, we measure only value, is am but whatwe really needed is the actual acceleration amc before scale factors,biases, and misalignment distort the measurement. That is, we want totake the measurement and extract the term . Solving, we get

In order to obtain the best accuracy, the terms should be determinedexperimentally over the full operating temperature of the sensor

1 1( ) ( )mc a a m aa S T M a T

mca

corrected accelerometer measurement vectormca

Kaviyarasu A, MIT Aerospace, Chennai

Page 23: Fundamentals of attitude Estimation - mitindia.edu

Distortions by Gyroscope

• Let the Vector P is defined as

• Usually coupling between the acceleration and rate gyro output Cga is small enoughthat can be neglected, but in high acceleration is expected (e.g. on a rocket), this term mustbe measured and included in the model for the best accuracy.

a

mc

g

measured angular rate vector

matrix encoding the sensitivity

of rate gyro axes to acceleration

a corrected accelerometer measur e

C

em nt

mp

1 1*ga mcC( ) ( ) ag g m gP S T M p T

p

p q

r

Kaviyarasu A, MIT Aerospace, Chennai

Page 24: Fundamentals of attitude Estimation - mitindia.edu

Distortions by Magnetometer• Magnetometer are very trick one to calibrate.• Like accelerometer and gyroscope magnetometer also subject to cross-axis

misalignment, output bias ,scale factors.• In addition to that, local magnetic field around the magnetometer can be distorted

by magnetic and ferrous metal objects. This distortion must be measured andcorrected in order for the magnetometer to be useful.

• The field can also be distorted by time-varying electromagnetic waves from high-power electrical lines and communication lines placed near the sensor.

• Finally, as the sensor is moved around in practice, the field can be distorted sothat, in certain locations (say, next to a concrete wall filled with rebar), theaccuracy of the measurement is reduced.

Kaviyarasu A, MIT Aerospace, Chennai

Page 25: Fundamentals of attitude Estimation - mitindia.edu

• After the magnetometer measurement is corrected for axis misalignment, scalefactor, and bias errors, it must be corrected for additional local magnetic fielddistortions.

1 1b= ( ) ( )b b m bS T M b T

1

1

magnetic field

Measured magnetic field

inverse of the magnetometer sensitive matrix

inverse of the magnetometer misalignment matrix

( ) magnetometer bias vector

m

b

b

b

b

b

S

M

T

Kaviyarasu A, MIT Aerospace, Chennai

Page 26: Fundamentals of attitude Estimation - mitindia.edu

• Two types of local distortions are there– Soft-Iron Distortion.– Hard -Iron Distortion.

• A soft-iron field distortion is caused by ferrous metal objects that bend the Earth’smagnetic field e.g. Screws

• A hard-iron distortion is caused by near by object having its own magnetic fieldlike permanent magnets motor or current carrying conductors.

• In the absence of any hard or soft-iron distortions, the outputs of the magnetometeras it is rotated should trace out a perfect sphere centered around zero.

• Soft-iron distortions distort the sphere so that it appears to be an ellipsoid. Hard-iron distortions shift the mean of the sphere away from zero

Kaviyarasu A, MIT Aerospace, Chennai

Page 27: Fundamentals of attitude Estimation - mitindia.edu

• One way to calibrate the magnetometer for hard and soft iron distortions is to fitan ellipsoid to a set of magnetometer data collected over a wide variety ofdifferent orientations. The center of the ellipsoid is equivalent to the bias causedby hard iron distortions, while the ellipsoid shape on the x, y, and z axes arecaused by the soft-iron distortions. A correction matrix can then be calculatedthat, when multiplied by the magnetometer measurements, alters the ellipsoid sothat it looks like a sphere again.

Kaviyarasu A, MIT Aerospace, Chennai

Page 28: Fundamentals of attitude Estimation - mitindia.edu

Sensor data fusion

Kaviyarasu A, MIT Aerospace, Chennai

Page 29: Fundamentals of attitude Estimation - mitindia.edu

• The sensor fusion can be implemented by some of the steps below-Complementary Filter (CF)-Kalman Filter (KF)-Extended Kalman Filter (EKF)-Unscented Kalman Filter (UKF)-Particle Filter (PF)

Kaviyarasu A, MIT Aerospace, Chennai

Page 30: Fundamentals of attitude Estimation - mitindia.edu

• Nothing but fusion of data’s from two or more sensor.• The data measured from a single sensor not gives accurate measurement of

reading. It may suffer from some noise ,errors ,misalignment and externaldisturbance.

• In order to measure the exact physical quantity of data ,two or more sensors are used. these data's are fused in such a way it will provide original measurement of the physical quantity.

Kaviyarasu A, MIT Aerospace, Chennai

Page 31: Fundamentals of attitude Estimation - mitindia.edu

Combining accelerometer and rate Gyro data

• Angle estimates based on rate gyros alone drift over time, making them unreliablein the long-term purpose or application.

• Angle estimates based on accelerometers do not cause angle estimates to drift, butthey are sensitive to external forces like vibration, making short-term estimatesunreliable.

• Here we are going to discuss about how to combine the outputs of both types ofsensor to produce angle estimates that are resistant to both vibration and immuneto long-term drift.

• Here the step is classified into two types– Prediction (by using gyroscope reading to measure incremental changes in the

angle).Kaviyarasu A, MIT Aerospace, Chennai

Page 32: Fundamentals of attitude Estimation - mitindia.edu

• Estimation (by means of using accelerometer reading to correct the rate gyrodrift).

• In updating step we assume accelerometer based angle estimation is close to truevalue .

• We take the measured angle (from the accelerometers) and the predicted angle(from the rate gyros), compute the difference, and add a portion of the differenceto the final angle estimate.

estimate accelgyro gyro

estimate accelgyro gyro

estimate maggyro gyro

L

L

L

Kaviyarasu A, MIT Aerospace, Chennai

Page 33: Fundamentals of attitude Estimation - mitindia.edu

• L is numeric value between 0 and 1.

• As approaches L=1, the accelerometers are trusted more and the rate gyros are trustedless. This makes the angle estimates less sensitive to rate gyro noise and biases, butmore sensitive to vibration and other external forces.

• As approaches L=0, rate gyros are trusted more and the accelerometers are trustedless. This makes the angle estimates more sensitive to rate gyro noise and biases, butless sensitive to vibration and other external forces.

0 gyro based angle mesurement is used

(accelerometer measurment become zero)

1 accelerometer based angle mesurement is used

(gyros measurment become z

if L

if L

ero)

Kaviyarasu A, MIT Aerospace, Chennai

Page 34: Fundamentals of attitude Estimation - mitindia.edu

• This formulation can be called a “fixed-gain observer” and it looks similar to thatof Kalman Filter.

• The main difference is that in a Kalman Filter, the observer gain is selectedoptimally using known characteristics of the physical system.

• In addition, a Kalman Filter can exploit knowledge of the physical system so thataccelerometer data (and other data) needn’t be converted to angles before using itto make corrections to the angle estimates.

Kaviyarasu A, MIT Aerospace, Chennai

Page 35: Fundamentals of attitude Estimation - mitindia.edu

Complementary filter

angle = 0.98*(angle+gyrodata*dt) +0.02*(accData);

Kaviyarasu A, MIT Aerospace, Chennai

Page 36: Fundamentals of attitude Estimation - mitindia.edu

Combining Barometer 1&2 using Complementary filter

12 2altitude BarometerBarometer BarometerH H L H H

Barometer 1 Barometer 2

Kaviyarasu A, MIT Aerospace, Chennai

Page 37: Fundamentals of attitude Estimation - mitindia.edu

Combining Barometer Altitude and Sonar using

Complementary filter

altitude BarometerUltrasonic sensor Ultrasonic sensorH H L H H

Barometer Ultrasonic Sensor

Kaviyarasu A, MIT Aerospace, Chennai

Page 38: Fundamentals of attitude Estimation - mitindia.edu

Combining Barometer Altitude Infrared sensor

using Complementary filter

Barometer Infrared Proximity sensor

Proximity Proximity altitude BarometerInfrared sensor Infrared sensorH H L H H

Kaviyarasu A, MIT Aerospace, Chennai

Page 39: Fundamentals of attitude Estimation - mitindia.edu

Combining GPS altitude and Barometer Altitude using

Complementary filter

altitude GpsreceiverBarosensor BarometerH H L H H

GPS Barometer

Kaviyarasu A, MIT Aerospace, Chennai

Page 40: Fundamentals of attitude Estimation - mitindia.edu

• A prime meridian is a meridian, i.e., a line of longitude, at which longitude isdefined to be 0°.

• This great circle divides the sphere, e.g., the Earth, into two hemispheres. If oneuses directions of East and West from a defined prime meridian, then they can becalled Eastern Hemisphere and Western Hemisphere.

• Prime meridian connects pole to poles covers a distance of about 20,000 km.• Why does the Prime Meridian (Zero Longitude) pass through Greenwich?

-The International Meridian Conference took place in October 1884 inWashington DC. Twenty-five nations were represented at the conference by 41delegates. The Greenwich Meridian was chosen to become the Prime Meridian ofthe World. There were several reasons for this; the main one being that nearlytwo thirds of the World's ships were already using charts based on it.

Kaviyarasu A, MIT Aerospace, Chennai

Page 41: Fundamentals of attitude Estimation - mitindia.edu

• Latitude tells you how far north or south of the Equator you are located.• Longitude is the location of a place east or west of a north-south line called the

prime meridian.• Longitude is measured in angles ranging from 0° at the Prime Meridian to 180° at

the International Date Line.• Local meridian is a great circle passing through celestial poles and zenith of a

particular location.

Kaviyarasu A, MIT Aerospace, Chennai

Page 42: Fundamentals of attitude Estimation - mitindia.edu

Kaviyarasu A, MIT Aerospace, Chennai

Page 43: Fundamentals of attitude Estimation - mitindia.edu

Kaviyarasu A, MIT Aerospace, Chennai

Page 44: Fundamentals of attitude Estimation - mitindia.edu

Kaviyarasu A, MIT Aerospace, Chennai

Page 45: Fundamentals of attitude Estimation - mitindia.edu

1

90

2

A clock wise rotation over east axis by an angle to align the up axis with the z axis

R

3

90

2

A clock wise rotation over z axis by an angle to align the east axis with the x axis

R

to From NED Frame ECEF

sin cos sin cos cos

cos sin sin sin cos

0 cos sin

ECEF k

ECEF k

ECEF kNED

x x

y y

z z

Kaviyarasu A, MIT Aerospace, Chennai

Page 46: Fundamentals of attitude Estimation - mitindia.edu

( sin ,cos ,0)

cos sin , sin sin ,cos

cos cos ,sin cos ,sin cos

ECEF

ECEF

ECEF

x

y

z

3 1 *2 2

k ECEF

k ECEF

k ECEFNED

x x

y R R y

z z

sin cos 0

cos sin sin sin cos

cos cos sin cos sin

k ECEF

k ECEF

k ECEFNED

x x

y y

z z

sin cos sin ,cos cos

cos , sin sin sin cos

0,cos ,sin

k

k

k

x

y

z

1 ( ( () . ) )Ti i i iFrom ECEF to NED Frame e RiR R R

Kaviyarasu A, MIT Aerospace, Chennai

Page 47: Fundamentals of attitude Estimation - mitindia.edu

,

,

2

,

cos cos

cos sin

1cos cos

ECEF k k k k

k

ECEF k k k k

k

ECEF k k k k

k

ax h Lat Lon

ay h Lat Lon

a ez h Lat Lon

2 21 2* *sink krf rf Lat

2 2 3

' in ( 6378137 )

( 6.69437999014*10 )

( 0.0033528)

k

a earth s semi major axis meters a m

e square of the first numerical eccentricity of ellipsoid e

h altitude of the vehicle

rf reciprocal flatting rf

, & Coordinate conversion from geodetic lat lon height to ECEF frame

Kaviyarasu A, MIT Aerospace, Chennai

Page 48: Fundamentals of attitude Estimation - mitindia.edu

• The Earth Centered Earth Fixed (ECEF) frame is converted into NED frame byusing the rotational matrix.

,

,

,

sin cos 0

sin cos sin sin cos

cos cos cos s sin

k k k ECEF k ECEF

k k k k k k ECEF k ECEF

k k k k k k ECEF k ECEFNED

x Lon Lon x xref

y Lat Lon Lat Lon Lat y yref

z Lat Lon Lat inLon Lat z zref

Kaviyarasu A, MIT Aerospace, Chennai

Page 49: Fundamentals of attitude Estimation - mitindia.edu

Combining INS position with GPS Position using

Complementary filter

INS

GPS Inertial Sensor

Kaviyarasu A, MIT Aerospace, Chennai

Page 50: Fundamentals of attitude Estimation - mitindia.edu

Kaviyarasu A, MIT Aerospace, Chennai

Page 51: Fundamentals of attitude Estimation - mitindia.edu

Thank you

Kaviyarasu A, MIT Aerospace, Chennai