mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Improved ITerm windup handling for tricopter
This commit is contained in:
parent
d0475a6987
commit
37c9d3c47e
3 changed files with 20 additions and 3 deletions
|
@ -116,6 +116,9 @@ PG_REGISTER_ARRAY(motorMixer_t, MAX_SUPPORTED_MOTORS, customMotorMixer, PG_MOTOR
|
|||
#define EXTERNAL_CONVERSION_MAX_VALUE 2000
|
||||
#define EXTERNAL_CONVERSION_3D_MID_VALUE 1500
|
||||
|
||||
#define TRICOPTER_ERROR_RATE_YAW_SATURATED 75 // rate at which tricopter yaw axis becomes saturated, determined experimentally by TriFlight
|
||||
|
||||
|
||||
static uint8_t motorCount;
|
||||
static float motorMixRange;
|
||||
|
||||
|
@ -328,6 +331,16 @@ float getMotorMixRange()
|
|||
return motorMixRange;
|
||||
}
|
||||
|
||||
bool mixerIsOutputSaturated(int axis, float errorRate)
|
||||
{
|
||||
if (axis == FD_YAW && (currentMixerMode == MIXER_TRI || currentMixerMode == MIXER_CUSTOM_TRI)) {
|
||||
return errorRate > TRICOPTER_ERROR_RATE_YAW_SATURATED;
|
||||
} else {
|
||||
return motorMixRange >= 1.0f;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isMotorProtocolDshot(void) {
|
||||
#ifdef USE_DSHOT
|
||||
switch(motorConfig()->dev.motorPwmProtocol) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue