henrioliv / sf9domahrs

Automatically exported from code.google.com/p/sf9domahrs
0 stars 0 forks source link

Acceleration in x and y lead to roll and pitch angles #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. acceleration of the board on a planar surface in x or y axis leads to a roll 
or pitch angle which is not zero and changes with the planar acceleration

What is the expected output? What do you see instead?
since the board is moving in a plane pitch and roll should be zero. x/y 
acceleration of course not. But the angles

What version of the product are you using? On what operating system?
using the code 1.1

Any ideas how to change the code?

Original issue reported on code.google.com by lennart....@gmail.com on 2 Feb 2011 at 1:11

GoogleCodeExporter commented 8 years ago
As far as I can tell, this is the same as "Issue 10." Basically, the firmware 
uses accelerometer data to compensate for drift of the gyros. However, because 
of this reliance on accelerometer data it effectively uses the direction of the 
gravity vector to determine the pitch and roll angles. The result of this is 
that a lateral acceleration appears as a roll or pitch, and a roll or pitch 
without lateral acceleration (i.e. a coordinated turn in a plane) appears as no 
change.

I think the solution to this is to change the Drift_correction() function so 
that it does not give so much weight to accelerometer data. What it should do, 
instead of immediately correcting the matrix, is to gradually shift the matrix 
over a long period of time to match the gravity vector. That way intermittent 
changes such as accelerations and turns do not affect the vector, but a steady 
state condition eventually will.

I will test this by disabling the drift correction code and see if that 
eliminates that problem (at the cost of drifting).

Original comment by jacob.pa...@gmail.com on 26 Feb 2011 at 8:51