mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 15:53:56 -04:00
Based on Jani's latest logs I've made two tweaks to alt hold.
The first is to remove the filter on the throttle output for alt_hold. The second was to open up the constraint on climb rate. This is to deal with larger than expected disturbances causing altitude changes.
This commit is contained in:
parent
d0a6359b37
commit
a924c3685e
@ -1515,7 +1515,7 @@ void update_simple_mode(void)
|
|||||||
g.rc_2.control_in = control_pitch;
|
g.rc_2.control_in = control_pitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define THROTTLE_FILTER_SIZE 4
|
#define THROTTLE_FILTER_SIZE 2
|
||||||
|
|
||||||
// 50 hz update rate, not 250
|
// 50 hz update rate, not 250
|
||||||
// controls all throttle behavior
|
// controls all throttle behavior
|
||||||
@ -1652,7 +1652,10 @@ void update_throttle_mode(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// light filter of output
|
// light filter of output
|
||||||
g.rc_3.servo_out = (g.rc_3.servo_out * (THROTTLE_FILTER_SIZE - 1) + throttle_out) / THROTTLE_FILTER_SIZE;
|
//g.rc_3.servo_out = (g.rc_3.servo_out * (THROTTLE_FILTER_SIZE - 1) + throttle_out) / THROTTLE_FILTER_SIZE;
|
||||||
|
|
||||||
|
// no filter
|
||||||
|
g.rc_3.servo_out = throttle_out;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1918,7 +1921,7 @@ static void update_altitude()
|
|||||||
climb_rate = (climb_rate + old_climb_rate)>>1;
|
climb_rate = (climb_rate + old_climb_rate)>>1;
|
||||||
|
|
||||||
// manage bad data
|
// manage bad data
|
||||||
climb_rate = constrain(climb_rate, -300, 300);
|
climb_rate = constrain(climb_rate, -800, 800);
|
||||||
|
|
||||||
// save for filtering
|
// save for filtering
|
||||||
old_climb_rate = climb_rate;
|
old_climb_rate = climb_rate;
|
||||||
|
Loading…
Reference in New Issue
Block a user