1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

feedforward transition moved to feedforward.c

This commit is contained in:
ctzsnooze 2021-08-04 16:48:07 +10:00
parent 86aa5cc84e
commit 28d9d778a6
6 changed files with 33 additions and 20 deletions

View file

@ -101,7 +101,10 @@ extern "C" {
{
UNUSED(newRcFrame);
UNUSED(feedforwardAveraging);
return simulatedSetpointRate[axis] - simulatedPrevSetpointRate[axis];
const float feedforwardTransitionFactor = pidGetFeedforwardTransitionFactor();
float setpointDelta = simulatedSetpointRate[axis] - simulatedPrevSetpointRate[axis];
setpointDelta *= feedforwardTransitionFactor > 0 ? MIN(1.0f, getRcDeflectionAbs(axis) * feedforwardTransitionFactor) : 1;
return setpointDelta;
}
bool shouldApplyFeedforwardLimits(int axis)
{