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 @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer
Nov 24
DIY Robocars via Twitter
UC Berkeley's DIY robocar program
Nov 24
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup
Nov 20
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video.…
Nov 20
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs
Nov 8
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video.
Nov 8
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23
DIY Robocars via Twitter
Oct 23
DIY Robocars via Twitter
Oct 19
DIY Robocars via Twitter
Oct 18
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13
DIY Robocars via Twitter
RT @araffin2: 🏎️ After hours of video editing, I'm happy to share a best of my Twitch videos on learning to race with RL. 🏎️ Each part is…
Oct 13