Mitsubishi QCPU, Q Mode, QnACPU Programming Manual

SAFETY PRECAUTIONS

(You must read these cautions before using the product)
DANGER
!
CAUTION
!
Note that the !CAUTION level may lead to a serious consequence according to the circumstances. Always follow the instructions of both levels because they are important to personal safety.
Please store this manual in order to read whenever it is necessary. Also, always forward this manual to the end users.
Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury.
Indicates that incorrect handling may cause hazardous conditions, resulting in medium or slight personal injury or physical damage.
[Design Precautions]
!
DANGER
Install a safety circuit external to the programmable controller that keeps the entire system safe
even when there are problems with the external power supply or the programmable controller. Otherwise, it may cause an output error or an operating error, resulting in an accident. (1) Configure a circuit such as an emergency stop circuit and a protective circuit on the outside
of the programmable logic controller.
(2) When the programmable controller detects the following problems, it will stop calculation
and turn off all outputs.
• An overcurrent protective device or an overvoltage protective device in a power supply module start running.
• A watchdog timer error or others is detected with self-checking function in the programmable controller CPU.
All outputs may be turned on, when an error occurs in the part of I/O controlling or others
that the programmable controller CPU cannot detect. Build a fail safe circuit exterior to the programmable controller to keep the entire system safe. As for the fail safe circuit, refer to a CPU module User’s Manual.
Configure a circuit that turns on an external power supply when the main power of
programmable controller is turned on. If the external power supply is turned on first, it could result in an output error or an operating error.
A - 1
[Design Precautions]
!
DANGER
When connecting a peripheral device to the CPU module or connecting a personal computer or
others to an intelligent function module, always configure an interlock circuit in the sequence program to ensure that the whole system always operate safely. Also, make sure to read this manual carefully and check all operations for safety first before executing other control (program changes, changes of operation status (and status control)) of the operating sequence. Especially for the control described above on the remote sequence from an external device, an immediate action may not be taken for a programmable controller’s trouble due to a data communication fault. Configure the interlock circuit in the sequence program. Simultaneously a recovery method for system, in which a data communications fault occurs, should be determined between the external device and the programmable controller CPU.
[Startup/Maintenance Precaution]
!
CAUTION
Make sure to read this manual carefully and check all operations for safety first before
connecting a peripheral device to an operating CPU module online (particularly program changes, forced outputs, and changes of operation status). Otherwise, an operating error may cause damage or problems with the modules.
A - 2

REVISIONS

* The manual number is given on the bottom left of the back cover.
Print Date * Manual Number Revision
Dec., 1999 SH (NA) 080040-A First edition
Jun., 2001 SH (NA) 080040-B
Partial addition About Manuals, Chapter 1, Chapter 2, Section 2.1, 3.1, 3.2, 3.3, 3.3.1,
4.2.3, 4.3.2, 4.3.5, Chapter 5, Section 5.1, 5.2, Chapter 6, Chapter 7, Section 8.1, 8.2
Apr., 2002 SH (NA) 080040-C
Correction Chapter 1, Chapter 7, Section 8.1, 8.2, 8.3, 8.4, 8.5
Jan., 2003 SH (NA) 080040-D • Addition of use of Basic model QCPU
• Addition of explanation of incomplete derivative
Overall reexamination
Mar., 2003 SH (NA) 080040-E • Addition of explanation of incomplete derivative to High Performance
model QCPU
Dec., 2003 SH (NA) 080040-F
Jun., 2004 SH (NA) 080040-G
Sep., 2006 SH (NA) 080040-H
Apr.,2007 SH (NA) 080040-I
Mar.,2008 SH (NA) 080040-J
Correction Chapter 1
Addition of Redundant CPU
Partial addition About Manuals, Chapter 1, Chapter 2, Section 2.1, 3.1.1, 3.1.3, 3.2.1,
3.2.3, 4.3.5, 5.1, 5.2, Chapter 6, Chapter 7, Section 8.1.1 to 8.1.4, Section 9.1.1 to 9.1.5, 9.2, Appendix 1
Partial addition
Section 4.2.5, Appendix 2
Addition of Universal model QCPU
Addition module
Q02UCPU, Q03UDCPU, Q04UDHCPU, Q06UDHCPU
Partial correction GENERIC TERMS AND ABBREVIATIONS USED IN THIS MANUAL, Chapter 1, Chapter 2, Section 2.1, 3.1.1, 3.1.3, 3.2.1, 3.2.3, 5.1, Chapter 6, Chapter 7, 8.1.1 to 8.1.5, 9.1.1 to 9.1.5, Appendix 1
Addition of Universal model QCPU
Addition module
Q13UDHCPU, Q26UDHCPU
Partial correction
GENERIC TERMS AND ABBREVIATIONS USED IN THIS MANUAL, Section 2.1, Appendix 1
A - 3
* The manual number is given on the bottom left of the back cover.
Print Date * Manual Number Revision May,2008 SH (NA) 080040-K
Revision due to the addition of Process CPU and Universal model QCPU
Addition module
Q03UDECPU, Q04UDEHCPU, Q06UDEHCPU, Q13UDEHCPU, Q26UDEHCPU
Q02PHCPU, Q06PHCPU
Partial correction
GENERIC TERMS AND ABBREVIATIONS USED IN THIS MANUAL,
Section 2.1, Appendix 1
Japanese Manual Version SH-080022-K
This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
© 1999 MITSUBISHI ELECTRIC CORPORATION
A - 4

INTRODUCTION

Thank you for choosing the Mitsubishi MELSEC-Q/QnA Series of Programmable Logic Controllers. Please read this manual carefully so that the equipment is used to its optimum. A copy of this manual should be forwarded to the end User.

CONTENTS

SAFETY CAUTIONS ......................................................................................................................................A- 1
REVISIONS .....................................................................................................................................................A- 3
CONTENTS.....................................................................................................................................................A- 5
About Manuals ................................................................................................................................................A- 8
Generic Terms and Abbreviations Used in This Manual ..............................................................................A-11
1. GENERAL DESCRIPTION 1 – 1 to 1 - 3
1.1 PID Processing Method ........................................................................................................................... 1 - 3
2. SYSTEM CONFIGURATION FOR PID CONTROL 2 - 1 to 2 - 2
2.1 Applicable PLC CPU ................................................................................................................................ 2 - 2
3. PID CONTROL SPECIFICATIONS 3 - 1 to 3 - 14
3.1 PID Control by Incomplete derivative ...................................................................................................... 3 - 1
3.1.1 Performance specifications............................................................................................................... 3 - 1
3.1.2 PID operation block diagram and operation expressions ................................................................ 3 - 2
3.1.3 PID control instruction list.................................................................................................................. 3 - 3
3.2 PID Control by Complete Derivative........................................................................................................ 3 - 8
3.2.1 Performance specifications............................................................................................................... 3 - 8
3.2.2 PID operation block diagram and operation expressions ................................................................ 3 - 9
3.2.3 PID control instruction list................................................................................................................ 3 - 10
4. FUNCTIONS OF PID CONTROL 4 - 1 to 4 - 14
4.1 Outline of PID Control .............................................................................................................................. 4 - 1
4.2 Functions of PID Control.......................................................................................................................... 4 - 2
4.2.1 Operation method.............................................................................................................................. 4 - 2
4.2.2 Forward operation and reverse operation ........................................................................................ 4 - 2
4.2.3 Proportionate operation (P operation) .............................................................................................. 4 - 4
4.2.4 Integrating operation (I operation) .................................................................................................... 4 - 5
4.2.5 Differentiating operation (D operation) ............................................................................................. 4 - 6
4.2.6 PID operation..................................................................................................................................... 4 - 8
4.3 Other Functions........................................................................................................................................ 4 - 9
4.3.1 Bumpless changeover function ........................................................................................................ 4 - 9
4.3.2 MV higher/lower limit control function ............................................................................................. 4 - 10
4.3.3 Monitorning PID control with the AD57(S1) (QnACPU only)......................................................... 4 - 11
4.3.4 Function for transfer to the SV storage device for the PV in manual mode .................................. 4 - 12
4.3.5 Changing the PID control data or input/output data setting range (QCPU only) ......................... 4 – 13
A - 5
5. PID CONTROL PROCEDURE 5 - 1 to 5 - 24
5.1 PID Control Data ...................................................................................................................................... 5 - 4
5.1.1 Number of loops to be used and the number of loops to be executed in a single scan ............... 5 - 15
5.1.2 Sampling cycle ................................................................................................................................5 - 16
5.2 I/O Data .................................................................................................................................................. 5 - 18
6. PID CONTROL INSTRUCTIONS 6 - 1 to 6 - 2
7. HOW TO READ EXPLANATIONS FOR INSTRUCTIONS 7 - 1 to 7 - 2
8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES 8 - 1 to 8 - 16
8.1 PID Control Instructions ........................................................................................................................... 8 - 1
8.1.1 PID control data settings S.PIDINIT,SP.PIDINIT .......................................... 8 - 2
8.1.2 PID operation S.PIDCONT,SP.PIDCONT................................... 8 - 3
8.1.3 Operation stop/start of designated loop no. S.PIDSTOP,SP.PIDSTOP,S.PIDRUN,SP.PIDRUN
.................................................................................................................................................................... 8 - 5
8.1.4 Parameter change at designated loop S.PIDPRMW,SP.PIDPRMW ................................8 - 6
8.2 PID Control Program Examples .............................................................................................................. 8 - 8
8.2.1 System configuration for program examples.................................................................................... 8 - 8
8.2.2 Program example for automatic mode PID control.......................................................................... 8 - 9
8.2.3 Program example for changing the PID control mode between automatic and manual .............. 8 - 13
9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES 9 - 1 to 9 - 28
9.1 PID Control Instructions ........................................................................................................................... 9 - 1
9.1.1 PID control data settings PIDINIT,PIDINITP................................................. 9 - 2
9.1.2 PID control PIDCONT,PIDCONTP.......................................... 9 - 3
9.1.3 Monitoring PID control status (QnACPU only) PID57,PID57P....................................................... 9 - 5
9.1.4 Operation stop/start of designated loop no. PIDSTOP,PIDSTOPP,PIDRUN,PIDRUNP ......... 9 - 8
9.1.5 Parameter change at designated loop PIDPRMW,PIDPRMWP ....................................... 9 - 9
9.2 PID Control Program Examples (QCPU only) ...................................................................................... 9 - 11
9.2.1 System configuration for program examples.................................................................................. 9 - 11
9.2.2 Program example for automatic mode PID control........................................................................ 9 - 12
9.2.3 Program example for changing the PID control mode between automatic and manual .............. 9 - 15
9.3 PID Control Program Examples (QnACPU only).................................................................................. 9 - 19
9.3.1 System configuration for program examples.................................................................................. 9 - 19
9.3.2 Program example for automatic mode PID control........................................................................ 9 - 20
9.3.3 Program example for changing the PID control mode between automatic and manual ............. 9 – 24
A - 6
APPENDIX APP - 1 to APP - 3
Appendix 1 Processing Time List .............................................................................................................APP - 1
Appendix 2 Anti-Reset Windup Measure .................................................................................................APP - 3
A - 7

About Manuals

Related Manuals
The following manuals are also related to this product. In necessary, order them by quoting the details in the tables below.
Manual Name
Manual Number
(Model Code)
QCPU User's Manual (Function Explanation, Program Fundamentals)
Describes the functions, programming procedures, devices, etc. necessary to create programs.
(Sold separately)
QnACPU Programming Manual (Fundamentals)
Describes how to create programs, the names of devices, parameters, and types of program.
(Sold separately)
QCPU (Q mode) /QnACPU Programming Manual (Common Instructions)
Describes how to use sequence instructions, basic instructions, and application instructions.
(Sold separately)
QnACPU Programming Manual (Special Function)
Describes the dedicated instructions for special function modules available when using the
Q2ACPU(S1), Q3ACPU, and Q4ACPU. (Sold separately)
QnACPU Programming Manual (AD57 Instructions)
Describes the dedicated instructions for controlling an AD57(S1) type CRT controller module available
when using the Q2ACPU(S1), Q3ACPU, or Q4ACPU. (Sold separately)
SH-080484ENG
(13JR73)
IB-66614
(13JF46)
SH-080039
(13JF58)
SH-4013
(13JF56)
IB-66617
(13JF49)
A - 8
g
Before reading this manual, refer to the user's manual of the used CPU module or the QnACPU Programming Manual (Fundamentals), and confirm which programs, I/O processing, and devices can be used with the used CPU module.
(1) When QCPU is used
QCPU (Q mode)/ QnACPU Programming Manual (Common Instructions)
Describes the instructions other than those given on the ri
ht.
This manual
QCPU (Q mode)/ QnACPU Programming Manual (PID Control Instructions)
Describes the instructions used for PID control.
QCPU User's Manual (Function Explanation, Program Fundamentals)
QCPU (Q mode)/ QnACPU Programming Manual (SFC)
Describes SFC.
Describes the functions, executable programs, I/O processing and device names of the QCPU.
QCPU (Q mode) Programming Manual (MELSAP-L)
Describes MELSAP-L.
QCPU (Q mode) Programming Manual (Structured Text)
Describes the structured text.
A - 9
(2) When QnACPU is used
QCPU (Q mode)/ QnACPU Programming Manual (Common Instructions)
Describes the instructions other than those given on the right.
QnACPU Programming Manual (Special Function Modules)
Describes the instructions for the special function modules such as the AJ71QC24 and AJ71PT32-S3.
QnACPU Programming Manual (Fundamentals)
QnACPU Programming Manual (AD57 Commands)
Describes the AD57 commands for controlling the AD57/AD58.
Describes the programs, I/O processing, device names, etc. that can be executed by the QnACPU.
This manual
QCPU (Q mode)/ QnACPU Programming Manual (PID Control Instructions)
Describes the instructions used for PID control.
QCPU (Q mode)/ QnACPU Programming Manual (SFC)
Describes SFC.
Q4ARCPU only
Q4ARCPU Programming Manual (Application PID Instructions)
Describes the instructions used for applied PID control.
A - 10

Generic Terms and Abbreviations Used in This Manual

This manual uses the following generic terms and abbreviations unless otherwise described.
Generic term/abbreviation Description of generic term/abbreviation
CPU module
QnACPU
QnA
Q4AR Abbreviation of Q4ARCPU
QCPU
QnCPU Abbreviation of Q02CPU
QnHCPU Abbreviation of Q02HCPU, Q06HCPU, Q12HCPU, Q25HCPU
QnPHCPU Abbreviation of Q02PHCPU, Q06PHCPU, Q12PHCPU, Q25PHCPU
QnPRHCPU Abbreviation of Q12PRHCPU, Q25PRHCPU
QnUD(H)CPU
Basic model QCPU
Basic
High Performance model QCPU
High Performance
Process CPU Generic term of Q02PHCPU, Q06PHCPU, Q12PHCPU, Q25PHCPU
Redundant CPU Generic term of Q12PRHCPU, Q25PRHCPU
Universal model QCPU
Universal
Generic term of Basic model QCPU, High Performance model QCPU,
Redundant CPU, Universal model QCPU, QnACPU
Abbreviation of Q2ASCPU, Q2ASCPU-S1, Q2ASHCPU, Q2ASHCPU-S1,
Q2ACPU, Q2ACPU-S1, Q3ACPU, Q4ACPU, Q4ARCPU
Abbreviation of Q2ASCPU, Q2ASCPU-S1, Q2ASHCPU, Q2ASHCPU-S1,
Q2ACPU, Q2ACPU-S1, Q3ACPU, Q4ACPU
Abbreviation of Q00CPU, Q01CPU, Q02CPU, Q02HCPU, Q06HCPU,
Q12HCPU, Q25HCPU, Q12PRHCPU, Q25PRHCPU, Q02UCPU,
Q03UDCPU, Q04UDHCPU, Q06UDHCPU, Q13UDHCPU, Q26UDHCPU,
Q03UDECPU, Q04UDEHCPU, Q06UDEHCPU, Q13UDEHCPU,
Q26UDEHCPU
Abbreviation of Q03UDCPU, Q04UDHCPU, Q06UDHCPU,
Q13UDHCPU, Q26UDHCPU, Q03UDECPU, Q04UDEHCPU,
Q06UDEHCPU, Q13UDEHCPU, Q26UDEHCPU
Generic term of Q00JCPU, Q00CPU, Q01CPU
Generic term of Q02CPU, Q02HCPU, Q06HCPU, Q12HCPU, Q25HCPU
Generic term of Q02UCPU, Q03UDCPU, Q04UDHCPU, Q06UDHCPU,
Q13UDHCPU, Q26UDHCPU, Q03UDECPU, Q04UDEHCPU,
Q06UDEHCPU, Q13UDEHCPU, Q26UDEHCPU
A - 11
MEMO
A - 12
A

1. GENERAL DESCRIPTION

MELSEC-Q/Qn
1. GENERAL DESCRIPTION
This manual describes the sequence program instructions used to implement PID control with any of the following CPU modules.
• Basic model QCPU (first five digits of serial No. are 04122 or later)
• High Performance model QCPU
• Redundant CPU
• Universal model QCPU
• QnACPU
The Basic model QCPU, High Performance model QCPU, Redundant CPU, and Universal model QCPU have the instructions used to perform PID control by incomplete derivative (PID control instructions) and the instructions used to perform PID control by complete derivative (PID control instructions) as standard features.
The QnACPU has the instructions used to perform PID control by complete derivative (PID control instructions) as standard features.
Since the incomplete derivative PID control instructions and complete derivative PID control instructions are independent of each other, they can be executed at the same time.
The following table indicates the CPU modules that can use the incomplete derivative PID control instructions and complete derivative PID control instructions.
CPU Module Model Name
First five digits of serial No. are
Basic model QCPU
High Performance model QCPU
Redundant CPU Universal model QCPU QnACPU
"04121" or earlier First five digits of serial No. are "04122" or later First five digits of serial No. are "05031" or earlier First five digits of serial No. are "05032" or later
*1: Version 7 or earlier version of GX Developer issues an “instruction code alarm” if it
loads a new CPU instruction realized with GX Developer Version 8.
Incomplete
Derivative
*1
: Usable, : Unusable
Complete Derivative
1
1 - 1
A
1. GENERAL DESCRIPTION
MELSEC-Q/Qn
There are the following PID control instructions.
Classification Incomplete Derivative Complete Derivative PID control data setting PID operation PID control status monitor Specified loop No. operation stop Specified loop No. operation start Specified loop No. parameter change
S(P).PIDINIT PIDINIT(P)
S(P).PIDCONT PIDCONT(P)
PID57(P)
S(P).PIDSTOP PIDSTOP(P)
S(P).PIDRUN PIDRUN(P)
S(P).PIDPRMW PIDPRMW(P)
PID control via PID control instructions is implemented by combining the CPU module with the A/D converter module and D/A converter module. In the case of the QnACPU, the PID control status can be monitored using the AD57(S1) CRT controller module.
POINT
(1) The Process CPU is not compatible with the PID control instructions described
in this manual. To implement PID control using the Process CPU, use the process control instructions described in the QnPHCPU/QnPRHCPU Programming Manual (Process Control Instructions).
(2) The Redundant CPU can use the PID control instructions and process control
instructions.
1 - 2
A
1. GENERAL DESCRIPTION

1.1 PID Processing Method

This section describes the processing method for PID control using PID control
Set value
SV
PV
instructions. (For details on PID operations, see Chapter 4.)
Execute PID control with PID control instructions by loading an A/D converter module and a D/A converter module, as shown in Figure 1.1.
CPU module
PID control instructions
PID operation
Automatic MV
Manual MV
Manual/automatic changeover
MV
PV
D/A conversion module
A/D conversion module
MELSEC-Q/Qn
Controlled system
Sensor
Sequence program
SV: Set Value PV: Process Value MV: Manipulated Value
Figure 1.1 Overview of PID Control Processing
In the PID control processing method, as shown in Figure 1.1, the PID operation is executed using the set value (SV) and the process value (PV) read from the A/D converter module, and the manipulated value (MV) is then calculated. The calculated MV (manipulated value) is output to the D/A converter module.
When a PID operation instruction* is executed in a sequence program, the sampling cycle is measured and a PID operation is performed. PID operation in accordance with the PID operation instruction is executed in preset sampling cycles.
PID operation instruction execution
Step 0
Measurement of sampling cycle
Sampling cycle
PID operation instruction execution
Step 0 Step 0
END END END END
PID operation instruction execution
Measurement of sampling cycle
PID operation instruction execution
Step 0 Step 0
Measurement of sampling cycle
Sampling cycle
PID operation instruction execution
Measurement of sampling cycle PID operation
Measurement of sampling cycle PID operation
Figure 1. 2 Operation when PID Operation Instruction Executed
REMARK
*: There are the following PID operation instructions.
S.PIDCONT (incomplete derivative)
PIDCONT (complete derivative)
1 - 3
A
1. GENERAL DESCRIPTION
MEMO
MELSEC-Q/Qn
1 - 4
A

2. SYSTEM CONFIGURATION FOR PID CONTROL

MELSEC-Q/Qn
2. SYSTEM CONFIGURATION FOR PID CONTROL
This chapter describes the system configuration for PID control using the PID control instructions. For the modules that can be used to configure a system, refer to the following manual.
• Basic model QCPU, High Performance model QCPU, Universal model QCPU: MELSEC-Q DATA BOOK
CPU module
• QnACPU: User's manual (details) of the used CPU module
Main base unit
Extension cable
For PV (process value) input
A/D conversion module
For MV (manipulated value) output
D/A conversion module
2
Extension base unit
For PID control monitoring (Only QnACPU)
CRT control module
AD57 or AD57-S1 only
CRT
Operation panel
2 - 1
A
2. SYSTEM CONFIGURATION FOR PID CONTROL
POINT
SV, PV and MV used with the PID control instructions may be set either with the fixed values of 0 to 2000 or to any values according to the used module. Refer to Section 4.3.5 for details.
Basic model QCPU High Performance model QCPU Redundant CPU Universal model QCPU QnACPU
*: When the resolution of the A/D converter module or D/A converter module used for
I/O of PID control is other than 0 to 2000, convert the digital values into 0 to 2000.
CPU Module Type

2.1 Applicable PLC CPU

SV, PV, MV
0 to 2000 fixed *
: Can be set, : Cannot be set
MELSEC-Q/Qn
Any setting
×
Component Module
Basic model QCPU
High Performance model QCPU Q02CPU, Q02HCPU, Q06HCPU, Q12HCPU, Q25HCPU Redundant CPU Q12PRHCPU, Q25PRHCPU
Universal model QCPU
QnACPU
Q00JCPU, Q00CPU, Q01CPU (First 5 digits of serial No. are 04122 or later)
Q02UCPU, Q03UDCPU, Q04UDHCPU, Q06UDHCPU, Q13UDHCPU, Q26UDHCPU, Q03UDECPU, Q04UDEHCPU, Q06UDEHCPU, Q13UDEHCPU, Q26UDEHCPU Q2ASCPU, Q2ASCPU-S1, Q2ASHCPU, Q2ASHCPU-S1 Q2ACPU, Q3ACPU, Q4ACPU, Q4ARCPU
2 - 2
A

3. PID CONTROL SPECIFICATIONS

MELSEC-Q/Qn
3. PID CONTROL SPECIFICATIONS
This section gives the specifications PID operation using PID control instructions.

3.1 PID Control by incomplete derivative

3.1.1 Performance specifications

Number of PID control loops
Sampling cycle TS 0.01 to 60.00 s
PID operation method
PID
constant
setting
range
SV (set value) setting range SV 0 to 2000 -32768 to 32767
PV (process value) setting range
MV (manipulated value) output range
Proportional constant KP 0.01 to 100.00
Integral constant TI 0.1 to 3000.0 s
Derivative constant TD 0.00 to 300.00 s
Derivative gain KD 0.00 to 300.00
The performance specifications for PID control are tabled below.
Specifications
With PID limits Without PID limits
High Performance
Item
PV
MV
Basic model
QCPU
8 loops
(maximum)
-50 to 2050 -32768 to 32767
model QCPU,
Redundant CPU,
Universal model
QCPU
32 loops
(maximum)
Process value differentiation incomplete derivative
(forward operation/reverse operation)
Basic model
QCPU
8 loops
(maximum)
High Performance
model QCPU,
Redundant CPU,
Universal model
QCPU
32 loops
(maximum)
: Unusable
QnA
CPU
3
3 - 1
A
3. PID CONTROL SPECIFICATIONS

3.1.2 PID operation block diagram and operation expressions

MELSEC-Q/Qn
Name Operation Expressions Meanings of Symbols
Process
value
differentiation
Incomplete
derivative
Forward
operation
Reverse
operation
(1) The PID operation block diagram for incomplete derivative is shown below.
SV +
Set value
Disturbance
1
1
+
s
-
TI
(P)
TD S
1
+(TD/KD) s
(D)
(I)
+
-
Kp P
Gain
Manipulated value
MV
W
+
Control objective
(2) The operation expressions for PID control using PID control instructions are
indicated below.
EV
EV
n=PVfn*-SV
MV=Kp{(EVn-EV
T
TS+
D
T
D
K
D
Dn= (PVfn-2PV
MVn= MV
)+ EVn+Dn}
n-1
T
S
T
I
+PV
fn-1
fn-2
T
D
K
D
)+
D
n-1
T
D
+
T
S
K
D
n : Deviation in the present sampling cycle
EV
n-1 : Deviation in the preceding sampling
cycle
SV : Set value
fn : Process value of the present sampling
PV
cycle (after filtering)
fn-1 : Process value of the preceding
PV
sampling cycle (after filtering)
PVfn-2 : Process value of the sampling cycle
two cycles before (after filtering)
EV
n=SV-PVfn*
MV=Kp{(EVn-EV
T
TS+
D
T
D
K
D
Dn= (-PVfn+2PV
MVn= MV
POINT
T
)+ EVn+Dn}
n-1
T
S
I
-PV
fn-1
fn-2
T
D
K
D
)+
D
n-1
T
D
T
+
S
K
D
MV : Output change value
n : Present manipulation value
MV
n : Present derivative term
D D
n-1 : Derivative term of the preceding
sampling cycle
P : Proportional constant
K T
S : Sampling cycle I : Integral constant
T
D : Derivative constant
T K
D : Derivative gain
(1) *:PVfn is calculated using the following expression.
Therefore, it is the same as the PV (process value) of the input data as long as the filter coefficient is not set for the input data.
Process Value after Filtering PV
fn= PVn+ (PVfn-1-PVn)
PVn : Process value of the present sampling cycle
: Filter coefficient
PV
fn-1 : Process value of the preceding sampling cycle (after filtering)
fn is stored in the I/O data area. (See Section 5.2)
(2) PV
Process value
++
Detected noise
PV
V
3 - 2
A
3. PID CONTROL SPECIFICATIONS

3.1.3 PID control instruction list

MELSEC-Q/Qn
Name
S.PIDINIT Sets the reference data for PID operation. * ×
S.PIDCONT
S.PIDSTOP
S.PIDRUN
S.PIDPRMW
A list of the instructions used to execute PID control is given below.
Processing Details
Executes PID operation with the SV (set value)
and the PV (process value).
Stops or starts PID operation for the set loop No.
Changes the operation parameters for the
designated loop number to PID control data.
QCPU QnACPU
* ×
*
CPU Instruction
:
×
×
Usable, ×: Unusable
*: The Basic model QCPU, High Performance model QCPU, Redundant CPU and
Universal model QCPU allow selection of "with/without PID limits". Refer to Sections 5.1 and 5.2 for details of the setting range when "with/without PID limits" has been selected.
3 - 3
A
3. PID CONTROL SPECIFICATIONS
(1) PID control instruction list
The PID control instruction list has the format indicated below:
Table 3.1 How to Read the PID control Instruction List
Category
Contril data setting
Instruction
Symbol
S.PIDINIT 7
Ladder Format Processing Details
S.PIDINIT
SP.PIDINIT
S
S
Sets the PID control data stored in the word device (designated by )
S
+ 0
Common data
to
to
+ 1
+ 2
+ 15
+ 16
+ 29
setting area
For loop 1
For loop 2
to
For loop n
S
S
S
S
S
S
+ (m+0)
to
S
+ (m+13)
m=(n-1) 14+2
S
Excution
Condition
MELSEC-Q/Qn
Number of Basic
Steps
Subset
Processing
Page
8-2
(4)(3)(2)(1)
(5)
(8)(7)(6)
Explanation
(1) Classification of instructions according to their application. (2) Instruction names written in a sequence program. (3) Symbols used in the ladder diagram. (4) Processing for each instruction.
16-bit data 16-bit data
S
+ 1S
+ 2S
+ 3S
Four consecutive device numbers (beginning with the device number designated for )
S
D
D + 1
D
+ 2
D
+ 3
Four consecutive device numbers (beginning with the device number designated for )
D
Fig. 3.1 Processing for Each Instruction
3 - 4
A
3. PID CONTROL SPECIFICATIONS
(5) The execution condition for each instruction. Details are given below.
Symbol Execution Condition
(6) Number of instruction steps
For details on the number of steps, refer to the QCPU (Q mode) /QnACPU Programming Manual (Common Instructions).
(7)
A circle
indicates that subset processing is possible.
indicates that subset processing is impossible. For details on subset processing, refer to the QCPU (Q mode) /QnACPU Programming Manual (Common Instructions).
(8) Indicates the page number in this manual where a detailed description for the
instruction can be found.
MELSEC-Q/Qn
Indicates an instruction that is executed for the duration that the
condition for its execution is ON.
When the condition before the instruction is OFF, the instruction is
not executed and no processing is carried out.
Indicates an instruction that is executed once only at the leading
edge (OFF to ON) of the condition for its execution; thereafter the
instruction will not be executed, and no processing will be carried
out, even if the condition is ON.
3 - 5
A
3. PID CONTROL SPECIFICATIONS
A PID control instruction list is given in Table 3.2.
Table 3.2 PID Control Instruction List
MELSEC-Q/Qn
Category
PID
Control
data
setting
PID
operation
Instruction
Symbol
S.PIDINIT
S.PIDCONT
Ladder Format Processing Details
Sets the PID control data stored in the word device (designated
).
by
S
S
+ 0
S.PIDINIT S
SP.PIDINIT
S
S
+ (m+0)
to
S
+ (m+13)
Common data
to
to
+ 1
+ 2
+ 15
+ 16
+ 29
setting area
For loop 1
For loop 2
For loop n
S
S
S
S
S
m=(n-1) 14+2
to
Executes PID operation with the SV (set value) and the PV (process value) designated by
and stores the PID
S
operation results in the MV
S.PIDCONT S
SP.PIDCONT
(manipulated value) area of the word device designated by
S
Common data
to
S
S
to
S
S
to
S
S
S
+ (m+0)
to
S
+ (m+22)
m=(n-1) 23+10
setting area
+ 9
SV setting area
+ 10
PV setting area
MV value stor age area
+ 32
SV setting area
+ 33
PV setting area
MV value stor age area
+ 55
SV setting area
PV setting area
MV value stor age area
.
S
For loop 1
For loop 2
For loop n
Execution
Condition
Number of Basic
Steps
7
7
Subset
Processing
Page
8-2
8-3
Operation
stop
Operation
start
Parameter
change
S.PIDSTOP
S.PIDRUN
S.PIDPRMW
S.PIDSTOP
SP.PIDSTOP
S.PIDRUN
SP.PIDRUN
S.PIDPRMW
SP.PIDPRMW
n
Stops the PID operation at the loop number designated by n.
n
n
Starts the operation at the loop
number designated by
n
n
.
7
8-5
6
8-5
Changes the operation
n
n
parameter for the loop number
S
designated by n to the PID control data stored in the word device designated by S
S
8
8-6
3 - 6
A
3. PID CONTROL SPECIFICATIONS
POINT
(1) "PID operation by incomplete derivative" and "PID operation by complete
derivative" can be executed simultaneously since they are independent.
(2) When the S(P).PIDINIT instruction has been used to make initialization, use the
S(P).PIDCONT instruction to perform PID operation. To stop and start the PID operation of the specified loop No. and to change the PID control data, use the S(P).PIDSTOP, S(P).PIDRUN and S(P).PIDPRMW instructions accordingly.
MELSEC-Q/Qn
3 - 7
A
3. PID CONTROL SPECIFICATIONS

3.2 PID Control by Complete Derivative

3.2.1 Performance specifications

MELSEC-Q/Qn
Number of PID control loops
Sampling cycle TS 0.01 to 60.00 s
PID operation method
PID
constant
setting
range
SV (set value) setting range SV 0 to 2000 -32768 to 32767 0 to 2000
PV (process value) setting range
MV (manipulated value) output range
Proportional constant KP 0.01 to 100.00
Integral constant TI 0.1 to 3000.0 s
Derivative constant T
The performance specifications for PID control are tabled below.
Specification
With PID limits Without PID limits
High
Performance
Item
Basic model
QCPU
8 loops
(maximum)
D 0.00 to 300.00 s
PV
MV
model QCPU,
Redundant
CPU,
Universal model
QCPU
32 loops
(maximum)
Process value differentiation complete derivative
(forward operation/reverse operation)
-50 to 2050 -32768 to 32767 -50 to 2050
Basic model
QCPU
Universal model
8 loops
(maximum)
High
Performance
model QCPU,
Redundant
CPU,
QCPU
32 loops
(maximum)
QnACPU
32 loops
(maximum)
3 - 8
A
3. PID CONTROL SPECIFICATIONS

3.2.2 PID operation block diagram and operation expressions

MELSEC-Q/Qn
Name Operation Expressions Meanings of Symbols
Process
value
differentiation
Complete
derivative
Forward
operation
Reverse
operation
(1) The PID operation block diagram for complete derivative is shown below.
SV +
Set value
Disturbance
1
1
+
T
(P)
T
(D)
I S
(I)
D S
-
+
-
Kp P
Gain
Manipulated value
MV
W
+
+
Control objective
(2) The operation expressions for PID operation using PID control instructions are
indicated below.
EV
EVn=PVfn*-SV
S
fn-1
T T
I
+PV
fn-2
MV=Kp{(EVn-EVn-1)+ EVn+Dn}
T
D
Dn= (PVfn-2PV
T
S
MVn= MV
)
n : Deviation in the present sampling cycle
EV
n-1 : Deviation in the preceding sampling cycle
SV : Set value
fn : Process value of the present sampling cycle
PV
(after filtering)
PVfn-1 : Process value of the preceding sampling
cycle (after filtering)
PVfn-2 : Process value of the sampling cycle two
cycles before (after filtering)
EVn=SV-PVfn*
T
fn-1
T
-PV
S
I
fn-2
MV=Kp{(EVn-EVn-1)+ EVn+Dn}
T
D
Dn= (-PVfn+2PV
T
S
MVn= MV
POINT
)
MV : Output change value
MV
n : Present manipulation value
n : Present derivative term
D
P : Proportional constant
K T
S : Sampling cycle I : Integral constant
T
D : Derivative constant
T
(1) *:PVfn is calculated using the following expression.
Therefore, it is the same as the PV (process value) of the input data as long as the filter coefficient is not set for the input data.
Process Value after Filtering PV
fn= PVn+ (PVfn-1-PVn)
PVn : Process value of the present sampling cycle
: Filter coefficient
PV
fn-1 : Process value of the preceding sampling cycle (after filtering)
(2) PV
fn is stored in the I/O data area. (See Section 5.2)
Process value
++
Detected noise
PV
V
3 - 9
A
3. PID CONTROL SPECIFICATIONS

3.2.3 PID control instruction list

MELSEC-Q/Qn
Name
PIDINIT Sets the reference data for PID operation. *
PIDCONT
PID57
PIDSTOP
PIDRUN
PIDPRMW
A list of the instructions used to execute PID control is given below.
Processing Details
Executes PID operation with the SV (set value)
and the PV (process value).
Used to monitor the results of PID operation at an
AD57(S1).
Stops or starts PID operation for the set loop No.
Changes the operation parameters for the
designated loop number to PID control data.
QCPU QnACPU
*
×
*
CPU Instruction
:
Usable, ×: Unusable
*: The Basic model QCPU, High Performance model QCPU, Redundant CPU and
Universal model QCPU allow selection of "with/without PID limits". Refer to Sections 5.1 and 5.2 for details of the setting range when "with/without PID limits" has been selected.
3 - 10
Loading...
+ 96 hidden pages