Methods for dynamic calibration and augmentation of digital acceleration MEMS sensors.

. We present a method for data acquisition and calibration of digital accelerometers which is being developed within the EMPIR Met4FoF project based on STM32 microcontrollers. Unlike analog sensors, some MEMS sensors with digital interface generate the sample clock themselves. For a dynamic calibration the exact knowledge of the sample times is essential. Therefore, an interrupt controlled data acquisition based on hardware timers with absolute time stamping was implemented. These routines are generic and can be used both for sensors that perform the measurements automatically, or for sensors whose data acquisition is requested by a hardware or software interrupt. The synchronization of the hardware timer with the absolute time is done via GNS time services or another PPS time source. The data is transferred from the microcontroller via ethernet to a host PC, which is to provide an OPC-UA interface and thus enables simple integration of the sensor system into larger measuring systems, like existing calibration setups. In addition to the acquisition of raw data for sensor calibrations, the system consisting of microcontroller and driver on the host system is also intended to provide dynamic measurement uncertain-ties. In addition, information about the calibration and the status of the sensor should be available on the system. The calibration data should be stored in form of a signed xml ﬁle on the microcontroller. In addition to this static information, the system should also record dynamic information about the status of the sensor, such as operating time, exceeding of measuring ranges, min and max temperature during operation. accelerometer.


Introduction
MEMS (Micro-Electro-Mechanical Systems) sensors with exclusively digital data output, here referred to as digital sensors, are gaining more and more popularity and are currently and in the future extensively used in industrial applications and plants. Within the 17IND12 Met4FoF "Metrology for the Factory of the Future" project of which this work is a part, we will establish a metrological framework for the complete lifecycle of measured data in industrial applications: from calibration capabilities for individual sensors with digital preprocessed output to uncertainty quantification associated with machine learning (ML) in industrial sensor networks [1]. In this paper we present the extension of existing accelerometer calibration equipment for the calibration of digital sensors, which is part of the Met4FoF project.

State of the art 2.1 Calibration of analog sensors
In typical dynamic calibration procedures like ISO 16063-21. [2], the physical/mechanical quantity (e.g. acceleration, force, pressure) to be used for the sensor input is applied either as a sinusoidal excitation with a given frequency and amplitude. This mechanical quantity is measured by a reference sensor, which is an integral part of the calibration system and provides the link to the SI units and by the device under test (DUT) which is a variable component. In a dynamic calibration situation, the response of the DUT to time-varying input is the major interest. Hence, it is crucial that the mechanical input operates simultaneously and equally on reference and DUT. This precondition is usually complied with by a proper mechanical arrangement, like a back-to-back mounting of reference and DUT in secondary accelerometer calibration. In current conventional set-ups, the reference as well as the DUT provide electrical outputs (typical voltage) while the data acquisition electronics of the system provides the analogue to digital conversion (ADC). Accordingly, two analogue channels are necessary one for the reference and one for the DUT. In order to get reliable information on the time dependent response, the timing of the data acquisition on the two channels has to be synchronized. This is typically accomplished by provision of a common clock signal to drive the sampling units of the ADC and a common trigger to start (or mark) the beginning of the acquisition. Fig. 1 provides a schematic diagram of such a conventional calibration configuration. The two sampled time-series can be characterized by fitted sine-functions: DUT clock: Figure 1. Analogue acceleration sensor calibration by comparison with a reference sensor according to ISO 16063-21. [2].Due to synchronization within the calibration system, the readings for both sensors are sampled at the same equidistant points in time t i .
Where the angular frequency ω is known and the amplitudes (Ŷ ref,ω ,Ŷ DUT,ω ,) and initial phases (φ ref,ω , φ DUT,ω ) are determined by fitting the measurement data. It has to be noted, that an important precondition lies in the use of a common clock represented by the same variable t i in the above equations. The frequency response of the sensor, i.e. the calibration result is given by the two parameters magnitude (3) and phase (4): 3 Digital sensors Figure 2 shows an example of the design of a 3-axis accelerometer. Within the digital sensor all elements of a measuring chain are included. In this case the physical quantity acceleration is converted by the MEMS element into an electrical quantity (here charge and after the charge amplifier into a voltage). This electrical quantity is digitized by an ADC integrated in the sensor at times specified by a timing generator. The clock generation for the timing generator as well as the ADC references are also integrated on the chip and are typically unaccessible from the outside. In the sensor used here, the individual channels are read out interlaced. As a rule, the sensors indicate a complete data acquisition cycle via their interrupt unit. This interrupt signal is the time reference for the calibration. The sampling times t k and thus also the sampling frequency f k = 1 t k+1 −t k are subject to fluctuations for various reasons, e.g. due to temperature drift or other internal processes in the sensor. Figure 3 shows the change of the sampling frequency of a 3-axis accelerometer caused by the application of cold spray to the sensor. In this case the sampling frequency increases significantly. At regular intervals, a change in the sampling frequency occurs, which correlates with the update of the internally acquired temperature values of the sensor. Such changes of the internal sampling rate have to be considered in the calibration of digital sensors.

Calibration of digital sensors
In order to equip existing calibration systems for the use with digital sensor DUT, various extensions are required: 1. A digital acquisition unit (DAU) which is capable to connect to the digital interface of the sensor under calibration and store/transmit the DUT time-series, with hardware generated timestamps, for subsequent analysis. Sensor t em perat ure / °C Figure 3. Sampling frequency f k change by temperature changes due cold spray as well as by internal delays caused by temperature measurements.
2. An additional synchronization signal which provides the link between the time-base of the calibration system and the time-base of the DUT captured by the (DAU). Fig. 4 provides a schematic diagram of such an extended system and the used signals. The DAU provides the means to configure the digital-output sensor and read the sampled data from its digital interface. In addition it applies one of two possible concepts to link the time bases: a. It reads the additional analog sync signal with an AD-converter every time a sample is provided by the DUT. This is accomplished in the same interrupt routine that is triggered when the DUT signals a data ready status. Hence, the DAU subsequently provides tuples of samples where each data point from the DUT is accompanied by the respective sample of the sync signal.
b. It reads an external start trigger and counts the time since the trigger while acquiring the data from the DUT based on interrupts generated by the DUT. Each sample of the DUT is marked with a precise timestamp relative to the trigger. Hence, the DAU subsequently provides a time-series of timestamped samples of the DUT measurement.
For concept a, the conventional calibration system already provides a second input channel, which was conventionally used for the DUT. In the extended set-up this channel is used to sample the sync signal of the extended system synchronously to the reference input channel. This will subsequently provide the link between the two time-bases for concept a. above. In this case four sine signals have to be fitted by sine-approximation: The calculation of the magnitude of the transfer function is as simple as before: For the phase delay of the transfer function the two initial-phases calculated in the different channels for the same sync-signal provide the necessary link: Where the indexes cal and DAU refer to the sampled sync-signal at the DAU or the conventional calibration system, respectively. The sync signal, by the way, is easily tapped from the generator signal driving the sinusoidal excitation. For concept b, i.e. the case where a trigger is shared between the systems, it is a necessary precondition that the control software of the conventional calibration can handle triggered acquisition and trigger generation, which is not always the case. If this precondition is fulfilled, however, the situation quite simple. The sampled time series of DAU and conventional calibration system are each fitted in relation to their individual time-base. Where the sample points, t i or t k respectively, are taken relative to the shared trigger.
Subsequently the initial phases, φ ref,ω and φ DUT,ω are no longer dependent on the individual time-base. Hence the calculation of the transfer function can be performed according to Eq. 3 and 4. As shown by example (c.f. Fig. 3) samples points of typical digital-output sensors are not strictly equidistant. This, however, is no contraindication for the sine-approximation, while it may be prohibitive concerning the application of Fourier-transform-methods for the determination amplitude and initial phase.

Digital sensors in the Factory of the Future
The Data Aquisition unit (DAU) presented here is based on a STM32F767Zi microcontroller and can not only be used for the acquisition of sensor data in the context of calibrations. It is also designed for use in industry 4.0 environments. The Met4FoF project addresses condition monitoring and other applications. A prerequisite for this application is the provision of reliable time-synchronized sensor data [4]. This can be done with the DAU, in this context also called Smartup-Unit, in combination with a GNSS receiver and software on a host system. The GNSS (global navigation satellite system) module provides a time reference which is synchronized by the pulse per second signal with the hardware timers of the Smartup-Unit. Thus an absolute time stamp with nanosecond resolution and sub microsecond uncertainty can be calculated for each captured measurement value. For further processing, in particular the compensation of sensor effects by deconvolution and the calculation of dynamic measurement uncertainties, the measurement data is sent to a host PC via a generic protocol based on Google Protobuff [5]. The compensation and uncertainty calculation is carried out with routines from the Python library PyDynamic [6] that have already been completed or are yet to be integrated. Subsequently, the augmented data is published in machine-to-machine communication frameworks. OPC-UA (OPC Unified Architecture) [7] and ROS (Robot Operating System) [8] are currently being evaluated for that purpose. Schematics and source code are available online at [9,10].

Summary
Digital sensors are becoming more widespread and are to be calibrated in the future. To make this possible, we provide an approach with which existing calibration setups can be extended. The calibration system will be complemented by a data acquisition solution based on a microcontroller which can also capture analog voltages. Digital sensors generally generate the sampling time stamps themselves and transmit these or correlated interrupt signals to the data acquisition unit. In order to bring this often not perfectly equidistant time base into agreement with the time base of the calibration system, a reference signal (e.g. the excitation signal) can be used. this is acquired by the data acquisition unit synchronously to sampling times of the digital sensor. Subsequently, the phases between data acquisition unit and analogue calibration system can be determined by sine-approximation. If this time reference is determined, the transfer function can be calculated. The sine-approximation is advantageous here, because no disturbances by non-equidistant sample distances are to be expected.