s300 pid control

voyage

Member
Join Date
Jan 2006
Location
Livingston Scotland
Posts
15
Hello everyone

I have a problem, I need to install 2 pid loops into an existing program on a s300 314 (software ver 5.2+sp1).Trouble is i don't have a dan do how to do this read the manual and still can't get it

Does anyone have a sample program or a guide on how to do it. As you can guess seimens is not my preferred PLC.Or maybe i am just thick?

Many Thx
and Merry Christmas to All
 
Do you understand PID control philosophy and just can't implement it in Siemens, or is it the whole PID thing which eludes you?

If it's the latter, there are weeks of reading in this forum when you search for "PID control" or similar.

If it's the former, PID control in Siemens S7 is implemented using FBs. There are several covering this topic in the Standard S7 Library installed with STEP7. Probably the most common one used is FB41. You've not given any details of what you're controlling so I can't say that this is definitely the answer to your needs. Anyway, copy FB41 from the Library in to your project, call it twice (once for each loop you require) and give each one its own instance Data Block as normal for any other FB. One of the key things for successful operation of any PID control block is that it is called on a regular time interval. Variations in scan duration mean that calling FB41 in a path that leads back to OB1 may lead to irregularities. The most common convention here is to use one of the timed interrupt OBs (OB35) to call the FB41 instances. This guarantess the period with which FB41 will be called. It's up to you and your process how frequent this needs to be. The default for OB35 is 100mS, but this can be adjusted in the CPU Properties in the H/w Configuration part of FB41. Whatever figure you settle on, make sure you then inform FB41 of this as one of the input parameters required by the block. I think it's named CYCLE. One last thing is the MAN_ON input. As you might guess this sets the MANUAL mode of the loop ON, and the default status of this variable in the Instance Data Block is true. To get the loop to take control of its output you must set this false.

After that it's over to you, and any more specific questions you have.

Regards

Ken
 
Thx Ken
The control i need is for steam heating 2 vessels max temp 98c fixed. controlled outputs 4-20ma.The Thing i don't understand is where to put these blocks and how to call them. Sorry for being a complete Dumpling

Voyage
 
Hello voyage;

Open the project you want to modify (offline, of course); go to the Blocks folder, see if OB35 exists.
If it is not there, right-click on the Blocks level in the navigation tree at left, insert an OB, name it OB35 (you can ajust its cycle time in the processor's properties, in the Hardware Config editor).

Double-click on OB35 in the blocks folder; go to an unused network; from the library copy FB41, paste it into the unused network; the block call should be marked in red, as you need to assign a new instance DB number to it, associated with this call of the FB. Indicate a new, unused DB number (look at the DBs in the Blocks folder, choose a new one). This will be the interface for your first PID loop (you can give a symbolic name to the Instance DB you chose, to recognize the loop in your program). Go to the next network, do the same for your second PID loop.

Now click on the first call of FB41, and press F1; a help window should open describing the different parameters of this FB. Looks complicated, but you will find that there is a way to simplify your requirements. There is a flowchart linking all the parameters in a single diagram.

fb41_diagram2.jpg


Start at the left uppermost parameter, work your way down.
The first parameter is SP_Int, decribed in the help file as a REAL value holding the setpoint; create a variable of REAL type where you will write the setpoint value and write the address or the symbol of that value here. Then it can be changed in the program or an HMI.
The next values are paired: PV_IN and PV_PER, and a selection is made between the 2 on the value of PVPER_ON; PV_IN is a REAL value, scaled from -100.00 to +100.0% (as if you choose to scale the 4-20 mA signal from the field in a seperate block, FC105 "Scale" for example); PV_PER (process value peripheral) is a WORD value that takes the unscale input from the analog input directly (you scale the input with the values in CRP_IN and PV_NORM); you select between the 2 options by changing the value in the BOOL parameter PVPER_ON.
And so on, and so on...You want Integral action, start by setting I_Sel to TRUE (actually use a BOOL address in your memory area and write 1 to it)., then assign an Integral gain to TI (reset time, a TIME format variable, with a value larger than the CYCLE parameter). You don't want derivatie action, place D_SEL to FALSE. And so on, step by step. CYCLE must be set to the same value as the time cycle for OB35, as previously mentionned.
There is a little twist you have to watch out for, besides the MAN_ON parameter that Ken mentioned; the COM_RST parameter (BOOL) should be set once in OB100 (First scan OB), and reset at the last network in OB35, so that it is active only once for the first execution of the PID logic. If other FB41 are already programmed, use the same bit address as they use for this parameter.
I really hope this does not make the issue even less clear to you,
Daniel Chartier
 
Last edited:
voyage said:
Thx Ken
The control i need is for steam heating 2 vessels max temp 98c fixed. controlled outputs 4-20ma.The Thing i don't understand is where to put these blocks and how to call them. Sorry for being a complete Dumpling

Voyage

Right - hang on a bit - these are steam Jacket mixing/storage vessels ? You are probably wasting your time with PID . The only time that this works well with jacketed vessels is when there is a constant flow from the vessel and a setpoint quite a bit lower than the boiling point of the liquid . Since your setpoint is nearly boiling , you may consider that simple on of control is all that is required .

If you do want to go the way of PID , for whatever reason - then you have good examples above - I won't guild the lilly with adding to the advice save perhaps to say that you probably will want to select D as on in this particular case .
 
Last edited:

Similar Topics

Hi I need to setup a Delta MS300 VSD. I have not done something like this in years so any help would be appreciated. I am going through the...
Replies
0
Views
1,288
Can anyone simplify this code for conversion into Studio 5000 LAD. Thanks
Replies
0
Views
1,388
Hi all, I'm quite new to this. Although I have some IT knowledge this is different stuff. I'm breaking my head over the following. I have SF and...
Replies
3
Views
1,761
hi all, I am new to this page but work in the automotive trade as electrical mechanical maintenance engineer just done a basic plc course with...
Replies
2
Views
1,108
I'm trying to find out whether it's possible to interface an InTouch SCADA system to a CS300 system using the CS300 peer-to-peer protocol. Any...
Replies
0
Views
1,944
Back
Top Bottom