Showing posts with label Drives. Show all posts
Showing posts with label Drives. Show all posts

Integral Action and PI Control

 Like the P-Only controller, the Proportional-Integral (PI) algorithm computes and transmits a controller output (CO) signal every sample time, T, to the final control element (e.g., valve, variable speed pump). The computed CO from the PI algorithm is influenced by the controller tuning parameters and the controller error, e(t).
PI controllers have two tuning parameters to adjust. While this makes them more challenging to tune than a P-Only controller, they are not as complex as the three parameter PID controller.
Integral action enables PI controllers to eliminate offset, a major weakness of a P-only controller. Thus, PI controllers provide a balance of complexity and capability that makes them by far the most widely used algorithm in process control applications.

The PI Algorithm

While different vendors cast what is essentially the same algorithm in different forms, here we explore what is variously described as the dependent, ideal, continuous, position form:

Where:
CO = controller output signal (the wire out)
CObias = controller bias or null value; set by bumpless transfer as explained below
e(t) = current controller error, defined as SP - PV
SP = set point
PV = measured process variable (the wire in)
Kc = controller gain, a tuning parameter
Ti = reset time, a tuning parameter

The first two terms to the right of the equal sign are identical to the P-Only controller referenced at the top of this article.
The integral mode of the controller is the last term of the equation. Its function is to integrate or continually sum the controller error, e(t), over time.

Some things we should know about the reset time tuning parameter, Ti:
▪ It provides a separate weight to the integral term so the influence of integral action can be independently adjusted.
▪ It is in the denominator so smaller values provide a larger weight to (i.e. increase the influence of) the integral term.
▪ It has units of time so it is always positive.


Function of the Proportional Term

As with the P-Only controller, the proportional term of the PI controller, Kc·e(t), adds or subtracts from CObias based on the size of controller error e(t) at each time t.

As e(t) grows or shrinks, the amount added to CObias grows or shrinks immediately and proportionately. The past history and current trajectory of the controller error have no influence on the proportional term computation.

The plot below illustrates this idea for a set point response. The error used in the proportional calculation is shown on the plot:
▪ At time t = 25 min, e(25) = 60-56 = 4
▪ At time t = 40 min, e(40) = 60-62 = -2

pierrorsmall.jpg

Recalling that controller error e(t) = SP - PV, rather than viewing PV and SP as separate traces as we do above, we can compute and plot e(t) at each point in time t.

Below is the identical data to that above only it is recast as a plot of e(t) itself. Notice that in the plot above, PV = SP = 50 for the first 10 min, while in the error plot below, e(t) = 0 for the same time period.

pierror2small.jpg

This plot is useful as it helps us visualize how controller error continually changes size and sign as time passes.

Function of the Integral Term

While the proportional term considers the current size of e(t) only at the time of the controller calculation, the integral term considers the history of the error, or how long and how far the measured process variable has been from the set point over time.

Integration is a continual summing. Integration of error over time means that we sum up the complete controller error history up to the present time, starting from when the controller was first switched to automatic.

Controller error is e(t) = SP - PV. In the plot below, the integral sum of error is computed as the shaded areas between the SP and PV traces.

piintsmall.jpg

Each box in the plot has an integral sum of 20 (2 high by 10 wide). If we count the number of boxes (including fractions of boxes) contained in the shaded areas, we can compute the integral sum of error.

So when the PV first crosses the set point at around t = 32, the integral sum has grown to about 135. We write the integral term of the PI controller as:

Since it is controller error that drives the calculation, we get a direct view the situation from a controller error plot as shown below:

piint2small.jpg

Note that the integral of each shaded portion has the same sign as the error. Since the integral sum starts accumulating when the controller is first put in automatic, the total integral sum grows as long as e(t) is positive and shrinks when it is negative.

At time t = 60 min on the plots, the integral sum is 135 - 34 = 101. The response is largely settled out at t = 90 min, and the integral sum is then 135 - 34 7 = 108.

Integral Action Eliminates Offset
The previous sentence makes a subtle yet very important observation. The response is largely complete at time t = 90 min, yet the integral sum of all error is not zero.

In this example, the integral sum has a final or residual value of 108. It is this residual value that enables integral action of the PI controller to eliminate offset.

As discussed in a previous article, most processes under P-only control experience offset during normal operation. Offset is a sustained value for controller error (i.e., PV does not equal SP at steady state).

We recognize from the P-Only controller:

ponlycontrollereq.jpg

that CO will always equal CObias unless we add or subtract something from it.

The only way we have something to add or subtract from CObias in the P-Only equation above is if e(t) is not zero. It e(t) is not steady at zero, then PV does not equal SP and we have offset.

However, with the PI controller:

picontroller.jpg

we now know that the integral sum of error can have a final or residual value after a response is complete. This is important because it means that e(t) can be zero, yet we can still have something to add or subtract from CObias to form the final controller output, CO.

So as long as there is any error (as long as e(t) is not zero), the integral term will grow or shrink in size to impact CO. The changes in CO will only cease when PV equals SP (when e(t) = 0) for a sustained period of time.

At that point, the integral term can have a residual value as just discussed. This residual value from integration, when added to CObias, essentially creates a new overall bias value that corresponds to the new level of operation.

In effect, integral action continually resets the bias value to eliminate offset as operating level changes.

Challenges of PI Control

There are challenges in employing the PI algorithm:
▪ The two tuning parameters interact with each other and their influence must be balanced by the designer.
▪ The integral term tends to increase the oscillatory or rolling behavior of the process response.

Because the two tuning parameters interact with each other, it can be challenging to arrive at "best" tuning values. The value and importance of our design and tuning recipe increases as the controller becomes more complex.

Initializing the Controller for Bumpless Transfer

When we switch any controller from manual mode to automatic (from open loop to closed loop), we want the result to be uneventful. That is, we do not want the switchover to cause abrupt control actions that impact or disrupt our process

We achieve this desired outcome at switchover by initializing the controller integral sum of error to zero. Also, the set point and controller bias value are initialized by setting:
▪ SP equal to the current PV
▪ CObias equal to the current CO

With the integral sum of error set to zero, there is nothing to add or subtract from CObias that would cause a sudden change in the current controller output. With the set point equal to the measured process variable, there is no error to drive a change in our CO. And with the controller bias set to our current CO value, we are prepared by default to maintain current operation.

Thus, when we switch from manual mode to automatic, we have "bumpless transfer" with no surprises. This is a result everyone appreciates.

Reset Time Versus Reset Rate

Different vendors cast their control algorithms in slightly different forms. Some use proportional band rather than controller gain. Also, some use reset rate, Tr, instead of reset time. These are simply the inverse of each other:
Tr = 1/Ti

No matter how the tuning parameters are expressed, the PI algorithms are all equally capable.

But it is critical to know your manufacturer before you start tuning your controller because parameter values must be matched to your particular algorithm form. Commercial software for controller design and tuning will automatically address this problem for you.

Implementing a PI controller

We explore PI controller design, tuning and implementation on the heat exchanger in this article and the gravity drained tanks in this article.

Read more


The P-Only Control Algorithm

The simplest algorithm in the PID family is a proportional or P-Only controller. Like all automatic controllers, it repeats a measurement-computation-action procedure at every loop sample time, T, following the logic flow shown in the block diagram below (click for large view):

 

Starting at the far right of the control loop block diagram above:
  • A sensor measures and transmits the current value of the process variable, PV, back to the controller (the 'controller wire in')
  • Controller error at current time t is computed as set point minus measured process variable, or e(t) = SP - PV
  • The controller uses this e(t) in a control algorithm to compute a new controller output signal, CO
  • The CO signal is sent to the final control element (e.g. valve, pump, heater, fan) causing it to change (the 'controller wire out')
  • The change in the final control element (FCE) causes a change in a manipulated variable
  • The change in the manipulated variable (e.g. flow rate of liquid or gas) causes a change in the PV

The goal of the controller is to make e(t) = 0 in spite of unplanned and unmeasured disturbances. Since e(t) = SP - PV, this is the same as saying a controller seeks to make PV = SP.

The P-Only Algorithm
The P-Only controller computes a CO action every loop sample time T as:

CO = CObias Kc∙e(t)

Where:
CObias = controller bias or null value
Kc = controller gain, a tuning parameter
e(t) = controller error = SP - PV
SP = set point
PV = measured process variable


Design Level of Operation
Real processes display a nonlinear behavior, which means their apparent process gain, time constant and/or dead time changes as operating level changes and as major disturbances change. Since controller design and tuning is based on these Kp, Tp and Өp values, controllers should be designed and tuned for a pre-defined level of operation.

When designing a cruise control system for a car, for example, would it make sense for us to perform bump tests to generate dynamic data when the car is traveling twice the normal speed limit while going down hill on a windy day? Of course not.

Bump test data should be collected as close as practical to the design PV when the disturbances are quiet and near their typical values. Thus, the design level of operation for a cruise control system is when the car is traveling at highway speed on flat ground on a calm day.

Definition: the design level of operation (DLO) is where we expect the SP and PV will be during normal operation while the important disturbances are quiet and at their expected or typical values.

Understanding Controller Bias
Let's suppose the P-Only control algorithm shown above is used for cruise control in an automobile and CO is the throttle signal adjusting the flow of fuel to the engine.

Let's also suppose that the speed SP is 70 and the measured PV is also 70 (units can be mph or kph depending on where you live in the world). Since PV = SP, then e(t) = 0 and the algorithm reduces to:

CO = CObias Kc∙(0) = CObias

If CObias is zero, then when set point equals measurement, the above equation says that the throttle signal, CO, is also zero. This makes no sense. Clearly if the car is traveling 70 kph, then some baseline flow of fuel is going to the engine.

This baseline value of the CO is called the bias or null value. In this example, CObias is the flow of fuel that, in manual mode, causes the car to travel the design speed of 70 kph when on flat ground on a calm day.

Definition: CObias is the value of the CO that, in manual mode, causes the PV to steady at the DLO while the major disturbances are quiet and at their normal or expected values.

A P-Only controller bias (sometimes called null value) is assigned a value as part of the controller design and remains fixed once the controller is put in automatic.

Controller Gain, Kc
The P-Only controller has the advantage of having only one adjustable or tuning parameter, Kc, that defines how active or aggressive the CO will move in response to changes in controller error, e(t).

For a given value of e(t) in the P-Only algorithm above, if Kc is small, then the amount added to CObias is small and the controller response will be slow or sluggish. If Kc is large, then the amount added to CObias is large and the controller response will be fast or aggressive.

Thus, Kc can be adjusted or tuned for each process to make the controller more or less active in its actions when measurement does not equal set point.


P-Only Controller Design
All controllers from the family of PID algorithms (P-Only, PI, PID) should be designed and tuned using our proven recipe:
  1. Establish the design level of operation (the normal or expected values for set point and major disturbances).
  2. Bump the process and collect controller output (CO) to process variable (PV) dynamic process data around this design level.
  3. Approximate the process data behavior with a first order plus dead time (FOPDT) dynamic model.
  4. Use the model parameters from step 3 in rules and correlations to complete the controller design and tuning.
The Internal Model Control (IMC) tuning correlations that work so well for PI and PID controllers cannot be derived for the simple P-Only controller form. The next best choice is to use the widely-published integral of time-weighted absolute error (ITAE) tuning correlation:

Moderate P-Only:  

This correlation is useful in that it reliably yields a moderate Kc value. In fact, some practitioners find that the ITAE Kc value provides a response performance so predictably modest that they automatically start with an aggressive P-Only tuning, defined here as two and a half times the ITAE value:


Aggressive P-Only: Kc = 2.5 (Moderate Kc)

Reverse Acting, Direct Acting and Control Action
Time constant, Tp, and dead time, Өp, cannot affect the sign of Kc because they mark the passage of time and must always be positive. The above tuning correlation thus implies that Kc must always have the same sign as the process gain, Kp.

When CO increases on a process that has a positive Kp, the PV will increase in response. The process is direct acting. Given this CO to PV relationship, when in automatic mode (closed loop), if the PV starts drifting too high above set point, the controller must decrease CO to correct the error.

This "opposite to the problem" reaction is called negative feedback and forms the basis of stable control.

A process with a positive Kp is direct acting. With negative feedback, the controller must be reverse acting for stable control. Conversely, when Kp is negative (a reverse acting process), the controller must be direct acting for stable control.

Since Kp and Kc always have the same sign for a particular process and stable control requires negative feedback, then:
  • direct acting process (Kp and Kc positive) −› use a reverse acting controller
  • reverse acting process (Kp and Kc negative) −› use a direct acting controller
In most commercial controllers, a positive value of the Kc is always entered. The sign (or action) of the controller is then assigned by specifying that the controller is either reverse or direct acting to indicate a positive or negative Kc respectively.

If the wrong control action is entered, the controller will quickly drive the final control element (e.g., valve, pump, compressor) to full on/open or full off/closed and remain there until the proper control action entry is made.

Proportional Band
Some manufacturers use different forms for the same tuning parameter. The popular alternative to Kc found in the marketplace is proportional band, PB.

In many industry applications, both the CO and PV are expressed in units of percent. Given that a controller output signal ranges from a minimum (COmin) to maximum (COmax) value, then:

PB = (COmax - COmin)/Kc

When CO and PV have units of percent and both range from 0% to 100%, the much published conversion between controller gain and proportional band results:

PB = 100/Kc

Many case studies on this site assign engineering units to the measured PV because plant software has made the task of unit conversions straightforward. If this is true in your plant, take care when using these conversion formula.

Implementation Issues
Implementation of a P-Only controller is reasonably straightforward, but this simple algorithm exhibits a phenomenon called "offset." In most industrial applications, offset is considered an unacceptable weakness. We explore P-Only control, offset and other issues for the heat exchanger and the gravity drained tanks processes.

Read more


Proportional Control - The Simplest PID Controller

he P-Only Control Algorithm
The simplest algorithm in the PID family is a proportional or P-Only controller. Like all automatic controllers, it repeats a measurement-computation-action procedure at every loop sample time, T, following the logic flow shown in the block diagram below (click for large view):

 

Starting at the far right of the control loop block diagram above:
  • A sensor measures and transmits the current value of the process variable, PV, back to the controller (the 'controller wire in')
  • Controller error at current time t is computed as set point minus measured process variable, or e(t) = SP - PV
  • The controller uses this e(t) in a control algorithm to compute a new controller output signal, CO
  • The CO signal is sent to the final control element (e.g. valve, pump, heater, fan) causing it to change (the 'controller wire out')
  • The change in the final control element (FCE) causes a change in a manipulated variable
  • The change in the manipulated variable (e.g. flow rate of liquid or gas) causes a change in the PV

The goal of the controller is to make e(t) = 0 in spite of unplanned and unmeasured disturbances. Since e(t) = SP - PV, this is the same as saying a controller seeks to make PV = SP.

The P-Only Algorithm
The P-Only controller computes a CO action every loop sample time T as:

CO = CObias Kc∙e(t)

Where:
CObias = controller bias or null value
Kc = controller gain, a tuning parameter
e(t) = controller error = SP - PV
SP = set point
PV = measured process variable


Design Level of Operation
Real processes display a nonlinear behavior, which means their apparent process gain, time constant and/or dead time changes as operating level changes and as major disturbances change. Since controller design and tuning is based on these Kp, Tp and Өp values, controllers should be designed and tuned for a pre-defined level of operation.

When designing a cruise control system for a car, for example, would it make sense for us to perform bump tests to generate dynamic data when the car is traveling twice the normal speed limit while going down hill on a windy day? Of course not.

Bump test data should be collected as close as practical to the design PV when the disturbances are quiet and near their typical values. Thus, the design level of operation for a cruise control system is when the car is traveling at highway speed on flat ground on a calm day.

Definition: the design level of operation (DLO) is where we expect the SP and PV will be during normal operation while the important disturbances are quiet and at their expected or typical values.

Understanding Controller Bias
Let's suppose the P-Only control algorithm shown above is used for cruise control in an automobile and CO is the throttle signal adjusting the flow of fuel to the engine.

Let's also suppose that the speed SP is 70 and the measured PV is also 70 (units can be mph or kph depending on where you live in the world). Since PV = SP, then e(t) = 0 and the algorithm reduces to:

CO = CObias Kc∙(0) = CObias

If CObias is zero, then when set point equals measurement, the above equation says that the throttle signal, CO, is also zero. This makes no sense. Clearly if the car is traveling 70 kph, then some baseline flow of fuel is going to the engine.

This baseline value of the CO is called the bias or null value. In this example, CObias is the flow of fuel that, in manual mode, causes the car to travel the design speed of 70 kph when on flat ground on a calm day.

Definition: CObias is the value of the CO that, in manual mode, causes the PV to steady at the DLO while the major disturbances are quiet and at their normal or expected values.

A P-Only controller bias (sometimes called null value) is assigned a value as part of the controller design and remains fixed once the controller is put in automatic.

Controller Gain, Kc
The P-Only controller has the advantage of having only one adjustable or tuning parameter, Kc, that defines how active or aggressive the CO will move in response to changes in controller error, e(t).

For a given value of e(t) in the P-Only algorithm above, if Kc is small, then the amount added to CObias is small and the controller response will be slow or sluggish. If Kc is large, then the amount added to CObias is large and the controller response will be fast or aggressive.

Thus, Kc can be adjusted or tuned for each process to make the controller more or less active in its actions when measurement does not equal set point.


P-Only Controller Design
All controllers from the family of PID algorithms (P-Only, PI, PID) should be designed and tuned using our proven recipe:
  1. Establish the design level of operation (the normal or expected values for set point and major disturbances).
  2. Bump the process and collect controller output (CO) to process variable (PV) dynamic process data around this design level.
  3. Approximate the process data behavior with a first order plus dead time (FOPDT) dynamic model.
  4. Use the model parameters from step 3 in rules and correlations to complete the controller design and tuning.
The Internal Model Control (IMC) tuning correlations that work so well for PI and PID controllers cannot be derived for the simple P-Only controller form. The next best choice is to use the widely-published integral of time-weighted absolute error (ITAE) tuning correlation:

Moderate P-Only:  

This correlation is useful in that it reliably yields a moderate Kc value. In fact, some practitioners find that the ITAE Kc value provides a response performance so predictably modest that they automatically start with an aggressive P-Only tuning, defined here as two and a half times the ITAE value:


Aggressive P-Only: Kc = 2.5 (Moderate Kc)

Reverse Acting, Direct Acting and Control Action
Time constant, Tp, and dead time, Өp, cannot affect the sign of Kc because they mark the passage of time and must always be positive. The above tuning correlation thus implies that Kc must always have the same sign as the process gain, Kp.

When CO increases on a process that has a positive Kp, the PV will increase in response. The process is direct acting. Given this CO to PV relationship, when in automatic mode (closed loop), if the PV starts drifting too high above set point, the controller must decrease CO to correct the error.

This "opposite to the problem" reaction is called negative feedback and forms the basis of stable control.

A process with a positive Kp is direct acting. With negative feedback, the controller must be reverse acting for stable control. Conversely, when Kp is negative (a reverse acting process), the controller must be direct acting for stable control.

Since Kp and Kc always have the same sign for a particular process and stable control requires negative feedback, then:
  • direct acting process (Kp and Kc positive) −› use a reverse acting controller
  • reverse acting process (Kp and Kc negative) −› use a direct acting controller
In most commercial controllers, a positive value of the Kc is always entered. The sign (or action) of the controller is then assigned by specifying that the controller is either reverse or direct acting to indicate a positive or negative Kc respectively.

If the wrong control action is entered, the controller will quickly drive the final control element (e.g., valve, pump, compressor) to full on/open or full off/closed and remain there until the proper control action entry is made.

Proportional Band
Some manufacturers use different forms for the same tuning parameter. The popular alternative to Kc found in the marketplace is proportional band, PB.

In many industry applications, both the CO and PV are expressed in units of percent. Given that a controller output signal ranges from a minimum (COmin) to maximum (COmax) value, then:

PB = (COmax - COmin)/Kc

When CO and PV have units of percent and both range from 0% to 100%, the much published conversion between controller gain and proportional band results:

PB = 100/Kc

Many case studies on this site assign engineering units to the measured PV because plant software has made the task of unit conversions straightforward. If this is true in your plant, take care when using these conversion formula.

Implementation Issues
Implementation of a P-Only controller is reasonably straightforward, but this simple algorithm exhibits a phenomenon called "offset." In most industrial applications, offset is considered an unacceptable weakness. We explore P-Only control, offset and other issues for the heat exchanger and the gravity drained tanks processes.

Read more


Controller process architecture

A controller seeks to maintain the measured process variable (PV) at set point (SP) in spite of unplanned and unmeasured disturbances. Since e(t) = SP - PV, this is equivalent to saying that a controller seeks to maintain controller error, e(t), equal to zero.


A controller repeats a measurement-computation-action procedure at every loop sample time, T. Starting at the far right of the control loop block diagram above:
  • A sensor measures a temperature, pressure, concentration or other property of interest from our process.
  • The sensor signal is transmitted to the controller. The pathway from sensor to controller might include: a transducer, an amplifier, a scaling element, quantization, a signal filter, a multiplexer, and other operations that can add delay and change the size, sign, and/or units of the measurement.
  • After all electronic and digital operations, the result terminates at our controller as the "wire in" measured process variable (PV) signal.
  • This "wire in" process variable is subtracted from set point in the controller to compute error, e(t) = SP - PV, which is then used in an algorithm (examples here and here) to compute a controller output (CO) signal.
  • The computed CO signal is transmitted on the "wire out" from the controller on a path to the final control element (FCE).
  • Similar to the measurement path, the signal from the controller to FCE might include filtering, scaling, linearization, amplification, multiplexing, transducing and other operations that can add delay and change the size, sign, and/or units of our original CO signal.
  • After any electronic and digital operations, the signal reaches the valve, pump, compressor or other FCE, causing a change in the manipulated variable (a liquid or gas stream flow rate, for example).
  • The change in the manipulated variable causes a change in our temperature, pressure, concentration or other process property of interest, all with the goal of making e(t) = 0.
Design Based on CO to PV Dynamics
The steps of the controller design and tuning recipe include: bumping the CO signal to generate CO to PV dynamic process data, approximating this test data with a first order plus dead time (FOPDT) model, and then using the model parameters in rules and correlations to complete the controller design and tuning.

The recipe provides a proven basis for controller design and tuning that avoids wasteful and expensive trial-and-error experiments. But for success, controller design and tuning must be based on process data as the controller sees it.

The controller only knows about the state of the process from the PV signal arriving on the "wire in" after all operations in the signal path from the sensor. It can only impact the state of the process with the CO signal it sends on the "wire out" before any such operations are made in the path to the final control element.

As indicated in the diagram at the top of this article, the proper signals that describe our complete "process" from the controller's view is the "wire out" CO and the "wire in" PV.

Complete the Circuit
Sometimes we find ourselves unable to proceed with an orderly controller design and tuning. Perhaps our controller interface does not make it convenient to directly record process data. Maybe we find a vendor's documentation to be so poorly written as to be all but worthless. There are a host of complications that can hinder progress.

Being resourceful, we may be tempted to move the project forward by using portable instrumentation. It seems reasonable to collect, say, temperature in a vessel during a bump test by inserting a spare thermocouple into the liquid. Or maybe we feel we can be more precise by standing right at the valve and using a portable signal generator to bump the process rather than doing so from a remote control panel.

As shown below, such an approach cuts out or short circuits the complete control loop pathway. External or portable instrumentation will not be recording the actual CO or PV as the controller sees it, and the data will not be appropriate for controller design or tuning.


Every Item Counts
The illustration above is extreme in that it shows many items that are not included in the control loop. But please recognize that it can be problematic to leave out even a single step in the complete signal pathway.

A simple scaling element that multiplies the signal by a constant value, for example, may seem reasonably unimportant to the overall loop dynamics. But this alone can change the size and even the sign of Kp, thus having dramatic impact on best tuning and final controller performance.

From a controller's view, the complete loop goes from "wire out" to "wire in" as shown below.


Every item in the loop counts. Always use the complete CO to PV data for process control analysis, design and tuning.

Pay Attention to Units
As detailed in this related article, signals can appear in a control loop in electronic units (e.g., volts, mA), in engineering units (e.g. oC, Lb/hr), as percent of scale (e.g., 0% to 100%), or as discrete or digital counts (e.g. 0 to 4095 counts).

It is critical that we remain aware of the units of a signal when working with a particular instrument or device. All values entered and computations performed must be consistent with the form of the data at that point in the loop.

Beyond the theory and methods discussed in this e-book, such "accounting confusion" can be one of the biggest challenges for the process control practitioner.

Read more


Drives


























































Read more

Followers

Powered by Blogger.

About This Blog

categories

Web hosting for webmasters