Module 2.1 - Accel
Module 2.1 - Accel
Accelerometer
Module 2 – Part 1
Outline
1. Sensor Types
2. MEMS Accelerometer Measurements
3. Accelerometer Main Parameters
4. Applications: Orientation Angles Estimation
5. MEMS Accelerometer Construction
6. Accelerometers Classification
7. Applications: Device Displacement Estimation
2
2.1
Sensor Types
Sensors Overview
An accelerometer (Accel) measures all linear forces that are working on an object.
The gyroscope (Gyro) gives the rate of change of angular velocity over time that is working
on an object.
These two sensors gathered together form Inertial Measurement Unit (IMU).
The magnetometers (Magnet) are used to measure the strength of the magnetic field and in
some cases direction of the field.
Addition of Magnetometer to the IMU forms Attitude and Heading Reference System
(AHRS).
4
Sensors Overview
Nowadays many commercially available Accelerometers and Gyroscopes are
fabricated using Micro-Electro-Mechanical Systems (MEMS).
The production process for the MEMS sensors combines Silicon and Mechanical
functions on the same micrometer silicon substrate.
Hall effect is the basis for the most Magnetometer sensors commonly applied in phones,
vehicles and position sensors.
5
Accelerometer Applications
Accels are typically used in one of three modes:
6
2.2
Measurements
8
Check Point
Let’s record accelerometer measurements using xSens device in predefined
positions:
Z axis upward;
X axis upward;
Y axis upward;
Plot the measurements using MATLAB and check the correspondence of data
signs to the physical sense.
9
2.3
Main Parameters
Accelerometer Parameters
A typical accelerometer has the following basic specifications:
Number of axes
which value depends on the amount of
acceleration applied;
Output range (FS)
Digital - output is a PWM signal (older
Sensitivity (mg/LSB or LSB/mg) ones); output their value using multi-wire
Typical zero-g level offset accuracy digital protocols such as I2C or SPI.
Zero-g level change vs. temperature There are 1 axis, 2 axes (most familiar
Plot the measurements using MATLAB and visually check the deviations from the
mean value;
Estimate biases for each coordinate axis measurements and display their values
using fprintf() function in command window.
14
Accel Bias and Noise - xSens
15
2.4 Applications
17
Gravity Sensor Application
Accel sensors measure the difference between any linear acceleration in the Accel’s
reference frame and the Earth's gravitational field vector.
In the absence of Linear Acceleration, the Accel’s output can be used to determine the
Pitch and Roll orientation angles.
The most common order is the aerospace sequence of yaw then pitch and finally a roll
rotation (XYZ).
Accel sensors are insensitive to rotations about the Earth's gravitational field vector
(Z-axis). The equations for the roll and pitch angles therefore have mathematical
instabilities when rotation axes (X or Y) happen to become aligned with Gravity and
point upwards or downwards.
18
Extracting Gravity
Simple Low-pass filter can be applied (-filter):
❑ ⃗
𝐺𝑘=𝛼 ∙ ❑⃗ ( ) ❑⃗
𝐵 𝐵 𝐺 𝑘− 1 + 1 − 𝛼 ∙ 𝐵 𝑎𝑘
( )
❑
𝐵 𝐺𝑘𝑋
❑ ⃗ 𝐵
( ❑ ❑
𝐸𝑎 )
𝐵 𝐺𝑘= ❑
𝐵 𝐺𝑌
𝑘
= 𝐸 𝑹 𝐸
⃗
𝑔 − ⃗
❑ 𝑍
𝐵 𝐺𝑘
where R is the RM describing the orientation of the Body relative to the Earth’s CS.
There are two assumptions for having an ability to solve the Equation:
The device is lying flat with the Earth's gravitational field aligned with the Z-axis.
( )
❑ 𝑋
𝐵 𝐺𝑘
❑ ⃗
𝐺𝑘= 𝐺𝑌
𝐵
𝑹 ❑
⃗
𝐸𝑔
❑
𝐵 𝐵 𝑘
= 𝐸 ∙
❑ 𝑍
𝐺𝑘
𝐵
20
Roll and Pitch Estimation
() ()( )
0 0 − 𝑠𝑖𝑛 ( 𝜃 )
𝐵
𝐸 𝑹 𝑋𝑌𝑍 0 =𝑹 𝑋 ( 𝜑 ) 𝑹𝑌 ( 𝜃 ) 𝑹 𝑍 ( 𝜓 ) 0 = 𝑐𝑜𝑠 ( 𝜃 ) 𝑠 𝑖𝑛 ( 𝜑 )
1 1 𝑐𝑜𝑠 ( 𝜃 ) 𝑐𝑜𝑠 ( 𝜑 )
() ()( )
0 0 𝑠 𝑖𝑛 ( 𝜑 ) 𝑠 𝑖𝑛 ( 𝜃 )
𝐵
𝐸 𝑹 𝑍𝑋𝑍 0 =𝑹 𝑍 ( 𝜑 ) 𝑹 𝑋 ( 𝜃 ) 𝑹 𝑍 ( 𝜓 ) 0 = 𝑐𝑜𝑠 ( 𝜑 ) 𝑠 𝑖𝑛 ( 𝜃 )
1 1 𝑐𝑜𝑠 ( 𝜃 )
Note that roll, pitch and yaw rotation angles are meaningless without first defining
the order in which these rotations are to be applied.
( )( )
⃗
❑
❑
𝐵 𝐺𝑘𝑋 − 𝑠𝑖𝑛 ( 𝜃 )
𝐺𝑘
𝐵 1
= ❑ 𝑌
𝐺𝑘 = 𝑐𝑜𝑠 ( 𝜃 ) 𝑠 𝑖𝑛 ( 𝜑 )
‖ 𝐺‖
❑⃗
√ (❑𝐵 𝐺𝑘𝑋 ) +( ❑𝐵𝐺𝑌𝑘 )
2 2 𝐵
𝑍 2
+ ( 𝐵 𝐺𝑘 )
❑
𝐵 𝑘 ❑
𝐵 𝐺𝑘
𝑍
𝑐𝑜𝑠 ( 𝜃 ) 𝑠 𝑖𝑛 ( 𝜑 )
❑ 𝑌 ❑ 𝑋 ❑ 𝑋
𝑡𝑎𝑛 ( 𝜑 𝑋𝑌𝑍 ) =
𝐵 𝐺𝑘 − 𝐵 𝐺𝑘 − 𝐵𝐺 𝑘
❑ 𝑍 𝑡𝑎𝑛 ( 𝜃 𝑋𝑌𝑍 ) = ∨𝑠𝑖𝑛 ( 𝜃 𝑋𝑌𝑍 ) =
𝐵 𝐺𝑘 2
√
( 𝐵𝐺𝑘 ) + ( 𝐵 𝐺𝑘 )
❑ 𝑌 ❑ 𝑍 2
‖𝐵 𝐺𝑘‖
❑⃗
The convention used in the aerospace sequence is that the roll angle can range
between [-180°; 180°] but the pitch angle is restricted to [-90°; 90°].
22
Roll and Pitch Estimation (XYZ)
The convention used in the aerospace sequence is that the roll angle can range
between [-180°; 180°] but the pitch angle is restricted to [-90°; 90°].
23
Roll and Pitch Estimation (ZXZ)
Again normalizing gravity vector components and substituting the values of RM, we
get the following equation:
( )( )
⃗
❑
❑
𝐵 𝐺𝑘𝑋 𝑠 𝑖𝑛 ( 𝜑 ) 𝑠 𝑖𝑛 ( 𝜃 )
𝐺𝑘
𝐵 1
= ❑ 𝑌
𝐺𝑘 = 𝑐𝑜𝑠 ( 𝜑 ) 𝑠 𝑖𝑛 ( 𝜃 )
‖ 𝐺‖
❑⃗
√ (❑𝐵 𝐺𝑘𝑋 ) +( ❑𝐵𝐺𝑌𝑘 )
2 2 𝐵
𝑍 2
+ ( 𝐵 𝐺𝑘 )
❑
𝐵 𝑘 ❑
𝐵 𝐺𝑘
𝑍
𝑐𝑜𝑠 ( 𝜃 )
𝑡𝑎𝑛 ( 𝜑 𝑍 𝑋𝑍 ) =
❑
𝐵 𝐺𝑘
𝑋
𝑡𝑎𝑛 ( 𝜃 𝑍 𝑋𝑍 )=
√ ( ❑
𝐵 𝐺
𝑋 2
𝑘) +( ❑
𝐵 𝐺
𝑌 2
𝑘 )
❑ 𝑍
❑
𝐵 𝐺
𝑌
𝑘 𝐵𝐺 𝑘
24
Check Point
Calculate the roll and pitch angles which define the orientation of the device
relative to the starting position with respect to the level plane (the table plane),
assuming the aerospace rotation sequence XYZ for the device Accel readings:
( )
0.461105
❑ ⃗
𝐺𝑘= 0. 082198
𝐵
− 0.887432
The ATAN2 function automatically returns the angle (in radians) in the correct quadrant
based on the signs of the two arguments.
25
Atan vs. Atan2
Definition:
Simple check:
26
Check Point
Record accelerometer measurements (all cases in one log file) using xSens device
corresponding to the following:
10 sec. in steady state on the table;
Plot the measurements using MATLAB and visually check the data behavior;
Write function for calculating Roll and Pitch values from accelerometer
measurements;
Plot the estimated angles on the same plots as the corresponding angles written
in log (calculated by xSens device), i.e. one plot for one angle.
27
2.5
MEMS Accelerometers
𝑄 𝜀0 ∙ 𝜀𝑟 ∙ 𝐴
𝐶 1= =
𝑉 𝑑
where
Q is the charge;
V is the applied voltage;
A is the plates area;
d is a distance between fixed plates and mass;
denotes dielectric constant of air, F/m;
is the dielectric constant of substrate relative to air. 29
Mass-Spring System
2
𝑑 ❑𝑥 𝑘𝑥
− =0
𝑑𝑡
2
𝑚
𝑘𝑥
𝑎=
𝑚
where
k is the spring constant;
m is the mass of the object;
x is the displacement.
30
Mass-Spring System
𝜀0 ∙ 𝜀𝑟 ∙ 𝐴 𝜀0 ∙ 𝜀𝑟 ∙ 𝐴 𝜀0 ∙ 𝜀𝑟 ∙ 𝐴
𝐶 1= 𝐶 2= , 𝑄1 +𝑄 2=0 𝐶 1 ≠ 𝐶 2 , 𝐶 1= , 𝐶2 =
𝑑 𝑑+𝑥 𝑑−𝑥
𝐶1 (𝑉 0 − 𝑉 𝑥 )+ 𝐶2 (− 𝑉 0 − 𝑉 𝑥 )= 0
𝑉 0−𝑉 𝑥 −𝑉 0 −𝑉 𝑥
+ =0
𝑑−𝑥 𝑑+ 𝑥
𝑉 𝑥 𝑑
𝑥=
𝑉 0
𝐹 =𝑚𝑎= − 𝑘𝑥 𝜀 0 ∙ 𝜀𝑟 ∙ 𝐴 𝜀0 ∙ 𝜀𝑟 ∙ 𝐴
𝐶 1= ,𝐶2 =
𝑑+𝑥 𝑑−𝑥
𝒌 𝑽 𝒙 𝒅
𝒂= −
𝒎𝑽 𝟎
32
MEMS Construction
𝜀0 ∙ 𝜀𝑟 ∙ 𝐿 ∙ 𝑊
𝐶=
𝑑
where
L is a length of adjoining fixed plate and mass;
W is a thickness of fixed plate and mass;
d is a distance between fixed plates and mass. 33
How it works
34
3D Accelerometer
There are three accelerometer sensors mounted
orthogonally
35
2.6
Accelerometers
Classification
Accelerometer Classifications
There are two classifications: a) based on response and b) on built principles.
Response-based classification
The most common AC-response Accels use piezoelectric elements for their sensing
mechanism.
40
Piezoelectric Effect
Piezoelectricity is the ability of some materials to generate an
electric potential in response to applied mechanical stress.
Are housed in a hermetic, welded metal case and can be considered one of the most
durable sensors because of its ability to tolerate hostile environmental conditions.
43
Voltage Mode Accelerometers
Unlike a charge mode devices that only contains ceramic sensing element(s), these
device includes a microelectronic circuit which limits the operating temperature of the
device to usually tops at +125°C.
Such devices feature 3-wire or 2-wire mode. The 2-wire mode is also known as
Integral Electronics PiezoElectric (IEPE). IEPE is most popular due to its convenient
coaxial configuration in which the AC signal is superimposed on the DC power line.
Full scale range is pre-determined by the internal amplifier at the factory and cannot
be altered.
Are available in very small footprint and are suited for dynamic measurements in
lightweight structures.
44
2.8
DC-Response Types
Overview
The output of such Accels is DC coupled and can respond down to 0 Hz.
46
Capacitive Accelerometers
The measurement of capacitance changes in the seismic mass under acceleration is
the most common technology used for accelerometer today.
Typically suffers from poor signal-to-noise ratio and limited dynamic range.
Bandwidth is mostly limited to a few hundred Hz partly due to its physical geometry
and its heavy gas damping.
Maximum range of acceleration measurement is typically limited to less than 200g’s.
Are suited for measuring low frequency motion where the g level is also low.
47
Piezoresistive Accelerometers
Produces resistance changes in the strain gages that are part of the Accel’s seismic
system.
Designs are either gas damped (MEMS types) or fluid damped (bonded strain gage type)
For very high g shock measurements, some designs can handle acceleration levels well
above 10,000 g’s.
Can be used to accurately derive the velocity and displacement without integration
error. Are commonly used in automotive safety testing, weapons testing, and high
shock range measurements. 48
2.9 Applications
For picking out Gravity sensor from the Accelerometer readings Low-pass filter (LPF) is
usually applied. Then:
⃗ 𝑘𝑓𝑖𝑙𝑡
𝑢
❑
⃗
𝑎𝑘 ❑ ⃗
𝐺𝑘 ⃗𝑎𝑐𝑐
❑
⃗
𝑎𝑘 ⃗
❑
𝑙 𝑎𝑘
𝐵 𝐵 𝑢𝑘 𝐸 𝐸
❑
𝐵
⃗
𝑎𝑘
❑
❑ ⃗
𝑑𝑘
❑
⃗
𝑣𝑘
𝑓𝑖𝑙𝑡
⃗
𝑣𝑘
❑ ⃗
𝑑 𝑘𝑓𝑖𝑙𝑡 𝐸 𝐸 𝐸
𝐸
51
Linear Acceleration Extraction
Having the Gravity vector data, , Linear acceleration is obtained as:
⃗ 𝑎𝑘 − ⃗
𝑙𝑎 𝑘 = ⃗ 𝐺𝑘 ⃗
𝐺 𝑘=𝛼 ∙ ⃗
𝐺𝑘 −1 + (1 − 𝛼 ) ∙ 𝑎
⃗𝑘
52
Accel Tilt Compensation
Obtained by integrating Linear acceleration:
𝑣 𝑣 𝑘 −1 + ⃗
⃗ 𝑘= ⃗ 𝑙𝑎 𝑘 ∙ ∆ 𝑡
53
Velocity Estimation
Obtained by integrating Linear acceleration:
𝑣 𝑣 𝑘 −1 + ⃗
⃗ 𝑘= ⃗ 𝑙𝑎 𝑘 ∙ ∆ 𝑡
order = 1;
filtCutOffF = 0.1;
[b, a] = butter(order, (2*filtCutOffF)/(1/TS), 'high');
velFilt = filtfilt(b, a, vel);
54
Velocity Estimation
55
Displacement Estimation
Obtained by integrating object velocity:
⃗
𝑑𝑘 = ⃗ ⃗𝑘 ∙ ∆ 𝑡
𝑑 𝑘 −1 + 𝑣
56
Displacement Estimation
57
Displacement Estimation
58
Tasks description
1. Capture Accelerometer measurements which correspond to the stationary position of the
device (log 1); stationary but with roll angle equal to 45 ⁰ ( log 2); stationary but with pitch
angle equal to 45⁰ (log 3); stationary but with roll and pitch angles equal to 45 ⁰ ( log 4);
dynamic – start with pitch and roll 0⁰ (5 sec.), then change roll to 45 ⁰ ( log 5).
2. Capture Accelerometer measurements in dynamic mode – for example, start with pitch
and roll 0⁰ (5 sec.), then change roll to 45⁰ (5 sec.), then return back and hold (5 sec.),
then change pitch to 45⁰ (5 sec.), then return back and hold (5 sec.), then change roll
and pitch to 45⁰ simultaneously and hold (5 sec.), then return to initial position.
3. Estimate angles based on Accelerometer measurements for all captured logs and depict
input measurements and estimated output angle values.
59
Tasks description
4. Estimate Accelerometer bias and noise STD using logs corresponded to stationary cases;
5. Capture Accelerometer measurements which correspond to the dynamic mode: move the
device up and down, left and right (log 6); move device straight ahead as far as cable
makes it possible (imitation of flight mode) (log 7);
6. Perform Tilt Compensation for dynamic logs and depict the result plots;
7. Extract Linear Acceleration from dynamic logs and depict the result plots;
8. Calculate displacement of the device from dynamic logs and depict the result plots;
9. Apply high-pass filters to estimated velocity and displacement of the device and compare
the results with the unfiltered case.
60
Well Done and
Thank You for attention!