Kaiyi — 5.1.7 Functions

Chapter 5 Temperature Measurement Module AH04PT/AH08PTG Control diagram: The instruction PID is inside the dotted line. 1/S 1/K I + + + 1/K G(s) - P + S K D The PID algorithm is as follows. ( ) dt t dE K dt t E K t E K MV D I P ) ( * ) ( t 0 + + = ∫ Forward action: ( ) ( ) ( ) t SV - t PV t E = Reverse action: ( ) ( ) ( ) t PV - t SV t E = 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. 5-11