Skip to content

Commit 109a803

Browse files
authored
Merge pull request #375 from mikeller/add_throttle_idle_percent_value
Add throttle idle percent value
2 parents f56cade + f995c3f commit 109a803

File tree

5 files changed

+171
-73
lines changed

5 files changed

+171
-73
lines changed

_locales/en/messages.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,17 @@
644644
"configurationMidRcHelp": {
645645
"message": "This is the center value <span style=\"font-weight: bold\">for all RC channels</span>. Set this to the value that your transmitter sends when the stick is centered for a channel. To adjust the thrust at throttle mid position, change the 'Trottle MID' value on the PID Tuning tab."
646646
},
647+
"configurationDigitalIdlePercent": {
648+
"message": "Motor Idle Throttle Value (percent)"
649+
},
650+
"configurationDigitalIdlePercentHelp": {
651+
"message": "This is the 'idle' value in percent of maximum throttle that is sent to the ESCs when the craft is armed and the trottle stick is at minimum position. Increase the percent value to gain more idle speed."
652+
},
647653
"configurationThrottleMinimum": {
648-
"message": "Minimum Throttle"
654+
"message": "Motor Idle Throttle Value (absolute / percent)"
649655
},
650656
"configurationThrottleMinimumHelp": {
651-
"message": "This is the 'idle' value that is sent to the ESCs when the craft is armed and the trottle stick is at minimum position. Adjust this so the motors run as slow as possible while still running smoothly."
657+
"message": "This is the 'idle' value (absolute / as a percentage of the throttle range) that is sent to the ESCs when the craft is armed and the trottle stick is at minimum position. Increase the value or to gain more idle speed."
652658
},
653659
"configurationThrottleMaximum": {
654660
"message": "Maximum Throttle"
@@ -1839,6 +1845,15 @@
18391845
"configurationPidProcessDenom": {
18401846
"message": "PID loop frequency"
18411847
},
1848+
"configurationPidProcessDenomHelp": {
1849+
"message": "The maximum frequency for the PID loop is limited by the maximum frequency that updates can be sent by the chosen ESC / motor protocol."
1850+
},
1851+
"configurationGyroUse32kHz": {
1852+
"message": "Use 32 kHz gyro update frequency instead of 8 kHz"
1853+
},
1854+
"configurationGyroUse32kHzHelp": {
1855+
"message": "32 kHz gyro update frequency is only possible if the gyro chip supports it (currently MPU6500, MPU9250, and ICM20689 if connected over SPI). If in doubt, consult the specification for your board."
1856+
},
18421857
"configurationAccHardware": {
18431858
"message": "Accelerometer"
18441859
},

js/fc.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ var FC = {
256256
pid_process_denom: 0,
257257
use_unsyncedPwm: 0,
258258
fast_pwm_protocol: 0,
259-
motor_pwm_rate: 0
259+
motor_pwm_rate: 0,
260+
digitalIdlePercent: 0,
261+
gyroUse32kHz: 0
260262
};
261263

262264
FILTER_CONFIG = {
@@ -283,7 +285,9 @@ var FC = {
283285
toleranceBandReduction: 0,
284286
itermThrottleGain: 0,
285287
pidMaxVelocity: 0,
286-
pidMaxVelocityYaw: 0
288+
pidMaxVelocityYaw: 0,
289+
levelAngleLimit: 0,
290+
levelSensitivity: 0
287291
};
288292

289293
SENSOR_CONFIG = {

js/msp/MSPHelper.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,13 @@ MspHelper.prototype.process_data = function(dataHandler) {
617617
PID_ADVANCED_CONFIG.use_unsyncedPwm = data.readU8();
618618
PID_ADVANCED_CONFIG.fast_pwm_protocol = data.readU8();
619619
PID_ADVANCED_CONFIG.motor_pwm_rate = data.readU16();
620+
if (semver.gte(CONFIG.apiVersion, "1.24.0")) {
621+
PID_ADVANCED_CONFIG.digitalIdlePercent = data.readU16() / 100;
622+
623+
if (semver.gte(CONFIG.apiVersion, "1.25.0")) {
624+
PID_ADVANCED_CONFIG.gyroUse32kHz = data.readU8();
625+
}
626+
}
620627
break;
621628
case MSPCodes.MSP_FILTER_CONFIG:
622629
FILTER_CONFIG.gyro_soft_lpf_hz = data.readU8();
@@ -651,6 +658,10 @@ MspHelper.prototype.process_data = function(dataHandler) {
651658
ADVANCED_TUNING.pidMaxVelocity = data.readU16();
652659
ADVANCED_TUNING.pidMaxVelocityYaw = data.readU16();
653660
}
661+
if (semver.gte(CONFIG.apiVersion, "1.24.0")) {
662+
ADVANCED_TUNING.levelAngleLimit = data.readU8();
663+
ADVANCED_TUNING.levelSensitivity = data.readU8();
664+
}
654665
break;
655666
case MSPCodes.MSP_SENSOR_CONFIG:
656667
SENSOR_CONFIG.acc_hardware = data.readU8();
@@ -1130,6 +1141,13 @@ MspHelper.prototype.crunch = function(code) {
11301141
.push8(PID_ADVANCED_CONFIG.use_unsyncedPwm)
11311142
.push8(PID_ADVANCED_CONFIG.fast_pwm_protocol)
11321143
.push16(PID_ADVANCED_CONFIG.motor_pwm_rate);
1144+
if (semver.gte(CONFIG.apiVersion, "1.24.0")) {
1145+
buffer.push16(PID_ADVANCED_CONFIG.digitalIdlePercent * 100);
1146+
1147+
if (semver.gte(CONFIG.apiVersion, "1.25.0")) {
1148+
buffer.push8(PID_ADVANCED_CONFIG.gyroUse32kHz);
1149+
}
1150+
}
11331151
break;
11341152
case MSPCodes.MSP_SET_FILTER_CONFIG:
11351153
buffer.push8(FILTER_CONFIG.gyro_soft_lpf_hz)
@@ -1160,6 +1178,10 @@ MspHelper.prototype.crunch = function(code) {
11601178
.push8(ADVANCED_TUNING.itermThrottleGain)
11611179
.push16(ADVANCED_TUNING.pidMaxVelocity)
11621180
.push16(ADVANCED_TUNING.pidMaxVelocityYaw);
1181+
if (semver.gte(CONFIG.apiVersion, "1.24.0")) {
1182+
buffer.push8(ADVANCED_TUNING.levelAngleLimit)
1183+
.push8(ADVANCED_TUNING.levelSensitivity);
1184+
}
11631185
}
11641186
// only supports 1 version pre bf 3.0
11651187
else {

tabs/configuration.html

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,36 @@
9090
<div class="helpicon cf_tip" i18n_title="configurationMidRcHelp"></div>
9191
</label>
9292
</div>
93-
<div class="number">
93+
<div class="number digitalIdlePercent">
94+
<label>
95+
<div class="numberspacer">
96+
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/>
97+
</div>
98+
<span i18n="configurationDigitalIdlePercent"></span>
99+
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
100+
</label>
101+
</div>
102+
<div class="number minthrottle">
94103
<label>
95104
<div class="numberspacer">
96105
<input type="number" name="minthrottle" min="0" max="2000" />
97106
</div>
107+
<div class="numberspacer">
108+
<input type="number" name="idlePercent" min="0.00" max="20.00" step="0.01"/>
109+
</div>
98110
<span i18n="configurationThrottleMinimum"></span>
99111
<div class="helpicon cf_tip" i18n_title="configurationThrottleMinimumHelp"></div>
100112
</label>
101113
</div>
102-
<div class="number">
114+
<div class="number maxthrottle">
103115
<label>
104116
<div class="numberspacer">
105117
<input type="number" name="maxthrottle" min="0" max="2000" />
106118
</div>
107119
<span i18n="configurationThrottleMaximum"></span>
108120
</label>
109121
</div>
110-
<div class="number">
122+
<div class="number mincommand">
111123
<label>
112124
<div class="numberspacer">
113125
<input type="number" name="mincommand" min="0" max="2000" />
@@ -252,6 +264,14 @@
252264
<p i18n="configurationLoopTimeHelp"></p>
253265
</div>
254266
</div>
267+
<div class="select gyroUse32kHz">
268+
<div style="float: left; height: 20px; margin-right: 15px; margin-left: 3px;">
269+
<input type="checkbox" id="gyroUse32kHz" class="toggle" />
270+
</div>
271+
<label for="gyroUse32kHz"> <span class="freelabel" i18n="configurationGyroUse32kHz"></span>
272+
</label>
273+
<div class="helpicon cf_tip" i18n_title="configurationGyroUse32kHzHelp"></div>
274+
</div>
255275
<div class="select">
256276
<label>
257277
<select class="gyroSyncDenom">
@@ -266,6 +286,7 @@
266286
<!-- list generated here -->
267287
</select>
268288
<span i18n="configurationPidProcessDenom"></span>
289+
<div class="helpicon cf_tip" i18n_title="configurationPidProcessDenomHelp"></div>
269290
</label>
270291
</div>
271292
<div class="hardwareSelection">

0 commit comments

Comments
 (0)