AH500 Programming Manual 3. The instruction PID only can be used in the cyclic task and the interval interrupt task. When the instruction PID is used in the interval interrupt task, the sampling time is the same as the interval between the timed interrupt tasks. 4. When the instruction is scanned, the PID algorithm is implmented according to the sampling time, and the MV is refreshed. When the instruction is used in the interrupt task, the sampling time is the same as the interval between the timed interrupt tasks. The PID algorithm is implemented according to the interval between the timed interrupt tasks. 5.
Before the PID algorithm is implemented, the process value used in the instruction PID has to be a stable value. When users need the input value in the module to implement the PID algorithm, they have to notice the time it takes for the analog input to be converted into the digital input. The PID algorithm: 1. When PID_MODE is set to 0 or 2, the PID control mode is the automatic control mode. 2. When PID_MODE is set to 1, the PID control mode is the automatic tuning mode. After the tuning of the parameter is complete, PID_MODE is set to 0. The PID control mode becomes the automatic control mode. a) The PID algorithm includes the forward action and the reverse action.
Whether the action is the forward one or the reverse one depends on the setting of PID_DIR . The PID algorithm is as follows. dt t dE K dt t E K t E K MV D 0 I P ) ( * ) ( t E(t)S represents the derivative value of E(t), and ( ) S 1 t E represents the integral value of . ( ) t E Control diagram: S represents the derivative action, and is defined as (Current E(t)-previous E(t))/Sampling time. 1/S represents the integral action, and is defined as (Previous integral value+Error value) Ч Sampling time. G(S) represents the plant. The instruction PID is inside the dotted line. The symbols: MV : Output value t E :
Error value Forward action SV PV t E Reverse action PV SV t E P K : Proportional gain PV : Process value SV : Target value 6-171 Action direction PID algorithm Forward action EtPVt-SVt Reverse action EtSVt-PVt 1/S 1/K I + + + 1/K P - + S K D G(s)