Sign in to follow this  
Followers 0
Linas

S7-300 PID controll

6 posts in this topic

I want to program PID control using standard function block FB41 (it can be found in library). I already analyzed all the parameters and setting it has. The problem is I don’t understand how I can assign a physical input and output to this PID block. Does anyone know where and how I can assign analog input (e.g. thermometer PIW256) to PV_PER (process variable peripheral) of FB41 (CONT_C) block. As well as analog output to LMN_PER of FB41. Another question is how I can call this block in my program. Thanks for any suggestions.

Share this post


Link to post
Share on other sites
Hello, you must call FB41 in ob35. Set MAN_ON to FALSE, preadjustment is true.Set PVPER_on to true,preadjustment is false.SP_int is your desired value, in real. A good help is PID CONTROL, you can find it in your SIMATIC orderer. Sorry for my english. dietmar

Share this post


Link to post
Share on other sites
ok I'll try to call FB41 in OB35 I tried to call FC1 in OB1. FC1 has the following code: ------------------------------------------------- CALL "CONT_C" , DB41 COM_RST :=FALSE MAN_ON :=FALSE PVPER_ON:=TRUE P_SEL :=TRUE I_SEL :=TRUE INT_HOLD:=FALSE I_ITL_ON:=TRUE D_SEL :=TRUE CYCLE :=T#10S SP_INT :=6.000000e+001 PV_IN :=0.000000e+000 PV_PER :=PIW256 MAN :=FALSE GAIN :=2.000000e+000 TI :=T#20S TD :=T#10S TM_LAG :=T#2S DEADB_W :=0.000000e+000 LMN_HLM :=8.000000e+001 LMN_LLM :=4.000000e+000 PV_FAC :=1.000000e+000 PV_OFF :=0.000000e+000 LMN_FAC :=1.000000e+000 LMN_OFF :=0.000000e+000 I_ITLVAL:=0.000000e+000 DISV :=0.000000e+000 LMN := LMN_PER :=PQW256 QLMN_HLM:= QLMN_LLM:= LMN_P := LMN_I := LMN_D := PV := ER := ---------------------------------------------------------------------------------------- Everything seems to work just fine on PLC Simulator. Now I need to figure out how I can assign a variable instead of fixed value in SP_INT (set point) because setpoint must be set externally from OP3 panel. Thanks.

Share this post


Link to post
Share on other sites
Hello, SP_INT is a DWORD like MD0 or DBD0, i hope in english it's the same. Good luck. dietmar

Share this post


Link to post
Share on other sites
ok thanks, can you explain why I must call FB41 (CONT_C) in OB35, because it's "cyclic interrupt" block? Maybe it's ok to call FB41 in OB1?

Share this post


Link to post
Share on other sites
Hello, look at this: Settings for the "CYCLE" parameter on the controller blocks QUESTION: How should you set the "CYCLE" parameter on the controller blocks for the S7-300/400? ANSWER: The "CYCLE" parameter informs the controller block of the time reference at which the block is called from the S7 program. Example: A controller (e.g. FB41, FB42 or FB1, FB2) is called in the OB35 without conditions. The OB35 has been set to the Time reference 100ms in the hardware configuration. Therefore you must also set T#100ms for the "CYCLE" parameter of the controller. Note: Because of this interrelation, it is not possible to call controller blocks at the OB1 level. The OB1 has no constant cycle time. Thus no specific value can be preset for the "CYCLE" parameter. If the values of the "CYCLE" parameter does not match the real scanning time, then time-dependent control parameters (such as TI, TD) are too fast or too slow. Good Luck dietmar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0