Thread: Discussion Open Flight Stabilizer
View Single Post
Old Jan 09, 2013, 06:18 PM
noobee is offline
Find More Posts by noobee
Registered User
Joined Dec 2006
1,461 Posts
i think i found the source of the "significant" jitter, it is either the i2c or imu libraries (more likely i2c). i think it is disabling interrupts for long-ish periods of time. this is with my mpu6050 board, but the mpu6050 and itg3205 libraries are based off the same base in i2cdevlib.

so, i'll look into using alternate i2c access functions that does not use the arduino Wire library.

i'll also look into a lock-free implementation of shared vars access between the isrs and main loop. the current atomic access operations will disable interrupts (though it seems that the disable time is quite small).

the +/-5us-ish jitter is probably coming from the 4us micros() granularity as you indicated. using a true microsecond timer1 could help there..
noobee is offline Find More Posts by noobee
Reply With Quote