Inertial Measurement Unit IMU Basics IMU Inertial Measurement
Inertial Measurement Unit (IMU) Basics
IMU (Inertial Measurement Unit) Accelerometer Gyroscope Magnetometer (Compass) Acceleration along 3 axes Rotation speed around 3 axes Direction of magnetic north Popular since they are inexpensive, small, and power efficient Can be embedded inside any object to enable intelligence
Accelerometer
Basic model (1 D) Accelerometer output under rest is non-zero. It measures g Accelerometer output under motion Accelerometers measure sum of acceleration due to motion and gravity Smartphone accelerometers are tri-axial – can measure 3 D acceleration
Accelerometer under free fall
Accelerometer measures ZERO in free fall Zero G = 9. 8 m/s 2
Measuring linear motion (1 D) Need to subtract gravity to obtain acceleration due to motion Hardware noise Error accumulates dramatically with time
Subtraction of gravity non-trivial in 2 D or 3 D
Subtraction of gravity in 2 D y 2 D equations (y axis pointing upwards) x g
Subtraction of gravity in 2 D y x 2 D equations (y axis pointing upwards) 2 D equations (arbitrary rotation of phone) g We need to know the orientation to subtract gravity Inaccurate orientation will not eliminate gravity, resulting in errors (which accumulate over time)
An interesting idea 2 D equations (arbitrary rotation of phone) Suppose the phone is at rest, then Accelerometer is an orientation sensor!! Need the accelerometer to be at rest to estimate rotation However accelerometer alone is not sufficient if we need 3 D orientation, more later. .
Accelerometer to measure distance • Double integration fails dramatically – • However, accelerometer is good in tracking steps Steps Distance = step_count * step_size Combining distance estimates with compass directions, we can dead reckon
Accelerometer • Measures gravity + linear acceleration • When static, gravity measurement can be used to sense orientation • Double integrating accelerometer will accumulate error dramatically, step counting is reasonable
Magnetometer
Measures magnetic north (2 D example) Magnetic north y Consider a 2 D example x
Measures magnetic north (2 D example) Magnetic north y Suppose, phone rotates in 2 D by an angle x The same concept generalizes to 3 D, Magnetometer can be used to sense the orientation However, in 3 D magnetometer alone is insufficient to determine the orientation
3 D orientation
Foundations of 3 D Orientation Up East Z X Y North Global Frame Local Frame 18
Consider a phone in random orientation Up East X Z Y North 3 D Orientation captures the misalignment between global and local frames 19
Rotation Matrix Up East X In global frame Z In local frame Y North Rotation Matrix R R is the 3 x 3 Rotation Matrix 3 x 3 Rotation matrix captures the full 3 D orientation 20
How can we estimate rotation matrix? Key idea use globally known reference vectors which can also be measured in the local frame of reference • Gravity • Magnetic North
Gravity equation Gravity globally known, measurable in local frame with accelerometer Rotation Matrix R Magnetic north, globally known, measurable in local frame with magnetometer 6 equations and 9 unknowns (3 x 3 rotation matrix) can we solve ? Yes, these 9 unknowns are all not independent (rotation matrix satisfies special properties) • It does not change length of a vector • Columns are orthogonal unit vectors The above 6 equations are sufficient to solve the rotation matrix Accelerometer and Magnetometer can be used to determine the rotation matrix (3 D orientation)
Decomposing the rotation matrix yaw pitch Z X roll 3 x 3 Rotation Matrix R = Y Orientation can be represented as 3 D yaw, pitch, roll Estimating yaw, pitch, roll will determine the orientation
Accelerometer equation Rotation Matrix R
Accelerometer equation Rotation Matrix R Accelerometer output does not depend on yaw! Hence, yaw cannot be estimated using accelerometer
Accelerometer equation Rotation Matrix R The above equations estimate pitch and roll
Magnetometer equation Rotation Matrix R
Magnetometer equation Rotation Matrix R Pitch, roll known from accelerometer Unknown yaw can be determined from above equations yaw, pitch, roll together determine the rotation matrix (3 D orientation) of a system
Gyroscope
1 D example • Measures angular velocity Error Time Error accumulates over time
3 D rotation estimation with gyroscope 3 D angular velocity Rotation Matrix R(t+1) d. R: 3 x 3 Matrix (from Gyroscope) Rotation Matrix R(t) Captures relative rotation between two times
3 D rotation estimation with gyroscope Gyroscope Measurements Rotation Matrix R(t+N-1) d. R(t+N-1) 3 x 3 Error accumulates with time with gyroscope integration …… d. R(t+1) 3 x 3 d. Rs have errors d. R(t) 3 x 3 Rotation Matrix R(t)
Summary: two ways to measure orientation • Using gyroscope • Error accumulates Error Time • Using accelerometer and compass • Big advantage: No error accumulation ( since there is no integration involved) • Accelerometer’s gravity measurement can be corrupted with linear motion • Accelerometer can measure orientation only when the phone is static • Magnetometer is susceptible to electromagnetic interference
Recall Un. Loc
Can we correct gyro drift using accelerometer/magnetometer like Un. Loc
High level idea to combine the two • Use gyroscope to track orientation in general • Errors will accumulate (drift) Gyro + Magn + Accl Error Time • Reset errors with accelerometer/magnetometer (When the phone is static and no magnetic interference)
- Slides: 36