1. Roll Angle Estimation
using Thermopile Sensors
ANDRE LUIZ ALCANTARA OSTRUFKA
MARCUS PEREIRA
PROFESSOR: DR. JONATHAN ROGERS
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
2. MOTIVATION AND GOALS
MOTIVATION
•Use low cost sensors and filtering techniques for attitude estimation in order to reduce the cost of
UAVs
•These low cost sensors can also be used to perform redundant measurements to increase robustness.
•These sensors can be easily replaced and purchased in bulk.
GOAL
•To estimate the roll angle state of a test platform using data from thermopile sensors and compare
the estimates with ”truth” data from an IMU (Inertial Measurement Unit)
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
3. TOPICS
•THERMOPILE / IMU
•ELECTRIC CIRCUIT
•SOFTWARE
•SYSTEM MODELING
•EXTENDED KALMAN-FILTER(EKF)
•IMPLEMENTING THE HYBRID EKF ALGORITHM
•DATA PROCESSING
•PLOTS AND RESULTS
•FUTURE DIRECTIONS
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
4. THERMOPILE / IMU
•Thermopile sensors are electric devices that convert
thermal energy into electric energy
•They are composed of several thermocouples connected
usually in series
•Thermopiles detect the temperature of an object by
absorbing the infrared (IR) radiation that emits from the
object’s surface
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
From left to right:
sensor mount, Heimann
HMS J11F5.5
thermopile sensor, and
signal conditioning
circuit board.
5. THERMOPILE / IMU
•The ground and the sky have different IR
emissivity as seen in the plot.
•The output voltage of a thermopile sensor can
be approximated by a sine function, when the
roll angle is varied from 0 to 360 degrees.
•Data from two thermopile sensors in opposite
directions can be used for Horizon Seeking.
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
6. THERMOPILE / IMU
•Thermopile sensor: Heimann HMS J11F5.5
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
•9 Degrees of Freedom - Razor IMU
•It has an ITG-3200 (MEMS triple-axis gyro),
ADXL345 (triple-axis accelerometer), and HMC5883
(Triple-axis magnetometer). However, we use just
the gyro data for roll angle measurement of the
platform.
9. SOFTWARE
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
•Timer A: Interrupts every 20ms (approximately equal to the IMU sampling time)
• GPIO: Pins P5.5 and P5.4 are configured to tertiary function (ADC module). P5.5 corresponds to
ADC module A0 and P5.4 corresponds to ADC module A1
•ADC is configured to operate in multi-sequence mode, so that the data from both sensors can be
acquired simultaneously.
•The memory location MEM0 was set to store the data from module A0 and MEM1 from module
A1.
•Output from Pin P2.4 to the gate of a BJT transistor is used to turn on the transmission of IMU
data onto the Serial Monitor of the Adruino IDE. The IMU firmware code was modified to ouput
roll angle data only at a frequency of 50 Hz (or 20 ms sampling time).
•Pin P1.4 (Button S2) is used to start the data acquisition process from Thermopile sensors and
the IMU at the same time.
10. ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
12. EXTERNDED KALMAN-FILTER (EKF)
•Kalman filtering is an algorithm that uses a series of measurements observed over time, and
produces estimates of unknown variables (in our case roll angle) that tend to be more precise
than those based on a single measurement alone.
•The Extended Kalman filter (EKF) is the nonlinear version of the Kalman filter which linearizes
about an estimate of the current mean and covariance of the unknown state variable.
•In our case we need to use the Extended Kalman Filter because the measurement model is a
non-linear function of the state variable (sinusoidal function the roll angle), although the
system’s dynamics model is linear.
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
13. ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
IMPLEMENTING
THE HYBRID EKF
ALGORITHM
14. DATA PROCESSING
Steps:
1. Process calibration data:- To be obtained by rotating the test platform 360 degrees 3-4 times
before flight tests. This is required to determine the scale factor (amplitude of approximated sine
wave function) for the measurement model of the Hybrid EKF. (Plot shown in subsequent slides)
2. Implement Moving Average (MA) Filters:-
Thermopile data – 4th order MA filter
IMU data – 45th order MA filter
3. Implement the Hybrid EKF Algorithm to Estimate Roll Angle .
4. Compare with IMU roll angle data to determine Estimation Error and calculate the Average RMS
estimation error.
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
15. RESULTS / ANALYSIS
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
1. Calibration: Using fit() in MATLAB
General model Sin1:
f(x) = a1*sin(b1*x+c1)
Coefficients (with 95% confidence bounds):
a1 = 0.2974 (0.2948, 0.3)
b1 = 0.002717 (0.002711, 0.002723)
c1 = -0.6589 (-0.674, -0.6439)
16. EKF Estimated roll angle vs. “True” roll
angle from IMU
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
17. EKF Estimation error compared to IMU
data
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)
Average RMS error = 5.7075 degrees
18. FUTURE DIRECTIONS
1. Replicate a similar system for pitch angle estimation and use Sequential Kalman Filtering.
2. Implement this attitude estimation system for feedback control of a quadcopter.
3. Implement the above controller in real time using a Raspberry Pi.
4. Use the quaternion version of Extended Kalman Filter as an alternative (MEKF –
Multiplicative Extended Kalman Filter).
5. Proper modelling for measurement equation (using compressed sine wave function to
remove estimation error near peaks).
6. Better calibration methods (estimation is very sensitive to scale factor from calibration).
ME 4405 - FUNDAMENTALS OF MECHATRONICS (SPRING 2016)