PID Controller In Layman's Terms

Don't let that image intimidate you. It's not that bad! I was surfing on the Parallax Propeller forums and I noticed a post on PID controllers for UAVs that might be useful to some of you:PID Stuff for you UAV Nuts out there!PID controllers are commonly used in UAVs to keep the airplane on a specified path. Sniper King discusses each of the three parts of a PID controller in easy to understand language. He also gives advice for flight testing your software and tuning your gains.I haven't looked at the PID code in the Parallax OBEX, but I believe there is an alternate PID form that uses only one gain. For a more thorough explanation on PID controllers, you may want to check out the wikipedia article.
E-mail me when people leave their comments –

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

Join diydrones

Comments

  • some of my examples:
    roll of aircraft in X-Plane flight sim:
    only P control, you can see oscillations here. You can calibrate P gain so that you do not have such oscillation, but this is possible only for one target value, for example I calibrated for 20 degree roll, but when I tried 30 degree roll I still had problems.
    and here: PID control. This gave same results on 10,20 or 30 degree rolls.
  • Developer

    This is the difference between a normal way, and the PID system =)...
  • Developer
    This is a very good and simple example:

    previous_error = 0
    start:
    error = setpoint - actual_position
    P = Kp * error
    I = I + Ki * error * dt
    D = (Kd / dt) * (error - previous_error)
    output = P + I + D
    previous_error = error
    wait(dt)
    goto start

    You just need to adjust the values Kp, Ki, Kd between .01 to 20, depending you model, the only way is the method better know as "Trial and Error", till you get it... There is a professional way too (but was in german and i don't remember anything).. if you search in torrents you going to find very interesting things.. =)
  • 100KM
    tunning a PID loop can be hard here is a good link with a few furmulas
  • mmprestine
    A hyperlink takes two parts: the URL and a text description (what you click on). You're not the first one to miss the second part.
    <a href="http://www.embedded.com/2000/0010/0010feat3.htm">need text description here</a>

    Here's the C code from the article: ftp://ftp.embedded.com/pub/2000/wescott
  • 3D Robotics
    Brilliant. Many thanks!
  • Strange that the hyper link didnt function.

    http://www.embedded.com/2000/0010/0010feat3.htm

  • Here is probably the best written explanation of PID loops. It is in C.

  • 100KM
    PID 1.1.zip
    here is a easy to read PID loop from the BasicX web site
  • 3D Robotics
    This is great! Too bad the code object in is Propeller Spin, and not C, but the write-up is refreshingly clear. My takehome: I've been using "P"s already, could easily add "I"s, and maybe don't need "D"s ;-)
This reply was deleted.