mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 12:25:13 +03:00
IDLE and number of poles
This commit is contained in:
parent
9ffad48591
commit
d1bf2242b5
4 changed files with 56 additions and 22 deletions
|
@ -3244,5 +3244,17 @@
|
|||
},
|
||||
"defaultsDialogInfo": {
|
||||
"message": "INAV Configurator would like to know which kind of UAV you are configuring. Based on this information it will modify some default values to unlock the best flying performance. "
|
||||
},
|
||||
"throttleIdle": {
|
||||
"message": "Motors IDLE power [%]"
|
||||
},
|
||||
"throttleIdleDigitalInfo": {
|
||||
"message": "For digital protocols, IDLE can be lowered even down to 5-7% without motors stopping in the air. If a drone wobbles after pulling throttle low, try increasing IDLE to tune this behavior out."
|
||||
},
|
||||
"throttleIdleAnalogInfo": {
|
||||
"message": "For analog protocols, IDLE can be lowered below 10% if motors are working smooth without stuttering. If a drone wobbles after pulling throttle low, try increasing IDLE to tune this behavior out."
|
||||
},
|
||||
"motor_poles": {
|
||||
"message": "Number of motor poles (number of magnets)"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,15 @@ var Settings = (function () {
|
|||
input.val(s.value);
|
||||
} else if (s.setting.type == 'float') {
|
||||
input.attr('type', 'number');
|
||||
|
||||
let dataStep = input.data("step");
|
||||
|
||||
if (dataStep !== undefined) {
|
||||
input.attr('step', dataStep);
|
||||
} else {
|
||||
input.attr('step', "0.01");
|
||||
}
|
||||
|
||||
input.attr('min', s.setting.min);
|
||||
input.attr('max', s.setting.max);
|
||||
input.val(s.value.toFixed(2));
|
||||
|
|
|
@ -53,25 +53,21 @@
|
|||
<div class="helpicon cf_tip" data-i18n_title="featureMOTOR_STOPTip"></div>
|
||||
</div>
|
||||
|
||||
<!-- -->
|
||||
<div class="number hide-for-shot">
|
||||
<input type="number" data-simple-bind="MISC.minthrottle" id="minthrottle" name="minthrottle" min="0" max="2000" />
|
||||
<label for="minthrottle">
|
||||
<span data-i18n="configurationThrottleMinimum"></span>
|
||||
<div id="throttle_idle-info" class="info-box"></div>
|
||||
<div class="number requires-v2_4">
|
||||
<input id="throttle_idle" data-setting="throttle_idle" type="number" data-step="1.0" />
|
||||
<label for="throttle_idle">
|
||||
<span data-i18n="throttleIdle"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number hide-for-shot">
|
||||
<input type="number" data-simple-bind="MISC.maxthrottle" id="maxthrottle" name="maxthrottle" min="0" max="2000" />
|
||||
<label for="maxthrottle">
|
||||
<span data-i18n="configurationThrottleMaximum"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number hide-for-shot">
|
||||
<input type="number" data-simple-bind="MISC.mincommand" id="mincommand" name="mincommand" min="0" max="2000" />
|
||||
<label for="mincommand">
|
||||
<span data-i18n="configurationThrottleMinimumCommand"></span>
|
||||
|
||||
<div class="number requires-v2_4">
|
||||
<input id="motor_poles" data-setting="motor_poles" type="number" />
|
||||
<label for="motor_poles">
|
||||
<span data-i18n="motor_poles"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="gui_box grey">
|
||||
|
|
|
@ -43,6 +43,7 @@ TABS.motors.initialize = function (callback) {
|
|||
var saveChainer = new MSPChainerClass();
|
||||
|
||||
saveChainer.setChain([
|
||||
saveSettings,
|
||||
mspHelper.sendServoConfigurations,
|
||||
mspHelper.saveAdvancedConfig,
|
||||
mspHelper.saveBfConfig,
|
||||
|
@ -55,19 +56,31 @@ TABS.motors.initialize = function (callback) {
|
|||
});
|
||||
|
||||
function load_html() {
|
||||
GUI.load("./tabs/motors.html", onLoad);
|
||||
GUI.load("./tabs/motors.html", Settings.processHtml(onLoad));
|
||||
}
|
||||
|
||||
function saveSettings(onComplete) {
|
||||
Settings.saveInputs().then(onComplete);
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
process_motors();
|
||||
process_servos();
|
||||
processConfiguration();
|
||||
|
||||
if (semver.gte(CONFIG.flightControllerVersion, "2.4.0")) {
|
||||
$('.requires-v2_4').show();
|
||||
} else {
|
||||
$('.requires-v2_4').hide();
|
||||
}
|
||||
|
||||
finalize();
|
||||
}
|
||||
|
||||
function processConfiguration() {
|
||||
let escProtocols = FC.getEscProtocols();
|
||||
let servoRates = FC.getServoRates();
|
||||
let escProtocols = FC.getEscProtocols(),
|
||||
servoRates = FC.getServoRates(),
|
||||
$idleInfoBox = $("#throttle_idle-info");
|
||||
|
||||
function buildMotorRates() {
|
||||
var protocolData = escProtocols[ADVANCED_CONFIG.motorPwmProtocol];
|
||||
|
@ -88,10 +101,15 @@ TABS.motors.initialize = function (callback) {
|
|||
}
|
||||
|
||||
if (ADVANCED_CONFIG.motorPwmProtocol >= 5) {
|
||||
//DSHOT/SERIALSHOT protocols, simplify UI
|
||||
$('.hide-for-shot').addClass('is-hidden');
|
||||
|
||||
$idleInfoBox.html(chrome.i18n.getMessage('throttleIdleDigitalInfo'));
|
||||
$idleInfoBox.addClass('ok-box');
|
||||
$idleInfoBox.show();
|
||||
|
||||
} else {
|
||||
$('.hide-for-shot').removeClass('is-hidden');
|
||||
$idleInfoBox.html(chrome.i18n.getMessage('throttleIdleAnalogInfo'));
|
||||
$idleInfoBox.addClass('ok-box');
|
||||
$idleInfoBox.show();
|
||||
}
|
||||
|
||||
if (protocolData.message !== null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue