1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Throttle boost (#5508)

* throttle boost which temporarily boosts throttle in both directions to improve response

* fix comment and use pt1FilterGain

* incorporate review suggestions

* incorporate review suggestions

* use float constant to avoid double promotion

* formatting changes

* formatting change

* hopefully last style changes
This commit is contained in:
joelucid 2018-03-24 23:33:22 +01:00 committed by Michael Keller
parent 172642383d
commit efda704ee5
4 changed files with 22 additions and 1 deletions

View file

@ -765,6 +765,10 @@ void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensation)
}
motorMixRange = motorMixMax - motorMixMin;
if (throttleBoost > 0.0f) {
float throttlehpf = throttle - pt1FilterApply(&throttleLpf, throttle);
throttle = constrainf(throttle + throttleBoost * throttlehpf, 0.0f, 1.0f);
}
if (motorMixRange > 1.0f) {
for (int i = 0; i < motorCount; i++) {