-
Notifications
You must be signed in to change notification settings - Fork 89
PIDReview: add D_FF PID parameter and data #329
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7b98e0b
PIDReview: add D_FF PID parameter and data
amilcarlucas d7748fc
PIDReview: Address review from Peter Hall
amilcarlucas 0d0bde7
PIDReview: rework DFF addition to work if it is not present.
IamPete1 9eef449
Libraries: have a better go at getting build type without VER message
IamPete1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,65 @@ | ||
| ## PID review | ||
| # PID Review | ||
|
|
||
| A FFT tool for reviewing flight logs and PID settings. A windowed FFT is applied to the logged PID data, the step response is extracted by estimating the transfer function between the target and actual. Log is split in to sections based on parameter changes. | ||
| A browser-based tool for analysing ArduPilot flight logs and evaluating PID tuning quality. | ||
|
|
||
| ## Requirements | ||
|
|
||
| The **PID** bit of the `LOG_BITMASK` parameter should be set before flying so that `PIDx` log messages (`PIDR`, `PIDP`, `PIDY`, `PIQR`, `PIQP`, `PIQY`, `PIDS`, `PIDA`) are recorded. | ||
| Without this the tool will fallback to using the less detailed `RATE` messages and will disable some features. | ||
|
|
||
| ## Supported vehicles | ||
|
|
||
| | Vehicle | Axes / controllers | | ||
| |---------|--------------------| | ||
| | Copter | Roll, Pitch, Yaw rate PIDs (`PIDR/P/Y`) and raw RATE (`RATE R/P/Y`) | | ||
| | Plane | Roll, Pitch, Yaw rate PIDs (`PIDR/P/Y`), VTOL rate PIDs (`PIQR/P/Y`) and VTOL RATE | | ||
| | Rover | Steering rate (`PIDS`) and speed (`PIDA`) controllers | | ||
|
|
||
| ### ArduCopter angle rate control loop | ||
|
|
||
| For this vehicle type, here is the annotated signal diagram: | ||
|
|
||
|  | ||
|
|
||
| ## How to use | ||
|
|
||
| 1. Open the tool in a browser and load a `.bin` log file using the file picker. | ||
| 2. Select the axis / controller to analyse using the radio buttons in the **Axis** panel. | ||
| 3. Optionally narrow the analysis window using the **Start / End** time inputs or by zooming into the **Flight Data** plot and dragging the range slider. | ||
| 4. Click **Calculate** to run the FFT. The button is re-enabled automatically whenever the time range or window size is changed. | ||
|
|
||
| ## Plots | ||
|
|
||
| ### Flight Data | ||
|
|
||
| Overview of roll, pitch, throttle and altitude for the whole flight. | ||
| Use the range slider to set the analysis time window. | ||
|
|
||
| ### Time Domain | ||
|
|
||
| - **Inputs** – target, actual and error signals in the time domain, in deg/s. | ||
| - **Outputs** – individual PID components (P, I, D, FF) and total output in the time domain. | ||
|
|
||
| Multiple test sections (caused by in-flight parameter changes) are shown with coloured background rectangles and can be toggled on/off individually in the **Tests** table. | ||
|
|
||
| ### Frequency Domain (FFT) | ||
|
|
||
| Averaged windowed FFT of the selected PID signals over the chosen time range. | ||
| Each signal (Target, Actual, Error, P, I, D, FF, DFF, Output) can be shown or hidden independently. | ||
|
|
||
| - **Amplitude scale** – Linear, dB, or Power Spectral Density (PSD). | ||
| - **Frequency scale** – Linear or logarithmic, in Hz or RPM. | ||
| - **Window size** – Controls FFT frequency resolution; must be a power of two. Changing it re-enables the Calculate button. | ||
|
|
||
| The **Logging rate** and **Frequency resolution** fields below the checkboxes reflect the actual sample rate and bin width of the computed FFT. | ||
|
|
||
| ### Step Response *(Roll / Pitch / Yaw axes only)* | ||
|
|
||
| Estimates the closed-loop step response from the flight data using a Wiener-filter / transfer-function approach between the target and actual signals. | ||
| Individual window estimates are shown in grey; the mean response is shown as a coloured line. | ||
| Useful for evaluating rise time, overshoot, and overall damping without requiring a dedicated step-input manoeuvre. | ||
|
|
||
| ### PID Spectrogram | ||
|
|
||
| Time–frequency heatmap of the selected PID component. | ||
| Shows how the spectral content of the control signal evolves throughout the flight, making it easy to spot resonances that appear only at certain throttle levels or flight phases. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The D low pass filter is done after the differentiation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done