Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions PIDReview/PIDReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
5 changes: 4 additions & 1 deletion PIDReview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,18 @@ <h2 style="text-align:center">
Step Response
<img id="TT_PID_StepResponse" src="../images/question-circle.svg" style="width: 1em; vertical-align: bottom"
data-tippy-content="
Simulated PID response to a step input.
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.
Grey lines are the estimate from each part, the coloured line is their mean.
" />
</h2>


</td></tr></table>

<div id="step_plot" style="width:1200px;height:450px"></div>
<p id="step_note" style="width:1200px; text-align:center" hidden>No step response: the target rate stayed below 20 deg/s in the analysis time. Select a section with some sharp stick inputs.</p>

<table><tr><td style="width:1200px">
<h2 style="text-align:center">
Expand Down
Loading