Go Down

Topic: Guide to gyro and accelerometer with Arduino including Kalman filtering (Read 313 times) previous topic - next topic

Brettj

I modded the code into java, as i'm doing the postprocessing on the PC.
the only thing i think i modded is this...
xAngle += kalmanCalculateX(accXangle, gyroXrate, dtime);
I made the xAngle += so I just print total xAngle directly. Is that wrong?
Apart from that, using nano seconds and slightly different calibration position it is the same.

Lauszus

Yes that it totally wrong. If you do like that, it will plus the angle with the last one. It should be:
Code: [Select]
Angle = kalmanCalculateX(accXangle, gyroXrate, dtime);

It is only when you calculate the gyros angle that you have to plus the last angle with the new one!
- Lauszus

Brettj

ok fixed that. But it only works for about 50 degrees +-. Similar to the other kalman filter i tried :(

Lauszus

Maybe you forgot that gyroXrate should be in degrees per second and not degrees in this line:

Code: [Select]
Angle = kalmanCalculateX(accXangle, gyroXrate, dtime);

- Lauszus

fino1990

Hi Lauszus, I bought the same gyro(http://www.sparkfun.com/products/9165) used by IMU on your project. I just want to read angle from the gyro but having a little confuse about the HP, PD and ST pin. Should I just left them all unconnect or do you have any suggestion?

~Thanks  :)
~Fino

Go Up