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.

Views: 4599

3D Robotics
Comment by Chris Anderson on May 29, 2008 at 3:58pm
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 ;-)

Comment by crystal garris on May 29, 2008 at 5:50pm
here is a easy to read PID loop from the BasicX web site
Comment by mmprestine on May 30, 2008 at 10:53am
Here is probably the best written explanation of PID loops. It is in C.

Comment by mmprestine on May 30, 2008 at 10:54am
Strange that the hyper link didnt function.

3D Robotics
Comment by Chris Anderson on May 30, 2008 at 11:21am
Brilliant. Many thanks!
Comment by James Ross on May 30, 2008 at 11:27am
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="">need text description here</a>

Here's the C code from the article:

Comment by crystal garris on May 30, 2008 at 4:25pm
tunning a PID loop can be hard here is a good link with a few furmulas

Comment by Jordi Muñoz on June 1, 2008 at 11:22am
This is a very good and simple example:

previous_error = 0
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
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.. =)

Comment by Jordi Muñoz on June 1, 2008 at 11:30am

This is the difference between a normal way, and the PID system =)...
Comment by faskunji on June 16, 2008 at 9:18am
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.


You need to be a member of DIY Drones to add comments!

Join DIY Drones


Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service