diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 6c615f9f..46c48dea 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -567,6 +567,12 @@ "pidTuningRollPitchRate": { "message": "ROLL & PITCH rate" }, + "pidTuningRollRate": { + "message": "ROLL rate" + }, + "pidTuningPitchRate": { + "message": "PITCH rate" + }, "pidTuningYawRate": { "message": "YAW rate" }, diff --git a/js/backup_restore.js b/js/backup_restore.js index 1ebd146b..830ea458 100644 --- a/js/backup_restore.js +++ b/js/backup_restore.js @@ -314,7 +314,7 @@ function configuration_restore(callback) { GUI.log(chrome.i18n.getMessage('configMigratedTo', [migratedVersion])); appliedMigrationsCount++; } - + if (!compareVersions(migratedVersion, '0.61.0')) { // Changing PID controller via UI was added. @@ -330,6 +330,30 @@ function configuration_restore(callback) { appliedMigrationsCount++; } + if (!compareVersions(migratedVersion, '0.63.0')) { + + // Serial configuation redesigned. Until a migration is written just reset the serial port configuration + configuration.SERIAL_CONFIG = { + ports: [] + }; + + for (var profileIndex = 0; profileIndex < 3; profileIndex++) { + var RC = configuration.profiles[profileIndex].RC; + // TPA breakpoint was added + if (!RC.dynamic_THR_breakpoint) { + RC.dynamic_THR_breakpoint = 1500; // firmware default + } + + // Roll and pitch rates were split + RC.roll_rate = RC.roll_pitch_rate; + RC.pitch_rate = RC.roll_pitch_rate; + } + + migratedVersion = '0.63.0'; + GUI.log(chrome.i18n.getMessage('configMigratedTo', [migratedVersion])); + appliedMigrationsCount++; + } + GUI.log(chrome.i18n.getMessage('configMigrationSuccessful', [appliedMigrationsCount])); return true; } diff --git a/js/data_storage.js b/js/data_storage.js index d4123fa4..3a85dced 100755 --- a/js/data_storage.js +++ b/js/data_storage.js @@ -65,7 +65,9 @@ var RC = { var RC_tuning = { RC_RATE: 0, RC_EXPO: 0, - roll_pitch_rate: 0, + roll_pitch_rate: 0, // pre 1.7 api only + roll_rate: 0, + pitch_rate: 0, yaw_rate: 0, dynamic_THR_PID: 0, throttle_MID: 0, diff --git a/js/msp.js b/js/msp.js index e239bf67..48cdd423 100644 --- a/js/msp.js +++ b/js/msp.js @@ -288,14 +288,22 @@ var MSP = { ANALOG.amperage = data.getInt16(5, 1) / 100; // A break; case MSP_codes.MSP_RC_TUNING: - RC_tuning.RC_RATE = parseFloat((data.getUint8(0) / 100).toFixed(2)); - RC_tuning.RC_EXPO = parseFloat((data.getUint8(1) / 100).toFixed(2)); - RC_tuning.roll_pitch_rate = parseFloat((data.getUint8(2) / 100).toFixed(2)); - RC_tuning.yaw_rate = parseFloat((data.getUint8(3) / 100).toFixed(2)); - RC_tuning.dynamic_THR_PID = parseFloat((data.getUint8(4) / 100).toFixed(2)); - RC_tuning.throttle_MID = parseFloat((data.getUint8(5) / 100).toFixed(2)); - RC_tuning.throttle_EXPO = parseFloat((data.getUint8(6) / 100).toFixed(2)); - RC_tuning.dynamic_THR_breakpoint = parseInt(data.getUint16(7, 1)); + var offset = 0; + RC_tuning.RC_RATE = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + RC_tuning.RC_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + if (CONFIG.apiVersion < 1.7) { + RC_tuning.roll_pitch_rate = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + } else { + RC_tuning.roll_rate = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + RC_tuning.pitch_rate = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + } + RC_tuning.yaw_rate = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + RC_tuning.dynamic_THR_PID = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + RC_tuning.throttle_MID = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + RC_tuning.throttle_EXPO = parseFloat((data.getUint8(offset++) / 100).toFixed(2)); + if (CONFIG.apiVersion >= 1.7) { + RC_tuning.dynamic_THR_breakpoint = data.getUint16(offset++, 1); + } break; case MSP_codes.MSP_PID: // PID data arrived, we need to scale it and save to appropriate bank / array @@ -913,13 +921,20 @@ MSP.crunch = function (code) { case MSP_codes.MSP_SET_RC_TUNING: buffer.push(parseInt(RC_tuning.RC_RATE * 100)); buffer.push(parseInt(RC_tuning.RC_EXPO * 100)); - buffer.push(parseInt(RC_tuning.roll_pitch_rate * 100)); + if (CONFIG.apiVersion < 1.7) { + buffer.push(parseInt(RC_tuning.roll_pitch_rate * 100)); + } else { + buffer.push(parseInt(RC_tuning.roll_rate * 100)); + buffer.push(parseInt(RC_tuning.pitch_rate * 100)); + } buffer.push(parseInt(RC_tuning.yaw_rate * 100)); buffer.push(parseInt(RC_tuning.dynamic_THR_PID * 100)); buffer.push(parseInt(RC_tuning.throttle_MID * 100)); buffer.push(parseInt(RC_tuning.throttle_EXPO * 100)); - buffer.push(lowByte(RC_tuning.dynamic_THR_breakpoint)); - buffer.push(highByte(RC_tuning.dynamic_THR_breakpoint)); + if (CONFIG.apiVersion >= 1.7) { + buffer.push(lowByte(RC_tuning.dynamic_THR_breakpoint)); + buffer.push(highByte(RC_tuning.dynamic_THR_breakpoint)); + } break; // Disabled, cleanflight does not use MSP_SET_BOX. /* diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html index 9a3e49ed..f20f5fec 100755 --- a/tabs/pid_tuning.html +++ b/tabs/pid_tuning.html @@ -79,18 +79,26 @@
- | - | - | - | ||
---|---|---|---|---|---|
- | - | - | - | ||
+ | + | + | + | + | + |
+ | + | + | + | + | + |