Chapter 7 Usage of Various Functions
7-
(g) Proportional gain
The MK80S can handle only integer, not the floating point type. Therefore, to enhance the accuracy of PID
operation, the PID8 instruction is designed to input the P_GAIN data as the 100 times scaled up. For example, if the
designated P_GAIN is 98, actual input data of P_GAIN should be 9800. If the designated P_GAIN is 10.99, input
1099 to the P_GAIN.
(h) Mode command set
In MK80S, only the following 4 operation modes are available. Other operation modes, such as PD or I, are not
permitted.
No. EN_P EN_I EN_D Operation
1 1 (enable) 0 (disable) 0 (disable) P operation
2 1 (enable) 1 (enable) 0 (disable) PI operation
3 1 (enable) 1 (enable) 1 (enable) PID operation
4 0 (disable) 0 (disable) 0 (disable) On/Off operation
(i) Bias value
The Bias data is used for the compensation of offset in the proportional control.
(j) SV(Target)
SV (setting value : the designated value) and PV (process value : present value) of K7 PID operation have the
range 0 ~ 4000. The range is set with the consideration of the resolution of A/D and D/A module of K7 series
(12bits) and offset value.
The following table shows error codes and descriptions of PID8 instruction.
Error code
(STAT output)
Description Countermeasure
0 Normal operation
1 SV is out of range Change the SV within 0 ~ 4000
2 MVMAN is out of range Change the MVMAN within 0 ~ 4000
3 P_GAIN is out of range Change the P_GAIN within 0 ~ 10000
4 I_TIME is out of range Change the I_TIME within 0 ~ 20000
5 D_TIME is out of range Change the D_TIME within 0 ~ 20000
6 S_TIME is out of range Change the S_TIME within 0 ~ 100
7 REF is out of range Change the REF within 0 ~ 10
8 TT is out of range Change the TT within 0 ~ 1000
9 N is out of range Change the N within 0 ~ 1000
10
EN_I and/or EN_D is set as 1
when EN_P is 0
Only P, PI, and PID controls are available. Please
change the setting of EN_P, EN_I, and EN_D.
1. Please be careful to input 100 times scaled up values for P_GAIN and TT.
2. I_TIME, D_TIME, S_TIME, and REF are 10 times scaled up, not 100 times.
Remark