From f239b1bd9c904eca4ecdeabbc5879574abd2f3df Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-12PPI61\\boris.bozic" Date: Fri, 5 Aug 2016 12:39:43 +0200 Subject: [PATCH] Add tooltips and refactor --- _locales/en/messages.json | 34 +++++++++++++++------- js/fc.js | 4 +-- js/msp.js | 12 ++++---- tabs/pid_tuning.html | 61 ++++++++++++++++++++++++++++----------- tabs/pid_tuning.js | 12 ++++---- 5 files changed, 81 insertions(+), 42 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 6189252a..d8a1616f 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -791,29 +791,41 @@ "pidTuningPidSettings": { "message": "PID Controller Settings" }, - "pidTuningRcSmoothing": { - "message": "RC Smoothing" + "pidTuningRcInterpolationHelp": { + "message": "RC TX/RX systems are not as fast as PID loops. That means that PID loop has gaps in the information stream from RC systems. This option enables interpolation of the RC input during the times when no RC frames are received. The option also offers cleaner P and D behaviour as there are no ramps in control input." }, - "pidTuningRcSmoothingOff": { + "pidTuningRcInterpolationIntervalHelp": { + "message": "Interpolation interval for manual RC interpolation mode in milliseconds" + }, + "pidTuningRcInterpolation": { + "message": "RC Interpolation" + }, + "pidTuningRcInterpolationOff": { "message": "Off" }, - "pidTuningRcSmoothingDefault": { - "message": "Default" + "pidTuningRcInterpolationDefault": { + "message": "Preset" }, - "pidTuningRcSmoothingAuto": { + "pidTuningRcInterpolationAuto": { "message": "Auto" }, - "pidTuningRcSmoothingManual": { + "pidTuningRcInterpolationManual": { "message": "Manual" }, - "pidTuningRcSmoothingInterval": { - "message": "RC Smoothing Interval (ms)" + "pidTuningRcInterpolationInterval": { + "message": "RC Interpolating Interval (ms)" }, "pidTuningPtermSetpoint": { - "message": "Pterm Setpoint Weight" + "message": "P Setpoint Weight" }, "pidTuningDtermSetpoint": { - "message": "Dterm Setpoint Weight" + "message": "D Setpoint Weight" + }, + "pidTuningPtermSetpointHelp": { + "message": "This parameter determines the transient behaviour of P on abrupt stick moves. Lower value gives less overshoot and smoother behaviour, but too low values can slow down the response. Value of 1 equals to legacy pid controller" + }, + "pidTuningDtermSetpointHelp": { + "message": "This parameter determines the transient behaviour of D on stick inputs.
Value of 0 equals to old Measuemenent method where D only tracks gyro, while value of 1 equals to old Error method with equal gyro and stick tracking ratio.
Lower value equals to slower/smoother stick response, while higher value provides more stick acceleration response.
Note that RC interpolation is recommended to be enabled with higher values to prevent control kicks making noise" }, "pidTuningProportional": { "message": "Proportional" diff --git a/js/fc.js b/js/fc.js index b2786f51..88f0c382 100644 --- a/js/fc.js +++ b/js/fc.js @@ -295,8 +295,8 @@ var FC = { spektrum_sat_bind: 0, rx_min_usec: 0, rx_max_usec: 0, - rcSmoothing: 0, - rcSmoothInterval: 0, + rcInterpolation: 0, + rcInterpolationInterval:0, airModeActivateThreshold: 0 }; diff --git a/js/msp.js b/js/msp.js index 04f5e53f..73752c73 100755 --- a/js/msp.js +++ b/js/msp.js @@ -910,14 +910,14 @@ var MSP = { RX_CONFIG.rx_max_usec = data.getUint16(offset, 1); offset += 2; if (semver.gte(CONFIG.apiVersion, "1.20.0")) { - RX_CONFIG.rcSmoothing = data.getUint8(offset, 1); + RX_CONFIG.rcInterpolation = data.getUint8(offset, 1); offset++; - RX_CONFIG.rcSmoothInterval = data.getUint8(offset, 1); + RX_CONFIG.rcInterpolationInterval = data.getUint8(offset, 1); offset++; RX_CONFIG.airModeActivateThreshold = data.getUint16(offset, 1); } else { - RX_CONFIG.rcSmoothing = 0; - RX_CONFIG.rcSmoothInterval = 0; + RX_CONFIG.rcInterpolation = 0; + RX_CONFIG.rcInterpolationInterval = 0; RX_CONFIG.airModeActivateThreshold = 0; } break; @@ -1562,8 +1562,8 @@ MSP.crunch = function (code) { buffer.push(lowByte(RX_CONFIG.rx_max_usec)); buffer.push(highByte(RX_CONFIG.rx_max_usec)); if (semver.gte(CONFIG.apiVersion, "1.20.0")) { - buffer.push(RX_CONFIG.rcSmoothing); - buffer.push(RX_CONFIG.rcSmoothInterval); + buffer.push(RX_CONFIG.rcInterpolation); + buffer.push(RX_CONFIG.rcInterpolationInterval); buffer.push(lowByte(RX_CONFIG.airModeActivateThreshold)); buffer.push(highByte(RX_CONFIG.airModeActivateThreshold)); } diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html index 84b9c309..8f0a043d 100755 --- a/tabs/pid_tuning.html +++ b/tabs/pid_tuning.html @@ -250,21 +250,35 @@ - + - +