TradHeli: Use Leaky Integrator on Yaw Rate controller

Use when rotor is not running to prevent the rudder from slowly moving over
This commit is contained in:
Robert Lefebvre 2013-07-18 16:52:06 -04:00 committed by Randy Mackay
parent 3ce16113b5
commit 232a116973

View File

@ -174,7 +174,11 @@ get_heli_rate_yaw(int32_t target_rate)
if (pid_saturated){
i = g.pid_rate_yaw.get_integrator(); // Locked Integrator due to PID saturation on previous cycle
} else {
if (motors.motor_runup_complete()){
i = g.pid_rate_yaw.get_i(rate_error, G_Dt);
} else {
i = g.pid_rate_yaw.get_leaky_i(rate_error, G_Dt, RATE_INTEGRATOR_LEAK_RATE); // If motor is not running use leaky I-term to avoid excessive build-up
}
}
d = g.pid_rate_yaw.get_d(rate_error, G_Dt);