mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 14:25:14 +03:00
Fix Curve formula
This commit is contained in:
parent
1da5219bf2
commit
25954b3d14
1 changed files with 7 additions and 1 deletions
|
@ -71,8 +71,14 @@ RateCurve.prototype.rcCommandRawToDegreesPerSecond = function (rcData, rate, rcR
|
||||||
var maxRc = 500 * rcRate;
|
var maxRc = 500 * rcRate;
|
||||||
|
|
||||||
if (rcExpo > 0) {
|
if (rcExpo > 0) {
|
||||||
|
var expoPower;
|
||||||
var absRc = Math.abs(inputValue) / maxRc;
|
var absRc = Math.abs(inputValue) / maxRc;
|
||||||
inputValue = inputValue * ((rcExpo * absRc * absRc * absRc) + absRc * (1-rcExpo)); // absRc should be wrapped in function using expo power
|
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) { // Configurable in the future
|
||||||
|
expoPower = 3;
|
||||||
|
} else {
|
||||||
|
expoPower = 2;
|
||||||
|
}
|
||||||
|
inputValue = inputValue * Math.pow(absRc, expoPower) * rcExpo + inputValue * (1-rcExpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
var rcInput = inputValue / maxRc;
|
var rcInput = inputValue / maxRc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue