mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Mixer update: dynamic idle and throttle logging improvements
- all CLI parameters related to dynamic idle alone re-named with the `dyn_idle_` prefix - when linear throttle scaling is active, the user's set idle value is now correct whether dynamic idle is on or off. Previously, the idle value fell when dynamic idle was activated at the same time as linear throttle scaling. - enabling dynamic idle no longer causes a deadband at full throttle - the setpoint throttle value sent to Blackbox does not include the dynamic idle offset - the throttle value sent to the antigravity and dynamic lowpass code includes throttle scaling, but no other modifiers, to avoid false elevation of the apparent throttle position from dynamic idle and unnecessary transient changes in their filter cutoffs - Dynamic Idle now uses a modified PI controller during active rpm control phase - the D factor provides early detection of rapid falls in rpm, e.g. in hard chops. It is filtered heavily. Inadequate `dyn_idle_d_gain` may lead to a transient drop in rpm immediately after cutting throttle. Default is 50. - the P factor provides fast control over rpm during the active control phase. Too much `dyn_idle_p_gain` may cause oscillation in that phase. Note enough and a slow drop in rpm will be inadequately corrected. Default is 50. Needs to be higher with heavier larger props. - An integral element does most of the work. It prevents enduring offsets from the set rpm. The I gain is high when increasing responding to low rpm, and slow to release. The slow release makes a huge difference and avoids I oscillation. Not enough `dyn_idle_i_gain` and there may be wobble in rpm during the control phase, or the idle value may rise too slowly; too much may cause wobble. Default is 50. Needs to be higher with heavier larger props. - The DYN_IDLE debug shows idle P, I and D in debugs 0, 1 and 2. minRps stays in debug 3. - Interactions between throttle and thrust linear, dynamic idle, throttle scaling and throttle boost have been checked and work as they should.
This commit is contained in:
parent
8ee317f815
commit
8050ecd1e7
12 changed files with 116 additions and 78 deletions
|
@ -188,11 +188,11 @@ typedef struct pidProfile_s {
|
|||
uint8_t ff_boost; // amount of high-pass filtered FF to add to FF, 100 means 100% added
|
||||
char profileName[MAX_PROFILE_NAME_LENGTH + 1]; // Descriptive name for profile
|
||||
|
||||
uint8_t idle_min_rpm; // minimum motor speed enforced by integrating p controller
|
||||
uint8_t idle_adjustment_speed; // how quickly the integrating p controller tries to correct
|
||||
uint8_t idle_p; // kP
|
||||
uint8_t idle_pid_limit; // max P
|
||||
uint8_t idle_max_increase; // max integrated correction
|
||||
uint8_t dyn_idle_min_rpm; // minimum motor speed enforced by the dynamic idle controller
|
||||
uint8_t dyn_idle_p_gain; // P gain during active control of rpm
|
||||
uint8_t dyn_idle_i_gain; // I gain during active control of rpm
|
||||
uint8_t dyn_idle_d_gain; // D gain for corrections around rapid changes in rpm
|
||||
uint8_t dyn_idle_max_increase; // limit on maximum possible increase in motor idle drive during active control
|
||||
|
||||
uint8_t ff_interpolate_sp; // Calculate FF from interpolated setpoint
|
||||
uint8_t ff_max_rate_limit; // Maximum setpoint rate percentage for FF
|
||||
|
@ -386,10 +386,12 @@ bool pidOsdAntiGravityActive(void);
|
|||
bool pidOsdAntiGravityMode(void);
|
||||
void pidSetAntiGravityState(bool newState);
|
||||
bool pidAntiGravityEnabled(void);
|
||||
|
||||
#ifdef USE_THRUST_LINEARIZATION
|
||||
float pidApplyThrustLinearization(float motorValue);
|
||||
float pidCompensateThrustLinearization(float throttle);
|
||||
#endif
|
||||
|
||||
#ifdef USE_AIRMODE_LPF
|
||||
void pidUpdateAirmodeLpf(float currentOffset);
|
||||
float pidGetAirmodeThrottleOffset();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue