Skip to content

Commit

Permalink
Rename digitalIdlePercent
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Oct 4, 2024
1 parent 9015ef7 commit 75d2ef8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1464,10 +1464,10 @@
"configurationGyroCalOnFirstArm": {
"message": "Calibrate Gyro on first arm"
},
"configurationDigitalIdlePercent": {
"configurationmotorIdle": {
"message": "Motor Idle (%)"
},
"configurationDigitalIdlePercentHelp": {
"configurationmotorIdleHelp": {
"message": "The Motor Idle value sets the idle speed of the motors when throttle is at minimum position.<br/><br/><strong>Dynamic Idle disabled</strong><br/><br/>The lowest throttle value sent to any motor, while armed, as a percentage of full throttle. Increase it to improve motor startup reliability, to avoid desyncs, and to improve PID responsiveness at low throttle.<br/><br/>Too low: the motors may not start up reliably, or desync at the end of a flip or roll or on hard throttle chops.<br/><br/>Too high: the craft may feel 'floaty'.<br/><br/><strong>Dynamic idle enabled</strong><br/><br/>The maximum throttle allowed, after arming, before takeoff. If RPM is less than dyn_idle_min_rpm, or zero, this throttle value will be sent to the motors. When the motors start spinning, throttle is adjusted to maintain the set RPM, but cannot exceed this value until the quad takes off.<br/><br/>Too low: the motors may not start up reliably.<br/><br/>Too high: the craft may shake on the ground before takeoff."
},
"configurationMotorPoles": {
Expand Down
2 changes: 1 addition & 1 deletion src/js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ const FC = {
use_unsyncedPwm: 0,
fast_pwm_protocol: 0,
motor_pwm_rate: 0,
digitalIdlePercent: 0,
motorIdle: 0,
gyroUse32kHz: 0,
motorPwmInversion: 0,
gyroHighFsr: 0,
Expand Down
4 changes: 2 additions & 2 deletions src/js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
FC.PID_ADVANCED_CONFIG.use_unsyncedPwm = data.readU8();
FC.PID_ADVANCED_CONFIG.fast_pwm_protocol = EscProtocols.ReorderPwmProtocols(FC.CONFIG.apiVersion, data.readU8());
FC.PID_ADVANCED_CONFIG.motor_pwm_rate = data.readU16();
FC.PID_ADVANCED_CONFIG.digitalIdlePercent = data.readU16() / 100;
FC.PID_ADVANCED_CONFIG.motorIdle = data.readU16() / 100;
data.readU8(); // gyroUse32Khz is not supported
// Introduced in 1.42
FC.PID_ADVANCED_CONFIG.motorPwmInversion = data.readU8();
Expand Down Expand Up @@ -2002,7 +2002,7 @@ MspHelper.prototype.crunch = function(code, modifierCode = undefined) {
.push8(FC.PID_ADVANCED_CONFIG.use_unsyncedPwm)
.push8(EscProtocols.ReorderPwmProtocols(FC.CONFIG.apiVersion, FC.PID_ADVANCED_CONFIG.fast_pwm_protocol))
.push16(FC.PID_ADVANCED_CONFIG.motor_pwm_rate)
.push16(FC.PID_ADVANCED_CONFIG.digitalIdlePercent * 100)
.push16(FC.PID_ADVANCED_CONFIG.motorIdle * 100)
.push8(0); // gyroUse32kHz not used

// Introduced in 1.42
Expand Down
12 changes: 6 additions & 6 deletions src/js/tabs/motors.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ motors.initialize = async function (callback) {
feature27: FC.FEATURE_CONFIG.features.isEnabled('ESC_SENSOR'),
dshotBidir: FC.MOTOR_CONFIG.use_dshot_telemetry,
motorPoles: FC.MOTOR_CONFIG.motor_poles,
digitalIdlePercent: FC.PID_ADVANCED_CONFIG.digitalIdlePercent,
motorIdle: FC.PID_ADVANCED_CONFIG.motorIdle,
idleMinRpm: FC.ADVANCED_TUNING.idleMinRpm,
_3ddeadbandlow: FC.MOTOR_3D_CONFIG.deadband3d_low,
_3ddeadbandhigh: FC.MOTOR_3D_CONFIG.deadband3d_high,
Expand Down Expand Up @@ -691,7 +691,7 @@ motors.initialize = async function (callback) {

unsyncedPWMSwitchElement.prop('checked', FC.PID_ADVANCED_CONFIG.use_unsyncedPwm !== 0).trigger("change");
$('input[name="unsyncedpwmfreq"]').val(FC.PID_ADVANCED_CONFIG.motor_pwm_rate);
$('input[name="digitalIdlePercent"]').val(FC.PID_ADVANCED_CONFIG.digitalIdlePercent);
$('input[name="motorIdle"]').val(FC.PID_ADVANCED_CONFIG.motorIdle);
$('input[name="idleMinRpm"]').val(FC.ADVANCED_TUNING.idleMinRpm);

dshotBidirElement.prop('checked', FC.MOTOR_CONFIG.use_dshot_telemetry).trigger("change");
Expand Down Expand Up @@ -765,7 +765,7 @@ motors.initialize = async function (callback) {
$('div.checkboxPwm').toggle(analogProtocolConfigured);
divUnsyncedPWMFreq.toggle(analogProtocolConfigured);

$('div.digitalIdlePercent').toggle(protocolConfigured
$('div.motorIdle').toggle(protocolConfigured
&& semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)
|| (digitalProtocolConfigured && FC.MOTOR_CONFIG.use_dshot_telemetry && FC.ADVANCED_TUNING.idleMinRpm));

Expand Down Expand Up @@ -1158,7 +1158,7 @@ motors.initialize = async function (callback) {
FC.PID_ADVANCED_CONFIG.fast_pwm_protocol = parseInt(escProtocolElement.val() - 1);
FC.PID_ADVANCED_CONFIG.use_unsyncedPwm = unsyncedPWMSwitchElement.is(':checked') ? 1 : 0;
FC.PID_ADVANCED_CONFIG.motor_pwm_rate = parseInt($('input[name="unsyncedpwmfreq"]').val());
FC.PID_ADVANCED_CONFIG.digitalIdlePercent = parseFloat($('input[name="digitalIdlePercent"]').val());
FC.PID_ADVANCED_CONFIG.motorIdle = parseFloat($('input[name="motorIdle"]').val());

await MSP.promise(MSPCodes.MSP_SET_FEATURE_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FEATURE_CONFIG));
await MSP.promise(MSPCodes.MSP_SET_MIXER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_MIXER_CONFIG));
Expand Down Expand Up @@ -1226,7 +1226,7 @@ motors.initialize = async function (callback) {
function setup_motor_output_reordering_dialog(callbackFunction, zeroThrottleValue)
{
const domDialogMotorOutputReorder = $('#dialogMotorOutputReorder');
const idleThrottleValue = zeroThrottleValue + FC.PID_ADVANCED_CONFIG.digitalIdlePercent * 1000 / 100;
const idleThrottleValue = zeroThrottleValue + FC.PID_ADVANCED_CONFIG.motorIdle * 1000 / 100;
const motorOutputReorderComponent = new MotorOutputReorderComponent($('#dialogMotorOutputReorderContent'),
callbackFunction, mixerList[FC.MIXER_CONFIG.mixer - 1].name,
zeroThrottleValue, idleThrottleValue);
Expand Down Expand Up @@ -1257,7 +1257,7 @@ motors.initialize = async function (callback) {
function SetupdescDshotDirectionDialog(callbackFunction, zeroThrottleValue)
{
const domEscDshotDirectionDialog = $('#escDshotDirectionDialog');
const idleThrottleValue = zeroThrottleValue + FC.PID_ADVANCED_CONFIG.digitalIdlePercent * 1000 / 100;
const idleThrottleValue = zeroThrottleValue + FC.PID_ADVANCED_CONFIG.motorIdle * 1000 / 100;
const motorConfig = {
numberOfMotors: self.numberOfValidOutputs,
motorStopValue: zeroThrottleValue,
Expand Down
8 changes: 4 additions & 4 deletions src/tabs/motors.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@
<span i18n="configurationMotorPolesLong"></span>
<div class="helpicon cf_tip" i18n_title="configurationMotorPolesHelp"></div>
</div>
<div class="number digitalIdlePercent">
<div class="number motorIdle">
<div class="numberspacer">
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/>
<input type="number" name="motorIdle" min="0.00" max="20.00" step="0.01"/>
</div>
<span i18n="configurationDigitalIdlePercent"></span>
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
<span i18n="configurationmotorIdle"></span>
<div class="helpicon cf_tip" i18n_title="configurationmotorIdleHelp"></div>
</div>
<div class="number idleMinRpm">
<div class="numberspacer noarrows">
Expand Down

0 comments on commit 75d2ef8

Please sign in to comment.