A Multi-sensor Embedded Microcontroller System for Condition Monitoring of RC Helicopters Artit Jirapatnakul B.S. Electrical Engineering, May 2005 Honors Thesis Research System Capabilities Communicate with sensors IMU: Crossbow IMU400-CC GPS: Novatel Superstar II Compass: Honeywell HMR3100 Data processing Reliable data transmission to computer Visualization in graphical interface Sensors Crossbow IMU400CC Linear acceleration along three orthogonal axes Rotational rates along three orthogonal axes Connected via RS232 at 38.4kbps Novatel Superstar II Latitude and Longitude Velocity Altitude Time and Date Connected via RS232 at 9.6kbps Honeywell HMR3100 Measures heading Connected via RS232 at 9.6kbps Sensors Compass IMU GPS Sensors mounted in plastic containment unit Microcontrollers PIC18F8720 16-bit RISC CPU Up to 10MIPS 3840 bytes RAM dsPIC30F6014 16-bit RISC CPU with DSP Up to 30MIPS 8192 bytes RAM System Design Several processing boards are used Advantages Allows greater number of sensors to be used Boards can be located closer to sensors Distributed processing Disadvantages Slightly greater complexity System Diagram using PIC18s 38.4kbps IMU 57.6kbps Slave PIC* 9.6kbps 57.6kbps Compass Master PIC 9.6kbps * Can also be used with dsPIC instead GPS System Setup using dsPIC Laptop for visualization Sensor box dsPIC development board System setup with dsPIC and IMU connected to laptop Results Sensor monitoring with PIC18 Can PIC18 keep up with data rate of all three sensors? Connected IMU, GPS, and Compass to two PIC18 boards PIC18 boards decoded sensor packets and multiplexed them Results Results Sensor monitoring with PIC18 Communication with sensors successful PIC18 is able to process at data rates of sensors Graphical interface works correctly Results dsPIC processing of IMU data Perform ten sample sliding window RMS calculation in real-time Transmit unprocessed IMU data along with RMS values for three linear accelerations Results Results Statistics calculations on PIC18 Ten sample sliding window RMS calculation by PIC18 compared to calculations in MATLAB Results Statistics calculation on PIC18 Ten sample sliding window skew calculation performed by PIC as compared with calculations in MATLAB Results Statistics calculation on PIC18 Ten sample sliding window kurtosis calculation on PIC18 compared to calculation in MATLAB Future Work Wireless connection between system and computer Design and fabricate small PC boards for system Testing with additional algorithms Actual flight testing Multi-Sensor Fusion For Feature Tracking and Prediction Using Particle Filters Cory Smith M.S. Electrical Engineering, May 2005 Committee Members: Dr. Kenneth Jenkins – Co-advisor Dr. Amulya Garga – Co-advisor Dr. David Hall – Committee Member Presentation Outline Motivation and thesis focus Theory – Kalman and particle filtering, prediction, remaining useful life (RUL) of mechanical systems Results – simulation data and mechanical fault data collected by the Conditioned-Based Maintenance department Decision-level fusion – theory and results Conclusions and further research topics Motivation Tracking in real-world scenarios usually involves systems with non-linear models and non-Gaussian noise Kalman filter provides the optimal solution as long as the system is linear with Gaussian noise Particle filter does not require Gaussian noise distributions and works with both linear and nonlinear models Focus of the Thesis Compare Kalman and particle filters with regard to their ability to track and predict features using simulated data and CBM mechanical fault data Estimate remaining useful life (RUL) of mechanical systems Utilize decision-level data fusion techniques to increase RUL accuracy Kalman Filtering Processing Steps (Gelb, 1974) xˆ (k ) Φ k 1xˆ (k)1 Pk( ) Φ k 1Pk(1)Φ k 1T Q k 1 K k Pk( ) H k T R k H k Pk( ) H k T z k H k xˆ (k ) v k xˆ (k ) xˆ (k ) K k z k H k xˆ (k ) Pk( ) I K k Hk Pk( ) 1 Predict Forward Compute Kalman Gain Receive Measurement Update Prediction Kalman Filtering Models for Application State Vector: Transition Matrix: Measurement Vector: Process Noise Matrix: xk xˆ k xk xk 1 Φ k 0 1 0 0 Estimating position, velocity and acceleration 1 2 2 1 1 H k 0 0 201 5 Q k 18 4 16 3 4 1 3 3 1 2 2 1 8 Based on kinematics: xk xk 1 xk 1 12 xk 1 2 Only measuring position 3 2 1 2 2 w 1 6 Derivation may be found in (BarShalom, 1993) Particle Filter Fundamentals Particle filters do not rely on any assumptions regarding noise distributions or linear models Utilizes Monte Carlo (MC) Integration to approximate the true density Choose an initial proposal density (Ex: Gaussian) to get started, then use the prior distribution as the proposal As the number of samples approaches infinity, the proposal density approaches the true density The particle filter is more computationally intensive than the Kalman filter Particle Filter Processing Flow (Ristic, 2004) x (ki )( ) ~ p (x k | x (ki)1( ) ) Draw Samples from Proposal Density (Predict Forward) xˆ (ki )( ) Φ k xˆ (ki)1( ) w k Receive Measurement z k h k (x k , v k ) z x(i )( ) 2 k k wk(i ) exp 2R k xˆ k 1 x(k ) wkT new proposal p(x k 1 | x i () k ) Compute Particle Weights Update Proposal Particle Filter Graphical Representation (Doucet, 2001) Initial Proposal Density (Ex. Gaussian) ~ x k( i ) {i 1,..., N } Sample from Proposal Density and Predict Forward True Underlying Posterior Density p( xk | zk ) Take measurement, compute likelihoods, and weight particles accordingly. This becomes the new proposal density for k+1. xk( i ) {i 1,..., N } Particle Filter Degeneracy Phenomenon After a few iterations, all but one particle will contain negligible weight. Solution: Resample (Ristic, 2004) Refine proposal density by sampling from the particles with high weights and discarding those with negligible weights. This will focus on “important” areas of the distribution giving it more “definition” to resemble the true underlying distribution Particle Filter Resampling (Ristic, 2004) p( xk | zk ) Resample from “important areas” of the estimated density New normalized particles for k+1 ~ xk(i )1 {i 1,..., N } Prediction The Kalman and particle filters may be used to estimate the state without any measurement updates The prediction relies only on the prediction equations for each filter: xˆ k n Φk n xˆ k x(ki) n Φ k n x(ki )( ) (KF) (PF) T Pk n Φk n Pk Φk n Q k n xˆ x( ) wT k n k n k The state transition and process noise matrices become a function of the time interval since the last measurement: Φk n 1 n 0 1 0 0 1 2 (n ) 2 n 1 Qk n 201 (n )5 18 (n ) 4 16 (n )3 (n ) 4 3 1 ( n ) 3 2 1 ( n ) 2 1 8 ( n )3 2 2 1 ( n ) 2 v 1 6 Remaining Useful Life (RUL) Feature Value Predicted Track with Confidence Intervals Failure Threshold Detection Threshold Failure Threshold Crossing Feature Track RUL Time • RUL is the amount of time left before a system reaches mechanical failure Third-Order Simulation Third-order simulation data 2 3 was generated using the model: f (t ) 1 2t 5t 5t where is zero-mean Gaussian noise ~ N(0,0.2) Feature Plot Tracking Error 3rd Order Simulation Data 3rd Order Simulation Tracking Results Particle Filter, Proc. Noise = 0.9 Particle Filter, Proc. Noise = 0.09 Particle Filter, Proc. Noise = 0.009 Kalman Filter, Proc. Noise = 0.9 Kalman Filter, Proc. Noise = 0.09 Kalman Filter, Proc. Noise = 0.009 0.7 Absolute Error (Feature Value) 14 12 Feature Value 10 8 6 4 2 0 0 20 40 60 Time (Hrs.) 80 100 0.6 0.5 0.4 0.3 0.2 0.1 0 100 200 300 400 500 600 700 Number of Particles (N) 800 900 1000 Third-Order Simulation Tracking Results 14 12 14 10 Feature Value 10 Feature Value Actual Data Kalman Filter Track, Proc. Noise = 0.009 12 Particle Filter Track (N=1000), Proc. Noise = 0.9 Actual trajectory Kalman filter track, Proc. Noise = 0.009 Particle filter track (N=100) , Proc. Noise = 0.9 8 6 6 4 4 2 2 0 0 8 0 20 40 60 80 100 0 20 14 Actual Data Kalman Filter Track, Proc. Noise = 0.009 Particle Filter Track (N=100), Proc. Noise = 0.009 12 14Actual 10 10 8 6 6 4 2 2 0 20 40 60 Time (Hrs.) 80 100 100 8 4 0 80 Data Kalman Filter Track, Proc. Noise = 0.009 12Particle Filter Track (N=1000), Proc. Noise = 0.009 Feature Value Feature Value Time (Hrs.) 40 60 Time (Hrs.) 0 0 20 40 60 Time (Hrs.) 80 100 Particle Paths Proc. Noise = 0.009 Particle Paths, Proc. Noise = 0.009 12 12 10 10 8 8 6 6 Feature Value Feature Value Proc. Noise = 0.9 Particle Paths, Proc. Noise = 0.9 4 2 0 4 2 0 -2 -2 -4 -4 -6 44 46 48 50 52 Time (Hrs.) 54 56 • With the high process noise many particles are discarded during resampling -6 44 46 48 50 52 Time (Hrs.) 54 • By lowering the process noise, more particles have sufficient weight 56 Computational Comparison • Kalman filter is O(2d3) dominated by the covariance update • The computation time for both filters was computed using cputime in Matlab • Plot shows that increasing the number of particles increases the computational costs as expected Average Computation Time (seconds) • Particle filter is O(Nd2) from individual particle propagation (Gustafsson, 2002) 5 Particle Filter, Proc. Noise = 0.009 Kalman Filter, Proc. Noise = 0.009 4 3 2 1 0 100 200 300 400 500 600 700 Number of Particles (N) 800 900 1000 Simulation Prediction Results Time = 26 Time = 50 10 9 8 8 6 7 4 4 2 5 0 20 40 60 Time (Hrs.) 80 0 100 4 2 10 1 2 3 4 5 2 2 100 6 7 8 9 10 6 4 80 100 8 4 40 60 Time (Hrs.) 80 10 1 6 20 40 60 Time (Hrs.) 12 8 0 20 Time = 90 Feature Value 12 0 0 3 Time = 75 Feature Value Measurements 10 Feature track 8 Feature prediction 95% Confidence bounds 6 Failure threshold 6 2 0 12 Feature Value 10 Feature Value 12 0 0 20 40 60 Time (Hrs.) 80 100 H-60 Intermediate Gearbox (IGB) 3 Separate Seeded Fault Run to Failure Tests EDM Notch Initiated at Input Pinion Tooth Root (EDM: Electrical Discharge Machine) 2 Accelerometers (100kHz sampling) Source: NAVAIR 4.4.2 Patuxent River Naval Air Station NAWCAD Helicopter Data FM0 Feat.Avg.All.FM0 4.5 80 Raw Data Smoothed Data 4 Actual RUL Particle Filter Estimate (N=1000) Particle Filter Lower 95% Conf. Interv. Kalman Filter Estimate Kalman Filter Lower 95% Conf. Interv. 70 3.5 50 RUL Feature Value 60 3 40 30 2.5 20 2 10 1.5 0 10 20 30 40 50 Time 60 70 80 90 0 10 20 30 40 50 Time 60 70 80 NAWCAD Helicopter Data SBlvl Feat.Avg.All.SBlvl 0.35 70 Raw Data Smoothed Data 0.3 60 50 0.2 RUL Feature Value 0.25 40 0.15 30 0.1 20 0.05 10 0 0 10 20 30 40 50 Time 60 70 80 90 Actual RUL Particle Filter Estimate (N=1000) Particle Filter Lower 95% Conf. Interv. Kalman Filter Estimate Kalman Filter Lower 95% Conf. Interv. 0 10 20 30 40 50 Time 60 70 80 References Bar-Shalom, Y., Li, X.-R., Estimation and Tracking: Principles, Techniques, and Software, Boston, MA, Artech House, 1993. Cleveland, W. S., “Robust Locally Weighted Regression and Smoothing Scatterplots,” Journal of the American Statistical Association, Vol. 74, No. 368,Dec. 1979, pp. 829-836. Doucet, A., Freitas, N., Gordon, N., Sequential Monte Carlo Methods in Practice,New York, NY, Springer-Verlag, 2001. Erdley, J., “Data Fusion for Improved Machinery Fault Classification,” M.S. Thesis in Electrical Engineering, The Pennsylvania State University, University Park, PA, May., 1997 Gelb, A., and technical staff of The Analytic Sciences Corportation, Applied Optimal Estimation, The M.I.T. Press, Cambridge, Massachusetts, and London, England,1974. Gustafsson, F., Gunnarsson, F., Bergman, N., Forssell, U., Jansson, J., Karlsson, R., and Nordlund, P.-J., “Particle Filters for Position, Navigation, and Tracking,” IEEE Transactions on Signal Processing, Vol. 50, No. 2, Feb. 2002, pp. 425-237. McClintic, K. T., “Feature Prediction and Tracking for Monitoring the Condition of Complex Mechanical Systems,” M.S. Thesis in Acoustics, The Pennsylvania State University, University Park, PA, Dec., 1998 Ristic, B., Arulampalam, S., Gordon, N., Beyond the Kalman Filter, Boston, MA, Artech House, 2004. Third-Order Simulation Particle Distributions Time =at50 Particle Distributions TimeHrs. = 50 0.05 = 0.009 N=100, Proc. Noise = 0.9 0.015N=100, N = 100, Proc. Noise = 0.9 N = 100,Proc. Proc. Noise Noise = 0.009 Weight Weight 0.04 0.03 0.02 0.01 0.005 0.01 0 2 4 6 0 8 N = 500, Proc. NoiseNoise = 0.9 N=500, Proc. = 0.9 0.01 0.005 0 0 0 2 4 6 8 -3 1 0 2 4 6 8 2 4 6 8 Proc. Noise = 0.009 N=1000, Proc. Noise = 0.9 N=1000, x 10 N = 1000, Proc. Noise = 0.009 N = 1000, Proc. Noise = 0.9 -3 x 10 1.5 1 Weight Weight 6 x 10 N=500, Proc. Noise = 0.009 N = 500, Proc. Noise = 0.009 0 8 4 2 0 4 3 -3 6 2 2 Weight Weight 0.015 0 0 2 4 Feature Value 6 8 0.5 0 0 Feature Value