Wiki source code of 11 PID Control Instruction

Last modified by Iris on 2025/10/22 16:39

Hide last authors
Iris 2.2 1 == **PID/PID calculation** ==
2
3 **PID**
4
5 This instruction is used to perform PID control that changes the output value according to the amount of input change.
6
7 -[PID (s1)(s2)(s3)(d)]
8
9 **Content, range and data type**
10
11 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
Iris 2.3 12 |(s1)|Device number for storing the target value (SV)|-32767 to 32767|Signed BIN 16 bit|ANY16
13 |(s2)|Device number for storing the measured value (PV)|-32767 to 32767|Signed BIN 16 bit|ANY16
14 |(s3)|Device number for storing parameters|1 to 32767|Signed BIN 16 bit|ANY16
15 |(d)|Device number for storing output value (MV)|-32767 to 32767|Signed BIN 16 bit|ANY16
Iris 2.2 16
17 **Device used**
18
Iris 2.3 19 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="3" %)**Devices**|(((
20 **Offset modification**
Iris 2.1 21 )))|(((
Iris 2.3 22 **Pulse extension**
Iris 2.1 23 )))
Iris 2.3 24 |**D**|**R**|**SD**|**[D]**|**XXP**
25 |(% rowspan="4" %)PID|Parameter 1|●|●|●| |
26 |Parameter 2|●|●|●| |
27 |Parameter 3|●|●|●| |
28 |Parameter 4|●|●|●| |
Iris 2.1 29
Iris 2.2 30 **Features**
31
32 This instruction is to complete the PID operation and is used to control the parameters of the closed-loop control system. PID control has a wide range of applications in mechanical equipment, pneumatic equipment, constant pressure water supply and electronic equipment, etc. among them:
33
Iris 5.2 34 [[image:11_html_1c6bb88c06ac24cf.png||height="18" width="32"]] is the target value of PID control;
Iris 2.2 35
Iris 5.2 36 [[image:11_html_fb5122fb6e3a43d5.png||height="19" width="34"]] is the measured feedback value;
Iris 2.2 37
Iris 5.2 38 [[image:11_html_6c3fad4a32a3db43.png||height="19" width="34"]] The starting address of the buffer area for setting parameters required for PID operation and saving intermediate results, occupies a total of 26 variable units in the subsequent addresses, the value range is D0 to D7974, it is best to specify the power failure retention area, which will remain after the power is OFF Set the value, otherwise the buffer area needs to be assigned value before starting the operation for the first time. The function and parameter description of each unit are described in this section;
Iris 2.2 39
Iris 5.2 40 [[image:11_html_b126b1b2673dc1f4.png||height="22" width="39"]] is the storage unit of the PID calculation result. Please designate [[image:11_html_d47cd1f59b766ed3.png||height="24" width="47"]] as a non-battery holding area, otherwise it needs to be initialized and cleared before starting the calculation for the first time.
Iris 2.2 41
42 **Programming example**
43
Iris 5.2 44 (% style="text-align:center" %)
45 [[image:1758108900843-990.png||height="24" width="396"]]
Iris 2.2 46
Iris 2.3 47 The parameter description is as follows:
Iris 2.2 48
49 What is stored in D9 is the target value of PID adjustment, and D10 is the closed-loop feedback value. Note that D9 and D10 must be of the same dimension, such as both 0.01MPa units, or 1℃ units, etc.;
50
Iris 2.3 51 A total of 26 units of D200 to D225 are used to store the set value and process value of PID operation. These values must be set item by item before the first PID calculation;
Iris 2.2 52
53 The D130 unit is used to store the calculated control output value to control the execution of the action.
54
Iris 5.2 55 The function and setting method of the parameter value of each unit about starting of [[image:11_html_6c3fad4a32a3db43.png||height="27" width="48"]] are described in the following table:
Iris 2.2 56
Iris 2.3 57 |**Unit**|**Features**|**Setting instructions**
Iris 5.2 58 |[[image:11_html_6c3fad4a32a3db43.png||height="24" width="43"]]|Sampling time (TS)|The setting range is 1 to 32767 (ms), but it needs to be greater than the PLC program scan period
59 |[[image:11_html_6c3fad4a32a3db43.png||height="22" width="39"]] +1|Action direction (ACT)|(((
Iris 2.2 60 bit0: 0 = positive action; 1 = reverse action bit3: 0 = unidirectional; 1 = bidirectional
61
62 bit4: 0 = auto-tuning does not work; 1 = auto-tuning is executed, others cannot be used.
63 )))
Iris 5.2 64 |[[image:11_html_6c3fad4a32a3db43.png||height="24" width="43"]] +2|Maximum ascent rate (DeltaT)|Setting range 0 to 32000 is the threshold of integral increment
65 |[[image:11_html_6c3fad4a32a3db43.png||height="24" width="43"]] +3|Proportional gain (Kp)|Setting range 0 to 32767, note that this value is enlarged by 256 times, the actual value is Kp/256
66 |[[image:11_html_6c3fad4a32a3db43.png||height="24" width="43"]] +4|Integral gain (Ki)|Setting range 0 to 32767, Ki=16384Ts/Ti, Ti is the integral time
67 |[[image:11_html_6c3fad4a32a3db43.png||height="23" width="41"]] +5|Differential gain (Kd)|Setting range 0 to 32767, Kd≈Td/Ts, Td is the derivative time
68 |[[image:11_html_6c3fad4a32a3db43.png||height="23" width="41"]] +6|Filtering (C0)|Setting range 0 to 1023, integral part filtering
69 |[[image:11_html_6c3fad4a32a3db43.png||height="24" width="43"]] +7|Output lower limit|(((
Iris 2.3 70 Recommended setting range -2000 to 2000
Iris 2.2 71
Iris 2.3 72 {{id name="OLE_LINK630"/}}When bit3 of S3+1=0, set to 0; When bit3 of S3+1=1, set to -2000;
Iris 2.2 73 )))
Iris 5.2 74 |[[image:11_html_6c3fad4a32a3db43.png||height="23" width="41"]] +8|Output upper limit|Recommended setting value 2000
75 |[[image:11_html_6c3fad4a32a3db43.png||height="25" width="44"]] +9|Reserved|Reserved
Iris 2.3 76 |︙|︙|︙
Iris 5.2 77 |[[image:11_html_6c3fad4a32a3db43.png||height="22" width="39"]] +25|Reserved|Reserved
Iris 2.2 78
79 **Auto tuning example**
80
Iris 2.3 81 (% style="text-align:center" %)
Iris 5.2 82 [[image:11_html_c64303b9c6a47ae9.png||height="583" width="567" class="img-thumbnail"]]
Iris 2.2 83
84 **✎Note:**
85
Iris 2.3 86 ● When multiple instructions are used, the device number of (d) cannot be repeated.
Iris 2.2 87
Iris 2.3 88 ● During the execution of auto-tuning, the (s3) parameter space cannot be modified.
Iris 2.2 89
Iris 2.3 90 ● The instruction occupies 26 point devices from the device specified in (s3).
Iris 2.2 91
Iris 2.3 92 ● PID instruction can be used multiple times in the program and can be executed at the same time, but the variable area used in each PID instruction should not overlap; it can also be used in step instructions, jump instructions, timing interrupts, and subroutines, in this case When executing the PID instruction, the (s3)+9 cache unit must be cleared in advance.
Iris 2.2 93
Iris 2.3 94 ● The maximum error of the sampling time Ts is -(1 operation cycle +1ms) +(1 operation cycle). If the sampling time Ts ≤ 1 operation cycle of the programmable controller, the following PID operation error (4D86H) will occur, and the PID operation will be executed with TS = operation cycle. In this case, it is recommended to use constant scan mode or use PID instruction in timer interrupt.
Iris 2.2 95
96 **Error code**
97
98 |**Error code**|**Content**
99 |4085H|When the device specified in the read application instructions (s1), (s2), (s3), (d) exceeds the range of the corresponding device.
100 |4086H|When the device specified in the write application instruction (s3) and (d) exceeds the range of the corresponding device.
Iris 2.3 101 |4D80H|The sampling time is out of range.​(T,,S,,≤0)
102 |4D81H|Input filter constant (,, ,,α ) is out of range (α​<0 or α>1023)
103 |4D82H|The maximum ascent rate (△T) is out of range.(△T​<0 or △T​>1023)
104 |4D83H|The proportional gain (K//p//) is out of range.​​​​(K//p//<0)
105 |4D84H|The integral gain (K//i//) is out of range.(K//i​//<0)
106 |4D85H|The differential gain (K//d//) is out of range.​​​​(K//d//<0)
107 |4D86H|The sampling time (T//s//) is less than the operation cycle.​​​​(T//s//<Scan cycle)
Iris 2.2 108
Iris 2.3 109 **Example**
Iris 2.2 110
Iris 2.8 111 == **CCPID/CCPID calculation** ==
Iris 2.2 112
Iris 2.3 113 **CCPID**
114
Iris 2.2 115 This instruction is used to perform PID control that changes the output value according to the amount of input change.
116
Iris 2.3 117 -[CCPID (s1) (s2) (s3) (d)]
Iris 2.2 118
119 **Content, range and data type**
120
121 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
Iris 2.3 122 |(s1)|Device number for storing the target value (SV)|-32767 to 32767|Signed BIN 16 bit|ANY16
123 |(s2)|Device number for storing the measured value (PV)|-32767 to 32767|Signed BIN 16 bit|ANY16
124 |(s3)|Device number for storing parameters|1 to 32767|Signed BIN 16 bit|ANY16
125 |(d)|Device number for storing output value (MV)|-32767 to 32767|Signed BIN 16 bit|ANY16
Iris 2.2 126
127 **Device used**
128
Iris 2.3 129 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="3" %)**Devices**|(((
130 **Offset modification**
Iris 2.2 131 )))|(((
Iris 2.3 132 **Pulse extension**
Iris 2.2 133 )))
Iris 2.3 134 |**D**|**R**|**SD**|**[D]**|**XXP**
135 |(% rowspan="4" %)CCPID|Parameter 1|●|●|●| |
136 |Parameter 2|●|●|●| |
137 |Parameter 3|●|●|●| |
138 |Parameter 4|●|●|●| |
Iris 2.2 139
140 **Features**
141
Iris 2.3 142 After setting target value (s1), measured value (s2), parameter (s3) to (s3) +12 and executing the program, the calculation result (MV) will be stored to the output according to the first sampling time (s3) in the parameter Value (d). For details, please refer to the user manual of "Wecon CC Series ccpid Function Description v1.4".
Iris 2.2 143
144 **✎Note:**
145
146 It can be executed multiple times at the same time (there is no limit to the number of loops), but please note that the device numbers (s3) and (d) used in the calculation cannot be repeated.
147
148 The instruction occupies 52 points of devices starting from the device specified in (s3).
149
150 During the execution of auto-tuning, the (s3) parameter space cannot be modified.
151
152 **Error code**
153
Iris 2.8 154
Iris 2.2 155 |**Error code**|**Content**
156 |4085H|When the device specified in the read application instructions (s1), (s2), (s3), (d) exceeds the range of the corresponding device.
157 |4086H|When the device specified in the write application instruction (s3) and (d) exceeds the range of the corresponding device.
Iris 2.3 158 |4D80H|The sampling time is out of range.​(T,,S,,≤0)
Iris 2.8 159 |4D81H|Input filter constant (α) is out of range (α​<0 or α>1023)
Iris 4.1 160 |4D82H|The maximum ascent rate (△//T//) is out of range.(△//T//​<0 or △//T//​>1023)
Iris 4.2 161 |4D86H|The sampling time (Ts) is less than the operation cycle.​​​​(T//s//<Scanning cycle)
Iris 4.3 162 |4D87H|The proportional gain (K//p//) is out of range.​​​​(K//p//<1 or K//p//>32000)
Iris 2.8 163 |4D88H|The integral time constant (Ti) is out of range.(K//i​//<0 or K//i//>3600)
164 |4D89H|The differential time constant (T//d//) is out of range.(K//d//<0 or K//d//>1000)
165 |4D90H|The upper limit of CCPID output is less than the lower limit.
Iris 2.2 166
Iris 2.8 167 **Example**
Iris 2.2 168
Iris 2.8 169 See "CCPID Instruction Manual".
170
171 == **FPID/FPID calculation** ==
172
Iris 2.3 173 **FPID**
Iris 2.2 174
175 The function of this instruction is to adjust PID control parameters by fuzzy algorithm.
176
177 -[FPID (s) (d1) (d2) (d3)]
178
179 **Content, range and data type**
180
181 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
182 |(s)|Store the start number of the device of the fuzzy parameter table (no input required)|-|Signed BIN 16 bit|ANY16
183 |(d1)|Start number of the device storing the initialization parameters|-|Signed BIN 16 bit|ANY16
184 |(d2)|Store the start number of the device of the input PID parameter|-|Signed BIN 16 bit|ANY16
185 |(d3)|The start number of the device that stores the adjusted PID parameters|-|Signed BIN 16 bit|ANY16
186
187 **Device used**
188
Iris 2.3 189 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="4" %)**Soft component**|**Offset modification**|(((
190 **Pulse extension**
Iris 2.2 191 )))
Iris 2.3 192 |**D**|**R**|**SD**|**LC**|**[D]**|**XXP**
193 |(% rowspan="4" %)FPID|Parameter 1|●|●|●|●| |
194 |Parameter 2|●|●|●|●| |
195 |Parameter 3|●|●|●|●| |
196 |Parameter 4|●|●|●|●| |
Iris 2.2 197
198 **Features**
199
200 This instruction needs to be used in conjunction with the PID instruction. It completes the fuzzy calculation of the adjustments of the three parameters of PID, Kp, Ki, and Kd. By passing in the three parameters of the PID, the new three parameters are calculated and substituted into the PID for output control.
201
202 **Parameter Description:**
203
204 |(% colspan="6" %)**S parameter setting**
205 |**Parameter**|**Offset address**|**Name**|**Format**|**Instruction**|**Range**
206 |Parameter 1|S|-|-|-|-
207
208 |(% colspan="6" %)**d1 parameter setting**
209 |**Parameter**|**Offset address**|**Name**|**Format**|**Instruction**|**Range**
210 |(% rowspan="2" %)Parameter 1|d1|(% rowspan="2" %)em domain|(% rowspan="2" %)Floating point|(% rowspan="2" %)Temperature difference|(% rowspan="2" %)>0
211 |d1+1
212 |(% rowspan="2" %)Parameter 2|d1+2|(% rowspan="2" %)ecm domain|(% rowspan="2" %)Floating point|(% rowspan="2" %)Temperature difference|(% rowspan="2" %)>0
213 |d1+3
214 |(% rowspan="2" %)Parameter 3|d1+4|(% rowspan="2" %)kpm coefficient|(% rowspan="2" %)Floating point|(% rowspan="2" %)0.5 (fixed) (not set)|(% rowspan="2" %)-
215 |d1+5
216 |(% rowspan="2" %)Parameter 4|d1+6|(% rowspan="2" %)kim coefficient|(% rowspan="2" %)Floating point|(% rowspan="2" %)1 (fixed) (not set)|(% rowspan="2" %)-
217 |d1+7
218 |(% rowspan="2" %)Parameter 5|d1+8|(% rowspan="2" %)kdm coefficient|(% rowspan="2" %)Floating point|(% rowspan="2" %)1 (fixed) (not set)|(% rowspan="2" %)-
219 |d1+9
220 |(% rowspan="2" %)Parameter 6|d1+10|(% rowspan="2" %)EM|(% rowspan="2" %)32-bit integer|(% rowspan="2" %)6 (fixed) (not set)|(% rowspan="2" %)-
221 |d1+11
222 |(% rowspan="2" %)Parameter 7|d1+12|(% rowspan="2" %)ECM|(% rowspan="2" %)32-bit integer|(% rowspan="2" %)6 (fixed) (not set)|(% rowspan="2" %)-
223 |d1+13
224 |(% rowspan="2" %)Parameter 8|d1+14|(% rowspan="2" %)UM|(% rowspan="2" %)32-bit integer|(% rowspan="2" %)6 (fixed) (not set)|(% rowspan="2" %)-
225 |d1+15
226 |(% rowspan="2" %)Parameter 9|d1+16|(% rowspan="2" %)Size_x|(% rowspan="2" %)32-bit integer|(% rowspan="2" %)13 (fixed) (not set)|(% rowspan="2" %)-
227 |d1+17
228 |(% rowspan="2" %)Parameter 10|d1+18|(% rowspan="2" %)Size_y|(% rowspan="2" %)32-bit integer|(% rowspan="2" %)13 (fixed) (not set)|(% rowspan="2" %)-
229 |d1+19
230 |Parameter 11|d1+20|Kpm reserved for internal use|Reserved|Reserved|-
231 |Parameter 12|d1+21|Kim reserved for internal use|Reserved|Reserved|-
232 |Parameter 13|d1+22|Kdm reserved for internal use|Reserved|Reserved|-
233 |Parameter 14|d1+23|Kukp reserved for internal use|Reserved|Reserved|-
234 |Parameter 15|d1+24|Kuki reserved for internal use|Reserved|Reserved|-
235 |Parameter 16|d1+25|Kukd reserved for internal use|Reserved|Reserved|-
236 |︙|︙|︙|︙|Reserved|-
237 |Parameter 20|d1+37|Reserved for internal use|Reserved|Reserved|-
238
239 |(% colspan="6" %)**d2 parameter setting**
240 |**Parameter**|**Offset address**|**Name**|**Format**|**Instruction**|**Range**
241 |Parameter 1|d2|Current Temperature|16-bit integer|Current test temperature|-
242 |Parameter 2|d2+1|set temperature|16-bit integer|Set temperature|-
243 |Parameter 3|d2+2|Calculation period|16-bit integer|Take an integer multiple of the pid sampling time, usually the same|-
244 |Parameter 4|d2+3|Kp|16-bit integer|PID initial Kp value|-
245 |Parameter 5|d2+4|KI|16-bit integer|PID initial Ki value|-
246 |Parameter 6|d2+5|KD|16-bit integer|PID initial Kd value|-
247 |Parameter 7|d2+6|Sampling cycle|16-bit integer|No need to enter|-
248 |Parameter 8|d2+7|Initialization flag|16-bit integer|Reserved for internal use|-
249 |(% rowspan="2" %)Parameter 9|d2+8|(% rowspan="2" %)Last calculation time|(% rowspan="2" %)32-bit integer|(% rowspan="2" %)View usage (not operable)|(% rowspan="2" %)-
250 |d2+9
251 |Parameter 10|d2+10|Last temperature|16-bit integer|View usage (not operable)|-
252 |Parameter 11|d2+11|Reserved|16-bit integer|Reserved|
253 |(% colspan="6" %)**d3 parameter setting**
254 |**Parameter**|**Offset address**|**Name**|**format**|**Instruction**|**Range**
255 |Parameter 1|d3|Current Temperature|16-bit integer|Current test temperature|-
256 |Parameter 2|d3+1|set temperature|16-bit integer|Set temperature|-
257 |Parameter 3|d3+2|Calculation period|16-bit integer|Take an integer multiple of the pid sampling time, usually the same|-
258 |Parameter 4|d3+3|Kp|16-bit integer|Kp value of PID after adjustment|-
259 |Parameter 5|d3+4|KI|16-bit integer|Ki value of PID after adjustment|-
260 |Parameter 6|d3+5|KD|16-bit integer|Kd value of PID after adjustment|-
261 |Parameter 7|d3+6|Sampling cycle|16-bit integer|No need to enter|-
262 |Parameter 8|d3+7|Reserved|16-bit integer|Reserved|-
263
264 **✎Note:**
265
266 The instruction starts from the device specified in (d1) and occupies 38 points of the device, and initializes the parameters. Normally, it only needs to be initialized once before calling (some parameters are fixed) (occupies 38 words space).
267
268 The instruction starts with the device specified in (d2) and occupies 12 points of the device, input parameters, and input the first 6 parameters, where Kp, Ki, Kd are the initial values of the PID control parameters (occupies 12 words space) .
269
270 The instruction starts from the device specified in (d3) and occupies 8 points of soft elements and output parameters, among which Kp, Ki, Kd are the parameter values after fuzzy adaptive calculation, which can be input to the designated position of PID (occupy 8 words space).
271
272 The FPID instruction occupies 58 words. The address of each operand must have a specified interval interval, which cannot be occupied by other instructions.
273
274 **Error code**
275
276 |**Error code**|**Content**
277 |4085H|When the device specified in the read application instructions (d1), (d2), (d3) exceeds the range of the corresponding device.
278 |4086H|When the device specified in the write application instructions (d1), (d2), (d3) exceeds the range of the corresponding device.
279 |4D91H|FPID calculation cycle is less than or equal to 0
280 |4D92H|FPID parameter range error
281 |4D93H|FPID initial flag error
282
283 **Example**
284
285 ~1. Parameter d1
286
Iris 2.3 287 (% style="text-align:center" %)
288 [[image:11_html_93e9f66475d6eb0c.png||class="img-thumbnail"]]
Iris 2.2 289
290 2. Parameter d2
291
Iris 2.3 292 (% style="text-align:center" %)
293 [[image:11_html_548b859bc5568099.png||class="img-thumbnail"]]
Iris 2.2 294
295 3. Invoke FPID
296
Iris 2.3 297 (% style="text-align:center" %)
298 [[image:11_html_599ccfa817c379fd.png||class="img-thumbnail"]]
Iris 2.2 299
Iris 2.3 300 == **CCPID instruction introduction manual** ==
Iris 2.2 301
Iris 2.3 302 **Background and purpose**
Iris 2.2 303
Iris 2.3 304 (1) Background:
Iris 2.2 305
306 PID (proportion, integral, derivative) controller has been the earliest practical controller for nearly a hundred years, and it is still the most widely used industrial controller. The PID controller is simple and easy to understand, and does not require precise system models and other prerequisites in use, making it the most widely used controller.
307
Iris 2.3 308 (2) Purpose:
Iris 2.2 309
Iris 2.3 310 You might not be familiar with the parameter settings in the new series of CCPID for the first time, this manual could let you quickly understand the meaning of each parameter in the CCPID and the influence on the control effect, so that you can quickly learn the CCPID.
Iris 2.2 311
Iris 2.3 312 **Description of the host CCPID instruction**
Iris 2.2 313
314 **Instruction description**
315
316 **Content, range and data type**
317
318 |**Name**|**Features**|**Bits (bits)**|**Whether pulse type**|**Instruction format**|**Step count**
Iris 5.2 319 |CCPID|PID Operation|16|No|CCPID [[image:11_html_253eb1176b58e989.png||height="23" width="44"]] [[image:11_html_80fccb1046bf8776.png||height="25" width="44"]] [[image:11_html_8760537828f7beaf.png||height="26" width="49"]] [[image:11_html_8b4fbd61f8ea9808.png||height="27" width="51"]]|9
Iris 2.2 320
Iris 2.3 321 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="3" %)**Devices**|**Offset modification**|**Pulse extension**
322 |**D**|**R**|**SD**|**[D]**|**XXP**
323 |(% rowspan="4" %)CCPID|Parameter 1|●|●|●| |
324 |Parameter 2|●|●|●| |
325 |Parameter 3|●|●|●| |
326 |Parameter 4|●|●|●| |
Iris 2.2 327
328 **Device used**
329
Iris 2.4 330 [[image:11_html_954290ac172c672b.jpg]] is the target value (SV) of PID control;
Iris 2.2 331
Iris 2.4 332 [[image:11_html_31f47ac5eec30067.jpg]] is the measured feedback value (PV);
Iris 2.2 333
Iris 2.4 334 [[image:11_html_6dcdd8fc88703a47.jpg]] is the start address of the buffer area for setting parameters required for PID operation and saving intermediate results, occupying a total of 52 variable units of subsequent addresses (recommended to reserve 100 continuous spaces).The value range is D0 to D7,948, it is better to specify power failure retention, and the setting value remains after power supply is off. Otherwise,the buffer needs to be assigned value before starting the calculation for the first time. The function and parameter description of each unit are described in this section;
Iris 2.2 335
Iris 2.4 336 [[image:11_html_7e06d96423d5de52.jpg]] is the storage unit (MV) of the PID calculation result. Please specify it as a non-battery retentive area, otherwise it needs to be initialized and cleared before the first start of calculation.
Iris 2.2 337
Iris 2.3 338 (% style="text-align:center" %)
339 [[image:11_html_8eeef07485b91193.jpg||class="img-thumbnail"]]
Iris 2.2 340
Iris 2.3 341 **Programming example**
Iris 2.2 342
343 The parameter description is as follows:
344
Iris 2.3 345 In D9, the target value of PID adjustment is stored, and D10 is the closed-loop feedback value. Note that D9 and D10 must be of the same dimension, such as both 0.01MPa units, or 1℃ units, etc.;
Iris 2.2 346
Iris 2.3 347 A total of 52 units of D200 to D251 are used to store the set value and process value of PID operation. These values must be set item by item before the first PID calculation;
Iris 2.2 348
349 D130 unit is used to store the calculated control output value to control the execution of the action.
350
Iris 2.4 351 The functions and setting methods of the parameter values of each unit used by [[image:11_html_6dcdd8fc88703a47.jpg]] are described in the following table:
Iris 2.2 352
Iris 2.4 353 [[image:11_html_6dcdd8fc88703a47.jpg]] to [[image:11_html_6dcdd8fc88703a47.jpg]] +14 is the parameter range that can be set (parameters set when CCPID is executed).
Iris 2.2 354
Iris 2.4 355 [[image:11_html_6dcdd8fc88703a47.jpg]] +15 to [[image:11_html_6dcdd8fc88703a47.jpg]] +21 is the space used internally by CCPID control.
Iris 2.2 356
Iris 2.4 357 [[image:11_html_6dcdd8fc88703a47.jpg]] +22 to [[image:11_html_6dcdd8fc88703a47.jpg]] +51 is the parameter space used in the auto-tuning process.
Iris 2.2 358
359 |**Unit**|**Features**|**Setting instructions**|**Supplement**
Iris 3.1 360 |[[image:11_html_6dcdd8fc88703a47.jpg]]|Sample time (TS)|The set range is 1 to 32,767 (ms), but greater than PLC program scan cycle.|It is how often the instruction calculates and updates the output value (MV). When TS is less than one scan time, PID instruction is executed with one scan time and alarm 4D86H. When TS ≤ 0, alarm 4D80H and no execution.
Iris 4.2 361 |[[image:11_html_6dcdd8fc88703a47.jpg]]+1|Action direction (ACT)|(((
Iris 2.3 362 bit0: 0=positive action; 1=reverse action bit2: auto-tuning transition zone switch. 0=not open;1=open
Iris 2.2 363
364 bit3: 0=unidirection; 1=bidirection
365
Iris 2.3 366 Bit4: 0=auto-tuning does not execute; 1=execute auto-tuning
Iris 2.2 367
Iris 2.3 368 [Bit6:0=Two-stage auto-tuning does not execute. 1=Execute two-stage auto-tuning (bit4 must be set to 1).
Iris 2.2 369
Iris 2.3 370 bit7: 0=Three-stage auto-tuning does not execute. 1=Execute three-stage auto-tuning (bit4 must be set to 1 )]
Iris 2.2 371
372 The Others cannot be used.
373 )))|(((
Iris 2.3 374 bit0: Positive action: similar heating system, when the temperature is lower than the set value, increases the output ; Reverse action: similar cooling system, when the temperature is greater than the set value, increases the output.
Iris 2.2 375
Iris 2.3 376 bit2: Self-tuning transition zone switch. There is a transition zone size of 1.5℃ when opened.
Iris 2.2 377
Iris 2.3 378 bit3: Bidirection indicates that outputs the positive and negative values to the heating system or the cooling system to control two external systems by one PID.
Iris 2.2 379
Iris 2.3 380 bit4: **✎**When bit4=1 and bit6 and bit7 are not 1, auto-tuning is not executed. **✎**When bit4=0 and one of bit6 and bit7 is 1, auto-tuning is not executed. **✎**When bit4=1 and bit6 and bit7 are both 1, auto-tuning is executed
Iris 2.2 381 )))
Iris 4.2 382 |[[image:11_html_6dcdd8fc88703a47.jpg]]+2|Filter coefficient|The first-order inertia filter of feedback amount (0 to 100%) has a range of 0 to100|When the value is greater than or equal to 100, it will be executed as 0, that is, no filtering will be executed;
383 |[[image:11_html_6dcdd8fc88703a47.jpg]]+3|Proportional gain(Kp)|Set range: 0 to 30,000[%]|Overrun error 4D87H
384 |[[image:11_html_6dcdd8fc88703a47.jpg]]+4|Integration time (Ti)|Ti is integration time, and the range is 0 to 3,600 (s)|Overrun error 4D88H
385 |[[image:11_html_6dcdd8fc88703a47.jpg]]+5|Differential time (Td)|Td is derivative time, and the range is 0 to 1,000 (s)|Overrun error 4D89H
386 |[[image:11_html_6dcdd8fc88703a47.jpg]]+6|Working interval|Operating temperature setting enabled by PID (0 indicates no effect) The range is 0 to 1,000|It is recommended to be greater than 5°C, that is, 50 (precision 0.1°C). If it exceeds the range, the boundary value will be taken.
387 |[[image:11_html_6dcdd8fc88703a47.jpg]]+7|Output low limit|(((
Iris 2.3 388 Range: -10,000 to 10,000.
Iris 2.2 389
Iris 2.3 390 Recommended setting range: -2,000 or 0 (when S3+1 bit3=0, the lower limit = 0;
Iris 2.2 391
Iris 2.3 392 when bit3=1, the lower limit = -2,000)
Iris 2.2 393 )))|(((
394 ~1. Self-tuning initialization:
395
Iris 2.3 396 ① Unidirection control: the lower limit is 0;
Iris 2.2 397
Iris 2.3 398 ② Bidirection control: If the lower limit is greater than 0, adjust the lower limit to 0; if the upper limit and the lower limit are equal to 0, the default lower limit is -2,000. **✎**Note: If set to -2,000, and the output value (MV) is less than -2,000, it will output -2,000.
Iris 2.2 399
Iris 2.3 400 2. During the control process, the lower limit is dynamically adjustable. If the lower limit is greater than or equal to the upper limit, error 4D90H will be reported.
Iris 2.2 401 )))
Iris 4.2 402 |[[image:11_html_6dcdd8fc88703a47.jpg]]+8|Output upper limit|(((
Iris 2.3 403 Value range: -10,000 to 10,000.
Iris 2.2 404
405 Recommended setting value is 2,000
406 )))|(((
407 ~1. Self-tuning initialization:
408
Iris 2.3 409 ① Unidirection control: If the upper limit is less than 0, the default upper limit is 2,000;
Iris 2.2 410
Iris 2.3 411 ② Bidirection control: If the upper limit is less than 0, adjust the upper limit to 0; if the upper limit and the lower limit are equal to 0, the default upper limit is -2,000. **✎**Note: If set to -2,000 and the output value (MV) is greater than -2,000, it will output 2,000.
Iris 2.2 412
Iris 2.3 413 2. During the control process, the upper limit is dynamically adjustable. If the lower limit is greater than or equal to the upper limit, error 4D90H will be reported.
Iris 2.2 414 )))
Iris 4.2 415 |[[image:11_html_6dcdd8fc88703a47.jpg]]+9|Mode setting|(((
Iris 2.3 416 0: Overshoot allowed
Iris 2.2 417
Iris 2.3 418 1: Slight overshoot or no overshoot
Iris 2.2 419
420 2: Dynamic setting
421 )))|(((
Iris 2.3 422 0:Overshoot allowed (ukd = 100)
Iris 2.2 423
Iris 2.3 424 1: Slight overshoot or no overshoot mode (ukd = 300)
Iris 2.2 425 )))
Iris 4.2 426 |[[image:11_html_6dcdd8fc88703a47.jpg]]+10|(((
Iris 2.2 427 Scale factor
428
429 (ukp)
Iris 2.3 430 )))|Typically sets value to 100 (default 100) [enabled when S3+9 is set to 2].The range is 1 to 500.|When the value is less than or equal to 0, or greater than 500, the boundary value will be taken.
Iris 4.2 431 |[[image:11_html_6dcdd8fc88703a47.jpg]]+11|Integral coefficient (uki)|Typically sets value to 50 (default 50) [enabled when S3+9 is set to 2]. The range is 1 to 300.|When the value is less than or equal to 0, or greater than 300, the boundary value will be taken.
432 |[[image:11_html_6dcdd8fc88703a47.jpg]]+12|Differential coefficient (ukd)|Typically sets value to 50 (default 100. 300 to 400 can be set when slight overshoot is required) [Enable when S3+9 is set to 2]. The range is 1 to 500.|When the value is less than or equal to 0, or greater than 500, the boundary value will be taken.
433 |[[image:11_html_6dcdd8fc88703a47.jpg]]+13|Maximum ascent rate (DeltaT)|The range is 0 to 32,000, which is the threshold of integral increment|Overrun error 4D82H
434 |[[image:11_html_6dcdd8fc88703a47.jpg]]+14|Filtering (C0)|The range is 0 to 1,023, integral part filtering|Overrun error 4D81H
435 |[[image:11_html_6dcdd8fc88703a47.jpg]]+15|(% rowspan="3" %)reserved for internal control|(% rowspan="3" %)Internal control space occupation|(% rowspan="3" %)
Iris 2.2 436 |┆
Iris 4.2 437 |[[image:11_html_6dcdd8fc88703a47.jpg]]+21
438 |[[image:11_html_6dcdd8fc88703a47.jpg]]+22|(% rowspan="3" %)used space for self-tuning|(% rowspan="3" %)New self-tuning space for internal use|(% rowspan="3" %)
Iris 2.2 439 |┆
Iris 4.2 440 |[[image:11_html_6dcdd8fc88703a47.jpg]]+51
Iris 2.2 441
Iris 2.3 442 1) The auto-tuning process occupies the space of S3+22 to S3+51. When the auto-tuning is successful, the adjusted parameters will be written into the space of S3+2 to S3+21.
Iris 2.2 443
Iris 4.2 444 2)[[image:11_html_6dcdd8fc88703a47.jpg]] +2 filter coefficient α: Processing in first-order inertial filter
Iris 2.2 445
446 Formula: **T,,now,,=(100-α)×T,,α,,+α×T,,old,,**
447
Iris 2.3 448 T,,α ,,is the currently measured temperature. T,,old ,,is the temperature that participated in the PID calculation last time. T,,now ,,is the temperature used for the current PID calculation. α is the filter coefficient (when α=0, no filtering is performed, and the range of α is 0 to 100.(If there is a temperature with a small overshoot but a long stabilization time, the parameter can be set to 80, and analyze the specific problems in detail)
Iris 2.2 449
Iris 4.2 450 3)[[image:11_html_6dcdd8fc88703a47.jpg]] +6 work range: Twork(example: 170 represents 17℃)
Iris 2.2 451
Iris 2.3 452 (% style="text-align:center" %)
Iris 2.8 453 [[image:企业微信截图_17581105436817.png||height="197" width="652"]]
Iris 2.2 454
Iris 4.2 455 4) [[image:11_html_6dcdd8fc88703a47.jpg]]+9 working mode:
Iris 2.2 456
457 0: Working mode that allows overshoot
458
Iris 2.3 459 1: Slight overshoot or no overshoot working mode
Iris 2.2 460
Iris 2.8 461 2: Custom settings; to achieve by setting [[image:1758111151287-920.png||height="15" width="28"]]+10, [[image:1758111151287-920.png||height="15" width="28"]]+11, [[image:1758111151287-920.png||height="15" width="28"]]+12 three coefficients.
Iris 2.2 462
Iris 4.2 463 5)[[image:11_html_6dcdd8fc88703a47.jpg]] +1 bit2 self-tuning transition zone switch: (upper limit 1℃, low limit 0.5℃)
Iris 2.2 464
Iris 2.3 465 The transition zone description in forward control:
Iris 2.2 466
Iris 2.3 467 (% style="text-align:center" %)
468 [[image:11_html_d90c24627566bf2f.gif||class="img-thumbnail"]]
Iris 2.2 469
Iris 2.3 470 In the heating process, when PV≤SV+1℃, 100% power output; when PV>SV+1℃, no output.
Iris 2.2 471
Iris 2.3 472 In the cooling process, when PV<SV-0.5℃, 100% power output; When PV≥SV-0.5℃, no output.
Iris 2.2 473
Iris 2.3 474 The transition zone description in reverse control:
Iris 2.2 475
Iris 2.3 476 (% style="text-align:center" %)
477 [[image:11_html_d3c25044a54c62ce.gif||class="img-thumbnail"]]
Iris 2.2 478
Iris 2.3 479 In the cooling process, when PV≥SV-1℃, 100% power output; when PV<SV-1℃, no output.
Iris 2.2 480
Iris 2.3 481 In the heating process, when PV>SV+0.5℃, 100% power output; When PV≤SV+0.5℃, no output.
Iris 2.2 482
Iris 2.3 483 The transition zone description in bidirectional control:
Iris 2.2 484
Iris 2.3 485 (% style="text-align:center" %)
486 [[image:11_html_9eb35607c95b1580.gif||class="img-thumbnail"]]
Iris 2.2 487
488 In the heating process, when PV≤SV+1℃, 100% power heating output; when PV>SV+1℃, 100% power cooling output.
489
490 In the cooling process, when PV<SV-0.5℃, 100% power heating output. When PV≥SV-0.5℃, 100% power cooling output
491
Iris 2.3 492 **Programming case**
Iris 2.2 493
494 **CCPID application configuration**
495
Iris 2.3 496 (1) Parameter setting
Iris 2.2 497
Iris 2.3 498 (% style="text-align:center" %)
499 [[image:11_html_36a152ee534a7f24.png||class="img-thumbnail"]]
Iris 2.2 500
Iris 2.3 501 (2) CCPID control process setting
Iris 2.2 502
Iris 2.3 503 (% style="text-align:center" %)
504 [[image:11_html_51d50fa8b154baca.png||class="img-thumbnail"]]
Iris 2.2 505
Iris 2.3 506 (% style="text-align:center" %)
507 [[image:11_html_66c8a636f6176c1f.png||class="img-thumbnail"]]
Iris 2.2 508
Iris 2.3 509 (3) Bidirection control
Iris 2.2 510
Iris 2.3 511 (% style="text-align:center" %)
512 [[image:11_html_234093eac2fe184d.png||class="img-thumbnail"]]
Iris 2.2 513
514 **✎Note:**
515
Iris 2.3 516 ~1. CCPID is a special instruction for operation control. CCPID operation will be executed only after the sample time is reached.
Iris 2.2 517
518 2. There is no limit to the number of times the CCPID instruction can be used, but+51 cannot be repeated.
519
520 3. Before CCPID instruction is executed, CCPID parameters need to be set.
521
522 **Case analysis**
523
Iris 2.3 524 **(1) Control requirements**
Iris 2.2 525
526 The control environment of this example is a kettle. The configuration is controlled by PLC-5V2416 host with 4PT module, and PI8070 screen is used for data storage and process curve viewing.
527
Iris 2.3 528 **(2) Sample program**
Iris 2.2 529
Iris 2.3 530 (% style="text-align:center" %)
531 [[image:11_html_f0a22955a8da7129.png||class="img-thumbnail"]]
Iris 2.2 532
Iris 2.3 533 (% style="text-align:center" %)
534 [[image:11_html_ad08c65bd672c66e.png||class="img-thumbnail"]]
Iris 2.2 535
Iris 2.3 536 **(3) Parameter description**
Iris 2.2 537
538 |**PLC device**|**Control instructions**
539 |M0|Set auto tuning
540 |M1|CCPID instruction calculation start
541 |M2|CCPID operating status
542 |Y0|Pulse output with adjustable pulse width
543 |D0|Temperature measured value
Iris 2.3 544 |D1|Temperature setting value
545 |D100|sample time
Iris 2.2 546 |D101|Control detail settings
547 |D102|First-order inertial filter coefficient
548 |D106|Working interval
Iris 2.8 549 |D109|Working mode
Iris 2.2 550
Iris 2.3 551 **(4) Parameter control effect description**
Iris 2.2 552
Iris 2.3 553 1) Boiling water experiment
Iris 2.2 554
Iris 2.3 555 ① Auto-tuning process and control process (no transition zone setting), take two-stage auto-tuning as an example
Iris 2.2 556
Iris 2.3 557 (% style="text-align:center" %)
558 [[image:11_html_9149b1e837158a17.gif||class="img-thumbnail"]]
Iris 2.2 559
560 Figure 1 Auto-tuning process curve without transition zone
561
562 When the control system is a single temperature control system or a system where environmental interference does not cause large fluctuations. Generally the automatic tuning without transition zone is selected, so that the self-tuning process can be completed more quickly than the method with transition zone.
563
Iris 2.3 564 ②Self-tuning process and control process (transition zone setting)
Iris 2.2 565
Iris 2.3 566 (% style="text-align:center" %)
567 [[image:11_html_a1e8ad7a31bb04af.gif||class="img-thumbnail"]]
Iris 2.2 568
569 Figure 2 Self-tuning process curve with transition zone
570
Iris 2.3 571 It is more suitable in a two-way control system with transition zone self-tuning process. The transition zone has a range of 1.5°C. The upper limit is 1°C, and the lower limit is 0.5°C.
Iris 2.2 572
Iris 2.3 573 2) Difference in working interval setting
Iris 2.2 574
Iris 2.3 575 (% style="text-align:center" %)
576 [[image:11_html_4140432ce11883ad.gif||class="img-thumbnail"]]
Iris 2.2 577
578 Figure 3 Process curve under different working interval parameters
579
Iris 2.3 580 (% style="text-align:center" %)
581 [[image:11_html_f742d80c8cc95f35.gif||class="img-thumbnail"]]
Iris 2.2 582
583 Figure 4 Process curve without different working interval parameters (heating process diagram)
584
585 It can be seen from the partially enlarged graph that the parameters of the working interval have a certain influence on the overshoot and the stable time. In the case of allowing overshoot, setting the working interval parameters can make the overshoot smaller. This is because the deviation E of PID starting to work is relatively small, and the integration accumulation will not quickly saturate.
586
Iris 2.3 587 3) Result of filter coefficient setting
Iris 2.2 588
Iris 2.3 589 (% style="text-align:center" %)
590 [[image:11_html_815ec6c129ae3891.gif||class="img-thumbnail"]]
Iris 2.2 591
592 Figure 5 Process curve under different filtering parameters
593
Iris 2.3 594 The figure above is the experimental result under the small overshoot coefficient, the sample time is 1s. The coefficients of the first-order inertial filtering are (20, 50, 70, 80, 90). After adding the inertia coefficient, the stability time of system control is greatly accelerated, and it is increased by about 6 minutes for the boiling water experiment. The overshoot is about 1.2°C to 1.7°C.
Iris 2.2 595
Iris 2.3 596 Therefore, the introduction of first-order inertial filtering could greatly improve the PID environment where the temperature fluctuates to a certain extent and increase stabilization time.
Iris 2.2 597
Iris 2.3 598 **✎Note: **This parameter of filter coefficient is helpful for systems with not very large hysteresis or the control effect of the phenomenon that the control amount fluctuates back and forth has been greatly improved.
Iris 2.2 599
Iris 2.3 600 4) The difference in mode selection
Iris 2.2 601
602 0: Overshoot allowed(ukd = 100)
603
604 1: Small overshoot or no overshoot (ukd = 300)
605
Iris 2.3 606 (% style="text-align:center" %)
607 [[image:11_html_3a7b42c8f4672ce4.gif||class="img-thumbnail"]]
Iris 2.2 608
609 Figure 6 Process curves in different working modes
610
Iris 2.3 611 When selecting mode 1 (small overshoot or no overshoot), the stable temperature may be slightly higher than the set temperature (fluctuates above the set temperature).
Iris 2.2 612
Iris 2.3 613 5) The function of the coefficient
Iris 2.2 614
Iris 2.3 615 (% style="text-align:center" %)
616 [[image:11_html_74a7527eace55103.gif||class="img-thumbnail"]]
Iris 2.2 617
Iris 4.4 618 == ** CCPIN_SHT operation** ==
Iris 2.2 619
Iris 4.4 620 **CCPIN_SHT**
Iris 4.3 621
622 This instruction is used to perform PID control that changes the output value according to the variation of the input.
623
624 -[CCPID_SHT (s1) (s2)  (s3) (d)]
625
626 **Content, range and data type**
627
628 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
629 |(s1)|The device number that stores the target value (SV)|-32767 to 32767|Signed BIN 16 bit|ANY16
630 |(s2)|The device number that stores the measured value (SV)|-32767 to 32767|Signed BIN 16 bit|ANY16
631 |(s3)|The device number that stores parameters|1 to 32767|Signed BIN 16 bit|ANY16
632 |(d)|The device number that stores the output value (SV)|-32767 to 32767|Signed BIN 16 bit|ANY16
633
634 **Device used**
635
Iris 4.4 636 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="3" %)**Devices**|(((
Iris 4.3 637 **Offset**
638
639 **modification**
640 )))|(((
641 **Pulse**
642
643 **extension**
644 )))
Iris 4.4 645 |**D**|**R**|**SD**|**[D]**|**XXP**
646 |(% rowspan="4" %)CCPID_SHT|Parameter 1|●|●|●| |
647 |Parameter 2|●|●|●| |
648 |Parameter 3|●|●|●| |
649 |Parameter 4|●|●|●| |
Iris 4.3 650
651 **Features**
652
653 This instruction is to complete the temperature control operation, used to control the parameters of the closed-loop control system.
654
Iris 4.4 655 [[image:1758113204827-229.png]] is the target value of CCPID SHT control (SV).
Iris 4.3 656
Iris 4.4 657 [[image:1758113217569-229.png]] is the measured feedback value (PV).
Iris 4.3 658
Iris 4.4 659 [[image:1758113227549-844.png]] is the start address of the cache where the parameters required by CCPID_SHT operation and intermediate results are saved,
Iris 4.3 660
661 occupying a total of 36 variable units of subsequent addresses. The value range is from D0 to D7946 or from R0 to R29964. It is better to specify power failure retention, and the setting value remains after power supply is off. Otherwise, the cache needs to be assigned value before starting the calculation for the first time. The function and parameter description of each unit are described in this section.
662
Iris 4.4 663 [[image:1758113243743-809.png]] is the storage unit of the CCPID_SHT calculation result. Please specify it as a non-battery retentive area, otherwise it needs to be initialized and cleared before the first start of calculation.
Iris 4.3 664
665 **Programming example**
666
Iris 4.4 667 [[image:1758113269397-376.png]]
Iris 4.3 668
Iris 4.4 669
Iris 4.3 670 The parameter description is as follows:
671
672 The target value of CCPID_SHT adjustment is stored in D1, and D0 is the closed-loop feedback value. Note that D0 and D9 must be of the same dimension, such as both 0.01MPa units, or 1℃ units, etc..
673
674 A total of 36 units of D1000 to D1035 are used to store the set value and process value of CCPID_SHT operation. These values must be set item by item before the first CCPID_SHT calculation.
675
676 D100 unit is used to store the calculated control output value to control the execution of the action.
677
Iris 4.4 678 [[image:1758113227549-844.png]]The functions and setting methods of the parameter values of each unit at the beginning are described in the table below:
Iris 4.3 679
Iris 4.4 680 [[image:1758113227549-844.png]]to[[image:1758113227549-844.png]] +15 is the parameter range that can be set (parameters set when CCPID_SHT is executed).
Iris 4.3 681
Iris 4.4 682 [[image:1758113227549-844.png]]+2 to [[image:1758113227549-844.png]]+31 is the parameter space used in the self-tuning process. (This space is multiplexed with the parameter space during control)
Iris 4.3 683
684
Iris 4.4 685 The functions and setting methods of the parameter values of each unit started by are described in the following table:
Iris 4.3 686
Iris 4.4 687 |(% style="width:106px" %)**Unit**|(% style="width:146px" %)**Function**|**Description**
688 |(% style="width:106px" %)[[image:1758113227549-844.png]]|(% style="width:146px" %)Sampling time (TS)|Range: 1 to 32767 (ms). It must be longer than PLC program scan cycle.
689 |(% style="width:106px" %)[[image:1758113227549-844.png]]+1|(% style="width:146px" %)Control flag bit|(((
Iris 4.3 690 bit0: 0=Forward action; 1=Reverse action
691
692 bit3: 0=one-way; 1=two-way
693
694 bit4: 0=Self-tuning does not act; 1=Perform self-tuning and the others are not available.
695
696 bit6: 0=Two-segment self-tuning does not act; 1=Perform two-segment self-tuning (bit4 must set to 1)
697
698 bit7: 0=Three-segment self-tuning does not act; 1=Perform three-segment self-tuning (bit4 must set to 1)
699
700 Bit15: The instruction initialization flag bit. When initialization is complete, it is set to 1.
701 )))
Iris 4.4 702 |(% style="width:106px" %)[[image:1758113227549-844.png]]+2|(% style="width:146px" %)Maximum rate of increase (DeltaT)|Range: 0 to 32000. Threshold of integral increment
703 |(% style="width:106px" %)[[image:1758113227549-844.png]]+3|(% style="width:146px" %)Proportional gain (Kp)|Range: 0 to 32767. This value is magnified 256 times and the actual value is Kp/256.
704 |(% style="width:106px" %)[[image:1758113227549-844.png]]+4|(% style="width:146px" %)Integral gain (Ki)|Range: 0 to 32767, Ki=16384Ts/Ti,Ti is integral time
705 |(% style="width:106px" %)[[image:1758113227549-844.png]]+5|(% style="width:146px" %)Differential gain (Kd)|Range: 0 to 32767, Kd≈Td/Ts, Td is differential time
706 |(% style="width:106px" %)[[image:1758113227549-844.png]]+6|(% style="width:146px" %)Filter constant (Co)|Range: 0 to 1023, Integral partial filtering.
707 |(% style="width:106px" %)[[image:1758113227549-844.png]]+7|(% style="width:146px" %)Output lower limit|Recommended setting range: -2000 to 2000
708 |(% style="width:106px" %)[[image:1758113227549-844.png]]+8|(% style="width:146px" %)Output upper limit|Recommended setting value: 2000. When the upper and lower limits are both 0, the upper limit becomes 2000 and the lower limit becomes 0.
709 |(% style="width:106px" %)[[image:1758113227549-844.png]]+9|(% style="width:146px" %)Reserved|Reserved for internal use
710 |(% style="width:106px" %)┇|(% style="width:146px" %)┇|┇
711 |(% style="width:106px" %)[[image:1758113227549-844.png]]+35|(% style="width:146px" %)Reserved|Reserved for internal use
Iris 4.3 712
713 Parameter space corresponding to the self-tuning time
714
Iris 4.4 715 |(% style="width:106px" %)**Unit**|(% style="width:141px" %)**Function**|**Description**
716 |(% style="width:106px" %)[[image:1758113227549-844.png]]|(% style="width:141px" %)Sampling time (TS)|Range: 1 to 32767 (ms). It must be longer than PLC program scan cycle.
717 |(% style="width:106px" %)[[image:1758113227549-844.png]]+1|(% style="width:141px" %)Control flag bit|(((
Iris 4.3 718 bit0: 0=Forward action; 1=Reverse action
719
720 bit3: 0=one-way; 1=two-way
721
722 bit4: 0=Self-tuning does not act; 1=Perform self-tuning and the others are not available.
723
724 bit6: 0=Two-segment self-tuning does not act; 1=Perform two-segment self-tuning (bit4 must set to 1)
725
726 bit7: 0=Three-segment self-tuning does not act; 1=Perform three-segment self-tuning (bit4 must set to 1)
727
728 Bit15: This instruction initializes the flag bit. When initialization is complete, the position is set to 1.
729 )))
Iris 4.4 730 |(% style="width:106px" %)[[image:1758113227549-844.png]]+2|(% style="width:141px" %)Sampling time of PID running after self-tuning|Setting range: 1 to 32767 ms(). When Ts≦0, Ts=3000
731 |(% style="width:106px" %)[[image:1758113227549-844.png]]+3|(% style="width:141px" %)Coefficient ukp for PID parameter calculation|Setting range: 0 to 500. When ukp≦0, ukp=100; When ukp≧500, ukp=500.
732 |(% style="width:106px" %)[[image:1758113227549-844.png]]+4|(% style="width:141px" %)Coefficient uki for PID parameter calculation|Setting range: 0 to 32767. When uki≦0, uki=50.
733 |(% style="width:106px" %)[[image:1758113227549-844.png]]+5|(% style="width:141px" %)Coefficient ukd for PID parameter calculation|Setting range: 0 to 32767. When ukd≦0, ukd=50.
734 |(% style="width:106px" %)[[image:1758113227549-844.png]]+6|(% style="width:141px" %)Reserved|Reserved
735 |(% style="width:106px" %)[[image:1758113227549-844.png]]+7|(% style="width:141px" %)Output lower limit|Recommended setting range: -2000 to 2000
736 |(% style="width:106px" %)[[image:1758113227549-844.png]]+8|(% style="width:141px" %)Output upper limit|Recommended setting value: 2000. When the upper and lower limits are both 0, the upper limit becomes 2000 and the lower limit becomes 0.
737 |(% style="width:106px" %)[[image:1758113227549-844.png]]+9|(% style="width:141px" %)Reserved|Reserved for internal use
738 |(% style="width:106px" %)┇|(% style="width:141px" %)┇|┇
739 |(% style="width:106px" %)[[image:1758113227549-844.png]]+35|(% style="width:141px" %)Reserved|Reserved for internal use
Iris 4.3 740
741 **Error code**
742
743 |**Error code**|**Content**
744 |4085H|Read application instruction (S1), (S2), (S3) and (d) output results exceed the range of device.
745 |4086H|The devices specified in write application instruction (S3) and (d) exceed the range of the corresponding device.
746 |4DB0H|Sampling time (Ts) exceeds the range the object (Ts≦0)
747 |4DB1H|Output filter constant (Co) exceeds the range the object (Co<0 or Co>1023)
748 |4DB2H|Maximum rate of increase (DeltaT) exceeds the range the object (deltaT<0 or deltaT>32000)
749 |4DB3H|Proportional gain (Kp) exceeds the range the object (Kp≦0)
750 |4DB4H|Integral gain (Ki) exceeds the range the object (Ki≦0)
751 |4DB5H|Differential gain (Kd) exceeds the range the object (Kd≦0)
752 |4DB6H|Sampling time (Ts) < operation cycle
753
754 **Example**
755
756
757
Iris 4.4 758 (% style="text-align:center" %)
759 [[image:企业微信截图_17581134583885.png]]
Iris 4.3 760
Iris 4.4 761 (% style="text-align:center" %)
762 [[image:企业微信截图_17581134696804.png]]
763
Iris 2.8 764 == **LAGCDL Large time-delay temperature control instruction** ==
Iris 2.2 765
Iris 2.8 766 **LAGCDL**
Iris 2.2 767
768 This instruction is used to perform large time-delay system temperature control that changes the output value according to changes in the input.
769
770 -[LAGCDL (s1) (s2)  (s3) (d)]
771
772 **Content, range and data type**
773
774 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
775 |(s1)|The device number that stores the target value (SV)|-32767 to 32767|Signed BIN 16 bit|ANY16
776 |(s2)|The device number that stores the measured value (SV)|-32767 to 32767|Signed BIN 16 bit|ANY16
777 |(s3)|The device number that stores parameters|1 to 32767|Signed BIN 16 bit|ANY16
778 |(d)|The device number that stores the output value (SV)|-32767 to 32767|Signed BIN 16 bit|ANY16
779
780 **Device used**
781
Iris 2.8 782 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|(((
Iris 2.2 783 **Offset**
784
785 **modification**
786 )))|(((
787 **Pulse**
788
789 **extension**
790 )))
Iris 2.8 791 |**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
792 |(% rowspan="4" %)LAGCDL|Parameter 1|●|●|●| | | | | | |
793 |Parameter 2|●|●|●| | | | | | |
794 |Parameter 3|●|●|●| | | | | | |
795 |Parameter 4|●|●|●| | | | | | |
Iris 2.2 796
797 **Features**
798
799 This instruction is to complete large time-delay system control operation, and used to control the parameters of the closed-loop control system.
800
Iris 2.8 801 [[image:1758111592778-873.png]]is the target value of CCPID SHT control (SV).
Iris 2.2 802
Iris 2.8 803 [[image:1758111614838-309.png]]is the measured feedback value (PV).
Iris 2.2 804
Iris 2.8 805 ​​​​[[image:1758111642557-547.png]]is the start address of the cache where the parameters required by LAGCDL operation and intermediate results are saved,
Iris 2.2 806
807 occupying a total of 634 variable units of subsequent addresses. The value range is from D0 to D7974 or from R0 to R35000. It is better to specify power failure retention, and the setting value remains after power supply is off. Otherwise, the cache needs to be assigned value before starting the calculation for the first time. The function and parameter description of each unit are described in this section.
808
Iris 2.8 809 [[image:1758111693192-390.png]] is the storage unit of the LAGCDL calculation result. Please specify it as a non-battery retentive area, otherwise it needs to be initialized and cleared before the first start of calculation.
Iris 2.2 810
811 **Programming example**
812
Iris 2.8 813 [[image:1758111738993-165.png||height="64" width="430"]]
Iris 2.2 814
815 The parameter description is as follows:
816
817 The target value of LAGCDL adjustment is stored in D1, and D0 is the closed-loop feedback value. Note that D0 and D9 must be of the same dimension, such as both 0.01MPa units, or 1℃ units, etc..
818
819 A total of 634 units of D1000 to D1633 are used to store the set value and process value of LAGCDL operation. These values must be set item by item before the first LAGCDL calculation.
820
821 D100 unit is used to store the calculated control output value to control the execution of the action.
822
Iris 2.8 823 [[image:1758111862269-781.png]] to [[image:1758111862269-781.png]]+15 is the parameter range that can be set (parameters set when LAGCDL is executed). [[image:1758111862269-781.png]]+28 to [[image:1758111862269-781.png]]+631 is the historical data space for LAGCDL control internal use. [[image:1758111862269-781.png]]+4 to [[image:1758111862269-781.png]]+27 is the parameter space used in the self-tuning process. (This space is multiplexed with the parameter space during control)
Iris 2.2 824
Iris 2.8 825 The functions and setting methods of the parameter values of each unit started by [[image:1758111862269-781.png]] are described in the following table:
Iris 2.2 826
827
828
Iris 2.8 829 |(% style="width:108px" %)**Unit**|(% style="width:230px" %)**Function**|**Description**
830 |(% style="width:108px" %)[[image:1758111862269-781.png]]|(% style="width:230px" %)Sampling time (TS)|Range: 1 to 32767 (ms). It must be longer than PLC program scan cycle.
831 |(% style="width:108px" %)[[image:1758111862269-781.png]]+1|(% style="width:230px" %)Control flag bit|(((
Iris 2.2 832 bit0: 0=Forward action; 1=Reverse action
833
834 bit1: Overshoot power limit output enable bit. 0=no limit; 1=limited
835
836 Bit2: Reset historical data. 0=reset; 1=no reset. This bit must be 0 before each execution.
837
838 bit4: 0=Self-tuning does not act; 1=Perform self-tuning and the others are not available.
839
840 Bit14:Historical data initialization flag bit. When initialization is complete, it is set to 1.
841
842 Bit15: The instruction initializes the flag bit. When initialization is complete, it is set to 1.
843 )))
Iris 2.8 844 |(% style="width:108px" %)[[image:1758111862269-781.png]]+2|(% style="width:230px" %)Output lower limit|Range: -32000 to 32000. Recommended setting range: -2000 or 0.
845 |(% style="width:108px" %)[[image:1758111862269-781.png]]+3|(% style="width:230px" %)Output upper limit|Range: 0 to 32000. Recommended setting value is 2000. When the upper and lower limits are both 0, the upper limit becomes 2000 and the lower limit becomes 0.
846 |(% style="width:108px" %)[[image:1758111862269-781.png]]+4|(% style="width:230px" %)Full power output boundary|The suggested value can be obtained by self-tuning, and can also be adjusted according to the actual situation.
847 |(% style="width:108px" %)[[image:1758111862269-781.png]]+5|(% style="width:230px" %)Half-power output boundary|The suggested value can be obtained by self-tuning, and can also be adjusted according to the actual situation.
848 |(% style="width:108px" %)[[image:1758111862269-781.png]]+6|(% style="width:230px" %)Stop output boundary|The suggested value can be obtained by self-tuning, and can also be adjusted according to the actual situation.
849 |(% style="width:108px" %)[[image:1758111862269-781.png]]+7|(% style="width:230px" %)The maximum rate of increase of the controlled system|Given by self-tuning
850 |(% style="width:108px" %)[[image:1758111862269-781.png]]+8|(% style="width:230px" %)The lagged time of the controlled system|Given by self-tuning. Unit: s
851 |(% style="width:108px" %)[[image:1758111862269-781.png]]+9|(% style="width:230px" %)The time constant of the controlled system|Given by self-tuning. Unit: s
852 |(% style="width:108px" %)[[image:1758111862269-781.png]]+10|(% style="width:230px" %)Ideal closed-loop time constant|Given by self-tuning. Unit: s
853 |(% style="width:108px" %)[[image:1758111862269-781.png]]+11|(% style="width:230px" %)Ideal closed-loop sampling time|Given by self-tuning. This parameter can be adjusted during the control process. Unit: s
854 |(% style="width:108px" %)[[image:1758111862269-781.png]]+12|(% style="width:230px" %)Maximum temperature difference during setting|Given by self-tuning. (for your reference)
855 |(% style="width:108px" %)[[image:1758111862269-781.png]]+13|(% style="width:230px" %)The temperature difference between the residual heat and temperature rise|Given by self-tuning. (for your reference)
856 |(% style="width:108px" %)[[image:1758111862269-781.png]]+14|(% style="width:230px" %)Heating time|Given by self-tuning. (for your reference)
857 |(% style="width:108px" %)[[image:1758111862269-781.png]]+15|(% style="width:230px" %)Setting time|Given by self-tuning. (for your reference)
858 |(% style="width:108px" %)[[image:1758111862269-781.png]]+16|(% rowspan="3" style="width:230px" %)Self-tuning use space|(% rowspan="3" %)Reserved for internal use
859 |(% style="width:108px" %)┇
860 |(% style="width:108px" %)[[image:1758111862269-781.png]]+27
861 |(% style="width:108px" %)[[image:1758111862269-781.png]]+28|(% style="width:230px" %)Current temperature difference|Used during control
862 |(% style="width:108px" %)[[image:1758111862269-781.png]]+29|(% style="width:230px" %)Previous temperature difference|Used during control
863 |(% style="width:108px" %)[[image:1758111862269-781.png]]+30|(% style="width:230px" %)The 1st operation flag bit|Used during control
864 |(% style="width:108px" %)[[image:1758111862269-781.png]]+31|(% style="width:230px" %)Number of valid history outputs|Used during control
865 |(% style="width:108px" %)[[image:1758111862269-781.png]]+32|(% rowspan="3" style="width:230px" %)Historical output data|(% rowspan="3" %)Used during control
866 |(% style="width:108px" %)┇
867 |(% style="width:108px" %)[[image:1758111862269-781.png]]+631
868 |(% style="width:108px" %)[[image:1758111862269-781.png]]+632|(% rowspan="2" style="width:230px" %)Previous sampling time stamp|(% rowspan="2" %)Reserved for internal use
869 |(% style="width:108px" %)[[image:1758111862269-781.png]]+633
Iris 2.2 870
871 **Error code**
872
873 |**Error code**|**Content**
874 |4085H|Read application instruction (S1), (S2), (S3) and (d) output results exceed the range of device.
875 |4086H|The devices specified in write application instruction (S3) and (d) exceed the range of the corresponding device.
876 |4D86H|Sampling time (Ts) < operation cycle
877 |4DA1H|Power limit boundary (s3+4), (s3+5) and (s3+6) exceed the range.
878 |4DA2H|System parameters (s3+7), (s3+8) and (s3+9) exceed the range.
879 |4DA3H|Control parameters (s3+10) and (s3+11) exceed the range.
880 |4DA4H|The output upper limit is smaller than the lower limit
881
882 **Example**
883
884
Iris 3.1 885 (% style="text-align:center" %)
886 [[image:企业微信截图_17581120459254.png]]
Iris 2.2 887
Wecon 1.1 888 == **TRH/Wet and dry bulb temperature and humidity conversion** ==
889
Iris 4.7 890 TRH
Wecon 1.1 891
892 This command completes the conversion of dry bulb temperature, wet bulb temperature and corresponding humidity.
893
894 -[TRH (d1) (s) (d2) (n)]
895
896 Content, range and data type
897
898 |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)**|=**Custom variable type**
899 |(d1)|Humidity|0~~100|Single-precision floating point|ANYREAL_32|REAL
900 |(s)|Dry bulb temperature|-|Single-precision floating point|ANYREAL_32|REAL
901 |(d2)|Wet bulb temperature|-|Single-precision floating point|ANYREAL_32|REAL
902 |(n)|Mode|0 to 1|Signed BIN 32 bit|ANY32|DINT
903
904 Device used
905
906 |=**Instruction**|=**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=**Pulse expansion**
907 | | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
908 |(% colspan="1" rowspan="4" %)TRH|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|
909 |Parameter 2| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|
910 |Parameter 3| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|
911 |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|
912
913 Function
914
915 There are two modes to choose from (n):
916
917 Mode 0: Calculate the corresponding humidity by wet bulb temperature and dry bulb temperature.
918
919 Mode 1: Calculate the corresponding wet bulb temperature by dry bulb temperature and humidity.
920
921 The conversion process formula is as follows:
922
923 Assuming that the wet bulb temperature is A, the dry bulb temperature is B, and the corresponding current humidity is C, which meet the following conditions:
924
925 (% style="text-align:center" %)
926 [[image:1709791199711-348.png||height="101" width="342"]]
927
928
929 Precautions
930
931 ·The wet bulb temperature is not greater than the dry bulb temperature. When they are the same, the humidity reaches the maximum value 100%.
932
933 ·The unit of dry and wet bulb temperature is (^^o^^C).
934
935 ·The general value range of dry bulb is between 0~~100^^o^^C, and the command does not judge its range, so pay special attention when using this command.
936
937 Error code
938
939 |=**Error code**|=**Content**
940 |(% rowspan="4" %)4084H|When the value specified in (n) exceeds the following range. 0 to 1
941 |The value specified in (d1) exceeds the following range. 0 to 100
942 |A negative value is specified in (s).
943 |A negative value is specified in (d2).
944 |4085H|The output result of (d1)(s)(d2)(n) in the read application command exceeds the device range.
945 |4086H|The output result of the write application command (d1) and (d2) exceeds the device range.
946
947 Example
948
949 (% style="text-align:center" %)
950 [[image:1709791591456-917.png]]
951
952 Dry and wet bulb temperature/humidity conversion table
953
954 (% style="text-align:center" %)
955 [[image:1709791607332-438.png]]