1
0
Fork 0
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:
Pawel Spychalski (DzikuVx) 2020-01-22 20:59:11 +01:00
parent 9ffad48591
commit d1bf2242b5
4 changed files with 56 additions and 22 deletions

View file

@ -3244,5 +3244,17 @@
}, },
"defaultsDialogInfo": { "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. " "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)"
} }
} }

View file

@ -52,7 +52,15 @@ var Settings = (function () {
input.val(s.value); input.val(s.value);
} else if (s.setting.type == 'float') { } else if (s.setting.type == 'float') {
input.attr('type', 'number'); input.attr('type', 'number');
input.attr('step', "0.01");
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('min', s.setting.min);
input.attr('max', s.setting.max); input.attr('max', s.setting.max);
input.val(s.value.toFixed(2)); input.val(s.value.toFixed(2));

View file

@ -53,25 +53,21 @@
<div class="helpicon cf_tip" data-i18n_title="featureMOTOR_STOPTip"></div> <div class="helpicon cf_tip" data-i18n_title="featureMOTOR_STOPTip"></div>
</div> </div>
<!-- --> <div id="throttle_idle-info" class="info-box"></div>
<div class="number hide-for-shot"> <div class="number requires-v2_4">
<input type="number" data-simple-bind="MISC.minthrottle" id="minthrottle" name="minthrottle" min="0" max="2000" /> <input id="throttle_idle" data-setting="throttle_idle" type="number" data-step="1.0" />
<label for="minthrottle"> <label for="throttle_idle">
<span data-i18n="configurationThrottleMinimum"></span> <span data-i18n="throttleIdle"></span>
</label> </label>
</div> </div>
<div class="number hide-for-shot">
<input type="number" data-simple-bind="MISC.maxthrottle" id="maxthrottle" name="maxthrottle" min="0" max="2000" /> <div class="number requires-v2_4">
<label for="maxthrottle"> <input id="motor_poles" data-setting="motor_poles" type="number" />
<span data-i18n="configurationThrottleMaximum"></span> <label for="motor_poles">
</label> <span data-i18n="motor_poles"></span>
</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>
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="gui_box grey"> <div class="gui_box grey">

View file

@ -43,6 +43,7 @@ TABS.motors.initialize = function (callback) {
var saveChainer = new MSPChainerClass(); var saveChainer = new MSPChainerClass();
saveChainer.setChain([ saveChainer.setChain([
saveSettings,
mspHelper.sendServoConfigurations, mspHelper.sendServoConfigurations,
mspHelper.saveAdvancedConfig, mspHelper.saveAdvancedConfig,
mspHelper.saveBfConfig, mspHelper.saveBfConfig,
@ -55,19 +56,31 @@ TABS.motors.initialize = function (callback) {
}); });
function load_html() { 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() { function onLoad() {
process_motors(); process_motors();
process_servos(); process_servos();
processConfiguration(); processConfiguration();
if (semver.gte(CONFIG.flightControllerVersion, "2.4.0")) {
$('.requires-v2_4').show();
} else {
$('.requires-v2_4').hide();
}
finalize(); finalize();
} }
function processConfiguration() { function processConfiguration() {
let escProtocols = FC.getEscProtocols(); let escProtocols = FC.getEscProtocols(),
let servoRates = FC.getServoRates(); servoRates = FC.getServoRates(),
$idleInfoBox = $("#throttle_idle-info");
function buildMotorRates() { function buildMotorRates() {
var protocolData = escProtocols[ADVANCED_CONFIG.motorPwmProtocol]; var protocolData = escProtocols[ADVANCED_CONFIG.motorPwmProtocol];
@ -88,10 +101,15 @@ TABS.motors.initialize = function (callback) {
} }
if (ADVANCED_CONFIG.motorPwmProtocol >= 5) { 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 { } else {
$('.hide-for-shot').removeClass('is-hidden'); $idleInfoBox.html(chrome.i18n.getMessage('throttleIdleAnalogInfo'));
$idleInfoBox.addClass('ok-box');
$idleInfoBox.show();
} }
if (protocolData.message !== null) { if (protocolData.message !== null) {