1
0
Fork 0
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:
U-DESKTOP-12PPI61\boris.bozic 2016-09-06 01:17:30 +02:00
parent 1da5219bf2
commit 25954b3d14

View file

@ -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;