View Single Post
Old Sep 23, 2012, 10:17 AM
scolton is offline
Find More Posts by scolton
Registered User
scolton's Avatar
United States, MA, Cambridge
Joined Aug 2012
30 Posts
Originally Posted by Akcopter View Post
Wow this is great how did you fix the problematic complementary filter...????
I thought yawing when your copter is banking steeply at some angle will cause bad angle estimates(i.e when your copter is armed and flying) because the accelerometer values will be rejected by the controller as the gyros dont sense reversal of angles on the roll axis.... but how is the controller latching to an angle even before it has been armed....this is very alarming ..can you just post what modifications you made to the code to solve this problem.....
Originally, I enabled the complementary filter code that is commented out in v1.2 and replaced the accelerometer-only angle with gyro+accelerometer angle from the filter in the self-level P controller. But, there's a conditional that says: "If filtered angle is higher than 26 (I think), ignore the accelerometer." I changed the conditional to: "If accelerometer angle is higher than 45, ignore the accelerometer."

It doesn't solve the problem of yaw while steeply banked causing a bad angle estimate. If you yaw fast enough, before the accelerometer has a chance to correct it, it may still cause strange results. Slow, shallow banked turns seem okay to me, but your results may vary.
scolton is offline Find More Posts by scolton
Reply With Quote