-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
FlightTask: add 1st order lpf on yawrate satepoint for smooth motion #13430
Conversation
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.
We definitely need to solve this but after reviewing and thinking about it I favor the slew-rate implementation. Please let me create a separate pr to compare. It's already implemented in https://github.com/PX4/Firmware/pull/12072/files#diff-cd11905871652d5f1467db1dfc9cecd2R61-R96
src/lib/FlightTasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
Outdated
Show resolved
Hide resolved
src/lib/FlightTasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
Outdated
Show resolved
Hide resolved
src/lib/FlightTasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
Outdated
Show resolved
Hide resolved
@MaEtUgR Thanks for the review. I'm waiting for the slew-rate PR to compare then. |
b2b0916
to
c577967
Compare
c577967
to
2ed1631
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.
We can test the differences to #13464 later on. It's easy to change again based on our findings from the comparison and any of the solutions is better than none.
I added a commit for my parameter description suggestions. You can change and squash them if you like.
@PX4/testflights Could you please test this PR? In altitude and position control, the yaw "stop" should be smoother than before. |
Tested on Pixhawk 4 v4 f-450 Modes Tested: log: |
@bresch it seems like the Yaw is not working on Pixhawk 4, PixRacer,Pixhawk Pro and NXP FMUK66. |
Tested on PixRacer V4:Modes Tested:
Log: https://review.px4.io/plot_app?log=5ff1f19a-ae37-47fe-a6f9-1c8ca1410508 Tested on Pixhawk V4pro:Modes Tested:
Log: https://review.px4.io/plot_app?log=d46b6772-8e8f-40a3-b646-4c490ab7f3b1 Tested on NXP_FMUK66_V3: Modes Tested:
|
4f917aa
to
370dcef
Compare
@PX4/testflights I was able to recreate the issue and fixed it, it's now ready for testing again. |
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.
Looks good, I did all my checks and added some minor changes that don't change the behavior in the last commit. Ready to merge.
@PX4/testflights Could you give this another go? We're interested in your judgment about stick yawing when flying in Altitude and Position mode. It should be smoother and have no overshoot when stopping quickly in yaw. |
src/lib/flight_tasks/tasks/ManualAltitude/FlightTaskManualAltitude.hpp
Outdated
Show resolved
Hide resolved
src/lib/flight_tasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
Outdated
Show resolved
Hide resolved
src/lib/flight_tasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
Outdated
Show resolved
Hide resolved
41d611c
to
d8b4a09
Compare
d8b4a09
to
3d380dc
Compare
9c83a1c
to
7bc2789
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.
@bkueng ?
Tested on PixRacer V4:- Modes Tested Procedure Log: https://review.px4.io/plot_app?log=54e39fe6-ab5d-4f77-9446-539aa857547a |
Tested on NXP FMUK66 v3:- Modes Tested Procedure Log: https://review.px4.io/plot_app?log=10ab6b43-de22-49f7-88db-ae03a7e5d113 |
Tested on Pixhawk 4 V5: Procedure |
…filter state insted of using the previous setpoint
… comments FlightTaskManualAltitude: declaration order Addressing @bkueng's review comments.
d418122
to
1581985
Compare
This feature is really useful, so I just wanted to drop a comment to say thanks. Keep up the good work! |
Currently, there is no way to have a smooth yaw stop as the yaw locking mechanism is based on the position of the yaw stick: when the stick goes back to zero, the yaw setpoint is set to the current yaw and since the vehicle is moving, it is not physically possible to stop without overshoot.
To fix this issue, the yawspeed setpoint (generated from the stick position) is passed through a 1st order lowpass filter. The yaw lock now occurs when the output of the filter is at zero.
As shown below, there is no overshoot anymore:
Note: this modification affects altitude and position controlled modes (i.e.:not stabilized, not auto)