The text of a manual · part 8 of 38
DL06 Micro PLC User Manual, Volume 2 of 2, pages 70 to 79
Pages 70 to 79 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.
Page 70
Chapter 7: RLLPLUS Stage Programming
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Initial Stage (ISG) The Initial Stage instruction is normally used as the first segment of an RLLPLUS program. Multiple Initial Stages are allowed in a program. They will be active when the CPU enters the Run mode allowing for a starting point in the program. Initial Stages are also activated by transitional logic, a jump or a set stage executed from an active stage. Operand Data Type
ISG S aaa
DL06 Range aaa
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–1777
NOTE: If the ISG is within the retentive range for stages, the ISG will remain in the state it was in before power down and will NOT turn itself on during the first scan.
Jump (JMP) The Jump instruction allows the program to transition from an active stage containing the jump instruction to another stage (specified in the instruction). The jump occurs when the input logic is true. The active stage containing the Jump will deactivate 1 scan later. Operand Data Type
S aaa JMP
DL06 Range aaa
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–1777
Not Jump (NJMP)
7–22
The Not Jump instruction allows the program to transition from an active stage which contains the jump instruction to another which is specified in the instruction. The jump will occur when the input logic is off. The active stage that contains the Not Jump will be deactivated 1 scan after the Not Jump instruction is executed. Operand Data Type
S aaa NJMP
DL06 Range aaa
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–1777
In the following example, only stage ISG0 will be active when program execution. begins. When X1 is on, program execution will jump from Initial Stage 0 to Stage 1.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 71
Chapter 7: RLLPLUS Stage Programming
DirectSOFT Direct SOFT32
ISG
Handheld Programmer Keystrokes S0
U
A ISG
0 B
$ X1
SG
1
S1
STR
JMP
K JMP
B
2
B
S1
1
SG
1 C
$ X2
X7
STR
OUT
GX OUT
F
S2
$
H
JMP
X7
2
Y5
S3 NJMP
5 7
STR C
K JMP SHFT
2 N TMR
SHFT
ENT ENT ENT ENT ENT ENT ENT ENT K JMP
D 3
ENT
Converge Stage (CV) and Converge Jump (CVJMP) The Converge Stage instruction is used to group certain stages together by defining them as Converge Stages. When all of the Converge Stages within a group become active, CV the CVJMP instruction (and any additional logic in the final CV S aaa stage) will be executed. All preceding CV stages must be active before the final CV stage logic can be executed. All Converge Stages are deactivated one scan after the CVJMP instruction is executed. Additional logic instructions are only allowed following the last Converge Stage instruction and before the CVJMP instruction. Multiple CVJMP instructions are allowed. S aaa Converge Stages must be programmed in the main body of CVJMP the application program. This means they cannot be programmed in Subroutines or Interrupt Routines.
Operand Data Type
DL06 Range aaa
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–1777
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
7–23
Page 72
Chapter 7: RLLPLUS Stage Programming
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 7–24
In the following example, when Converge Stages S10 and S11 are both active the CVJMP instruction will be executed when X4 is on. The CVJMP will deactivate S10 and S11, and activate S20. Then, if X5 is on, the program execution will jump back to the initial stage, S0. DirectSOFT Direct SOFT32
Handheld Programmer Keystrokes U
A ISG
0 A
$
0
STR
ISG
S0
X0
Y0 OUT
X1
S1 JMP S10 JMP
SG
S1
X2
A
$
B STR
1
K JMP
B
K JMP
B
2
B
1
S10
C
$
2
STR B
K JMP SHFT
C
SHFT
C
X4
ENT
1
V AND
B
2
GX OUT
D
$
E
3 4 C 2
S0 JMP
DL06 Micro PLC User Manual, 3rd Edition Rev. A
ENT
A
ENT
A 0
ENT
ENT
C
5
1
ENT
ENT
K JMP
2
0 B
1
SHFT
F
S20
A 1
V AND
STR K JMP
ENT B
3
$
ENT
ENT
B
D
S20
X5
0
V AND
STR
CVJMP SG
ENT
2
$
2
Y3 OUT
ENT
1
SG
X3
ENT
A
1
STR
S11
ENT
1
SG
SHFT
CV
0
S11 JMP
CV
GX OUT
ENT
0 ENT ENT
C
A 2
0
ENT
Page 73
Chapter 7: RLLPLUS Stage Programming
Block Call (BCALL) The stage block instructions are used to activate a block of stages. The Block Call, Block, and Block End instructions must be used together. The BCALL instruction is used to activate a stage block. There are several things you need to know about the BCALL instruction. • Uses CR Numbers, The BCALL appears as an output C aaa coil, but does not actually refer to a Stage number as you BCALL might think. Instead, the block is identified with a Control Relay (Caaa). This control relay cannot be used as an output anywhere else in the program. • Must Remain Active, The BCALL instruction actually controls all the stages between the BLK and the BEND instructions even after the stages inside the block have started executing. The BCALL must remain active or all the stages in the block will automatically be turned off. If either the BCALL instruction, or the stage that contains the BCALL instruction goes off, then the stages in the defined block will be turned off automatically. • Activates First Block Stage, When the BCALL is executed it automatically activates the first stage following the BLK instructions. Operand Data Type
DL06 Range aaa
Control Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–1777
Block (BLK) The Block instruction is a label which marks the beginning of a block of stages that can be activated as a group. A Stage instruction must immediately follow the Start Block instruction. Initial Stage instructions are not allowed in a block. The control relay (Caaa) specified in Block instruction must not be used as an output any where else in the program. Operand Data Type
BLK C aaa
DL06 Range aaa
Control Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . S
0–1777
Block End (BEND) The Block End instruction is a label used with the Block instruction. It marks the end of a block of stages. There is no operand with this instruction. Only one Block End is allowed per Block Call.
BEND
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
7–25
Page 74
Chapter 7: RLLPLUS Stage Programming
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 7–26
Direct SOFT32 DirectSOFT
In this example, the Block Call is executed when stage 1 is active and X6 is on. The Block Call then automatically activates stage S10, which immediately follows the Block instruction. This allows the stages between S10 and the Block End instruction to operate as programmed. If the BCALL instruction is turned off, or if the stage containing the BCALL instruction is turned off, then all stages between the BLK and BEND instructions are automatically turned off. If you examine S15, you will notice that X7 could reset Stage S1, which would disable the BCALL, thus resetting all stages within the block.
SG S1 Y5
X2
OUT C0
X6
BCALL BLK C0 SG S10 Y6
X3
OUT BEND
Handheld Programmer Keystrokes SG
S(SG)
1
ENT
STR
X(IN)
2
ENT
OUT
Y(OUT)
5
ENT
STR
X(IN)
6
ENT
C
A
L
SHFT
B
SHFT
B
SG S15 RST
L
L
K
SG
S(SG)
1
0
STR
X(IN)
3
ENT
OUT
Y(OUT)
6
ENT
E
N
D
ENT
SG
S(SG)
1
5
ENT
STR
X(IN)
7
ENT
RST
S(SG)
1
ENT
SHFT
B
S1
X7
C(CR)
C(CR)
0
0
ENT
ENT
ENT
Stage View in DirectSOFT 5 The Stage View option in DirectSOFT 5 will let you view the ladder program as a flow chart. The figure below shows the symbol convention used in the diagrams. You may find the stage view useful as a tool to verify that your stage program has faithfully reproduced the logic of the state transition diagram you intend to realize. SG
Stage
Transition Logic
Reference to a Stage
J
Jump
Output
S
Set Stage
R
Reset Stage
The following diagram is a typical stage view of a ladder program containing stages. Note the left-to-right direction of the flow chart. ISG S0
J
SG S1
J
SG S2
S
SG S4
J
SG S3
J
SG S5
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 75
Chapter 7: RLLPLUS Stage Programming
Questions and Answers about Stage Programming
1 2 Q. What does stage programming do that I can’t do with regular RLL programs? A. Stages allow you to identify all the states of your process before you begin programming. 3 This approach is more organized, because you divide up a ladder program into sections. As stages, these program sections are active only when they are actually needed by the process. 4 Most processes can be organized into a sequence of stages, connected by event-based transitions. 5 Q. What are Stage Bits? A. A stage bit is just a single bit in the CPU’s image register, representing the active/inactive status of the stage in real time. For example, the bit for Stage 0 is referenced as “S0”. If S0 6 = 0, then the ladder rungs in Stage 0 are bypassed (not executed) on each CPU scan. If S0 = 1, then the ladder rungs in Stage 0 are executed on each CPU scan. Stage bits, when used 7 as contacts, allow one part of your program to monitor another part by detecting stage active/inactive status. 8 Q. How does a stage become active? A. There are three ways: 9 • If the Stage is an initial stage (ISG), it is automatically active at powerup. • Another stage can execute a Stage JMP instruction naming this stage, which makes it active upon its 10 next occurrence in the program. • A program rung can execute a Set Stage Bit instruction (such as Set S0). 11 Q. How does a stage become inactive? A. There are three ways: 12 • Standard Stages (SG) are automatically inactive at powerup. • A stage can execute a Stage JMP instruction, resetting its Stage Bit to 0. 13 • Any rung in the program can execute a Reset Stage Bit instruction (such as Reset S0). Q. What about the power flow technique of stage transitions? 14 A. The power flow method of connecting adjacent stages (directly above or below in the program) actually is the same as the Stage Jump instruction executed in the stage above, A naming the stage below. Power flow transitions are more difficult to edit in DirectSOFT 5, we list them separately from two preceding questions. B Q. Can I have a stage which is active for only one scan? A. Yes, but this is not the intended use for a stage. Instead, just make a ladder rung active for 1 scan by including a stage Jump instruction at the bottom of the rung. Then the ladder C will execute on the last scan before its stage jumps to a new one. D We include the following commonly-asked questions about Stage Programming as an aid to new students. All question topics are covered in more detail in this chapter.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
7–27
Page 76
Chapter 7: RLLPLUS Stage Programming
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Q. Isn’t a Stage JMP just like a regular GOTO instruction used in software? A. No, it is very different. A GOTO instruction sends the program execution immediately to the code location named by the GOTO. A Stage JMP simply resets the Stage Bit of the current stage, while setting the Stage Bit of the stage named in the JMP instruction. Stage bits are 0 or 1, determining the inactive/active status of the corresponding stages. A stage JMP has the following results: • When the JMP is executed, the remainder of the current stage’s rungs are executed, even if they reside past(under) the JMP instruction. On the following scan, that stage is not executed, because it is inactive. • The Stage named in the Stage JMP instruction will be executed upon its next occurrence. If located past (under) the current stage, it will be executed on the same scan. If located before (above) the current stage, it will be executed on the following scan.
Q. How can I know when to use stage JMP, versus a Set Stage Bit or Reset Stage Bit? A. These instructions are used according to the state diagram topology you have derived: • Use a Stage JMP instruction for a state transition... moving from one state to another. • Use a Set Stage Bit instruction when the current state is spawning a new parallel state or stage sequence, or when a supervisory state is starting a state sequence under its command. • Use a Reset Bit instruction when the current state is the last state in a sequence and its task is complete, or when a supervisory state is ending a state sequence under its command.
Q. What is an initial stage, and when do I use it? A. An initial stage (ISG) is automatically active at powerup. Afterwards, it works just like any other stage. You can have multiple initial stages, if required. Use an initial stage for ladder that must always be active, or as a starting point.
Q. Can I place program ladder rungs outside of the stages, so they are always on? A. It is possible, but it’s not good software design practice. Place ladder that must always be active in an initial stage, and do not reset that stage or use a Stage JMP instruction inside it. It can start other stage sequences at the proper time by setting the appropriate Stage Bit(s).
Q. Can I have more than one active stage at a time?
7–28
A. Yes, and this is a normal occurrence for many programs. However, it is important to organize your application into separate processes, each made up of stages. And a good process design will be mostly sequential, with only one stage on at a time. However, all the processes in the program may be active simultaneously.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 77
PT ER C H APTER
PID LOOP OPERATION
8
In This Chapter:.. DL06 PID Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–2 Introduction to PID Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–4 Introducing DL06 PID Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–6 PID Loop Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–9 Ten Steps to Successful Process Control . . . . . . . . . . . . . . . . . . . . . . .8–16 PID Loop Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–18 PID Loop Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–40 Using the Special PID Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–53 Ramp/Soak Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–58 DirectSOFT 5 Ramp/Soak Example . . . . . . . . . . . . . . . . . . . . . . . . . . .8–63 Cascade Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–65 Time-Proportioning Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–68 Feedforward Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–70 PID Example Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–72 Troubleshooting Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–75 Glossary of PID Loop Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . .8–77 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–79
Page 78
Chapter 8: PID Loop Operation
1 DL06 PID Control DL06 PID Control Features 2 Along with control functions discussed in this manual, the DL06 PLC features PID process control capability. The DL06 PID process control loops offer the same features offered in much larger PLCs. The primary features are: 3 • Up to 8 PID loops, individual programmable sample rates • Manual, Automatic and Cascade loop operation modes 4 • Two types of bumpless transfer available • Full-featured alarms 5 • Ramp/soak generator with up to 16 segments • Auto Tuning 6 The DL06 CPU has process control loop capability in addition to ladder program execution. You can select and configure up to eight loops. All sensor and actuator wiring connects 7 directly to DL06 analog modules. All process variables, gain values, alarm levels, etc., associated with each loop reside in a Loop Variable Table in the CPU. The DL06 CPU reads 8 process variable (PV) inputs during each scan. Then it makes PID loop calculations during a dedicated time slice on each PLC scan, updating the control output value. The control loops use a Proportional-Integral-Derivative (PID) algorithm to generate the control output. This 9 chapter describes how the loops operate, and how to configure and tune the loops. 10 11 12 13 14 A B DirectSOFT 5 programming software, release 5, or later, is used for configuring analog control loops in the DL06. DirectSOFT 5 uses dialog boxes to help you set up the individual C loops. After completing the setup, you can use DirectSOFT 5’s PID Trend View to tune each loop. The configuration and tuning selections you make are stored in the DL06’s V-memory D (RAM). The loop parameters also may be saved to disk for recall later. Analog Input
DL06 PID Loop Calculations
Manufacturing Process
Analog Output
8–2
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 79
Chapter 8: PID Loop Operation PID Loop Feature Number of loops CPU V-memory needed PID algorithm Control Output polarity Error term curves Loop update rate (time between PID calculation) Minimum loop update rate Loop modes Ramp/Soak Generator PV curves Set Point Limits Process Variable Limits Proportional Gain Integrator (Reset) Derivative (Rate) Rate Limits Bumpless Transfer I Bumpless Transfer II Step Bias Anti-windup (Freeze Bias) Error Deadband
Alarm Feature PV Alarm Hysteresis PV Alarm Points PV Deviation Rate of Change
Specifications Selectable, 8 maximum 32 words (V locations) per loop selected, 64 words if using ramp/soak Position or Velocity form of the PID equation Selectable direct-acting or reverse-acting Selectable as linear, square root of error, and error squared 0.05 to 99.99 seconds, user programmable 0.05 seconds for 1 to 4 loops 0.1 seconds for 5 to 8 loops Automatic, Manual (operator control), or Cascade control Up to 8 ramp/soak steps (16 segments) per loop with indication of ramp/soak step number Select standard linear, or square-root extract (for flow meter input) Specify minimum and maximum setpoint values Specify minimum and maximum Process Variable values Specify gains of 0.01 to 99.99 Specify reset time of 0.1 to 99.99 in units of seconds or minutes Specify the derivative time from 0.01 to 99.99 seconds Specify derivative gain limiting from 1 to 20 Automatically sets the bias equal to the control output and the setpoint equal to the process variable when control switches from manual to automatic. Automatically sets the bias equal to the control output when control switches from manual to automatic. Provides proportional bias adjustment for large setpoint changes For position form of PID, this inhibits integrator action when the control output reaches 0% or 100 % (speeds up loop recovery when output recovers from saturation) Specify a tolerance (plus and minus) for the error term (SP–PV), so that no change in control output value is made
Specifications Specify 1 to 200 (word/binary) does not affect all alarms, such as PV Rate-of-Change Alarm Select PV alarm settings for Low–low, Low, High, and High-high conditions Specify alarms for two ranges of PV deviation from the setpoint value Detect when PV exceeds a rate of change limit you specify
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–3