Go Down

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

Lauszus

Yes it is yaw (the rotation around the z-axis). The reason why you can not measure yaw with a accelerometer is because the gravitational force from earth does not change when you rotate the IMU horizontal. In theory you will not measure any difference at all, in pratical however you see the acceleration from the movement. I use the z-value from the accelerometer together with pitch and roll to calculate the force vector (this is theoretical 1, but in practice there is a small difference). I also use the z-value from the accelerometer to know when the IMU is tilted more than 90 degrees to both side, so I can get 360 degree resolution instead of only 180 :)  
- Lauszus

pito

.."while the accelerometer measures Earth gravitational acceleration (g) in three dimensions"..
not only, it measures the acceleration of the unit as well..P. :)

onidaito

Yes, I understand in the case of the accelerometer now. That does make sense. So, do you use the gyro at all for the Yaw calculation?

Lauszus

Pito: exactly! That is why you can not count on the accelerometer on short terms, because it is to unstable. For example it will jump all over the place if you shake it. That is why you have to combine it with a gyro, that do not change when you for example shake it.

Onidaito: I do not use it right now, but if you look in my code I actualy calculate the yaw. Just write
Code: [Select]
Serial.println(gyroZangle); and you will see the yaw, but remember it will drift!

Senso

If it is an ITG a simple offset calibration is enought to cancel the drift, or almost all of it.

Go Up