Merge remote-tracking branch 'origin/master' into sh_mixer_profile

pull/1848/head
shota 11 months ago
commit 0a9e1693a4

@ -110,6 +110,9 @@
"tabFailsafe": {
"message": "Failsafe"
},
"tabEzTune": {
"message": "Ez Tune"
},
"tabGPS": {
"message": "GPS"
},
@ -3386,6 +3389,15 @@
"osd_pilot_name": {
"message": "Pilot's Name"
},
"osdElement_PILOT_LOGO_HELP": {
"message": "Shows your small pilot logo in the OSD, where you position it. This requires a custom font with your pilot logo."
},
"osd_use_pilot_logo": {
"message": "Use pilot logo"
},
"osd_use_large_pilot_logo_help": {
"message": "Use your large pilot logo with/instead of the INAV logo. This requires a custom font with your pilot logo. This is seen on the arming screen."
},
"osd_units": {
"message": "Units"
},
@ -5501,5 +5513,77 @@
},
"timerOutputs": {
"message": "Timer outputs"
},
"ezTuneFilterHz": {
"message": "Filter Hz"
},
"ezTuneAxisRatio": {
"message": "Axis ratio"
},
"ezTuneResponse": {
"message": "Response"
},
"ezTuneDamping": {
"message": "Damping"
},
"ezTuneStability": {
"message": "Stability"
},
"ezTuneAggressiveness": {
"message": "Aggressiveness"
},
"ezTuneRate": {
"message": "Rate"
},
"ezTuneExpo": {
"message": "Expo"
},
"ezTuneFilterHzTips": {
"message": "This sets the base cutoff frequency for all INAV gyro and D-term filters. Higher values will result in lower filter delay and better stabilization, but more noise will go through the filters and motors will get hot, UAV might oscillate and be unfyable. Your goal is to increase this value as high as possible before any negative effects appear. Negative effects include: hot motors, audible osciallations, UAV rapidly shaking, UAV gaining altitude by itself. Usual starting points for 'Filter Hz' are: <strong>3-inch props</strong>: 90, <strong>5-inch props</strong>: 110, <strong>7-inch props</strong>: 90, <strong>10-inch props</strong>: 75, <strong>12-inch props</strong>: 60. Use Blackbox and common sense to find a value that is most suited for your UAV."
},
"ezTuneAxisRatioTips": {
"message": "Describes the weight/moment of inertia distribution of your UAV. The longer the frame (more mass on the front-back axis) more Axis Ratio is requires. Perfect X frame is ratio 100. Most modern frames should fit somewhere between 110 and 130. Default 110 is a good starting point."
},
"ezTuneResponseTips": {
"message": "This setting defines how fast the UAV will react to stick movements and gyro signal. Higher values will result in faster reaction, but also in more overshoots and oscillations. If UAV feels sluggish or has a slow wobble, increase the Response. If it has hot motors, audibly osciallates, overshoots or feels too nervous, decrease the Response. Most modern quads should beefy motors will fly best with Response below 80. Should be tuned together with Damping. It is a P-term equivalent."
},
"ezTuneDampingTips": {
"message": "Describes the stengths of a force that opposes any rotation speed change. It dampens roll and pitch acceleration and causes smoother and more stable flight. Your task during tuning is to find out how much you can increase it before any negative symptoms appear: hot motors, audible osciallations, overshoot. Most modern quads should accept 'Damping' up to 150-180. It is a D-term equivalent."
},
"ezTuneStabilityTips": {
"message": "Defines long-term stabilization strength. Most modern quads should tolerate 'Stability' even up to 120-130. Usually does not have to be tuned at all. If UAV suffers from heavy propwash during vertical descent, lowering 'Stability' might help. It is a I-term equivalent"
},
"ezTuneAggressivenessTips": {
"message": "Defines how fast your UAV will react to fast stick movements. Higher 'Aggressiveness' results in snappier fast manouvers. It does not affect stabilization, only stick feeling. It is a FF-term equivalent."
},
"ezTuneRateTips": {
"message": "Defines how fast your UAV will rotate around roll, pitch and yaw axis. Higher 'Rate' results in faster rotation. Value of 0 is the equivalent of 300dps, 100 is the equivalent of 600dps, 200 is the equivalent of 900dps."
},
"ezTuneExpoTips": {
"message": "Defines expo of the RC input. Lower values result in more sensitive stick in the center. Higher values result in less sensitive center and more rapid response at the end of the stick. Value of 0 is the equivalent of 0 expo, 100 is the equivalent of 0.7 expo, 200 is the equivalent of 1.0 expo."
},
"ezTunePidPreview": {
"message": "PID preview"
},
"ezTuneRatePreview": {
"message": "Rate preview"
},
"ezTuneRatePreviewAxis" : {
"message": "Axis"
},
"ezTuneRatePreviewRate" : {
"message": "Rate"
},
"ezTuneRatePreviewExpo" : {
"message": "Expo"
},
"ezTuneEnabledTips": {
"message": "When enabled, <strong>Ez Tune</strong> will override multiple INAV setting to simplify the tuning process. Instead of setting each PID and filtering setting independently, you only have to work with 7 sliders. Ez Tune will automatically adjust all other settings to match your needs. Ez Tune is a great starting point for new users and a great way to quickly tune a new UAV. It is not recommended to use Ez Tune on advanced builds, as it will override all your settings and you will not be able to fine tune your UAV. When Ez Tune is enabled, settings from the <strong>PID tuning</strong> tab will be overriden by EzTune."
},
"ezTuneDisclaimer": {
"message": "<strong>Disclaimer:</strong> Ez Tune is an experimental function. It is not guaranteed to work on all UAVs. It is not guaranteed to work with all frame types. It is not guaranteed to work with all propellers. All computations and tuning result can change in future versions of INAV. We still encourage you to check it out and share your experience on INAV Discord in the <strong>#ez-tune</strong> channel"
},
"ezTuneNote": {
"message": "<strong>Important</strong> Ez Tune is enabled. All settings on this tab are set and controlled by the Ez Tune. To use PID Tuning tab you have to disable Ez Tune. To do it, uncheck the <strong>Enabled</strong> checkbox on the Ez Tune tab."
}
}
}

@ -126,6 +126,7 @@ sources.js = [
'./js/serial_queue.js',
'./js/msp_balanced_interval.js',
'./tabs/advanced_tuning.js',
'./tabs/ez_tune.js',
'./js/peripherals.js',
'./js/appUpdater.js',
'./js/feature_framework.js',

@ -552,6 +552,18 @@ var FC = {
weightCenter: null,
weightEnd: null
};
EZ_TUNE = {
enabled: null,
filterHz: null,
axisRatio: null,
response: null,
damping: null,
stability: null,
aggressiveness: null,
rate: null,
expo: null
};
},
getOutputUsages: function() {
return {

@ -41,7 +41,8 @@ var GUI_control = function () {
'advanced_tuning',
'mission_control',
'mixer',
'programming'
'programming',
'ez_tune'
];
this.allowedTabs = this.defaultAllowedTabsWhenDisconnected;
@ -456,6 +457,7 @@ GUI_control.prototype.sliderize = function ($input, value, min, max) {
}
$input.val(val);
$input.trigger('updated');
});
$input.on('change', function() {
@ -474,6 +476,7 @@ GUI_control.prototype.sliderize = function ($input, value, min, max) {
}
$range.val(newVal);
$input.trigger('updated');
});
$input.trigger('change');

@ -242,5 +242,8 @@ var MSPCodes = {
MSP2_INAV_RATE_DYNAMICS: 0x2060,
MSP2_INAV_SET_RATE_DYNAMICS: 0x2061,
MSP2_INAV_SELECT_MIXER_PROFILE: 0x2070
MSP2_INAV_EZ_TUNE: 0x2070,
MSP2_INAV_EZ_TUNE_SET: 0x2071,
MSP2_INAV_SELECT_MIXER_PROFILE: 0x2080
};

@ -1573,6 +1573,22 @@ var mspHelper = (function (gui) {
console.log('Rate dynamics saved');
break;
case MSPCodes.MSP2_INAV_EZ_TUNE:
EZ_TUNE.enabled = data.getUint8(0);
EZ_TUNE.filterHz = data.getUint16(1, true);
EZ_TUNE.axisRatio = data.getUint8(3);
EZ_TUNE.response = data.getUint8(4);
EZ_TUNE.damping = data.getUint8(5);
EZ_TUNE.stability = data.getUint8(6);
EZ_TUNE.aggressiveness = data.getUint8(7);
EZ_TUNE.rate = data.getUint8(8);
EZ_TUNE.expo = data.getUint8(9);
break;
case MSPCodes.MSP2_INAV_EZ_TUNE_SET:
console.log('EzTune settings saved');
break;
default:
console.log('Unknown code detected: ' + dataHandler.code);
} else {
@ -2209,6 +2225,22 @@ var mspHelper = (function (gui) {
buffer.push(RATE_DYNAMICS.weightEnd);
break;
case MSPCodes.MSP2_INAV_EZ_TUNE_SET:
buffer.push(EZ_TUNE.enabled);
buffer.push(lowByte(EZ_TUNE.filterHz));
buffer.push(highByte(EZ_TUNE.filterHz));
buffer.push(EZ_TUNE.axisRatio);
buffer.push(EZ_TUNE.response);
buffer.push(EZ_TUNE.damping);
buffer.push(EZ_TUNE.stability);
buffer.push(EZ_TUNE.aggressiveness);
buffer.push(EZ_TUNE.rate);
buffer.push(EZ_TUNE.expo);
console.log(buffer);
break;
default:
return false;
}
@ -3411,6 +3443,14 @@ var mspHelper = (function (gui) {
MSP.send_message(MSPCodes.MSP2_INAV_SET_RATE_DYNAMICS, mspHelper.crunch(MSPCodes.MSP2_INAV_SET_RATE_DYNAMICS), false, callback);
}
self.loadEzTune = function (callback) {
MSP.send_message(MSPCodes.MSP2_INAV_EZ_TUNE, false, false, callback);
}
self.saveEzTune = function (callback) {
MSP.send_message(MSPCodes.MSP2_INAV_EZ_TUNE_SET, mspHelper.crunch(MSPCodes.MSP2_INAV_EZ_TUNE_SET), false, callback);
}
self.loadParameterGroups = function (callback) {
MSP.send_message(MSPCodes.MSP2_COMMON_PG_LIST, false, false, function (resp) {
var groups = [];

@ -1643,7 +1643,7 @@ dialog {
/* fixing padding for all Tabs*/
.tab-setup, .tab-landing, .tab-adjustments, .tab-auxiliary, .tab-cli, .tab-configuration, .tab-failsafe, .tab-onboard_logging,
.tab-firmware_flasher, .tab-gps, .tab-magnetometer, .tab-help, .tab-led-strip, .tab-logging, .tab-modes, .tab-motors, .tab-pid_tuning,
.tab-ports, .tab-receiver, .tab-sensors, .tab-servos, .tab-osd, .tab-calibration {
.tab-ports, .tab-receiver, .tab-sensors, .tab-servos, .tab-osd, .tab-calibration, .tab-ez_tune {
height: 100%;
position: relative;
}
@ -2287,4 +2287,8 @@ ol li {
.no-border {
border: none !important;
}
.bold {
font-weight: bold;
}

@ -215,6 +215,9 @@
<li class="tab_failsafe">
<a href="#" data-i18n="tabFailsafe" class="tabicon ic_failsafe" title="Failsafe"></a>
</li>
<li class="tab_ez_tune">
<a href="#" data-i18n="tabEzTune" class="tabicon ic_wizzard"></a>
</li>
<li class="tab_pid_tuning">
<a href="#" data-i18n="tabPidTuning" class="tabicon ic_pid" title="PID Tuning"></a>
</li>
@ -261,8 +264,7 @@
<a href="#" data-i18n="tabCLI" class="tabicon ic_cli" title="CLI"></a>
</li>
<!--<li class=""><a href="#" class="tabicon ic_advanced">Advanced (spare icon)</a></li>-->
<!--<li class=""><a href="#" class="tabicon ic_wizzard">Wizzard (spare icon)</a></li>-->
<!-- <li class=""><a href="#" class="tabicon ic_advanced">Advanced (spare icon)</a></li> -->
</ul>
</div>
<div class="clear-both"></div>

@ -301,6 +301,9 @@ $(document).ready(function () {
case 'cli':
TABS.cli.initialize(content_ready);
break;
case 'ez_tune':
TABS.ez_tune.initialize(content_ready);
break;
default:
console.log('Tab not found:' + tab);

@ -324,5 +324,7 @@
| ![Pan centred](/resources/osd/digital/default/24x36/454.png) | SYM_SERVO_PAN_IS_CENTRED | | Pan servo is centred | 454 | 0x1C6 |
| ![Pan Left](/resources/osd/digital/default/24x36/455.png) | SYM_SERVO_PAN_IS_OFFSET_L | SYM.PAN_SERVO_IS_OFFSET_L | Pan servo is moved to the left | 455 | 0x1C7 |
| ![Pan Right](/resources/osd/digital/default/24x36/456.png) | SYM_SERVO_PAN_IS_OFFSET_R | | Pan servo is moved to the right | 456 | 0x1C8 |
| ![Pilot Logo S](/resources/osd/digital/default/24x36/469_471.png) | SYM_PILOT_LOGO_SML_L | SYM.PILOT_LOGO_SML_L | Small Pilot logo | 469 - 471 | 0x1D5 - 0x1D7 |
| ![Pilot Logo L](/resources/osd/digital/default/24x36/472_511.png) | SYM_PILOT_LOGO_LRG_START | | Large Pilot logo | 472 - 511 | 0x1D5 - 0x1D7 |
_*_ Do not change the IDs of these characters

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@ -0,0 +1,32 @@
.ez-tune-preview {
background-color: #8ecae6;
margin-left: 1em;
margin-bottom: 1em;
min-width: 25%;
padding: 0.5em;
}
.ez-tune-preview h2 {
font-size: 1.3em;
margin-bottom: 1em;
margin-top: 0.5em;
color: #303030
}
.ez-tune-preview table {
width: 100%;
}
.ez-tune-preview table td,
.ez-tune-preview table th {
padding: 0.5em;
text-align: center;
}
.ez-tune-preview table th {
background-color: #3EA5D4;
}
.ez-tune-preview table td {
background-color: #A8D6EC;
}

@ -401,18 +401,21 @@
/* background: #D6D6D6 linear-gradient(-45deg, rgba(255, 255, 255, .2) 10%, transparent 10%, transparent 20%, rgba(255, 255, 255, .2) 20%, rgba(255, 255, 255, .2) 30%, transparent 30%, transparent 40%, rgba(255, 255, 255, .2) 40%, rgba(255, 255, 255, .2) 50%, transparent 50%, transparent 60%, rgba(255, 255, 255, .2) 60%, rgba(255, 255, 255, .2) 70%, transparent 70%, transparent 80%, rgba(255, 255, 255, .2) 80%, rgba(255, 255, 255, .2) 90%, transparent 90%, transparent 100%, rgba(255, 255, 255, .2) 100%, transparent); */
}
.pid-slider-row {
.pid-slider-row,
.pid-switch-row {
display: flex;
padding: 4px;
}
.pid-slider-row span {
.pid-slider-row span,
.pid-switch-row .label {
margin-right: 2em;
width: 120px;
line-height: 22px;;
}
.pid-slider-row input[type="number"] {
.pid-slider-row input[type="number"],
.pid-switch-row input[type="number"] {
font-family: 'open_sansregular', 'Segoe UI', Tahoma, sans-serif;
background-color: #fff;
border: 1px solid #ccc;
@ -422,7 +425,9 @@
margin-right: 2em;
}
.pid-slider-row input[type="range"] {
.pid-slider-row input[type="range"],
.pid-switch-row input[type="range"]
{
display: block;
flex-grow: 100;
}
@ -436,18 +441,28 @@
padding: 4px;
}
.pid-sliders-axis[data-axis="roll"] {
.pid-sliders-axis[data-axis="roll"],
.pid-sliders-axis[data-axis="0"] {
background-color: #8ecae6;
}
.pid-sliders-axis[data-axis="pitch"] {
.pid-sliders-axis[data-axis="pitch"],
.pid-sliders-axis[data-axis="1"]
{
background-color: #00b4d8;
}
.pid-sliders-axis[data-axis="yaw"] {
.pid-sliders-axis[data-axis="yaw"],
.pid-sliders-axis[data-axis="2"]
{
background-color: #e9c46a;
}
.pid-sliders-axis[data-axis="3"]
{
background-color: #f4a261;
}
#pid-sliders {
margin-bottom: 1em;
}

@ -0,0 +1,175 @@
<!--suppress ALL -->
<div id="content-watermark"></div>
<div class="tab-ez_tune toolbar_fixed_bottom">
<div class="content_wrapper">
<div class="tab_title" data-i18n="tabEzTune"></div>
<div class="note spacebottom">
<div class="note_spacer">
<p i18n="ezTuneDisclaimer"></p>
</div>
</div>
<div class="clear-both"></div>
<div style="display: flex;">
<div>
<div class="pid-sliders-axis" style="background-color: #2a9d8f;">
<div style="padding: 1em;" data-i18n="ezTuneEnabledTips"></div>
<div class="pid-switch-row">
<span data-i18n="configurationFeatureEnabled" class="bold label"></span>
<div class="checkbox no-border">
<input id="ez_tune_enabled" type="checkbox" class="ez-element toggle" />
</div>
</div>
<div class="clear-both"></div>
</div>
<div class="pid-sliders-axis" data-axis="roll">
<div style="padding: 1em;" data-i18n="ezTuneFilterHzTips"></div>
<div class="pid-slider-row">
<span data-i18n="ezTuneFilterHz" class="bold"></span>
<div class="number no-border">
<input id="ez_tune_filter_hz" type="number" class="ez-element" />
</div>
</div>
<div class="clear-both"></div>
</div>
<div class="pid-sliders-axis" data-axis="pitch">
<div style="padding: 1em;" data-i18n="ezTuneAxisRatioTips"></div>
<div class="pid-slider-row">
<span data-i18n="ezTuneAxisRatio" class="bold"></span>
<div class="number no-border">
<input id="ez_tune_axis_ratio" type="number" class="ez-element" />
</div>
<div class="clear-both"></div>
</div>
<div style="padding: 1em;" data-i18n="ezTuneResponseTips"></div>
<div class="pid-slider-row">
<span data-i18n="ezTuneResponse" class="bold"></span>
<div class="number no-border">
<input id="ez_tune_response" type="number" class="ez-element" />
</div>
<div class="clear-both"></div>
</div>
<div style="padding: 1em;" data-i18n="ezTuneDampingTips"></div>
<div class="pid-slider-row">
<span data-i18n="ezTuneDamping" class="bold"></span>
<div class="number no-border">
<input id="ez_tune_damping" type="number" class="ez-element" />
</div>
<div class="clear-both"></div>
</div>
<div style="padding: 1em;" data-i18n="ezTuneStabilityTips"></div>
<div class="pid-slider-row">
<span data-i18n="ezTuneStability" class="bold"></span>
<div class="number no-border">
<input id="ez_tune_stability" type="number" class="ez-element" />
</div>
<div class="clear-both"></div>
</div>
<div style="padding: 1em;" data-i18n="ezTuneAggressivenessTips"></div>
<div class="pid-slider-row">
<span data-i18n="ezTuneAggressiveness" class="bold"></span>
<div class="number no-border">
<input id="ez_tune_aggressiveness" type="number" class="ez-element" />
</div>
<div class="clear-both"></div>
</div>
</div>
<div class="pid-sliders-axis" data-axis="yaw">
<div style="padding: 1em;" data-i18n="ezTuneRateTips"></div>
<div class="pid-slider-row">
<span data-i18n="ezTuneRate" class="bold"></span>
<div class="number no-border">
<input id="ez_tune_rate" type="number" class="ez-element" />
</div>
<div class="clear-both"></div>
</div>
<div style="padding: 1em;" data-i18n="ezTuneExpoTips"></div>
<div class="pid-slider-row">
<span data-i18n="ezTuneExpo" class="bold"></span>
<div class="number no-border">
<input id="ez_tune_expo" type="number" class="ez-element" />
</div>
<div class="clear-both"></div>
</div>
</div>
</div>
<div class="ez-tune-preview">
<h2 data-i18n="ezTunePidPreview"></h2>
<table>
<tr>
<th>&nbsp;</th>
<th>P</th>
<th>I</th>
<th>D</th>
<th>FF</th>
</tr>
<tr>
<th data-i18n="axisRoll"></th>
<td id="preview-roll-p"></td>
<td id="preview-roll-i"></td>
<td id="preview-roll-d"></td>
<td id="preview-roll-ff"></td>
</tr>
<tr>
<th data-i18n="axisPitch"></th>
<td id="preview-pitch-p"></td>
<td id="preview-pitch-i"></td>
<td id="preview-pitch-d"></td>
<td id="preview-pitch-ff"></td>
</tr>
<tr>
<th data-i18n="axisYaw"></th>
<td id="preview-yaw-p"></td>
<td id="preview-yaw-i"></td>
<td id="preview-yaw-d"></td>
<td id="preview-yaw-ff"></td>
</tr>
</table>
<h2 data-i18n="ezTuneRatePreview"></h2>
<table>
<tr>
<th data-i18n="ezTuneRatePreviewAxis"></th>
<th data-i18n="ezTuneRatePreviewRate"></th>
<th data-i18n="ezTuneRatePreviewExpo"></th>
</tr>
<tr>
<th data-i18n="axisRoll"></th>
<td id="preview-roll-rate"></td>
<td id="preview-roll-expo"></td>
</tr>
<tr>
<th data-i18n="axisPitch"></th>
<td id="preview-pitch-rate"></td>
<td id="preview-pitch-expo"></td>
</tr>
<tr>
<th data-i18n="axisYaw"></th>
<td id="preview-yaw-rate"></td>
<td id="preview-yaw-expo"></td>
</tr>
</table>
</div>
</div>
<div class="clear-both"></div>
</div>
<div class="clear-both"></div>
<div class="content_toolbar">
<div class="btn save_btn">
<a class="update" href="#" data-i18n="pidTuning_ButtonSave"></a>
</div>
</div>
</div>

@ -0,0 +1,161 @@
/*global chrome,helper,mspHelper*/
'use strict';
TABS.ez_tune = {
};
TABS.ez_tune.initialize = function (callback) {
let loadChainer = new MSPChainerClass();
let loadChain = [
mspHelper.loadEzTune,
];
let EZ_TUNE_PID_RP_DEFAULT = [40, 75, 23, 100];
let EZ_TUNE_PID_YAW_DEFAULT = [45, 80, 0, 100];
loadChain.push(mspHelper.loadRateProfileData);
loadChainer.setChain(loadChain);
loadChainer.setExitPoint(load_html);
loadChainer.execute();
var saveChainer = new MSPChainerClass();
var saveChain = [
mspHelper.saveEzTune,
mspHelper.saveToEeprom
];
saveChainer.setChain(saveChain);
saveChainer.setExitPoint(reboot);
function reboot() {
//noinspection JSUnresolvedVariable
GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
GUI.tab_switch_cleanup(function () {
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, reinitialize);
});
}
function reinitialize() {
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
GUI.handleReconnect($('.tab_ez_tune a'));
}
if (GUI.active_tab != 'ez_tune') {
GUI.active_tab = 'ez_tune';
googleAnalytics.sendAppView('Ez Tune');
}
function load_html() {
GUI.load("./tabs/ez_tune.html", Settings.processHtml(process_html));
}
function getYawPidScale(input) {
const normalized = (input - 100) * 0.01;
return 1.0 + (normalized * 0.5);
}
function scaleRange(x, srcMin, srcMax, destMin, destMax) {
let a = (destMax - destMin) * (x - srcMin);
let b = srcMax - srcMin;
return ((a / b) + destMin);
}
function updatePreview() {
let axisRatio = $('#ez_tune_axis_ratio').val() / 100;
let response = $('#ez_tune_response').val();
let damping = $('#ez_tune_damping').val();
let stability = $('#ez_tune_stability').val();
let aggressiveness = $('#ez_tune_aggressiveness').val();
let rate = $('#ez_tune_rate').val();
let expo = $('#ez_tune_expo').val();
$('#preview-roll-p').html(Math.floor(EZ_TUNE_PID_RP_DEFAULT[0] * response / 100));
$('#preview-roll-i').html(Math.floor(EZ_TUNE_PID_RP_DEFAULT[1] * stability / 100));
$('#preview-roll-d').html(Math.floor(EZ_TUNE_PID_RP_DEFAULT[2] * damping / 100));
$('#preview-roll-ff').html(Math.floor(EZ_TUNE_PID_RP_DEFAULT[3] * aggressiveness / 100));
$('#preview-pitch-p').html(Math.floor(axisRatio * EZ_TUNE_PID_RP_DEFAULT[0] * response / 100));
$('#preview-pitch-i').html(Math.floor(axisRatio * EZ_TUNE_PID_RP_DEFAULT[1] * stability / 100));
$('#preview-pitch-d').html(Math.floor(axisRatio * EZ_TUNE_PID_RP_DEFAULT[2] * damping / 100));
$('#preview-pitch-ff').html(Math.floor(axisRatio * EZ_TUNE_PID_RP_DEFAULT[3] * aggressiveness / 100));
$('#preview-yaw-p').html(Math.floor(EZ_TUNE_PID_YAW_DEFAULT[0] * getYawPidScale(response)));
$('#preview-yaw-i').html(Math.floor(EZ_TUNE_PID_YAW_DEFAULT[1] * getYawPidScale(stability)));
$('#preview-yaw-d').html(Math.floor(EZ_TUNE_PID_YAW_DEFAULT[2] * getYawPidScale(damping)));
$('#preview-yaw-ff').html(Math.floor(EZ_TUNE_PID_YAW_DEFAULT[3] * getYawPidScale(aggressiveness)));
$('#preview-roll-rate').html(Math.floor(scaleRange(rate, 0, 200, 30, 90)) * 10 + " dps");
$('#preview-pitch-rate').html(Math.floor(scaleRange(rate, 0, 200, 30, 90)) * 10 + " dps");
$('#preview-yaw-rate').html((Math.floor(scaleRange(rate, 0, 200, 30, 90)) - 10) * 10 + " dps");
$('#preview-roll-expo').html(Math.floor(scaleRange(expo, 0, 200, 40, 100)) + "%");
$('#preview-pitch-expo').html(Math.floor(scaleRange(expo, 0, 200, 40, 100)) + "%");
$('#preview-yaw-expo').html(Math.floor(scaleRange(expo, 0, 200, 40, 100)) + "%");
}
function process_html() {
localize();
helper.tabs.init($('.tab-ez_tune'));
helper.features.updateUI($('.tab-ez_tune'), FEATURES);
$("#ez_tune_enabled").prop('checked', EZ_TUNE.enabled);
GUI.sliderize($('#ez_tune_filter_hz'), EZ_TUNE.filterHz, 10, 300);
GUI.sliderize($('#ez_tune_axis_ratio'), EZ_TUNE.axisRatio, 25, 175);
GUI.sliderize($('#ez_tune_response'), EZ_TUNE.response, 0, 200);
GUI.sliderize($('#ez_tune_damping'), EZ_TUNE.damping, 0, 200);
GUI.sliderize($('#ez_tune_stability'), EZ_TUNE.stability, 0, 200);
GUI.sliderize($('#ez_tune_aggressiveness'), EZ_TUNE.aggressiveness, 0, 200);
GUI.sliderize($('#ez_tune_rate'), EZ_TUNE.rate, 0, 200);
GUI.sliderize($('#ez_tune_expo'), EZ_TUNE.expo, 0, 200);
$('.ez-element').on('updated', function () {
updatePreview();
});
updatePreview();
GUI.simpleBind();
GUI.content_ready(callback);
$('a.update').on('click', function () {
if ($("#ez_tune_enabled").is(":checked")) {
EZ_TUNE.enabled = 1;
} else {
EZ_TUNE.enabled = 0;
}
EZ_TUNE.filterHz = $('#ez_tune_filter_hz').val();
EZ_TUNE.axisRatio = $('#ez_tune_axis_ratio').val();
EZ_TUNE.response = $('#ez_tune_response').val();
EZ_TUNE.damping = $('#ez_tune_damping').val();
EZ_TUNE.stability = $('#ez_tune_stability').val();
EZ_TUNE.aggressiveness = $('#ez_tune_aggressiveness').val();
EZ_TUNE.rate = $('#ez_tune_rate').val();
EZ_TUNE.expo = $('#ez_tune_expo').val();
saveChainer.execute();
});
}
};
TABS.ez_tune.cleanup = function (callback) {
if (callback) {
callback();
}
};

@ -74,6 +74,11 @@
<input type="text" id="pilot_name" data-setting="pilot_name" data-live="true" />
<span data-i18n="osd_pilot_name"></span>
</label>
<div for="usePilotLogo" class="helpicon cf_tip osd_use_large_pilot_logo" data-i18n_title="osd_use_large_pilot_logo_help"></div>
<label>
<input type="checkbox" id="usePilotLogo" class="toggle update_preview" data-setting="osd_use_pilot_logo" data-live="true">
<span data-i18n="osd_use_pilot_logo"></span>
</label>
<label class="craft_name">
<input type="text" id="craft_name" data-setting="name" data-live="true" />
<span data-i18n="osd_craft_name"></span>

@ -116,6 +116,9 @@ SYM.ALERT = 0xDD;
SYM.CROSS_TRACK_ERROR = 0xFC;
SYM.PAN_SERVO_IS_OFFSET_L = 0x1C7;
SYM.ODOMETER = 0X168;
SYM.PILOT_LOGO_SML_L = 0x1D5;
SYM.PILOT_LOGO_SML_C = 0x1D6;
SYM.PILOT_LOGO_SML_R = 0x1D7;
SYM.AH_AIRCRAFT0 = 0x1A2;
SYM.AH_AIRCRAFT1 = 0x1A3;
@ -841,7 +844,6 @@ OSD.constants = {
{
name: 'THROTTLE_POSITION',
id: 9,
preview: ' ' + FONT.symbol(SYM.THR) + ' 69'
},
{
@ -859,6 +861,11 @@ OSD.constants = {
id: 142,
preview: '[PILOT_NAME]'
},
{
name: 'PILOT_LOGO',
id: 146,
preview: FONT.symbol(SYM.PILOT_LOGO_SML_L) + FONT.symbol(SYM.PILOT_LOGO_SML_C) + FONT.symbol(SYM.PILOT_LOGO_SML_R)
},
{
name: 'FLYMODE',
id: 7,

@ -1,7 +1,14 @@
<!--suppress ALL -->
<div id="content-watermark"></div>
<div class="tab-pid_tuning toolbar_fixed_bottom">
<div class="content_wrapper">
<div id="note-wrapper" class="content_wrapper">
<div class="note spacebottom">
<div class="note_spacer">
<p i18n="ezTuneNote"></p>
</div>
</div>
</div>
<div id="tuning-wrapper" class="content_wrapper">
<div class="tab_title subtab__header">
<span class="subtab__header_label subtab__header_label--current" for="subtab-pid" data-i18n="pidTuning_PIDgains"></span>
<span class="subtab__header_label" for="subtab-rates" data-i18n="pidTuning_RatesAndExpo"></span>
@ -683,7 +690,7 @@
</div>
</div>
<div class="clear-both"></div>
<div class="content_toolbar">
<div id="tuning-footer" class="content_toolbar">
<div class="btn save_btn">
<a class="update" href="#" data-i18n="pidTuning_ButtonSave"></a>
</div>

@ -16,7 +16,8 @@ TABS.pid_tuning.initialize = function (callback) {
mspHelper.loadPidAdvanced,
mspHelper.loadFilterConfig,
mspHelper.loadFeatures,
mspHelper.loadRateDynamics
mspHelper.loadRateDynamics,
mspHelper.loadEzTune
];
loadChain.push(mspHelper.loadRateProfileData);
@ -125,6 +126,15 @@ TABS.pid_tuning.initialize = function (callback) {
}
function process_html() {
// translate to user-selected language
if (EZ_TUNE.enabled) {
$("#tuning-wrapper").remove();
$("#tuning-footer").remove();
$('#note-wrapper').show();
} else {
$("#note-wrapper").remove();
}
localize();
helper.tabs.init($('.tab-pid_tuning'));

Loading…
Cancel
Save