Skip to content

Commit cdeb6f8

Browse files
authored
Merge pull request #238 from McGiverGim/ag_type_rc_smooth_type_header
Add AG type and RC Smoothing type info to Header
2 parents 0cb2613 + fad2fb9 commit cdeb6f8

File tree

4 files changed

+198
-75
lines changed

4 files changed

+198
-75
lines changed

index.html

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,12 @@ <h5 class="modal-title-craft"></h5>
900900
<table class="parameter cf">
901901
<tbody>
902902
<tr>
903+
<td name="antiGravityMode" class="bf-only">
904+
<label>AG Mode</label>
905+
<select>
906+
<!-- list generated here -->
907+
</select>
908+
</td>
903909
<td name="antiGravityGain" class="bf-only">
904910
<label>AG Gain</label>
905911
<input type="number" step="0.01" min="0" max="999" />
@@ -1385,16 +1391,59 @@ <h5 class="modal-title-craft"></h5>
13851391
<table class="parameter cf">
13861392
<tbody>
13871393
<tr>
1394+
<th colspan="5">RC Smoothing</th>
1395+
</tr>
1396+
<tr>
1397+
<td name='rc_smoothing_type'>
1398+
<label>Type</label>
1399+
<select>
1400+
<!-- list generated here -->
1401+
</select>
1402+
</td>
13881403
<td name='rc_interpolation'>
1389-
<label>RC Interpolation</label>
1404+
<label>Interpolation</label>
13901405
<select>
13911406
<!-- list generated here -->
13921407
</select>
13931408
</td>
13941409
<td name="rc_interpolation_interval">
1395-
<label>RC Interval (ms)</label>
1410+
<label>Interval (ms)</label>
13961411
<input type="number" step="0.01" min="0" max="999.00" />
13971412
</td>
1413+
<td name="rc_smoothing_cutoffs_1">
1414+
<label>Input Hz</label>
1415+
<input type="number" step="1" min="0" max="255" />
1416+
</td>
1417+
<td name="rc_smoothing_cutoffs_2">
1418+
<label>Derivative Hz</label>
1419+
<input type="number" step="1" min="0" max="255" />
1420+
</td>
1421+
</tr>
1422+
<tr>
1423+
<td name="rc_smoothing_rx_average">
1424+
<label>RX Average (ms)</label>
1425+
<input type="number" step="0.1" min="0"/>
1426+
</td>
1427+
<td name='rc_smoothing_filter_type_1'>
1428+
<label>Input Type</label>
1429+
<select>
1430+
<!-- list generated here -->
1431+
</select>
1432+
</td>
1433+
<td name='rc_smoothing_filter_type_2'>
1434+
<label>Derivative Type</label>
1435+
<select>
1436+
<!-- list generated here -->
1437+
</select>
1438+
</td>
1439+
</tr>
1440+
<tr>
1441+
<td name='rc_smoothing_debug_axis'>
1442+
<label>Debug Axis</label>
1443+
<select>
1444+
<!-- list generated here -->
1445+
</select>
1446+
</td>
13981447
</tr>
13991448
</tbody>
14001449
</table>

js/flightlog_fielddefs.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,34 @@ var
200200
"JETIEXBUS"
201201
]),
202202

203+
ANTI_GRAVITY_MODE = makeReadOnly([
204+
"SMOOTH",
205+
"STEP"
206+
]),
207+
208+
RC_SMOOTHING_TYPE = makeReadOnly([
209+
"INTERPOLATION",
210+
"FILTER"
211+
]),
212+
213+
RC_SMOOTHING_INPUT_TYPE = makeReadOnly([
214+
"PT1",
215+
"BIQUAD"
216+
]),
217+
218+
RC_SMOOTHING_DERIVATIVE_TYPE = makeReadOnly([
219+
"OFF",
220+
"PT1",
221+
"BIQUAD"
222+
]),
223+
224+
RC_SMOOTHING_DEBUG_AXIS = makeReadOnly([
225+
"ROLL",
226+
"PITCH",
227+
"YAW",
228+
"THROTTLE"
229+
]),
230+
203231
RC_INTERPOLATION = makeReadOnly([
204232
"OFF",
205233
"DEFAULT",

js/flightlog_parser.js

Lines changed: 84 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -199,76 +199,84 @@ var FlightLogParser = function(logData) {
199199
// standard logger.
200200

201201
defaultSysConfigExtension = {
202-
thrMid:null, // Throttle Mid Position
203-
thrExpo:null, // Throttle Expo
204-
tpa_breakpoint:null, // TPA Breakpoint
205-
airmode_activate_throttle:null, // airmode activation level
206-
serialrx_provider:null, // name of the serial rx provider
207-
superExpoFactor:null, // Super Expo Factor
208-
rates:[null, null, null], // Rates [ROLL, PITCH, YAW]
209-
rc_rates:[null, null, null], // RC Rates [ROLL, PITCH, YAW]
210-
rc_expo:[null, null, null], // RC Expo [ROLL, PITCH, YAW]
211-
looptime:null, // Looptime
212-
gyro_sync_denom:null, // Gyro Sync Denom
213-
pid_process_denom:null, // PID Process Denom
214-
pidController:null, // Active PID Controller
215-
rollPID:[null, null, null], // Roll [P, I, D]
216-
pitchPID:[null, null, null], // Pitch[P, I, D]
217-
yawPID:[null, null, null], // Yaw [P, I, D]
218-
feedforward_transition:null, // Feedforward transition
219-
altPID:[null, null, null], // Altitude Hold [P, I, D]
220-
posPID:[null, null, null], // Position Hold [P, I, D]
221-
posrPID:[null, null, null], // Position Rate [P, I, D]
222-
navrPID:[null, null, null], // Nav Rate [P, I, D]
223-
levelPID:[null, null, null], // Level Mode [P, I, D]
224-
magPID:null, // Magnetometer P
225-
velPID:[null, null, null], // Velocity [P, I, D]
226-
yaw_p_limit:null, // Yaw P Limit
227-
yaw_lpf_hz:null, // Yaw LowPass Filter Hz
228-
dterm_average_count:null, // DTerm Average Count
229-
rollPitchItermResetRate:null, // ITerm Reset rate for Roll and Pitch
230-
yawItermResetRate:null, // ITerm Reset Rate for Yaw
231-
dterm_lpf_hz:null, // DTerm Lowpass Filter Hz
232-
dterm_lpf2_hz:null, // DTerm Lowpass Filter Hz 2
233-
dterm_differentiator:null, // DTerm Differentiator
234-
H_sensitivity:null, // Horizon Sensitivity
235-
iterm_reset_offset:null, // I-Term reset offset
236-
deadband:null, // Roll, Pitch Deadband
237-
yaw_deadband:null, // Yaw Deadband
238-
gyro_lpf:null, // Gyro lpf setting.
239-
gyro_32khz_hardware_lpf:null, // Gyro 32khz hardware lpf setting. (post BF3.4)
240-
gyro_lowpass_hz:null, // Gyro Soft Lowpass Filter Hz
241-
gyro_lowpass2_hz:null, // Gyro Soft Lowpass Filter Hz 2
242-
gyro_notch_hz:null, // Gyro Notch Frequency
243-
gyro_notch_cutoff:null, // Gyro Notch Cutoff
244-
dterm_notch_hz:null, // Dterm Notch Frequency
245-
dterm_notch_cutoff:null, // Dterm Notch Cutoff
246-
acc_lpf_hz:null, // Accelerometer Lowpass filter Hz
247-
acc_hardware:null, // Accelerometer Hardware type
248-
baro_hardware:null, // Barometer Hardware type
249-
mag_hardware:null, // Magnetometer Hardware type
250-
gyro_cal_on_first_arm:null, // Gyro Calibrate on first arm
251-
vbat_pid_compensation:null, // VBAT PID compensation
252-
rc_smoothing:null, // RC Control Smoothing
253-
rc_interpolation:null, // RC Control Interpolation type
254-
rc_interpolation_interval:null, // RC Control Interpolation Interval
255-
dterm_filter_type:null, // D term filtering type (PT1, BIQUAD)
256-
pidAtMinThrottle:null, // Stabilisation at zero throttle
257-
itermThrottleGain:null, // Betaflight PID
258-
ptermSetpointWeight:null, // Betaflight PID
259-
dtermSetpointWeight:null, // Betaflight PID
260-
yawRateAccelLimit:null, // Betaflight PID
261-
rateAccelLimit:null, // Betaflight PID
262-
gyro_soft_type:null, // Gyro soft filter type (PT1, BIQUAD)
263-
gyro_soft2_type:null, // Gyro soft filter 2 type (PT1, BIQUAD)
264-
debug_mode:null, // Selected Debug Mode
265-
features:null, // Activated features (e.g. MOTORSTOP etc)
266-
Craft_name:null, // Craft Name
267-
motorOutput:[null,null], // Minimum and maximum outputs to motor's
268-
digitalIdleOffset:null, // min throttle for d-shot (as a percentage)
269-
pidSumLimit:null, // PID sum limit
270-
pidSumLimitYaw:null, // PID sum limit yaw
271-
unknownHeaders : [] // Unknown Extra Headers
202+
anti_gravity_gain:null, // Anti gravity gain
203+
anti_gravity_mode:null, // Anti gravity mode
204+
anti_gravity_threshold:null, // Anti gravity threshold for step mode
205+
thrMid:null, // Throttle Mid Position
206+
thrExpo:null, // Throttle Expo
207+
tpa_breakpoint:null, // TPA Breakpoint
208+
airmode_activate_throttle:null, // airmode activation level
209+
serialrx_provider:null, // name of the serial rx provider
210+
superExpoFactor:null, // Super Expo Factor
211+
rates:[null, null, null], // Rates [ROLL, PITCH, YAW]
212+
rc_rates:[null, null, null], // RC Rates [ROLL, PITCH, YAW]
213+
rc_expo:[null, null, null], // RC Expo [ROLL, PITCH, YAW]
214+
looptime:null, // Looptime
215+
gyro_sync_denom:null, // Gyro Sync Denom
216+
pid_process_denom:null, // PID Process Denom
217+
pidController:null, // Active PID Controller
218+
rollPID:[null, null, null], // Roll [P, I, D]
219+
pitchPID:[null, null, null], // Pitch[P, I, D]
220+
yawPID:[null, null, null], // Yaw [P, I, D]
221+
feedforward_transition:null, // Feedforward transition
222+
altPID:[null, null, null], // Altitude Hold [P, I, D]
223+
posPID:[null, null, null], // Position Hold [P, I, D]
224+
posrPID:[null, null, null], // Position Rate [P, I, D]
225+
navrPID:[null, null, null], // Nav Rate [P, I, D]
226+
levelPID:[null, null, null], // Level Mode [P, I, D]
227+
magPID:null, // Magnetometer P
228+
velPID:[null, null, null], // Velocity [P, I, D]
229+
yaw_p_limit:null, // Yaw P Limit
230+
yaw_lpf_hz:null, // Yaw LowPass Filter Hz
231+
dterm_average_count:null, // DTerm Average Count
232+
rollPitchItermResetRate:null, // ITerm Reset rate for Roll and Pitch
233+
yawItermResetRate:null, // ITerm Reset Rate for Yaw
234+
dterm_lpf_hz:null, // DTerm Lowpass Filter Hz
235+
dterm_lpf2_hz:null, // DTerm Lowpass Filter Hz 2
236+
dterm_differentiator:null, // DTerm Differentiator
237+
H_sensitivity:null, // Horizon Sensitivity
238+
iterm_reset_offset:null, // I-Term reset offset
239+
deadband:null, // Roll, Pitch Deadband
240+
yaw_deadband:null, // Yaw Deadband
241+
gyro_lpf:null, // Gyro lpf setting.
242+
gyro_32khz_hardware_lpf:null, // Gyro 32khz hardware lpf setting. (post BF3.4)
243+
gyro_lowpass_hz:null, // Gyro Soft Lowpass Filter Hz
244+
gyro_lowpass2_hz:null, // Gyro Soft Lowpass Filter Hz 2
245+
gyro_notch_hz:null, // Gyro Notch Frequency
246+
gyro_notch_cutoff:null, // Gyro Notch Cutoff
247+
dterm_notch_hz:null, // Dterm Notch Frequency
248+
dterm_notch_cutoff:null, // Dterm Notch Cutoff
249+
acc_lpf_hz:null, // Accelerometer Lowpass filter Hz
250+
acc_hardware:null, // Accelerometer Hardware type
251+
baro_hardware:null, // Barometer Hardware type
252+
mag_hardware:null, // Magnetometer Hardware type
253+
gyro_cal_on_first_arm:null, // Gyro Calibrate on first arm
254+
vbat_pid_compensation:null, // VBAT PID compensation
255+
rc_smoothing:null, // RC Control Smoothing
256+
rc_smoothing_type:null, // Type of the RC Smoothing
257+
rc_interpolation:null, // RC Control Interpolation type
258+
rc_interpolation_interval:null, // RC Control Interpolation Interval
259+
rc_smoothing_cutoffs:[null, null], // RC Smoothing input and derivative cutoff
260+
rc_smoothing_filter_type:[null,null], // RC Smoothing input and derivative type
261+
rc_smoothing_rx_average:null, // RC Smoothing rx average readed in ms
262+
rc_smoothing_debug_axis:null, // Axis recorded in the debug mode of rc_smoothing
263+
dterm_filter_type:null, // D term filtering type (PT1, BIQUAD)
264+
pidAtMinThrottle:null, // Stabilisation at zero throttle
265+
itermThrottleGain:null, // Betaflight PID
266+
ptermSetpointWeight:null, // Betaflight PID
267+
dtermSetpointWeight:null, // Betaflight PID
268+
yawRateAccelLimit:null, // Betaflight PID
269+
rateAccelLimit:null, // Betaflight PID
270+
gyro_soft_type:null, // Gyro soft filter type (PT1, BIQUAD)
271+
gyro_soft2_type:null, // Gyro soft filter 2 type (PT1, BIQUAD)
272+
debug_mode:null, // Selected Debug Mode
273+
features:null, // Activated features (e.g. MOTORSTOP etc)
274+
Craft_name:null, // Craft Name
275+
motorOutput:[null,null], // Minimum and maximum outputs to motor's
276+
digitalIdleOffset:null, // min throttle for d-shot (as a percentage)
277+
pidSumLimit:null, // PID sum limit
278+
pidSumLimitYaw:null, // PID sum limit yaw
279+
unknownHeaders : [] // Unknown Extra Headers
272280
},
273281

274282
// Translation of the field values name to the sysConfig var where it must be stored
@@ -527,6 +535,9 @@ var FlightLogParser = function(logData) {
527535
case "gyro_cal_on_first_arm":
528536
case "vbat_pid_compensation":
529537
case "rc_smoothing":
538+
case "rc_smoothing_type":
539+
case "rc_smoothing_debug_axis":
540+
case "rc_smoothing_rx_average":
530541
case "superExpoYawMode":
531542
case "features":
532543
case "dynamic_pid":
@@ -551,6 +562,7 @@ var FlightLogParser = function(logData) {
551562
case "gyro_soft_type":
552563
case "gyro_soft2_type":
553564
case "debug_mode":
565+
case "anti_gravity_mode":
554566
case "anti_gravity_gain":
555567
that.sysConfig[fieldName] = parseInt(fieldValue, 10);
556568
break;
@@ -640,6 +652,8 @@ var FlightLogParser = function(logData) {
640652
case "levelPID":
641653
case "velPID":
642654
case "motorOutput":
655+
case "rc_smoothing_cutoffs":
656+
case "rc_smoothing_filter_type":
643657
that.sysConfig[fieldName] = parseCommaSeparatedString(fieldValue);
644658
break;
645659
case "magPID":

0 commit comments

Comments
 (0)