TECHNICAL FIELDThis invention relates to processing of sensor data and, more particularly to a single chip sensor processor including an on-chip digital filter.
BACKGROUND ARTMicrocontrollers are used in vehicles for processing data from a sensor such as an accelerometer in order to determine whether an air bag should be deployed. Because of vehicle noise and other high frequency components of the sensor signal, filtering is necessary in order to identify the low frequency crash data necessary to make the decision on air bag deployment.
Implementing a digital filter such as an infinite impulse response (IIR) filter in software places a heavy processing load on the CPU of a microcontroller. There is a need to off-load the filtering requirements of the air bag microcontroller in order to more efficiently process the data from the vehicle acceleration sensor.
SUMMARY OF THE INVENTIONIn accordance with the present invention a single chip sensor processor includes an integrated analog to digital converter and digital filter. The converter converts acceleration input data from an analog sensor to digital data and outputs the converted data to the digital filter. The digital filter, preferably an infinite impulse response (IIR) filter receives the converted sensor data at a sampling rate as set by the processor CPU and performs the filtering function in parallel with other processor software executions. This parallel operation effectively increases the bandwidth of the system. The results of the acceleration computation is communicated to a remote air bag microcontroller.
BRIEF DESCRIPTION OF THE DRAWINGSA more complete understanding of the present invention may be had from the following detailed description which should be read in conjunction with the drawings in which:
FIG. 1 is a block diagram of an air bag deployment system.
FIG. 2 is a block diagram showing the various components included in the sensor processor of the present invention;
FIGS. 3 and 3a are flowcharts depicting a program incorporating a software implementation of the IIR filter; and
FIGS. 4 and 4a are flowcharts depicting the program of FIGS. 3 and 3a where the digital filtering is performed on-board the sensor processor.
DETAILED DESCRIPTION OF PREFERRED EMBODIMENTReferring now to the drawings and initially to FIG. 1, an air bag system includes asensor 10 providing acceleration data to asensor processor 12 where the acceleration data is processed and communicated to anair bag microcontroller 14. The microcontroller is programmed to energize an actuator or squib to deploy the air bag depending on the processed acceleration data.
Referring now to FIG. 2 thesensor processor 12 is formed as a single integrated circuit or chip generally designated 20. Thechip 20 include a central processing unit (CPU) 22 that communicates through asystem bus 24 with a clock/timer block 26, random access memory (RAM) 28, and one time programmable read only memory (ROM) 30. Thechip 20 further includes an analog to digital converter (A/D) 32 and adigital filter 34. The operation of the A/D 32 is free-running after initialization by theCPU 22 through settings in an A/Dcontrol register block 36 that provides control parameter for the A/D such as sampling rate. After initialization the A/D 32 converts analog data received from thesensor 10 to digital data x(n) without the need for direct control of the conversion process by theCPU 22. The digital data is communicated to thefilter 34 for processing by the filter. Thesensor 10 is preferably a differential capacitance type sensor such as disclosed in U.S. Pat. No. 5,488,864 assigned to the assignee of the present invention. Thefilter 34 is preferably an Infinite Impulse Response (IIR) filter and performs calculations on the digital data received from A/D 32 using scaling coefficients loaded fromROM 30 into a plurality of filter parameter registers generally designated 38. The output of the filter calculation is stored in anoutput register 40 and is available for fetching by theCPU 22.
TheIIR filter 34 calculates an output value that is placed in theregister 40, based on the present input value plus previous input samples and output results multiplied by scaling coefficients of positive and negative sign. The implementation integrated within the single chip sensor processor uses 8 bit wide sensor data and coefficients for a minimalist implementation. Larger coefficient bit length would allow a greater degree of flexibility in selecting desired filter responses. The general equation implemented by thefilter 34 is as follows:
y(n)= b.sub.0 x(n)+b.sub.1 x(n-1)+b.sub.2 x(n-2)-a.sub.1 y(n-1)-a.sub.2 y(n-2)!/a.sub.0
where x(n) is the most recently acquired sensor signal data input, x(n-1) is the previous data input sample, x(n-2) is the previous, previous, sample. Y(n-1) and y(n-2) are the previous filter result and previous, previous result, respectively. A typical application requiring a low pass second order autorecursive moving average (ARMA) filter with a corner frequency at approximately 1/10 of the sensor sampling frequency would use the following filter coefficients:
b0 =36
b1 =36
b2 =36
a0 =256
a2 =-256
a2 =108
A serialcommunication modulator block 42 provides a modulated output to themicrocontroller 14 representing the result of CPU computation based on the acceleration sensed by thesensor 10.
One of the primary advantages of integrating thedigital filter 32 on theprocessor chip 20 is the increased time available for software execution. Since the sensor signal's filter calculations are performed in parallel with the normal software execution, the software processing bandwidth of the system is increased. This is illustrated in FIGS. 3, 3a, 4, and 4a.
Referring initially to FIG. 3, a typical sensor processing system samples sensor analog signal data by periodically performing an analog-to-digital conversion on the data. The sampling repetition rate is known as the sampling frequency. The step of obtaining a sample is shown in theblock 50. This digital sample is operated on by a digital filter algorithm, in software, in theblock 52. The calculation involves shifting old data (or rotating cyclical pointers) and performing the multiplications, additions, subtractions, and divisions necessary to obtain the resultant output value y(n).
Inblock 54 the software decision algorithm selects the appropriate actions to be taken based on the results of the filtered sensor signal. This block includes calculations necessary to extract, or determine, information from the signal that can be compared to high or low limits, expected values, or other decisive criteria. All of this software execution must be performed within the time between sensor signal sampling. It is generally not allowed to vary or alter the sampling frequency when processing real-time functions. FIG. 3a depicts fivesequential epochs 50a-54a to 50e-54e, with the corresponding sample and action points noted.
Referring now to FIG. 4 the software execution in accordance with the present invention is devoted entirely to the decision algorithm and is indicated at 56. The sensor signal is pre-processed by the on-chip hardware logic at 58, to produce both the current sample, x(n), and the current filtered result, y(n). These results are immediately available to the software flow via data transfer registers such as theoutput register 38 typically employed in microcontrollers. Thezone 60 indicates the additional time allocated to algorithm processing that had been used for software filtering in FIG. 3.
In FIG. 4a, the five epochs are again illustrated for comparison with FIG. 3a. The software decisive algorithm is shown to the left, and the sensor signal sampling and subsequent filtering is shown on the right. The signal sampling and filter execution atblocks 58a-58e is performed independently of software execution indicated generally at 56a-56e. Upon completion of a filter calculation, the filter hardware indicates "data ready" by asserting an interrupt to the software flow. This leaves nearly the entire time between samples devoted to algorithm processing.
While the best mode for carrying out the present invention has been described in detail, those familiar with the art to which this invention relates will recognize various alternative designs and embodiments for practicing the invention as defined by the following claims. For example, while the invention is described as using a low pass second order autorecursive moving average (ARMA) filter other filters for realization of bandpass, high pass etc. may be employed where appropriate. Also, while a single filter is disclosed, a plurality of such filters, interacting as desired, and providing data ready for software processing may be included where the application renders such modifications desirable.