FB41CONT_C function and parameter setting of Siemens S7-300PID - Database & Sql Blog Articles

Brand AVX TPSE226M035R0125 Low impedance tantalum capacitor AVX 22
Photocoupler

Now, we are using the Siemens S7-300 (CPU315) to perform PID control on the rectification system. The 4-20mA signal is input via the AI module, including feedback signals from both A and B cabinet saturated reactors as well as DC current signals from units A and B. The CPU calls the PID function block to achieve automatic closed-loop control, and finally, the AO module outputs a 4-20mA signal to the steady current system for both A and B cabinets.

During the implementation, some issues were encountered:

1. Which specific PID function blocks in S7 should be used? For example, can FB41 be called directly in OB1, and is that acceptable?

2. How should the input and output parameters of the standard PID block FB41 be set? What is the difference between PV_PER, SP_INT, and PV_IN?

3. How to configure GAIN, TI, and TD values properly?

4. How to use MAN_ON and PVPER_ON—should these be directly written into the inputs of FB41?

In principle, the execution cycle of the PID should match its sampling period to ensure consistency between the mathematical model and the actual process. That’s why FB41 should be called periodically in OB35, with the OB35 period matching the FB41 sampling interval.

However, it's also possible to call FB41 from OB1 or other FC/FB functions. In such cases, it's better to use the scan period of OB1 as the sampling period for FB41.

I have also used FB41 continuously in FC without conditions during constant current and pressure control of pipelines, and the results were satisfactory. In low-precision applications, simple calls can still work effectively.

The parameter settings for FB41 are very flexible and can be adjusted based on personal preference or application convenience. Here’s one approach:

MAN_ON: This activates the manual adjustment mode of the PID, enabling the setpoint (MAN) to be adjusted manually. It can be triggered by the switch between manual and automatic modes in the PID.

PVPER_ON: This enables the "peripheral" input/output parameters of the PID, treating them as integers between 0 and 27648. In this case, the feedback value is directly taken from the AIW channel, and the output is directly sent to the AQW channel. Parameter tuning is handled internally by FB41. You can also use this to trigger the home position of the device.

MAN: This is the manual setpoint of the PID, which becomes active when MAN_ON is set to 1.

CYCLE: This represents the sampling period. It should be consistent with the execution cycle of FB41, depending on how quickly the physical quantity changes.

SP_INT: This is the setpoint of the PID. Make sure the unit matches the feedback value. To avoid errors, it's recommended to convert SP_INT to a dimensionless percentage ranging from -100.0% to 100.0%. When entering it into FB41, only the numeric part before the percent sign should be used.

PV_PER: This is the process variable directly read from the A/D code of the AIW channel. It is only valid when PVPER_ON is set to 1.

GAIN: This is the proportional gain factor.

TI: This is the integral time constant.

TD: This is the derivative time constant.

LMN_PER: This is the output of the PID, directly mapped to the AQW channel.

Once these parameters are configured, basic PID control can be achieved. Additional settings like deadband can be added as needed.

Using the PID assignment tool in STEP7 allows you to configure parameters graphically and quickly. The configuration is stored directly in the corresponding instance data block. There's no need to assign FB41 explicitly when calling it.

Double-Pole Rocker Switches

Double Pole Rocker Switches,2 Pole Rocker Switch,Dual Pole Rocker Switch

Yang Guang Auli Electronic Appliances Co., Ltd. , https://www.ygpowerstrips.com

This entry was posted in on