-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
APM_Control: add AP_FW_Controller as common base class to roll and pitch controlers #27747
Conversation
This is a example of something it would simplify. #27694 |
I tried this on for size and got bounced: #22023 "Needs a lot of testing" was not the only comment made. From the meeting notes:
... and it was also stated that increasing complexity in this area was not wanted and burning those extra bytes was fine. |
This is awesome. It's a very nice structural change that should make some other things much easier in future. |
efa7a8e
to
209cd68
Compare
Rebased and added enum for autotune type so the |
Thanks Peter, this would be great for a smoother management evolution of automatic controls in the future. |
cce4107
to
755b9ac
Compare
I have added a test that runs a 60 second chirp through the roll and pitch controllers. This is then run in a test matrix with a range of roll/pitch/airspeed/flags. Total runs of 882 (441 for roll and 441 for pitch). The sweep is dumped to a csv with time, angle error, output, rate target, rate actual, rate error, P, I D, FF, DFF, DMod, slew rate, limit flag, PD limit flag, reset flag and I term set flag. The floating point values are printed to four decimal places. There is no change in these output files with the rework. |
Nice cut on H743!
|
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.
I'd like to see some manual testing on:
- inverted flight
- auto-tune
f42c303
to
faee37b
Compare
Wider range of roll and pitch added to the test sweep. Roll from -170 to +180 in 10 get steps, pitch from -80 to + 80 in 10 deg steps. This brings the total number of test runs to 11016, still no change in output. |
c7bbc65
to
244248f
Compare
Added results checking to the existing autotest. Roll is very consistent, values within 2% every time. Pitch is not, there seems to be three solutions for P and two for D. There is no change as a result of this PR, but we might want to look into it... |
…mter is withing a given percentage of the expected value
244248f
to
e944e73
Compare
This moves to a shared base class between the plane roll and pitch controllers, there is lots of shared code which was duplicated. This helps with future tidyups as they now only need to happen in one place.