Ghanbari 2015

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

This article has been accepted for publication in a future issue of this journal, but has not been

fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/JSEN.2014.2366874, IEEE Sensors Journal
IEEE SENSORS JOURNAL 1

Delay Compensation of Tilt Sensors Based on


MEMS Accelerometer Using Data Fusion
Technique
Milad Ghanbari and Mohammad Javad Yazdanpanah

Abstract—In this paper, the inaccuracies of the tilt sensor based paper, we focus on these types of systems. In these applica-
on MEMS (Micro Electro Mechanical Systems) accelerometer tions, the measurement of the angle is not trivial; hence sensors
and gyroscope during the process of the angle measurement such as gyroscope, tilt sensor or acceleration sensor are used
are considered and a new method is proposed to compensate
them, using data fusion of sensors. The tilt sensor has a constant instead of encoder. However, each of these sensors has some
delay and low bandwidth. In the gyroscope, drift phenomena disadvantages too. Thus, these sensors are seldom used alone.
makes some difficulties in the angle measurement. A model for Tilt sensor directly measure the angle with respect to its
the sensory system is developed and a modified Kalman filter vertical axis but it has some problems such as delay and
is proposed to compensate the delay of the tilt sensor using low bandwidth. Angle could be obtained by integrating the
the data fusion technique. A complementary filter is designed
to overcome the problem of low-bandwidth in the tilt sensor. gyroscope output; but in practice, due to the drift problem in
The overall proposed sensor fusion consists of a complementary gyroscope, the measured angle is far away from its actual value
filter as a pre-filter and a modified Kalman filter as a post-filter in a long time. Angle measurement in acceleration sensor is
to solve the problems of bandwidth and delay, respectively. The based on component of the vector of gravitational acceleration
experimental tests are performed to evaluate the effectiveness on axes of the sensor and use of trigonometric relations [10].
of the proposed sensor fusion scheme. In these experiments, the
accuracy in the tilt measurement is improved from 10◦ to 0.9◦ and For this reason, only in a quasi-static mode, exact angle can
15◦ to 0.6◦ in low-frequency tests, and from 18◦ to 0.8◦ in higher be obtained from the acceleration sensor. In the dynamic
frequency test. Also, the bandwidth of the tilt measurement is mode, the angle measurement from this sensor becomes highly
enhanced from 0.16 Hz (bandwidth of tilt sensor) to 6 Hz. The inaccurate, because of the influence of other accelerations in
results show proper performance of the proposed approach in addition to the gravity acceleration. In [11], data fusion of
the line of delay compensation and increment of the bandwidth.
acceleration sensor and gyroscope by Kalman filter are used
for measuring the angle of the pendulum. However, due to the
Index Terms—Tilt sensor, complementary filter, gyroscope, drawbacks of the acceleration sensor in measuring the angle,
Kalman filter, sensor fusion.
just small deviation of pendulum from the vertical axis (which
causes slow motion of pendulum) is investigated. Another
I. INTRODUCTION way for data fusion of gyroscope and acceleration is using a
complementary filter. Authors of [12] used this filter for linear
NGLE MEASUREMENTS are used in many applica-
A tions such as navigation systems, robotics, motion anal-
ysis, motion control, etc. [1]–[9]. Each of these applications
model identification of a robot. However, due to acceleration
sensor problem in measurement of angle, it cannot be used for
nonlinear model identification. In [3], authors used fusion of
require suitable sensor to measure the angle. Typical sensors tilt sensor and gyroscope with combination of a Kalman filter
for measurement of angle are encoders, acceleration sensor, tilt and complementary filter algorithms to control two wheeled
sensor and gyroscope. For applications in which axis of angle mobile inverted pendulum robot. In [4], for increasing the
measurement is connected to a fixed reference (for example bandwidth of tilt measurement, a combination of acceleration
ground), measurement of the angle with high precision can sensor, tilt sensor, and gyroscope is used. They modeled tilt
be achieved by means of an encoder [7]. However, in many sensor as a simple pendulum, obtained its transfer function,
applications, such as aerospace systems, mobile robot with and then used system identification methods to estimate the
inverted pendulum, navigation systems, etc, axis of the angle corresponding parameters. By using the transfer function as
measurement is not connected to a fixed reference. In this the tilt sensor’s dynamics and applying the Kalman filter
algorithm, they fused data of tilt sensor, acceleration sensor
Manuscript submitted December 01, 2013; revised April 04, 2014 and July
14, 2014; accepted October 17, 2014. and gyroscope to estimate the angle.
M. Ghanbari is an M.Sc. student in the School of ECE, University of In terms of time response and in a specific classification,
Tehran, Tehran, Iran. (e-mail: mi.ghanbari@ut.ac.ir) there are two types of tilt sensor. The first type is sluggish
M. J. Yazdanpanah is with the Control & Intelligent Processing Center
of Excellence (CIPCE) and Advanced Control Systems Laboratory (ACSL), and the second type has a delay. In this paper, the second
College of Engineering, School of ECE, University of Tehran, Tehran, Iran. type of tilt sensors is utilized. In [3] and [4], the first type
(e-mail: yazdan@ut.ac.ir) of tilt sensors is used. The second type of tilt sensors has a
Copyright (c) 2013 IEEE. Personal use of this material is permitted.
However, permission to use this material for any other purposes must be lower price compared to that of the first one. For example,
obtained from the IEEE by sending a request to pubs-permissions@ieee.org. we used CMPS10 tilt sensor which is cheaper than the tilt

1530−437X (c) 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See
http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/JSEN.2014.2366874, IEEE Sensors Journal
2 IEEE SENSORS JOURNAL

Fig. 2. CMPS-10 Tilt sensor [24] (left), Gyroscope [25] (middle) and Encoder

TABLE I
CHARACTERISTICS OF SENSORS

Tilt sensor Gyroscope Encoder


(CMPS10) (MLX90609 ) (incremental)
High
Resolution 0.1◦ 0.05◦
(< 0.01◦ /sec)
Accuracy 1◦ < 0.1◦ /sec < 0.1◦
Fig. 1. Test apparatus included: tilt sensor, encoder and gyroscope. Supply
voltage 3.3 − 5V 5V 5V
Output digital
format I2 C, serial, pwm analog (square wave)
sensor used in [4] (U.S. Digital T2-7200-T). Although there measuring
range ±85◦ ±75◦ /sec ±360◦
are tilt sensors which do not have the problems mentioned
above, their prices are higher [13]. In [14]–[20], sensor fusion
by using different filters is discussed. Authors of [16] used
mean filter and Kalman filter to estimate attitude angle. Also to evaluate the accuracy of the proposed data fusion algorithm.
in [17], an extended Kalman filter and a Madgwick filter for The encoder is used as a reference for angle measurement.
oriented estimation are used and compared. Up to now, to the All test procedures reported in this paper, are performed by
best of authors’ knowledge and by referring to references [4], moving the pendulum part and gathering data. The tilt sensor,
[6], [15]–[20], [12], [21], [22], delay in the tilt estimation has gyroscope and incremental encoder used in this system are
not been considered yet. We used the method introduced in shown in Fig. 2. Table I also represents characteristics of the
[23] for compensation of delay. In this paper, we modify this mentioned sensors.
method in order to make it executable on our sensory system.
Also, compared to the previous work on sensor fusion of the III. PERFORMANCE DISADVANTAGES OF THE SENSORS
tilt sensor and gyroscope [4], a new sensor fusion algorithm As mentioned in Section I, the tilt sensor and gyroscope
consisting a modified Kalman filter and a complementary filter both have disadvantages in measurement of angle. In this
is proposed concerning the delay compensation, enhancement section, the disadvantages are investigated in more details.
of the tilt sensor bandwidth and elimination of drift in the
gyroscope. In the meantime, frequency characteristic of the tilt
A. Tilt Sensor
sensor is obtained and based on that, a complementary filter
is designed to increase the bandwidth of the tilt measurement. The tilt sensor used in this study has an accuracy of
The rest of this paper is organized as follows. Section approximately 1◦ and its correct measurement-range in roll
II illustrates the test apparatus which has been constructed and pitch is ±85◦ . One should note that, since the tilt sensor
to investigate the characteristics of sensors and evaluate the is based on MEMS accelerometer, therefore, can operate cor-
proposed data fusion algorithm. Section III investigates the rectly only under quasi-static conditions (i.e., when no constant
characteristics and problems of the tilt sensor and gyroscope in accelerations act except for the gravitational acceleration). The
the direction of measuring the angle. In Section IV, we propose used sensor (CMPS-10) has two main disadvantages. One of
a modified version of the Kalman filter to solve the problem them is the delay in its response. In this type of sensors, the
of delay in the tilt sensor. A complementary filter is presented time which sensor consumes to filter specific number of data
in Section V to overcome the problem of low bandwidth in the to update its output, causes a constant delay. A test has been
tilt sensor. Section VI illustrates the experimental result and performed on the test apparatus to determine tilt sensor delay
indicates effectiveness of the proposed sensor fusion algorithm and to measure its duration. This test is shown in Fig. 3. As
in overcoming the problems of the tilt sensor and finally, seen in this figure, the angle of tilt sensor has a constant delay
conclusions and discussions are presented in Section VII. with respect to the actual angle measured by the encoder.
The second disadvantage of tilt sensor is the high decrement
II. TEST APPARATUS of accuracy at high frequencies. In other words, these sensors
have a low bandwidth, due to data filtering process. As seen
To investigate the characteristics of the tilt sensor and
in Fig. 3, by delay ignorance, in the initial motions which are
gyroscope, a test apparatus -shown in Fig. 1- was constructed.
slow (low frequency), the accuracy of tilt sensor is good, but in
The test bed consists of an incremental encoder, a tilt sensor, a
the final motions which is fast (high frequency), the accuracy
gyroscope, a pendulum and a shaft which connects pendulum
of tilt sensor highly decreases.
to the encoder. The encoder has inaccuracy in its measurement.
This inaccuracy, as mentioned by its manufacturer, is less
than 0.1◦ which is enough for our application. It should be B. Gyroscope
noted that all considerations and experiments are limited to the As we know, the gyroscope measures the angular velocity.
single-axis tilt measurement. Furthermore, this test bed is used In theory, angle can be achieved by integrating the gyroscope

1530−437X (c) 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See
http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/JSEN.2014.2366874, IEEE Sensors Journal
GHANBARI AND YAZDANPANAH: DELAY COMPENSATION OF TILT SENSORS BASED ON MEMS ACCELEROMETER USING DATA FUSION TECHNIQUE 3

50
20 Encoder Signal
Tilt Sensor Signal Encoder Signal
40
Integration from Gyroscope Signal
15 30

20
10
Angle (deg)

Angle (deg)
10
5
0

0 −10

−20
−5
−30

−10 −40
0 0.5 1 1.5 2 2.5 3 3.5 4 0 5 10 15 20 25 30 35 40
Time (sec) Time (sec)

Fig. 3. Angle measured by encoder and tilt sensor to demonstrate delay and Fig. 4. Angle measured by encoder and gyroscope to demonstrate the drift
low bandwidth of the tilt sensor phenomena

output. However, in practice, this is not possible because input and output. We consider a linear time invariant discrete
of the drift phenomenon and the accumulation of numerical system with zero-delay measurement in the state space form
integration errors incurred in obtaining the angle from angular as follows:
rate. In practice, output of gyroscope has a bias in addition to
its actual angular velocity, as stated below: xk = F xk−1 + Guk−1 + wk−1 (3)
yk = Hxk + vk (4)
ωgyro = ωactual + b (1)
where x ∈ Rn is the state, u(t) ∈ Rm is the input, y(t) ∈ Rp
where ωactual and ωgyro are actual angular rate and angular
is the measurement, wk ∼ N (0, Qk ) is process noise, vk ∼
rate measured from gyroscope, respectively. The gyroscope
N (0, Rk ) is the measurement noise and F, G, H are known
bias depends on several factors [26]. Two of the most impor-
matrices of appropriate dimensions.
tant factors are output of gyroscope in zero angular velocity
The optimal state estimator minimizing the variance of
and internal temperature of the device. The output signal of
the estimation error is Kalman filter. A derivation of the
gyroscope sensor is an analog voltage. The relation between
Kalman filter equations can be found in [27]. The equations
angular velocity corresponding to this output voltage is:
for estimation are summarized below:
V − Vω=0
ωgyro = (2) x̂− +
k = F x̂k−1 + G uk−1 (5)
scale f actor
Pk− = +
F Pk−1 F ⊤ + Qk−1 (6)
The scale factor and Vω=0 are given in the datasheet
of gyroscope. However, Vω=0 may slightly change during Kk = Pk H[H Pk− H ⊤ + Rk ]−1

(7)
operation of the sensor and over time which causes a bias in x̂+
k = x̂− −
k + Kk [yk − H x̂k ] (8)
Eq. (2). Due to this bias, integration from gyroscope does not Pk+ = [I − Kk H] Pk− (9)
lead to the actual angle and cause a drift term. To describe the
drift problem in the gyroscope, we performed an experiment where x̂− +
k is prior estimation, x̂k is posterior estimation,
− +
on the test apparatus which is shown in Fig. 4. As it is evident Pk is prior covariance, Pk is posterior covariance, Kk is
in the figure, due to drift phenomenon, angle measured from Kalman gain and Q and R are process and measurement noise
gyroscope deviates from its actual value over time. covariance matrices, respectively. The steps of the Kalman
The following part of the paper is devoted to this topic filter estimation depicted in Fig. 5, which consists of two
which resolves the problems of delay and bandwidth of the parts: prediction and correction. As can be seen, using Kalman
tilt sensor by designing appropriate filters for data fusion of filter requires a model of the system. Consequently, in the next
the tilt sensor and gyroscope. subsection a model for this system will be developed.

IV. FILTER DESIGN FOR COMPENSATION OF DELAY A. Modeling of the Sensory System
As investigated in the previous section, one of the major The first equation for modeling the sensory system is the
problems of tilt sensor in the measurement of the angle is angular momentum equation:
existence of a constant delay in its response. In this section,
we design a suitable filter in order to combine data of the θ̇ = ω = ωgyro + b (10)
tilt sensor and gyroscope to remove the effect of delay in the As previously mentioned, bias of the gyroscope depends
output of this filter. on several factors such as output in zero angular velocity
One of the common and well known algorithms in sensor and internal temperature of the device. In [26], the relatively
fusion is Kalman filter. A Kalman filter is a stochastic recursive accurate model of gyroscope was investigated. The relatively
estimator, which estimates the state of a system based on accurate model for bias of gyroscope is as follows:
the knowledge of the system input, the measurement of the
system output, and a model of the relation between the b = bb + bR + bm (11)

1530−437X (c) 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See
http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/JSEN.2014.2366874, IEEE Sensors Journal
4 IEEE SENSORS JOURNAL

where Ts is the sample time. If the sample time be small


enough, we can approximate Eq. (22) as below:
F = I + A Ts , G = Ts B, H=C (23)
Finally, model of our sensory system in the linear discrete time
state-space form with delay in the measurement is as follows:
[ ] [ ]
1 Ts T
xk = xk−1 + s uk−1 + wk−1 (24)
0 1 0
[ ]
yk = 1 0 xk−N + vk (25)
where N is the number of delay sample in the tilt sensor.
Fig. 5. A complete procedure of the estimation in the Kalman filter

B. Modified Kalman Filter


where b denotes bias of gyroscope, bb is the bias instability, As can be seen from Eqs. (5-9), in each sample, Kalman fil-
bR denotes gyro rate random walk and bm denotes first-order ter needs measurement in same sample, but our sensory system
Markov process noise. It should be noted however, a property has a constant delay in the measurement; hence, we cannot
which simplifies the modeling of the bias is its very slow use the original version of the Kalman filter for estimation.
dynamics, namely, we can assume that this bias is constant Fortunately, we can compensate the delay in the estimation
over relatively large period of time and ignore first-order by some modification in the Kalman filter algorithm [23].
Markov process noise. Therefore the following model was In [23], the assumption of knowing exactly the measurement
used for the bias of gyroscope: covariance matrix is needed which is not executable for our
sensory system. In this paper, we modify this assumption in
b = bb + bR (12)
order to be executable on our sensory system. To illustrate our
in which dynamics of bb and bR are as follows: modification, we first describe this algorithm with a numerical
example and then, extend the method to the general case
ḃb = 0 (13) as investigated in [23]. As mentioned in [23], we consider
ḃR = w2 (14) two cases: in the first case, we do not have any delay in
the measurement and in the second, we have delay. Assume
where w2 is a Gaussian noise. The output of these dynamical
that we are in the 4th sample and have three sample delay
equations, using the tilt sensor, is defined as follows:
in the measurement. For the first case, based on the Kalman
y(t) = θtilt = θ(t − τ ) (15) prediction step (Fig. 5), the effect of measurement y1 in the
prediction of states at 4th sample is:
where θtilt is angle which is measured from tilt sensor and
τ is the delay of the tilt sensor. The dynamic equations of the x̂′4− = F x̂′3+ + G u3
overall sensory system can be presented as below: =F [x̂′3− + K3′ (y3 − H x̂′3− )] + G u3
θ̇ = ωgyro + b + w1 (16) =F [ (I − K3′ H) x̂′3− + K3′ y3 ] + G u3
ḃ = w2 (17) =F [ (I − K3′ H) (F x̂′2+ + G u2 ) + K3′ y3 ]+G u3
y(t) = θ(t − τ ) + v (18) ..
.
where w1 , w2 , v are process and measurement noises with =F (I − K3′ H) F (I − K2′ H) F [x̂1− + K1 (y1 − H x̂1− )]
gaussian probability density function. By considering state + F (I − K3′ H) F (I − K2′ H) G u1
variables as[x1 , x2 ] = [θ, b], the above equations can be written
in the linear state-space form: + F (I − K3′ H) F K2′ y2
+ F (I − K3′ H) G u2 + F K3′ y3
ẋ(t) = A x(t) + B u(t) + w (19)
+ G u3 (26)
y(t) = C x(t − τ ) + v (20)
By repeating the above procedure for the case with delay in
where u = ωgyro , y = θtilt and: the measurement, we obtain:
[ ] [ ]
0 1 1 [ ]
A= , B= , C= 1 0 (21) x̂4− = F (I − K3 H) F (I − K2 H) F [x̂1− ]
0 0 0
+ F (I − K3 H) F (I − K2 H) G u1
To use discrete version of Kalman filter, we need to discretize + F (I − K3 H) F K2 y2
Eqs. (19-20). If we consider discrete time state-space model as
Eqs. (3-4), then the relationship between the continuous and + F (I − K3 H) G u2 + F K3 y3
discrete matrix is as follows [27]: + G u3 (27)
( ∫ Ts ) There are two differences between these two cases: 1) In
ATs
F =e , G= eAτ dτ B, H = C (22)
0
the second case, we do not have y1 in the 1st sample for

1530−437X (c) 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See
http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/JSEN.2014.2366874, IEEE Sensors Journal
GHANBARI AND YAZDANPANAH: DELAY COMPENSATION OF TILT SENSORS BASED ON MEMS ACCELEROMETER USING DATA FUSION TECHNIQUE 5

incorporation, as can be seen in Eq. (27), 2) Because of


the lack of this measurement, update of error covariance
matrix and Kalman gain are not equal in these two cases,
the difference is shown with prime sign in Eq. (26).
The difference between Eq. (26) and Eq. (27) is the amount
which should be added to the estimation in the second case
until it becomes equal to estimation in the first case. The
difference is as below:
δ x̂4− = x̂′4− − x̂4−
= F (I − K3′ H)F (I − K2′ H)F K1 (y1 − H x̂1− ) Fig. 6. Proposed measurement covariance to meet the requirement assump-
[ tion of the modified Kalman filter
+ F (I − K3′ H)F (I − K2′ H)
]
− (I − K3 H)F (I − K2 H) (F x̂1− ) determines the amount of measurement contribution in the
[ estimation at update times. Also, by considering this waveform
+ F (I − K3′ H)F (I − K2′ H) for measurement covariance, Eq. (32) becomes simpler as
]
below:
−(I − K3 H)F (I − K2 H) (Gu1 )
[ ] Mk = F N −1 (33)
+ F (I − K3′ H)F K2′ − (I − K3 H)F K2 y2 which is much easier for implementation in practice compared
[ ]
+ F (I − K3′ H) − (I − K3 H) Gu2 to Eq. (32).
[ ] The concept of Fig. 6 in our sensory system in the esti-
+ F K3′ − K3 y3 (28) mation of the angle is that between update times, where the
Kalman gain is set to zero, it estimates angle from prediction
In other words, when the measurement arrives, Eq. (28) is the step in Fig. 5 (approximately from integral of gyroscope’s
correction term which should be added to the estimation (Eq. output) and at the update time incorporates data of the tilt
(27)), to compensate the effect of delay. As can be predicted sensor according to Eqs. (30-32).
from Eq. (28), the terms of correction term become very large
over time, which makes it impossible to be implemented. To V. FILTER DESIGN FOR INCREASING BANDWIDTH
solve this problem, as [23] has suggested, if we know exactly
the measurement covariance matrix (Rk ), to put Ki′ = Ki , As mentioned before, the tilt sensor encounters some dif-
then all terms in Eq. (28) will be removed except the first ficulties such as delay and low bandwidth. In the previous
one. As a result, Eq. (28) becomes as simple as follows: section, we solved the problem of delay by using a modified
Kalman filter. However, this filter cannot increase the band-
δ x̂4− = F (I − K3′ H)F (I − K2′ H)F K1 (y1 − H x̂1− ) (29) width of the tilt sensor, because if we have high frequency
movement, then data of the tilt sensor will be unreliable.
By extending this method to the general form, estimation
Consequently, this results in degradation of the efficiency of
and correction terms to compensate the delay become as
the Kalman filter. In this section, a filter is designed to increase
follows:
the bandwidth of the tilt measurement before contributing
x̂k+ = x̂k− + δ x̂k− (30) in the modified Kalman filter. The filter which we use is a
( ) complementary filter.
δ x̂k− = Mk F Kk−N yk − H x̂(k−N )− (31)
−1
The filter which combines data sources by adding filtered

N
[ ] valued, where sum of the filters in the frequency domain is

Mk = F (I − Kk−i H) (32)
i=1
unity, is called a complementary filter. As previously men-
tioned in Section III, tilt sensor because of their low bandwidth
As mentioned before, assumption of [23] to reach Eqs. (30- has unreliable high frequency behavior. Moreover in gyro-
32) was to know the measurement covariance matrix exactly, scope, because of its drift problem, high frequency behavior
but it is not achievable in many practical applications. Our is much more accurate compared to its low frequency. So,
sensory system belongs to this category. Our modification these two sensors have complementary frequency information,
to solve this problem is to consider measurement covariance therefore, we can use complementary filter idea to combine
as a waveform which is shown in Fig. 6. Where T is the data of these two sensors to achieve accurate angle in a wide
duration of the measurement delay. Fig. 6 means that at the range of frequency.
measurement update times, we should set the measurement As it is predictable from frequency characteristics of these
covariance equivalent to A1 and between these update times two sensors, the type of the filter which must be located
set it to A2 . Now, if A2 → ∞ based on Kalman gain equation after tilt sensor and integral of gyroscope (angle from gyro)
(Eq. (7)), we have Kk → 0, which means that between these in complementary filter are low pass and high pass filters,
update times Kalman gain is equal to zero. As a result, the respectively. Due to delay of the tilt sensor, time information of
condition for removing the extra terms in the correction term tilt sensor and gyroscope is not synchronous, so a delay, equal
(namely Ki′ = Ki ) is held. A1 is the tuning parameter which to the size of tilt sensor delay, was considered for the data of

1530−437X (c) 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See
http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/JSEN.2014.2366874, IEEE Sensors Journal
6 IEEE SENSORS JOURNAL

Fig. 7. Block diagram of the complementary filter


Fig. 9. Proposed sensor fusion including complementary filter and modified
Kalman filter

Fig. 8. Frequency characteristic of the tilt sensor

gyroscope. The block diagram of the complementary filter for


mentioned sensory system is shown in Fig. 7. In the design
of the complementary filter, a trade-off between the required Fig. 10. Schematic of the test system
accuracy and simplicity of the filters must be considered. In
our sensory system, a first order filter meets our requirements.
Complementary filter design procedure is as follows: sensor fusion method to achieve higher frequency range in the
tilt measurement, a gyroscope with a higher bandwidth and
s+β s β higher maximum measurable rate must be used. The overall
θ= θ= θ+ θ = H1 θ + H2 θ (34)
s+β s+β s+β proposed sensor fusion is shown in Fig. 9 which consists of
where H1 and H2 are the filters placed after the angle a pre-filter and a post-filter. The pre-filter is a complementary
measured from the gyroscope and tilt sensor, respectively. filter which, by combining the data of the tilt sensor and
Based on frequency characteristics of sensors, the type of the gyroscope, increases the bandwidth of the measured angle to
filter which must be located after the tilt sensor and integral provide high bandwidth estimation of the angle but with a
of gyroscope are expected to be low pass and high pass filters, delay for the post-filter. The post-filter is a modified Kalman
respectively. Then: filter whose task is to compensate the delay of the estimated
angle. As a result, by these two filters, we have a no-delay
s β and high bandwidth estimation of the angle.
θf ilter = θgyro + θtilt (35)
s+β s+β
where β is the tuning parameter and determine the cutoff VI. EXPERIMENTAL RESULTS
frequency of these filters. Based on the low pass filter which is In this section, experimental results are presented to demon-
placed after the tilt sensor, one way to choose the parameter β strate the reliability and effectiveness of the proposed sensor
is to put it near the cutoff frequency of the tilt sensor. Based fusion. The schematic of test system is given in Fig. 10.
on frequency characteristic, shown in Fig. 8, it can be seen The test system includes a test apparatus, microcontroller
that the acceptable frequency of operation of the tilt sensor is board, USB to serial module and a personal computer (PC).
near 1rad/sec. Therefore, by choosing β = 1, we can ensure Test apparatus included tilt sensor, encoder and gyroscope.
from correctness of the filtered tilt information after tilt sensor. Data of these sensors were sent to the microcontroller board.
The one possible limitation of the correct tilt measurement The microcontroller (LPC2138) is based on 32-bit ARM7
in the high frequency is due to the frequency characteristic CPU from NXP Company (PHILIPS®). The communication
of the gyroscope. The cutoff frequency of the gyroscope is protocol between tilt sensor and microcontroller is I2 C. The
equal to 16Hz. Another reason to prevent us to achieve microcontroller reads the data of gyroscope from its 10-bit
higher frequency in addition to bandwidth of the gyroscope, ADC (analog to digital converter) and demodulates data of
is maximum measurable angular rate of the gyroscope. For the encoder by using its Timer/Counter peripheral. The three
the used gyroscope, this maximum rate is ±75 ◦ /sec, which main tasks of the microcontroller are: 1) reading data of
means that if the sensor is moving faster than that, its output sensors; 2) filtering data of tilt sensor and gyroscope by the
is saturated and becomes unreliable for tilt estimation. Based proposed sensor fusion algorithm; 3) sending the filtered and
on conducted experiments, the maximum frequency which we unfiltered data to the PC. To investigate the effectiveness of
could achieve was around 6 Hz. Therefore, by the proposed the proposed sensor fusion, we conducted two experiments on

1530−437X (c) 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See
http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/JSEN.2014.2366874, IEEE Sensors Journal
GHANBARI AND YAZDANPANAH: DELAY COMPENSATION OF TILT SENSORS BASED ON MEMS ACCELEROMETER USING DATA FUSION TECHNIQUE 7

80
80 Signal of Tilt Sensor Signal of Tilt Sensor
Integration of Gyroscope Signal Integration of Gyroscope Signal
60
Signal of Encoder Signal of Encoder
60 Estimated Angle by the Proposed Sensor Fusion Estimated Angle by the Proposed Sensor Fusion
40
40
Angle (deg)

Angle (deg)
20
20
0
0
−20
−20
−40
−40
−60
0 0.5 1 1.5 2 0 1 2 3 4 5
Time (sec) Time (sec)

Fig. 11. Angle measured by the encoder, tilt sensor and gyroscope, and Fig. 12. Angle measured by the encoder, tilt sensor and gyroscope, and
estimation angle in one direction test estimated angle in swinging mode test

TABLE II TABLE III


QUANTITATIVE SPECIFICATIONS OF THE TILT ERROR IN ONE DIRECTION QUANTITATIVE SPECIFICATIONS OF THE TILT ERROR IN SWINGING MODE
TEST TEST

RMS of the tilt error maximal tilt error RMS of the tilt error maximal tilt error
before applying before applying
5.51◦ 10◦ 12.25◦ 15◦
the proposed method the proposed method
after applying after applying
1.1◦ 0.9◦ 1.3◦ 0.6◦
the proposed method the proposed method

the test apparatus which consist of low frequency and higher the proposed method”, we mean the error existing in the tilt
frequency movement. sensor signal. The effectiveness of the proposed method is
investigated based on RMS (Root Mean Square) and maximum
A. Low Frequency Test of error criterions. As can be seen from these tables, the
proposed sensor fusion reduces the error of tilt measurement
In this subsection, the proposed sensor fusion algorithm is
with a high ratio.
investigated in order to compensate delay. We test a slow mo-
tion on the pendulum of the experimental setup. Then with the
proposed sensor fusion, implemented on the microcontroller, VII. CONCLUSION
data filtering of the tilt sensor and gyroscope is done. Two In this paper, a new method for combining data from the
experiments have been done on the test apparatus. One in tilt sensor and gyroscope to produce an accurate angle in
single direction and the other in a swinging mode. The data the presence of the difficulties such as the delay and low
of the tilt sensor, encoder, gyroscope and estimated angle by bandwidth of the tilt sensor was presented. First, we modeled
the proposed sensor fusion are shown in Figs. 11, 12. As seen our sensory system as a linear time invariant state space
in this figure, angle measured from gyroscope (by integration) system. A modified Kalman filter algorithm was proposed to
has a drift and in the high frequency motions, the accuracy of compensate for the delay of the tilt sensor. To overcome the
the tilt sensor is decreased. As it can be seen from Figs. 11, problem of bandwidth in the tilt sensor, a complementary filter
12, the proposed sensor fusion is able to compensate the delay was designed. As verified in the experiments, the proposed
appropriately and can estimate the angle with a high accuracy. sensor fusion is able to reduce the maximum error of the
tilt measurement from 10◦ to 0.9◦ and 15◦ to 0.6◦ in low-
B. Higher Frequency Test frequency tests, and from 18◦ to 0.8◦ in higher frequency.
Also, it was shown that the bandwidth of the tilt measurement
In the next experimental test, the effectiveness of the pro-
can be enhanced from 0.16 Hz (bandwidth of the tilt sensor)
posed sensor fusion in order to increase bandwidth of the
to 6 Hz. Since the complementary filter uses the data of
output of the tilt sensor is investigated. For this purpose,
the gyroscope in the range of high frequency, the bandwidth
the fast motion on the pendulum of the experimental setup
of the tilt measurement is limited by the cutoff frequency
is performed. The data of the tilt sensor, encoder, gyroscope
and also maximum measurable angular rate of the gyroscope.
and estimated angle by the proposed sensor fusion are shown
Therefore, by the proposed sensor fusion method to achieve
in Figs. 13. As seen in this figure, angle measured from
higher frequency range in the tilt measurement, a gyroscope
gyroscope (by integration) has a drift and in the high frequency
with a higher bandwidth and higher maximum measurable rate
motions, the accuracy of the tilt sensor is decreased. In the
must be used.
meantime, the angle estimated by the proposed sensor fusion
has a proper accuracy in the higher frequency region. In order
to investigate the quantitative specifications of the tilt error ACKNOWLEDGMENT
before and after applying the proposed sensor fusion, tables The authors would like to thank the anonymous reviewer
II, III and IV may be considered. By the error “before applying for his/her valuable comments and suggestions that improved

1530−437X (c) 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See
http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/JSEN.2014.2366874, IEEE Sensors Journal
8 IEEE SENSORS JOURNAL

20 [14] S. O. H. Madgwick, “An efficient orientation filter for inertial and


10
inertial/magnetic sensor arrays,” Tech. Rep., April 2010.
[15] P. He, P. Cardou, A. Desbiens, and E. Gagnon, “Estimating the orienta-
0 tion of a rigid body moving in space using inertial sensors,” Multibody
−10
Syst Dyn, July 2014.
Angle (deg)

[16] Y. Liu, N. Noguchi, and K. Ishii, “Development of a low-cost imu by


−20 using sensor fusion for attitude angle estimation,” in Proc. IEEE IFAC,
−30
2014, pp. 4435–4440.
Signal of Tilt Sensor
[17] A. Cavallo, A. Cirillo, P. Cirillo, G. D. Maria, P. Falco, C. Natale, and
−40 S. Pirozzi, “Experimental comparison of sensor fusion algorithms for
Integration of Gyroscope Signal

−50
Signal of Encoder attitude estimation,” in Proc. IEEE IFAC, 2014, pp. 7585–7591.
Estimated Angle by the Proposed Sensor Fusion
[18] I. Prayudi and D. Kim, “Design and implementation of imu-based human
−60 arm motion capture system,” in Proc. IEEE ICMA, 2012, pp. 670–675.
0 0.5 1 1.5 2 2.5 3
Time (sec) [19] S. Chen, C. Ding, Y. Han, and Y. Chen, “Study on information fusion
algorithm for the miniature ahrs,” in Proc. IEEE IHMSC, 2012, pp.
Fig. 13. Angle measured by the encoder, tilt sensor, gyroscope and estimated 114–117.
angle (higher frequency test) [20] B. Strah and S. Rinderknecht, “High dynamics tilt estimation using
simple observer,” in Proc. IEEE EUROCON, 2013, pp. 1964–1971.
TABLE IV [21] A. Tayebi, S. Mcgilvary, A. Roberts, and M. Moallem, “Attitude
QUANTITATIVE SPECIFICATIONS OF THE TILT ERROR IN HIGHER estimation and stabilization of a rigid body using low-cost sensors,”
FREQUENCY TEST in 46th Proc. IEEE CDC, New Orleans, USA, 2007.
[22] H. Rehbinder and X. Hu, “Nonlinear state estimation for rigid-body
motion with low-pass sensors,” SYST CONTROL LETT, vol. 40, pp.
RMS of the tilt error maximal tilt error
183–190, jan 2000.
before applying
6.92◦ 18◦ [23] H. L. Alexander, “State estimation for distributed systems with sensing
the proposed method delay,” in Proc. IEEE SPIE. Data Structures and Target Classification,
after applying
0.68◦ 0.8◦ 1991.
the proposed method
[24] (2013) Devantech CMPS10 Tilt sensor datasheet. [Online]. Avail-
able:http://www.pishrobot.com/files/products/datasheets/cmps10.pdf.
[25] (2013) Sparkfun Electronics MLX90609 gyroscope datasheet. [Online].
Available:https://www.sparkfun.com/datasheets/Sensors/MLX90609
the quality of this paper as well as members of Advanced datasheet.pdf.
Control Systems Lab of the University of Tehran for the [26] H. Sun, J. F, X. Yuan, and W. Tang, “Analysis of the kalman filter with
fruitful discussion on the subject. different ins error models for gps/ins integration in aerial remote sensing
applications,” ISPRS journal of Photogrammetry and Remote Sensing,
vol. 7, pp. 883–890, 2008.
R EFERENCES [27] D. Simon, Optimal State Estimation. Hoboken, New Jersey: John Wiley
& Sons, 2006.
[1] L. Vermeiren, A. Dequidt, T. M. Guerra, H. R. Tirmant, and M. Parent,
“Modeling, control and experimental verification on a two-wheeled
vehicle with free inclination: An urban transportation system,” Control.
Eng. Pract, vol. 19, pp. 744–756, 2011.
[2] S. C. Lin, C. C. Tsai, , and H. C. Huang, “Adaptive robust self-balancing
and steering of a two-wheeled human transportation vehicle,” J. Intell. Milad Ghanbari was born in Kermanshah, Iran,
Robot. Syst., vol. 62, pp. 103–123, 2011. in 1989. He received his B.Sc. degree in electrical
[3] H. Lee and S. Jung, “Balancing and navigation control of a mobile engineering from Shahed University, Tehran, Iran, in
inverted pendulum robot using sensor fusion of low cost sensors,” 2011, and M.Sc. degrees in control engineering from
Mechatronics, vol. 23, pp. 95–105, 2012. the University of Tehran, Tehran, Iran, in 2014 (with
[4] J. Leavitt, A. Sideris, and J. E. Bobrow, “High bandwidth tilt measure- high honors). His research interests include non-
ment using low-cost sensors,” IEEE/ASME Trans. Mechatronics, vol. 11, linear systems control, mechatronic, sensor fusion,
pp. 320–327, jun 2006. control of autonomous vehicles, real-time control
[5] U. X. Tan, K. C. Veluvolu, W. T. Latt, C. Y. Shee, C. N. Riviere, and and controller implementation.
W. T. Ang, “Estimation displacement of periodic motion with inertial
sensors,” IEEE Sensors J, vol. 8, pp. 1385–1388, aug 2008.
[6] J. Lim and D. Hong, “Cost reference particle filtering approach to high-
bandwidth tilt estimation,” IEEE Trans. Ind. Electron, vol. 57, pp. 3830–
3839, nov 2010.
[7] S. Jung, H. T. Cho, and T. C. Hsia, “Neural network control for position
tracking of a two-axis inverted pendulum system: Experimental studies,” M. J. Yazdanpanah received his B.Sc., M.Sc., and
IEEE Trans. Neural Netw, vol. 18, pp. 1042–1048, jul 2007. Ph.D. degrees all in Electrical Engineering from Isfa-
[8] J. H. M. Bergmann, S. A. Ivanova, I. Spulber, V. Gulati, P. Georgiou, han University of Technology, Isfahan, Iran in 1986,
and A. McGregor, “An attachable clothing sensor system for measuring University of Tehran, Tehran, Iran, in 1988, and
knee joint angles,” IEEE Sensors J, vol. 13, pp. 4090–4097, oct 2013. Concordia University, Montreal, Quebec, Canada in
[9] S. B. Lazarus, I. Ashokaraj, A. Tsourdos, R. Zbikowski, P. M. G. Silson, 1997, respectively. His Ph.D. thesis entitled “Control
N. Aouf, and B. A. White, “Vehicle localization using sensors data of flexible-link manipulators using nonlinear H∞
fusion via integration of covariance intersection and interval analysis,” techniques” was ranked outstanding. From 1986 to
IEEE Sensors J, vol. 7, pp. 1302–1314, sep 2007. 1992, he worked with the Engineering Research
[10] S. Luczak, W. Oleksiuk, and M. Bodnicki, “Sensing tilt with MEMS Center, Tehran, Iran, as an R&D engineer and cul-
accelerometers,” IEEE Sensors J, vol. 6, pp. 1669–1675, dec 2006. minating as the chairman of the System Design
[11] N. G. M. Thao, D. H. Nghia, and N. H. Phuc, “A pid backstepping Division. In 1998, he joined the School of Electrical and Computer Engi-
controller for two-wheeled self-balancing robot,” in Proc. IEEE IFOST, neering, University of Tehran, Tehran, Iran, where he is now a Professor,
2010, pp. 76–81. director of the Control & Intelligent Processing Center of Excellence (CIPCE)
[12] G. Y. Morales, S. A. Plazas, and L. F. Combita, “Implementation and and director of the Advanced Control Systems Laboratory (ACSL). Dr.
closed loop identification of a two wheeled inverted pendulum mobile Yazdanpanah’s research interests are in the areas of analysis and design of
robot,” in Proc. IEEE SBR-LARS, 2012, pp. 97–102. nonlinear/optimal/adaptive control systems, robotics, control on networks, and
[13] (2013) Rion-Tech HCA528T Tilt sensor datasheet. [Online]. Available: theoretical and practical aspects of neural networks.
http://www.rion-tech.us/newen/showproduct.asp?ID=60.

1530−437X (c) 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See
http://www.ieee.org/publications_standards/publications/rights/index.html for more information.

You might also like