PID & Nav troubles

I have now had more than 50 flights with my ArduPilot equipped plane but I am still dissatisfied with the navigation performance despite trying almost every PID configuration that I can think of. I'm using APv2.7.1, Mediatek GPS, FMA thermopiles, a 150cm (60") twinboom plane with 2200mAh LiPo.

Perhaps I'm being too critical but I cannot seem get this system to navigate accurately enough, waypoints are missed (10m radius, not that hard), noticeable overshooting on turns and wide/narrow s-turns are some of my main problems.

I have tried the following "NAV_ROLL" PID parameters:

P = 0.6, I = 0.0, D = 0.0
P = 0.6, I = 0.1, D = 0.1
P = 0.7, I = 0.1, D = 0.0
P = 0.8, I = 0.0, D = 0.1
P = 0.6, I = 0.5, D = 0.0
P = 0.6, I = 0.0, D = 0.5
P = 0.5, I = 0.3, D = 0.2
P = 0.6, I = 0.05, D = 0.05
P = 0.9, I = 0.5, D = 0.5 
and multiple other variations, etc, etc, etc!

and whilst I can usually see the effect of the different parameters but I can't seem to get rid of my problems.

Am I missing something, XTRACK_ENTRY_ANGLE or something else that would cause this? BTW, the plane flies 100% fine in STABILIZE & FBW

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • Moderator

    Ahhh, that's better, success, much tighter navigation now, north is up, slight breeze from the west. Jason, I have raised the sensor by about 2cm (3/4") and later switched it round so that the cable faces rearwards. The turns are still tighter to the right but not quite as tight, so after changing the above it must be something with the plane. Anyway things look much better with only the slightest overshoot:




    My settings are:

    HEAD_MAX 4500




    NAV_ROLL_P 1.1

    NAV_ROLL_D 0.6


  • Moderator

    Things are much better, with less zigzagging.

    My main change (besides lowering my expectations) is no Xtrack - gain is 0, also P is
    now 1.0 and D is 0.4, HEAD_MAX = 4900 (BUT I still only get a left bank
    angle of about 25 deg during navigation! Right bank angle is
    steeper, closer to 45 deg). XY Sensor is mounted diagonally and has a
    clear view, with perhaps a little less clear for the two rear sensors
    looking over the wing.


    Most of the turns in the plot below were left for some reason (and usually are...)

    (Plot starts at Red, up is north, slight breeze from NNW).

    Turns green, orange, light blue and dark blue are left turns and are very wide.

     2 right hand turns occur at yellow, much tighter, but that's after lots of overshoot between orange and yellow and then two perfect (wide) turns after that with NO overshoot at all, it's this inconsistency that flummoxes me at times.


    Anyway it's navigating more to my (lowered :)) expectations, looking forward to developments with this code!




  • Hi Guys,


    Just to let you know, reducing the rudder throw has worked a charm for me.


    Thanks for all your support,



  • Moderator

    Still having problems despite an additional 30 test flights! (Where I get the patience from I have no idea, but may lose it soon...)

    This is about the best I can get! See GPS path below.


    Changing 'I' and 'D' doesn't have the expected effect almost as if they aren't actually working (tried ranges: 0.01 to 1.2).

    Under manual control the plane turns equally both ways, under AUTO plane turns right 4x more aggressively than left.(compare orange turn to light green turn!)

    Cannot get rid of zigzags visible in the red-to-orange and green-to-blue track section in the image below.

    Light green through purple sections below show erratic course deviations despite higher 'P'



  • I did something like this:

    Is there a way of reducing the throw without affecting manual mode? Would modifying the low/high rudder timings (the 1000ms and 2000ms values) have that effect?
  • I have tried 30 and 20 meters. Unfotunately i have no xbees or groundstation at this point which is a pain.

    Im wondering if my enlarged rudder is actually to big! I saw a neat mod for this that makes the top of the fin the rudder. This really increases authority but maybe to much. Reducing the throws mechanically should fix that.
  • Hi Chris,

    Easystar, larger rudder, 2.7.1, imu and brushless. Like graham stabilse, fbw b work great.


  • Hi Graham,

    If you figure this out or make some progress, then please let me know as I have very similar issues on an Easystar.

    The plane flies in the direction of the waypoint, then as it aproaches goes all over the place hunting out the actual waypoint, then goes off to the next.

    Im going to try mechanically reduce the rudder throw on the control horn. This should let me keep the nav PID high enough to navigate but reduce tne throw.

    Keep in touch,


  • 3D Robotics
    My first thought is that 10m is too tight a radius. Try 30m (it will still shoot for the center)
This reply was deleted.


DIY Robocars via Twitter
RT @DanielChiaJH: Great racing against @a1k0n today at @diyrobocars! Pretty cool to both break sun-9s at the track today I think I got very…
2 hours ago
DIY Robocars via Twitter
Broadcasting the @circuitlaunch race live now at Races begin around 2:00pm PT
7 hours ago
DIY Robocars via Twitter
RT @a1k0n: ran a huge number of hyperparameter tuning experiments yesterday; now I can train a new policy, far with better quality, in 15 m…
7 hours ago
DIY Robocars via Twitter
RT @a1k0n: Did I get rid of hand-tuned parameters? Yes. Am I still hand-tuning more parameters? Also yes. I have a few knobs to address the…
DIY Robocars via Twitter
RT @a1k0n: I'm not going to spoil it, but (after charging the battery) this works way better than it has any right to. The car is now faste…
DIY Robocars via Twitter
RT @a1k0n: Decided to just see what happens if I run the sim-trained neural net on the car, with some safety rails around max throttle slew…
DIY Robocars via Twitter
Sep 24
DIY Robocars via Twitter
RT @SmallpixelCar: @a1k0n @diyrobocars I learned from this. This is my speed profile. Looks like I am too conservative on the right side of…
Sep 24
DIY Robocars via Twitter
RT @a1k0n: @SmallpixelCar @diyrobocars Dot color is speed; brighter is faster. Yeah, it has less room to explore in the tighter part, and t…
Sep 24
DIY Robocars via Twitter
RT @a1k0n: I'm gonna try to do proper offline reinforcement learning for @diyrobocars and throw away all my manual parameter tuning for the…
Sep 23
DIY Robocars via Twitter
RT @circuitlaunch: DIY Robocars & Brazilian BBQ - Sat 10/1. Our track combines hairpin curves with an intersection for max danger. Take tha…
Sep 22
DIY Robocars via Twitter
RT @SmallpixelCar: Had an great test today on @RAMS_RC_Club track. However the car starts to drift at 40mph. Some experts recommended to ch…
Sep 11
DIY Robocars via Twitter
RT @gclue_akira: 世界最速 チームtamiyaのaiカー
Sep 10
DIY Robocars via Twitter
RT @DanielChiaJH: Always a good time working on my @diyrobocars car at @circuitlaunch. Still got some work to do if I’m to beat @a1k0n howe…
Sep 10
DIY Robocars via Twitter
RT @SmallpixelCar: My new speed profile for @RAMS_RC_Club track
Sep 10
DIY Robocars via Twitter
RT @SmallpixelCar: Practiced at @RAMS_RC_Club today with my new @ARRMARC car
Aug 28