Chapter 6 Temperature Measurement Module AH04TC/AH08TC 
6-11 
Control diagram: 
G(s)
S
1/S
1/K
I
K
D
+
+
+
-
The instruction PID is inside the dotted line.
P
+
1/K
 
 
The PID algorithm is as follows. 
( )
dt
tdE
KdttEKtEKMV
D
t
IP
)(
*)(
0
++=
∫
 
Forward action: 
 
Reverse action:
 
 
b. Control mode
 
Cyclic control mode: Users set a cycle according to a controlled environment. (If the ambient 
air temperature changes slowly, the cycle can be longer.) 
The width of a pulse is defined below. 
  Pulse width=Output value (MV)/(Maximal output value–Minimal output value)×Cycle 
Users can set the width of a pulse and a cycle (sampling time) by means of the instruction 
GPWM. 
Example: 
The cycle is 2000 ms, the maximal output value is 100, and the minimal output value is 0. After 
the PID algorithm is performed, the output value gotten is 50. 
  Width of a pulse=50/(100-0)×2000 ms=1000 ms 
Therefore, the pulse width used in the instruction GPWM is 1000 ms, and the cycle used in the 
instruction GPWM is 2000 ms.