PID LOOP PROGRAMMING

B

Thread Starter

Bryn Powell

I am experiencing problems in creating a PID loop for a Siemens S7 PLC ( 314, 315 ).
The Siemens PID blocks supplied are just too damn complicated to use.
What I am trying to do is control a hydraulic proportional valve using an analog voltage. The feedback from the system is a load cell.
I have analog inputs from the load cell and analog outputs to the valve.
Thanks
 
You don't have to configure all the parameters of the block. Most of them work fine at their default settings. You can also download the PID block descrption manual from siemens website.

You should first give it a try by turning I & D options off.

I assume that you are using FB41 for implementing the PID. If so, then you need to configure the following inputs..

PVPER_ON: true
P_SEL: true
I_SEL: integral action
D_SEL: Differential action
SP_INT: The setpoint goes here
PV_PER: the load cell input goes here
GAIN: +ve or -ve value
TI: Integral time(if integral action is on)
TD: diff. time (if diff. action is on)


You can contact me at my email address for any further questions.


Bye
Omer
 
J

Joerg Jaschke

Hi,
this is a common Siemens problem. First off all you should forget about the build in PID blocks as there are too many parameters you have to configure or to forget about. Second is, that if you want to use a proportional valve (pistion position control +/-100%) to control a force or a pressure (bar) you have to use a square root function to calculate the degree of opening, depending from the delta setpoint to actual value and actual value to source/drain value. Additionaly you should use a sin² function to ramp your setpoints.
If this is what you are interested in, please let me know and I can give you some sample logic for that.

Joerg Jaschke
ATR Industrie Elektronik / Germany
 
S

Sachin Singh

Hi there! My name is Sachin Singh and i am a Control Engineer from South Africa..
I have a pid function created in s7 stl.language i can gladly mail it to you.
It is created to control a bank of heaters switching in a step binary sequence.
It will surely work for your purpose with a little modification to the output word.

Contact me at [email protected]
 
D

Danijel Vidoviè

Hallo ! I have used this PID loop many times for water level control regulation in the tank. Normally I call the PID loop in OB35 with instance data block. In OB35 i configure only CYCLE, SP_INT, PV_PER and LMN_PER. For other parameters use I "PID Control Parameter Assignment" where i open online the instance data block. This program is useful for tunning the PID loop because there is also curve recorder, which helps you to find right assignment. If you want more information about this contact me directly via e-mail ! Best regards, Danijel [email protected]
 
i got the same problem. I tried tunning a system with thermopar (type J) and thermoresistors. I am using FB42 and i think that was an error. Should i use FB41?. i would appreciate your help Best regards > You don't have to configure all the parameters of the block. Most of them work fine at their default settings. You can also download the PID block descrption manual from siemens website. You should first give it a try by turning I & D options off. I assume that you are using FB41 for implementing the PID. If so, then you need to configure the following inputs.. PVPER_ON: true P_SEL: true I_SEL: integral action D_SEL: Differential action SP_INT: The setpoint goes here PV_PER: the load cell input goes here GAIN: +ve or -ve value TI: Integral time(if integral action is on) TD: diff. time (if diff. action is on) You can contact me at my email address for any further questions. Bye Omer
 
S

Shahid Waqas Chaudhry

FB42 is Step Controller used for integrating actuators. For continous control, use SIEMENS standard block FB41 (you can find it in the library). The parameters are quite clearly (by SIEMENS standards) descibed in the manual. This manual is installed as part of Step7 on your PC. Using the FB41 block, you can have a combination of controller types by turning P, I, and D parameters off respectively. SIEMENS algorithm is a parallel one using the following equation: Output = (Gain)*err + (Ti)integral(err . dt) + (Td) d/dt(err) The interesting parameters are: (not in the correct order) Process Value: PVPER_ON:= TRUE // To enable direct Analog Input. The input is converted to 0-100% scale. PV_IN:= // Leave blank if using direct AI. else give the address here. You have to set PVPER_ON:=FALSE. PV_PER:= // Analog Address e.g: PIW272 You can scale the AI value by giving the Factor and Offset values. Set Point: SP_INT:= // Set Point given by HMI or OP. If using Peripheral Input (AI) then you can have it in 0-100% else in the Engg Units Controller Types: P_SEL:= // True or False - Controls the Proportional Controller I_SEL:= // True or False - Controls the Integral Controller D_SEL:= // True or False - Controls the Differential Controller Controller Parameters: Gain:= // Real Value Ti:= // Integral Value, in Seconds. format is t#2s Td:= // Differential Value, in Seconds. format is t#2s Manual Control: Man_ON: // True for Manual mode and FALSE for AUTO MAN:= // Manual Value. This would be outputted to the Controller output when in manual mode. There are other controller parameters here that you can adjust if required by process. These include TimeLag of D action, Integral action Hold, init value of integral value etc. Output: LMN:= // 0 - 100% LMN_PER:= // Use this entry if you want to output directly to the Analog Output Like SP, you can use LMN_FAC and LMN_OFF to provide factor and offset for the manipulated value. You can also have output if the controllers goes over the High or Low LMN limit (default setting are 0 and 100%, can be changed). You can also have the individual manipulated values of P, I and D controller at the block (FB41) output. Hope this information would jump start you. Shahid
 
L
I, too, am trying to use FB41 to implement PID control for my PLC/motor system. Unfortunately, I do not understand quite how the block's variables work. For example, say I want a proportional gain of 2. After subtracting my tachogenerator feedback from my reference voltage (the difference is a variable called #control), I take the difference and input it at the "MAN" label of FB41. I have P_SEL set to 1, MAN_ON set to 1, and GAIN set to 2.0. Now, from where should I get the output from FB41? To clarify, the value at LMN is simply #control, with no amplification! The motor does nothing if I take the output from PV or ER. I know the rest of my system is working correctly because I first used a simple multiplier block to amplify #control, and this gave a good proportional gain.

Thanks for your help,
Lee Rehorn
[email protected]
 
Top