Detection of the Trench Depth Based on a Differential Inertial Sensor Technology

The article proposes the use of a differential inertial sensors system for detection of the trench depth under operation. The inertial sensors are employed to detect a posture of the trencher and as a result to determine an angle difference through inertial sensors located on a vehicle (as a reference) and on the trencher arm. In this way, the undesirable, disturbing effects caused by unevenness of the field etc. are significantly reduced or even eliminated. The trench depth calculation procedure combines the angle difference and relative dimensions of the trencher structure. It is displayed on a monitor in real time. To perform a remote monitoring, the system is equipped with wireless transmission module using an upper-computer. To decrease data oscillation under operation, the calculated angles need to be filtered. Therefore, simulation based on Kalman filter in MATLAB was performed and found Q/R rate takes an important role in filtering and filtering test verified it. In field test, error rate between trench depth measured and detected is within 5 % what confirms the practical usefulness of the developed measuring system for the trench depth detection.DOI: http://dx.doi.org/10.5755/j01.eie.24.3.20973

1 Abstract-The article proposes the use of a differential inertial sensors system for detection of the trench depth under operation.The inertial sensors are employed to detect a posture of the trencher and as a result to determine an angle difference through inertial sensors located on a vehicle (as a reference) and on the trencher arm.In this way, the undesirable, disturbing effects caused by unevenness of the field etc. are significantly reduced or even eliminated.The trench depth calculation procedure combines the angle difference and relative dimensions of the trencher structure.It is displayed on a monitor in real time.To perform a remote monitoring, the system is equipped with wireless transmission module using an upper-computer.To decrease data oscillation under operation, the calculated angles need to be filtered.Therefore, simulation based on Kalman filter in MATLAB was performed and found Q/R rate takes an important role in filtering and filtering test verified it.In field test, error rate between trench depth measured and detected is within 5 % what confirms the practical usefulness of the developed measuring system for the trench depth detection.

Index Terms-Inertial sensor; Trench depth detection;
Filtering; Remote monitoring.

I. INTRODUCTION
To keep a constant trench depth is one of the most important conditions required to ensure the quality of field working and plays a significant role in agricultural production, gardening as well as a land improvement.The method commonly used to estimate the depth value is manual measurement.However, it takes time and energy, and results in a poor consistency and repeatability.Above all, there is unable to meet the requirements of real-time trench depth acquisition under field operation.
With the development of sensor technology and proceeding of agricultural mechanization, there are various instruments and equipment available to replace the manual measurements [1].At present the improved detection methods of the trench depth is based on direct measurements using contour wheel [2] or indirect method by means of displacement sensors [3], inclinometers [4], ultrasonic sensors [5], etc. Besides, there can be used a combined method of the two above [6].
This paper analyses and studies the use of a differential trench depth detection system based on inertial sensor technology.The inertial sensors are employed to detect postures of both the trencher and a vehicle.Therefore, the trench depth is calculated using data from the inertial sensor taking into account as relative dimensions of the trencher as well as there of mounting.The system processes data in real time and utilizes wireless transition sending data to upper-computer.Therefore, it implements function of a remote monitor by means of website.

A. Detecting Principle
Under the real conditions of a field operation, operators are unable to acquire trench depth in real time.Besides, a machine vibration, uneven soil under real farming etc. can result in significant errors under working.Therefore, taking the above into account, authors have developed a differential trench depth detection system basing on inertial sensor technology.Therefore, the inertial sensors are used to detect and measure such physical quantities like acceleration, tilt, impact, vibration, rotation and motion of multiple degrees of freedom [7]- [9].These functions are provided by means of accelerometer and gyroscope which perform functions of the inertial sensor [10].
In this system, the inertial sensors are utilized to detect postures of the trencher and a vehicle body, therefore, to detect tilt angles of the trencher and the vehicle body referring to the horizontal plane respectively (as shown in Fig. 1).The angle of vehicle body α indicates tilt condition of the whole vehicle, that is, ground situation.Similarly, β angle of the trencher is under the same ground situation.Therefore, through the angle difference γ between the trencher and the vehicle body, a detection error caused by a slope can be eliminated.
As shown in the Fig. 1, one sensor is fastened to the arm of the trencher and the other is located on the vehicle body.The structure and mounting position of the trencher are fixed.Under operation, when adjusting the trench depth, the trencher rotates around pivot point fixed on the vehicle.
Therefore, the angle of the trencher with respect to the vehicle body indicates direct correlation to the trench depth and changes under the trench depth varying.So, the trench depth is able to be estimated simply by the angle difference and related sizes.

B. Depth Calculation
The system uses inertial sensors of the MPU6050 type being, a six-axis motion processing modules.They are composed of three-axis accelerometer, three-axis gyroscope and a digital motion processor [11]- [13].Measurement ranges of the accelerometer as well as the gyroscope are programmable in order to track movement accurately.The optional range of the accelerometer can be selected as ±2 g, ±4 g, ±8 g or ±16 g, and this of the gyroscope as ±250°/s, ±500°/s, ±1000°/s or ±2000°/s respectively [14].Selection of the ranges depends on both specified condition of operation as well as a speed of motion.In practice, range of accelerometer is set to be ±2 g, and range of gyroscope ±2000°/s respectively.Since the output of MPU6050 is 16-bit and range of accelerometer is ±2 g, therefore, sensitivity of accelerometer is 2 16 /(2 × 2) = 16384LSB/g.The acceleration can be thus calculated as follows / 16384, where Ai (i = x, y, z) is acceleration along the x, y, z-axis (from MPU6050) before transfer, ai (i = x, y, z) is acceleration along the x, y, z-axis after transfer.For the developed system, only the angle along x-axis θ is needed tan .
Thus, the angle difference can be obtained by subtraction of the angles measured by two respective inertial sensors.
where L is length of trencher arm, r is radius of rotary blade, l is distance between fixed pivot point and ground.

A. Filtering Procedure
Under operation the machine vibrations etc. will result in oscillation of the sensors' output signals.Therefore, the depth calculation becomes unstable and inaccurate.To avoid this, the calculated angle difference need to be filtered so as to decrease data oscillation.
Kalman filter is a data processing algorithm based on the theory of optimal autoregression [15]- [17], which make optimal estimation of system state via observation data of system input.In this paper, angle difference is the objective need to be filtered.The model of filtering flowchart is shown in Fig. 3 [18], [19].Filtering consists of two parts, prediction and correction.In prediction part, angle difference is estimated by optimal value of angle difference at the last time and a relative prediction covariance is needed.In correction part, optimal gain changes with covariance and R. Then optimal value of angle difference can be estimated on the basis of predicted value, measured value, and optimal gain and covariance updates with it.The process needs to be iterative at the next time.
x(k|k) is optimal value of angle difference at time k; z(k) is observed value of angle difference at time k; H is observation parameter; P(k|k) is covariance of x(k|k).
Note that both Q and R value vary with the measured data (Fig. 3(b) and Fig. 3(c)) what should be taken under consideration when realize adaptive filtering [20].Unfortunately, the adaptive filtering needs much more complex program, which can burden the system and can influence the speed as well.Therefore, to simplify calculations, parameters Q and R applied in the system for filtering are assumed to be constant.

B. Filtering Simulation
Filtering effect depends on parameters Q and R. Therefore, respective simulation in MATLAB has been performed to find out an influence of different Q and R value on filtering effect, according to filter model above.When combined steps in Fig. 3(b) and Fig. 3(c), the influence of Q/R rate on the filtering effect (on optimization) can be estimated from (4) ( 1| 1)+ ( ) ( 1| 1) Firstly, the filtering effect for the same Q/R rate however, at different Q and R values was considered.It must be noted that Q and R value are relative to process noise and observation noise respectively.Under simulation, the variance of observation values was found to be 8, so the initial value of R is set to be 8 as well.The filtering diagram for three different 4 and variances of them are listed in Table I.As shown in Fig. 4(a), four curves after filtering almost overlap, that is, filtering effect is basically the same for Q/R = 0.1 and when R is equal to 8, 1, 0.1, and 0.01 respectively.Meanwhile, variances after filtering are smaller than that before filtering (variance before filter is 8 and variance after filtering is less than 5).Moreover, as we can see from Table I, the variance decreases with decrescence of Q and R and a tendency to be a constant.For Q/R = 1 and Q/R = 2 (Fig. 4 (b) and Fig. 4 (c)), overall situation is similar to this in Fig. 4 (a).The curves after filtering overlap and variance decreases with decrescence of Q and R.
So one can conclude that with the decrescence of Q and R, the variance is a little bit smaller, but filtering effect is basically the same.
From Fig. 4 and Table I, it can be concluded that the filtering effect can be better as Q/R increases.To make it clearer, the curves for different Q/R rates, Q/R = 2, 1, 0.1, and 0.01 for the constant Q value when changing R, have been put on Fig. 5.The curves after filtering have a tendency with observations.It is obvious that amplitude of curve reduces with the decrease of Q/R rate.However, due to the unchanged expected value in Fig. 5, it is unable to figure out dynamic effects.As a result, observation curve has been replaced by a sine curve with noise as in Table II.There are four different Q/R rates and it can be seen that vibration is decreased and variance reduces from 7.078 to 3.222 when Q/R rate reduces from 2 to 0.01.
There is a trend that variance will approach a constant value with the decrease in Q/R.However, delay comes out at the same time and the smaller Q/R is, the longer delay is.According to the above analysis, there are two changing trends with the decrease in Q/R: 1. Amplification and variance of curves after filtering is smaller.There is a trend that variance will approach a constant with the decrease of Q/R.It implies that Q/R rate has nothing to do with filtering effect while Q/R reduces to a certain degree.2. Filtering effect becomes more obvious.

IV. DETECTION SYSTEM
This system mainly consists of data acquisition module, wireless transmission module, and upper-computer (Fig. 7).The data acquisition module collects data, processes them and displays the trench depth in real time.The wireless transmission module transfers the processed data to the upper-computer through wireless network.The upper-computer possesses functions of data storage, historical records query, curve drawing, and map display to realize remote monitoring.The data acquisition module and the wireless transmission belong to hardware device placed on operation machine.
Structure diagram of hardware device is shown in Fig. 8. Data acquisition module uses Microprogrammed Control Unit (MCU), MC9S12XS128 as the core.The MC9S12XS128 is a 16-bit single-chip microcomputer with powerful functionality, strong stability and efficient computation capacity [21].It is equipped with 8KB RAM and 128KB flash, sufficient in this system.Moreover, it contains several interface modes for diversified requirement.Among them, two serial communication interfaces are applied to receive GPS data and to send information to wireless transmission module.Wireless transmission module adopted is YJ400, enabled by a subscriber identification module (SIM).Hence, wireless transmission module is user-friendly control and can communicate through GPRS network.The data acquisition module is primarily composed of two inertial sensors, a monitor, and a GPS unit except the MCU.The MCU receives data from inertial sensors and differential angle to reduce influence on detection caused by uneven field.Then MCU calculates trench depth by angle difference combined with the relative sizes of trencher structure and the positons of inertial sensors using (3).The trench depth is displayed by monitor so that operators can obtain trench depth in real time.Meanwhile, GPS module collects GPS information of working machinery and transfers it to MCU by NMEA-0183 protocol [22] through a serial communication interface (SCI).MCU simply gets longitude and latitude from all GPS information every few seconds.Then MCU integrates ultimate data processed and sends them to wireless transmission module at a certain frequency programmed by users on the upper-computer.Wireless transmission module transmits data to upper-computer by GPRS network the moment it receives data.
The upper-computer possesses functions of data storage, historical records query, curve drawing, and map display to realize remote monitoring in the form of a website.It can draw trench depth curve, locate and display working route of trencher on map, so people are able to monitor the status of working trencher remotely.

A. Filtering Test
In the system, filtering model is set up to optimize angle for the trench depth.Simulation has been carried out to find effect of Q/R changes on filtering.Then the test was conducted to verify result of further simulation.
A remote-control vehicle made by our laboratory in other project was used as a carrier in the test.There is an adjustable platform, whose pitch angle can be changed on the vehicle.Under the test, one sensor was located on the vehicle body, whereas, the other on the platform as shown in Fig. 9. Before the test, the platform was adjusted to an appropriate angle, equal to 13.43° specifically.This state was remained under the whole test.Five groups of Q and R values were chosen and separated into two parts for the same Q/R as well as different Q/R rate.

1) The same Q/R rate
For the same Q/R rate, equal to 0.0001, results of three groups are shown in Fig. 10 and Table III  From Fig. 10 it can be seen that filtering is performed well severally and effects are similar for the three tested different groups.Variance values before filtering are all between 4 and 5 and variance values after filtering are all between 0.4 and 0.5.Moreover, average angles before and after filtering are basically identical.So test and simulation arrive at the same conclusion that filtering effect is basically the same under the same Q/R rate.In Fig. 11, curves of three groups fluctuate near the average within a certain range.When Q = 0.001 and R = 0.1(as in Fig. 11(a)), filtering takes effect and variance decreases from 4.52 to 1.12.But the amplification after filtering is still not significant.When compare data in Fig. 11(b) with Fig. 11(a), one can see that data fluctuation is narrower and variance is smaller.From Fig. 11(c), it is clear that data filtering is the best of three groups and it is quite smoother than initial data.From Fig. 11 and Table IV, it can be seen that for different Q/R rate, the variance is smaller and optimization is closer to ideal value with decreased Q/R.It indicates that the filtering effect (for the analysed filtering model) becomes better with the decrease of Q/R.It is consistent with simulation.

B. Field Test
Field tests have been conducted in Yanqing Agricultural Mechanization Technology Extend and Serve Station.Under the test, a JDT600 tractor (produced by John Deer) pulled and powered the test trencher, (3KPF-50 orchard trencher).The measuring and control equipment was located at the appropriate places and positions of the tractor and test trencher.Two inertial sensors were fixed as stated in the previous section.Therefore, the one on a lifting arm of the trencher and the other on tractor as a reference.The angle difference of two sensors calculated expressed relative positon of the tractor and the test trencher.Figure 12 shows specific installation conditions of these devices.To get the real trench depth, test operators measured relative sizes of structure and mounting position.The measured sizes were: l = 490 mm, L = 1500 mm, r = 575 mm.Under testing operators measured two distances each of 100 m in length, and marked twenty points evenly distributed along the distance.The tractor driver controlled and adjusted the trencher for trenching to a certain depth.Then he switched on the data acquisition module as well as the wireless transmission module.After a few seconds, (startup time), the tractor driver started work until the data displayed on website.After completion of the work, the trench depth was measured 3 times and the average values were calculated and recorded for each marked point.
The trench depths detected by means of the developed measuring system was found to be in a good coincidence with these measured manually.The error rate is within 5 %, (Table V) what confirms the practical usefulness of the developed measuring system for the trench depth detection.A method based on differential inertial sensors was proposed to detect trench depth.Inertial sensors are utilized to acquire angle difference through one inertial sensor on vehicle (as a reference) and the other on the trencher arm.Thus, the effects caused by unevenness of the field, etc. can be reduced or even eliminated.The trench depth is calculated with the combination of the angle difference and relative dimensions of the trencher structure.2. To decrease data oscillation caused by the machine vibrations etc. under operation, the calculated angles need to be filtered.Filtering effect depends on parameters Q and R. Therefore, simulation in MATLAB has been performed.
And we found out an influence of Q/ R value on filtering effect: (a) With the change of Q and R under the same Q/R value, filtering effect is basically the same.Such as variances after filtering are all around 6 when Q/R is 1.
(b) With the decrease in Q/R, amplification and variance of curves after filtering is smaller.When Q/R decreases from 2 to 0.01, variance reduces from 7.078 to 3.222.
3. Detection system was set up and filtering test was taken to verify conclusions in simulation.Test results shew that on the one hand, when Q/R is 0.0001, variances after filtering are all between 0.4 and 0.5; on the other hand, when Q/R reduces from 0.01 to 0.0001, variances after filtering decrease from 1.12 to 0.44.The results coincide with that in simulation.4. Field tests are conducted and error rate of measured depth and detected depth is within 5 %, which confirms the practical usefulness of the developed measuring system for the trench depth detection.

Fig. 2 .
Fig. 2. Geometrical relationship of trench depth and angle difference.From Fig.2can be deduced a formula for geometrical

Fig. 3 .
Fig. 3. Filtering model flowchart: x(k|k -1) is predicted angle difference at time k based on optimal result at time k -1; x(k -1|k -1) is optimal angle difference at time k -1; A is state transfer parameter; w(k) is process noise; P(k|k -1) is covariance of x(k|k -1); P(k -1|k -1) is covariance of x(k -1|k

Fig. 4 .
Filtering effect with different Q and R: a) -Q

Fig. 5 .
Fig. 5. Comparison of filtering effects under different Q/R values with constant expected value.

Fig. 6 .
Fig. 6.Comparison of filtering effects under different Q/R values with and sinusoid as expected value.

Fig. 7 .
Fig. 7.The overall frame diagram of the detection system.

2 ) 11 .
Different Q/R rate In order to test filtering effect under different Q/R rate the R value varied with fixed Q to obtain the change of Q/R.Results of three groups are shown in Fig. 11 and Table IV respectively.Filtering effects with different Q/R: a) -Q = 0.001, R = 0.1; b) -Q = 0.001, R = 1; c) -Q = 0.001, R = 10.
Manuscript received 26 September, 2017; accepted 11 January, 2018.This research was funded by grant (No. 2017YFD0700603 and No. 2016YFD0700102) the National Key Research and Development Program of China.

TABLE I .
DATA VARIANCES AFTER FILTERING WITH DIFFERENT Q AND R.

TABLE II
. DATA VARIANCE AFTER FILTERING UNDER DIFFERENT Q/R VALUES WITH SINUSOID AS EXPECTED CURVE.

TABLE III .
FILTERING RESULTS OF DIFFERENT Q AND R WITH THE SAME Q/R RATE IN FILTERING TEST.

TABLE IV .
FILTERING RESULTS OF Q AND R WITH DIFFERENT Q/R RATE IN FILTERING TEST.

TABLE V .
DETECTED AND MEASURED TRENCH DEPTH IN FIELD TEST.