Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 15 of 38

DL06 Micro PLC User Manual, Volume 2 of 2, pages 140 to 149

Pages 140 to 149 of 370

The original document is the PDF (6.0 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the AutomationDirect Direct Logic DL06

Page 140

Chapter 8: PID Loop Operation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–64

Test the Profile Test your profile using PID View.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 141

Chapter 8: PID Loop Operation

Cascade Control

1 Introduction 2 Cascaded loops are an advanced control technique that is superior to individual loop control in certain situations. As the name implies, cascade means that one loop is connected to another loop. In addition to Manual (open loop) and Auto (closed loop) Modes, the DL06 3 also provides Cascaded Mode. NOTE: Cascaded loops are an advanced process control technique. Therefore we recommend their use only 4 for experienced process control engineers. 5 When a manufacturing process is complex and contains a lag time from control input to process variable output, even the most perfectly tuned single loop around the process may yield slow and inaccurate control. It may be the actuator operates on one physical property, 6 which eventually affects the process variable, measured by a different physical property. Identifying the intermediate variable allows us to divide the process into two parts as shown 7 in the following figure. 8 9 The principle of cascaded loops is simply that we add another process loop to more precisely control the intermediate variable! This separates the source of the control lag into two parts, as well. 10 The diagram below shows a cascade control system, showing that it is simply one loop nested inside another. The inside loop is called the minor loop, and the outside loop is called the 11 major loop. For overall stability, the minor loop must be the fastest responding loop of the two (try a factor of 10 for a better response time). We do have to add the additional sensor to measure the intermediate variable (PV for process A). Notice the setpoint for the minor loop 12 is automatically generated for us, by using the output of the major loop. Once the cascaded control is programmed and debugged, we only need to deal with the original setpoint and 13 process variable at the system level. The cascaded loops behave as one loop, but with improved performance over the previous single-loop solution. 14 A

B C One of the benefits to cascade control can be seen by examining its response to external disturbances. Remember the minor loop is faster acting than the major loop. Therefore, if a D disturbance affects process A in the minor loop, the Loop A PID calculation can correct the PROCESS

Control input

Loop B Calculation

Setpoint

+

–

Intermediate Variable

Process A

Output B/ Setpoint A +

Loop A Calculation

Process B

Output A

Process Variable (PV)

External Disturbances

External Disturbances

Process A (secondary)

Process B (primary)

–

Major Loop

Minor Loop

PV, Process A

PV, Process B resulting error before the major loop sees the effect.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

8–65

Page 142

Chapter 8: PID Loop Operation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–66

Cascaded Loops in the DL06 CPU In the use of the term “cascaded loops”, we must make an important distinction. Only the minor loop will actually be in the Cascade Mode. In normal operation, the major loop must be in Auto Mode. If you have more than two loops cascaded together, the outer-most (major) loop must be in Auto Mode during normal operation, and all inner loops in Cascade Mode. NOTE: Technically, both major and minor loops are “cascaded” in strict process control terminology. Unfortunately, we are unable to retain this convention when controlling loop modes. Remember that all minor loops will be in Cascade Mode, and only the outer-most (major) loop will be in Auto Mode.

You can cascade together as many loops as necessary on the DL06, and you may have multiple groups of cascaded loops. For proper operation on cascaded loops you must use the same data range (12/15 bit) and unipolar/bipolar settings on the major and minor loop. To prepare a loop for Cascade Mode operation as a minor loop, you must program its remote Setpoint Pointer in its loop parameter table location V+32, as shown below. The pointer must be the address of the V+05 location (control output) of the major loop. In Cascade Mode, the minor loop will ignore the its local SP register (V+02), and read the major loop’s control output as its SP instead. Minor Loop (Cascade Mode)

Major Loop (Auto mode) Loop Table

Loop Table

V+02

XXXX

SP

V+02

XXXX

SP

V+03

XXXX

PV

V+03

XXXX

PV

V+05

XXXX

Control Output

V+05

XXXX

Control Output

V+32

XXXX

Remote SP Pointer

When using DirectSOFT 5’s PID View to watch the SP value of the minor loop, DirectSOFT 5 automatically reads the major loop’s control output and displays it for the minor loop’s SP. The minor loop’s normal SP location, V+02, remains unchanged. Now, we use the loop parameter arrangement above and draw its equivalent loop schematic, shown below. Major loop Loop Calculation

Minor Cascaded loop Cascade

Control Output V+05 Remote SP

Setpoint +

Local SP V+02

Loop Calculation

Control Output

–

Auto/Manual

Process Variable

Remember that a major loop goes to Manual Mode automatically if its minor loop is taken out of Cascade Mode.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 143

Chapter 8: PID Loop Operation

Tuning Cascaded Loops

1 1. If you are not using auto tuning, then find the loop sample rate for the minor loop, using the 2 method discussed earlier in this chapter. Then set the sample rate of the major loop slower than the minor loop by a factor of 10. Use this as a starting point. 3 2. Tune the minor loop first. Leave the major loop in Manual Mode, and you will need to generate SP changes for the minor loop manually as described in the loop tuning procedure. 3. Verify the minor loop gives a critically-damped response to a 10% SP change while in Auto Mode. 4 Then we are finished tuning the minor loop. 4. In this step, you will need to get the minor loop in Cascade Mode, and then the Major loop in 5 Auto Mode. We will be tuning the major loop with the minor loop treated as a series component its overall process. Therefore, do not go back and tune the minor loop again while tuning the major loop. 6 5. Tune the major loop, following the standard loop tuning procedure in this section. The response of the major loop PV is actually the overall response of the cascaded loops together. 7 8 9 10 11 12 13 14 A B C D

In tuning cascaded loops, you will need to de-couple the cascade relationship and tune the loops individually, using one of the loop tuning procedures previously covered.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

8–67

Page 144

Chapter 8: PID Loop Operation

Control 1 Time-Proportioning The PID loop controller in the DL06 CPU generates a smooth control output signal across a numerical range. The control output value is suitable to drive an analog output module, 2 which connects to the process. In the process control field, this is called continuous control, because the output is on (at some level) continuously. 3 While continuous control can be smooth and robust, the cost of the loop components (such as actuator, heater amplifiers) can be expensive. A simpler form of control is called timeproportioning control. This method uses actuator which are either on or off (no in-between). 4 Loop components for on/off-based control systems are lower cost than their continuous control counterparts. 5 In this section, we will show you how to convert the control output of a loop to timeproportioning control for the applications that need it. Let’s take a moment to review how 6 7 8 9 10 alternately turning a load on and off can control a process. The diagram below shows a hot-air 11 balloon following a path across some mountains. The desired path is the setpoint. The balloon pilot turns the burner on and off alternately, which is his control output. The large mass of air 12 in the balloon effectively averages the effect of the burner, converting the bursts of heat into a continuous effect: slowly changing balloon temperature and ultimately the altitude, which is the process variable. 13 Time-proportioning control approximates continuous control by virtue of its duty-cycle – the ratio of ON time to OFF time. The following figure shows an example of how duty-cycle 14 approximates a continuous level when it is averaged by a large process mass. A B C If we were to plot the on/off times of the burner in the hot-air balloon, we would probably see a very similar relationship to its effect on balloon temperature and altitude. D period

Desired Effect

On/Off Control

8–68

On Off

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 145

Chapter 8: PID Loop Operation

On/Off Control Program Example

1 2 Time SP V2005 Y0 Loop P Process

Proportioning Calculation V 3 continuous on/off PV 4 The example program uses two timers to generate On/Off control. It makes the following assumptions, which you can alter to fit your application: 5 • The loop table starts at V2000, so the control output is at V2005. • The data format of the control output is 12-bit, unipolar (0 – FFF). 6 • The time base (one full cycle) for the On/Off waveform is 10 seconds. We use a fast timer (0.01 sec/tick), counting to 1000 ticks (10 seconds). 7 • The On/Off control output is Y0. The time proportioning program must match the resolution of the output (1 part in 1000) to 8 the resolution of the time base of T0 (also 1 part in 1000). NOTE: Some processes change too fast for time proportioning control. Consider the speed of your process 9 when you choose this control method. Use continuous control for processes that change too fast for time proportioning control. Also, consider using a solid state switch for a longer switch life instead of a relay. 10 11 12 13 14 A B C D The following ladder segment provides a time proportioned on/off control output. It converts the continuous output in V2005 to on/off control using the output coil, Y0.

+

–

T0

TMRF T0 K1000

T0

LD V2005

At the end of the 10 second period, T0 turns on, and loads the control output value (binary) from the loop table V+05 location (V2005).

BTOR

The BTOR instruction changes the number in the accumulator to a real number.

DIVR R4.095

Dividing the control output by 4.095, converts the 0 – 4095 range to 0 – 1000, which “matchs” the number of ticks in the 10 second timer range.

RTOB

This instruction converts the real number back to binary. This step prepares the number for conversion to BCD. There is no real-to-BCD instruction.

BCD

Convert the number in the accumulator to BCD format. This satisfies the timer preset format requirement.

OUT V1400

T0

T1

TMRF T1 V1400

TA1

K0

A fast timer (0.01 sec. timebase) establishes the primary time interval. The constant, K1000, sets the preset at 10 seconds (1,000 ticks). The N.C. enabling contact, T0, makes the timer self-resetting. T0 is on for one scan each 10 seconds, when it resets itself and T1.

Output the result to V1400. In our example, this is the location of the timer preset for the second timer.

The second fast timer also counts in increments of .01 seconds, so its range is variable from 0 to a maximum of 1000 ticks, or 10 seconds. This timer’s output, T1, turns off the output coil, Y0, when the preset is reached.

Y0 OUT

The N.C. T1 contact, inverts the T1 timer output. The control output is on at the beginning of the 10-second time interval. Y0 turns off when T1 times out. The STRNE contact prevents Y0 from energizing during the one scan when T0 resets T1. Y0 is the actual control output.

END

END coil marks the end of the main program.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

8–69

Page 146

Chapter 8: PID Loop Operation

Control 1 Feedforward Feedforward control is an enhancement to standard closed-loop control. It is most useful for diminishing the effects of a quantifiable and predictable loop disturbance or sudden change in 2 setpoint. Use of this feature is an option available to you on the DL06. However, it’s best to implement and tune a loop without feedforward, and adding it only if better loop performance is still needed. The term “feed-forward” refers to the control technique involved, 3 shown in the diagram below. The incoming setpoint value is fed forward around the PID equation, and summed with the output. 4 Feedforward path kf 5 Setpoint Control Output Loop 6

Calculation Process Variable 7 In the previous section on the bias term, we said that “the bias term value establishes a “working region” or operating point for the control output. When the error fluctuates around 8 its zero point, the output fluctuates around the bias value.” Now, when there is a change in setpoint, an error is generated and the output must change to a new operating point. This 9 also happens if a disturbance introduces a new offset in the loop. The loop does not really “know its way” to the new operating point... the integrator (bias) must increment/decrement until the error disappears, and then the bias has found the new operating point. 10 Suppose that we are able to know a sudden setpoint change is about to occur (common in some applications). We can avoid much of the resulting error in the first place, if we can 11 quickly change the output to the new operating point. If we know (from previous testing) what the operating point (bias value) will be after the setpoint change, we can artificially 12 change the output directly (which is feedforward). The benefits from using feedforward are: • The SP–PV error is reduced during predictable setpoint changes or loop 13 offset disturbances. • Proper use of feedforward will allow us to reduce the integrator gain. Reducing integrator gain gives 14 us an even more stable control system. Feedforward is very easy to use in the DL06 loop controller, as shown below. The bias term has been made available to the user in a special read/write location, at PID Parameter Table A location V+04. B C

D +

+

+

–

Parameter Table location V+04.

Loop Calculation

Setpoint

Error T erm

+ kp

P ki

I

XXXX

8–70

+ +

Control Output

+

–

Process Variable

V+04 Bias T erm kd

D

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 147

Chapter 8: PID Loop Operation To change the bias (operating point), ladder logic only has to write the desired value to V+04. The PID loop calculation first reads the bias value from V+04 and modifies the value based on the current integrator calculation. Then it writes the result back to location V+04. This arrangement creates a sort of “transparent” bias term. All you have to do to implement feed forward control is write the correct value to the bias term at the right time (see the following example).

1 2 3 NOTE: When writing the bias term, one must be careful to design ladder logic to write the value only once, at the moment when the new bias operating point is to occur. If ladder logic writes the bias value on every scan, the loop’s integrator is effectively disabled. 4 Feedforward Example 5 How do we know when to write to the bias term, and what value to write? Suppose we have an oven temperature control loop, and we have already tuned the loop for optimal 6 performance. Refer to the figure below. We notice that when the operator opens the oven door, the temperature sags a bit while the loop bias adjusts to the heat loss. Then when the door closes, the temperature rises above the SP until the loop adjusts again. Feedforward 7 8 9 10 11 control can help diminish this effect. First, we record the amount of bias change the loop controller generates when the door opens 12 or closes. Then, we write a ladder program to monitor the position of an oven door limit switch. When the door opens, our ladder program reads the current bias value from V+04, 13 adds the desired change amount, and writes it back to V+04. When the door closes, we duplicate the procedure, but subtracting desired change amount instead. The following figure 14 A B C shows the results. D The step changes in the bias are the result of our two feed-forward writes to the bias term. We Oven Closed door

Open

PV

PV sags

Closed

PV excess

Bias

Oven Closed door

Open

Closed

PV

Feed-forward

Feed-forward

Bias can see the PV variations are greatly reduced. The same technique may be applied for changes in setpoint. DL06 Micro PLC User Manual, 3rd Edition Rev. A

8–71

Page 148

Chapter 8: PID Loop Operation

1 PID Example Program Program Setup for the PID Loop 2 After the PID loop, or loops, have been setup with DirectSOFT 5, you will need to edit your RLL program to include the rungs needed to setup the analog I/O module to be used by the PID loop(s). 3 The following example program shows how an RTD module, F0-04RTD, and an analog combination module, F0-2AD2DA-2, are used and setup for a PID loop. This example 4 assumes that the PID table for loop 1 has a beginning address of V2100. All of the analog I/O modules used with the DL06 are setup in a similar manner. Refer to the 5 DL05/DL06 Options Manual for the setup information for the particular module that you will be using. 6 7 8 9 10 11 12 13 14 A B C D DirectSOFT 5

Note: The inputs will be read in binary format 0-4095 only if the temperature does not go above 409.5 degrees. Full range is 65535, which equates to 6,553.5 degrees, since the RTD card reads directly in tenths of a degree. The input resolution of the PID loop needs to be set based on the max. temperature of the application since the RTD card is always 16 bit resolution.

Set to read degrees F and select up scale burnout.

Program continued on next page

8–72

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 149

Chapter 8: PID Loop Operation Example program continued

Note: The value stored in V1400 must be in the same scale as the PV value, or tenths of a degree in this example.

Manual Mode Request B2100.0

Auto Mode Request B2100.1

DL06 Micro PLC User Manual, 3rd Edition Rev. A

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–73