Kalman filters reportedly came to prominence in the early years of the space program as a result of their success in definitively tracking space exploration vehicles. Kalman filters are mathematical processes first applied to extract vehicular courses or trajectories from noise-filled, measured radio-telemetry navigational data. Navigational data involves numerous degrees of freedom, such as roll, pitch, and yaw combined with forward, sideways, and vertical motions. Following a vehicle motion involves simultaneous application of the Kalman filter to each spatial dimension. Simultaneous, multiple filtering requires the application of advanced high-speed matrix algebra that goes beyond the introductory nature of this work. Kalman filtering is often taught by the application of mathematics to models of motion in a single dimension in which the uncertainty in position as a function of time is significantly reduced. The mathematical modeling of an error in a one-dimensional position as a function of time is equivalent to that of errors in a time-based sensor data stream.1 (See Prof. M. van Biezen presenting the first six lectures of “The Kalman Filter” for an excellent qualitative and quantitative demonstration of the filter theory and practical single-dimension application to the smoothing of a temperature sensor data stream.)
Kalman filtering can be used to significantly reduce or smooth the noise present in the output of a sensor data stream in which the errors in measurement form a Gaussian or normal distribution about the true value of the parameter being monitored.
The Single-Dimension Kalman Filter Process
As noted, in a Kalman filter smoothing of a single-dimension data stream, it is assumed that the errors in the data stream are of a Gaussian or normal distribution. (See Chapter 7, “Data Errors, Quality Control: Quality Assurance with Statistical Process Control.”) A Gaussian distribution is completely defined by its mean value and the variance; hence, the error distributions in the previous, present, and future data points of a data stream are well defined and amenable to processing with the Kalman filter.
In very simplified terms, a Kalman filter can be considered as an iterative mathematical process in which the past data is used to estimate a correction to be applied to the present data in order to predict a more accurate estimate of a future, true value in a data stream. A Kalman filter uses three functions to continuously refine the value of a data stream by determining three parameters called the Kalman Gain, then using the error in the estimate and the error in the measurement to converge on a better estimate of the true value of the streamed data. A Kalman filter converges very quickly on a final output variable value and only uses a few points of data from the recent past to achieve the convergence.
As can be seen in Figure 10-3, with an FSD of 21.25 to 22.50oC or 1.25oC, a nominal 1oC temperature jump in an insulated aluminum dry well, as measured by a mercury-in-glass thermometer, produced a 0.84oC recorder-tracing deflection from 10:50 to 11:00. (For dry-well configuration, see Chapter 3, Figure 3-3, High Heat and Temperature.) The cooling curve from 11:00 to 13:00 is marked by the temperature variations caused by the on/off cycling of the building’s central heating system. As with other time-based recorded data streams, the tendency for heat to flow and the limitations of insulation to retard that flow are graphically illustrated by the periodic temperature fluctuations in the aluminum mass.
Although the Kalman filter and signal averaging can greatly reduce the baseline noise in a data stream, there are electronic limitations imposed by the analog to digital converter (ADC) on the amount of scale expansion that can be used to increase signal sensitivity.
In Figure 10-4, certain areas of the trace containing “square steps” are marked with black arrows. The square portions of the trace are in reality the limit of resolution possible with a 10-bit ADC on the Arduino. The stream of data coming from the Arduino is the series of numerical values that have been created when the analog voltage from the sensor passes through the analog-to-digital converter on the microcontroller. At high sensitivities, low temperature differentials are being read, and as the sensitivity is increased to display smaller and smaller temperature differentials eventually the unit-value steps of the ADC are resolved.
The Kalman filter and signal-smoothing statistical packages from the DAQFactory plotting software are able to increase the resolution of the temperature differentials to the point at which the individual digital transitions become visible and limit any further scale expansion.
Sensitivity can be increased in many data-acquisition applications by inserting an analog front end between the sensor and the data-acquisition system in the form of an ASIC, such as the LMP9100, 9150, or 91200 AFE chips from Texas Instruments, or as a circuit built from common components as described in Chapter 9.
Code Listings
DAQFactory Sequence Code for Plotting a Data Stream on Com3
Summary
Kalman filters originally implemented in three dimensions to track and position space vehicles from noisy telemetry data have found use in reducing the noise in single-dimension data streams from experiments.
A Kalman filter iteratively uses three parameters called the Kalman gain, the error in the estimate, and the error in the measurement to converge on a more accurate estimate of the true value of the streamed data.
An Arduino microprocessor using a Kalman filter library provides a voltage-based data stream for microprocessor plotting and a temperature-based data stream for a DAQFactory plotting of single-dimension sensor data streams.