Page 1 of 1

Accelerometers and external forces

PostPosted: Sun May 13, 2012 4:57 pm
by Nano
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):
Image

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 :

Image

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:

Image

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 :oops:

Re: Accelerometers and external forces

PostPosted: Sun May 13, 2012 8:40 pm
by Tom
Hello,

You need to calculate Fc (centripetal force)! You will need speed and rotation rate (gyroscope) along Z and Y axis. Once you have this, you can substract it from the accelerometer readings. Finally you can use the gyroscopes to implement some sort of noise-filter (hi frequency from gyro and low frequency from accelerometer). I'd suggest euler angles, they are easier and you don't need quaternions on a bike :-)

Re: Accelerometers and external forces

PostPosted: Mon May 14, 2012 7:41 am
by Nano
Tom wrote:Hello,

You need to calculate Fc (centripetal force)! You will need speed and rotation rate (gyroscope) along Z and Y axis. Once you have this, you can substract it from the accelerometer readings. Finally you can use the gyroscopes to implement some sort of noise-filter (hi frequency from gyro and low frequency from accelerometer). I'd suggest euler angles, they are easier and you don't need quaternions on a bike :-)


Thanks Tom! I was trying calculate all without speed data because I don't have any sensor to do that (for now :lol: ) ...but I have to say that yesterday I was working on my equations trying to obtain a iterative formula to get the angle and I had this:

Az^2 * cos(ang)^2 + Ay^2*sin(ang)^2 - Ax^2 = 1

Image

red one is acc data from previous iterative equation.
and blue one is integration from gyro data.
I think that it's very close...

I'm going to work more on that to see if I can control the gyro cam without speed data...

:ugeek: :ugeek:

Re: Accelerometers and external forces

PostPosted: Tue May 15, 2012 8:06 pm
by Tom
Good luck!