My issue is not directly related to motor control, but I figured people here might be able to help.
I’m trying to compute a linear velocity by using an accelerometer. Before throwing up your hands, please hear me out :
- I get precise velocity data every 1 second from another source, so I only need the accelerometer in between.
- My acceleration data is clean: no noise, no gravity (I use a gyroscope and a software library from ST to achieve this).
Even though the above sounds quite promising to me, I still get a significant linear drift in my velocity (using square, trapezoid or Simpson integration).
I’ve tried several high-pass filters, but they all seem to replace the linear drift by a sinusoidal trend.
P.S.: one more thing: my loop is slow (100Hz).
Im probably not the right person to help, but I have some questions that might help others answer you question.
What type of velocity data are you getting every second? Is it instantaneous velocity or does it describe the velocity state over the period between it and the previous data point 1 second prior?
What does this system look like? Is it a vehicle or something? / Do you think you will be able to test a solution?
Every 1s, I get GPS velocity data from a mobile phone. I don’t know if it’s an instantaneous or mean velocity.
The system is a portable device use by a pedestrian. I’ve got a prototype in front of me, so I can test it.
I did more tests and I think I’m on the right way. On many websites I found that you should use a LPF on the acceleration data, then a HPF on the resulting velocity data. Thinking more about it, I think a LPF on acceleration data is appropriate only if you’ve got noise, which is not my case. What I have is probably bias, so I’m currently experimenting with a HPF on the acceleration data, with promising results.