L
Now that I've got velocity and position control programs for my S7-300 written and working well, I want to incorporate PID control. I thought this would be easy: just plop in FB41, fill in the blanks, and poof! This hasn't turned out to be true: I get a permanently-overdamped response in my velocity control program (regardless of my P gain) and no response at all in my position control program. As I say, both programs work well with just the use of MUL_R acting as a proportional gain (multiplying the difference between input and feedback). My big questions are: WHAT output do I use (LMN vs. ER), and what am I doing wrong with regards to my input? Below is a copy of the FB41 that I'm using in my position control program:
CALL "CONT_C" , DB1
COM_RST :=
MAN_ON :=L20.1
PVPER_ON:=
P_SEL :=L20.3
I_SEL :=L20.4
INT_HOLD:=
I_ITL_ON:=
D_SEL :=L20.7
CYCLE :=
SP_INT :=#input_angle
PV_IN :=#feedback_angle
PV_PER :=
MAN :=
GAIN :=3.500000e+000
TI :=T#10S
TD :=T#20S
TM_LAG :=
DEADB_W :=
LMN_HLM :=
LMN_LLM :=
PV_FAC :=
PV_OFF :=
LMN_FAC :=
LMN_OFF :=
I_ITLVAL:=
DISV :=
LMN :=
LMN_PER :=
QLMN_HLM:=
QLMN_LLM:=
LMN_P :=
LMN_I :=
LMN_D :=
PV :=
ER :=#PID_error
DB1 and FB41 have both been downloaded into the PLC (no errors at runtime). All variables have been defined as temporary REAL values, which works fine without PID. I am using the switches on the training module's control board to include/exlude the differen gains.
If anyone has a working PID block that they could e-mail me, I would be very appreciative!
Thank you to all who respond,
Lee Rehorn
student at the University of Western Ontario
CALL "CONT_C" , DB1
COM_RST :=
MAN_ON :=L20.1
PVPER_ON:=
P_SEL :=L20.3
I_SEL :=L20.4
INT_HOLD:=
I_ITL_ON:=
D_SEL :=L20.7
CYCLE :=
SP_INT :=#input_angle
PV_IN :=#feedback_angle
PV_PER :=
MAN :=
GAIN :=3.500000e+000
TI :=T#10S
TD :=T#20S
TM_LAG :=
DEADB_W :=
LMN_HLM :=
LMN_LLM :=
PV_FAC :=
PV_OFF :=
LMN_FAC :=
LMN_OFF :=
I_ITLVAL:=
DISV :=
LMN :=
LMN_PER :=
QLMN_HLM:=
QLMN_LLM:=
LMN_P :=
LMN_I :=
LMN_D :=
PV :=
ER :=#PID_error
DB1 and FB41 have both been downloaded into the PLC (no errors at runtime). All variables have been defined as temporary REAL values, which works fine without PID. I am using the switches on the training module's control board to include/exlude the differen gains.
If anyone has a working PID block that they could e-mail me, I would be very appreciative!
Thank you to all who respond,
Lee Rehorn
student at the University of Western Ontario