Mitsubishi QCPU Programming Manual
Mitsubishi QCPU Programming Manual

Mitsubishi QCPU Programming Manual

Melsec-q/qna series, pid control instructions
Hide thumbs Also See for QCPU:
Table of Contents

Advertisement

Quick Links

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the QCPU and is the answer not in the manual?

Questions and answers

Summary of Contents for Mitsubishi QCPU

  • Page 3: Safety Cautions

    • SAFETY PRECAUTIONS • (You must read these cautions before using the product) As for the use of the product, please carefully read this manual and the related manuals introduced later. Also, please pay attention to safety adequately and manage the product correctly. The safety cautions shown in this manual apply to the product only.
  • Page 4 [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.
  • Page 5: Revisions

    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 •...
  • Page 6 * 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...
  • Page 7: Table Of Contents

    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...
  • Page 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 ....
  • Page 9 APPENDIX APP - 1 to APP - 3 Appendix 1 Processing Time List ......................APP - 1 Appendix 2 Anti-Reset Windup Measure ....................APP - 3 A - 7...
  • Page 10: About Manuals

    IB-66614 Describes how to create programs, the names of devices, parameters, and types of program. (13JF46) (Sold separately) QCPU (Q mode) /QnACPU Programming Manual (Common Instructions) SH-080039 Describes how to use sequence instructions, basic instructions, and application instructions. (13JF58) (Sold separately)
  • Page 11 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 Describes the functions,...
  • Page 12 (2) When QnACPU is used QnACPU Describes the programs, I/O processing, Programming device names, etc. that can be executed Manual by the QnACPU. (Fundamentals) This manual QCPU (Q mode)/ QnACPU QnACPU QCPU (Q mode)/ QCPU (Q mode)/ QnACPU Programming Programming QnACPU...
  • Page 13: 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 Generic term of Basic model QCPU, High Performance model QCPU, CPU module Redundant CPU, Universal model QCPU, QnACPU Abbreviation of Q2ASCPU, Q2ASCPU-S1, Q2ASHCPU, Q2ASHCPU-S1,...
  • Page 14 MEMO A - 12...
  • Page 15: 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 •...
  • Page 16 1. GENERAL DESCRIPTION MELSEC-Q/QnA There are the following PID control instructions. Classification Incomplete Derivative Complete Derivative S(P).PIDINIT PIDINIT(P) PID control data setting PID operation S(P).PIDCONT PIDCONT(P) PID control status monitor PID57(P) Specified loop No. operation stop S(P).PIDSTOP PIDSTOP(P) Specified loop No. operation start S(P).PIDRUN PIDRUN(P) S(P).PIDPRMW...
  • Page 17: Pid Processing Method

    1. GENERAL DESCRIPTION MELSEC-Q/QnA 1.1 PID Processing Method This section describes the processing method for PID control using PID control 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.
  • Page 18 1. GENERAL DESCRIPTION MELSEC-Q/QnA MEMO 1 - 4...
  • Page 19: System Configuration For Pid Control

    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 • QnACPU: User's manual (details) of the used CPU module...
  • Page 20: Applicable Plc Cpu

    Component Module Q00JCPU, Q00CPU, Q01CPU Basic model QCPU (First 5 digits of serial No. are 04122 or later) High Performance model QCPU Q02CPU, Q02HCPU, Q06HCPU, Q12HCPU, Q25HCPU Redundant CPU Q12PRHCPU, Q25PRHCPU Q02UCPU, Q03UDCPU, Q04UDHCPU, Q06UDHCPU, Universal model QCPU Q13UDHCPU, Q26UDHCPU, Q03UDECPU, Q04UDEHCPU,...
  • Page 21: Pid Control Specifications

    3.1.1 Performance specifications The performance specifications for PID control are tabled below. Specifications With PID limits Without PID limits High Performance High Performance Item model QCPU, model QCPU, Basic model Basic model Redundant CPU, Redundant CPU, QCPU QCPU Universal model...
  • Page 22: Pid Operation Block Diagram And Operation Expressions

    3. PID CONTROL SPECIFICATIONS MELSEC-Q/QnA 3.1.2 PID operation block diagram and operation expressions (1) The PID operation block diagram for incomplete derivative is shown below. Disturbance SV + Set value Process Manipulated value Gain Control value objective Detected noise (2) The operation expressions for PID control using PID control instructions are indicated below.
  • Page 23: Pid Control Instruction List

    PID control data. : 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"...
  • Page 24 3. PID CONTROL SPECIFICATIONS MELSEC-Q/QnA (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 Number Excution Subset Instruction of Basic Page Category Ladder Format Processing Details Condition Processing...
  • Page 25 ON. (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.
  • Page 26 3. PID CONTROL SPECIFICATIONS MELSEC-Q/QnA A PID control instruction list is given in Table 3.2. Table 3.2 PID Control Instruction List Number Instruction Execution Subset Category Ladder Format Processing Details of Basic Page Symbol Condition Processing Steps Sets the PID control data stored in the word device (designated S.PIDINIT S Common data...
  • Page 27 3. PID CONTROL SPECIFICATIONS MELSEC-Q/QnA 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.
  • Page 28: Pid Control By Complete Derivative

    3.2 PID Control by Complete Derivative 3.2.1 Performance specifications The performance specifications for PID control are tabled below. Specification With PID limits Without PID limits High High Performance Performance Item model QCPU, model QCPU, QnACPU Basic model Basic model Redundant Redundant QCPU QCPU CPU, CPU,...
  • Page 29: Pid Operation Block Diagram And Operation Expressions

    3. PID CONTROL SPECIFICATIONS MELSEC-Q/QnA 3.2.2 PID operation block diagram and operation expressions (1) The PID operation block diagram for complete derivative is shown below. Disturbance SV + Set value Process Manipulated value Gain Control value objective Detected noise (2) The operation expressions for PID operation using PID control instructions are indicated below.
  • Page 30: Pid Control Instruction List

    PID control data. : 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"...
  • Page 31 3. PID CONTROL SPECIFICATIONS MELSEC-Q/QnA (1) The PID control instruction list The PID control instruction list has the format indicated below: Table 3.3 How to Read the PID control Instruction List Number Excution Subset Instruction of Basic Category Ladder Format Processing Details Page Condition...
  • Page 32 ON. (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.
  • Page 33 3. PID CONTROL SPECIFICATIONS MELSEC-Q/QnA A PID control instruction list is given in Table 3.4. Table 3.4 PID Control Instruction List Number Instruction Execution Subset Category Ladder Format Processing Details of Basic Page Symbol Condition Processing Steps Sets the PID control data stored in the word device (designated PIDINIT Common data...
  • Page 34 3. PID CONTROL SPECIFICATIONS MELSEC-Q/QnA Table 3.4 PID Control Instruction List Number Instruction Execution Subset Category Ladder Format Processing Details of Basic Page Symbol Condition Processing Steps PIDSTOP Operation Stops the PID operation at the PIDSTOP loop number designated by stop PIDSTOPP n PIDRUN...
  • Page 35: Functions Of Pid Control

    4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4. FUNCTIONS OF PID CONTROL This chapter describes PID control performed using the PID control instructions. 4.1 Outline of PID Control PID control is applicable to process control in which factors such as flowrate, velocity, air flow volume, temperature, tension, mixing ratio, etc.
  • Page 36: Operation Method

    4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.2 Functions of PID Control The operation methods for PID control with the PID control instructions are the velocity type and process value derivative type. The following describes the control executed for both of these methods: 4.2.1 Operation method (1) Velocity type operation The velocity type operation calculates amounts of changes in the MVs...
  • Page 37 4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA (5) The figure below shows examples of process control with forward operation and reverse operation: Set value Process value Set value Process value Time Time Forward operation (for cooling) Reverse operation (for heating) 4 - 3...
  • Page 38: Proportionate Operation (P Operation)

    4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.2.3 Proportional operation (P operation) The control method for proportional operation is described below. (1) In proportional operation, an MV (manipulated value) proportional to the deviation (the difference between the set value and process value) is obtained. (2) The relationship between E (deviation) and the MV is expressed by the following formula: MV=Kp •...
  • Page 39 4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.2.4 Integral operation (I operation) The control method for integral operation is described below. (1) In the integral operation, the MV (manipulated value) changes continuously to zero deviation when it occurs. This operation can eliminate the offset that is unavoidable in proportional operation.
  • Page 40 4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.2.5 Derivative operation (D operation) The control method for derivative operation is described below. (1) In derivative operation, an MV (manipulated value) proportional to the deviation change rate is added to the system value to zero deviation when it occurs. This operation prevents significant fluctuation at the control objective due to external disturbances.
  • Page 41 4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA REMARK About the differences between complete derivative and incomplete derivative [Incomplete derivative] Incomplete derivative is PID control that has a primary delay filter in the input of a derivative term. The S.PIDCONT instruction is the incomplete derivative PID control instruction. Incomplete derivative is effective for the following cases.
  • Page 42: Pid Operation

    4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.2.6 PID operation The control method when proportional operation (P operation), integral operation (I operation), and derivative operation (D operation) are used in combination is described below. (1) During PID operation, the system is controlled by the MV (manipulated value) calculated in the (P + I + D) operation.
  • Page 43: Other Functions

    4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.3 Other Functions During PID control using the PID control instructions, MV upper/lower limit control is automatically executed by the bumpless changeover function explained below. 4.3.1 Bumpless changeover function (1) This function controls the MV (manipulated value) continuously when the control mode is changed between manual and automatic.
  • Page 44 4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.3.2 MV upper/lower limit control function (1) The MV upper/lower limit control function controls the upper or lower limit of the MV calculated in the PID operation. This function is only effective in the automatic mode.
  • Page 45: Monitorning Pid Control With The Ad57(S1) (Qnacpu Only)

    4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.3.3 Monitoring PID control with the AD57(S1) (QnACPU only) The PID control operation results can be monitored in a bar graph with an AD57(S1) CRT controller unit. (1) The monitor screen displays the monitored information of eight loops beginning with the designated loop number.
  • Page 46: Function For Transfer To The Sv Storage Device For The Pv In Manual Mode

    4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.3.4 Function for transfer to the SV storage device for the PV in manual mode When using the PID control instruction to perform PID control, execute the PID operation instruction also in the manual mode. In the manual mode, it is possible to select whether the PV imported from the A/D converter module is transferred to the SV storage device or not when the PID operation instruction is executed, depending on the ON/OFF status of the PID...
  • Page 47: Changing The Pid Control Data Or Input/Output Data Setting Range (Qcpu Only)

    4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA 4.3.5 Changing the PID control data or input/output data setting range (QCPU only) The setting ranges of the following data of the PID control data (refer to Section 5.1) and I/O data (refer to Section 5.2) can be changed as desired by user setting.
  • Page 48 4. FUNCTIONS OF PID CONTROL MELSEC-Q/QnA MEMO 4 - 14...
  • Page 49: Pid Control Procedure

    5. PID CONTROL PROCEDURE MELSEC-Q/QnA 5. PID CONTROL PROCEDURE The programming procedure required to execute PID control is shown below. Programming Procedure Changing the PID control data Setting the PID control data See Section 5.1 for details on the Set the PID control data in the setting items and setting procedure.
  • Page 50 5. PID CONTROL PROCEDURE MELSEC-Q/QnA Executing the PID operation instruction * Using the PID operation instruction, See Section 8.1.2/9.1.2 for details on execute PID operation based on the the instruction. PID control data set in the word devices and the I/O data. Outputting the MV (manipulated The MV, obtained from the PID value)
  • Page 51 5. PID CONTROL PROCEDURE MELSEC-Q/QnA MEMO 5 - 3...
  • Page 52: Pid Control Data

    PID operation instruction The PID control data is classified into two types, "common data for all loops" and "data for individual loops". (a) For Basic model QCPU Table 5.1 PID Control Data List Incomplete derivative With PID limits...
  • Page 53 5. PID CONTROL PROCEDURE MELSEC-Q/QnA REMARK *1: The following are available as the PID operation instructions. S.PIDCONT (incomplete derivative) PIDCONT (complete derivative) *2: The following are available as the PID control data setting instructions. S.PIDINIT (incomplete derivative) PIDINIT (complete derivative) Complete derivative With PID limits Without PID limits...
  • Page 54 5. PID CONTROL PROCEDURE MELSEC-Q/QnA Table 5.1 PID Control Data List Incomplete derivative With PID limits Without PID limits Data Data Item Description User User Setting Range Specification Setting Range Specification Range Range In the automatic mode, sets the lower limit for the MV (manipulated MV Lower value) calculated in PID operation.
  • Page 55 5. PID CONTROL PROCEDURE MELSEC-Q/QnA Complete derivative With PID limits Without PID limits Processing when Set Data is Outside the Allowable Setting Range Setting User Specification User Specification Setting Range Range Range Range In the case of "with PID limits", PID -50 to 2050 -50 to 2050 -32768 to 32767...
  • Page 56 5. PID CONTROL PROCEDURE MELSEC-Q/QnA (b) For High Performance model QCPU, Redundant CPU, Universal model QCPU Table 5.2 PID Control Data List Incomplete derivative With PID limits Without PID limits Data Data Item Description User User Setting Range Specification Setting Range...
  • Page 57 5. PID CONTROL PROCEDURE MELSEC-Q/QnA Complete derivative With PID limits Without PID limits Processing if Set Data is Outside the Allowable Setting Range User Designation User Designation Setting Range Setting Range Range Range 1 to 32 1 to 32 1 to 32 1 to 32 An error occurs and PID operation is not executed for all loops.
  • Page 58 5. PID CONTROL PROCEDURE MELSEC-Q/QnA Table 5.2 PID Control Data List Incomplete derivative With PID limits Without PID limits Data Data Item Description User User Setting Range Specification Setting Range Specification Range Range In the automatic mode, sets the lower limit for the MV (manipulated MV Lower value) calculated in PID operation.
  • Page 59 User Specification User Specification Setting Range Range Range Range For the High Performance model QCPU "with PID limits" or the QnACPU, PID operation is -50 to 2050 -50 to 2050 -32768 to 32767 -32768 to 32767 performed after conversion into the following value.
  • Page 60 5. PID CONTROL PROCEDURE MELSEC-Q/QnA (c) For QnACPU Table 5.3 PID Control Data List Processing when Set Data is Data User Specifi- Data Item Description Outside the Allowable Setting Setting Range cation Range Range Number of Sets the number of loops for which PID 1 to 32 1 to 32 loops...
  • Page 61 5. PID CONTROL PROCEDURE MELSEC-Q/QnA (2) PID control data can be set in any word device number. However, all the data used for the corresponding loops must be set in devices with consecutive numbers. (3) The PID control data allocations are shown below. (a) For incomplete derivative Specified device number +0 Number of loops...
  • Page 62 5. PID CONTROL PROCEDURE MELSEC-Q/QnA (a) Use the following formula to calculate the number of device points to be used when setting the PID control data: Number of device points = 2 + 14 n (n: Number of loops to be used) (b) Set each data as a binary value.
  • Page 63: Number Of Loops To Be Used And The Number Of Loops To Be Executed In A Single Scan

    5. PID CONTROL PROCEDURE MELSEC-Q/QnA 5.1.1 Number of loops to be used and the number of loops to be executed in a single scan (1) The number of loops to be used means the number of loops for which PID operation is executed.
  • Page 64: Sampling Cycle

    5. PID CONTROL PROCEDURE MELSEC-Q/QnA 5.1.2 Sampling cycle (1) A sampling cycle is the cycle in which PID operation is executed. The measurement time for one scan is added to the measurement time of up to the preceding scan each time a PID operation instruction* is executed.
  • Page 65 5. PID CONTROL PROCEDURE MELSEC-Q/QnA MEMO 5 - 17...
  • Page 66: I/O Data

    (2) The I/O data area is divided into the "data area where data are allocated loop-by- loop" and "work area used by the system to perform PID operation". Table 5.4 I/O Data List Setting Range Data Name Description QCPU With PID limits Without PID limits Set value PID control target value 0 to 2000...
  • Page 67 MELSEC-Q/QnA Processing when Set Data is Outside the Specified Range QnACPU QCPU "with PID limit", or QnACPU, PID operation is performed after conversion into the following value. 0 to 2000 When SV is less than 0, SV must be 0.
  • Page 68 5. PID CONTROL PROCEDURE MELSEC-Q/QnA (3) For the I/O data, any word device number can be specified. However, all the data used for the corresponding loops must be set in devices with consecutive numbers. (4) The I/O data allocations are shown below. (a) For incomplete derivative Designated device number +0 Initial processing flag...
  • Page 69 5. PID CONTROL PROCEDURE MELSEC-Q/QnA 3) The initial processing flag sets the processing method at the start of PID operation. •) In the initial PID operation processing cycle, operation is executed assuming that the set sampling cycle is reached or exceeded. •) The initial processing flag is set in the following manner: 0......
  • Page 70 5. PID CONTROL PROCEDURE MELSEC-Q/QnA (b) For complete derivative Designated device number +0 Initial processing flag Write Read/write Work area for PID control disabled (cannot be used) Set value (SV) Write Process value (PV) Automatic manipulated value (MV) Read Process value after filtering (PVf) Manual manipulated value (MV I/O data area Write...
  • Page 71 5. PID CONTROL PROCEDURE MELSEC-Q/QnA 3) The initial processing flag sets the processing method at the start of PID operation. •) In the initial PID operation processing cycle, operation is executed assuming that the set sampling cycle is reached or exceeded. •) The initial processing flag is set in the following manner: 0......
  • Page 72 5. PID CONTROL PROCEDURE MELSEC-Q/QnA MEMO 5 - 24...
  • Page 73: Pid Control Instructions 6 - 1 To

    PID control instructions are defined in the same configuration as High Performance model QCPU, Redundant CPU, Universal model QCPU and QnACPU control instructions. For details on the configuration of control instructions, see the QCPU (Q mode)/ QnACPU Programming Manual (Common Instructions.) 6 - 1...
  • Page 74 6. PID CONTROL INSTRUCTIONS MELSEC-Q/QnA MEMO 6 - 2...
  • Page 75: How To Read Explanations For Instructions

    *2 : FX and FY can only be used with bit data, and FD can only be used with word data. *3 : Can be used with MELSECNET/G,MELSECNET/H and MELSECNET/10. *4 : For the explanation of the corresponding devices, refer to the QCPU User's Manual (Function Explanation, Programming Fundamentals) or the QnACPU Programming Manual (Basics).
  • Page 76 7. HOW TO READ EXPLANATIONS FOR INSTRUCTIONS MELSEC-Q/QnA 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA (6) For , designate the first number of the device numbers that are designated in the I/O data area. If file registers (R) are designated for the I/O data area, do not set memory protect ON for the file registers (R).
  • Page 77: Incomplete Derivative Pid Control Instructions And Program Examples

    8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES This section explains how to use the PID control instructions for PID control and shows some programming examples. 8.1 PID Control Instructions 8 - 1...
  • Page 78: S.pidinit,Sp.pidinit

    8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA QCPU Applicable PLC CPU Q4AR Redundant Process CPU Basic High Performance Universal *1: First five digits of serial No. are 04122 or later *2: First five digits of serial No. are 05032 or later 8.1.1 PID control data settings...
  • Page 79: S.pidcont,Sp.pidcont

    8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA QCPU Applicable PLC CPU Q4AR Redundant Process CPU Basic High Performance Universal *1: First five digits of serial No. are 04122 or later *2: First five digits of serial No. are 05032 or later 8.1.2 PID operation...
  • Page 80 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA (6) For , designate the first number of the device numbers that are designated in the I/O data area. If file registers (R) are designated for the I/O data area, do not set memory protect ON for the file registers (R).
  • Page 81: Operation Stop/Start Of Designated Loop No

    • When the loop number designated by does not exist. (Error code: 4100) • When is outside the range 1 to 8. (Basic model QCPU) (Error code: 4100) • When is outside the range 1 to 32. (High Performance model QCPU, Redundant CPU, Universal model QCPU) (Error code: 4100) •...
  • Page 82: S.pidprmw,Sp.pidprmw

    8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA QCPU Applicable PLC CPU Q4AR Redundant Process CPU Basic High Performance Universal *1: First five digits of serial No. are 04122 or later *2: First five digits of serial No. are 05032 or later 8.1.4 Parameter change at designated loop...
  • Page 83 1 to 8.(Basic model QCPU) (Error code: 4100) • When is outside the range 1 to 32.(High Performance model QCPU, Redundant CPU, Universal model QCPU) (Error code: 4100) • When the PID control data is outside the setting range.
  • Page 84: Pid Control Program Examples

    8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 8.2 PID Control Program Examples This section describes examples of sequence programs that execute PID control. 8.2.1 System configuration for program examples The following illustrates the system configuration for the program examples in Sections 8.2.2 and 8.2.3 CPU module PID operation...
  • Page 85: Program Example For Automatic Mode Pid Control

    8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 8.2.2 Program example for automatic mode PID control This section gives a program example in which PID operation is performed using the digital values imported from the Q64AD as PV and the MV obtained as a result of PID operation are output from the Q62DA to control external devices.
  • Page 86 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA [PROGRAM EXAMPLE] Sets the number of loops to Setting of be used to 2. common data of PID Sets the number of loops to control data be executed per scan to 2. Sets the operation expression to forward operation.
  • Page 87 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA Sets the operation expression to reverse operation. Sets the sampling cycle to 1s. Sets the proportional constant to 1. Sets the integral constant to 3000s. Sets the derivative constant to 0s. Sets the filter coeffic ent to 0%.
  • Page 88 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA Sets the PV from the Q64AD to the I/O data area (for loop 1). Sets the PV from the Q64AD to the I/O data area (for loop 2). PID operation Turns ON the output enable of CH.
  • Page 89: Program Example For Changing The Pid Control Mode Between Automatic And Manual

    8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 8.2.3 Program example for changing the PID control mode between automatic and manual An example program for switching between automatic and manual modes while executing PID operation is described below. [PROGRAMMINGCONDITIONS] (1) Refer to Section 8.2.1 for details on the system configuration.
  • Page 90 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA (9) The PID bumpless processing flag, SM794, is set to OFF. In the manual mode, the SV is automatically rewritten to the PV when PID operation is performed. Therefore, when the manual mode is returned to the automatic mode, the SV must be rewritten to the one used in the automatic mode before switching to the manual mode.
  • Page 91 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA [PROGRAM EXAMPLE] Sets the number of Setting of loops to be used to 1. common data Sets the number of loops of PID control to be executed per scan data to 1.
  • Page 92 8. INCOMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA Sets the manual mode. Resets the devices used for manual to automatic mode change processing. Processing in manual mode Sets the MV externally. Sets the automatic mode. Manual to automatic mode change command Since the manual mode is not switched to the automatic mode until PID...
  • Page 93: Complete Derivative Pid Control Instructions And Program Examples 9 - 1 To

    9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES This chapter explains the PID control instruction usage and program examples for implementing PID control. 9.1 PID Control Instructions 9 - 1...
  • Page 94: 9.1.1 Pid Control Data Settings

    9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA QCPU Applicable PLC CPU Q4AR Redundant Process CPU Basic High Performance Universal *1: First five digits of serial No. are 04122 or later 9.1.1 PID control data settings Usable Devices...
  • Page 95 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA QCPU Applicable PLC CPU Q4AR Redundant Process CPU Basic High Performance Universal *1: First five digits of serial No. are 04122 or later 9.1.2 PID control Usable Devices Internal Devices...
  • Page 96 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA (6) For , designate the first number of the device numbers that are designated as the I/O data area. If file registers (R) are designated for the I/O data area, do not set memory protect ON for the file registers (R).
  • Page 97 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA QCPU Applicable PLC CPU Q4AR Redundant Process CPU Basic High Performance Universal 9.1.3 Monitoring PID control status (QnACPU only) Usable Devices Internal Devices MELSECNET/10 (H) Set Data Special Function Index Register...
  • Page 98 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA (4) Execute the PID57 instruction only after the PIDINIT and PIDCONT instructions have been executed. An error will occur if the PID57 instruction is executed before the PIDINIT and PIDCONT instructions. (5) Designate the loop number indicated by with a screen number from "1"...
  • Page 99 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 000H...
  • Page 100: Operation Stop/Start Of Designated Loop No

    • When the loop number designated by does not exist. (Error code: 4100) • When n is outside the range 1 to 8. (Basic model QCPU) (Error code: 4100) • When is outside the range 1 to 32.(High Performance model QCPU, Redundant...
  • Page 101 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA QCPU Applicable PLC CPU Q4AR Redundant Process CPU Basic High Performance Universal *1: First five digits of serial No. are 04122 or later 9.1.5 Parameter change at designated loop Usable Devices...
  • Page 102 1 to 8. (Basic model QCPU) (Error code: 4100) • When is outside the range 1 to 32. (High Performance model QCPU, Redundant CPU, Universal model QCPU, QnACPU) (Error code: 4100) • When the PID control data is outside the setting range.
  • Page 103: Pid Control Program Examples (Qcpu Only)

    9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 9.2 PID Control Program Examples (QCPU only) This section describes examples of sequence programs that execute PID control. 9.2.1 System configuration for program examples The following illustrates the system configuration for the program examples in Sections 9.2.2 and 9.2.3.
  • Page 104: Program Example For Automatic Mode Pid Control

    9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 9.2.2 Program example for automatic mode PID control This section gives a program example in which PID operation is performed using the digital values imported from the Q64AD as PV and the MV obtained as a result of PID operation are output from the Q62DA to control external devices.
  • Page 105 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA [PROGRAM EXAMPLE] Sets the number of loops to be used to 2. Setting of common Sets the number of data of PID control loops to be executed data per scan to 2. Sets the operation expression to forward operation.
  • Page 106 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA Setting of common data Sets the initial processing flag to 0. of I/O data Sets the SV to 600. Setting of I/O data for loop 1 Sets the automatic mode. Sets the SV to 1000.
  • Page 107: Program Example For Changing The Pid Control Mode Between Automatic And Manual

    9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 9.2.3 Program example for changing the PID control mode between automatic and manual An example program for switching between automatic and manual modes while executing PID operation is described below. [PROGRAMMINGCONDITIONS] (1) Refer to Section 9.2.1 for details on the system configuration.
  • Page 108 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA (9) The PID bumpless processing flag, SM774, is set to OFF. In the manual mode, the SV is automatically rewritten to the PV when PID operation is performed. Therefore, when the manual mode is returned to the automatic mode, the SV must be rewritten to the one used in the automatic mode before switching to the manual mode.
  • Page 109 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA [PROGRAM EXAMPLE] Sets the number of loops to be used to 1. Setting of common Sets the number of data of PID control loops to be executed data per scan to 1. Sets the operation expression to forward operation.
  • Page 110 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA [PROGRAM EXAMPLE] Sets the automatic mode. Manual to automatic mode change command Since the manual mode is not switched to the automatic mode until PID operation is performed after the manual to automatic mode change command has turned ON, executes the manual to automatic change command processing (step 102 to step 138)
  • Page 111: Pid Control Program Examples (Qnacpu Only)

    9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 9.3 PID Control Program Examples (QnACPU only) This section describes examples of sequence programs that execute PID control. 9.3.1 System configuration for program examples The following illustrates the system configuration for the program examples in Sections 9.3.2 and 9.3.3.
  • Page 112: Program Example For Automatic Mode Pid Control

    9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 9.3.2 Program example for automatic mode PID control This section gives a program example in which PID operation is performed using the digital values imported from the A68AD as PV and the MV obtained as a result of PID operation are output from the A62DA to control external devices.
  • Page 113 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA [PROGRAM EXAMPLE] Sets the number of loops to be used to "2" Setting of common data of PID control Sets the number of PID operation data execution loops per scan to "2" Sets the operation expression to forward operation Sets the sampling cycle to...
  • Page 114 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA Sets the operation expression for reverse operation Sets the sampling cycle to "1 s" Sets the proportional constant to "1" Sets the integral constant to "3000 s" Sets the derivative constant to "0 s"...
  • Page 115 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA Turns the A62DA output enable signal ON Writes the MV values of loop 1 and loop 2 to the A62DA Stops PID operation Sets the initial screen display request Monitors PID control status with the AD57 REMARK...
  • Page 116: Program Example For Changing The Pid Control Mode Between Automatic And Manual

    9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA 9.3.3 Program example for changing the PID control mode between automatic and manual An example program for switching between automatic and manual modes while executing PID operation is described below. [PROGRAMMINGCONDITIONS] (1) Refer to Section 9.3.1 for details on the system configuration.
  • Page 117 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA (9) The PID bumpless processing flag, SM774, is set to OFF. The SV is automatically rewritten to the PV when the control mode is changed from automatic to manual. Therefore, before returning the control mode from manual to automatic, the SV must be rewritten to the one used in the automatic mode.
  • Page 118 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA [PROGRAM EXAMPLE] Sets the number of loops Setting of common to be used to "1" data of PID control Sets the number of PID data operation execution loops per scan to "1" Sets the operation expression to forward operation Sets the sampling cycle to...
  • Page 119 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA [PROGRAM EXAMPLE] Sets the automatic mode Manual to automatic mode change command The control mode is changed to automatic only after PID operation is executed following the manual to automatic mode change command being turned ON.
  • Page 120 9. COMPLETE DERIVATIVE PID CONTROL INSTRUCTIONS AND PROGRAM EXAMPLES MELSEC-Q/QnA MEMO 9 - 28...
  • Page 121: Appendix 1 Processing Time List

    APPENDIX MELSEC-Q/QnA APPENDIX Appendix 1 Processing Time List (1) The following table indicates the processing times for incomplete derivative PID control instructions. Instruction Processing Time ( s) Conditions Name Q00JCPU Q00CPU Q01CPU Q02CPU QnHCPU QnPRHCPU 1 loop 115.0 97.0 88.5 64.5 28.0 28.0...
  • Page 122 APPENDIX MELSEC-Q/QnA (2) The following table indicates the processing times for complete derivative PID control instructions. Processing Time ( s) Instruction Q2ASHCPU(S1) Conditions Q2ASCPU Q00J QnPRH Name Q3ACPU Q4ACPU Q2ACPU(S1) Q4ARCPU 1 loop 66.0 56.0 50.5 26.0 11.2 11.2 PIDINIT 8 loops 170.0 145.0...
  • Page 123: Appendix 2 Anti-Reset Windup Measure

    Since the anti-reset windup measure is taken in the PID operation instruction (PIDCONT instruction and S.PIDCONT instruction) of the QCPU/QnACPU, it is unnecessary to stop the integral operation. Without anti-reset windup measure: If deviation turns to decreasing direction, response of MV delays.
  • Page 124 6. Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi. 7. Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user. 2. Onerous repair term after discontinuation of production (1) Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued.

This manual is also suitable for:

Q modeQnacpu

Table of Contents