# PID Controller Standard

D

#### Danyang Liu

For a long time I have been thinking about the standards of PID controller. There are various forms and types of PID control equations. Some of these can be found at

http://bestune.50megs.com/PLC.htm
I am sure the different names, different structures, different forms, etc., concerning PID control equations confused many people and may have caused some serious problems. So it is important that an industrial standard for PID control equations be set up.

Then what should be the standard? This question will cause a lot of discussion and disputes. I have done some research on this topic and I would
like to share it with others and I also wish to get comments or criticisms.

All existing PID equations can be simplified into three basic types, which are listed below.

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 but best):

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)]

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. Any comments and criticisms welcome.

Dan

J

#### jmGiraud

I just visited your site:
Intresting how much you did, but wrong.
The D & I have not enough terms to come close to an analog approximation. For decent " D " approximation, you need 11 terms. This way, you can have an excellent second drivative. For decent " I " you need 13 terms. From experience, AB can not replicate an analog tuning. The common mistake is that most users address the controller output faster than the system's dynamic.

J

#### Johan Bengtsson

What is best (of B and C) really depends on what is to be controlled and should therefore (in my opinion) not be anything "standardized" and decided before you actually know what you want to control.

Some even introduce another parameter, this parameter (between 0 and 1) decides how much of the setpoint should directly affect the output, ie somewhere between B (1) and C (0)

Form A actually have it's uses too in some processes, bus since most controllers don't use the D-part anyway there won't be any difference.

Then there is more matters to consider:

First of all, the ones you have listed below is not the "normal" way a PID should be done, since the normal way is what is called "Dependent PID" on the page your link refers to. This means the
proportional gain should affect ALL terms of the controller.

Then there is the "serial" form of PID controllers, ok they are obsolete in most areas and there si no real difference unless the D-part is actually used but anyway.

Normal PID-controllers also have a filter at the D-part in order to supress the noice aplified by that part, normally a fraction of Td, usually somewhere in the range 1/15 to 1/5, usually for
some reason 1/9. Without this filter is the D-part realtively useless in quite many cases because of noice.

/Johan Bengtsson

----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------

D

#### Dr Gerrit M. van der Molen

Dan,

A problem with Type C is that this will not work without integral action in the controller, i.e. if Ki=0. The other Types, A and B, will work
without modification for proportional-only and proportional-derivative control. Also, would the response of Type C not be very slow if a small
value of Ki was used? (but maybe this is could be intentional?)

I noticed an earlier thread on this subject, under 'TRUE PID':

http://www.control.com/control_com/953587574/index_html
Did this not lead to a conclusive decision on the 'standard' (or
'best/most usable/...') PID formulation to be used?

Regards,
Gerrit.

-----------------------------------------------------------------------
Dr ir Gerrit M. van der Molen
Industrial Systems and Control Ltd.
50 George Street, Glasgow G1 1QE, UK
Tel: (+44) (0)141-553 1111 Fax: (+44) (0)141-553 1232
Email: [email protected] WWW: http://www.isc-ltd.com
-----------------------------------------------------------------------

D

#### Danyang Liu

Please note that if the setpoint is a constant, then type A, B, and C are equivalent. If you set Ki=0, then all three types of PID will not track the setpoint. In particular, the P-only PID of any types is only try to keep PV a constant if the P gain is properly set. If the P gain is too large, it will cause oscillations in PV. Please note that a P-only PID will not response to any change in setpoint changes, no matter your P-only PID is of type A, B, or C, or any other types.

If you want your PV to track SP, then Ki can't be 0.

D

#### Danyang Liu

The dependent and serial form of PID can be simplified to the independent form.

The are many reasons that D term is not used. I only list three of them:

(1) For manual tuning, a PI controller (with only two parameters) is much easier to tune than a PID (with three parameters).
(2) A PI controller is enough.
(3) In case D-term contains setpoints, then changes in setpoint will cause unwanted changes in CO. This reason is often ignored.

Dan

E

#### Eminent

D for "Difficult".

Anand

B

#### Bruce Durdle

Danyang,

I can see no advantage in "simplifying" the dependent and serial forms of PID to the "independent" form.

The independent form, as an algebraic or time-based equation, certaily has the P, I, and D terms nicely independnet. But convert it into its
transfer-function form and plot a Bpode chart of it, and the independence vanishes - change the gain and the low-frequency and higfh-frequency
cut-off points also change. With the traditional or serial form:

Out = K (1 + 1/sTi)(1 + sTd)

= K (1 + sTi) (1 + sTd)/sTi

the frequency response elements are each independent.

More importantly, this interaction shows up where it matters - when tuning loops. With the so-called "independent" form, it is possible to reduce the gain of a loop which is pretty close to optimally-tuned (as would be done when adjusting a PI loop if integral action is being increased) and have it become less stable. In short, the standard tuning rules apply to the serial or traditional form, but not to the "independent" form.

In short, the so-called "independent" PID algorithm is nice for the mathematicians, but has major problems when applied in practice. I think
there are more important issues to consider when discussing PIDs - in particular, how bumpless transfer and other operator interactions are to be
implemented.

Bruce.

D

#### Dr Gerrit M. van der Molen

A P-only PID of type A or B will respond to setpoint changes: suppose that CO=SP=PV=0 up to time k, and SP(k)=1. Then (with e=SP-PV):

CO(k) = CO(k-1) + Kp*[e(k) - e(k-1)] = 0 + Kp*[1 - 0] = Kp

The response of the plant/process output PV to this proportional control output will of course depend on the type of the process. In many cases
the reduction in the output error will be insufficient (for an otherwise "properly set" value of the P gain Kp) and integral action in the
controller will be required, but not always. For example, if the process has integral action itself (e.g. level control of liquid in a tank
through control of the inlet and/or outlet flow) and no uncontrolled in/outflows, the output will track setpoint changes for any (non-zero) value of Kp with no steady-state error. However, such systems are rare, and I agree with you that in most cases "Ki can't be 0" for acceptable
setpoint tracking.

Gerrit.

PS Or is there some issue with the usual implementation of types A and B that means they do not operate as in the equation above?

-----------------------------------------------------------------------
Dr ir Gerrit M. van der Molen
Industrial Systems and Control Ltd.
50 George Street, Glasgow G1 1QE, UK
Tel: (+44) (0)141-553 1111 Fax: (+44) (0)141-553 1232
Email: [email protected] WWW: http://www.isc-ltd.com

J

#### Johan Bengtsson

Well, both A and B would react to setpoint changes with only P activated but not C.

With only P activated you will not be able to completely follow the setpoint, but you can get close and the controller will react to a change, but possibly not enough. Larger gain means you keep closer to setpoint changes, and greater
risk in oscillating.

/Johan Bengtsson

----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------

J

#### Johan Bengtsson

That is true, but the values of the parameters for the I-term and D-term are not the same, and that makes a lot of confusion in the end. All optimisations methods I have seen is made for the dependent (or in some cases the serial form) never for the independent. That don't mean you can't convert the parameters but they won't work well directly.

Changing the gain on a dependent and on an independent implemented controller will *not* have the same effect, this can be really confusing.

I personally think independant implemented controllers should be avoided, or possibly an automatic parameter conversion applied. It is true that you can do a little bit more with the independant but you don't really have much use for that anyway...

/Johan Bengtsson

----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------

D

#### Danyang Liu

(1) The three PID forms: Independent, Dependent, and Serial

It is possible that the dependend PID is more suitable for manual tuning. However, the independent form represents a wider range of PIDs. Given any dependent PID with a specific PID setting, there is always an independent PID that is equivalent to the given dependent PID. The reverse is NOT true.

Similarly, the set of serial PIDs is a subset of the set of independent PIDs.

Except some special cases, all these three forms can be transformed from one to another, i.e., they are mathematically equivalent.

(2) The three Types of PID: Type A, Type B, and Type C.

If the setpoint is a constant, then these three types are equivalent. If the setpoint changes, then these three types are NOT equivalent, and they behave quite differently. My conclusion is: Type C behaves best, type B is worse, and type A is worst. For a proof of this conclusion see

http://bestune.50megs.com/typeABC.htm
Dan

J

#### Johan Bengtsson

D is not difficult if you take some time to understand what it does and why. There is nothing beating good education (I know since that is what I do at work )

However, you need to understand that most control circuits would not gain *anything* by applying the D-term, and completely regardless of how you apply the D-term you will amplify noice.
The simple rule is: if you don't need D, don't use it if you need D, use it and apply filters to reduce noice.

/Johan Bengtsson

----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------

D

#### Danyang Liu

The bad effect of setpoint in the D term is more obvious than that in the P term. This is possible people removed setpoint from D term (e.g. A.-B. PLCs) and did not do this for P term.

If setpoint is removed from both P term and D term, then the D term can greatly improve the performance of your PID controller if the PID is
well-tuned.

Dan

D

#### Danyang Liu

Yes, "a P-only PID of type A or B will respond to setpoint changes". But this change takes place only ONCE (lets assume there is a one step change in SP). And this change in CO does not guarantee that PV will be brought to the new SP. From this point of view, a P-only control should not be used.

Dan

D

#### Danyang Liu

I agree with you. That is why I don't recommend the use of a P-only control. The I-term is essential in a PID controller and can't be set to zero.

Dan

E

#### Eminent

D for Difficult was a small piece of humour.

Some points about usage of D element not sequentially arranged.

D factor comes into picture at the time of change in the process or error depending on your selection. It is not a "continously acting" feature. Used with P, and I, the D factor many a times acts opposite to the I factor.

Generally the gain and integral factors based on error give very good results while the D factor could be helpful if based on process. If the user
is not able to establish this aspect then there could be some problems.

Dead time can be effectively controlled by Dead time factors rather than by D. In other words "does your loop require D element" needs to be analysed.

Rate of change in error or rate of change in process could be nonlinear in the range of operation. This will effectively mean that at multiple points in the process and control values, you will need multiple values for D
element of the PID loop. Though this malady is also true to P and I values, this many a times has lesser significance for P and I.

"Dyanamism" of the process could also be equipment specific. Say there are two pumps. Then one pump affects the process in a different way and the other one could be significantly different.

Anand

J

#### Johan Bengtsson P&L Automatik AB

>(1) The three PID forms: Independent, Dependent, and Serial
>
>It is possible that the dependend PID is more suitable for manual tuning.
>However, the independent form represents a wider range of PIDs. Given any
>dependent PID with a specific PID setting, there is always an independent
>PID that is equivalent to the given dependent PID. The reverse is NOT true.

The reverse is not true for gain=0, all other can be converted. Is gain=0 really useful practically? That would be equivalent as having a pure I (or ID) controller, quite unusual.

>Similarly, the set of serial PIDs is a subset of the set of independent
>PIDs.

I guess you mean the serial is a subset if dependent, but of course your statement is true anyway....

>Except some special cases, all these three forms can be transformed from one
>to another, i.e., they are mathematically equivalent.

True

>(2) The three Types of PID: Type A, Type B, and Type C.
>
>If the setpoint is a constant, then these three types are equivalent.
>If the setpoint changes, then these three types are NOT equivalent, and they
>behave quite differently. My conclusion is: Type C behaves best, type B is
>worse, and type A is worst. For a proof of this conclusion see
>
>http://bestune.50megs.com/typeABC.htm

I don't really agree. This statement is true for some (possibly most) cases, but not neccesarily for all. Actually I can se use for even type A in some cases. In cases when the setpoint is changed in steps, the statement would be true, most surely for type A but not neccesarily for type B. However in cases when you have smooth changes in setpoint there is most surely cases when it would be better to have at least type B, possibly type A.

/Johan Bengtsson

----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------

J

#### Johan Bengtsson

What do you mean by that?

A continous controller (such as a PID) don't ever do anything just once, it might seem like that but it isn't.

They continue to work on their input over and over again and while it is true that there is no guarantee that the PV will be brought to be exactly equal to SP (it almost never does in an P only controller) it can very well bring it close enough for some processes. To simply say that P only control is useless is wrong since it depends on the process.

Controllers of type A and B (effectively the same if D is not used) work continously on the control error trying to bring it as close to 0 as possible without any memory of what happended the calculation before.

/Johan Bengtsson

----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------

J

#### Johan Bengtsson

The world is full of P only controllers, and they do their work, often good enough too....

Some examples of where you find P only controllers:

1. Do you have a power lawnmower? The throttle in those is normally controlled by a P only controller controlling the speed of the engine. The SP comes from the speed lever and the PV comes from the air speed thru the cooling fan, a spring togheter with some other parts decides the
gain and affects the throttle. The reason for this is of course that when the motor gets heavily loaded the throttle is opened and the speed is almost maintained.

2. A radiator using hot water quite often have a thermostat controlled input valve, this is also a mechanical P only controller.

3. A lot more examples of mechanical P only temperature controllers exist, for example controlling the flow of water thru the radiator of a car to cool the engine

4. Another example is the thermostat controller found in some showers, those where you have one knob for the temperature and another for the flow (as opposed to one for hot water and another for cold, those don't have a controller at all)

5. Speed control of some cooling fans, for example inside a computer. The simplest solution I have seen is to connect a temperature dependant resistor (NTC) in series with the fan and attach it to the normally hottest component. This will effectively be a P only controller.

None of these controllers will be able to exactly maintain the setpoint, in most cases it won't matter (or perhaps even be noticed). The shower is the one I have found out to be the one in most need for a different control scheme (for example adding an I part) but doing that mechanically would be not so easy and introducing an electronical controller and the necesary valves and sensors might just be too expensive. These control circuits would not actually suffer from having an I part, but the cost would be too high since they are mechanical.

6. Position control. A position control loop don't need an I part to work, adding I will make it less optimal than not having I by making it less stable. Since the I part don't make the control better it should not be used.

Other cases probably exists when the I part don't actually improve but rather make it worse, I don't know more examples right now from memory but I am 100% conviced they exists until the opposite is proved.

/Johan Bengtsson

----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------