APM 3.1-rc4 yaw PID tuning


I need some help in setting up yaw PID's. My TBS Discovery with APM2.6 has a poor yaw performance. It seems not very locked and what is most annoying it is slowly oscillating which is most visible in onboard video footage.

To get to the root of the problem I did some log analysis and found that actual_yaw is indeed tracking nav_yaw but leaves some +-3 degrees slow oscillations. Please have a look at this log screen and my current PID's. Any ideas where to start or how to systematically set up the yaw PID's?






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

Join diydrones

Email me when people reply –


    • Rate YAW P 0.25-stab yaw 5.0 
      Worked GREAT


      Rate YAW P 0.10-stab yaw 5.0

      Looks not as good but okay


      Rate YAW P 0.10-stab yaw 1.0

      1.0 in the Stabilize P made it rock like a drunk driver, landing was hard as it was swaying


      • wow man, thank you very much, I was gonna do it myself tonight with my F450 but you saved me a lot of time, hopefully I can get my frame as stable too

  • Michael, I am having the exact same issue, with a TBS Disco Pro.

    So I'm a little confused

    P: 0.2
    I: 0.02 (1/10th p)
    D: 0
    IMAX: 8


    Are we saying bump up the P to say 0.3 and leave the rest as is to see if in stops it?

    Can you post your latest PIDs doe yaw P/I/D/Imax

    Here is what I have


    • This is my current PID's


      • Thank you very much for such a prompt reply, I hope it stops my oscillation, this has been driving me nuts.

        So it sounds like the more I increase the P the less oscillation, not really sure what the I does, but with increase risk of waypoint overshoot.

        here was mine :(

        Once again thank you for taking the time, I'll try it out in the morning.

        • plz post videos after the PID change, also I think the max number for the YAW P is 0.3

          • I still wonder, does

            less P = less oscillation 


            more P = less oscillation

          • Oh dang yea, I hope that wont cause it to be uncontrollable, actually 0.25 is the max, I wonder if anything over 2.5 actually does anything?  Guess Ill change it to 2.5 as I don't want to crash

            Yaw axis rate controller P gain (ArduCopter:RATE_YAW_P)

            Yaw axis rate controller P gain. Converts the difference between desired yaw rate and actual yaw rate into a motor speed output

            • Range: 0.150 0.250
            • Increment: 0.005

            Yaw axis rate controller I gain (ArduCopter:RATE_YAW_I)

            Yaw axis rate controller I gain. Corrects long-term difference in desired yaw rate vs actual yaw rate

            • Range: 0.010 0.020
            • Increment: 0.01

            Yaw axis rate controller I gain maximum (ArduCopter:RATE_YAW_IMAX)

            Yaw axis rate controller I gain maximum. Constrains the maximum motor output that the I gain will output

            • Range: 0 800
            • Increment: 10
            • Units: Percent*10
  • Can you share your YAW PIDs please, how is it working so far?

  • Developer

    When tuning the yaw I would suggest keeping the Rate I term 1/10 the Rate P term to keep the overshoot after a yaw command, to an acceptable level.

    Start with the Rate D set to zero. Increase Rate P on the slider between something like 0.25 and 1. If this doesn't help you can increase the Stab P term but don't go over about 8 without doing an AutoTune to see what the maximum safe value is.

This reply was deleted.


DIY Robocars via Twitter
RT @a1k0n: @DanielChiaJH @diyrobocars @circuitlaunch Here's my car's view of that race. About 8.4 second lap times for laps 2 and 3... both…
12 hours ago
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…
DIY Robocars via Twitter
Broadcasting the @circuitlaunch race live now at https://m.twitch.tv/diyrobocars Races begin around 2:00pm PT
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…
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…
Sep 26
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…
Sep 26
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…
Sep 26
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カー https://t.co/1Qq2zOeftG
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 https://t.co/RtLb7TcgIJ
Sep 10