1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

New calculation for DTERM setpoint weight

I'm flying race with betaflight and on all my race quads I have setpoint on maximum value 2.54. But I feel, that it's not enough. This calculation of setpoint is almost same as old method up to number 2.0 (previously 2.54) but numbers above 2.0 have more aggresive impact on Dterm RC stick commands. With this calculation i found, that value 2.3 is fine for me. 2.3 is equivalent to 6,35 with old calculation method (which was not possible of course, because there is 8bit limit). With higher values have quad much sharper responses and feel more "locked in". 
I think, that most freestyle pilots have setpoint at values around 1, so there is almost no change and race pilots using higher values and for those, who are limited by the value 2.54 (like me and my friends) should be solution new setpoint calculation method.
This is my first pull request to betaflight, so I hope, that I did everything well according your rules
This commit is contained in:
supiiik 2018-05-22 19:59:47 +02:00 committed by GitHub
parent 041362614b
commit e4846f2ecc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,7 +317,10 @@ void pidInitConfig(const pidProfile_t *pidProfile)
pidCoefficient[axis].Kd = DTERM_SCALE * pidProfile->pid[axis].D; pidCoefficient[axis].Kd = DTERM_SCALE * pidProfile->pid[axis].D;
} }
dtermSetpointWeight = pidProfile->dtermSetpointWeight / 127.0f; dtermSetpointWeight = pidProfile->dtermSetpointWeight / 100.0f;
if (dtermSetpointWeight > 2.0f) {
dtermSetpointWeight = 10 * (dtermSetpointWeight - 2.0f) + 2.0f;
}
if (pidProfile->setpointRelaxRatio == 0) { if (pidProfile->setpointRelaxRatio == 0) {
relaxFactor = 0; relaxFactor = 0;
} else { } else {