This should be a relatively easy-one hopefully
I would like to improve the navigation loops on my ArduPilot - if you look at the image attached you can see that between waypoints 4 and 1 it straightens out, and the result is that it overshoots waypoint 1. If it had kept on turning tightly then it should have made waypoint 1 a lot closer.
My feeling is that it is something to do with the L1 controller and the Waypoint Radius - but I don’t have a great understanding of this - so would appreciate anyone’s input that had a good understanding here. I think my pitch and bank control loops are relatively good. At max bank angle of about 45 degrees I get a turning radius of 40m.
I have also attached the flight log.
Thanks for your help!
I have a few suggestions. First off, you need to fix your airspeed sensor setup. Your airspeed is reading very low compared to average groundspeed. You could workaround this using ARSPD_AUTOCAL (read up about airspeed calibration on plane.ardpilot.com), but really you should fix the install. I suspect you have a blockage in the pitot tube.
Next, raise WP_RADIUS to 90. Having it at 15 means the plane always turns too late. Using 90 won’t mean it will turn 90 meters before the waypoint, it means it will start looking at whether a turn may be needed when it gets within 90 meters. It will then turn at the right point.
I’d suggest a LIM_ROLL_CD of 5000. At 4500 with a groundspeed of 25m/s you will have a turn radius of 63m. That will drop to 53m at 50 degrees. Consider 55 degrees if your airframe looks OK in the air. Fix your airspeed sensor first though!
If you use AUTOTUNE again then raise AUTOTUNE_LEVEL to 6 or 7. That will make for more agressive turns. Also, make sure you do enough pitch oscillations in AUTOTUNE. Your roll tuning looks fine, but pitch is way off.
Many thanks for your suggestions here - it all makes sense and I will be doing as you suggested. Once I get it all tuned properly I will post a good explanation of my blog with some pictures so others can follow it.
One questions - I’m curious about your turning radius calculations. My thoughts are as follows:
- Lift, L = m.g (assuming the plane is travelling at the same speed during the turn as during stable flight)
- Tangential force, F_y = L * sin (bank_angle)
- Tangential acceleration, a_y = v_x ^ 2 / r (v_x is forward air speed)
- Tangential force, F_y = m . a_y
Putting all this together you get turning radius, r = v_x ^ 2 / ( g . sin (bank_angle) )
Therefore for bank angle 45 deg, forward speed of 25 m/s - I get turning radius = 90 m. You get 63 m here.
For bank angle 50 deg, forward speed of 25 m/s - I get turning radius of 83 m. You get 53 m.
What’s your method here?
Close! It is tan(bank_angle), not sin(). See en.wikipedia.org/wiki/Banked_turn
Yep that makes sense - so you assume that the aircraft will increase power during the turn to maintain altitude. (ie Fz = L * cos (bank) = m.g )
Therefore: F_y = L sin (bank) = cos (bank) * m.g / cos (bank) = m.g . tan (bank).