From 374c9cad9ec779037a98f4e5814f277dc0b01462 Mon Sep 17 00:00:00 2001 From: b14ckyy Date: Sun, 23 May 2021 11:20:41 +0200 Subject: [PATCH 1/2] updated FW Presets --- js/defaults_dialog.js | 1222 +++++++++++++++++++------------------- js/preset_definitions.js | 374 ++++++------ 2 files changed, 794 insertions(+), 802 deletions(-) diff --git a/js/defaults_dialog.js b/js/defaults_dialog.js index f06c7eaa..e16578a2 100644 --- a/js/defaults_dialog.js +++ b/js/defaults_dialog.js @@ -3,7 +3,7 @@ var helper = helper || {}; -helper.defaultsDialog = (function() { +helper.defaultsDialog = (function () { let publicScope = {}, privateScope = {}; @@ -11,614 +11,610 @@ helper.defaultsDialog = (function() { let $container; let data = [{ - "title": 'Mini Quad with 3"-7" propellers', - "notRecommended": false, - "reboot": true, - "settings": [ - /* - System - */ - { - key: "gyro_hardware_lpf", - value: "256HZ" - }, - { - key: "looptime", - value: 500 - }, - { - key: "motor_pwm_protocol", - value: "ONESHOT125" - }, - /* - Filtering - */ - { - key: "gyro_main_lpf_hz", - value: 110 - }, - { - key: "gyro_main_lpf_type", - value: "PT1" - }, - { - key: "dterm_lpf_hz", - value: 110 - }, - { - key: "dterm_lpf_type", - value: "PT1" - }, - { - key: "dterm_lpf2_hz", - value: 170 - }, - { - key: "dterm_lpf2_type", - value: "PT1" - }, - { - key: "dynamic_gyro_notch_enabled", - value: "ON" - }, - { - key: "dynamic_gyro_notch_q", - value: 250 - }, - { - key: "dynamic_gyro_notch_min_hz", - value: 120 - }, - { - key: "setpoint_kalman_enabled", - value: "ON" - }, - { - key: "setpoint_kalman_q", - value: 200 - }, - /* - Mechanics - */ - { - key: "airmode_type", - value: "THROTTLE_THRESHOLD" - }, - { - key: "mc_iterm_relax", - value: "RP" - }, - { - key: "d_boost_factor", - value: 1.5 - }, - { - key: "antigravity_gain", - value: 2 - }, - { - key: "antigravity_accelerator", - value: 5 - }, - /* - Rates - */ - { - key: "rc_yaw_expo", - value: 70 - }, - { - key: "rc_expo", - value: 70 - }, - { - key: "roll_rate", - value: 70 - }, - { - key: "pitch_rate", - value: 70 - }, - { - key: "yaw_rate", - value: 60 - }, - /* - PIDs - */ - { - key: "mc_p_pitch", - value: 44 - }, - { - key: "mc_i_pitch", - value: 75 - }, - { - key: "mc_d_pitch", - value: 25 - }, - { - key: "mc_p_roll", - value: 40 - }, - { - key: "mc_i_roll", - value: 60 - }, - { - key: "mc_d_roll", - value: 23 - }, - { - key: "mc_p_yaw", - value: 35 - }, - { - key: "mc_i_yaw", - value: 80 - }, - /* - * TPA - */ - { - key: "tpa_rate", - value: 20 - }, - { - key: "tpa_breakpoint", - value: 1200 - }, - { - key: "platform_type", - value: "MULTIROTOR" - }, - { - key: "applied_defaults", - value: 2 - } - ] - }, - { - "title": 'Airplane with a Tail', - "notRecommended": false, - "id": 3, - "reboot": true, - "settings": [ - { - key: "platform_type", - value: "AIRPLANE" - }, - { - key: "applied_defaults", - value: 3 - }, - { - key: "gyro_hardware_lpf", - value: "256HZ" - }, - { - key: "gyro_main_lpf_hz", - value: 25 - }, - { - key: "dterm_lpf_hz", - value: 40 - }, - { - key: "d_boost_factor", - value: 1 - }, - { - key: "gyro_main_lpf_type", - value: "BIQUAD" - }, - { - key: "dynamic_gyro_notch_enabled", - value: "ON" - }, - { - key: "dynamic_gyro_notch_q", - value: 250 - }, - { - key: "dynamic_gyro_notch_min_hz", - value: 30 - }, - { - key: "motor_pwm_protocol", - value: "STANDARD" - }, - { - key: "throttle_idle", - value: 5.0 - }, - { - key: "rc_yaw_expo", - value: 30 - }, - { - key: "rc_expo", - value: 30 - }, - { - key: "roll_rate", - value: 18 - }, - { - key: "pitch_rate", - value: 9 - }, - { - key: "yaw_rate", - value: 3 - }, - { - key: "nav_fw_pos_z_p", - value: 20 - }, - { - key: "nav_fw_pos_z_d", - value: 5 - }, - { - key: "nav_fw_pos_xy_p", - value: 50 - }, - { - key: "fw_turn_assist_pitch_gain", - value: 0.5 - }, - { - key: "max_angle_inclination_rll", - value: 350 - }, - { - key: "nav_fw_bank_angle", - value: 35 - }, - { - key: "fw_p_pitch", - value: 15 - }, - { - key: "fw_i_pitch", - value: 10 - }, - { - key: "fw_ff_pitch", - value: 60 - }, - { - key: "fw_p_roll", - value: 10 - }, - { - key: "fw_i_roll", - value: 8 - }, - { - key: "fw_ff_roll", - value: 40 - }, - { - key: "fw_p_yaw", - value: 20 - }, - { - key: "fw_i_yaw", - value: 5 - }, - { - key: "fw_ff_yaw", - value: 100 - }, - { - key: "imu_acc_ignore_rate", - value: 10 - }, - { - key: "airmode_type", - value: "STICK_CENTER_ONCE" - }, - { - key: "small_angle", - value: 180 - }, - { - key: "nav_fw_control_smoothness", - value: 2 - }, - { - key: "nav_rth_allow_landing", - value: "FS_ONLY" - }, - { - key: "nav_rth_altitude", - value: 5000 - }, - { - key: "failsafe_mission", - value: "ON" - }, - { - key: "nav_wp_radius", - value: 1500 - }, - ], - "features":[ - { - bit: 4, // Enable MOTOR_STOP - state: true - } - ] - }, - { - "title": 'Airplane without a Tail (Wing, Delta, etc)', - "notRecommended": false, - "id": 3, - "reboot": true, - "settings": [ - { - key: "platform_type", - value: "AIRPLANE" - }, - { - key: "applied_defaults", - value: 3 - }, - { - key: "gyro_hardware_lpf", - value: "256HZ" - }, - { - key: "gyro_main_lpf_hz", - value: 25 - }, - { - key: "dterm_lpf_hz", - value: 40 - }, - { - key: "d_boost_factor", - value: 1 - }, - { - key: "gyro_main_lpf_type", - value: "BIQUAD" - }, - { - key: "dynamic_gyro_notch_enabled", - value: "ON" - }, - { - key: "dynamic_gyro_notch_q", - value: 250 - }, - { - key: "dynamic_gyro_notch_min_hz", - value: 30 - }, - { - key: "motor_pwm_protocol", - value: "STANDARD" - }, - { - key: "throttle_idle", - value: 5.0 - }, - { - key: "rc_yaw_expo", - value: 30 - }, - { - key: "rc_expo", - value: 30 - }, - { - key: "roll_rate", - value: 18 - }, - { - key: "pitch_rate", - value: 9 - }, - { - key: "yaw_rate", - value: 3 - }, - { - key: "nav_fw_pos_z_p", - value: 20 - }, - { - key: "nav_fw_pos_z_d", - value: 5 - }, - { - key: "nav_fw_pos_xy_p", - value: 50 - }, - { - key: "fw_turn_assist_pitch_gain", - value: 0.2 - }, - { - key: "max_angle_inclination_rll", - value: 450 - }, - { - key: "nav_fw_bank_angle", - value: 45 - }, - { - key: "fw_p_pitch", - value: 10 - }, - { - key: "fw_i_pitch", - value: 15 - }, - { - key: "fw_ff_pitch", - value: 70 - }, - { - key: "fw_p_roll", - value: 5 - }, - { - key: "fw_i_roll", - value: 8 - }, - { - key: "fw_ff_roll", - value: 35 - }, - { - key: "fw_p_yaw", - value: 20 - }, - { - key: "fw_i_yaw", - value: 5 - }, - { - key: "fw_ff_yaw", - value: 100 - }, - { - key: "imu_acc_ignore_rate", - value: 10 - }, - { - key: "airmode_type", - value: "STICK_CENTER_ONCE" - }, - { - key: "small_angle", - value: 180 - }, - { - key: "nav_fw_control_smoothness", - value: 2 - }, - { - key: "nav_rth_allow_landing", - value: "FS_ONLY" - }, - { - key: "nav_rth_altitude", - value: 5000 - }, - { - key: "failsafe_mission", - value: "ON" - }, - { - key: "nav_wp_radius", - value: 1500 - }, - ], - "features":[ - { - bit: 4, // Enable MOTOR_STOP - state: true - } - ] - }, - { - "title": 'Rovers & Boats', - "notRecommended": false, - "reboot": true, - "settings": [ - { - key: "gyro_hardware_lpf", - value: "256HZ" - }, - { - key: "gyro_main_lpf_hz", - value: 10 - }, - { - key: "gyro_main_lpf_type", - value: "BIQUAD" - }, - { - key: "motor_pwm_protocol", - value: "STANDARD" - }, - { - key: "applied_defaults", - value: 1 - }, - { - key: "failsafe_procedure", - value: "DROP" - }, - { - key: "platform_type", - value: "ROVER" - }, - { - key: "nav_wp_safe_distance", - value: 50000 - }, - { - key: "nav_fw_loiter_radius", - value: 100 - }, - { - key: "nav_fw_yaw_deadband", - value: 5 - }, - { - key: "pidsum_limit_yaw", - value: 500 - }, - { - key: "nav_fw_pos_hdg_p", - value: 60 - }, - { - key: "nav_fw_pos_hdg_i", - value: 2 - }, - { - key: "nav_fw_pos_hdg_d", - value: 0 - } - ] - }, - { - "title": 'Custom UAV - INAV legacy defaults (Not recommended)', - "notRecommended": true, - "reboot": false, - "settings": [ - { - key: "motor_pwm_protocol", - value: "STANDARD" - }, - { - key: "applied_defaults", - value: 1 - } - ] - }, - { - "title": 'Keep current settings (Not recommended)', - "notRecommended": true, - "reboot": false, - "settings": [ - { - key: "applied_defaults", - value: 1 - } - ] - } + "title": 'Mini Quad with 3"-7" propellers', + "notRecommended": false, + "reboot": true, + "settings": [ + /* + System + */ + { + key: "gyro_hardware_lpf", + value: "256HZ" + }, + { + key: "looptime", + value: 500 + }, + { + key: "motor_pwm_protocol", + value: "ONESHOT125" + }, + /* + Filtering + */ + { + key: "gyro_main_lpf_hz", + value: 110 + }, + { + key: "gyro_main_lpf_type", + value: "PT1" + }, + { + key: "dterm_lpf_hz", + value: 110 + }, + { + key: "dterm_lpf_type", + value: "PT1" + }, + { + key: "dterm_lpf2_hz", + value: 170 + }, + { + key: "dterm_lpf2_type", + value: "PT1" + }, + { + key: "dynamic_gyro_notch_enabled", + value: "ON" + }, + { + key: "dynamic_gyro_notch_q", + value: 250 + }, + { + key: "dynamic_gyro_notch_min_hz", + value: 120 + }, + { + key: "setpoint_kalman_enabled", + value: "ON" + }, + { + key: "setpoint_kalman_q", + value: 200 + }, + /* + Mechanics + */ + { + key: "airmode_type", + value: "THROTTLE_THRESHOLD" + }, + { + key: "mc_iterm_relax", + value: "RP" + }, + { + key: "d_boost_factor", + value: 1.5 + }, + { + key: "antigravity_gain", + value: 2 + }, + { + key: "antigravity_accelerator", + value: 5 + }, + /* + Rates + */ + { + key: "rc_yaw_expo", + value: 70 + }, + { + key: "rc_expo", + value: 70 + }, + { + key: "roll_rate", + value: 70 + }, + { + key: "pitch_rate", + value: 70 + }, + { + key: "yaw_rate", + value: 60 + }, + /* + PIDs + */ + { + key: "mc_p_pitch", + value: 44 + }, + { + key: "mc_i_pitch", + value: 75 + }, + { + key: "mc_d_pitch", + value: 25 + }, + { + key: "mc_p_roll", + value: 40 + }, + { + key: "mc_i_roll", + value: 60 + }, + { + key: "mc_d_roll", + value: 23 + }, + { + key: "mc_p_yaw", + value: 35 + }, + { + key: "mc_i_yaw", + value: 80 + }, + /* + * TPA + */ + { + key: "tpa_rate", + value: 20 + }, + { + key: "tpa_breakpoint", + value: 1200 + }, + { + key: "platform_type", + value: "MULTIROTOR" + }, + { + key: "applied_defaults", + value: 2 + } + ] + }, + { + "title": 'Airplane with a Tail', + "notRecommended": false, + "id": 3, + "reboot": true, + "settings": [ + { + key: "platform_type", + value: "AIRPLANE" + }, + { + key: "applied_defaults", + value: 3 + }, + { + key: "gyro_hardware_lpf", + value: "256HZ" + }, + { + key: "gyro_main_lpf_hz", + value: 25 + }, + { + key: "dterm_lpf_hz", + value: 10 + }, + { + key: "d_boost_factor", + value: 1 + }, + { + key: "gyro_main_lpf_type", + value: "BIQUAD" + }, + { + key: "dynamic_gyro_notch_enabled", + value: "ON" + }, + { + key: "dynamic_gyro_notch_q", + value: 250 + }, + { + key: "dynamic_gyro_notch_min_hz", + value: 30 + }, + { + key: "motor_pwm_protocol", + value: "STANDARD" + }, + { + key: "throttle_idle", + value: 5.0 + }, + { + key: "rc_yaw_expo", + value: 30 + }, + { + key: "rc_expo", + value: 30 + }, + { + key: "roll_rate", + value: 18 + }, + { + key: "pitch_rate", + value: 9 + }, + { + key: "yaw_rate", + value: 3 + }, + { + key: "nav_fw_pos_z_p", + value: 20 + }, + { + key: "nav_fw_pos_z_d", + value: 5 + }, + { + key: "nav_fw_pos_xy_p", + value: 60 + }, + { + key: "fw_turn_assist_pitch_gain", + value: 0.5 + }, + { + key: "max_angle_inclination_rll", + value: 350 + }, + { + key: "nav_fw_bank_angle", + value: 35 + }, + { + key: "fw_p_pitch", + value: 15 + }, + { + key: "fw_i_pitch", + value: 10 + }, + { + key: "fw_ff_pitch", + value: 80 + }, + { + key: "fw_p_roll", + value: 10 + }, + { + key: "fw_i_roll", + value: 8 + }, + { + key: "fw_ff_roll", + value: 40 + }, + { + key: "fw_p_yaw", + value: 20 + }, + { + key: "fw_i_yaw", + value: 5 + }, + { + key: "fw_ff_yaw", + value: 100 + }, + { + key: "imu_acc_ignore_rate", + value: 8 + }, + { + key: "imu_acc_ignore_slope", + value: 5 + }, + { + key: "airmode_type", + value: "STICK_CENTER_ONCE" + }, + { + key: "small_angle", + value: 180 + }, + { + key: "nav_fw_control_smoothness", + value: 2 + }, + { + key: "nav_rth_allow_landing", + value: "FS_ONLY" + }, + { + key: "nav_rth_altitude", + value: 5000 + }, + { + key: "failsafe_mission", + value: "ON" + }, + { + key: "nav_wp_radius", + value: 1500 + }, + ], + "features": [ + { + bit: 4, // Enable MOTOR_STOP + state: true + } + ] + }, + { + "title": 'Airplane without a Tail (Wing, Delta, etc)', + "notRecommended": false, + "id": 3, + "reboot": true, + "settings": [ + { + key: "platform_type", + value: "AIRPLANE" + }, + { + key: "applied_defaults", + value: 3 + }, + { + key: "gyro_hardware_lpf", + value: "256HZ" + }, + { + key: "gyro_main_lpf_hz", + value: 25 + }, + { + key: "dterm_lpf_hz", + value: 10 + }, + { + key: "d_boost_factor", + value: 1 + }, + { + key: "gyro_main_lpf_type", + value: "BIQUAD" + }, + { + key: "dynamic_gyro_notch_enabled", + value: "ON" + }, + { + key: "dynamic_gyro_notch_q", + value: 250 + }, + { + key: "dynamic_gyro_notch_min_hz", + value: 30 + }, + { + key: "motor_pwm_protocol", + value: "STANDARD" + }, + { + key: "throttle_idle", + value: 5.0 + }, + { + key: "rc_yaw_expo", + value: 30 + }, + { + key: "rc_expo", + value: 30 + }, + { + key: "roll_rate", + value: 18 + }, + { + key: "pitch_rate", + value: 9 + }, + { + key: "yaw_rate", + value: 3 + }, + { + key: "nav_fw_pos_z_p", + value: 20 + }, + { + key: "nav_fw_pos_z_d", + value: 5 + }, + { + key: "nav_fw_pos_xy_p", + value: 60 + }, + { + key: "fw_turn_assist_pitch_gain", + value: 0.2 + }, + { + key: "max_angle_inclination_rll", + value: 450 + }, + { + key: "nav_fw_bank_angle", + value: 45 + }, + { + key: "fw_p_pitch", + value: 10 + }, + { + key: "fw_i_pitch", + value: 15 + }, + { + key: "fw_ff_pitch", + value: 70 + }, + { + key: "fw_p_roll", + value: 5 + }, + { + key: "fw_i_roll", + value: 8 + }, + { + key: "fw_ff_roll", + value: 35 + }, + { + key: "imu_acc_ignore_rate", + value: 8 + }, + { + key: "imu_acc_ignore_slope", + value: 5 + }, + { + key: "airmode_type", + value: "STICK_CENTER_ONCE" + }, + { + key: "small_angle", + value: 180 + }, + { + key: "nav_fw_control_smoothness", + value: 2 + }, + { + key: "nav_rth_allow_landing", + value: "FS_ONLY" + }, + { + key: "nav_rth_altitude", + value: 5000 + }, + { + key: "failsafe_mission", + value: "ON" + }, + { + key: "nav_wp_radius", + value: 1500 + }, + ], + "features": [ + { + bit: 4, // Enable MOTOR_STOP + state: true + } + ] + }, + { + "title": 'Rovers & Boats', + "notRecommended": false, + "reboot": true, + "settings": [ + { + key: "gyro_hardware_lpf", + value: "256HZ" + }, + { + key: "gyro_main_lpf_hz", + value: 10 + }, + { + key: "gyro_main_lpf_type", + value: "BIQUAD" + }, + { + key: "motor_pwm_protocol", + value: "STANDARD" + }, + { + key: "applied_defaults", + value: 1 + }, + { + key: "failsafe_procedure", + value: "DROP" + }, + { + key: "platform_type", + value: "ROVER" + }, + { + key: "nav_wp_safe_distance", + value: 50000 + }, + { + key: "nav_fw_loiter_radius", + value: 100 + }, + { + key: "nav_fw_yaw_deadband", + value: 5 + }, + { + key: "pidsum_limit_yaw", + value: 500 + }, + { + key: "nav_fw_pos_hdg_p", + value: 60 + }, + { + key: "nav_fw_pos_hdg_i", + value: 2 + }, + { + key: "nav_fw_pos_hdg_d", + value: 0 + } + ] + }, + { + "title": 'Custom UAV - INAV legacy defaults (Not recommended)', + "notRecommended": true, + "reboot": false, + "settings": [ + { + key: "motor_pwm_protocol", + value: "STANDARD" + }, + { + key: "applied_defaults", + value: 1 + } + ] + }, + { + "title": 'Keep current settings (Not recommended)', + "notRecommended": true, + "reboot": false, + "settings": [ + { + key: "applied_defaults", + value: 1 + } + ] + } ] - publicScope.init = function() { + publicScope.init = function () { mspHelper.getSetting("applied_defaults").then(privateScope.onInitSettingReturned); $container = $("#defaults-wrapper"); }; @@ -656,9 +652,9 @@ helper.defaultsDialog = (function() { mspHelper.saveToEeprom(function () { //noinspection JSUnresolvedVariable GUI.log(chrome.i18n.getMessage('configurationEepromSaved')); - + if (selectedDefaultPreset.reboot) { - GUI.tab_switch_cleanup(function() { + GUI.tab_switch_cleanup(function () { MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () { //noinspection JSUnresolvedVariable GUI.log(chrome.i18n.getMessage('deviceRebooting')); @@ -671,18 +667,18 @@ helper.defaultsDialog = (function() { }); }; - privateScope.onPresetClick = function(event) { + privateScope.onPresetClick = function (event) { $container.hide(); let selectedDefaultPreset = data[$(event.currentTarget).data("index")]; if (selectedDefaultPreset && selectedDefaultPreset.settings) { mspHelper.loadBfConfig(function () { - privateScope.setFeaturesBits(selectedDefaultPreset) + privateScope.setFeaturesBits(selectedDefaultPreset) }); } }; - privateScope.render = function() { + privateScope.render = function () { let $place = $container.find('.defaults-dialog__options'); $place.html(""); for (let i in data) { @@ -703,7 +699,7 @@ helper.defaultsDialog = (function() { } } - privateScope.onInitSettingReturned = function(promise) { + privateScope.onInitSettingReturned = function (promise) { if (promise.value > 0) { return; //Defaults were applied, we can just ignore } diff --git a/js/preset_definitions.js b/js/preset_definitions.js index 47de3465..b0681952 100644 --- a/js/preset_definitions.js +++ b/js/preset_definitions.js @@ -11,10 +11,10 @@ presets.elementHelper = function (group, field, value) { }; presets.defaultValues = { - INAV_PID_CONFIG: {"asynchronousMode": "0", "accelerometerTaskFrequency": 500, "attitudeTaskFrequency": 250, "magHoldRateLimit": 90, "magHoldErrorLpfFrequency": 2, "yawJumpPreventionLimit": 200, "gyroscopeLpf": "3", "accSoftLpfHz": 15}, - RC_tuning: {"RC_RATE": 1, "RC_EXPO": 0.7, "roll_pitch_rate": 0, "roll_rate": 200, "pitch_rate": 200, "yaw_rate": 200, "dynamic_THR_PID": 0, "throttle_MID": 0.5, "throttle_EXPO": 0, "dynamic_THR_breakpoint": 1500, "RC_YAW_EXPO": 0.2}, - PID_ADVANCED: {"rollPitchItermIgnoreRate": 200, "yawItermIgnoreRate": 50, "yawPLimit": 300, "axisAccelerationLimitRollPitch": 0, "axisAccelerationLimitYaw": 1000}, - FILTER_CONFIG: {"gyroSoftLpfHz": 60, "dtermLpfHz": 40, "yawLpfHz": 30, "gyroNotchHz1": 0, "gyroNotchCutoff1": 0, "dtermNotchHz": 0, "dtermNotchCutoff": 0, "gyroNotchHz2": 0, "gyroNotchCutoff2": 0, "accNotchHz": 0, "accNotchCutoff": 0, "gyroStage2LowpassHz": 0} + INAV_PID_CONFIG: { "asynchronousMode": "0", "accelerometerTaskFrequency": 500, "attitudeTaskFrequency": 250, "magHoldRateLimit": 90, "magHoldErrorLpfFrequency": 2, "yawJumpPreventionLimit": 200, "gyroscopeLpf": "3", "accSoftLpfHz": 15 }, + RC_tuning: { "RC_RATE": 1, "RC_EXPO": 0.7, "roll_pitch_rate": 0, "roll_rate": 200, "pitch_rate": 200, "yaw_rate": 200, "dynamic_THR_PID": 0, "throttle_MID": 0.5, "throttle_EXPO": 0, "dynamic_THR_breakpoint": 1500, "RC_YAW_EXPO": 0.2 }, + PID_ADVANCED: { "rollPitchItermIgnoreRate": 200, "yawItermIgnoreRate": 50, "yawPLimit": 300, "axisAccelerationLimitRollPitch": 0, "axisAccelerationLimitYaw": 1000 }, + FILTER_CONFIG: { "gyroSoftLpfHz": 60, "dtermLpfHz": 40, "yawLpfHz": 30, "gyroNotchHz1": 0, "gyroNotchCutoff1": 0, "dtermNotchHz": 0, "dtermNotchCutoff": 0, "gyroNotchHz2": 0, "gyroNotchCutoff2": 0, "accNotchHz": 0, "accNotchCutoff": 0, "gyroStage2LowpassHz": 0 } }; presets.settings = { @@ -26,7 +26,7 @@ presets.settings = { }, MR: { }, - get: function(mixerType) { + get: function (mixerType) { var settings = {}; $.extend(settings, presets.settings.COMMON); if (mixerType == 'multirotor') { @@ -942,344 +942,340 @@ presets.presets = [ ], type: 'multirotor' }, - { - name: 'Airplane with a tail', + { + name: 'Airplane with a tail', description: "General setup for airplanes with tails.", features: ["Adjusted gyro filtering", "Adjusted PIDs", "Adjusted rates"], applyDefaults: ["INAV_PID_CONFIG", "RC_tuning", "PID_ADVANCED", "FILTER_CONFIG"], settingsMSP: [], - type: 'airplane', + type: 'airplane', settings: [ - { + { key: "platform_type", value: "AIRPLANE" - }, - { + }, + { key: "applied_defaults", value: 3 - }, - { + }, + { key: "gyro_hardware_lpf", value: "256HZ" - }, - { + }, + { key: "gyro_main_lpf_hz", value: 25 - }, - { + }, + { key: "dterm_lpf_hz", - value: 40 - }, - { + value: 10 + }, + { key: "d_boost_factor", value: 1 - }, - { + }, + { key: "gyro_main_lpf_type", value: "BIQUAD" - }, - { + }, + { key: "dynamic_gyro_notch_enabled", value: "ON" - }, - { + }, + { key: "dynamic_gyro_notch_q", value: 250 - }, - { + }, + { key: "dynamic_gyro_notch_min_hz", value: 30 - }, - { + }, + { key: "motor_pwm_protocol", value: "STANDARD" - }, - { + }, + { key: "throttle_idle", value: 5.0 - }, - { + }, + { key: "rc_yaw_expo", value: 30 - }, - { + }, + { key: "rc_expo", value: 30 - }, - { + }, + { key: "roll_rate", value: 18 - }, - { + }, + { key: "pitch_rate", value: 9 - }, - { + }, + { key: "yaw_rate", value: 3 - }, - { + }, + { key: "nav_fw_pos_z_p", - value: 20 - }, - { + value: 20 + }, + { key: "nav_fw_pos_z_d", value: 5 - }, - { + }, + { key: "nav_fw_pos_xy_p", - value: 50 - }, - { + value: 60 + }, + { key: "fw_turn_assist_pitch_gain", value: 0.5 - }, - { + }, + { key: "max_angle_inclination_rll", value: 350 - }, - { + }, + { key: "nav_fw_bank_angle", value: 35 - }, - { + }, + { key: "fw_p_pitch", value: 15 - }, - { + }, + { key: "fw_i_pitch", value: 10 - }, - { + }, + { key: "fw_ff_pitch", - value: 60 - }, - { + value: 80 + }, + { key: "fw_p_roll", value: 10 - }, - { + }, + { key: "fw_i_roll", value: 8 - }, - { + }, + { key: "fw_ff_roll", value: 40 - }, - { + }, + { key: "fw_p_yaw", value: 20 - }, - { + }, + { key: "fw_i_yaw", value: 5 - }, - { + }, + { key: "fw_ff_yaw", value: 100 - }, - { + }, + { key: "imu_acc_ignore_rate", - value: 10 - }, - { + value: 8 + }, + { + key: "imu_acc_ignore_slope", + value: 5 + }, + { key: "airmode_type", value: "STICK_CENTER_ONCE" - }, - { + }, + { key: "small_angle", value: 180 - }, - { + }, + { key: "nav_fw_control_smoothness", value: 2 - }, - { + }, + { key: "nav_rth_allow_landing", value: "FS_ONLY" - }, - { + }, + { key: "nav_rth_altitude", value: 5000 - }, - { + }, + { key: "failsafe_mission", - value: "ON" - }, - { + value: "ON" + }, + { key: "nav_wp_radius", value: 1500 - }, - ], + }, + ], }, { name: "Airplane without tail", description: "General setup for airplanes without tails: Flying Wing, Delta, etc.", - features: ["Adjusted gyro filtering", "Adjusted PIDs", "Adjusted rates"], + features: ["Adjusted gyro filtering", "Adjusted PIDs", "Adjusted rates"], applyDefaults: ["INAV_PID_CONFIG", "RC_tuning", "PID_ADVANCED", "FILTER_CONFIG"], settingsMSP: [], - type: 'flyingwing', + type: 'flyingwing', settings: [ - { + { key: "platform_type", value: "AIRPLANE" - }, - { + }, + { key: "applied_defaults", value: 3 - }, - { + }, + { key: "gyro_hardware_lpf", value: "256HZ" - }, - { - key: "gyro_main_lpf_hz", - value: 25 - }, - { + }, + { + key: "gyro_main_lpf_hz", + value: 25 + }, + { key: "dterm_lpf_hz", - value: 40 - }, - { + value: 10 + }, + { key: "d_boost_factor", value: 1 - }, - { + }, + { key: "gyro_main_lpf_type", value: "BIQUAD" - }, - { + }, + { key: "dynamic_gyro_notch_enabled", value: "ON" - }, - { + }, + { key: "dynamic_gyro_notch_q", value: 250 - }, - { + }, + { key: "dynamic_gyro_notch_min_hz", value: 30 - }, - { + }, + { key: "motor_pwm_protocol", value: "STANDARD" - }, - { + }, + { key: "throttle_idle", value: 5.0 - }, - { + }, + { key: "rc_yaw_expo", value: 30 - }, - { + }, + { key: "rc_expo", value: 30 - }, - { + }, + { key: "roll_rate", value: 18 - }, - { + }, + { key: "pitch_rate", value: 9 - }, - { + }, + { key: "yaw_rate", value: 3 - }, - { + }, + { key: "nav_fw_pos_z_p", value: 20 - }, - { + }, + { key: "nav_fw_pos_z_d", value: 5 - }, - { + }, + { key: "nav_fw_pos_xy_p", - value: 50 - }, - { + value: 60 + }, + { key: "fw_turn_assist_pitch_gain", value: 0.2 - }, - { + }, + { key: "max_angle_inclination_rll", value: 450 - }, - { + }, + { key: "nav_fw_bank_angle", value: 45 - }, - { + }, + { key: "fw_p_pitch", value: 10 - }, - { + }, + { key: "fw_i_pitch", value: 15 - }, - { + }, + { key: "fw_ff_pitch", value: 70 - }, - { + }, + { key: "fw_p_roll", value: 5 - }, - { + }, + { key: "fw_i_roll", value: 8 - }, - { + }, + { key: "fw_ff_roll", value: 35 - }, - { - key: "fw_p_yaw", - value: 20 - }, - { - key: "fw_i_yaw", - value: 5 - }, - { - key: "fw_ff_yaw", - value: 100 - }, - { + }, + { key: "imu_acc_ignore_rate", - value: 10 - }, - { + value: 8 + }, + { + key: "imu_acc_ignore_slope", + value: 5 + }, + { key: "airmode_type", value: "STICK_CENTER_ONCE" - }, - { + }, + { key: "small_angle", value: 180 - }, - { + }, + { key: "nav_fw_control_smoothness", value: 2 - }, - { + }, + { key: "nav_rth_allow_landing", value: "FS_ONLY" - }, - { + }, + { key: "nav_rth_altitude", value: 5000 - }, - { + }, + { key: "failsafe_mission", value: "ON" - }, - { + }, + { key: "nav_wp_radius", value: 1500 - }, - ], + }, + ], }, ]; From 7e00e9bebf0b4cf121857af66d742071c8c3bb60 Mon Sep 17 00:00:00 2001 From: b14ckyy Date: Tue, 25 May 2021 19:48:44 +0200 Subject: [PATCH 2/2] slightly adaption for smaller wings --- js/defaults_dialog.js | 4 ++-- js/preset_definitions.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/defaults_dialog.js b/js/defaults_dialog.js index e16578a2..365d6935 100644 --- a/js/defaults_dialog.js +++ b/js/defaults_dialog.js @@ -315,7 +315,7 @@ helper.defaultsDialog = (function () { }, { key: "imu_acc_ignore_rate", - value: 8 + value: 9 }, { key: "imu_acc_ignore_slope", @@ -481,7 +481,7 @@ helper.defaultsDialog = (function () { }, { key: "imu_acc_ignore_rate", - value: 8 + value: 9 }, { key: "imu_acc_ignore_slope", diff --git a/js/preset_definitions.js b/js/preset_definitions.js index b0681952..be4e1542 100644 --- a/js/preset_definitions.js +++ b/js/preset_definitions.js @@ -1080,7 +1080,7 @@ presets.presets = [ }, { key: "imu_acc_ignore_rate", - value: 8 + value: 9 }, { key: "imu_acc_ignore_slope", @@ -1242,7 +1242,7 @@ presets.presets = [ }, { key: "imu_acc_ignore_rate", - value: 8 + value: 9 }, { key: "imu_acc_ignore_slope",