Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename d_min related values #775

Merged
merged 2 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -724,12 +724,12 @@ <h5 class="modal-title-revision"></h5>
<th name="Integral">
<label>I</label>
</th>
<th name="D_Max">
<label>D_Max</label>
</th>
<th name="Derivative">
<label>D</label>
</th>
<th name="D_Max">
<label>D Max</label>
</th>
<th name="Feedforward">
<label>FF</label>
</th>
Expand All @@ -747,7 +747,7 @@ <h5 class="modal-title-revision"></h5>
<input type="text" name="d" step="1" min="0" max="255" />
</td>
<td>
<input type="text" name="d_min_roll" step="1" min="0" max="255" />
<input type="text" name="dMax" step="1" min="0" max="255" />
</td>
<td>
<input type="text" name="f" step="1" min="0" max="255" />
Expand All @@ -766,7 +766,7 @@ <h5 class="modal-title-revision"></h5>
<input type="text" name="d" step="1" min="0" max="255" />
</td>
<td>
<input type="text" name="d_min_pitch" step="1" min="0" max="255" />
<input type="text" name="dMax" step="1" min="0" max="255" />
</td>
<td>
<input type="text" name="f" step="1" min="0" max="255" />
Expand All @@ -785,7 +785,7 @@ <h5 class="modal-title-revision"></h5>
<input type="text" name="d" step="1" min="0" max="255" />
</td>
<td>
<input type="text" name="d_min_yaw" step="1" min="0" max="255" />
<input type="text" name="dMax" step="1" min="0" max="255" />
</td>
<td>
<input type="text" name="f" step="1" min="0" max="255" />
Expand Down Expand Up @@ -928,8 +928,8 @@ <h5 class="modal-title-revision"></h5>
<label>D gain</label>
<input type="text" step="1" min="0" max="200" />
</td>
<td name="simplified_dmax_gain" class="bf-only">
<label>Dmax</label>
<td name="simplified_d_max_gain" class="bf-only">
<label>D Max</label>
<input type="text" step="1" min="0" max="200" />
</td>
</tr>
Expand Down Expand Up @@ -995,19 +995,19 @@ <h5 class="modal-title-revision"></h5>
</tbody>
</table>

<table id="d_min" class="parameter cf">
<table id="d_max" class="parameter cf">
<thead>
<tr>
<th colspan="5">D Max</th>
</tr>
</thead>
<tbody>
<tr>
<td name="d_min_gain" class="bf-only">
<td name="d_max_gain" class="bf-only">
<label>Gain</label>
<input type="text" step="1" min="0" max="100" />
</td>
<td name="d_min_advance" class="bf-only">
<td name="d_max_advance" class="bf-only">
<label>Advance</label>
<input type="text" step="1" min="0" max="200" />
</td>
Expand Down
2 changes: 1 addition & 1 deletion src/flightlog_fielddefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export const DEBUG_MODE_COMPLETE = makeReadOnly([
"RX_SPECTRUM_SPI",
"DSHOT_RPM_TELEMETRY",
"RPM_FILTER",
"D_MIN",
"D_MAX",
"AC_CORRECTION",
"AC_ERROR",
"DUAL_GYRO_SCALED",
Expand Down
8 changes: 4 additions & 4 deletions src/flightlog_fields_presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ const DEBUG_FRIENDLY_FIELD_NAMES_INITIAL = {
"debug[6]": "Not Used",
"debug[7]": "Not Used",
},
D_MIN: {
"debug[all]": "D_MIN",
D_MAX: {
"debug[all]": "D_MAX",
"debug[0]": "Gyro Factor [roll]",
"debug[1]": "Setpoint Factor [roll]",
"debug[2]": "Actual D [roll]",
Expand Down Expand Up @@ -1850,7 +1850,7 @@ FlightLogFieldPresenter.decodeDebugFieldToFriendly = function (
).toFixed(0)} hz`;
case "RPM_FILTER":
return `${(value * 60).toFixed(0)}rpm / ${value.toFixed(0)} Hz`;
case "D_MIN":
case "D_MAX":
switch (fieldName) {
case "debug[0]": // roll gyro factor
case "debug[1]": // roll setpoint Factor
Expand Down Expand Up @@ -2506,7 +2506,7 @@ FlightLogFieldPresenter.ConvertDebugFieldValue = function (
return toFriendly ? (value * 200) / pole : (value * pole) / 200;
case "RPM_FILTER":
return toFriendly ? value * 60 : value / 60;
case "D_MIN":
case "D_MAX":
switch (fieldName) {
case "debug[0]": // roll gyro factor
case "debug[1]": // roll setpoint Factor
Expand Down
30 changes: 15 additions & 15 deletions src/flightlog_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ export function FlightLogParser(logData) {
pidSumLimit: null, // PID sum limit
pidSumLimitYaw: null, // PID sum limit yaw
use_integrated_yaw: null, // Use integrated yaw
d_min: [null, null, null], // D_Min [P, I, D]
d_min_gain: null, // D_Min gain - D_Max in 4.3
d_min_advance: null, // D_Min advance - D_Max in 4.3
d_max: [null, null, null], // D_MAX [P, I, D]
d_max_gain: null, // D_MAX gain
d_max_advance: null, // D_MAX advance
iterm_relax: null, // ITerm Relax mode
iterm_relax_type: null, // ITerm Relax type
iterm_relax_cutoff: null, // ITerm Relax cutoff
Expand Down Expand Up @@ -326,7 +326,7 @@ export function FlightLogParser(logData) {
simplified_pi_gain: null,
simplified_i_gain: null,
simplified_d_gain: null,
simplified_dmax_gain: null,
simplified_d_max_gain: null,
simplified_feedforward_gain: null,
simplified_pitch_d_gain: null,
simplified_pitch_pi_gain: null,
Expand Down Expand Up @@ -370,8 +370,8 @@ export function FlightLogParser(logData) {
dterm_lpf2_static_hz: "dterm_lpf2_hz",
dterm_setpoint_weight: "dtermSetpointWeight",
digital_idle_value: "digitalIdleOffset",
d_max_gain: "d_min_gain",
d_max_advance: "d_min_advance",
d_max_gain: "d_max_gain",
d_max_advance: "d_max_advance",
dshot_idle_value: "digitalIdleOffset",
dyn_idle_min_rpm: "dynamic_idle_min_rpm",
feedforward_transition: "ff_transition",
Expand Down Expand Up @@ -696,8 +696,8 @@ export function FlightLogParser(logData) {
case "anti_gravity_cutoff_hz":
case "abs_control_gain":
case "use_integrated_yaw":
case "d_min_gain":
case "d_min_advance":
case "d_max_gain":
case "d_max_advance":
case "dshot_bidir":
case "gyro_rpm_notch_harmonics":
case "gyro_rpm_notch_q":
Expand Down Expand Up @@ -731,7 +731,7 @@ export function FlightLogParser(logData) {
case "simplified_pi_gain":
case "simplified_i_gain":
case "simplified_d_gain":
case "simplified_dmax_gain":
case "simplified_d_max_gain":
case "simplified_feedforward_gain":
case "simplified_pitch_d_gain":
case "simplified_pitch_pi_gain":
Expand Down Expand Up @@ -868,12 +868,12 @@ export function FlightLogParser(logData) {
case "magPID":
that.sysConfig.magPID = parseCommaSeparatedString(fieldValue, 3); //[parseInt(fieldValue, 10), null, null];
break;
case "d_min":
// Add Dmin values as Derivative numbers to PID array
var dMinValues = parseCommaSeparatedString(fieldValue);
that.sysConfig["rollPID"].push(dMinValues[0]);
that.sysConfig["pitchPID"].push(dMinValues[1]);
that.sysConfig["yawPID"].push(dMinValues[2]);
case "d_max":
// Add D MAX values as Derivative numbers to PID array
var dMaxValues = parseCommaSeparatedString(fieldValue);
that.sysConfig["rollPID"].push(dMaxValues[0]);
that.sysConfig["pitchPID"].push(dMaxValues[1]);
that.sysConfig["yawPID"].push(dMaxValues[2]);
break;
case "ff_weight":
// Add feedforward values to the PID array
Expand Down
2 changes: 1 addition & 1 deletion src/graph_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ GraphConfig.getDefaultCurveForField = function (flightLog, fieldName) {
"debug[2]",
"debug[3]"
);
case "D_MIN":
case "D_MAX":
switch (fieldName) {
case "debug[0]": // roll gyro factor
case "debug[1]": // roll setpoint Factor
Expand Down
20 changes: 10 additions & 10 deletions src/header_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ export function HeaderDialog(dialog, onSave) {
max: "999.9.9",
},
{
name: "simplified_dmax_gain",
name: "simplified_d_max_gain",
type: FIRMWARE_TYPE_BETAFLIGHT,
min: "4.3.0",
max: "999.9.9",
Expand Down Expand Up @@ -1692,24 +1692,24 @@ export function HeaderDialog(dialog, onSave) {
setParameter("rcSmoothingActiveCutoffsThr", "0", 0);
}

// D_MIN and rate_limits
// D_MAX and rate_limits
if (
activeSysConfig.firmwareType == FIRMWARE_TYPE_BETAFLIGHT &&
semver.gte(activeSysConfig.firmwareVersion, "4.0.0")
) {
setParameter("d_min_roll", sysConfig.d_min[0], 0);
setParameter("d_min_pitch", sysConfig.d_min[1], 0);
setParameter("d_min_yaw", sysConfig.d_min[2], 0);
setParameter("d_min_gain", sysConfig.d_min_gain, 0);
setParameter("d_min_advance", sysConfig.d_min_advance, 0);
$("#d_min").show();
setParameter("d_max_roll", sysConfig.d_max[0], 0);
setParameter("d_max_pitch", sysConfig.d_max[1], 0);
setParameter("d_max_yaw", sysConfig.d_max[2], 0);
setParameter("d_max_gain", sysConfig.d_max_gain, 0);
setParameter("d_max_advance", sysConfig.d_max_advance, 0);
$("#d_max").show();

setParameter("rate_limits_roll", sysConfig.rate_limits[0], 0);
setParameter("rate_limits_pitch", sysConfig.rate_limits[1], 0);
setParameter("rate_limits_yaw", sysConfig.rate_limits[2], 0);
$("#rate_limits").show();
} else {
$("#d_min").hide();
$("#d_max").hide();
$("#rate_limits").hide();
}

Expand Down Expand Up @@ -1823,7 +1823,7 @@ export function HeaderDialog(dialog, onSave) {
setParameter("simplified_pi_gain", sysConfig.simplified_pi_gain, 0);
setParameter("simplified_i_gain", sysConfig.simplified_i_gain, 0);
setParameter("simplified_d_gain", sysConfig.simplified_d_gain, 0);
setParameter("simplified_dmax_gain", sysConfig.simplified_dmax_gain, 0);
setParameter("simplified_d_max_gain", sysConfig.simplified_d_max_gain, 0);
setParameter(
"simplified_feedforward_gain",
sysConfig.simplified_feedforward_gain,
Expand Down