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
Auto-tuning of angular rates and attitude controllers (MC version) #18311
Merged
Conversation
This file contains 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
bresch
force-pushed
the
pr-autotune
branch
2 times, most recently
from
October 1, 2021 08:52
bb3da99
to
9dd774e
Compare
I'll see if I can get this building everywhere. |
dagar
force-pushed
the
pr-autotune
branch
3 times, most recently
from
October 2, 2021 17:59
0f61201
to
6d1a9b6
Compare
- adjust flash constrianed targets to fit
PetervdPerk-NXP
added a commit
to PetervdPerk-NXP/Firmware
that referenced
this pull request
Oct 6, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Describe problem solved by this pull request
Trial and error manual tuning requires good piloting skills and tuning experience. The new module
mc_autotune_attitude_control
introduced in this PR is an attempt to address these issues by automating this tuning process.More than this, the result of the system identification algorithm included in this module will be helpful to the control systems engineer to obtain a simple discrete-time model of the system that can be later used for offline controller design of more sophisticated controllers.
Describe your solution
The auto-tuning introduced in this PR is based on indirect (online closed-loop system identification + controller design) adaptive control theory. Running at relatively high speed in real time on a microcontroller, only recursive filters and estimators have been used. For the same reason, the PID designer (based on General Minimum Variance Control) uses a pre-computed closed-form solution to obtain the result of the optimization problem.
For more details, see:
MathieuBresciani_Controllers_auto-tuning_for_multirotors_and_fixed-wing_vehicles.pdf
and the recorded presentation (PX4 Dev Summit 2021):
https://www.youtube.com/watch?v=Yzhjlo5FnCU&t=2s&ab_channel=PX4Autopilot-OpenSourceFlightControl.
How to use it?
IMPORTANT: moving the roll/pitch stick of the remote during identification will immediately abort the process. It can be started again using the
MC_AT_START
parameter.It will soon be a single click on a button in the "Tuning" tab of QGC (but it isn't upsreamed at the moment) but for now, it can be triggered manually via the parameter
MC_AT_START
(set to 1, it'll automatically go back to 0 when done). For the rest, follow the documentation in the Skynode manual:https://docs.auterion.com/skynode/advanced-configuration/controllers-auto-tuning
Test data / coverage
SITL jMavSim on this branch:
https://logs.px4.io/plot_app?log=d305531b-5462-4b1c-949f-7f89c2beefab
Result in
autotune_attitude_control_status.msg
From top to bottom:
Replayed on offline Python tool (soon available):
Test on a X500 (same algorithm but different branch):
https://logs.px4.io/plot_app?log=7a2a60fd-dfba-4356-b92b-5dfd687bd579
TODO:
progress
field in the ACK message but it's apparently not there anymore)