PID is not difficult. It is very time consuming to get it right. It is a straightforward mathematical calculation. The dynamic reaction in the real world makes it hard.
If you have an electronic thermostat at home it is PID controlled. So is your oven. I have worked on hundreds of PID equipped machines
that use PID to control a moving mass driven by a motor and screw, a 6,000,000
btu burner (12 of them. Some gas bill!) and lots more.
You use PID every day when you drive your car. When you are driving along at 60 mph you have about 10% throttle. Try stopping the car and
starting off with 10% throttle. You will eventually get to 60 mph. It will take
a long time.
You don’t drive that way. Instead, you push the throttle down. Driver A in a Honda Civic uses 50%. Driver B in a Ford Mustang uses 95%. How much I push the throttle is “P”.
In our case not the real RC throttle, but the reaction to a difference between where we are and we should be. If we are not touching the
roll stick and we are level there is no difference. If the wind changes the
roll then the sensor reads the difference. How much you want to react is
determined by “P”.
Both drivers lift off the throttle at exactly 60 mph. The Civic overshoots by 5 mph. The Mustang overshoots by 20 mph. That would be an “I”
of zero and a large "P". In real life you start backing out of the throttle as you approach 60
mph. The Civic driver starts to ease out of the throttle at 50 and gently rolls
up to 60 mph. The Mustang driver starts to ease out at 55 and still overshoots
a little. How much I lift off the throttle as I approach 60 mph is “I”. If “I”
is too big you overshoot. If ”I” is too small it may never get there. “I” is
part of the equation from the start, but “P” has the largest influence. As you
get closer to where you want to be “I” exerts a stronger influence to smoothly
bring that difference to zero. “P” just
looks at the amount of error, “I” looks at the accumulation of errors over time and brings you smoothly to zero error.
The tuning information on the wiki says “I” should be zero. I disagree.
The Civic has a responsive throttle and responds to engine braking very well and rolls along at exactly 60 mph. The Mustang has very
little engine braking and a very responsive throttle and rolls along somewhere
between 58 and 62 mph. To adjust long term variance in speed is “D”. Only
necessary when you have a static condition. That almost never happens with
flying vehicles. It is possible to have a very small negative number to help
certain conditions, but that is long after “P” and “I” have been sorted out.
If you are flying a camera and want a smooth reaction with no wobbles or overshoot you will end up with different values than the guy that
is only interested in acrobatics and wants the fastest reaction and is willing
to put up with a little overshoot to get what he wants.
One of the problems in coming to grips with PID is the fact that the numbers are dimensionless. We know what 5 lbs, 23 feet, and 94 psi
look like because there is a dimension attached. PID isn’t related to anything.
It is just a number that reflects the mass of the system and how quickly the
system can react to changes. The numbers could be 0 or 100. There is no way to know
where to start with PID.
Fortunately for you the team here has established baseline PID numbers. Let’s assume that you and your buddy build identical quadcopters.
You have received the finest parts that are available. Your buddy shops the
bargain bin. They are going to fly slightly different from each other. The same
PID numbers might be close. Might be different. Even if you managed to adjust
the PID, when you mount a camera the center of mass and weight change and so do
the PID numbers. Different prop, different motor . . .
If you have too large a number for “P” then it over reacts and you get a rapidly oscillating out of control vehicle. If “P” is too small
then it is too slow to react and by then the situation has changed and you get
a drunk vehicle. It’s important to slightly reach these conditions to
understand where the middle is. If you are starting from scratch start with "I" zero and work on "P". When you introduce "I", every
time you adjust “P” you affect “I”. When you are getting close to a number that
works you are going to have to look at the numbers as well as the reaction. The
numbers will tell you more about the reactions than your eyes will. On this
small of a vehicle a very small change goes a long ways. The Aeroquad PID
Tuning methodology should work well, but I still think adjusting “I” is
necessary. One set of PID numbers only works in a narrow range of fixed conditions. The Arducopter team has already figured out that a cascading PID is necessary. And multiple PID conditions.
So you tuned it perfectly on that nice summer day at the beach. Now in the winter at 6,000 ft you expect the same tuning to work? (PS: Tuning outdoors with the wind makes life 10
times harder.) Because we are tuning with multiple axis the job is more
difficult. As your axis angle increases you start to slide down hill and your
altitude has to compensate.
Keep track of every number you change and the reaction. When you get lost it helps you to get back on track. Change only 1 number at a time
and by small values. So what you are looking for is middle ground that will get
you running and make you happy. You can spend a ton of hours tuning the system
if you don’t have PID experience. Have patience. If you have no patience, use
the baseline number and go on with life.
Tags:
Great!!! This is just what i needed! Thanks alot! :)
Fantastic! I had previously heard PID explained in terms of the temperature of running water (wikipedia I think).
However I was driving in traffic and thought I was getting closer to understanding the whole concept as I noticed my mental calculations of throttle vs total speed vs distance to next vehicle.
Some people with a lead foot, rather than smoothly applying and reducing gas to adjust speed. This would be a to high a P... resulting in the oscillations that typically cause car sickness.
This write-up really helped me understand the mental algorithms I was doing in my head. Something in the way you said it, made it click into place. I'm much more well prepared to fix the tuning my 450.
Thanks and well done.
592 members
29 members
735 members
2669 members
477 members
© 2015 Created by Chris Anderson.