Presentation is loading. Please wait.

Presentation is loading. Please wait.

Inertial Measurement Unit (IMU) Basics

Similar presentations


Presentation on theme: "Inertial Measurement Unit (IMU) Basics"— Presentation transcript:

1 Inertial Measurement Unit (IMU) Basics

2 IMU (Inertial Measurement Unit)
Accelerometer Gyroscope Magnetometer (Compass) Acceleration along 3 axes Rotation speed around 3 axes Direction of magnetic north { 𝑑 2 𝑥 𝑑 𝑡 2 , 𝑑 2 𝑦 𝑑 𝑡 2 , 𝑑 2 𝑧 𝑑 𝑡 2 } { 𝑑 𝜃 𝑥 𝑑𝑡 , 𝑑 𝜃 𝑦 𝑑𝑡 , 𝑑 𝜃 𝑧 𝑑𝑡 } { 𝑚 𝑥 , 𝑚 𝑦 , 𝑚 𝑧 } Popular since they are inexpensive, small, and power efficient Can be embedded inside any object to enable intelligence

3 Accelerometer

4 Basic model (1D) Accelerometer measures 𝐹 𝑘 𝑚 𝑚𝑎 𝑎𝑐𝑐𝑙 𝐹 𝑘 =𝑚𝑔 𝐴 𝑚𝑒𝑎𝑠𝑢𝑟𝑒𝑑 = 𝐹 𝑘 𝑚 = 𝑔 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 3D acceleration

5 Accelerometer under free fall

6 Accelerometer measures ZERO in free fall
G = 9.8 m/s2

7 Measuring linear motion (1D)
𝐴 𝑚𝑒𝑎𝑠𝑢𝑟𝑒𝑑 =𝑔+ 𝑎 𝑎𝑐𝑐𝑙 𝑎 𝑎𝑐𝑐𝑙 = 𝐴 𝑚𝑒𝑎𝑠 − 𝑔 Need to subtract gravity to obtain acceleration due to motion 𝑑 2 𝑥 𝑑 𝑡 2 = A meas −g 𝑑 2 𝑥 𝑑 𝑡 2 = A meas −g + n Hardware noise 𝑑𝑥 𝑑𝑡 = (𝐴 −𝑔+ 𝑛 ) 𝑑𝑡= 𝐴 −𝑔 𝑑𝑡+ 𝑛 𝑑𝑡 𝑥= 0 𝑡 𝐴−𝑔 𝑑𝑡+ 0 𝑡 𝑛 𝑑𝑡 Error accumulates dramatically with time

8 Subtraction of gravity non-trivial in 2D or 3D

9 Subtraction of gravity in 2D
𝑎 𝑥 𝑎 𝑦 y 1D equation → 𝐴 𝑚𝑒𝑎𝑠 = 𝑎 𝑎𝑐𝑐𝑙 + 𝑔 2D equations (y axis pointing upwards) 𝜃 x 𝐴 𝑥 = 𝑎 𝑥 g 𝐴 𝑦 = 𝑎 𝑦 + 𝑔

10 Subtraction of gravity in 2D
𝑎 𝑥 𝑎 𝑦 1D equation → 𝐴 𝑚𝑒𝑎𝑠 = 𝑎 𝑎𝑐𝑐𝑙 + 𝑔 y x 2D equations (y axis pointing upwards) 𝜃 𝐴 𝑥 = 𝑎 𝑥 g 𝐴 𝑦 = 𝑎 𝑦 + 𝑔 𝐴 𝑥 = 𝑎 𝑥 + 𝑔𝑠𝑖𝑛𝜃 𝐴 𝑦 = 𝑎 𝑦 + 𝑔𝑐𝑜𝑠𝜃 2D equations (arbitrary rotation of phone) We need to know the the orientation to subtract gravity 𝜃 Inaccurate orientation will not eliminate gravity, resulting in errors (which accumulate over time)

11 Accelerometer is an orientation sensor!!
An interesting idea 𝐴 𝑥 = 𝑎 𝑥 + 𝑔𝑠𝑖𝑛𝜃 𝐴 𝑦 = 𝑎 𝑦 + 𝑔𝑐𝑜𝑠𝜃 2D equations (arbitrary rotation of phone) Suppose the phone is at rest, then 𝑎 𝑥 =0, 𝑎 𝑦 =0 𝐴 𝑥 = 𝑔𝑠𝑖𝑛𝜃 𝑠𝑖𝑛𝜃 = 𝑔 𝐴 𝑥 Accelerometer is an orientation sensor!! Need the accelerometer to be at rest to estimate rotation However accelerometer alone is not sufficient if we need 3D orientation, more later ..

12 Accelerometer to measure distance
𝑥= 0 𝑡 𝐴−𝑔 𝑑𝑡+ 0 𝑡 𝑛 𝑑𝑡 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

13 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

14 Magnetometer

15 Measures magnetic north (2D example)
y x Consider a 2D example 𝑀 𝑦 = 𝑀 𝑀 𝑥 =0

16 Measures magnetic north (2D example)
y Suppose, phone rotates in 2D by an angle 𝑀 𝑦 = 𝑀𝑐𝑜𝑠𝜃 𝑀 𝑥 =𝑀 𝑠𝑖𝑛𝜃 𝜃 x The same concept generalizes to 3D, 3D magnetometer output { 𝑀 𝑥 , 𝑀 𝑦 , 𝑀 𝑧 } depends on phone orientation Magnetometer can be used to sense the orientation 𝑠𝑖𝑛𝜃= 𝑀 𝑥 𝑀 However, in 3D magnetometer alone is insufficient to determine the orientation

17 3D orientation

18 Foundations of 3D Orientation
East North Up X Y Z Local Frame Global Frame

19 Consider a phone in random orientation
East North Up X Y Z 3D Orientation captures the misalignment between global and local frames

20 3x3 Rotation matrix captures the full 3D orientation
In global frame In local frame 𝑉 East North Up X Y Z 𝑥 𝑙 𝑦 𝑙 𝑧 𝑙 = ⋯ ⋮ ⋱ ⋮ 𝑥 𝑔 𝑦 𝑔 𝑧 𝑔 Rotation Matrix R R is the 3x3 Rotation Matrix 3x3 Rotation matrix captures the full 3D orientation

21 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

22 Gravity equation Gravity globally known, measurable in local frame with accelerometer 𝑎 𝑥 𝑎 𝑦 𝑎 𝑧 = ⋯ ⋮ ⋱ ⋮ −𝑔 Rotation Matrix R 𝑚 𝑥 𝑚 𝑦 𝑚 𝑧 = ⋯ ⋮ ⋱ ⋮ 𝑀 0 Rotation Matrix R Magnetic north, globally known, measurable in local frame with magnetometer 6 equations and 9 unknowns (3x3 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 (3D orientation)

23 Decomposing the rotation matrix
yaw pitch X Y Z roll 3x3 Rotation Matrix R cos⁡(𝑝𝑖𝑡𝑐ℎ) 0 −sin⁡(𝑝𝑖𝑡𝑐ℎ) sin⁡(𝑝𝑖𝑡𝑐ℎ) 0 cos⁡(𝑝𝑖𝑡𝑐ℎ) cos⁡(𝑟𝑜𝑙𝑙) sin⁡(𝑟𝑜𝑙𝑙) 0 −sin⁡(𝑟𝑜𝑙𝑙) 𝑐𝑜𝑠⁡(𝑟𝑜𝑙𝑙) cos⁡(𝑦𝑎𝑤) −sin⁡(𝑦𝑎𝑤) 0 sin⁡(𝑦𝑎𝑤) cos⁡(𝑦𝑎𝑤) = Orientation can be represented as 3D yaw, pitch, roll Estimating yaw, pitch, roll will determine the orientation

24 Accelerometer equation
𝑎 𝑥 𝑎 𝑦 𝑎 𝑧 = ⋯ ⋮ ⋱ ⋮ 𝑔 Rotation Matrix R 𝑎 𝑥 𝑎 𝑦 𝑎 𝑧 cos⁡(𝑟𝑜𝑙𝑙) sin⁡(𝑟𝑜𝑙𝑙) 0 −sin⁡(𝑟𝑜𝑙𝑙) 𝑐𝑜𝑠⁡(𝑟𝑜𝑙𝑙) cos⁡(𝑦𝑎𝑤) −sin⁡(𝑦𝑎𝑤) 0 sin⁡(𝑦𝑎𝑤) cos⁡(𝑦𝑎𝑤) 0 0 −𝑔 cos⁡(𝑝𝑖𝑡𝑐ℎ) 0 −sin⁡(𝑝𝑖𝑡𝑐ℎ) sin⁡(𝑝𝑖𝑡𝑐ℎ) 0 cos⁡(𝑝𝑖𝑡𝑐ℎ) =

25 Accelerometer equation
𝑎 𝑥 𝑎 𝑦 𝑎 𝑧 = ⋯ ⋮ ⋱ ⋮ 𝑔 Rotation Matrix R 𝑎 𝑥 𝑎 𝑦 𝑎 𝑧 cos⁡(𝑟𝑜𝑙𝑙) sin⁡(𝑟𝑜𝑙𝑙) 0 −sin⁡(𝑟𝑜𝑙𝑙) 𝑐𝑜𝑠⁡(𝑟𝑜𝑙𝑙) 0 0 −𝑔 cos⁡(𝑝𝑖𝑡𝑐ℎ) 0 −sin⁡(𝑝𝑖𝑡𝑐ℎ) sin⁡(𝑝𝑖𝑡𝑐ℎ) 0 cos⁡(𝑝𝑖𝑡𝑐ℎ) = Accelerometer output does not depend on yaw! Hence, yaw cannot be estimated using accelerometer

26 Accelerometer equation
𝑎 𝑥 𝑎 𝑦 𝑎 𝑧 = ⋯ ⋮ ⋱ ⋮ −𝑔 Rotation Matrix R 𝑎 𝑥 𝑎 𝑦 𝑎 𝑧 −sin 𝑝𝑖𝑡𝑐ℎ . cos 𝑟𝑜𝑙𝑙 .𝑔 − sin 𝑟𝑜𝑙𝑙 .𝑔 − cos 𝑝𝑖𝑡𝑐ℎ . cos 𝑟𝑜𝑙𝑙 .𝑔 = The above equations estimate pitch and roll

27 Magnetometer equation
𝑚 𝑥 𝑚 𝑦 𝑚 𝑧 = ⋯ ⋮ ⋱ ⋮ 𝑀 0 Rotation Matrix R 𝑚 𝑥 𝑚 𝑦 𝑚 𝑧 cos⁡(𝑟𝑜𝑙𝑙) sin⁡(𝑟𝑜𝑙𝑙) 0 −sin⁡(𝑟𝑜𝑙𝑙) 𝑐𝑜𝑠⁡(𝑟𝑜𝑙𝑙) cos⁡(𝑦𝑎𝑤) −sin⁡(𝑦𝑎𝑤) 0 sin⁡(𝑦𝑎𝑤) cos⁡(𝑦𝑎𝑤) 0 𝑀 0 cos⁡(𝑝𝑖𝑡𝑐ℎ) 0 −sin⁡(𝑝𝑖𝑡𝑐ℎ) sin⁡(𝑝𝑖𝑡𝑐ℎ) 0 cos⁡(𝑝𝑖𝑡𝑐ℎ) =

28 Magnetometer equation
𝑚 𝑥 𝑚 𝑦 𝑚 𝑧 = ⋯ ⋮ ⋱ ⋮ 𝑀 0 Rotation Matrix R 𝑚 𝑥 𝑚 𝑦 𝑚 𝑧 cos⁡(𝑟𝑜𝑙𝑙) sin⁡(𝑟𝑜𝑙𝑙) 0 −sin⁡(𝑟𝑜𝑙𝑙) 𝑐𝑜𝑠⁡(𝑟𝑜𝑙𝑙) cos⁡(𝑦𝑎𝑤) −sin⁡(𝑦𝑎𝑤) 0 sin⁡(𝑦𝑎𝑤) cos⁡(𝑦𝑎𝑤) 0 𝑀 0 cos⁡(𝑝𝑖𝑡𝑐ℎ) 0 −sin⁡(𝑝𝑖𝑡𝑐ℎ) sin⁡(𝑝𝑖𝑡𝑐ℎ) 0 cos⁡(𝑝𝑖𝑡𝑐ℎ) = Pitch, roll known from accelerometer Unknown yaw can be determined from above equations yaw, pitch, roll together determine the rotation matrix (3D orientation) of a system

29 Gyroscope

30 Error accumulates over time
1D example Measures angular velocity 𝑔𝑦𝑟𝑜=𝜔 𝑑𝜃 𝑑𝑡 = 𝜔 𝑑𝜃 𝑑𝑡 =𝜔+𝑛𝑜𝑖𝑠𝑒 Error Time 𝜃= 0 𝑡 𝜔 .𝑑𝑡+ 0 𝑡 𝑛𝑜𝑖𝑠𝑒 . 𝑑𝑡 Error accumulates over time

31 3D rotation estimation with gyroscope
𝜔 𝑥 𝜔 𝑦 𝜔 𝑧 3D angular velocity Rotation Matrix R(t+1) = dR: 3x3 Matrix (from Gyroscope) Rotation Matrix R(t) Captures relative rotation between two times

32 3D rotation estimation with gyroscope
Gyroscope Measurements Rotation Matrix R(t+N-1) dR(t+N-1) 3x3 dR(t+1) 3x3 dR(t) 3x3 Rotation Matrix R(t) …… = dRs have errors Error accumulates with time with gyroscope integration

33 Summary: two ways to measure orientation
Using gyroscope Error accumulates 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 Error Time 𝐴 𝑚𝑒𝑎𝑠𝑢𝑟𝑒𝑑 =𝑔𝑟𝑎𝑣𝑖𝑡𝑦 + 𝑎 𝑚𝑜𝑡𝑖𝑜𝑛

34 Recall UnLoc

35 Can we correct gyro drift using accelerometer/magnetometer like UnLoc

36 High level idea to combine the two
Use gyroscope to track orientation in general Errors will accumulate (drift) Reset errors with accelerometer/magnetometer (When the phone is static and no magnetic interference) Error Time Gyro Gyro + Magn + Accl


Download ppt "Inertial Measurement Unit (IMU) Basics"

Similar presentations


Ads by Google