ardupilot
ardupilot copied to clipboard
Tradheli Autotune Improvements
This PR was primarily focused on enabling the safe tuning of larger helicopters. I have made other changes along the way that help clean up the code and make it more efficient. Here is a list of changes
- feedforward tuning was switched to a 5 deg attitude frequency dwell test for safety
- all tuning of the rate PIDs is accomplished with a sweep in attitude rather than rate to provide more safety when going to low frequencies for larger vehicles.
- Rate and acceleration limits are used and included as separate parameters
- removed the sweep conducted before Rate D tuning and modified code so that data could be gathered during Max Gain sweep
- Significantly cleaned up the dwell_run method
- significantly cleaned up the test_init method
- Significantly cleaned up the update gain methods
- Align frequency search algorithms for the rate P, rate D, and max gained tests
@IamPete1 I made a pretty significant clean up of the heli autotune code. At least by my standards ;) I was wondering if you might take a look over the heli.cpp and provide any additional pointers on how to clean it up a little more. I'm sure there is a little more refactoring and ways that I could make it more readable. Already I have save 6K in flash on the cube orange+ :)
@bnsgeyer you asked me to have a look at the autotests for this PR.
It doesn't look like you're changing the test suite itself, just the simulated vehicle and default tuning values?
I can have a look at the test failures, but if it's a vehicle dynamics sort of thing then you're far better off with help from @IamPete1 (or many other developers!) vs my rudimentary knowledge :-)
@peterbarker sorrry, this was not the PR I was referring to. I just submitted the autotest PR last night. It is this PR https://github.com/ArduPilot/ardupilot/pull/26810
I was having troubles with it but I think I figured out the error. Still would like you to look at it. thanks!
@IamPete1 can I get you to approve this since you had done all of the review.
@rmackay9 I have removed the delete ring buffer lines and checked to ensure it wasn't exceeding the buffer. Once Pete approves and it passes CI, can I merge or do you want me to take it back to Devcall?
This has been tested on actual helicopters by myself and @Ferruccio1984