Hi!
First, good job with Glounpilot!
Well,I'm from Spain and I'm studing my last year of robotics and control system engineering. At the moment I'm doing two personal proyects with acc + gyro. A gyroscopic cam for my motorbike and later for mi AR-Drone UAV.
I have been reading a lot of stuff for sensor fusion, but I'm confused.
When I'm riding on my bike cornering I have the centripetal and gravity forces, but the x component of centripetal force is canceled with x component of gravity, producing the equilibrium during the inclination.
Now I can't do atan2(az,ax).
I have that acc data (on G force):
blue line is z accelerometer readings (gravity force on static position)
red line is y accelerometer readings (forward and backward movement), not interesting for now.
green line is x accelerometer readings (lateral forces).
As you can see, z-data it's bigger than 1G, because when we are cornering, we have G*cos(ang) + Fc*sin(ang), and on x-data G*sin(ang)-Fc*cos(ang).
G*sin(ang)+Fc*cos(ang) = xdata
G*cos(ang)-Fc*sin(ang) = zdata
---------------------------------------
tan(ang)-cot(ang) = x/z ->
atan2(x+z*cot(ang),z) -> that could be a iterative equation
....
but something it's going wrong and I don't know if i should use euler angles or quaternions from gyro readings to try to cancel the centripetal force.
Thats the gyro-roll :
The drift error from datasheet it's corrected, but the problems is that we are inclinated cornering the angular velocity from z, yaw, it's divided in more components because the axis aren't paralel to the ground.
That's the angular velocities:
As you can see, blue ones is yaw and green ones is roll...seeing that roll data it's how I was rolling on myself during the corner....
How can I get the inclination angle from accelerometer????
Thank you a lot!!
PD: sorry for my english