Loiter PIDs

I built a quick sim today to look for the optimum PIDs for Loiter:


What's looking good is 


Loiter_P = .5 or .6  (more = some overshoot, but not much)
Loiter_I  = zero       (Just say no)
Nav_P    = 4   (Higher than I thought, What will it do to navigation?)
Nav_I  = .25         (Higher than I though, but still large like it should be)
Let me know if anyone proves this out!


Here's why Loiter_I is a bad idea. It just ends in overshoot.



Here is Loiter_P from  .5 to 1.8 (lower looks better)3690892493?profile=original

This is Loiter kp 1, Loiter kI 0, Nav_kP 2 through 10, Nav_kI .2 



Here it is in action:

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

Join diydrones

Email me when people reply –


  • on the 93 version, NAV_LOITER_I = 0 and its still overshoots, the must be a finer range parameters

  • flew four waypoints last night.  After hitting #4 would not RTL.  Planned new mission with two waypoints, same thing.  Attempted auto takeoff, copter speeded to waypoint 1,  i flipped to stabalize but couldnt recover.  throttle was set at minimum (my fault). flying Y6 with 750kv motors, running 2.0.47. stabilize great,  alt hold so so,  loiter radius too big and fast.  

    2011-10-13 12-34 1.log

    2011-10-13 12-34 1.kmz

  • Xbee problems on 2.0.47

    I've been flying with Xbee connected in order to tune Pids easy. But i found an importantnt problem: from time to time the four motors are stoped by 1 second or so, then continues normally. This happens randomly (I can't identify any reason). I've verified in my two copters, and do the same.
    When I remove the Xbee, the problem dissapear. This never hapen in previous version (i don't remember which one exactly)
    Anyone had this problem?
  • There can be integral windups.

    This occurs if a disturbance such as a wind gust occurs and the steering pressure against it cannot overcome to reach a waypoint. I am not sure of the pid method used with the arducopter. I presumed that the Imax is the limit that stops integral windup?

    Here is a video if two different pid methods.

    The disturbance would be interpreted as the wind pressure in the copters case.

  • Here are my log for .45, but loiter works ok, but older versions works better. Now I have a field 1x9 meter


    With .33 it works much more better:


    With .47 the copter totaly overshot can´t use loiter


    What is the rpm limiter in the pid tuing flash file??

    I do not understand the value???


    2011-10-10 07-01 44.kmz

    2011-10-10 07-01 44.log

  • Hi Jason, I don't suppose I can get you to answer my question at this post?

    Sonar attitude compensation

    Thanks man, your work is awesome, and we all appreciate your efforts



  • There were some great flights today under Auto mode.

    Integrals on both Nav and Loiter were set to .001 There was no wind.

    What I observed was each time the copter began its approach to the next waypoint once it hit the maximum speed it rolled back to a stop. Then forth again in a wave like motion. Once at the derived waypoint it stopped pointed to the next waypoint with the same approach speed going up and down. Is there a derivative toward the speed m/sec, mph?  The waypoint distances are small 100 m point to point. Possibly the GPS is not accurate. However i've found a garmin handheld accurate with groundspeeds. Also the IMU had to be rebooted after configuration changes were sent from MP otherwise the sonar was disabled. Attached is the log done today.  MP 1.0.79  w Arducopter 2.0.46

    Flying with no wind is enjoyable.

    2011-10-08 1.log
  • Jason,
    I was testing a lot tuning the loiter pids with fw.46, trying to fix my "circles" problem. I've fixed finally with pids close to the ones you propose now by default. So, i reduced Loiter_p to 0.6 and circle effect almost dissapear. Then i increased nav_p and nav_i up to 2.7 and 0.27 respectively. I've got this good performances only by testing a lot, before reading this post. Now the behaviour is much better. Tomorrow I'll test fw.47
  • On the 47 ver i have set the compass to the north, but when i rotate it 180 to the south there is 20 deg differences for the real south.


    Any clue?


  • Jason,

    It have problem last code 2.0.47 . when i will change mode (ALT or Loiter) and I change back to Stabilize mode. I can't Throttle control and slow down on ground (No crash). and I down throttle and up again. I just normal control. Now it's problem about throttle when I will change mode to ALT or Loiter ..... Edit Now!! Please........

    thank you , Balloon

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…
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 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カー
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