Speed Calculation using accelerometer sensor.

Thread Starter

Malesh

Joined Nov 11, 2020
2
Hi,
I am trying to measure the speed of a moving vehicle using accelerometer sensor. here i am using trepizoidal method to integrate the discrete data from accelerometer sensor. it works bit better(with small error) for small distances. But, when i continue for long distances (with up&down slopes) it making more error. Can any body help me?????


Please help me????????
 

nsaspook

Joined Aug 27, 2009
8,156
The large errors likely from the integration of drift and noise. A band-pass filer might help (one high-pass and other low-pass) and redundant sensors.

18:40 23:40
 

Irving

Joined Jan 30, 2016
1,126
Yes, as AndrewMM says, you need a Kalman filter that integrates the accelerometer data with the gyro data to remove longer-term drift. There's many YouTube videos on this for improving dead-reckoning navigation on drones, autonomous vehicles and the like. Pretty standard practice these days.
 

andrewmm

Joined Feb 25, 2011
1,127

nsaspook

Joined Aug 27, 2009
8,156
The Madgwick's IMU and AHRS algorithms are very good.

Here's a little PIC32MK demo (in C) of a 9-axis IMU driving a SPI graphics display showing IMU data, a tracking glyph from the sensor fusion data while outputting serial data for a Linux java cube visualization.

https://github.com/nsaspook/vcan/tr...apps_pic32mk/apps/clock/clock_config/firmware


10ms update frequency.

Top line: SPI data output to graphics display, 4.5ms, https://www.lcd-module.com/fileadmin/eng/pdf/grafik/dogxl240-7e.pdf
Bottom line: IMU SPI data readout for all sensors, 90us

Actual processing time for IMU and graphics transformations is less than 1ms.
 
Last edited:
Top