I'm doing an experimental program. I've a smartphone fixed on the car dashboard with a support, during the travel I read from an application some value from inertial sensor.
Precisely I read, Accelerometer Data Time (at fixed interval) of each registration in seconds.
So now I would want to pass from vertical acceleration to vertical displacement, to do this I should do a double integration.
I tried the Euler method. From initial condition like:
v0=0.v0=0
this is initial velocity at time zero.
x0=0.x0=0
this is initial position at time zero.
define,
deltaT=registrationinterval.deltaT=registrationinterval
(in my case 0,04s)
then for each registration made, I do:
vi=vi−1+ayi∗deltaT.vi=vi−1+ayi∗deltaT
xi=xi−1+vi∗deltaT.xi=xi−1+vi∗deltaT
where i
represents the current, and i-1
precedent.
But the chart that I get is not very realistic, in fact both the speed and the displacement are only grow, instead the effect that I had to get is that the vertical displacement came out as something similar to the acceleration graph.
Given that applying this procedure, I also a high error, it is possible that the graph is only growing, and I do not see any kind of vertical oscillation?
I also read the Kalman filter can be applied in advance to clean the signal, could be a solution?
Or should I change the method of integration and switch to the Euler from Runge Kutta? (The last, however, I have not the slightest idea of how it could be set).
Or someone know an algorithm that can be help me?
Here there is an example of the data registered if can be helpful: