mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 13:25:24 +03:00
Rc Rate accuracy old versions
This commit is contained in:
parent
25954b3d14
commit
15be4bb687
1 changed files with 11 additions and 7 deletions
|
@ -70,14 +70,18 @@ RateCurve.prototype.rcCommandRawToDegreesPerSecond = function (rcData, rate, rcR
|
|||
var inputValue = this.rcCommand(rcData, rcRate);
|
||||
var maxRc = 500 * rcRate;
|
||||
|
||||
if (rcExpo > 0) {
|
||||
var expoPower;
|
||||
var absRc = Math.abs(inputValue) / maxRc;
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) { // Configurable in the future
|
||||
var rcRateConstant;
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {
|
||||
expoPower = 3;
|
||||
rcRateConstant = 200;
|
||||
} else {
|
||||
expoPower = 2;
|
||||
rcRateConstant = 205.85;
|
||||
}
|
||||
|
||||
if (rcExpo > 0) {
|
||||
var absRc = Math.abs(inputValue) / maxRc;
|
||||
inputValue = inputValue * Math.pow(absRc, expoPower) * rcExpo + inputValue * (1-rcExpo);
|
||||
}
|
||||
|
||||
|
@ -85,7 +89,7 @@ RateCurve.prototype.rcCommandRawToDegreesPerSecond = function (rcData, rate, rcR
|
|||
|
||||
if (superExpoActive) {
|
||||
var rcFactor = 1 / this.constrain(1 - Math.abs(rcInput) * rate, 0.01, 1);
|
||||
angleRate = 200 * rcRate * rcInput; // 200 should be variable checked on version (older versions it's 205,9)
|
||||
angleRate = rcRateConstant * rcRate * rcInput; // 200 should be variable checked on version (older versions it's 205,9)
|
||||
angleRate = angleRate * rcFactor;
|
||||
} else {
|
||||
angleRate = (((rate * 100) + 27) * inputValue / 16) / 4.1; // Only applies to old versions ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue