Type A (textbook PID):
CO(k)=CO(k-1) + Kp*[e(k)-e(k-1)] + Ki*T*e(k) + Kd/T*[e(k)-2e(k-1)+e(k-2)]
Type B (e.g. AB PLCs):
CO(k)=CO(k-1) + Kp*[e(k)-e(k-1)] + Ki*T*e(k) - Kd/T*[PV(k)-2PV(k-1)+PV(k-2)]
Type C (not common):
CO(k)=CO(k-1) - Kp*[PV(k)-PV(k-1)] + Ki*T*e(k) -
Kd/T*[PV(k)-2PV(k-1)+PV(k-2)]
I have done some research on the topic: Of the three types, which one is the
best?
The differences:
Type A: All P, I, and D terms act on error e.
Type B: Setpoint is removed from the D term of type A.
Type C: Setpoint is removed from BOTH D term and P term of type A.
My answer is: Type C is the best when setpoint changes. For more of my
research see
http://bestune.50megs.com/typeABC.htm
Therefore, I hope that all PID controllers should implement type C PID
equation. What is your idea?
What is best depends on what you are afraid of most.
If you want absolute fastest response to setpoint changes, have all
terms react to error (). This is almost never the optimal choice,
because it almost never happens that there is a pole in the process
response that coincides with a pole in the setpoint response that can
both be treated equally by the same derivative term. I have never
improved the performance of a loop by switching to this algorithm.
If you want to have the derivative effect focus only on a process pole
(especially in the inner loop of a cascade pair, where the inner loop
derivative focuses on the inner process, and the outer derivative
focuses on a pole in the outer loop process), having the derivative
react only to process (B) may be best.
But if you are afraid that the output may move too fast, and upset
this or other interrelated processes (and you are in no particular
hurry to get to setpoint), you may want to use version c and have only
the integral term react to setpoint changes, to ramp to the new
setpoint with the least upset. This version is also nice for manual
setpoints that might be entered incorrectly. It gives the operator
"oops time" to correct his mistake without slamming outputs.
I think a better form should be produced that has more advantages than
any of these for moving setpoint applications. I want to see a form
that has two gains (one that responds only to process changes and one
that responds to setpoint changes) and two derivative gains (or times)
(again, one that responds to the derivative of the process changes and
one that responds to the derivative of setpoint changes) and a single
integral gain (or time) that responds to error. This would eliminate
the necessity of choosing any of the common "all or nothing" schemes
you describe, but would let me tune optimally, process disturbance
response and setpoint disturbance response independently. One
algorithm fits all, with just 5 coefficients, rather than 3
coefficients and 3 extreme choices.
Please, somebody, bring the PID controller into the 21st century.
--
John Popelish
If your PID is not tightly tuned, then type A may reduce the settle
time and it may not be so. Typically type A will cause an overshoot in
PV. Please take a look at
http://bestune.50megs.com/typeABC.htm
In this case, the overshoot may be reduced if (1) the tightness of
type A is further reduced and/or (2) A smaller admissible range is
enforced on CO so that the bad effect of type A is further restricted.
But remember, if the your type A PID is too loose in order to reduce
overshoot, the settling time will be longer.
Similar comments apply to tyep B. But for type B, things are not that
serious as for type A.
Type C completely overcomes the problems mentioned above. If your type
C is well tuned, the settling time can be very short AND the overshoot
can be zero. Take a look at
http://bestune.50megs.com/tightness.htm
to verify this.
Dan
A motion controller would never use the PID B or PID C.
Peter Nachtwey
"BESTune" <bes...@163.net> wrote in message
news:1e55aea5.01060...@posting.google.com...
http://bestune.50megs.com/tightness.htm.
And you do not need to ramp setpoint from one value to another for
type C. So I strongly recommend the use of type C PID in motion
control. Type A, B, and C are equivalent if setpoint is a constant.
This does not mean type B or C is good only when setpoint is a
constant. The defects of type A comes with the first PID that was
invented more than half a century ago. The setpoint should have
removed from P and D terms. As I said, people still have strong good
feelings towards type A PID even though some experienced engineers
call them "textbook" PID (more or less this shows some frustration
with what they learned from textbook).
Think about this: Why people called type A textbook PID? Why people
began to use type B PID even though type A was invented long time ago?
If you know the answers, then you know why type C is the better than
type A and B, because the answer is the same.
Dan
"Peter Nachtwey" <pnac...@home.com> wrote in message
I think you would benefit from doing a bode plot (phase delay and gain
versus frequency) of the process response versus setpoint for the
three versions, and you will see why C is not the preferred choice in
many fast changing (relative to process settling time) applications.
Of course, the perfect gain would be 1 and the phase delay would be
zero. None of your controllers (each optimally tuned) will achieve
that, but your C version will have gain drop off at lower frequencies,
and more phase delay than A or B.
--
John Popelish
Dan
BESTune wrote:
>
> If simulation shows that type C's setting time is shorter than type A
> and B, why is there a need to see the bode plot?
>
> John wrote:
> > I think you would benefit from doing a bode plot (phase delay and gain
> > versus frequency) of the process response versus setpoint for the
> > three versions, and you will see why C is not the preferred choice in
> > many fast changing (relative to process settling time) applications.
> > Of course, the perfect gain would be 1 and the phase delay would be
> > zero. None of your controllers (each optimally tuned) will achieve
> > that, but your C version will have gain drop off at lower frequencies,
> > and more phase delay than A or B.
--
John Popelish
What do you do about the overshoot? The integrator must overshoot because
it winds up when there is a step jump in the error. It must unwind by
overshooting the set point. This is not acceptable. If the motion
controller can follow a ramped setpoint from one position to another with
only a small error the integrator will not windup and overshoot.
> So I strongly recommend the use of type C PID in motion
> control.
You haven't tried this on a motion controller have you?
Has anyone else?
> Type A, B, and C are equivalent if setpoint is a constant.
Yes, but that is not reality. By definition a motion controller controls
motion. That is a moving set point!.
> This does not mean type B or C is good only when setpoint is a
> constant. The defects of type A comes with the first PID that was
> invented more than half a century ago. The setpoint should have
> removed from P and D terms. As I said, people still have strong good
> feelings towards type A PID even though some experienced engineers
> call them "textbook" PID (more or less this shows some frustration
> with what they learned from textbook).
>
> Think about this: Why people called type A textbook PID?
Because it is ideal. In practice there must be limits on the integral windup
and a pole in the differentiator to keep from having infinite gain at high
frequencies
> Why people
> began to use type B PID even though type A was invented long time ago?
Because they were too lazy, lacked processing power, or not capable of
making a good trajectory generator ( ramp and soak for the process people).
This is where 90% of the effort is. The PID is the trivial part.
Motion people must do gearing, clutching, camming, and super imposed moves
not just point to point moves.
In many applications the set point never stops!
> If you know the answers, then you know why type C is the better than
> type A and B, because the answer is the same.
WRONG! This may be acceptable to process people but a motion controller
must follow a set point that is ramped precisely from one position to
another. Motion people want to know that the motion controller not only
gets to position but is exactly where it should be every millisecond along
the path. This way multiple axes can be synchronized together. Your B and
C 'PID' do not even take into account that set point is moving! How can
that be better at following a moving set point?
Peter Nachtwey
-----------------------
For a process control problem, I have "An Open PID Controller Tuning
Contest" published at
http://bestune.50megs.com/CO_PV.htm
A comparison between type A, B, C is given at
http://bestune.50megs.com/typeABC.htm
The performance of type C PID with different tightness is shown at
http://bestune.50megs.com/tightness.htm
If someone can get better PID control results using type A or B, then
I am defeated.
---------------------
If someone can provide me with a motion PID control problem, I can
repeat all the above work, i.e., give a comparison between type A, B,
and C PIDs. I am sure type C is still the best. Let's do it now.
---------------------
As far as I can tell from your page that compares controller
algorithms, your process is a zero dead time, single time constant
one. This is an extremely well behaved, undemanding sort of thing to
control with a PID controller. Almost any controller algorithm can be
made to work pretty well. Most real process responses are lots
tougher than this.
And if you give credit to shortest first time to setpoint, your
equation C does not even win with that process, but is the worst. In
fact, if you specify a reasonable error band (anything from +-1/4 of
the setpoint step size to +-1/10 of the setpoint step size) and time
the response to stability within that band, C always looses even with
this easy example. Your visual definition of best is a very arbitrary
and not very useful one.
Try this comparison with an integrating process with an additional
time constant and C will fall on its ass. The only kind of process
response that I expect C to excel at would be a pure dead time
response. For that one, derivative is useless, and proportional gain
can only be used sparingly, anyway, so reacting with mostly integral
action is the only solution left to the PID, anyway.
--
John Popelish
a good reference is "Feedback Controllers for the Process Industries" by F.
G. Shinskey.
One solution to Dan's "Which controller is best?" is to use a setpoint
filter:
http://www.expertune.com/Advanced.html#SetPointFilter
All of Dan's controllers respond identically to load upsets which is what
process industry people usually care most about:
http://www.expertune.com/artcon91.html
I would not recommend using ANY of Dan's controllers unless the D action
were filtered and I had intimate knowledge of the anti-windup features.
John Gerry, ExperTune Inc.
Dan
Thanks for your comments. For a PID controller with buit in filter
please take a look at
http://bestune.50megs.com/piddesign.htm.
In many practical applications signals (e.g. process variables PV)
contain noise. Filters are used to reduce noise in the signals. There
hardware filters and software filters. When tuning a PID controller,
the filter should consider as one part of the process. This is because
the PID controller receives the PV from a filter.
The design of a PID controller and the design of a filter can be
separated, even though they can be put into the same program or even
the same function. For a hardware filter, we have to separate the PID
controller with the filter.
Having the above in mind, we can say the three types of PID controller
described at:
http://bestune.50megs.com/typeABC.htm
cover all PID controllers in industry. I don't it is convenient to mix
filters with PID controllers, because there are so many different
filters and there are even larger number of all possible combinations.
Again, I don't think filters and PID controllers cannot be put
together (see above). For more of my idea
please take a look at
http://bestune.50megs.com/piddesign.htm.
Futher comments welcome.
Dan
"John G" <jp...@expertune.com> wrote in message news:<3b5040e8$0$93665$272e...@news.execpc.com>...