mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 09:16:07 +03:00
Acro trainer
Adds a new angle limiting mode for pilots who are learning to fly in acro mode. Primarily targeted at new LOS acro pilots, but can be used with FPV as well. The feature is activated with a new mode named "ACRO TRAINER". When the feature is active, the craft will fly in normal acro mode but will limit roll/pitch axes so that they don't exceed the configured angle limit. New pilots can start with a small angle limit and progressively increase as their skills improve. The accelerometer must be enabled for the feature to be configured and function. Also the feature will only be active while in acro flight and will disable if ANGLE or HORIZON modes are selected. For most users all they need to do is simply configure the new mode to be active as desired on the "Modes" tab in the configurator and configure the desired angle limit in the cli. Configuration parameters: acro_trainer_angle_limit: (range 10-80) Angle limit in degrees. acro_trainer_lookahead_ms: (range 10-200) Time in milliseconds that the logic will "look ahead" to help minimize overshoot and bounce-back if the limit is approached at high gyro rates. The default value of 50 should be good for most users. For low powered or unresponsive craft (micros or brushed) it may be helpful to increase this setting if you're seeing substantial overshoot. acro_trainer_debug_axis: (ROLL, PITCH) The axis that will log information if debugging is active. To enable debugging: set debug_mode = ACRO_TRAINER debug(0) - Current angle debug(1) - The internal logic state debug(2) - Modified setpoint debug(3) - Projected angle based gyro rate and lookahead period
This commit is contained in:
parent
eecb59db45
commit
9b43839052
10 changed files with 158 additions and 3 deletions
|
@ -128,7 +128,9 @@ typedef struct pidProfile_s {
|
|||
uint8_t iterm_relax_cutoff_low; // Slowest setpoint response to prevent iterm accumulation
|
||||
uint8_t iterm_relax_cutoff_high; // Fastest setpoint response to prevent iterm accumulation
|
||||
itermRelax_e iterm_relax; // Enable iterm suppression during stick input
|
||||
|
||||
uint8_t acro_trainer_angle_limit; // Acro trainer roll/pitch angle limit in degrees
|
||||
uint16_t acro_trainer_lookahead_ms; // The lookahead window in milliseconds used to reduce overshoot
|
||||
uint8_t acro_trainer_debug_axis; // The axis for which record debugging values are captured 0=roll, 1=pitch
|
||||
} pidProfile_t;
|
||||
|
||||
#ifndef USE_OSD_SLAVE
|
||||
|
@ -171,4 +173,6 @@ void pidInitConfig(const pidProfile_t *pidProfile);
|
|||
void pidInit(const pidProfile_t *pidProfile);
|
||||
void pidCopyProfile(uint8_t dstPidProfileIndex, uint8_t srcPidProfileIndex);
|
||||
bool crashRecoveryModeActive(void);
|
||||
void pidAcroTrainerInit(void);
|
||||
void pidSetAcroTrainerState(bool newState);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue