Description and adjustment method of PID function block in Siemens FB41 - Database & Sql Blog Articles
FB41 is called continuous control PID to control the continuously changing analog quantity. The difference from FB42 is that the latter is discrete type, used to control the switching quantity. The other two methods are the same or similar. Shenzhen Xcool Vapor Technology Co.,Ltd , http://www.xcoolvapor.com
PID initialization can be set once in OB100, the parameter COM-RST is set, of course, it can be initialized elsewhere, the key is to control COM-RST;
The PID call can be completed in OB35, and the general setup time is 200MS.
Be sure to study the following parameters in conjunction with the PID block diagram in the help documentation. You can do more with less. The following important parameters are marked in bold. If you are lazy, just focus on the parameters of the boldface. Others can use the default parameters.
A: All input parameters:
COM_RST: BOOL: Restart PID: When this bit is TRUE: PID performs the restart function, resets the PID internal parameters to the default value; usually performs a scan cycle when the system restarts, or uses this when the PID enters saturation and needs to exit. Bit
MAN_ON: BOOL: Manual value ON; when this bit is TRUE, the PID function block directly outputs the value of MAN to LMN, which can be seen in the PID block diagram; that is, this bit is the manual/automatic switching bit of the PID. ;
PEPER_ON: BOOL: Process variable peripheral value ON: Process variable is the feedback amount. This PID can directly use the process variable PIW (not recommended), or PIW normalized value (common), therefore, this bit is FALSE;
P_SEL: BOOL: Proportional selection bit: When this bit is ON, the P (proportional) control is selected to be valid; the general selection is valid;
I_SEL: BOOL: integral selection bit; when this bit is ON, the selection I (integration) control is valid; the general selection is valid;
INT_HOLD BOOL: The point remains, don't set it;
I_ITL_ON BOOL: The initial value of the integral is valid. The I-ITLVAL (integrated value) variable corresponds to this bit. When this bit is ON, the initial value is integrated using the I-ITLVAL variable. Generally, when it is found that the integral value of the PID function grows slowly or the system response is insufficient, the initial value of the integral may be considered;
D_SEL : BOOL: Differential selection bit. When this bit is ON, the D (differential) control is valid; the general control system is not used;
CYCLE : TIME: PID sampling period, generally set to 200MS;
SP_INT: REAL: the given value of the PID;
PV_IN : REAL: the feedback value of the PID (also called the process variable);
PV_PER: WORD: Unnormalized feedback value, valid by PEPER-ON; (not recommended)
MAN : REAL: Manual value, selected by MAN-ON;
GAIN : REAL: proportional gain;
TI : TIME: integration time;
TD : TIME: differential time;
TM_LAG: TIME: I don't know, I haven't used it, it's related to differentiation;
DEADB_W: REAL: dead zone width; if the output oscillates slightly near the equilibrium point, consider using dead zones to reduce sensitivity;
LMN_HLM: REAL: the upper limit of PID, generally 100%;
LMN_LLM: REAL: the lower limit of PID; generally 0%, if you need bipolar adjustment, you need to set it to -100%; (the positive and negative 10V output is a typical bipolar output, you need to set -100%);
PV_FAC: REAL: Process variable scale factor PV_OFF: REAL: Process variable offset value (OFFSET)
LMN_FAC: REAL: PID output value scale factor;
LMN_OFF: REAL: PID output value offset value (OFFSET);
I_ITLVAL: REAL: the initial value of the integral of the PID; the I-ITL-ON selection is valid;
DISV : REAL: Permissible disturbance amount, feedforward control is added, generally not set;
B: Description of some output parameters:
LMN: REAL: PID output;
LMN_P : REAL: the component of P in the PID output; (can be used to observe the effect during debugging)
LMN_I : REAL: component of I in the PID output; (can be used to observe the effect during debugging)
LMN_D : REAL: the component of D in the PID output; (can be used to observe the effect during debugging)
C: Standardization concepts and methods:
The important variables in the PID parameters, the given value, the feedback value and the output value are all represented by a real number between 0.0 and 1.0.
These variables are actually derived from the analog input, or the output controls the analog quantity. Therefore, the analog output needs to be converted into data of 0.0~1.0, or the data of 0.0~1.0 is converted into analog output. This process is called Standardized method: (ie the variable corresponds to the percentage of the entire range of values ​​and the amount within the 27648 digital range)
For input and feedback, execute: variable *100/27648 and transfer the result to PV-IN and SP-INT
For the output variable, execute: LMN*27648/100, and then transfer the result to PQW;
D: PID adjustment method:
Generally, D is not used, except for some large-power heating systems such as high-power heating control; only PI can be used.
Generally, I first makes I equal to 0, and P increases from 0 until the system shows equal amplitude oscillation. Write down the period of oscillation at this time, and then set I to 0.48 times of the oscillation period, which should satisfy most of the requirements. I remember that there are many ways to adjust the PID on the network, but I don't remember so much, let's try it first.
Appendix: PID adjustment can be done by "Start -> SIMATIC -> STEP7 -> PID adjustment" to open the PID adjustment control panel, adjust the PID parameters of different loops by selecting different PID background data blocks.