Tilt Sensor with Recalibration Feature Based on MEMS Accelerometer

The main errors of MEMS accelerometers are misalignments of their sensitivity axes, thermal and long-term drifts, imprecise factory calibration, and aging phenomena. In order to reduce these errors, a two-axial tilt sensor comprising a triaxial MEMS accelerometer, an aligning unit, and solid cubic housing was built. By means of the aligning unit it was possible to align the orientation of the accelerometer sensitive axes with respect to the housing with an accuracy of 0.03°. Owing to the housing, the sensor could be easily and quickly recalibrated, and thus errors such as thermal and long-term drifts as well as effects of aging were eliminated. Moreover, errors due to local and temporal variations of the gravitational acceleration can be compensated for. Procedures for calibrating and aligning the accelerometer are described. Values of thermal and long-term drifts of the tested sensor, resulting in tilt errors of even 0.4°, are presented. Application of the sensor for monitoring elevated loads is discussed.


Introduction
MEMS accelerometers are currently widely used in many electronic and mechatronic devices for a number of purposes primarily related to the sensing of linear acceleration, but also vibration [1], mechanical shock (jounce) [2], and one-axis tilt, i.e., inclination [3], or two-axial tilt [4]. Mathematical processing of the accelerometer output signal enables the sensing of linear velocity or displacement [5], such as in the case of applying MEMS accelerometers for a wheel odometer designed to determine the kinematics of a car [6]. While employing a higher number of accelerometers with a strictly defined geometrical configuration, accelerometers can replace gyroscopes in the sensing of angular rates [7].
Despite numerous advantages of these microsensors, including low price, robustness, small size, high shock-resistance and easy integration with electronics, there are a few disadvantages that characterize their performance. These are mainly: misalignments of the sensitivity axes (including their non-perpendicularity) [8]; thermal and long-term drifts of the output signals (affecting both the offset and the scale factor) [9]; errors related to factory calibration of the accelerometer and aging of the silicon structure [8]; and attenuation of amplitude and phase shift over frequency [10].
Misalignments of the accelerometer sensitivity axes are very harmful [11,12], especially in the case of performing accurate tilt measurements [13], which are one of the most typical applications of MEMS accelerometers [14]. Therefore, many solutions have been proposed to address this problem, mainly based on numerical compensation for the existing misalignment angles, as proposed, e.g., in [15][16][17].
Thermal drifts of the offset and the scale factor, of which the first is much more dominant [9], are dealt with by the application of temperature sensors and using averaged thermal characteristics (or look-up tables) of particular accelerometer models. Another approach is keeping the accelerometer at a constant ambient temperature [9], e.g., by means

Mechanical Structure of the Device
As aforementioned, the essential shortcomings of MEMS accelerometers can be eliminated by repeating their calibration process. When implementing a simple calibration procedure, which does not require the application of a dedicated test stand, it is beneficial to use suitable accelerometer housing (which typically has an unfavorable geometry), preferably of a cubic shape. Such an idea has been presented in [28], where it was proposed to equip the tested inertial measurement unit (IMU) with a rectangular housing adapted to calibrate the component triaxial MEMS accelerometer and MEMS gyroscope. On the other hand, in [13] a special mechanical unit used for alignment of the used MEMS accelerometer is described. In this paper, a sensor using both solutions is presented, where the aligning unit, used to adjust orientation of the MEMS accelerometer, is mounted in a housing that allows its calibration to be performed without a test stand.

The Housing
In order to replace the role of the test stand during the calibration of the sensor, the housing must have a specific geometrical shape. Maintaining, at the same time, a good alignment of the accelerometer sensitive axes with respect to the external mechanical frame (housing) significantly reduces the influence of the related errors. The presented mechanical structure was designed to ensure possibly simple realization of these two ideas. Therefore, the housing of the sensor has a cubic shape, as presented in Figure 1, with a chamber open in one of the faces, in which the chamber an aligning unit is installed. The aligning unit supports a printed circuit board, onto which a MEMS accelerometer is soldered.

The Housing
In order to replace the role of the test stand during the calibration of the sensor, the housing must have a specific geometrical shape. Maintaining, at the same time, a good alignment of the accelerometer sensitive axes with respect to the external mechanical frame (housing) significantly reduces the influence of the related errors. The presented mechanical structure was designed to ensure possibly simple realization of these two ideas. Therefore, the housing of the sensor has a cubic shape, as presented in Figure 1, with a chamber open in one of the faces, in which the chamber an aligning unit is installed. The aligning unit supports a printed circuit board, onto which a MEMS accelerometer is soldered. The housing is made of stainless steel, which ensures sufficient and durable perpendicularity of its faces, with the respective deviation of ca. 0.01 degrees arc, which results from precession of its machining. It is possible to obtain lower deviation of perpendicularity; however, this is at considerably higher machining costs, especially in the case of stainless steel. Nevertheless, if the housing is expected to be used for determining the inherent misalignments of the accelerometer sensitive axes (e.g., when the axes are not perpendicular, as discussed later in the text), deviation of perpendicularity of its faces must not exceed the expected alignment error.
The housing has three openings created in its faces. The first opening provides a space for the aligning unit and the accelerometer PCB. The structure of the housing facilitates placement of the unit.
The second opening of a cylindrical shape in the housing is created for a spirit level, which makes it easier to level the flat surface used during calibration of the sensor, proving a leveling precision of ca. 1 min arc.
The third opening is a small notch, which enables the cable to be put on different faces, depending on the housing orientation during calibration of the sensor. The cable transmits measurement data from the MEMS accelerometer and supplies it with power. Alternatively, the sensor may be equipped with a wireless communication module connected with the accelerometer and adapted to transmit its readings to an external computing unit, just as proposed in [28] and presented in Section 7. The housing is made of stainless steel, which ensures sufficient and durable perpendicularity of its faces, with the respective deviation of ca. 0.01 degrees arc, which results from precession of its machining. It is possible to obtain lower deviation of perpendicularity; however, this is at considerably higher machining costs, especially in the case of stainless steel. Nevertheless, if the housing is expected to be used for determining the inherent misalignments of the accelerometer sensitive axes (e.g., when the axes are not perpendicular, as discussed later in the text), deviation of perpendicularity of its faces must not exceed the expected alignment error.
The housing has three openings created in its faces. The first opening provides a space for the aligning unit and the accelerometer PCB. The structure of the housing facilitates placement of the unit.
The second opening of a cylindrical shape in the housing is created for a spirit level, which makes it easier to level the flat surface used during calibration of the sensor, proving a leveling precision of ca. 1 min arc.
The third opening is a small notch, which enables the cable to be put on different faces, depending on the housing orientation during calibration of the sensor. The cable transmits measurement data from the MEMS accelerometer and supplies it with power. Alternatively, the sensor may be equipped with a wireless communication module connected with the accelerometer and adapted to transmit its readings to an external computing unit, just as proposed in [28] and presented in Section 7.
Additionally, several groups of threaded holes are provided in the housing. The first allows the sensor to be mounted in the end-user device or to be fixed in a special test stand while aligning the accelerometer sensitive axes. The second makes it possible to secure all the sensor components in the housing (the aligning unit, the spirit level, a grip of the cable), whereas the third is for the aligning screws.
The constructed tilt sensor is based on using a triaxial MEMS accelerometer; therefore, it can be used for two-axial tilt sensing. Of course, it is also possible to sense single-axis tilt (i.e., inclination: either pitch or roll) or axial tilt. Then, the triaxial MEMS accelerometer may be replaced by a biaxial or uniaxial one, as discussed in [27]. In order to determine perpendicularity deviation of the adjacent faces of the machined housing, a precise coordinate measuring machine (CMM) was employed. The maximal deviation of perpendicularity DP among all the adjacent faces of the housing was 36 s arc (0.01 • ), whereas deviation of flatness did not exceed 5 µm.
However, it should be noted that for alignment purposes, it is sufficient to make the geometrical data of only two adjacent faces of the housing. The faces should be flat and approximately perpendicular: the first is the base that removes two rotational degrees of freedom of the sensor, and the second removes the third rotational degree of freedom.
Nonetheless, if all the faces of the housing are machined precisely, any pair of adjacent faces can be used as the geometrical data, making the installation of the housing in the end-user device more convenient.

The Aligning Unit
The aligning unit, presented in Figure 2 in top view, is fixed to the housing by two clamping screws, and its orientation with respect to the housing is determined by three aligning screws oriented approximately perpendicularly to each other. Between the mounting section of the aligning unit and its supporting section, a U-shaped groove is created partially surrounding the mounting section. The PCB with MEMS accelerometer is fixed to the supporting section by means of four clamping screws. Owing to the groove, it is possible to elastically deform the aligning unit in such a manner that the supporting section can reversibly move with respect to the mounting section. The angular displacements can be controlled by means of three aligning screws seated in the walls of the housing. Thus, it is possible to align the accelerometer by changing the orientation of the supporting section of the unit with respect to the housing. the sensor components in the housing (the aligning unit, the spirit level, a grip of the ca-ble), whereas the third is for the aligning screws.
The constructed tilt sensor is based on using a triaxial MEMS accelerometer; therefore, it can be used for two-axial tilt sensing. Of course, it is also possible to sense singleaxis tilt (i.e., inclination: either pitch or roll) or axial tilt. Then, the triaxial MEMS accelerometer may be replaced by a biaxial or uniaxial one, as discussed in [27].
In order to determine perpendicularity deviation of the adjacent faces of the machined housing, a precise coordinate measuring machine (CMM) was employed. The maximal deviation of perpendicularity DP among all the adjacent faces of the housing was 36 s arc (0.01°), whereas deviation of flatness did not exceed 5 m.
However, it should be noted that for alignment purposes, it is sufficient to make the geometrical data of only two adjacent faces of the housing. The faces should be flat and approximately perpendicular: the first is the base that removes two rotational degrees of freedom of the sensor, and the second removes the third rotational degree of freedom.
Nonetheless, if all the faces of the housing are machined precisely, any pair of adjacent faces can be used as the geometrical data, making the installation of the housing in the end-user device more convenient.

The Aligning Unit
The aligning unit, presented in Figure 2 in top view, is fixed to the housing by two clamping screws, and its orientation with respect to the housing is determined by three aligning screws oriented approximately perpendicularly to each other. Between the mounting section of the aligning unit and its supporting section, a U-shaped groove is created partially surrounding the mounting section. The PCB with MEMS accelerometer is fixed to the supporting section by means of four clamping screws. Owing to the groove, it is possible to elastically deform the aligning unit in such a manner that the supporting section can reversibly move with respect to the mounting section. The angular displacements can be controlled by means of three aligning screws seated in the walls of the housing. Thus, it is possible to align the accelerometer by changing the orientation of the supporting section of the unit with respect to the housing.  The three aligning screws are seated in threaded holes created in respective walls of the housing. The aligning screw 5 rests against the supporting section which, owing to the U-shaped groove, may be deflected with respect to the mounting section. Screwing in this screw results in rotation of the supporting section about y-axis. The aligning screw 4 is parallel to the aligning screw 5. It is located within the same plane of the unit, but is closer to the mounting section. Screwing in this screw results in rotation of the supporting section about x-axis. The third aligning screw 3 is oriented perpendicularly to the other two. Screwing in this screw results in rotation of the supporting section about z-axis. Thus, the presented configuration provides adjustment of accelerometer orientation around three perpendicular axes. The aligning unit is made of aluminum alloy featuring good elasticity and high fatigue strength. Nevertheless, the unit may be made of some other material, preferably (due to good elastic properties): beryllium bronze, brass, steel, polymer (including 3D printing), composites (glass or carbon fiber).
In order to reveal a special relief created next to the groove, the aligning unit is shown in bottom view in Figure 3.
parallel to the aligning screw 5. It is located within the same plane of the unit, but is closer to the mounting section. Screwing in this screw results in rotation of the supporting section about X-axis. The third aligning screw 3 is oriented perpendicularly to the other two. Screwing in this screw results in rotation of the supporting section about Z-axis. Thus, the presented configuration provides adjustment of accelerometer orientation around three perpendicular axes.
The aligning unit is made of aluminum alloy featuring good elasticity and high fatigue strength. Nevertheless, the unit may be made of some other material, preferably (due to good elastic properties): beryllium bronze, brass, steel, polymer (including 3D printing), composites (glass or carbon fiber).
In order to reveal a special relief created next to the groove, the aligning unit is shown in bottom view in Figure 3. The relief was introduced in order to reduce the mechanical stress in the structure of the aligning unit. As can be seen in Figure 4, the maximal value of the Von Mises stress, while fully loaded by means of all three aligning screws, does not exceed 155 MPa, which is a relatively high, yet acceptable with respect to aluminum alloy. The relief was introduced in order to reduce the mechanical stress in the structure of the aligning unit. As can be seen in Figure 4, the maximal value of the Von Mises stress, while fully loaded by means of all three aligning screws, does not exceed 155 MPa, which is a relatively high, yet acceptable with respect to aluminum alloy.  It must be realized that it is almost impossible to build such an aligning mechanism that would ensure no interaction between alignments in particular axes-especially when keeping its overall dimensions small. Therefore, the alignment procedure, being of experimental nature, must be iterative, i.e., additional fine alignment in one axis must follow a rough alignment in the other axes. Typically, 2 or 3 iterations ensure a satisfactory result.

Physical Alignment of the MEMS Accelerometer
Physical alignment enables a precise positioning of the accelerometer with respect to the sensor housing, i.e., the particular accelerometer sensitivity axis is oriented in such a way that it is either parallel or perpendicular to the housing external faces.
While aligning the accelerometer, a simple procedure, minutely described in [13], can It must be realized that it is almost impossible to build such an aligning mechanism that would ensure no interaction between alignments in particular axes-especially when keeping its overall dimensions small. Therefore, the alignment procedure, being of experimental nature, must be iterative, i.e., additional fine alignment in one axis must follow a rough alignment in the other axes. Typically, 2 or 3 iterations ensure a satisfactory result.

Physical Alignment of the MEMS Accelerometer
Physical alignment enables a precise positioning of the accelerometer with respect to the sensor housing, i.e., the particular accelerometer sensitivity axis is oriented in such a way that it is either parallel or perpendicular to the housing external faces.
While aligning the accelerometer, a simple procedure, minutely described in [13], can be used. It basically consists of slowly rotating the sensor about a rotation axis parallel to the respective housing face (which is also approximately parallel to the sensitive axis being aligned), and monitoring the output signal associated with the sensitive axis being aligned.
Variations of the output signal should be minimized by changing the orientation of the sensitive axis by means of two appropriate aligning screws.
First, the tilt sensor must be precisely fixed in a test stand, ensuring parallel orientation of the respective housing face with respect to the rotation axis of the test stand. Then, the aligning procedure should be performed for the X-axis (see Figure 2), setting aligning screws 3 and 5 to obtain minimal variations of the x-output signal. Then, the aligning procedure should be performed for the Y-axis. However, at this time only the aligning screw 4 can be used in order to obtain minimal variations of the y-output signal. Alignment precision of the Z-axis results from the two procedures. The order of aligning of the sensitive axes can be of course changed, according to particular demands related, e.g., to the accuracy of tilt measurements.
It must be realized that a complete elimination of all misalignments is generally impossible due to the fact that accelerometer sensitive axes are not perfectly perpendicular. The inherent mutual misalignments may be much higher than specified in the relevant datasheets, even of 1 • [27]. This problem is discussed in Section 6.

The Alignment Precision
In order to precisely align the accelerometer with respect to the housing, the test rig presented in Figure 5 was employed. The housing of the aligned sensor was secured in a special precise fixture installed on the output shaft of the optical rotary head. The shaft was driven manually with the positioning accuracy of a 3 s arc. The accelerometer was supplied by a stabilized power unit and constant-voltage regulator (nominal voltage: 3 V; range of variation of the voltage throughout the whole experiment did not exceed 0.25 mV), and its output analog voltage signal was sampled by means of a data acquisition module USB 6211 by National Instruments (not shown in Figure 5) and recorded in computer memory.

The Alignment Precision
In order to precisely align the accelerometer with respect to the housing, the test rig presented in Figure 5 was employed. The housing of the aligned sensor was secured in a special precise fixture installed on the output shaft of the optical rotary head. The shaft was driven manually with the positioning accuracy of a 3 s arc. The accelerometer was supplied by a stabilized power unit and constant-voltage regulator (nominal voltage: 3V; range of variation of the voltage throughout the whole experiment did not exceed 0.25 mV), and its output analog voltage signal was sampled by means of a data acquisition module USB 6211 by National Instruments (not shown in Figure 5) and recorded in computer memory.
According to the method described in [13], a series of 30 measurements were performed at the following angular positions, the resultant average value was observed, and the aligning unit was adjusted accordingly. After few revolutions, it was possible to align the particular sensitive axis so precisely that the observed variation of the averaged output voltage did not exceed ± LSB [13], where LSB is the least significant bit (in the case of the 16-bit USB 6211 device and the measurement range of 10 V: LSB = 0.15 mV). Thus, the error of the alignment procedure APE can be calculated as follows: where SF is the scale factor of the accelerometer (see Section 5.1).

Figure 5.
Experimental test rig during the alignment procedure.
On the other hand, the total alignment error (TAE) can be evaluated as follows: where DP is the deviation of perpendicularity (see Section 2.1).

Calibration of the Sensor
As aforementioned, owing to the cubic shape of the housing, a test stand was not According to the method described in [13], a series of 30 measurements were performed at the following angular positions, the resultant average value was observed, and the aligning unit was adjusted accordingly. After few revolutions, it was possible to align the particular sensitive axis so precisely that the observed variation of the averaged output voltage did not exceed ±LSB [13], where LSB is the least significant bit (in the case of the 16-bit USB 6211 device and the measurement range of 10 V: LSB = 0.15 mV). Thus, the error of the alignment procedure APE can be calculated as follows: where SF is the scale factor of the accelerometer (see Section 5.1).
On the other hand, the total alignment error (TAE) can be evaluated as follows: where DP is the deviation of perpendicularity (see Section 2.1).

Calibration of the Sensor
As aforementioned, owing to the cubic shape of the housing, a test stand was not necessary to perform the calibration. The only element required was a platform that could be precisely leveled, e.g., using the embedded spirit level.
Various concepts of the low-g accelerometer calibration process have been proposed in relevant publications, e.g., using twelve characteristic orientations of the accelerometer, employing a simple instrument such as a three-way milling vice [21]. However, in most of the related research, only six characteristic orientations were employed, e.g., in [9,23,28]. The accepted idea of the calibration was also based on the latter concept, and was very simple. It was based on recording the sensor output signals under static conditions at six specific orientations, where one of the accelerometer output signals reached its extreme (maximal or minimal) value. The six positions were, of course, defined by the faces of the housing and are presented in Figure 6.  In order to perform the proposed type of calibration, the accelerometer output signals were measured after it was placed on each of the six external faces of the housing. At each position, a series of measurements of the output signal associated with a particular axis was performed. Then, an average value was determined for each axis at each position.
In the case of the reported study, 300 measurements of the analog voltages were performed per each axis, at each of the six calibration positions. For this purpose, the data acquisition module USB 6211 by National Instruments was used, whose absolute accuracy at the selected scale range (10 V) was specified as 2.7 mV [29] (it should be noted that the In order to perform the proposed type of calibration, the accelerometer output signals were measured after it was placed on each of the six external faces of the housing. At each position, a series of measurements of the output signal associated with a particular axis was performed. Then, an average value was determined for each axis at each position. In the case of the reported study, 300 measurements of the analog voltages were performed per each axis, at each of the six calibration positions. For this purpose, the data acquisition module USB 6211 by National Instruments was used, whose absolute accuracy at the selected scale range (10 V) was specified as 2.7 mV [29] (it should be noted that the relevant accuracy was higher, since the performed measurements reached only 20% of the measurement scale and no variation of the ambient temperature was involved). For all of the 18-measurement series, the type-A uncertainty [30] did not exceed 0.24 mV. Assuming Gaussian distribution, the expanded uncertainty (3-σ error), corresponding to a probability of 99.73%, was equal to 0.72 mV.
At this point, it is worthwhile to mention that at the orientations illustrated in Figure 6, the calibrated accelerometer axis is not sensitive to relatively large inclinations of the housing. Let us assume that the reference surface is precisely leveled (accuracy of 1 min arc), and the housing is characterized by a large theoretical deviation of perpendicularity TDP as high as 1 degree arc. As a result, the calibrated axis, instead of the gravitational acceleration g, senses its component that is equal to gcos(TDP), which is only 0.02% smaller than g. The resultant calibration error (CE) expressed as tilt angle can be evaluated as follows: where TDP is a theoretical deviation of perpendicularity, accepted as 1 • . So, from the point of view of the calibration, deviation of perpendicularity of the housing being as large as 1 degree arc results in a tilt error below a 0.01 degree arc. So, if only two faces of the housing are to be used for aligning the sensor with respect to the frame of the end-user device, as suggested in Section 2.1, deviation of perpendicularity of all the faces of the housing may be even that large.
The purpose of the calibration process is to determine two individual parameters for each sensitive axis: offset (bias) OF and scale factor SF. Having all the data recorded, maximal and minimal average value for each sensitive axis must be found. Then, the following equations can be used to compute the set of the offsets and scale factors: where U x .. z are averaged voltage output signals assigned to particular sensitive axis of the MEMS accelerometer, expressed in [V]; OF x .. z are offsets (biases) associated with particular sensitive axis, expressed in [V]; and SF x .. z are scale factors associated with particular sensitive axis, expressed in [V/g], where g is the gravitational acceleration.
Once the calibration parameters have been determined, accelerations indicated by the accelerometer can be expressed as a fraction of g (referring to tilt measurements), using the following formulas: In order to calculate tilt (expressed as pitch, roll or axial tilt), various formulas based on inverse trigonometric functions can be used, as discussed in [27].
It should be noted that owing to the recalibration of an accelerometer at the location of its operation, the errors due to variations of the gravitational acceleration (resulting mainly from the local altitude and latitude) can be eliminated. If the recalibration is cyclically repeated, even temporal variations of the gravitational acceleration (e.g., resulting from interactions of the heavenly bodies) can be considerably reduced.

Misalignment Angles
If it is impossible to precisely align the accelerometer (e.g., due to its inherent imperfections), the component misalignment angles can be determined (two for each axis) during the calibration. In such case, not only the extreme values of the output signals of the accelerometer must be used, but all the average values. At a position of the sensor when a particular sensitive axis has approximately horizontal orientation, the associated output signal makes it possible to determine the respective misalignment angle, which the accelerometer senses as pitch or roll.
Referring to Figures 2 and 6, the respective positions will be the following for the particular sensitive axes: Using the scales factors and offsets determined in the first step, it is possible to determine the misalignment angles MA using the following formulas: where U 1 .. 6x .. z are averaged voltage signals assigned to a particular sensitive axis (x..z) at a given position (1..6 as in Figure 6), expressed in Volts.

Thermal and Long-Term Drifts
To evaluate the performance of the constructed tilt sensor, a triaxial MEMS accelerometer ADXL 327 [31] was employed. Once the accelerometer had been aligned, the sensor could have been calibrated.
The following methodology was accepted while studying thermal and long-term drifts of the accelerometer. The full calibration procedure, as described in Section 4, was repeated cyclically. Each time, a series of the accelerometer output signals was measured after placing it on each of the six faces of the housing. Then, using averaged values of the measurements, offset and scale factors for each sensitive axis were determined. The ambient temperature was kept constant both while determining the thermal drifts as well as the long-term drifts. The difference was the time interval between the successive recalibrations. In the first case it was 1, 2, 4 and 6 h., whereas in the second case it was 24 and 48 h.

Thermal Drifts
The first experiment was performed in order to reveal thermal drifts resulting from self-heating of the accelerometer, just after its start-up. The ambient temperature was kept constant. A relevant publication reports on the considerable temperature changes after the start-up of the accelerometer (up to 3 • C) [9]. The changes are characterized by continuous temperature increase over the 5 h. of testing.
So, the sensor was supplied with power, and the first calibration was performed. Then, calibration was repeated after 1, 2, 4 and 6 h. Results of the measurements of output signals associated with particular sensitive axes against the time since the sensor was powered on are presented in Tables 1-5. The ambient temperature was kept constant during the experiment. Table 1. Averaged values of the output voltages just after start-up of the sensor.  Table 3. Averaged values of the output voltages two hours after the start-up.   Table 5. Averaged values of the output voltages six hours after the start-up. Results of the calculations of the offset OF and scale factor SF for particular sensitive axis against the time since the sensor was powered on, are presented in Tables 6 and 7. The last row indicates the maximal absolute value of the variations of each parameter within 6 h.  Table 7. Scale factor variations within six hours. As can be observed, both at the reheating phase and during early operation of the device, just after connecting it to the power supply, there were no significant temperature fluctuations, since the sensor parameters were not considerably affected. The observed changes were not systematic. Once the parameters increased, and once decreased: no continuous trend can be stated. This observation is altogether different than in the case of a similar study reported in [9]; this can be explained by the application of different types of accelerometers in both studies (in the case of the cited study, the tested accelerometer was installed on a PCB together with a microprocessor unit generating additional heat). Another issue was a good heat transfer from the accelerometer, since the aligning unit is made of aluminum and has relatively large surfaces, besides, the accelerometer is also exposed to open air.

Time from the Start-Up (h)
It was not planned to study the thermal drifts of the accelerometer resulting from changes of the ambient temperature, since values of related parameters are provided by the manufacturer in the dedicated datasheet [31]. Nevertheless, it is worthwhile mentioning that the drift of the offset was more significant than the drift of the scale factor [9].

Long-Term Drifts
The same procedure used for determining the thermal drifts was adapted for studying long-term drifts. The calibration process was performed at the beginning of the test, then it was repeated after 24 and 48 h. of continuous operation of the sensor under constant ambient temperature. Variations of the offset and the scale factor for particular sensitive axes are illustrated in Figure 7.   Figure 7. The last row indicates the maximal absolute values.    Figure 7. The last row indicates the maximal absolute values.
Analyzing the results illustrated both in Figure 7 and Table 8, it can be observed that the variations are rather of a random character. Each sensitive axis reveals its own individual trends. The highest variation of 0.2% was observed for z-axis, since this is rather predictable, due to the fact that this axis generally features worse metrological parameters [27]. The main reason for such a situation is the fact that the MEMS manufacturing processes are in fact only semi-three-dimensional [20], often resulting in a worse performance in the vertical axis. Of course, this is not a general rule, and there exist designs of triaxial (or even multiaxial) MEMS accelerometers featuring uniform parameters in all sensitive axes, taking for an example the original design presented in [32].

Resultant Errors
In order to evaluate the value of the maximal relative error of acceleration measurement, which results from the observed maximal long-term drift, affecting both the offset and the sale factor, the following formula should be applied [8]: where ∆g zl is the relative error (with respect to g) of acceleration measurement in z-axis due to long-term drift. In analogy to Equation (1), the value of the resultant maximal tilt error TEL can be calculated as follows: Similar procedure can be applied to errors resulting from aging TEA. Even though aging effects were not determined in this study, we refer to experimental results related to the same accelerometer ADXL 327 tested over 4.5 years, presented in [8]. Analogously to Equation (20): where ∆g za is the maximal relative error (with respect to g) of acceleration measurement in the z-axis due to aging phenomena, equal to 1.5% [8].
The above values of errors are considerable as related to tilt errors, especially in view of the fact that the long-term drifts were determined over only a 48-h period, and the errors due to aging over only 4.5 years-longer periods may be the reality.

Discussion
Since MEMS accelerometers may be characterized by the considerable deviation of perpendicularity of their sensitive axes, the presented mechanical structure may not be sufficient in some cases, since it allows only one of the sensitive axes to be fully aligned with respect to the housing of the sensor. Consequently, the second sensitivity axis can be precisely aligned only within one plane, and the third cannot be aligned without losing the alignment of the previous two. In such cases, the following solutions are possible:

•
Application of a more precise MEMS accelerometer, with low deviation of perpendicularity of its sensitive axes (either different model or a better piece from the same production lot); • Using only two appropriate sensitive axes (at the cost of decreasing the measurement range or/and the sensitivity, as discussed in [27]); • Using two or three MEMS accelerometers-each having its own aligning unit, featuring only two degrees of freedom (i.e., employing only two aligning screws). In other words, developing a more complicated mechanical structure of the sensor; • Having the first sensitive axis fully aligned, the second partially aligned, and then determining in an experimental way during recalibration the remaining component misalignment angles: one for the second and two for the third sensitive axis, as described in Section 4.1; • Not using the aligning unit and applying instead numerical models compensating for the existing misalignments of all the sensitive axes (i.e., three angles related to non-perpendicularity of each sensitive axis-as proposed in [16]-or six component misalignment angles, two for each sensitive axis-as proposed in [15]).
Each solution had its own advantages and disadvantages. The most interesting one seems to be the mechanical structure with three MEMS accelerometers and three aligning units, where it is possible to eliminate all the misalignments (i.e., two component angular displacements per each sensitive axis).

3D-Printed Housing
Because of a high cost of machining for the housing made of stainless steel, it was decided to use additive manufacturing instead. Two prototypes were made of acrylonitrile butadiene styrene (ABS), using fused material deposition (FDM) technology. One of the manufactured prototypes of the tilt sensor is presented in Figure 8. Moreover, it was decided to add a module of wireless transmission and a battery in order to eliminate the cable. Not using the aligning unit and applying instead numerical models compensating for the existing misalignments of all the sensitive axes (i.e., three angles related to non-perpendicularity of each sensitive axis-as proposed in [16]-or six component misalignment angles, two for each sensitive axis-as proposed in [15]).
Each solution had its own advantages and disadvantages. The most interesting one seems to be the mechanical structure with three MEMS accelerometers and three aligning units, where it is possible to eliminate all the misalignments (i.e., two component angular displacements per each sensitive axis).

3D-Printed Housing
Because of a high cost of machining for the housing made of stainless steel, it was decided to use additive manufacturing instead. Two prototypes were made of acrylonitrile butadiene styrene (ABS), using fused material deposition (FDM) technology. One of the manufactured prototypes of the tilt sensor is presented in Figure 8. Moreover, it was decided to add a module of wireless transmission and a battery in order to eliminate the cable. The prototype had dimensions of 40 × 48 × 48 mm [33], the same as in the case of the steel housing. However, it was not equipped with a spirit level, and employed a different design of the aligning unit: instead of a compliant structure, a commercial cap-and-ball joint was used. Nevertheless, the alignment principle remained the same-it was realized by means of 3 screws and small helical springs as their counterparts.
Because of a considerable shape deviation of the printed housing, its footing had to be machined in order to make it flat, which is important while calibrating the tilt sensor. While using additive manufacturing, attention must be paid to the selection of an appropriate material featuring possibly high mechanical strength in the first place. Then, an appropriate 3D printing technique must be used. As proven by experimental tests of 3D prints, mechanical properties of various materials differ considerably [34,35].
In the case of the second prototype, an attempt was made to manufacture the ball of the joint as integrated with the housing [36]. However, due to porous structure of the 3D prints, it broke easily. Moreover, the ball and its counterparts were characterized by higher friction compared to the commercial cap-and-ball joint. So, because of material properties, it is recommended to use additive manufacturing only for the housing, and to machine the aligning unit in a conventional way. Nonetheless, another trade-off must be realized: substituting stainless steel with a printed polymer results also in a significant The prototype had dimensions of 40 × 48 × 48 mm [33], the same as in the case of the steel housing. However, it was not equipped with a spirit level, and employed a different design of the aligning unit: instead of a compliant structure, a commercial cap-and-ball joint was used. Nevertheless, the alignment principle remained the same-it was realized by means of 3 screws and small helical springs as their counterparts.
Because of a considerable shape deviation of the printed housing, its footing had to be machined in order to make it flat, which is important while calibrating the tilt sensor. While using additive manufacturing, attention must be paid to the selection of an appropriate material featuring possibly high mechanical strength in the first place. Then, an appropriate 3D printing technique must be used. As proven by experimental tests of 3D prints, mechanical properties of various materials differ considerably [34,35].
In the case of the second prototype, an attempt was made to manufacture the ball of the joint as integrated with the housing [36]. However, due to porous structure of the 3D prints, it broke easily. Moreover, the ball and its counterparts were characterized by higher friction compared to the commercial cap-and-ball joint. So, because of material properties, it is recommended to use additive manufacturing only for the housing, and to machine the aligning unit in a conventional way. Nonetheless, another trade-off must be realized: substituting stainless steel with a printed polymer results also in a significant worsening of the robustness of the housing. This may not be acceptable when the tilt sensor is operated under harsh industrial conditions. Still, another problem is the limited temperature range, both for the operation of as well as the storing of 3D prints. Our own tests proved that even the temperature inside a car on a hot summer day (ca. 60 • C) causes a permanent distortion of 3D prints if exposed for a long time. These prints are also hygroscopic, and it is difficult to define the long-term stability of their shape and dimensions.
Nevertheless, when the tilt sensor is to be used only under laboratory conditions (research, didactic classes), printed housing may be considered as a much cheaper option compared to steel housing. Additional machining of the footing ensures satisfactory flatness, whereas linear accuracy of FDM of ca. 0.1 mm is high enough with respect to the required deviation of perpendicularity of the housing faces, which under special conditions may be as high as 1 • (see explanation in Section 2.1). As in the case of the steel housing, perpendicularity deviation of the adjacent faces of the two ABS housings was determined by the coordinate measuring machine. The maximal deviation of perpendicularity among all the adjacent faces of the housing was approximately of few min arc (0.1 • ).

Monitoring of Tilt of Elevated Loads
In order to maintain the high alignment accuracy of the accelerometer sensitive axes while employing the tilt sensor in the monitoring of elevated loads, a special mechanical device was designed. Basically, this provides the housing of the tilt sensor with two angular degrees of freedom, which are controlled by means of two aligning screws, seated in threaded holes of the two-part housing, using the same principle of operation as in the case of the unit aligning the MEMS accelerometer. By setting the aligning screws, it is possible to align appropriate planes of the housing of the tilt sensor with the axis of the lifting rope, as illustrated in Figure 9. sensor is operated under harsh industrial conditions. Still, another problem is the limited temperature range, both for the operation of as well as the storing of 3D prints. Our own tests proved that even the temperature inside a car on a hot summer day (ca. 60 °C) causes a permanent distortion of 3D prints if exposed for a long time. These prints are also hygroscopic, and it is difficult to define the long-term stability of their shape and dimensions. Nevertheless, when the tilt sensor is to be used only under laboratory conditions (research, didactic classes), printed housing may be considered as a much cheaper option compared to steel housing. Additional machining of the footing ensures satisfactory flatness, whereas linear accuracy of FDM of ca. 0.1 mm is high enough with respect to the required deviation of perpendicularity of the housing faces, which under special conditions may be as high as 1° (see explanation in Section 2.1). As in the case of the steel housing, perpendicularity deviation of the adjacent faces of the two ABS housings was determined by the coordinate measuring machine. The maximal deviation of perpendicularity among all the adjacent faces of the housing was approximately of few min arc (0.1°).

Monitoring of Tilt of Elevated Loads
In order to maintain the high alignment accuracy of the accelerometer sensitive axes while employing the tilt sensor in the monitoring of elevated loads, a special mechanical device was designed. Basically, this provides the housing of the tilt sensor with two angular degrees of freedom, which are controlled by means of two aligning screws, seated in threaded holes of the two-part housing, using the same principle of operation as in the case of the unit aligning the MEMS accelerometer. By setting the aligning screws, it is possible to align appropriate planes of the housing of the tilt sensor with the axis of the lifting rope, as illustrated in Figure 9. Because of the fact that the direction of the alignment rotation is random, the respective walls should not be perpendicular, but the angles alpha and beta, illustrated in Figure  10, should be slightly bigger than the right angle (e.g., of 92 degrees arc). Because of the fact that the direction of the alignment rotation is random, the respective walls should not be perpendicular, but the angles alpha and beta, illustrated in Figure 10, should be slightly bigger than the right angle (e.g., of 92 degrees arc). While determining the maximal axial tilt of the elevated load that constantly swings on the lifting rope, the following inverse trigonometric functions can be used: where ax, ay, az are the Cartesian components of the acceleration sensed by the applied MEMS accelerometer, and g is the gravitational acceleration.

Summary
An original tilt sensor has been presented. Its parameters are: Housing material: stainless steel (ensuring robustness) or 3D-printed polymer (ensuring low cost); • Mechanical datum of the housing for accurate mounting of the sensor onto the enduser device, using several threaded holes created in the housing; • External faces of the housing allowing accurate calibration and alignment of the sensor to be performed on a leveled surface; Figure 10. Compliant fixture: 3a and 3b-constriction; 3c and 3d-mounting wall; 3e-working wall; 5-clamping screws; 7a and 7b-aligning screws.
• External faces of the housing allowing accurate calibration and alignment of the sensor to be performed on a leveled surface; • Error of leveling the housing (by means of the embedded spirit level) of approx. 1 min arc.
The presented tilt sensor, owing to the special design of its housing, can be easily and quickly recalibrated by the user in order to eliminate such considerable errors as thermal and long-term drifts as well as effects of aging, keeping the sensitive axes aligned with respect to the external mechanical datum (two faces of the housing).
As it has been experimentally discovered, thermal drifts due to self-heating of the accelerometer typically resulted in relatively insignificant variations of the offset or the scale factor of approx. 0.02%. However, long-term drifts resulted in variations of these parameters as high as 0.2% (3 mV) within only 48 h., corresponding to the acceleration error of ca. 0.7% and tilt error of ca. 0.4 • .
In order to compare the performance of the proposed sensor, misalignment values of four inertial measurement units (IMU) with 6-10 degrees of freedom (DOF) and a MEMS accelerometer by Analog Devices Inc. are listed in Table 9. It should be noted that it is difficult to find MEMS sensors with misalignments of the sensitive axes with respect to the frame (packaging) specified separately in the respective datasheet-this is why sensors by Analog Devices Inc. were selected. Table 9. Misalignments between the sensitive axes and the packaging (frame) [31,37,38]. Moreover, the manufacturer stated that they strove for a tight orthogonal alignment of the sensitive axes, since it simplifies the alignment of the sensor packaging in navigation systems [37,38]. The listed mutual misalignment of the sensitive axes is an inherent feature of a given sensor, and cannot be physically reduced.

Misalignment
While comparing the values of misalignments of the sensitive axes with respect to the packaging (minimal value of ±0.5 • ), it can be stated that the corresponding value featured by the proposed sensor (approximately ±0.03 • ) was considerably lower (16 times).
The IMUs listed in Table 9 had their thermal drifts compensated for. However, even though some of them were quite expensive (price over USD 1000), the long-term drifts and effects of aging phenomena were not reduced, whereas the proposed sensor makes it possible to fully eliminate these effects owing to the recalibration process.

Patents
As a result of the work related to the discussed content, a patent [39] was submitted to the Polish Patent Office. It described both the aligning unit as well as the special housing enabling the recalibration function. Another related patent [40] was submitted to the Polish Patent Office later. It addressed a specific application of the proposed sensor for monitoring the dynamic tilt of elevated loads.