Inclinometer is an important instrument for measuring the levelness of the surface to be measured. Due to its high resolution, wide measuring range and simple integration, inclinometer has been widely used in Marine engineering, mechanical automation, space launch and other fields. However, due to the influence of nonlinear factors and temperature, inclinometer has a large measurement error. In order to reduce the measurement error and improve the accuracy, it is necessary to correct the measurement error by hardware compensation   or software compensation  . Software compensation methods are generally superior to hardware compensation in universality, accuracy, cost, etc. including nonlinear inverse function , polynomial fitting  , neural network  , etc. The nonlinear inverse function takes into account the nonlinear characteristics of inclinometer, but it does not take into account the temperature factor, and it is difficult to solve the nonlinear inverse function precisely, which leads to the low compensation accuracy. The neural network has high requirements for initial values, easy to fall into local minima, and poor generalization ability. The polynomial fitting method has the characteristic of curvilinear form to compensate the measurement error, high compensation precision and easy operation.
At present, the electronic inclinometer is used in the calibration system of a radar to collect the dip data of the plate, and the measurement error of the dip data directly affects the result of the non-levelness calibration of the antenna plate in the radar standard calibration system. Therefore, this paper takes the BWS2000 inclinometer used in the calibration system as an example to study the software compensation method for the measurement error of inclinometer based on polynomial fitting, so as to reduce the influence of measurement error on the calibration results.
2. Analysis of Dip Data
In order to study the measurement error of inclinometer accurately, it is necessary to reduce the influence of “outliers” and random errors. The application of the composite filtering method can effectively reduce the random error and “outliers” interference, that is, the dip value di is measured for N times, and the arithmetic mean value d is calculated as the N − 2 measured values after removing the minimum and maximum value:
Figure 1. Nonlinear error curve.
Figure 2. Temperature drift error curve.
Figure1 shows the measurement error curve of the inclinometer when the temperature varies from 20˚C to 48˚C at an interval of 4˚C. It can be seen from the Figurethat, within the range of ±10˚, the measurement error of the inclinometer is small and remains within 0.02˚. However, the error varies greatly with the increase of dip angle. As shown in Figure1, when the inclination is beyond ±30˚, the measurement error of the inclinometer exceeds 0.1˚. It can be seen that the larger the dip angle is, the greater error caused by nonlinear factors will be, and the nonlinear error curve is more complex.
Figure 2 shows the measurement error curve varying with temperature at each dip angle. With the change of temperature, the measurement error also changes. The larger the dip angle is, the more significant the error will be.
To sum up, the measurement error includes nonlinear error and temperature drift error, especially on the larger dip angle, the two kinds of errors are more obvious. And the two kinds of errors are independent of each other, there is no interaction relationship. Therefore, the error compensation must be compensated simultaneously for the nonlinear characteristic and the temperature influence.
3. Error Compensation by Polynomial Fitting
3.1. Polynomial Fitting Compensation
When the temperature is t, the actual dip Angle is , and the measured value of the inclinometer is d, the measured output model of the inclinometer is
Due to the nonlinear characteristic and temperature of inclinometer, the function of measurement is complex, and its expression is difficult to obtain accurately. The error compensation is to obtain the actual dip angle , which requires constructing the inverse model:
And if the error can be calculated as a function of temperature t and measured dip value d, namely:
Then the actual dip angle can be obtained by , to reduce the error. But the is as complex as , , and their expressions can’t be calculated precisely.
Due to limited conditions, only a limited number of measured data at temperature t and dip value d can be collected. However, the polynomial fitting can be used to fit the relationship function between the error and the dip value, the temperature, that the approximate expression of the function . Finally the compensation of the measurement error can be realized.
3.2. Nonlinear Error Modeling
As shown in Figure 1, the relationship between the nonlinear error ε and the dip value d at different temperatures can be expressed by a polynomial:
How to properly select the highest order n of polynomial is very important for data fitting. If the order is too small, the fitting error will be large and the compensation effect will not be good. On the contrary, the order is too big, although the fitting accuracy of sample data is high, it may not fit the non-sample data accurately. There is a certain error in the sample data itself. Therefore, it is not necessary to make the exacting fitting curve pass all the sample points, but try to pass near the sample points, which can reflect the changing trend of the data.
In order to determine the appropriate polynomial fitting of the highest order, the nonlinear error curve at the temperature of 20˚C was fitted at different orders. The highest order was determined by comparing the sum of squares of the fitting errors at each order, as well as the size and change trend of the determination coefficient. The relationship between the fitting error, coefficient of determination and order is shown in Figure 3.
Figure 3. Sum of squares of fitting errors and coefficient of determination under different orders.
Figure 3 shows that the higher the highest order, the sum of the squares of the fitting error is small, at the same time coefficient of determination is higher. But fitting error sum of squares and coefficient of determination occurred upheaval in order of 3, then changed very little. And it doesn’t need to make the sum of the squares of the fitting error to 0 or coefficient of determination to 1, therefore, identifying the highest order as 3, polynomial model of nonlinear error is:
3.3. Compensation of Temperature Error
It can be seen from Figure 1 that the nonlinear error curve has an obvious drift with the temperature, which inevitably affects the coefficient of the polynomial model. Therefore, the relationship function between each coefficient and temperature should also be obtained. According to the nonlinear error ε curve at different temperature t in Figure 1, the coefficient Pn at different temperature was fitted as shown in Table 1. The relationship between temperature and each coefficient can be more intuitively represented by the figure, as shown in Figure 4.
Figure 4. Relationship between the coefficient and temperature.
Table 1. Values of Pn at different temperatures.
As can be seen from Figure 4, the relationship between pn and t is also complex and nonlinear, which also needs to be represented by a high-order polynomial:
For each coefficient of the relationship between pn and t function, the solution method is the same of the error function. First, it needs to determine the highest order of the polynomial, then comparing the sum of squares the fitting error and the coefficient of determination under different order, eventually determine p3 - p0 fitting of the highest order of 6, 5, 3, 4 respectively, then solving the p3 -p0 of km, an expression of p3 - p0 is obtained as follows:
By substituting p3 - p0 in Equation (8) into the polynomial model of nonlinear error in Equation (6), the measurement error function of inclinometer can be obtained. Therefore, the measurement error can be quickly and accurately obtained according to the dip angle value of the inclinometer at a certain temperature, so as to make real-time measurement error compensation and correction.
4. Experiment of Measurement Error Compensation
In order to verify the validity of the method, new experimental data are used for error compensation and correction experiment. In the experiment of data acquisition, the inclinometer is installed on the radar antenna, and the temperature around the inclinometer is controlled by the air conditioner, so as to obtain the dip data under different inclinations and temperatures.
The measurement data were collected when the dip value varied between ±35˚ at an interval of 5˚ and the temperature varied between 22˚C - 46˚C at an interval of 4˚C. The data were processed by the composite filtering method to obtain the measurement error before compensation, as shown in Figure 5 “Pre-compensation”. After correction of the measurement data by polynomial fitting method, the measurement error is shown in Figure 5 “Post-compensation”. According to the graph comparison, the measurement error of Pre-compensation changes between ±0.2˚, and it changes greatly with the difference of dip angle and temperature. However, the measurement error of Post-compensation is mainly concentrated between ±0.05˚, and is slightly affected by the dip angle and temperature, distributing relatively stable and uniform.
In order to reflect the compensation effect more concretely, the statistical characteristic of the measurement error was compared. The specific values are shown in Table 2.
Figure 5. The measurement output error comparison before and after compensation.
Table 2. The statistical characteristics of measurement errors (Pre-compensation and Post-compensation).
It can be seen from Table 2 that the measurement error of Post-compensation is smaller than the Pre-compensation in terms of mean value, standard deviation and error sum of squares.
Through graphic comparison and quantitative analysis of the measurement errors in Figure 5 and Table 2, it is shown that the polynomial fitting method has a good effect on the measurement error compensation of the inclinometer, which effectively reduces the influence of nonlinear factors and temperature, and it achieves the purpose of improving the measurement accuracy of the inclinometer.
Since the nonlinear characteristic and temperature of the inclinometer have great influence on its measurement accuracy, the two factors of nonlinear characteristic and temperature should be taken into account in the compensation of the measurement error. In this paper, a polynomial model of nonlinear error is constructed based on the polynomial fitting principle, and then the relationship between the coefficient of the model and the temperature is calculated. Finally, the function of the measurement error on the dip angle and temperature is obtained, so as to realize the compensation of the measurement error. This method is not only the model of simple structure, easy to operate, and can greatly reduce the temperature drift error, nonlinear error. The error is kept within 0.03˚, the measuring accuracy of the inclinometer is improved effectively. Later, it is applied in radar calibration system to improve the accuracy of calibration results.
 Chen, H.T., Xue, Z.G., Jin, H.W. and Zhang, W.Y. (2020) Method and Realization of Nonlinear Compensation and Temperature Compensation for bme680 Pressure Sensor. Journal of Naval Aeronautical Engineering College, 35, 200-204+222.
 Wang, X.Y., Zhu, J.L. and Miao, M. (2020) Gyro Error Compensation Method Based on Threshold Noise Reduction and Neural Network. Journal of Beijing University of Information Technology (Natural Science Edition), 35, 58-62+77.