The Proportional-Integral- Derivative Controller.

25
The Proportional- Integral-Derivative Controller

Transcript of The Proportional-Integral- Derivative Controller.

Page 1: The Proportional-Integral- Derivative Controller.

The Proportional-Integral-Derivative Controller

Page 2: The Proportional-Integral- Derivative Controller.

Objectives

• Learners will be able to– Describe the different components of the PID

controller (Mathematical activities)– Explain the function of each component

(research activity)– Explain the function of the PID (Group

discussion)– Give examples of application systems of PID

(targeted questioning)

Page 3: The Proportional-Integral- Derivative Controller.

PID diagram

The PID controller looks at the SetPoint (SP) and compares it with the actual value of the Process Variable (PV) i.e. what we want (desired output) and what we have got (actual output).

Goal is to have VSET = VOUT

Note that VERROR = VSET – VSENSOR

Output Process uses VERROR from the PID controller to adjust Vout such that it is ~VSET

Page 4: The Proportional-Integral- Derivative Controller.

Application

Page 5: The Proportional-Integral- Derivative Controller.

How the PID Black Box Operates

The PV is subtracted from the SP to create the Error. The error is simply multiplied by either the P, the I, the D or the combination of two or all three as outlined below depending on which ones are turned on. Then the resulting are added together and sent to the controller output.P – Sometimes usedPI - Most often usedPID – Sometimes usedPD – rare as hen’s teeth but can be useful for controlling servomotors.

Page 6: The Proportional-Integral- Derivative Controller.

Derivatives

• It means the rate of change• It’s mathematical formula is:• Change in y/change in x = slope

Page 7: The Proportional-Integral- Derivative Controller.

Derivatives…

• Consider the function f(x) = x2 • We know f(x) = x2, and can therefore calculate

f(x+Δx):• Start with: f(x+Δx) = (x+Δx)2

• Expanding the RHS: (x + Δx)2 = x2 + 2x Δx + (Δx)2

• Therefore f(x+Δx) = x2 + 2x Δx + (Δx)2

Page 8: The Proportional-Integral- Derivative Controller.

Derivatives…

• (f(x+Δx) − f(x)) / Δx = (x2 + 2x Δx + (Δx)2 − x2) / Δx• Simplify (x2 and −x2 cancel): 2x Δx + (Δx)2 / Δx• Simplify more (divide through by Δx):  = 2x + Δx• And then as Δx tends towards 0, we get := 2x• Result: the derivative of x2 is 2x, written

mathematically as:

Page 9: The Proportional-Integral- Derivative Controller.

Math activity: 20 mins

• Work out the derivative of:

Page 10: The Proportional-Integral- Derivative Controller.

IntegralThe integral of a signal is the sum of all the instantaneous values that the signal has been, from whenever you started counting until you stop counting.

Page 11: The Proportional-Integral- Derivative Controller.

Integrals…

The green line is your temperature.The red circles are where your control system has sampled the temperature The blue area is the integral of the temperature signal. It is the sum of the 5 temperature values over the time period that you are interested in. In numerical terms it is the sum of the areas of each of the blue rectangles:(13 x 1)+(14x1)+(13x1)+(12x1)+(11x1) = 63 °C sThe curious units (degrees Celsius x seconds) are because we have to multiply a temperature by time – but the units aren’t important.So the integral turns out to be the area under the curve. Note that in real world systems, we actually get an approximation to the area under the curve, which from the diagram’s perspective gets better, the higher the sample rate.

Page 12: The Proportional-Integral- Derivative Controller.

Integrals…The derivative of x2+4 is 2x, and the derivative of x2+99 is also 2x, and so on, because the derivative of a constant is zero. So when we reverse the operation (to find the integral) we only know 2x, but there could have been a constant of any value. So we wrap up the idea by just writing + C at the end.

Page 13: The Proportional-Integral- Derivative Controller.

Proportional

In P-mode, the controller simply multiplies the Error by the Proportional Gain (Kp) to get the controller output.Kp is the setting that the user tunes to get the desired performance from a “P only” controller.

Page 14: The Proportional-Integral- Derivative Controller.

PID controller

Three-term control:

• Proportional term (P) depends proportionally on the present error

• Integral term (I) depending on the accumulation of past errors

• Derivative term (D) is a prediction of future errors, based on current rate of change

Page 15: The Proportional-Integral- Derivative Controller.

PID Controller

Given the error e(t), the control command, Q(t), used to adjust the process is a weighted sum of P, I, and D:

where KP, KI, KD are positive constants referred to as proportional gain, integral gain and derivative gain respectively

)(')()()(0

teKdeKteKtQt

DIP

Page 16: The Proportional-Integral- Derivative Controller.

Variations: Proportional control

)()()( tQteKtQ dP

where Qd(t) is a desired control command, or bias/reset and KP is a positive constant

In proportional control, the command Q(t) used to adjust the process is:

Page 17: The Proportional-Integral- Derivative Controller.

Variations: Integral control (PI)

In integral (PI) control, the command Q(t) used to adjust the process is:

t

IP deKteKtQ0

)()()(

where KP and KI are positive constants

Page 18: The Proportional-Integral- Derivative Controller.

Variations: Differential control (PD)

)(')()( teKteKtQ DP

where KP and KD are positive constants

In differential (PD) control, the command Q(t) used to adjust the process is:

Page 19: The Proportional-Integral- Derivative Controller.

P + I

It will not work as expected except when the user knows exactly how much Integral action to apply

Page 20: The Proportional-Integral- Derivative Controller.

Now your turn: 20 mins

• Explain the following concept– The two step mode– Proportional control mode– Integral control mode– The derivative control mode

Page 21: The Proportional-Integral- Derivative Controller.

Answers• The two-step mode: The controller is just a switch which is

activated by the error signal and supplies just an on-off correcting signal. Example of such mode is the bimetallic thermostat.

• The proportional mode (P): This produces a control action that is proportional to the error. The correcting signal thus becomes bigger the bigger the error. Therefore, the error is reduced the amount of correction is reduced and the correcting process slows down. A summing operational amplifier with an inverter can be used as a proportional controller.

• The derivative mode: This produces a control action that is proportional to the rate at which the error is changing. When there is a sudden change in the error signal the controller gives a large correcting signal. When there is a gradual change only a small correcting signal is produced. An operational amplifier connected as a differentiator circuit followed by another operational amplifier connected as an inverter make an electronic derivative controller circuit.

Page 22: The Proportional-Integral- Derivative Controller.

Answers• The integral mode (I): This produces a control action that is

proportional to the integral of the error with time. Therefore, a constant error signal will produce an increasing correcting signal. The correction continues to increase as long as the error persists.

• Combination of modes: Proportional plus derivative modes (PD), proportional plus integral modes (PI), proportional plus integral plus derivative modes (PID). The term three-term controller is used for PID control.

• The controller may achieve these modes by means of pneumatic circuits, analog electronics involving operational amplifiers or by the programming of a microprocessor or computer.

Page 23: The Proportional-Integral- Derivative Controller.

Adjusting the Integral Action

The way to adjust how much Integral Action you have is by adjusting a term called “minutes per repeat”. It is a measure of how long it will take for the Integral Action to match the Proportional Action. In other words, if the output of the proportional box on the diagram above is 20%, the repeat time is the time it will take for the output of the Integral box to get to 20% too. And the important point to note is that the “bigger” integral action, the quicker it will get this 20% value. That is, it will take fewer minutes to get there, so the “minutes per repeat” value will be smaller. In other words the smaller the “minutes per repeat” is the bigger the integral action. To make things a bit more intuitive, a lot of controllers use an alternative unit of “repeats per minute” which is obviously the inverse of “minutes per repeat”. The nice thing about “repeats per minute” is that the bigger it is - the bigger the resulting Integral action is.

Page 24: The Proportional-Integral- Derivative Controller.

Predicting the future with the derivatives Engineers are always looking to tweak performance by adding the Derivative Action.The Derivative action can allow the engineer to have bigger P and I gains and still keep the loop stable, producing a faster response and better loop performance.Derivative action improves the controller action because it predicts what is yet to happen by projecting the current rate of change into the future. This means that it is not using the current measured value, but a future measured value.The units used for derivative action describe how far into the future you want to look. i.e. If derivative action is 20 seconds, the derivative term will project the current rate of change 20 seconds into the future.The big problem with D control is that if you have noise on your signal (which looks like a bunch of spikes with steep sides) this confuses the hell out of the algorithm. It looks at the slope of the noise-spike and thinks:As it thinks that the process is changing quickly, it will accelerate the D ActionAnd the control output jumps all over the place, messing up the control.The solution is to try and filter the noise out, but the rule of thumb is unless PI control is really slow, D should not be activated.

Page 25: The Proportional-Integral- Derivative Controller.

Conclusion/summary

• Group discussion