Hi, I dont know if this is the right forum but I'm supposed to write some code for a device containing an ARM uC that reads data from a gyro/accelero meter and determines its position in space. A read a lot of articles on the net. Kalman, double integration.... etc. Nowhere I find a strait piece of c-code just entering the realtime gyro and accelero values returning the absolute position in space. Most experts declare it's not accurate and will drift over time. I do not need a preciese position but a rough indication to detect in what direction the gyro/accelero object has moved. I developed my own application with old school physics formulas but measured distance is a factor 10 too small. I know all about the ARM uC and gyro/accelero (LSM6DS0) but would like to find some usefull simple c-code that solves my problem. Thanks in advance, Henk
If you get an error with a factor 10, then I think you already have a working solution (even if it may not contain state-of-the-art filtering/prediction logic).
Start by verifying the time steps - how often you your formula is reevaluated - and also carefully verify the individual units. I'm pretty sure you either forgot about the time step length or put the decimal one step wrong in a unit conversion.
Just a quick check - your error factor don't happen to be somewhere around 9.82 :)
Does a device like the Honeywell HMC5883 suit your needs? It has a simple I2C interface, I have been working with it for some private projects - I don't mind posting some of it here...