Skip to content
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

AttitudeControl: let the user set yaw weight directly via parameter #12175

Merged
merged 2 commits into from
Mar 28, 2020

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Jun 4, 2019

instead of infering the yaw weight from the gains which can lead to
unexpected results depending on the particular vehicle tuning.

@jkflying
Copy link
Contributor

jkflying commented Jun 5, 2019

This is setting a default of 0.4, what would the defaults have roughly been before? I don't have a feeling for what yaw P gain would be compared to pitch/roll.

@MaEtUgR
Copy link
Member Author

MaEtUgR commented Jun 6, 2019

@jkflying Good point. I should mention:

@MaEtUgR
Copy link
Member Author

MaEtUgR commented Sep 12, 2019

@sfuhrer I quickly rebased on master for further testing on VTOL. I could also enable the option to make yaw eight dependent on the roll, pitch error. I once created a python script here: https://github.com/Auterion/Flight_Control_Prototyping_Scripts/blob/master/quaternion_attitude_control/quaternion_attitude_control_test.py#L232 to visualize the result of different yaw weights.

@stale
Copy link

stale bot commented Dec 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Dec 11, 2019
@sfuhrer
Copy link
Contributor

sfuhrer commented Jan 7, 2020

@MaEtUgR this is worth keeping open, right?

@stale stale bot removed the stale label Jan 7, 2020
@MaEtUgR
Copy link
Member Author

MaEtUgR commented Jan 24, 2020

@sfuhrer Well yes, I should push it through and do the necessary testing 😬
It got less urgent since we have yaw slew rates in missions but it's not a final solution because there's also no feed-forward.

@MaEtUgR MaEtUgR force-pushed the yaw-weight-hotfix branch from da970a0 to d80242c Compare March 25, 2020 14:05
@MaEtUgR MaEtUgR marked this pull request as ready for review March 25, 2020 14:06
@MaEtUgR
Copy link
Member Author

MaEtUgR commented Mar 25, 2020

I revived this and finished the work:

  • rebased on master (first commit was existing)
  • fixed the yaw output scaling which was like expected broken with the original first draft
  • Added unit tests to verify that the yaw output scaling is correct and doesn't result in division by zero
  • did some successful SITL testing

Open for review, testing. I'm quite confident on this one.

It just allows to change the priority of yaw compared to roll and pitch in the non-linear attitude controller with non-default tuning. The main goal is that if you keep the yaw weight e.g. default and just tune the yaw gains you only change the feedback gain but not the relative priority.

@MaEtUgR MaEtUgR requested a review from bresch March 25, 2020 14:09
@MaEtUgR MaEtUgR force-pushed the yaw-weight-hotfix branch from d80242c to ebd8505 Compare March 25, 2020 14:12
MaEtUgR added 2 commits March 25, 2020 15:42
instead of infering the yaw weight from the gains which can lead to
unexpected results depending on the particular vehicle tuning.
@MaEtUgR MaEtUgR force-pushed the yaw-weight-hotfix branch from ebd8505 to b4d06f9 Compare March 25, 2020 14:42
@MaEtUgR
Copy link
Member Author

MaEtUgR commented Mar 25, 2020

I found a better implementation for the exact same thing and squashed my commits.

@MaEtUgR MaEtUgR requested a review from a team March 26, 2020 13:15
@MaEtUgR
Copy link
Member Author

MaEtUgR commented Mar 26, 2020

@PX4/testflights Could you please do a quick test on this with focus on multicopter yawing? Stabilized, Altitude, Position, Mission just check if yaw tracking looks like expected.

@Junkim3DR
Copy link

Tested NXP FMUK66 V3

Modes Tested

  • Position Mode: Good.
  • Altitude Mode: Good.
  • Stabilized Mode: Good.
  • Mission Plan Mode (Automated): Good.
  • RTL (Return To Land): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint then trigger RTL.

Notes
No issues noted, good flight in general.

Logs

Tested Pixhawk 3 V4Pro

Modes Tested

  • Position Mode: Good.
  • Altitude Mode: Good.
  • Stabilized Mode: Good.
  • Mission Plan Mode (Automated): Good.
  • RTL (Return To Land): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint then trigger RTL.

Notes
Vehicle does not detect all Flight Modes Switches, Top = Stabilized ; Mid = Altitude (Undetected No Flight Mode Change) ; Bot = Position (Switched to altitud) RC Work with no issue on other vehicles.

Logs

@dannyfpv
Copy link

Tested on pixhawk4 v5 f-450
Modes Tested

Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.
Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint then trigger RTL.

Notes
No issues noted, good flight in general.

Logs
https://review.px4.io/plot_app?log=aa76011d-28d7-413b-81b5-3fb3047e9b65
https://review.px4.io/plot_app?log=f85caf4c-973d-43d9-9904-640ddcfb237a

@jorge789
Copy link

Tested on PixRacer V4

Modes Tested

Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.
Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint then trigger RTL.

Notes
The following issue was not seen in this PR "In altitude mode, the vehicle did not respect the height that continued to increase in pitch forward"
We are unsure if this was due to the lack of strong winds on the field today.

Logs
https://review.px4.io/plot_app?log=54f0c926-14eb-47de-a996-6a0ee3f33710

https://review.px4.io/plot_app?log=f667ae28-5495-4694-ae36-b85ddff54698

Tested on CUAV nano V5

Modes Tested

Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Return To Land): Good.
Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint then trigger RTL.

Notes
No issues noted, good flight in general.

Logs
https://review.px4.io/plot_app?log=4f4c2181-b7ea-4707-b46b-345b58c3c0ca

https://review.px4.io/plot_app?log=cd036b34-a4c4-4764-af43-1277d34552b4

@MaEtUgR
Copy link
Member Author

MaEtUgR commented Mar 28, 2020

Thanks so much for testing! Yaw tracking looks like expected in the logs. I checked against other recent flights on master.

@MaEtUgR MaEtUgR merged commit b8576cc into master Mar 28, 2020
@MaEtUgR MaEtUgR deleted the yaw-weight-hotfix branch March 28, 2020 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants