mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 06:45:16 +03:00
don't rotate D or A, it reverses their sign inappropriately
This commit is contained in:
parent
1a81b3cdf3
commit
5e81ff6977
1 changed files with 9 additions and 9 deletions
|
@ -331,15 +331,15 @@ bool positionControl(void) {
|
|||
posHold.pitchI = rotatedPitchI;
|
||||
|
||||
// rotate smoothed DA factors
|
||||
const float rotatedRollD = rollD * cosDeltaHeading + pitchD * sinDeltaHeading;
|
||||
const float rotatedPitchD = pitchD * cosDeltaHeading - rollD * sinDeltaHeading;
|
||||
rollD = rotatedRollD;
|
||||
pitchD = rotatedPitchD;
|
||||
|
||||
const float rotatedRollA = rollA * cosDeltaHeading + pitchA * sinDeltaHeading;
|
||||
const float rotatedPitchA = pitchA * cosDeltaHeading - rollA * sinDeltaHeading;
|
||||
rollA = rotatedRollA;
|
||||
pitchA = rotatedPitchA;
|
||||
// const float rotatedRollD = rollD * cosDeltaHeading + pitchD * sinDeltaHeading;
|
||||
// const float rotatedPitchD = pitchD * cosDeltaHeading - rollD * sinDeltaHeading;
|
||||
// rollD = rotatedRollD;
|
||||
// pitchD = rotatedPitchD;
|
||||
//
|
||||
// const float rotatedRollA = rollA * cosDeltaHeading + pitchA * sinDeltaHeading;
|
||||
// const float rotatedPitchA = pitchA * cosDeltaHeading - rollA * sinDeltaHeading;
|
||||
// rollA = rotatedRollA;
|
||||
// pitchA = rotatedPitchA;
|
||||
|
||||
// limit sum of D and A because otherwise too aggressive if entering at speed
|
||||
float rollDA = rollD + rollA;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue