A systematic MEMS sensor calibration framework

In this paper we present a systematic method to determine sets of close to optimal sensor calibration points for a polynomial approximation. For each set of calibration points a polynomial is used to fit the nonlinear sensor response to the calibration reference. The polynomial parameters are calculated using ordinary least square fit. To determine the quality of each calibration, reference sensor data is measured at discrete test conditions. As an error indicator for the quality of a calibration the root mean square deviation between the calibration polynomial and the reference measurement is calculated. The calibration polynomials and the error indicators are calculated for all possible calibration point sets. To find close to optimal calibration point sets, the worst 99 % of the calibration options are dismissed. This results in a multi-dimensional probability distribution of the probably best calibration point sets. In an experiment, barometric MEMS (micro-electromechanical systems) pressure sensors are calibrated using the proposed calibration method at several temperatures and pressures. The framework is applied to a batch of six of each of the following sensor types: Bosch BMP085, Bosch BMP180, and EPCOS T5400. Results indicate which set of calibration points should be chosen to achieve good calibration results.


Introduction
MEMS (micro-electromechanical systems) sensors are calibrated at one or several points at the end of the production process in order to fulfill the product specifications.Various techniques can be applied to compensate sensor nonlinearities (see Brignell, 1987).In many cases (e.g., humidity sensors, gyroscopes, pressure sensors, barometric pressure sensors) calibration relies on a polynomial for fitting the raw sensor data readout to reference signals (van der Horn and Hujising, 1997;Lyahou et al., 1996;Cerry et al., 1990;Bolk, 1985).Usually production issues limit the number of calibration points available for calibrating sensors against a reference.An adequate choice of calibration points can reduce the number of calibration points and thus sensor calibration time and cost (see Dickow and Feiertag, 2014).As far as we know, no systematic technique for MEMS sensor calibration has been published, including both optimal calibration point selection and calibration using as few points as possible.In this paper a polynomial approach for MEMS sensor calibration with only a few calibration points is proposed.An algebraic framework is used to determine all possible calibration point combinations.In an experiment, the proposed method is applied to barometric MEMS pressure sensors.Recommendations are made for an optimal choice of calibration points.The paper is structured as follows: Sect. 2 introduces the concept of polynomial calibration with parameter extrapolation; in Sect. 3 a combinatorial framework is proposed for the selection of calibration point sets; in Sect. 4 the proposed framework is applied to barometric MEMS pressure sensors; and in Sect. 5 the results are discussed in a conclusion.

Calibration using polynomial regression
As sensors often show nonlinear behavior in their measurement range, calibration functions are used to linearize the raw digital sensor readout.To calibrate these sensors reference values are needed.Reference values and the sensors raw values are recorded in a calibration device at defined test conditions or calibration points.State of the art calibration uses multiple ordinary least square fits (multiple OLS) (see Seber and Lee, 2003;Martens and Naes, 2002) to calculate the sensor calibration parameters.For further reading about calibration methods refer to Martens and Naes, 2002, and Varmuza Published by Copernicus Publications on behalf of the AMA Association for Sensor Technology.
and Filzmoser, 2009.As multiple OLS is a linear regression method, calibration functions have to be linear in their parameters.In this paper a multivariable polynomial is chosen as the calibration function to linearize the sensor behavior over specification.The polynomial function is capable of linearizing continuous, differentiable sensor readouts to a given specification.In some cases, polynomial functions of very high order are needed to reach the desired calibration accuracy.Then, it is useful to switch to other functions, reaching accuracy goals with fewer parameters, or even switch to other regression methods, e.g., support vector regression (see Smola and Scholkopf, 2004).

Linear regression model for polynomial calibration
A calibration function gives the sensor output signal as a function of the sensor's raw values.Multiple regression calibration is used to generate an appropriate calibration function for given reference values.The OLS calibration method is an integral part of research and production in many fields of applications (shown in Eriksson et al., 2006).A linear regression model for N observations can be expressed as where y is denoted as dependent variable (set of reference values measured at the calibration points), X is a matrix of independent variables (functions of sensor raw values at the calibration points), β is the calibration parameter vector and ε is the error term vector, describing the calibration errors at the distinct calibration points.
In matrix notation, the calibration problem transforms to where M = N −1 and rank (X) = N. N calibration points are required to calculate a unique solution for the calibration parameters β.Each single row of X describes an independent variable vector of the calibration function used.An independent variable vector 1, x ij , . .., x iM describes transformed raw sensor readouts at specific reference sensor readout y i .When calibration uses a polynomial function with a single raw sensor readout signal, M = N − 1 is also the polynomial order K; so that describes the polynomial approximation of y k , where k ∈ (1, . .., N ).If M < N − 1, the OLS fit produces an error ε k .When having p raw sensor readout signals, the polynomial approximation expands to needing calibration points to calculate a unique solution to the multiple sensor signal calibration problem.The parameter K j , j ∈ 1, . .., p describes the polynomial order for each raw sensor signal used for calibration.For example, MEMS pressure sensors with raw temperature x raw,T and raw pressure readout x raw,P are usually calibrated with a polynomial of order 2 in temperature and order 1 in pressure: In this case, N = (2 + 1)(1 + 1), six calibration points are required to determine all calibration parameters β i , i ∈ (0, . .., 5).

Calibration criteria and option selection
In the following k i denotes a set of calibration points.For the example from Eq. ( 6), each k i contains three temperature points (T 1, T 2, T 3) and two pressure points (P 1, P 2) coupled in a row, leading to To decide which sets of calibration points give the best sensor accuracy a reference data set is necessary.This reference data is measured at discrete values within the measurement range of the sensor.In the following we assume that all calibration points match the discrete values of the reference data.This leads to a finite number of possible sets of calibration point combinations [k 1 , . .., k L ] .In Fig. 1 this is shown for the example given above.The reference data was measured for all points denoted with an "X", the group of six grey circles is one set of calibration points.
For each k i , the OLS regression is performed using the polynomial from Eq. ( 4).This leads to B = [β 1 , . .., β L ] sets of identified polynomial parameters for a given sensor.To evaluate the calibration quality, the identified parameters are inserted into y poly and used to calculate the calibration error over the sensor working range.As calibration error indicator, the calibration root mean squared error (rms error), is calculated from the reference data y ref and the polynomial approximation y poly , where R is the number of reference data points.N < R describes the case, when more than one calibration option is available.In this case the calibration task has possible calibration options.For a multidimensional calibration problem calibration options are possible, when the sensor is influenced by p signals/factors.From all calibration options, those are seen as optimal calibration options , where

Statistical evaluation
For a batch of I sensors, with evaluated rms errors at C, there are optimal calibration options.It can happen that some optimal calibration options are identical.If the batch of sensors is representative for a specific sensor type, the most common optimal calibration option should be preferred.However as sensors are influenced by multiple parameters, it is not very likely to find sensors having exactly the same calibration recommendation.
To retrieve more information about fields of attraction for best calibration options in a multidimensional optimization problem, a selection criteria weaker than Eq. ( 12) is proposed.The criteria 99 ⊂ e k 1 , . .., e k O cal (14) dismisses those 99 % calibration options, which have the highest rms errors according to Eq. ( 8).The 99 criteria is applied to each sensor of a batch.This results in a calibration recommendation for an investigated sensor type r99 = 99,1 , . .., 99,I , which will be used in the following as a multidimensional indicator for close to optimal calibration points.

Software implementation
The proposed sensor calibration approach was implemented in a framework, written in Python language, to investigate commercial MEMS sensors with digital data readout.It uses the Fortran package LAPACK (Linear Algebra PACKage) to solve linear equations using LU (lower, upper) decomposition (Strang, 1980) with partial pivoting and row interchange.A typical calibration workflow is depicted in Table 1.Four steps are needed to retrieve meaningful statistical data out of given digital raw sensor readout and reference values: data processing, calibration, comparison and statistical evaluation.If the number of required calibration points N is much smaller than the amount of available reference points for calibration R or more than two independent sensor readouts p are used for calibration, the amount of OLS calls can get too high for desktop computers to solve within a reasonable time.In consequence, the framework should only be used for low-to medium-order polynomials, having only a few independent readout signals used for calibration.

Application example -barometric MEMS pressure sensors
In this section, the new framework is applied to three types of commercial barometric MEMS pressure sensors, which are calibrated against temperature and barometric pressure using polynomials (see Kim et al., 2012;Köster et al., 2003;Bosch Sensortec, 2008, 2013;EPCOS, 2013) Select calibration polynomial order in each given sensor raw data readout signal, calculate all possible calibration options with Eq. ( 11) and run sensor multiple OLS polynomial calibrations for each sensor of the given batch.
Test the calibration parameters against the reference data set using the rms error approach from Eq. ( 8) with respect to Eq. ( 9), calculate Eq. ( 15) in respect to Eq. ( 16).Repeat this procedure for each sensor of the batch.
Use the framework for statistical evaluation (histograms, multidimensional probability plots, calibration point recommendations, nonlinearity plots, parameter and calibration function influences).
metrical second-order calibration polynomial, using the sensor's raw temperature readout x raw,t and a raw pressure readout x raw,p .

Calibration setup
The test equipment uses a pressurized climate chamber, a General Electric PACE 5000 pressure controller as pressure calibration reference and a combination of Peltier elements and a type K thermocouple for reference temperature control, attached close to the sensor site.Data is recorded using a National Instruments USB-8451 I2C device, connected to the digital barometric MEMS pressure sensors, soldered on to a printed circuit board.

Calibration task
For all further investigations, it is assumed that the sensors deliver reproducible results.As barometric MEMS pressure sensors suffer from temperature hysteresis (see Waber et al., 2013), data was recorded in ascending temperature order to minimize the hysteresis effect.Sensors used in the experiment have a measurement range from −40 to 90 • C and from 300 to 1100 hPa.To test the calculated sensor calibration, discrete points at [−40, −30, . . ., 90 • C] are chosen as test temperature points and [300, 400, . . ., 1100 hPa] are chosen as test pressure points.Within the measurement range, the sensor's raw values, the reference pressure and the reference temperature are recorded in a sequence to avoid disturbances from temperature hysteresis, as described in Fig. 1.At each point, the measurement device waits until stable pressure and temperature conditions are reached.Data recorded consists of time stamp, raw pressure, raw temperature, reference pressure and reference temperature.Six points are numerated and marked in grey.They exemplarily stand for a calibration point set, as presented in Eq. ( 7).In the following, this and all other possible calibration options will be evaluated to determine the best combinations possible.

Calibration point recommendation
Data is recorded according to the description in Sect.4.2.For the calibration polynomial from Eq. ( 16), the most likely best calibration point combinations were calculated using the procedure taken from Table 1.The experimental results are shown in a distribution landscape plot in Fig. 2. The plot exemplarily separates the first 3 calibration points (upper row in Fig. 2) from the calibration points 4-6 (second row in Fig. 2).This clustering into two distribution plots provides information about how to combine temperature points, when calibration is restricted to only two possible pressure conditions, as it can happen in industrial sensor production to save calibration time.Figure 2 shows, that the investigated T5400 sensor should be calibrated at points at the borders of pressure range (300 and 1100 hPa), while the other sensor types investigated show a more heterogeneous calibration point recommendation (300, 900 and 1100 hPa).

Other applications
The proposed method can be applied to all sorts of sensors, having one output signal and a at minimum one input signal.For computational complexity reasons, the number of measurement points for searching the optimal calibration option should be low.In the pressure sensor example there are 9 pressure points and 14 temperature points, resulting in a grid of 126 measurement points for calibration.This is already a demanding task, for a polynomial order 3 in both parameters (16 parameter polynomial), according to Eq. ( 10).The proposed method can be applied to sensors like gyroscopes (see Aggarwal et al., 2006) or any other kind of sensor, as long as the number of parameters for calibration and the number of measurement points investigated is comparable to the numbers from the barometric pressure sensor example.For the gyroscope example in Aggarwal et al. (2006), the parameter y is a combined error including scale factor and bias in one direction, and the parameters of x include six calibration points.As directions x, y and z are assumed to be independent, three independent optimal calibration models with six calibration points can be calculated with the proposed method.

Conclusions
The proposed framework was used to calibrate barometric MEMS pressure sensors with six calibration points and a second-order calibration polynomial in temperature and firstorder in pressure.For all sensors investigated, points selected at the upper and lower borders of temperature and pressure range increase the likelihood of appearing within the best 1 % of the calibration options.The proposed framework determines all possible calibration options for a given set of sensor measurement data using a linear polynomial regression approach and then applies the rms error over measured test conditions as calibration benchmark.The worst 99 % of the calibrations are dismissed to show areas of attraction for good calibration options.For further research, calibration point extrapolation will be implemented to reduce the amount of calibration points measured.This is used to achieve the sensor specification required by statistically estimating offset values for higher-order calibration polynomial parameters.Further calibration uncertainty considerations will be evaluated according to Waber et al. (2013), Heydorn and Anglov (2002) and Brüggemann and Wennrich (2002).

Figure 1 .
Figure1.Six selected calibration points for digital barometric pressure sensors, chosen from a reference data set (marked with ×); recorded data is in ascending order to avoid temperature hysteresis effects.

Figure 2 .
Figure 2. Recommended six calibration points for second order polynomial barometric pressure sensor calibration; frequency of the first three calibration points shown in the upper part; frequency of the last three calibration points shown in the lower part of the figure.

Table 1 .
A typical calibration workflow using the proposed framework; data processing, calibration and evaluation are implemented in independent modules.
. Three batches of six barometric MEMS pressure sensors each, of the type EPCOS T5400, Bosch BMP 180 and Bosch BMP 085, are used to calculate calibration point recommendations for a multiparawww.j-sens-sens-syst.net/4/97/2015/