Waypoint Turn Radius

Good evening everyone, I am trying in SITL with a fixed-wing. I want to make it turn before reaching the waypoint so that it does not overshoot. I have managed to achieve this to some extent. If I use a normal waypoint and set the frame “accuracy radius” to 250, it starts turning there. If I set it to 500 m or 1000 m, it does not turn earlier and still starts at 250 m. I also tried changing WP_RADIUS, but it does not change anything.

I tried to find some documentation for this but i haven’t. Do you have any idea?

Thanks in advance!

Hi,

The reason increasing WP_RADIUS beyond a certain value has no effect is because of how the L1 controller calculates turn anticipation distance.

In AP_L1_Control.cpp the actual turn distance is the smaller of two values: WP_RADIUS and L1_dist. So WP_RADIUS is just an upper cap. If L1_dist is already smaller, making WP_RADIUS bigger does nothing.

L1_dist is calculated as: (1/pi) x NAVL1_DAMPING x NAVL1_PERIOD x groundSpeed

With typical SITL values (NAVL1_PERIOD=16, NAVL1_DAMPING=0.95, GS ~17 m/s) this gives L1_dist of only ~82 m. That’s why setting WP_RADIUS to 500 or 1000 doesn’t help — the plane still turns at ~80 m.

The fix is to increase NAVL1_PERIOD.

I tested this in SITL with a square mission, 90 degree turns, GS ~17 m/s:

NAVL1_PERIOD=16 — calculated 82 m, observed ~80 m

NAVL1_PERIOD=35 — calculated 180 m, observed ~190 m

NAVL1_PERIOD=60 — calculated 308 m, observed ~290 m

Just make sure WP_RADIUS is set larger than your expected L1_dist, otherwise it caps the value again.

Trade-off: higher NAVL1_PERIOD makes the whole navigation loop slower. In real flight with wind this means sluggish crosstrack correction, slower gust rejection, and potentially weaving on straights. In calm SITL this wasn’t visible, but expect it in the real world. Increase in small steps (17, 25, 35) and test.

Hope this helps!

1 Like

Thank you very much for your reply and for the explanation!

I will test it in SITL and also add wind to see the response.

1 Like