-
Notifications
You must be signed in to change notification settings - Fork 14k
Smooth yaw in auto mode by limiting acceleration #24766
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
Conversation
ab4c87b
to
cd85bc0
Compare
I rebased and added my suggestions. I also did some testing in SITL SIH and realized we should adjust the default parameters such that this change shows the significant improvement I was looking for. The current defaults only make sense with the current limited implementation that doesn't consider acceleration. EDIT: I checked the rough timing for a 180° turn which is likely the worst case for an autonomous yaw change (otherwise you start to rotate the other direction) and assuming the drone could accelerate indefinitely with the previous slew rate it would by default turn in (180°) / (45°/s) = 4s which it of course never managed and overshot so it probably took ~5-6s. If we have a high (100°/s) limit with the new implementation but limit the acceleration to have a smooth turn it roughly results in the following timings if it can track the demanded yaw acceleration:
I suggest to go with 20°/s^2 for a start and adjust that in case we see undesired either too slow or too aggressive yawing. |
…aw setpoint and reset smoothing when yaw is not locked
…te for exclusive use with HeadingSmoothing
cd85bc0
to
456f073
Compare
I added the |
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.
@dawr68 Thanks for the real world testing you provided. Now that you checked again and tested I feel confident to merge. If the defaults turn out to be limiting in some use case I'm happy to follow up with adjustments.
Solved Problem
Currently, only a slew rate is applied to the yaw setpoint, which causes issues on highly responsive platforms (e.g., helicopters) due to steep changes in the yaw setpoint.
Solution
Smooth the yaw setpoint by limiting the yaw acceleration.
Results
Applying an acceleration limit leads to more realistic yaw and yaw rate setpoints, enabling improved yaw tracking performance.
