mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Avoid necessity for pidInitMixer
This commit is contained in:
parent
533734a58d
commit
6c8b0f3adf
3 changed files with 3 additions and 15 deletions
|
@ -120,9 +120,6 @@ float motor_disarmed[MAX_SUPPORTED_MOTORS];
|
|||
mixerMode_e currentMixerMode;
|
||||
static motorMixer_t currentMixer[MAX_SUPPORTED_MOTORS];
|
||||
|
||||
float pidSumLimit;
|
||||
float pidSumLimitYaw;
|
||||
|
||||
|
||||
static const motorMixer_t mixerQuadX[] = {
|
||||
{ 1.0f, -1.0f, 1.0f, -1.0f }, // REAR_R
|
||||
|
@ -379,12 +376,6 @@ void mixerInit(mixerMode_e mixerMode)
|
|||
initEscEndpoints();
|
||||
}
|
||||
|
||||
void pidInitMixer(const struct pidProfile_s *pidProfile)
|
||||
{
|
||||
pidSumLimit = CONVERT_PARAMETER_TO_FLOAT(pidProfile->pidSumLimit);
|
||||
pidSumLimitYaw = CONVERT_PARAMETER_TO_FLOAT(pidProfile->pidSumLimitYaw);
|
||||
}
|
||||
|
||||
#ifndef USE_QUAD_MIXER_ONLY
|
||||
|
||||
void mixerConfigureOutput(void)
|
||||
|
@ -591,11 +582,11 @@ void mixTable(uint8_t vbatPidCompensation)
|
|||
|
||||
// Calculate and Limit the PIDsum
|
||||
float scaledAxisPidRoll =
|
||||
constrainf(axisPID_P[FD_ROLL] + axisPID_I[FD_ROLL] + axisPID_D[FD_ROLL], -pidSumLimit, pidSumLimit) / PID_MIXER_SCALING;
|
||||
constrainf(axisPID_P[FD_ROLL] + axisPID_I[FD_ROLL] + axisPID_D[FD_ROLL], -currentPidProfile->pidSumLimit, currentPidProfile->pidSumLimit) / PID_MIXER_SCALING;
|
||||
float scaledAxisPidPitch =
|
||||
constrainf(axisPID_P[FD_PITCH] + axisPID_I[FD_PITCH] + axisPID_D[FD_PITCH], -pidSumLimit, pidSumLimit) / PID_MIXER_SCALING;
|
||||
constrainf(axisPID_P[FD_PITCH] + axisPID_I[FD_PITCH] + axisPID_D[FD_PITCH], -currentPidProfile->pidSumLimit, currentPidProfile->pidSumLimit) / PID_MIXER_SCALING;
|
||||
float scaledAxisPidYaw =
|
||||
constrainf(axisPID_P[FD_YAW] + axisPID_I[FD_YAW], -pidSumLimitYaw, pidSumLimitYaw) / PID_MIXER_SCALING;
|
||||
constrainf(axisPID_P[FD_YAW] + axisPID_I[FD_YAW], -currentPidProfile->pidSumLimitYaw, currentPidProfile->pidSumLimitYaw) / PID_MIXER_SCALING;
|
||||
if (isMotorsReversed()) {
|
||||
scaledAxisPidRoll = -scaledAxisPidRoll;
|
||||
scaledAxisPidPitch = -scaledAxisPidPitch;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue