Improving Altitude Hold Mode
Posted: Thu Mar 19, 2015 6:06 pm
According to this page in the wiki: http://wiki.bitcraze.se/projects:crazyf ... itude_hold, the integral (I) part of the altitude hold PID controller is used to compensate for decreasing motor voltage as the battery discharges, and it only resets when the battery is charging. This setup seems kind of fragile to me. There is a lot that can go wrong to throw off the voltage compensation. I've noticed weird behavior of the altitude hold function as the battery level drops, almost to the point where it can't be used after the battery hits 50%. I was wondering if it would make more sense to compensate for battery voltage fluctuations by doing the PID thrust calculations in RPM and then converting the RPM to a PWM percentage based on the measured battery voltage (make a motorsSetSpeed function instead of using motorsSetRatio). Obviously, the max RPM would go down as the battery voltage goes down, but I don't think that would affect the PID controller too much.
Any thoughts or advice before I try to implement it? Is there some big factor I'm overlooking that makes this idea unfeasible?
Any thoughts or advice before I try to implement it? Is there some big factor I'm overlooking that makes this idea unfeasible?