Skip to content

Commit 698345d

Browse files
committed
Add missing fields for 3.1 and reorganise PID other
1 parent 36c045e commit 698345d

File tree

4 files changed

+32
-33
lines changed

4 files changed

+32
-33
lines changed

P-Term

Whitespace-only changes.

index.html

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,24 @@ <h5 class="modal-title-craft"></h5>
732732
<div class="gui_box_titlebar">
733733
<div class="spacer_box_title">PID Other</div>
734734
</div>
735+
<div class="spacer_box">
736+
<table class="parameter cf">
737+
<tbody>
738+
<tr>
739+
<td name="ptermSRateWeight" class="bf-only"><label>P-Term<br>&nbsp;</label><input type="number" step="0.01" min="0" max="999" /></td>
740+
<td name="setpointRelaxRatio" class="bf-only"><label>Setpoint Relax<br>Ratio</label><input type="number" step="0.01" min="0" max="999" /></td>
741+
<td name="dtermSetpointWeight" class="bf-only"><label>D-Term Setpoint<br>Weight</label><input type="number" step="0.01" min="0" max="999" /></td>
742+
<td name="rateAccelLimit" class="bf-only"><label>Roll/Pitch Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
743+
<td name="yawRateAccelLimit" class="bf-only"><label>Yaw Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
744+
</tr>
745+
<tr>
746+
<td name="antiGravityGain" class="bf-only"><label>AG Gain</label><input type="number" step="0.01" min="0" max="999" /></td>
747+
<td name="antiGravityThreshold" class="bf-only"><label>AG Threshold</label><input type="number" step="0.01" min="0" max="999" /></td>
748+
<td name="itermWindupPointPercent" class="bf-only"><label>Windup Threshold</label><input type="number" step="1" min="0" max="999" /></td>
749+
</tr>
750+
</tbody>
751+
</table>
752+
</div>
735753
<div class="spacer_box">
736754
<table class="no-inav parameter cf">
737755
<tbody>
@@ -741,13 +759,13 @@ <h5 class="modal-title-craft"></h5>
741759
</tbody>
742760
</table>
743761
<table class="parameter cf">
744-
<thead>
762+
<thead class="BFPIDController">
745763
<tr>
746764
<th colspan="2">P-Term</th>
747765
<th class="bf-only" colspan="2">I-Term</th>
748766
</tr>
749767
</thead>
750-
<tbody>
768+
<tbody class="BFPIDController">
751769
<tr>
752770
<td name='dynamic_pterm' class="bf-only"><label>Dynamic P</label><select><!-- list generated here --></select></td>
753771
<td name="yaw_p_limit"><label>Yaw Limit</label><input type="number" step="1" min="0" max="999" /></td>
@@ -757,36 +775,14 @@ <h5 class="modal-title-craft"></h5>
757775
<td name="yawItermIgnoreRate" class="bf-only"><label>Yaw Ignore Rate</label><input type="number" step="1" min="0" max="999" /></td>
758776
</tr>
759777
</tbody>
760-
<tbody>
778+
<tbody class="BFPIDController">
761779
<tr>
762780
<td></td>
763781
<td name="iterm_reset_offset" class="bf-only"><label>Reset Offset</label><input type="number" step="1" min="0" max="999" /></td>
764782
</tr>
765783
</tbody>
766784
</table>
767785
</div>
768-
<div class="spacer_box">
769-
<table class="parameter cf">
770-
<thead class="BFPIDController">
771-
<tr>
772-
<th colspan="5">Betaflight PID Controller</th>
773-
</tr>
774-
</thead>
775-
<tbody>
776-
<tr>
777-
<td name="ptermSRateWeight" class="bf-only"><label>P-Term<br>&nbsp;</label><input type="number" step="0.01" min="0" max="999" /></td>
778-
<td name="setpointRelaxRatio" class="bf-only"><label>Setpoint Relax<br>Ratio</label><input type="number" step="0.01" min="0" max="999" /></td>
779-
<td name="dtermSetpointWeight" class="bf-only"><label>D-Term Setpoint<br>Weight</label><input type="number" step="0.01" min="0" max="999" /></td>
780-
<td name="rateAccelLimit" class="bf-only"><label>Roll/Pitch Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
781-
<td name="yawRateAccelLimit" class="bf-only"><label>Yaw Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
782-
</tr>
783-
<tr>
784-
<td name="itermThrottleGain" class="bf-only"><label>I-Term Throttle Gain</label><input type="number" step="0.01" min="0" max="999" /></td>
785-
<td name="itermThrottleThreshold" class="bf-only"><label>I-Term Throttle Threshold</label><input type="number" step="0.01" min="0" max="999" /></td>
786-
</tr>
787-
</tbody>
788-
</table>
789-
</div>
790786
<div class="spacer_box">
791787
<table class="bf-only" cellpadding="0" cellspacing="0">
792788
<tbody class="static-features noline">

js/flightlog_parser.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ var FlightLogParser = function(logData) {
465465
case "acc_1G":
466466
case "dterm_filter_type":
467467
case "pidAtMinThrottle":
468-
case "itermThrottleGain":
469-
case "itermThrottleThreshold":
468+
case "anti_gravity_threshold":
469+
case "itermWindupPointPercent":
470470
case "ptermSRateWeight":
471471
case "setpointRelaxRatio":
472472
case "dtermSetpointWeight":
@@ -477,6 +477,7 @@ var FlightLogParser = function(logData) {
477477

478478
case "yawRateAccelLimit":
479479
case "rateAccelLimit":
480+
case "anti_gravity_gain":
480481
if(that.sysConfig.firmwareType == FIRMWARE_TYPE_BETAFLIGHT && semver.gte(that.sysConfig.firmwareVersion, '3.1.0')) {
481482
that.sysConfig[fieldName] = uint32ToFloat(fieldValue, 10);
482483
} else {

js/header_dialog.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ function HeaderDialog(dialog, onSave) {
2626
{name:'dynamic_pid' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'2.8.0', max:'2.9.9'},
2727
{name:'rcYawRate' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'2.8.0', max:'999.9.9'},
2828
{name:'airmode_activate_throttle' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'2.8.0', max:'999.9.9'},
29-
{name:'rollPitchItermIgnoreRate' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'2.8.0', max:'999.9.9'},
30-
{name:'yawItermIgnoreRate' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'2.8.0', max:'999.9.9'},
29+
{name:'rollPitchItermIgnoreRate' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'2.8.0', max:'3.0.1'},
30+
{name:'yawItermIgnoreRate' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'2.8.0', max:'3.0.1'},
3131
{name:'gyro_notch_hz' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.0.0', max:'999.9.9'},
3232
{name:'gyro_notch_cutoff' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.0.0', max:'999.9.9'},
3333
{name:'dterm_notch_hz' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.0.0', max:'999.9.9'},
@@ -56,8 +56,9 @@ function HeaderDialog(dialog, onSave) {
5656
{name:'motorOutputHigh' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
5757
{name:'digitalIdleOffset' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
5858
{name:'setpointRelaxRatio' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
59-
{name:'itermThrottleThreshold' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'}
60-
59+
{name:'antiGravityGain' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
60+
{name:'antiGravityThreshold' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
61+
{name:'itermWindupPointPercent' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'}
6162
];
6263

6364
function isParameterValid(name) {
@@ -461,6 +462,7 @@ function HeaderDialog(dialog, onSave) {
461462
setParameter('yawItermResetRate' ,sysConfig.yawItermResetRate,0);
462463
setParameter('rollPitchItermIgnoreRate' ,sysConfig.rollPitchItermIgnoreRate,0);
463464
setParameter('yawItermIgnoreRate' ,sysConfig.yawItermIgnoreRate,0);
465+
setParameter('itermWindupPointPercent' ,sysConfig.itermWindupPointPercent,0);
464466
setParameter('dterm_cut_hz' ,sysConfig.dterm_cut_hz,2);
465467
setParameter('iterm_reset_offset' ,sysConfig.iterm_reset_offset,0);
466468
setParameter('deadband' ,sysConfig.deadband,0);
@@ -496,7 +498,6 @@ function HeaderDialog(dialog, onSave) {
496498
renderSelect('fast_pwm_protocol' ,sysConfig.fast_pwm_protocol, FAST_PROTOCOL);
497499
setParameter('motor_pwm_rate' ,sysConfig.motor_pwm_rate,0);
498500
renderSelect('dterm_filter_type' ,sysConfig.dterm_filter_type, FILTER_TYPE);
499-
setParameter('itermThrottleGain' ,sysConfig.itermThrottleGain,2);
500501
setParameter('ptermSRateWeight' ,sysConfig.ptermSRateWeight,2);
501502
setParameter('dtermSetpointWeight' ,sysConfig.dtermSetpointWeight,2);
502503
if(activeSysConfig.firmwareType == FIRMWARE_TYPE_BETAFLIGHT && semver.gte(activeSysConfig.firmwareVersion, '3.1.0')) {
@@ -511,7 +512,8 @@ function HeaderDialog(dialog, onSave) {
511512
setParameter('motorOutputLow' ,sysConfig.motorOutput[0],0);
512513
setParameter('motorOutputHigh' ,sysConfig.motorOutput[1],0);
513514
setParameter('digitalIdleOffset' ,sysConfig.digitalIdleOffset,2);
514-
setParameter('itermThrottleThreshold' ,sysConfig.itermThrottleThreshold,0);
515+
setParameter('antiGravityGain' ,sysConfig.anti_gravity_gain,0);
516+
setParameter('antiGravityThreshold' ,sysConfig.anti_gravity_threshold,0);
515517
setParameter('setpointRelaxRatio' ,sysConfig.setpointRelaxRatio,2);
516518

517519
/* Packed Flags */

0 commit comments

Comments
 (0)