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

Nav course hold yaw stick control improvement for fixed wing #10187

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

breadoven
Copy link
Collaborator

Fixes an issue when using the yaw stick to alter course during Nav course hold on fixed wing where the plane reverses the turn direction during adjustment. This is caused by the desired course adjusting faster than the plane can turn until the heading error gets close to 180 degrees causing a turn reversal. PR fixes this by limiting the max allowed heading error. Limiting the heading error to the demanded turn rate works well, not only preventing the turn reversal but also making adjustment more proportional to yaw stick movement.

Change also sets the desired course to the current course over ground and also resets the position controller when adjustment is finished. This helps to prevent course adjustment overshoot when the yaw stick is released so the new course aligns better with the direction the plane was pointing when the yaw stick was released.

Tested OK on HITL but needs more testing for different plane types . Also needs testing on multirotor.

@Jetrell
Copy link

Jetrell commented Jun 30, 2024

I haven't flown with a rudder yaw controlled plane for a while.. I like the control twin tractor prop planes provide, from using differential thrust. Both for manual stick control and navigation nav_use_fw_yaw_control.
But I'll give this a try when we get some good weather.

I generally fly in Cruise more than Course Hold.. I assume it should work the same for both ?

I've always noticed the yaw stick input in Cruise mode is very sluggish, compared to Acro, regardless of nav_cruise_yaw_rate.
But the effect that shows up much worse in Cruise mode, compared to Acro or WP crosswind tracking.. Is adverse roll coupling when stick differential yaw is applied.
The Angle based stabilization doesn't re-level the roll axis after the yaw stick is released.. I always forget to look at the logs. And wasn't sure if the effect is derived from bad WindEstimation VELNED and TURNRATE logic feeding into the AHRS. Making it think the Yaw offset was caused by the wind, instead of a stick command, and causing horizon drift.

@breadoven
Copy link
Collaborator Author

breadoven commented Jun 30, 2024

I haven't flown with a rudder yaw controlled plane for a while.. I like the control twin tractor prop planes provide, from using differential thrust. Both for manual stick control and navigation nav_use_fw_yaw_control. But I'll give this a try when we get some good weather.

I generally fly in Cruise more than Course Hold.. I assume it should work the same for both ?

Cruise is just Course hold with Altitude hold also enabled so this works for both. And it doesn't need a rudder controlled plane. The yaw stick just demands a course change which uses roll mainly to change direction, with turn assistance if rudder is available.

I've always noticed the yaw stick input in Cruise mode is very sluggish, compared to Acro, regardless of nav_cruise_yaw_rate. But the effect that shows up much worse in Cruise mode, compared to Acro or WP crosswind tracking.. Is adverse roll coupling when stick differential yaw is applied. The Angle based stabilization doesn't re-level the roll axis after the yaw stick is released.. I always forget to look at the logs. And wasn't sure if the effect is derived from bad WindEstimation VELNED and TURNRATE logic feeding into the AHRS. Making it think the Yaw offset was caused by the wind, instead of a stick command, and causing horizon drift.

I quite like the yaw stick control from a smoothness point of view ... once it actually starts to react. But as you say it's sluggish initially (it then over reacts once it gets going). It's also sluggish to stop the turn when you release the yaw stick causing it to over turn making it difficult to judge when you need to stop turning in order to end up pointing in the direction you want. This change makes the over control problem much better.

The reason the roll axis doesn't doesn't level after the Yaw stick is released appears to be because of the PID controller. It takes a long time to unwind after the course adjustment ends. I noticed that the position controller is reset after adjusting using the Roll stick which results in a much quicker return to level flight after the Roll stick is released. If you do the same after using the Yaw stick for adjustment you get the same quick return to level flight. Makes it much easier to release the stick when you're pointing where you want to go and actually end up heading in that direction. Seems to work much better testing in HITL. The plane actually responds to the Yaw stick movements as you'd expect rather than feeling disconnected.

@breadoven
Copy link
Collaborator Author

Did you get to test this @Jetrell ?

@breadoven
Copy link
Collaborator Author

Flight tested this recently on fixed wing and it's a big improvement on before. Also tested on multirotor OK so should be good to merge.

@breadoven breadoven merged commit 1594996 into iNavFlight:master Jul 23, 2024
21 checks passed
@breadoven breadoven deleted the abo_coursehold_improvement branch July 23, 2024 22:05
@breadoven breadoven added this to the 8.0 milestone Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants