-
Notifications
You must be signed in to change notification settings - Fork 17.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
AP_L1_Control: Add wind compensation for 90 degree turn distance #28509
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.
Seems like a reasonable change, may be better to do it at the plane level tho, it has a better idea where its going next.
OK, where would I take the current turn rate from and where alternatively would I apply this change on plane level instead of L1_Control? |
Does it go into command logic instead of L1_Control? |
I believe this PR is now mature enough to be reviewed. I'll try to add some test with SITL. |
*/ | ||
float AP_L1_Control::turn_distance(float wp_radius) const | ||
{ | ||
wp_radius *= sq(_ahrs.get_EAS2TAS()); | ||
return MIN(wp_radius, _L1_dist); |
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.
L1 distance is already scaled by the groundspeed, which will increase as you have more tailwind.
Isn't your approach double-dipping on the scaling of L1 distance?
I admit however that this MIN(
is forcing a max distance of WP_RADIUS
, which can be too small, and masking the effect of the L1 scaling.
What I would like to see is some testing that shows:
- The current behaviour in head and tailwind.
- Your proposed PR in head and tailwind.
- What would happen if you turned this
MIN(
into aMAX(
, instead of using your new code.
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.
Interesting Idea.
I can't say that I fully understand the L1 algo but with my limited knowledge I assume that L1 point will continue to update on the course and not stop at the waypoint.
The MIN(wp_radius, _L1_dist) seems to be an invariant for that.
This is an attempt to setup L1 Navigation correctly with 20km/h wind from the right and 35km/h cruise speed. Rectangle 300x100m. Regular Arduplane 4.5
It is clear that turning into the wind is beneficiary to perfectly line up with the next leg. While turning with the wind creates crosstrack error. Reviewing this picture also unveils, that the 90degree approach is not perfect, so I'll try to setup a SITL test first.
This is a Request for Comments for a Work in Progress Enhancement. Please add tags WIP and RFC respectively.
Abstract
Shift waypoint turn-in to compensate for wind.
Observation:
When a plane enters a 90 degree turn to the next waypoint while flying with tailwind, the plane overshoots and has to correct after the turn.
The overshoot is caused by the crosswind the plane experiences relative to the new course.
Goal:
Forward-correct the crosstrack error after the turn by an earlier turn-in.
Assumptions and classifications:
Simplifications: