Copter: remove reset_I_all

Each controller should reset the I terms as needed
This commit is contained in:
Randy Mackay 2014-02-03 17:48:08 +09:00 committed by Andrew Tridgell
parent 72a3f14561
commit 38d5148b99
2 changed files with 1 additions and 36 deletions

View File

@ -241,38 +241,7 @@ static float get_throttle_surface_tracking(int16_t target_rate, float current_al
return (target_rate + velocity_correction); return (target_rate + velocity_correction);
} }
/* // set_accel_throttle_I_from_pilot_throttle - smooths out transition from pilot controlled throttle to autopilot throttle
* reset all I integrators
*/
static void reset_I_all(void)
{
reset_rate_I();
reset_throttle_I();
reset_optflow_I();
}
static void reset_rate_I()
{
g.pid_rate_roll.reset_I();
g.pid_rate_pitch.reset_I();
g.pid_rate_yaw.reset_I();
}
static void reset_optflow_I(void)
{
g.pid_optflow_roll.reset_I();
g.pid_optflow_pitch.reset_I();
of_roll = 0;
of_pitch = 0;
}
static void reset_throttle_I(void)
{
// For Altitude Hold
g.pi_alt_hold.reset_I();
g.pid_throttle_accel.reset_I();
}
static void set_accel_throttle_I_from_pilot_throttle(int16_t pilot_throttle) static void set_accel_throttle_I_from_pilot_throttle(int16_t pilot_throttle)
{ {
// shift difference between pilot's throttle and hover throttle into accelerometer I // shift difference between pilot's throttle and hover throttle into accelerometer I

View File

@ -159,10 +159,6 @@ static void init_arm_motors()
calc_distance_and_bearing(); calc_distance_and_bearing();
} }
// all I terms are invalid
// -----------------------
reset_I_all();
if(did_ground_start == false) { if(did_ground_start == false) {
did_ground_start = true; did_ground_start = true;
startup_ground(true); startup_ground(true);