mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Simplified the calculations, fixed tests.
This commit is contained in:
parent
2bbe525853
commit
bc4701aebf
2 changed files with 4 additions and 6 deletions
|
@ -541,9 +541,9 @@ TEST(pidControllerTest, testItermRelax) {
|
|||
EXPECT_NEAR(-8.16, itermErrorRate, calculateTolerance(-8.16));
|
||||
currentPidSetpoint += ITERM_RELAX_SETPOINT_THRESHOLD;
|
||||
applyItermRelax(FD_PITCH, pidData[FD_PITCH].I, gyroRate, &itermErrorRate, ¤tPidSetpoint);
|
||||
EXPECT_NEAR(-2.69, itermErrorRate, calculateTolerance(-2.69));
|
||||
EXPECT_NEAR(0, itermErrorRate, calculateTolerance(0));
|
||||
applyItermRelax(FD_PITCH, pidData[FD_PITCH].I, gyroRate, &itermErrorRate, ¤tPidSetpoint);
|
||||
EXPECT_NEAR(-0.84, itermErrorRate, calculateTolerance(-0.84));
|
||||
EXPECT_NEAR(0, itermErrorRate, calculateTolerance(0));
|
||||
|
||||
pidProfile->iterm_relax_type = ITERM_RELAX_GYRO;
|
||||
pidInit(pidProfile);
|
||||
|
@ -587,7 +587,7 @@ TEST(pidControllerTest, testItermRelax) {
|
|||
pidProfile->iterm_relax = ITERM_RELAX_RPY;
|
||||
pidInit(pidProfile);
|
||||
applyItermRelax(FD_YAW, pidData[FD_YAW].I, gyroRate, &itermErrorRate, ¤tPidSetpoint);
|
||||
EXPECT_NEAR(-6.46, itermErrorRate, calculateTolerance(-3.6));
|
||||
EXPECT_NEAR(-3.6, itermErrorRate, calculateTolerance(-3.6));
|
||||
}
|
||||
|
||||
// TODO - Add more tests
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue