Skip to content

Commit

Permalink
Update BB fields
Browse files Browse the repository at this point in the history
  • Loading branch information
DzikuVx committed Apr 29, 2020
1 parent 9124596 commit 8b09aeb
Show file tree
Hide file tree
Showing 6 changed files with 1,156 additions and 1,218 deletions.
78 changes: 9 additions & 69 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,9 @@ <h5 class="modal-title-craft"></h5>
<table class="parameter cf">
<tbody>
<tr>
<td name="ptermSRateWeight" class="bf-only"><label>P-Term<br>&nbsp;</label><input type="number" step="0.01" min="0" max="999" /></td>
<td name="setpointRelaxRatio" class="bf-only"><label>Setpoint Relax<br>Ratio</label><input type="number" step="0.01" min="0" max="999" /></td>
<td name="dtermSetpointWeight" class="bf-only"><label>D-Term Setpoint<br>Weight</label><input type="number" step="0.01" min="0" max="999" /></td>
<td name="rateAccelLimit" class="bf-only"><label>Roll/Pitch Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
<td name="yawRateAccelLimit" class="bf-only"><label>Yaw Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
<td name="dterm_setpoint_weight"><label>D-Term Setpoint<br>Weight</label><input type="number" step="0.01" min="0" max="999" /></td>
<td name="axisAccelerationLimitRollPitch" ><label>Roll/Pitch Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
<td name="axisAccelerationLimitYaw"><label>Yaw Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
</tr>
<tr>
<td name="antiGravityGain" class="bf-only"><label>AG Gain</label><input type="number" step="0.01" min="0" max="999" /></td>
Expand All @@ -727,50 +725,6 @@ <h5 class="modal-title-craft"></h5>
</tbody>
</table>
</div>
<div class="spacer_box">
<table class="no-inav parameter cf">
<tbody>
<tr>
<td name='dynamic_pid' class="bf-only"><label>Dynamic PID</label><select><!-- list generated here --></select></td>
</tr>
</tbody>
</table>
<table class="parameter cf">
<thead class="BFPIDController">
<tr>
<th colspan="2">P-Term</th>
<th class="bf-only" colspan="2">I-Term</th>
</tr>
</thead>
<tbody class="BFPIDController">
<tr>
<td name='dynamic_pterm' class="bf-only"><label>Dynamic P</label><select><!-- list generated here --></select></td>
<td name="yaw_p_limit"><label>Yaw Limit</label><input type="number" step="1" min="0" max="999" /></td>
<td name="rollPitchItermResetRate" class="bf-only"><label>Roll/Pitch Reset</label><input type="number" step="1" min="0" max="999" /></td>
<td name="rollPitchItermIgnoreRate" class="bf-only"><label>Roll/Pitch Ignore Rate</label><input type="number" step="1" min="0" max="999" /></td>
<td name="yawItermResetRate" class="bf-only"><label>Yaw Reset</label><input type="number" step="1" min="0" max="999" /></td>
<td name="yawItermIgnoreRate" class="bf-only"><label>Yaw Ignore Rate</label><input type="number" step="1" min="0" max="999" /></td>
</tr>
</tbody>
<tbody class="BFPIDController">
<tr>
<td></td>
<td name="iterm_reset_offset" class="bf-only"><label>Reset Offset</label><input type="number" step="1" min="0" max="999" /></td>
</tr>
</tbody>
</table>
</div>
<div class="spacer_box">
<table class="bf-only" cellpadding="0" cellspacing="0">
<tbody class="static-features noline">
<tr>
<td name="pidAtMinThrottle"><label class="option"><input class="ios-switch" type="checkbox"/><div><div></div></div></label></td>
<td><label>pidAtMinThrottle</label></td>
<td><span>Stabilisation at zero throttle ?</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="gui_box grey filters">
<div class="gui_box_titlebar">
Expand All @@ -786,8 +740,8 @@ <h5 class="modal-title-craft"></h5>
<tbody>
<tr>
<td name='gyro_lpf'><label>Hardware</label><select><!-- list generated here --></select></td>
<td name="gyro_lowpass_hz"><label>Soft (Hz)</label><input type="number" step="0.01" min="0" max="999.00" /></td>
<td name="gyro_stage2_lowpass_hz"><label>Stage2 (Hz)</label><input type="number" step="0.01" min="0" max="999.00" /></td>
<td name="gyro_lpf_hz"><label>Soft (Hz)</label><input type="number" step="0.01" min="0" max="999.00" /></td>
<td name="gyro_lpf2_hz"><label>Stage2 (Hz)</label><input type="number" step="0.01" min="0" max="999.00" /></td>
<td></td>
</tr>
<tr>
Expand All @@ -806,8 +760,8 @@ <h5 class="modal-title-craft"></h5>
</thead>
<tbody>
<tr>
<td name="dterm_lpf_hz" ><label>Cut-off<br>(Hz)</label><input type="number" step="0.01" min="0" max="999.00" /></td>
<td name="dterm_average_count" class="bf-only"><label>Average Count</label><input type="number" step="1" min="0" max="12" /></td>
<td name="dterm_lpf_hz" ><label>LPF1 Cutoff<br>(Hz)</label><input type="number" step="0.01" min="0" max="999.00" /></td>
<td name="dterm_lpf2_hz" ><label>LPF2 Cutoff<br>(Hz)</label><input type="number" step="0.01" min="0" max="999.00" /></td>
<td name='dterm_notch_hz'><label>Notch<br>(Hz)</label><input type="number" step="0.01" min="0" max="999.00" /></td>
<td name="dterm_notch_cutoff"><label>Notch Cutoff<br>(Hz)</label><input type="number" step="0.1" min="0" max="999.00" /></td>
</tr>
Expand Down Expand Up @@ -864,7 +818,6 @@ <h5 class="modal-title-craft"></h5>
<tbody>
<tr>
<td name="loopTime"><label>Looptime</label><input type="number" step="25" min="0" max="3000"/></td>
<td name="gyro_sync_denom"><label>Gyro Sync</label><input type="number" step="1" min="0" max="8"/></td>
</tr>
</tbody>
<tbody>
Expand All @@ -875,15 +828,6 @@ <h5 class="modal-title-craft"></h5>
</tr>
</tbody>
</table>
<table class="bf-only" cellpadding="0" cellspacing="0">
<tbody class="static-features noline">
<tr>
<td name="gyro_cal_on_first_arm"><label class="option"><input class="ios-switch" type="checkbox"/><div><div></div></div></label></td>
<td><label>GYRO_CAL_ON_FIRST_ARM</label></td>
<td><span>Calibrate Gyro on first arm</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="gui_box grey debug">
Expand Down Expand Up @@ -947,11 +891,7 @@ <h5 class="modal-title-craft"></h5>
<td name="superExpoFactorYaw" class="bf-only"><label>YAW SuperExpo</label><input type="number" step="0.01" min="0" max="1.00"/></td>
<td></td>
</tr>
<tr>
<td></td>
<td name='superExpoYawMode' class="bf-only"><select><!-- list generated here --></select></td>
<td></td>
</tr>

</tbody>
</table>
<table class="parameter cf">
Expand All @@ -962,7 +902,7 @@ <h5 class="modal-title-craft"></h5>
</thead>
<tbody>
<tr>
<td name='fast_pwm_protocol'><label>Protocol</label><select><!-- list generated here --></select></td>
<td name='motor_pwm_protocol'><label>Protocol</label><select><!-- list generated here --></select></td>
<td name="motor_pwm_rate"><label>Motor Rate</label><input type="number" step="1" min="0" max="32000"/></td>
</tr>
</tbody>
Expand Down
10 changes: 1 addition & 9 deletions js/flightlog_fielddefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,7 @@ var
]),

SERIALRX_PROVIDER = makeReadOnly([
"SPEK1024",
"SPEK2048",
"SBUS",
"SUMD",
"SUMH",
"XB-B",
"XB-B-RJ01",
"IBUS",
"JETIEXBUS"
"SPEK1024", "SPEK2048", "SBUS", "SUMD", "SUMH", "XB-B", "XB-B-RJ01", "IBUS", "JETIEXBUS", "CRSF", "FPORT", "SBUS_FAST"
]),

FILTER_TYPE = makeReadOnly([
Expand Down
97 changes: 50 additions & 47 deletions js/flightlog_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ var FlightLogParser = function(logData) {
superExpoFactor:null, // Super Expo Factor
rates:[null, null, null], // Rates [ROLL, PITCH, YAW]
looptime:null, // Looptime
gyro_sync_denom:null, // Gyro Sync Denom
pid_process_denom:null, // PID Process Denom
pidController:null, // Active PID Controller
rollPID:[null, null, null], // Roll [P, I, D]
Expand All @@ -221,20 +220,14 @@ var FlightLogParser = function(logData) {
levelPID:[null, null, null], // Level Mode [P, I, D]
magPID:null, // Magnetometer P
velPID:[null, null, null], // Velocity [P, I, D]
yaw_p_limit:null, // Yaw P Limit
yaw_lpf_hz:null, // Yaw LowPass Filter Hz
dterm_average_count:null, // DTerm Average Count
rollPitchItermResetRate:null, // ITerm Reset rate for Roll and Pitch
yawItermResetRate:null, // ITerm Reset Rate for Yaw
dterm_lpf_hz:null, // DTerm Lowpass Filter Hz
dterm_differentiator:null, // DTerm Differentiator
H_sensitivity:null, // Horizon Sensitivity
iterm_reset_offset:null, // I-Term reset offset
deadband:null, // Roll, Pitch Deadband
yaw_deadband:null, // Yaw Deadband
gyro_lpf:null, // Gyro lpf setting.
gyro_lowpass_hz:null, // Gyro Soft Lowpass Filter Hz
gyro_stage2_lowpass_hz:null, // Stage 2 gyro LPF cutoff Hz
gyro_lpf_hz:null, // Gyro Soft Lowpass Filter Hz
gyro_notch_hz:null, // Gyro Notch Frequency
gyro_notch_cutoff:null, // Gyro Notch Cutoff
dterm_notch_hz:null, // Dterm Notch Frequency
Expand All @@ -243,25 +236,41 @@ var FlightLogParser = function(logData) {
acc_hardware:null, // Accelerometer Hardware type
baro_hardware:null, // Barometer Hardware type
mag_hardware:null, // Magnetometer Hardware type
gyro_cal_on_first_arm:null, // Gyro Calibrate on first arm
vbat_pid_compensation:null, // VBAT PID compensation
rc_smoothing:null, // RC Control Smoothing
rc_interpolation:null, // RC Control Interpolation type
rc_interpolation_interval:null, // RC Control Interpolation Interval
dterm_filter_type:null, // D term filtering type (PT1, BIQUAD)
pidAtMinThrottle:null, // Stabilisation at zero throttle
itermThrottleGain:null, // Betaflight PID
ptermSetpointWeight:null, // Betaflight PID
dtermSetpointWeight:null, // Betaflight PID
yawRateAccelLimit:null, // Betaflight PID
rateAccelLimit:null, // Betaflight PID
dterm_setpoint_weight:null, // Betaflight PID
axisAccelerationLimitYaw:null, // Betaflight PID
axisAccelerationLimitRollPitch:null, // Betaflight PID
gyro_soft_type:null, // Gyro soft filter type (PT1, BIQUAD)
debug_mode:null, // Selected Debug Mode
features:null, // Activated features (e.g. MOTORSTOP etc)
Craft_name:null, // Craft Name
motorOutput:[null,null], // Minimum and maximum outputs to motor's
digitalIdleOffset:null, // min throttle for d-shot (as a percentage)
waypoints:[null,null], // Number of nav. waypoints / is waypoint list valid
dterm_lpf_type: null,
dterm_lpf2_hz: null,
dterm_lpf2_type: null,
gyro_lpf_type: null,
gyro_lpf2_hz: null,
dynamicGyroNotchRange: null,
dynamicGyroNotchQ: null,
dynamicGyroNotchMinHz: null,
acc_notch_hz: null,
acc_notch_cutoff: null,
pidSumLimit: null,
pidSumLimitYaw: null,
axisAccelerationLimitYaw: null,
axisAccelerationLimitRollPitch: null,
rpm_gyro_filter_enabled: null,
rpm_gyro_harmonics: null,
rpm_gyro_min_hz: null,
rpm_gyro_q: null,
unknownHeaders : [] // Unknown Extra Headers
},

Expand Down Expand Up @@ -417,58 +426,59 @@ var FlightLogParser = function(logData) {
case "airmode_activate_throttle":
case "serialrx_provider":
case "looptime":
case "gyro_sync_denom":
case "pid_process_denom":
case "pidController":
case "yaw_p_limit":
case "dterm_average_count":
case "rollPitchItermResetRate":
case "yawItermResetRate":
case "rollPitchItermIgnoreRate":
case "yawItermIgnoreRate":
case "dterm_differentiator":
case "deltaMethod":
case "dynamic_dterm_threshold":
case "dynamic_pterm":
case "iterm_reset_offset":
case "deadband":
case "yaw_deadband":
case "gyro_lpf":
case "acc_lpf_hz":
case "acc_hardware":
case "baro_hardware":
case "mag_hardware":
case "gyro_cal_on_first_arm":
case "vbat_pid_compensation":
case "rc_smoothing":
case "superExpoYawMode":
case "features":
case "dynamic_pid":
case "rc_interpolation":
case "rc_interpolation_interval":
case "unsynced_fast_pwm":
case "fast_pwm_protocol":
case "motor_pwm_protocol":
case "motor_pwm_rate":
case "vbatscale":
case "vbatref":
case "acc_1G":
case "dterm_filter_type":
case "pidAtMinThrottle":
case "anti_gravity_threshold":
case "itermWindupPointPercent":
case "ptermSRateWeight":
case "setpointRelaxRatio":
case "dtermSetpointWeight":
case "gyro_soft_type":
case "debug_mode":
case "dterm_cut_hz":
case "acc_cut_hz":
case "yaw_lpf_hz":
case "gyro_lowpass_hz":
case "gyro_stage2_lowpass_hz":
case "gyro_lpf_hz":
case "dterm_notch_hz":
case "dterm_notch_cutoff":
case "dterm_lpf_hz":
case "dterm_lpf_type":
case "dterm_lpf2_hz":
case "dterm_lpf2_type":
case "gyro_lpf_type":
case "gyro_lpf2_hz":
case "dynamicGyroNotchRange":
case "dynamicGyroNotchQ":
case "dynamicGyroNotchMinHz":
case "acc_notch_hz":
case "acc_notch_cutoff":
case "pidSumLimit":
case "pidSumLimitYaw":
case "axisAccelerationLimitYaw":
case "axisAccelerationLimitRollPitch":
case "rpm_gyro_filter_enabled":
case "rpm_gyro_harmonics":
case "rpm_gyro_min_hz":
case "rpm_gyro_q":
that.sysConfig[fieldName] = parseInt(fieldValue, 10);
break;

Expand All @@ -484,7 +494,7 @@ var FlightLogParser = function(logData) {
break;

case "gyro_lpf_hz":
that.sysConfig["gyro_lowpass_hz"] = parseInt(fieldValue, 10);
that.sysConfig["gyro_lpf_hz"] = parseInt(fieldValue, 10);
break;

case "waypoints":
Expand Down Expand Up @@ -513,10 +523,6 @@ var FlightLogParser = function(logData) {
that.sysConfig.thrExpo = parseInt(fieldValue, 10);
break;
case "setpoint_relaxation_ratio":
that.sysConfig.setpointRelaxRatio = parseInt(fieldValue, 10);
break;
case "dterm_setpoint_weight":
that.sysConfig.dtermSetpointWeight = parseInt(fieldValue, 10);
break;
case "gyro_lowpass_type":
that.sysConfig.gyro_soft_type = parseInt(fieldValue, 10);
Expand All @@ -527,24 +533,16 @@ var FlightLogParser = function(logData) {
case "dshot_idle_value":
that.sysConfig.digitalIdleOffset = parseInt(fieldValue, 10);
break;
case "acc_limit":
that.sysConfig.rateAccelLimit = parseInt(fieldValue, 10);
break;
case "acc_limit_yaw":
that.sysConfig.yawRateAccelLimit = parseInt(fieldValue, 10);
case "axisAccelerationLimitYaw":
that.sysConfig.axisAccelerationLimitYaw = parseInt(fieldValue, 10);
break;
case "iterm_windup":
that.sysConfig.itermWindupPointPercent = parseInt(fieldValue, 10);
break;
case "motor_pwm_protocol":
that.sysConfig.fast_pwm_protocol = parseInt(fieldValue, 10);
break;
case "tpa_rate":
that.sysConfig.dynThrPID = parseInt(fieldValue, 10);
break;

case "yawRateAccelLimit":
case "rateAccelLimit":
case "anti_gravity_gain":
that.sysConfig[fieldName] = uint32ToFloat(fieldValue, 10);
break;
Expand Down Expand Up @@ -640,6 +638,11 @@ var FlightLogParser = function(logData) {
case "Device UID":
that.sysConfig.deviceUID = fieldValue;
break;

case "dterm_setpoint_weight":
that.sysConfig[fieldName] = parseFloat(fieldValue, 10);
break;

default:
if ((matches = fieldName.match(/^Field (.) (.+)$/))) {
var
Expand Down
Loading

0 comments on commit 8b09aeb

Please sign in to comment.