Position calculation of small model of a car using Accelerometer + Gyroscope
Position calculation of small model of a car using Accelerometer + Gyroscope [0] [1] GuiccoPiano [2012-06-18 16:28:18] [ position accelerom eter gy roscope inertial-nav igation ] [ http://stackov erflow.com /questions/11087 07 6/position-calculation-of-sm all-m odel-of-acar-using-accelerom eter-gy roscope ]
I wish to calculate position of a small remote controlled car (relative to starting position). The car moves on a flat surface for example: a room floor. Now, I am using an accelerometer and a gyroscope. To be precise this board --> http://www.sparkfun.com/products/9623 As a first step I just took the accelerometer data in x and y axes (since car moves on a surface) and double integrated the data to get position. The formulae I used were: vel_new = vel_old + ( acc_old + ( (acc_new - acc_old ) / 2.0 ) ) * SAMPLING_TIME; pos_new = pos_old + ( vel_old + ( (vel_new - vel_old ) / 2.0 ) ) * SAMPLING_TIME; vel_old = vel_new; pos_old = pos_new; acc_new = measured value from accelerometer
The above formulae are based on etis.ensea.fr/~pierandr/cours/M1_SIC/AN3397.pdf
this
document:
http://perso-
However this is giving horrible error. After reading other similar questions on this forum, I found out that I need to subtract the component of Gravity from above acceleration values (everytime from acc_new) by using gyroscope somehow. This idea is very well explained in Google Tech Talks video Sensor Fusion on Android Devices: A Revolution in Motion Processing [1 ] at time 23:49. Now my problem is how to subtract that gravity component? I get angular velocity from gyroscope. How do I convert it into acceleration so that I can subtract it from the output of accelerometer? [1 ] http://www.y outube.com/watch?v =C7 JQ7 Rpwn2k [+1] [2012-06-18 16:59:24] Ali It won't work, [1 ] these sensors are not accurate enough to calculate the position. The reason is also ex plained in the v ideo y ou are referring to. The best y ou could do is to get the v elocity based on the rpm of the wheels. If y ou also know the heading that belongs to the v elocity , y ou can integrate the v elocity to get position. Far from perfect but it should giv e y ou a reasonable estimate of the position. I do not know how y ou could get the heading of the car, it depends on the hardware y ou hav e. [1 ] http://stackov erflow.com/a/7 835988/341 97 0 Hi Ali. We cannot im plem ent dead reckoning (calculating rpm of the wheels) due to space lim itations for wheelencoders. Also right now we can forget about the heading. Let us assum e that the car m ov es along a straight line in known direction. I just want to know how m uch the car has m ov ed from its starting position using accelerom eter and gy roscope data. How could I m inim ize the error? - GuiccoPiano I repeat: it won't work, these sensors are not accurate enough to calculate the position. Sorry ... :( - Ali Hi.I get y our point Ali. But this is m y project and I hav e to try . Right now m y accuracy is som ething like this: if I www.stackprinter.com/export?format=HTML&service=stackoverflow&question=11087076
1/2
1/29/13
Position calculation of small model of a car using Accelerometer + Gyroscope
m ov e the sensor say 4 0 cm along a straight line and just use accelerom eter data (assum ing that I just get Linear Acceleration), I get totally random v laues for position if I repeat the test. For exam ple: test 1 : Position = 51 cm , test 2 : Position = 4 6 cm , test 3 : Position = 7 6 cm , test 4 : Position = 1 9 cm , test 5 : Position = 1 09 cm . Can I get m ore closer or atleast constant error using gy ro? - GuiccoPiano 1