Next Article in Journal
A Novel Offset and Finite-Gain Compensated Switched-Capacitor Amplifier with Input Correlated Level Shifting
Next Article in Special Issue
Design and Power Management of a Secured Wireless Sensor System for Salton Sea Environmental Monitoring
Previous Article in Journal
Correction: Qiao, D. et al. M3C: Multimodel-and-Multicue-Based Tracking by Detection of Surrounding Vessels in Maritime Environment for USV. Electronics 2019, 8, 723
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Estimation of Displacement for Internet of Things Applications with Kalman Filter

by
Renato Ferrero
*,†,
Filippo Gandino
and
Masoud Hemmatpour
Dipartimento di Automatica e Informatica, Politecnico di Torino, 10129 Torino TO, Italy
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Electronics 2019, 8(9), 985; https://doi.org/10.3390/electronics8090985
Submission received: 7 August 2019 / Revised: 22 August 2019 / Accepted: 23 August 2019 / Published: 4 September 2019
(This article belongs to the Special Issue Embedded Devices in IoT)

Abstract

:
In the vision of the Internet of Things, an object embedded in the physical world is recognizable and becomes smart by communicating data about itself and by accessing aggregate information from other devices. One of the most useful types of information for interactions among objects regards their movement. Mobile devices can infer their position by exploiting an embedded accelerometer. However, the double integration of the acceleration may not guarantee a reliable estimation of the displacement of the device (i.e., the difference in the new location). In fact, noise and measurement errors dramatically affect the assessment. This paper investigates the benefits and drawbacks of the use of the Kalman filter as a correction technique to achieve more precise estimation of displacement. The approach is evaluated with two accelerometers embedded in commercial devices: A smartphone and a sensor platform. The results show that the technique based on the Kalman filter dramatically reduces the percentage error, in comparison to the assessment made by double integration of the acceleration data; in particular, the precision is improved by up to 72%. At the same time, the computational overhead due to the Kalman filter can be assumed to be negligible in almost all application scenarios.

1. Introduction

The aim of the Internet of Things is to trace a map of the real world, giving an electronic identity to physical objects and places [1]. This enables the inter-connectivity of devices: The objects gain new and powerful capabilities by sharing data with each other. In this scenario, the position of the connected objects is often an essential piece of information for effective representation of the real world. Without a central co-ordinator, every device should autonomously trace its own movements. A low-cost and accessible method relies on the use of an embedded accelerometer.
An accelerometer measures the proper acceleration of an object [2]. The proper acceleration is relative to an inertial stationary observer; for example, the gravity acting upon the inertial observer is not considered in the proper acceleration. For this reason, an accelerometer in free-fall will measure zero, whereas an accelerometer at rest will measure an acceleration of 1 g due to the Earth’s gravity. Internally, the accelerometer can be considered as a damped mass on a spring. The deformation of the spring gives a measurement of the acceleration: In a resistive or capacitive accelerometer, the deformation is converted into a change of the impedance, whereas, in a piezo-electric accelerometer, it is expressed as an electrical signal.
The motion and displacement (i.e., change of position) of an object can be analyzed by measuring its acceleration. In fact, the acceleration can reveal the intensity and the frequency of the movement, as it is proportional to the external force applied to the object [3]. Basically, integration (with respect to time) of the values provided by the accelerometer gives information about the speed and displacement of the object. In addition, information about inclination can be retrieved, such as the orientation and tilt of an object rotating on a reference plane [4]. Furthermore, wearable devices commonly exploit accelerometers to evaluate human actions in vehicle control [5], clinical and lab environments [6], and in a free-living context [7]. The first example of using an accelerometer to analyze human motion was presented in the 1950s [8]. This trend was accelerated by technological improvements in the 1970s [9]; thanks to micro-electro-mechanical systems (MEMS), sensor performance was notably increased while both cost overhead and power requirements were significantly reduced. In 1979, the first MEMS accelerometers were batch-fabricated [10] and commonly integrated into wearable objects for the analysis of human activity and movements, both for research and commercial purposes [7,11]. The size and cost of accelerometers have continued to decrease, due to further advances in integrated MEMS, without compromising quality and reliability standards [12].
This paper investigates movement tracking by means of a single accelerometer. In particular, the goal is computation of the displacement based on the data collected by a three-axis linear accelerometer. Typically, the displacement is estimated by a double integration of the acceleration data. First, the speed is computed by integrating the acceleration, following which the displacement is retrieved by integrating the speed. However, measurements are affected by errors and noise, which dramatically reduces the precision of the results. This paper analyzes a countermeasure for this issue, based on the Kalman filter [13,14]. The Kalman filter is commonly exploited in dynamic systems, in order to make estimations based on uncertain information. This paper extends a preliminary analysis [15] by comparing the performance of two different accelerometers and by evaluating the overhead introduced by the Kalman filter. The main goal of this paper is to evaluate the benefits of the application of the Kalman filter. Different experiments were made, studying movements with one, two, and three degrees of freedom. The collected statistics reveal that the technique based on the Kalman filter produces more accurate results, with a reduction of the estimation error ranging between 18–72%. Moreover, although the Kalman filter requires additional computation time with respect to the integration of the acceleration values, the overhead can be assumed to be negligible.
The remainder of the paper is organized as follows. The related works for estimating a displacement according to the values produced by an accelerometer are reviewed in Section 2. The Kalman filter and the approach to exploit it for estimating the displacement are described in Section 3. Section 4 describes the methodology followed to evaluate the accuracy of the developed approach. The experimental analysis is provided in Section 5. Section 6 investigates the overhead due to the proposed approach. Finally, some conclusions are drawn in Section 7.

2. Related Work

A common approach for retrieving position information is by integration of the signal acquired from an accelerometer [16]. However, this method is reliable only without strict requirements about the result precision, as the input data usually contain noise and measurement errors that need to be properly managed. The correction techniques proposed in the literature are targeted to the specific application scenario.
Human movement can be tracked by means of inertial and magnetic sensors on body parts, such as limbs and feet [17]. Cyclic phases can be frequently detected in various kinds of human actions, such as walking, running, and side-steping. For instance, walking is composed of an alternation of stance and swing phases. In some periodic moments, the instantaneous value of the speed may be zero (e.g., between the stance and the swing phases, when both feet touch the ground). Recognizing these events may increase the accuracy of the results. In these cases, if the result of integration of the acceleration is not null, as expected, the error of the drift in the measurements can help to correct the accelerometer results, by providing consistent speed data. Consequently, better data on human movement can be provided; for example, the average error measured by tests on indoor walking has been recorded to be 5.5% [17].
In automotive engineering, displacement is commonly estimated by means of inertial-based measurement techniques [18]. In fact, due to their small dimensions, accelerometers can be used in a vehicle. Furthermore, information about the structural integrity of the vehicle can be obtained by studying the accelerometer data: For an elastic structure, the stress responsible for structural damage is proportional to the displacement. Finally, vibrations can be properly detected by the wide frequency and dynamic range of acceleration. Three digital filtering approaches have been designed to reduce the integration errors in low-frequency random acceleration data related to on-road vibration patterns and vehicle movements. Filtering approaches exploit the response of the finite and the infinite impulses with the inverse of the fast Fourier transform [18]. With their adoption, the standard error in the displacement estimation has been shown to range from 5.7% at 20 Hz to 21.5% at 150 Hz [18].
An off-line analysis of the displacement which uses the acceleration measurements has been provided for damage detection in structural health monitoring [19]. A variation of the Kalman filter has been applied to limit the increase in noise due to the integration of the acceleration values. In particular, the condition at a specific point is estimated off-line by knowing the entire sequence of measurements. Kalman filter smoothing is introduced by analyzing a Kalman filter applied to all the samples, backward and forward. A multi-rate Kalman filter should be applied, due to the different sampling frequencies used in civil engineering applications. The displacement error is affected by the acceleration values (e.g., considering a swept-sine signal, the root mean square error is equal to 2.5% [19]).
An alternative approach to computing the displacement is realized through conversion of the acceleration values to the frequency domain [20,21]. Given a discrete series of acceleration samples { a 1 , a 2 , , a k , , a N } , the discrete Fourier transform is applied for the conversion. The discrete Fourier transform A k of an acceleration sample a k is:
A k = k = 0 N - 1 a k e - i 2 π N k r ,
with i corresponding to the imaginary unit. The discrete Fourier transform D k of the kth displacement is immediate, due to the property of the Fourier transform of the integrals:
D k = - 1 ( 2 π k ) 2 A k .
It is possible to take the inverse Fourier transform of the coefficients of (2) in order to obtain the discrete series of the displacement:
d r = k = 0 N - 1 D k e i 2 π N k r .
The scale factor of the error involved in (3) is - 1 / ( 2 π k ) 2 . Consequently, when the frequency is doubled, the displacement is reduced by 6 dB. Thus, the components of the dominant signal may be lower than those at low-frequency noise during conversion. Low-frequency components should be zero padded, in order to be attenuated, with the exception of the significant sinusoidal components within the Fourier transform of the acceleration signal [20]. A better technique has been proposed, based on the significant frequency components of the Fourier transform of acceleration values before applying inverse-Fourier transform [21]. A curve-fitting correction on the local maximum points of the discrete Fourier transform can be applied to execute this operation. Curve-fitting corresponds to the finding which coefficients of a function better match a series of points.
Not only the error in the integration of the acceleration values, but also the drift and other noise effects, as well as double integration of thermal noise, affect the estimation of the displacement [22,23]. This effect can be checked with a fixed accelerometer: A long integration time increases the root mean square value, which is even affected by the sampling frequency. Initial calibration of an accelerometer can exploit the theoretical model of the described error, taking into account both analytical [22] and numerical [23] integration.

3. Theoretical Approach

The speed of an object at time T can be obtained by integrating the acceleration over time, if its initial speed is zero. The speed can be computed as a summation of samples at discrete instants t s :
v ( T ) = 0 T a ( t ) d t = lim n T n s = 1 n a ( t s ) .
The end of (4) reveals that the speed corresponds to the sum of the area below the acceleration curve in the Cartesian plane. Algorithm 1 follows this approach to estimate the speed of an object. The input is the acceleration along an axis, obtained by querying the accelerometer with the acceleration.getx() pseudo-command, and the output is the value of the speed along the same axis. Algorithm 1 is repeated as many times as the degrees of freedom of the movement; for example, the speed of an object moving in three-dimensional space is obtained by three iterations of the algorithm. The variables s p e e d _ i n i t i a l , s p e e d _ n e w , and  t i m e all start at zero. Spurious data produced by the accelerometer are discarded after comparison with admissible values. The threshold for determining an acceptable value is different for all the axes and is related to the values of acceleration; for example, the threshold applied to z-axis is greater than that applied to the other axes, as it also includes the gravitational force.
Algorithm 1 Computation of speed along the x-axis.
 1:
s p e e d _ i n i t i a l x = s p e e d _ n e w x
 2:
t i m e = t i m e + Δ t
 3:
a c c x = acceleration.getx()
 4:
if a c c x < t h r e s h o l d _ l o w then
 5:
    a c c x = t h r e s h o l d _ l o w
 6:
end if
 7:
if a c c x > t h r e s h o l d _ h i g h then
 8:
    a c c x = t h r e s h o l d _ h i g h
 9:
end if
10:
s p e e d _ n e w x = s p e e d _ i n i t i a l x + a c c x · Δ t
By definition, speed is the distance covered per unit of time. Algorithm 2 approximates the integral of the speed by a summation:
d ( T ) = 0 T v ( t ) d t = lim n T n s = 1 n v ( t s ) .
A significant difference between the value computed in (5) and the real displacement can occur, due to noise and measurement errors. This gap can be limited by means of a Kalman filter [13], which statistically minimizes the estimation error. The acquisition of a new measurement does not require that any previous data are processed again. During the data-processing flow of the algorithm, input data (i.e., discrete-time measurement samples) are first acquired, then they are processed, and finally new output data are produced.
Algorithm 2 Computation of displacement along the x-axis.
1:
x _ i n i t i a l = x _ n e w
2:
call Algorithm 1
3:
d x = ( s p e e d _ i n i t i a l x + s p e e d _ n e w x ) / 2 · Δ t
4:
x _ n e w = x _ i n i t i a l + d x
The Kalman filter evaluates the system model, row data, and data uncertainty [14]. The system model can be described by a linear stochastic difference equation
x k = A x k - 1 + B u k + w k ,
where x k I R n represents the state of the system at time k, A is an n × n matrix that indicates how the system evolves to the next step without any process noise, u k I R l is the optional control input, B is an n × l matrix that represents the control-input model applied to u k , and  w k is the process noise. At the instant k, a measurement z k I R m of the true state x k is made, according to
z k = H x k + v k ,
where H is an m × n matrix that links the true state x k to the observed state z k ; v k is the measurement noise, which is considered to be white and Gaussian (i.e., not correlated in time and with probability density equal to the normal distribution); and Q and R are the matrices of covariance of the process and measurement noise. In a covariance matrix, the element (i, j) corresponds to the covariance between the ith and jth elements of the source vector. In other words, a covariance matrix reports the covariance between any two elements of the vectors.
The a priori state estimate at time k is defined as the estimation obtained by relying only the process before time k. It is indicated as x ^ k | k - 1 I R n . On the contrary, the a posteriori state estimate at time k exploits also the knowledge of the measurement z k to estimate the state. It is indicated as x ^ k | k I R n . The a priori and a posteriori estimate errors are
e k | k - 1 = x k - x ^ k | k - 1 e k | k = x k - x ^ k | k ,
and the a priori and a posteriori estimate error covariance matrices are:
P k | k - 1 = E [ e k | k - 1 · e k | k - 1 T ] P k | k = E [ e k | k · e k | k T ] .
The Kalman filter estimates the process with a feedback control. In the predict phase, the process at time k is estimated without knowledge of z k . Then, in the update phase the estimation is refined by including knowledge of z k . The a priori estimations of the state and the error covariance matrix are computed in the predict phase, as follows
x ^ k | k - 1 = A x ^ k - 1 | k - 1 + B u k P k | k - 1 = A P k - 1 | k - 1 A T + Q .
The feedback control is implemented in the update phase by the sum of the new measurement with the a priori estimate, in order to obtain a better a posteriori estimate:
x ^ k | k = x ^ k | k - 1 + K k ( z k - H x ^ k | k - 1 ) P k | k = ( I - K k H ) P k | k - 1 ,
where K, which is the Kalman gain, is a n × m matrix that minimizes the a posteriori error covariance:
K k = P k | k - 1 H T H P k | k - 1 H T + R .
Algorithm 3 shows an implementation of the Kalman filter for computation of the speed on the x-axis. Every iteration of the algorithm computes the a priori and a posteriori estimates of the speed at the current time. In particular, the a priori estimate of the speed is based on the a posteriori estimate from the previous iteration. In more detail, the a priori estimate is computed in the predict phase by multiplying the previous a posteriori estimate by a constant A, because there are no control inputs. In a similar way, the a priori estimate of the error covariance uses the a posteriori estimate of the error covariance from the previous iteration of the algorithm. The a priori estimate of the error covariance is applied in the update phase for the computation of the Kalman gain. The speed value used in this phase is the last value computed by Algorithm 1. Finally, the a posteriori estimate of the speed and error covariance are updated, as they are needed for the subsequent iteration.
Algorithm 3 Use of the Kalman filter to compute speed along the x-axis.
1:
p r i o r i _ s p e e d x = A · p o s t e r i o r i _ s p e e d x
2:
p r i o r i _ P x = A · p o s t e r i o r i _ P x · A T + Q
3:
z _ s p e e d x = s p e e d _ n e w x
4:
K = p r i o r i _ P x · H T / ( H · p r i o r i _ P x · H T + R )
5:
p o s t e r i o r i _ s p e e d x = p r i o r i _ s p e e d x + K · ( z _ s p e e d x - H · p r i o r i _ s p e e d x )
6:
p o s t e r i o r i _ P x = ( 1 - K · H ) · p r i o r i _ P x
Algorithm 4, which computes the displacement on the x-axis, is similar to Algorithm 3. Both algorithms are executed three times, in order to compute speed and displacement along each of the three axes.
Algorithm 4 Use of the Kalman filter to compute displacement along the x-axis.
1:
p r i o r i _ d x = A · p o s t e r i o r i _ d x
2:
p r i o r i _ P x = A · p o s t e r i o r i _ P x · A T + Q
3:
z _ x = x _ n e w
4:
K = p r i o r i _ P x · H T / ( H · p r i o r i _ P x · H T + R )
5:
p o s t e r i o r i _ d x = p r i o r i _ d x + K · ( z _ x - H · p r i o r i _ d x )
6:
p o s t e r i o r i _ P x = ( 1 - K · H ) · p r i o r i _ P x

4. Evaluation Scenario

The method developed in Section 3 for the computation of the displacement was evaluated with two accelerometers produced by ST Microelectronics: LIS344ALH [24] and LIS331DLH [25]. The IC interface of the accelerometers acquires information from the sensing element and provides an output signal. Suspended silicon structures inside the sensing element are able to move along the direction of the sensed acceleration. Therefore, when an acceleration is applied, the proof mass changes, which generates an imbalance in the capacitive circuit. A charge integration can measure the imbalance by applying a voltage pulse to the sense capacitor.
The LIS344ALH is the accelerometer available in the Waspmote, an Arduino-based wireless sensor platform commercialized by Libelium [26] and shown in Figure 1. It is a ultra compact, low-power, analog output three-axis linear accelerometer. The user can dynamically select the acceleration full scale, choosing between ±2 g and ±6 g. The maximum bandwidth of the measured acceleration is 1.8 kHz. The IC interface processes the signal acquired from the sensing element by means of a low-noise capacitive amplifier and three different sample and hold circuits. The analog signal provided by the IC interface is an offset voltage, which is ratiometric to the voltage supply V dd ; the offset increases or decreases linearly, according to the change of the voltage supply. Furthermore, the sensitivity, which indicates the gain of the sensor, is ratiometric to the voltage supply. The sensitivity is obtained by performing one measure and by repeating the same measurement when 1 g is applied to the sensor. This can be easily obtained by pointing the sensor towards the center of the Earth, and then repeating the measurement with the sensor rotated by 180 degrees, in order to add the gravitational force. The mean of the two output values provided by the sensor gives its sensitivity. With V dd = 3.3 V, the sensitivity of the LIS344ALH ranges between V dd /5 and V dd /15 V/g and its change, according to the temperature, is ± 0.01 % / C.
The LIS331DLH is the accelerometer embedded in the iPhone 4S smartphone. The LIS331DLH is a nano, low-power, digital output three-axis linear accelerometer, in which the three full scales of ±2 g, ±4 g, and ±8 g are available. The output data rate is between 0.5 Hz to 1 kHz. The technology of the sensing element is the same as the LIS344ALH accelerometer. The IC interface exploits a low-noise capacitive amplifier to generate an analog voltage, following which an analog-to-digital converter provides a discrete-time signal. The output data can be easily accessed by means of a I 2 C/SPI serial interface. The typical voltage supply is V dd = 2.5 V. The analog-to-digital converter uses a 12 bit representation; the sensitivity ranges between 0.9–4.3 m g/digit and its change, according to the temperature, is ± 0.01 % / C.
For the experiment with the LIS344ALH accelerometer, a program developed in C for Arduino was compiled and uploaded to the Waspmote. The program acquires data from the accelerometer and computes the displacement, according to two algorithms: The basic double integration of the input data and the application of the Kalman filter to the input data. A similar application was developed with the Swift programming language for iOS and uploaded onto the iPhone 4S, in order to repeat the experiment with the LIS331DLH accelerometer. Motion data were received from the device hardware and processed by means of the Core Motion framework.
In every experiment, the distance between an initial and a final point was first evaluated with a measuring tape. Then, both devices were moved along a straight path between the two points. The initial speed of each of the accelerometers was zero, and their speed was randomly changed during the movement. Three kinds of paths were considered, with one, two, and three degrees of freedom. In the first case, the x-axis of the accelerometer was aligned with the straight line followed by the device. In the second case, the device moved over a desk, which coincided with the xy-plane of the accelerometer. In the third case, the device freely moved in the space and the accelerometer recorded data along all three axes.
Three reference distances were considered in the experiments: 50, 70, and 100 cm. The devices covered every distance N = 3 times. Each estimation e i of the displacement d was recorded and the following statistics were computed:
  • The mean e gives a measure of central tendency:
    e ¯ = 1 N i = 1 N e i .
  • The range R indicates how widely spread the estimations are:
    R = e m a x - e m i n .
  • The uncertainty in a measurement Δ e suggests the precision of the estimations. If a lot of data are available, the uncertainty coincides with the standard deviation:
    Δ e = σ = i = 1 N ( e i - e ¯ ) 2 N .
    According to (15), the majority of the data lies in the range e ¯ ± Δ e . With a small number of data, the uncertainty can be computed as:
    Δ e = R 2 = e m a x - e m i n 2 .
    According to (16), the displacement ranges in the interval between e m a x and e m i n . As each experiment was repeated only three times, the uncertainty in a measurement was computed as in (16).
  • The uncertainty in the mean Δ e ¯ indicates how far the displacement is from the average value of the estimations:
    Δ e ¯ = Δ e N .
    Substituting (16) into (17), if few data are available, the uncertainty in the mean can be computed as:
    Δ e ¯ = R 2 N .
  • The mean absolute percentage error M A P E expresses the discrepancy between the displacement and the estimations:
    M A P E = 100 N i = 1 N d - e i d .
All statistics were computed both for the estimation based on integration of the acceleration data and for the estimation based on the Kalman filter. Finally, in order to quantify the benefits introduced by the Kalman filter, the percentage decrease of the MAPE was computed, as follows:
d e c r e a s e = 100 · M A P E a c c e l e r a t i o n i n t e g r a l - M A P E K a l m a n f i l t e r M A P E a c c e l e r a t i o n i n t e g r a l .

5. Experimental Results

Table 1 and Table 2 present the statistics of the experiment with one degree of freedom, when the acceleration data were recorded with the Waspmote and the smartphone, respectively. The estimation was usually higher than the real displacement: This can be noted by observing that the mean value of the estimation was always higher than the distance covered by the device. However, some instances of the experiment provided an output value lower than the real displacement. This can be easily detected by checking the range of the estimations. For example, the range of the values computed with a double integration of the data obtained from the Waspmote was always higher than the displacement; this means that the maximum estimation was higher than the displacement, but the minimum one was lower. On the contrary, a narrow range indicates that the single estimations were closer to the mean value. For example, this happened in the trials with 50 and 70 cm, both with the Waspmote and the smartphone. In these cases, all estimations were higher than the path covered, as their average value was higher, but not by too much, since their range was tight. A correction can be easily applied to reach a better estimation; for example, by applying a reductive factor to the mean value or by giving more weight to the minimum estimation. By comparing the mean absolute percentage errors, it can be noted that the use of the Kalman filter decreased the percentage error in the estimation at least by 50%. However, only the accelerometer of the Waspmote allowed for precise results, with an acceptable error.
Data concerning the movement with two degrees of freedom is listed in Table 3 and Table 4 for the Waspmote and the smartphone, respectively. Similarly to the previous set of trials, the average estimation was always higher than the real distance covered by the device. It can be noted that the average value obtained with a double integration of the acceleration data could not predict the displacement. In fact, even if the average value was decreased by the uncertainty in the mean, the result was still higher than the real displacement. By applying the Kalman filter, the uncertainty in the mean was lower; which means that the estimations were closer to each other. At the same time, the estimations based on the data collected with the accelerometer embedded in the Waspmote were closer to the real distance, so a satisfactory match can be obtained by correcting the average value with the uncertainty in the mean. The only exception, according to Table 3, occurs when the path covered was 70 cm. In contrast, relying on the mean and on its uncertainty was not enough if the Kalman filter was used with the data obtained from the smartphone. However, the use of the Kalman filter is always suggested, as it reduced the percentage error of the estimation in every case.
The data shown in Table 5 and Table 6, about the movement with three degrees of freedom with the Waspmote and smartphone, respectively, confirm the general trend of the previous experiments. Notably, the estimations were always higher than the measured displacement. However, the Kalman filter reduced the gap between the average value of the estimation and the displacement, both with the Waspmote and the smartphone. Similarly, the percentage error of the single estimation always decreased by applying the Kalman filter to the acceleration data. The accelerometer embedded in the smartphone provided results almost precise as those obtained from the accelerometer of the Waspmote, independently of the use of the Kalman filter.

6. Computation Time

The overhead introduced by the Kalman filter was quantified by running an extensive set of computing tasks. In detail, the data acquired from the accelerometer after a movement was processed 64,000 times repeatedly. The current time was recorded at the beginning and at the end of the loop. The time required to execute the loop was computed as the difference between the two moments, which is reported in Table 7. With the Waspmote, the estimation of the displacement by means of the Kalman filter required almost the double the time spent in simply integrating the acceleration data. With the smartphone, the time needed by the Kalman filter increased by almost 50%. However, it can be noted that the time spent for a single estimation was only a few microseconds and, so, the overhead due to the Kalman filter can be considered negligible in almost all the cases, even for time-critical applications.

7. Conclusions

The estimation of displacement based on two-fold integration of data acquired from an accelerometer is impractical, in most cases. In fact, the estimation tends to be much higher than the real case, and the percentage error between the two values can be notable. A significantly better estimation of the displacement can be obtained by exploiting a Kalman filter for data processing. By running a set of experiments with two different commercial accelerometers, it was observed that the average value of the estimations came closer to the real displacement, along with a lower uncertainty in the measure. The percentage error made in the estimations dropped by up to 72%. This technique, based on the Kalman filter, has thus been shown to be beneficial and can be always suggested, with respect to the integration of acceleration data, as the overhead introduced is not significant. As a future work, the Kalman filter will be tested in combination with other algorithms.

Author Contributions

Conceptualization, R.F.; methodology, R.F.; software, M.H.; validation, M.H.; formal analysis, R.F.; investigation, M.H.; data curation, M.H.; Writing—Original Draft preparation, R.F.; Writing—Review and Editing, F.G.; visualization, M.H.; supervision, F.G.; project administration, F.G.; funding acquisition, F.G.

Funding

This work has been partially supported by the grant “Internet Data Environmental Monitoring”, funded by Regione Piemonte, call for “Progetti di ricerca industriale e/o sviluppo di applicazioni integrate e innovative in ambito internet of data”.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Jiang, Y.; Zhang, L.; Wang, L. Wireless sensor networks and the Internet of Things. Int. J. Distrib. Sens. Netw. 2013, 2013. [Google Scholar] [CrossRef]
  2. Shieh, J.; Huber, J.E.; Fleck, N.A.; Ashby, M.F. The selection of sensors. Prog. Mater. Sci. 2001, 46, 461–504. [Google Scholar] [CrossRef]
  3. Chen, K.Y.; Bassett, D.R.J. The technology of accelerometry-based activity monitors: Current and future. Med. Sci. Sports Exerc. 2005, 37, 490–500. [Google Scholar] [CrossRef] [PubMed]
  4. Pedley, M. Tilt sensing using a three-axis accelerometer. Free Semicond. Appl. Note 2013, 1, 2012–2013. [Google Scholar]
  5. Li, X.; Xu, Q.; Li, B.; Song, X. A Highly Reliable and Cost-Efficient Multi-Sensor System for Land Vehicle Positioning. Sensors 2016, 16, 755. [Google Scholar] [CrossRef] [PubMed]
  6. Mathie, M.J.; Coster, A.C.F.; Lovell, N.H.; Celler, B.G. Accelerometry: Providing an integrated, practical method for long-term, ambulatory monitoring of human movement. Physiol. Meas. 2004, 25, R1. [Google Scholar] [CrossRef] [PubMed]
  7. Yang, C.C.; Hsu, Y.L. A review of accelerometry-based wearable motion detectors for physical activity monitoring. Sensors 2010, 10, 7772–7788. [Google Scholar] [CrossRef] [PubMed]
  8. Saunders, J.B.; Inman, V.T.; Eberhart, H.D. The major determinants in normal and pathological gait. J. Bone Jt. Surg. 1953, 35, 543–558. [Google Scholar] [CrossRef]
  9. Morris, J.R.W. Accelerometry—A technique for the measurement of human body movements. J. Biomech. 1973, 6, 729–736. [Google Scholar] [CrossRef]
  10. Roylance, L.M.; Angell, J.B. A batch-fabricated silicon accelerometer. Trans. Electron Devices 1979, 26, 1911–1917. [Google Scholar] [CrossRef]
  11. Szydło, T.; Konieczny, M. Mobile and wearable devices in an open and universal system for remote patient monitoring. Microprocess. Microsyst. 2016, 46, 44–54. [Google Scholar] [CrossRef]
  12. Culhane, K.; O’connor, M.; Lyons, D.; Lyons, G. Accelerometers in rehabilitation medicine for older adults. Age Ageing 2005, 34, 556–560. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  13. Maybeck, P.S. Stochastic Models, Estimation, and Control; Academic Press: Cambridge, MA, USA, 1982; Volume 1. [Google Scholar]
  14. Bishop, G.; Welch, G. An introduction to the Kalman filter. Proc. SIGGRAPH Course 2001, 8, 41. [Google Scholar]
  15. Ferrero, R.; Gandino, F.; Hemmatpour, M.; Montrucchio, B.; Rebaudengo, M. Exploiting accelerometers to estimate displacement. In Proceedings of the 5th Mediterranean Conference on Embedded Computing (MECO), Bar, Montenegro, 12–16 June 2016; pp. 206–210. [Google Scholar]
  16. Seifert, K.; Camacho, O. Implementing Positioning Algorithms Using Accelerometers; Application Note AN3397: Freescale Semicond, AZ, USA, February 2007. [Google Scholar]
  17. Yun, X.; Bachmann, E.R.; Moore, H.; Calusdian, J. Self-contained position tracking of human movement using small inertial/magnetic sensor modules. In Proceedings of the International Conference on Robotics and Automation, Roma, Italy, 10–14 April 2007; pp. 2526–2533. [Google Scholar]
  18. Slifka, L.D. An Accelerometer Based Approach to Measuring Displacement of a Vehicle Body. Ph.D. Thesis, Master of Science in Engineering, Department of Electrical and Computer Engineering, University of Michigan, Dearborn, MI, USA, 2004. [Google Scholar]
  19. Smyth, A.; Wu, M. Multi-rate Kalman filtering for the data fusion of displacement and acceleration response measurements in dynamic system monitoring. Mech. Syst. Signal Process. 2007, 21, 706–723. [Google Scholar] [CrossRef]
  20. Han, S. Retrieving the time history of displacement from measured acceleration signal. KSME Int. J. 2003, 17, 197–206. [Google Scholar] [CrossRef]
  21. Han, S. Measuring displacement signal with an accelerometer. J. Mech. Sci. Technol. 2010, 24, 1329–1335. [Google Scholar] [CrossRef]
  22. Thong, Y.K.; Woolfson, M.S.; Crowe, J.A.; Hayes-Gill, B.R.; Challis, R.E. Dependence of inertial measurements of distance on accelerometer noise. Meas. Sci. Technol. 2002, 13, 1163–1172. [Google Scholar] [CrossRef] [Green Version]
  23. Thong, Y.K.; Woolfson, M.S.; Crowe, J.A.; Hayes-Gill, B.R.; Jones, D.A. Numerical double integration of acceleration measurements in noise. Measurement 2004, 36, 73–92. [Google Scholar] [CrossRef]
  24. Microelectronics, S. LIS344ALH. Available online: https://www.st.com/resource/en/datasheet/lis344alh.pdf (accessed on 8 April 2019).
  25. Microelectronics, S. LIS331DLH. Available online: https://www.st.com/resource/en/datasheet/lis331dlh.pdf (accessed on 8 April 2019).
  26. Libelium. Available online: www.libelium.com/products/waspmote (accessed on 8 April 2019).
Figure 1. The Waspmote with the embedded accelerometer used in the experiments.
Figure 1. The Waspmote with the embedded accelerometer used in the experiments.
Electronics 08 00985 g001
Table 1. Displacement along the x-axis measured with the Waspmote.
Table 1. Displacement along the x-axis measured with the Waspmote.
Acceleration IntegralWith Kalman Filter
Real distance (cm)50701005070100
Mean (cm)74.3127.0178.659.684.0118.0
Range (cm)7682141235394
Uncertainty in measure (cm)38.041.070.511.526.547.0
Uncertainty in mean (cm)21.923.640.76.615.327.1
Percentage error (%)68.781.978.719.327.638.6
Percentage decrease (%)---71.866.350.8
Table 2. Displacement along the x-axis measured with the smartphone.
Table 2. Displacement along the x-axis measured with the smartphone.
Acceleration IntegralWith Kalman Filter
Real distance (cm)50701005070100
mean (cm)120.0119.3177.371.678.6107.6
Range (cm)29581994338138
Uncertainty in measure (cm)14.529.099.521.519.069.0
Uncertainty in mean (cm)8.316.757.512.410.939.8
Percentage error (%)140.070.595.351.327.647.7
Percentage decrease (%)---63.360.850.0
Table 3. Displacement along the xy-plane measured with the Waspmote.
Table 3. Displacement along the xy-plane measured with the Waspmote.
Acceleration IntegralWith Kalman Filter
Real distance (cm)50701005070100
Mean (cm)79.6127.6120.656.384.6103.3
Range (cm)564443382617
Uncertainty in measure (cm)28.022.021.519.013.08.5
Uncertainty in mean (cm)16.112.712.410.97.54.9
Percentage error (%)59.382.420.726.021.96.0
Percentage decrease (%)---56.273.471.0
Table 4. Displacement along the xy-plane measured with the smartphone.
Table 4. Displacement along the xy-plane measured with the smartphone.
Acceleration IntegralWith Kalman Filter
Real distance (cm)50701005070100
Mean (cm)90.083.6176.679.381.0144.3
Range (cm)223669132263
Uncertainty in measure (cm)11.018.034.56.511.031.5
Uncertainty in mean (cm)6.310.419.93.76.318.2
Percentage error (%)80.022.476.758.715.744.3
Percentage decrease (%)---26.729.842.2
Table 5. Displacement in the space measured with the Waspmote.
Table 5. Displacement in the space measured with the Waspmote.
Acceleration IntegralWith Kalman Filter
Real distance (cm)50701005070100
Mean (cm)89.391.3160.664.384.3126.6
Range (cm)36265843334
Uncertainty in measure (cm)18.013.029.021.51.517.0
Uncertainty in mean (cm)10.47.116.712.40.89.8
Percentage error (%)78.730.560.732.720.526.7
Percentage decrease (%)---58.532.856.0
Table 6. Displacement in the space measured with the smartphone.
Table 6. Displacement in the space measured with the smartphone.
Acceleration IntegralWith Kalman Filter
Real distance (cm)50701005070100
Mean (cm)76.390.6162.657.080.6151.6
Range (cm)202853172565
Uncertainty in measure (cm)10.014.026.58.512.532.5
Uncertainty in mean (cm)5.78.015.34.97.218.7
Percentage error (%)52.729.562.716.720.051.7
Percentage decrease (%)---68.332.317.5
Table 7. Computation time with Waspmote and smartphone.
Table 7. Computation time with Waspmote and smartphone.
Acceleration IntegralWith Kalman Filter
Waspmote1.037 s2.023 s
Smartphone0.200 s0.298 s

Share and Cite

MDPI and ACS Style

Ferrero, R.; Gandino, F.; Hemmatpour, M. Estimation of Displacement for Internet of Things Applications with Kalman Filter. Electronics 2019, 8, 985. https://doi.org/10.3390/electronics8090985

AMA Style

Ferrero R, Gandino F, Hemmatpour M. Estimation of Displacement for Internet of Things Applications with Kalman Filter. Electronics. 2019; 8(9):985. https://doi.org/10.3390/electronics8090985

Chicago/Turabian Style

Ferrero, Renato, Filippo Gandino, and Masoud Hemmatpour. 2019. "Estimation of Displacement for Internet of Things Applications with Kalman Filter" Electronics 8, no. 9: 985. https://doi.org/10.3390/electronics8090985

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop