-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
FW auto-trimming #22668
base: main
Are you sure you want to change the base?
FW auto-trimming #22668
Conversation
293fafe
to
0330d9f
Compare
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 airspeed dependency would indeed be very cool to co-estimate. And we maybe only want to apply the trim that we got in level flight and not the one we estimate in climbs/descents, or at least not store it in the param in that case.
I would further consider limiting the maximum delta trim from one iteration to the next to avoid large steps in the controller (unless you handle it explicitly, the integrator will have to react), plus to add an extra protection against momentarily wrong trim estimates/estimates from short time vehicle flight states.
Do you plan to extend it to MC as well? Would that be a different module or the same? If the same then you can already drop the "FW" prefix in the module name.
38bf603
to
6ccae92
Compare
956cc99
to
fc2f176
Compare
b8d6ac0
to
3d91372
Compare
3d91372
to
bc9df1a
Compare
rebased on current main |
Reminder - docs required for this? |
@bresch I test flew this branch on my FunCub without airspeed and GPS in Stabilized and Manual: |
G'day, is this going into PX4 v1.15? Just planning the next couple of weeks docs work. |
I'd like to get at least 50-100 flights on this across several aircraft to see some data. I'll post the logs when we can devote some time to this. Looks great by the way. |
@ryanjAA Would you be able to do a couple of tests? |
Sure - Flight testing tomorrow and Friday - as long as everything else goes fine we can put a few tests with this on. What do you want to see and which commit, etc? |
Thanks, just fly this PR, make at least a couple of straight lines of >7 seconds or large circles (bank angle < 10degrees). |
Howdy, is this going into PX4 v1.15? If so, are further updates required for #3146 following work done since you created that? |
@hamishwillee I think we'll have to wait for more flight tests before we can merge this. |
Estimates the torque trim values while flying
0f55c7a
to
b079c59
Compare
Solved Problem
Trim values are used to unload the integrators from known constant disturbances. Setting them correctly improves the performance of the vehicle but those parameters are often neglected. Furthermore, re-trimming the aircraft after changing the payload is often required.
Solution
Automatically adjust the roll/pitch/yaw trim values during flight by using an average of the torque setpoint.
Algorithm:
Usage
FW_ATRIM_MODE
to "calibration" for the first flight. This allows the autotrim to commit the fill trim estimate back to the paramslistener auto_trim_status
iftrim_validated
has non-zero values.FW_ATRIM_MODE
automatically changes to "continuous" mode, where a small amount of trim is used to update the trim values after every flight.Changelog Entry
For release notes:
Test coverage
SITL vtol
TODO:
We could also automatically set the DTRIM values if the vehicle is flown at various speeds.