Society of Robots - Robot Forum

Software => Software => Topic started by: anir_yogi on January 06, 2011, 12:38:11 AM

Title: accelerometer+ gyro not giving proper tilt
Post by: anir_yogi on January 06, 2011, 12:38:11 AM
I am making a balancing robot which uses Idg500 as gygo and mma7260 as accelerometer.
As i know accelerimeter has a vibration problem and gyro has a drift problem, I have used complimentary filter as will as simple kalman filter also using (
Have gone through many resources as well as many codes related to this.
One thing i never understand is how the they fix the sample rate that is dt. For me its the loop time how can u fix it, it comes automaticly right. say for my loop it is coming as 60ms.
Now when i am using all this i am still not able to balance my bot. There might be one problem i am assuming that my gyro gives the reading in every 7ms but i am tatking it after 60ms and putting it in the complimentary as
angle = 0.68*(old_acc_angle + gyro_read*dt)+(1-0.68)*(new_acc_angle).

As of i can understand the equation assumes that the gyro is showing a constant reading in this time but actually it has given 8-9 readings which are not considered at all.
I hope i am clear with my question please reply. and thanks in advance.