From aed72ab0e93e8a80603c8a1b0dd3b9267d7bf042 Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Sat, 17 Oct 2026 11:59:44 -0400 Subject: [PATCH 1/4] PIDReview: explain how the step response is found and when it is empty --- PIDReview/PIDReview.js | 9 +++++++++ PIDReview/index.html | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PIDReview/PIDReview.js b/PIDReview/PIDReview.js index d8c50ada..7cd7efb1 100644 --- a/PIDReview/PIDReview.js +++ b/PIDReview/PIDReview.js @@ -132,6 +132,7 @@ function reset() { step_plot.data[i].x = [] step_plot.data[i].y = [] } + document.getElementById("step_note").hidden = true for (let i = 0; i < Spectrogram.data.length; i++) { Spectrogram.data[i].x = [] Spectrogram.data[i].y = [] @@ -1048,6 +1049,7 @@ function redraw_step() { step_plot.data[plot_index].x = [] step_plot.data[plot_index].y = [] } + document.getElementById("step_note").hidden = true if (valid_sets == 0) { Plotly.redraw("step_plot") return @@ -1105,6 +1107,9 @@ function redraw_step() { // Pre-calculate inverse sn = array_inverse(sn) + // Count of sets with at least one step estimate + let sets_with_steps = 0 + // For each data set for (let j = 0; j < num_sets; j++) { if (PID.sets[j] == null) { @@ -1189,6 +1194,7 @@ function redraw_step() { // No good steps, skip this set continue } + sets_with_steps += 1 // Plot mean step_plot.data[plot_index+1].x = time @@ -1201,6 +1207,9 @@ function redraw_step() { } + // Explain an empty plot + document.getElementById("step_note").hidden = (sets_with_steps > 0) + step_plot.layout.yaxis.range = [0, 2] step_plot.layout.yaxis.autorange = false diff --git a/PIDReview/index.html b/PIDReview/index.html index c6b5cae8..6092bb77 100644 --- a/PIDReview/index.html +++ b/PIDReview/index.html @@ -248,8 +248,10 @@

Step Response

@@ -257,6 +259,7 @@

+

From 4d5389f9a61c09640da4a0e8eefd5bdb7df95ca6 Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Mon, 9 Nov 2026 01:21:00 -0500 Subject: [PATCH 2/4] PIDReview: step note review fixes Clear the mean step response with the rest of the plot so an old curve is not left with the note, hide the note when the axis data is set up, give the threshold in the axis units and only give stick advice for rate axes, and reword it as not enough target above the threshold. --- PIDReview/PIDReview.js | 18 +++++++++++++----- PIDReview/index.html | 4 ++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/PIDReview/PIDReview.js b/PIDReview/PIDReview.js index 7cd7efb1..070ab601 100644 --- a/PIDReview/PIDReview.js +++ b/PIDReview/PIDReview.js @@ -404,6 +404,7 @@ function setup_FFT_data() { TimeOutputs.layout.shapes = [] fft_plot.data = [] step_plot.data = [] + document.getElementById("step_note").hidden = true // Add group for each param set @@ -1048,6 +1049,8 @@ function redraw_step() { const plot_index = i*2 step_plot.data[plot_index].x = [] step_plot.data[plot_index].y = [] + step_plot.data[plot_index+1].x = [] + step_plot.data[plot_index+1].y = [] } document.getElementById("step_note").hidden = true if (valid_sets == 0) { @@ -1107,8 +1110,8 @@ function redraw_step() { // Pre-calculate inverse sn = array_inverse(sn) - // Count of sets with at least one step estimate - let sets_with_steps = 0 + // True if there is at least one step estimate + let have_steps = false // For each data set for (let j = 0; j < num_sets; j++) { @@ -1194,7 +1197,7 @@ function redraw_step() { // No good steps, skip this set continue } - sets_with_steps += 1 + have_steps = true // Plot mean step_plot.data[plot_index+1].x = time @@ -1207,8 +1210,13 @@ function redraw_step() { } - // Explain an empty plot - document.getElementById("step_note").hidden = (sets_with_steps > 0) + // Explain an empty plot, the threshold is in the units of the axis + let note = document.getElementById("step_note") + note.hidden = have_steps + note.textContent = "No step response: not enough of the analysis time has a target above 20 " + PID.units + "." + if (PID.units == "deg /s") { + note.textContent += " Select a section with some sharp stick inputs." + } step_plot.layout.yaxis.range = [0, 2] step_plot.layout.yaxis.autorange = false diff --git a/PIDReview/index.html b/PIDReview/index.html index 6092bb77..28f953f6 100644 --- a/PIDReview/index.html +++ b/PIDReview/index.html @@ -250,7 +250,7 @@

data-tippy-content=" Closed loop step response estimated from the logged target and actual rates. Used to evaluate rise time, overshoot, damping, and stability. - Only parts of the flight where the target rate goes above 20 deg/s are used, so the analysis time needs some sharp stick inputs. + Only parts of the flight where the target goes above 20 (deg/s for rate axes) are used, so the analysis time needs some sharp stick inputs. Grey lines are the estimate from each part, the coloured line is their mean. " />

@@ -259,7 +259,7 @@

- +

From fa1a866233fdb65eb046d6523ab72b1dd53db0be Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Mon, 9 Nov 2026 01:21:21 -0500 Subject: [PATCH 3/4] PIDReview: hide the step note at the start of setting up the axis data --- PIDReview/PIDReview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIDReview/PIDReview.js b/PIDReview/PIDReview.js index 070ab601..e97b198e 100644 --- a/PIDReview/PIDReview.js +++ b/PIDReview/PIDReview.js @@ -398,13 +398,13 @@ function get_FFT_data_index(set_num, plot_type) { function setup_FFT_data() { const PID = PID_log_messages[get_axis_index()] + document.getElementById("step_note").hidden = true // Clear existing data TimeInputs.layout.shapes = [] TimeOutputs.layout.shapes = [] fft_plot.data = [] step_plot.data = [] - document.getElementById("step_note").hidden = true // Add group for each param set From c524f589889784b840086aa049068efef850efbd Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Mon, 9 Nov 2026 07:27:12 -0500 Subject: [PATCH 4/4] PIDReview: hide the step note when the calculation is cleared --- PIDReview/PIDReview.js | 1 + 1 file changed, 1 insertion(+) diff --git a/PIDReview/PIDReview.js b/PIDReview/PIDReview.js index e97b198e..0e3c79ae 100644 --- a/PIDReview/PIDReview.js +++ b/PIDReview/PIDReview.js @@ -510,6 +510,7 @@ function clear_calculation() { } // Enable button to fix document.getElementById("calculate").disabled = false + document.getElementById("step_note").hidden = true for (let i = 0; i < PID_log_messages.length; i++) { if ((PID_log_messages[i] == null) || (PID_log_messages[i].sets == null)) {