s7 pid problem

DDV

Member
Join Date
Jul 2006
Location
Stellenbosch
Posts
187
Hi All,

I am trying to simulate a simatic s7 pid block with Siemens PlcSim, but no luck. Can this be done or am I wasting my time trying? It works in the field on a actual plc.
 
Yes, should i be able to simulate a continuous pid controler FB41 via Simatic PLCSim? The block is correct as it works in the plant, but i wish to simulate the input values for a trending aplication done with winCC Flex?
 
Comparing between successful field operation and unsuccessful PLCSIM operation it may be that the thing that's missing in PLCSIM is any form of feedback to the PID block. Remember, PLCSIM does just that - it simulates the PLC, not the process.If you want a dummy process to take the output of the PID loop and respond by changing the PV of the PID loop try adding an additional block to the PLC code. There is a block in the TI-S7 Library called LEAD/LAG (can't remember the FB number off-hand) which can be used for simple process simulation. Use the PID output LMN as the input to the LEAD/LAG block, and take the output of this block (suitably scaled) as the PV for the PID. Judicious choice of lead and lag parameters will allow various forms of 'process' response to be produced.

Regards

Ken
 
FB80..that could work, but how will i ensure that the feedback remains realistic? I dont know exactly how fb80 works so i think i will first read up on it. Thank you for your input.
 
Thank you Peter, much appreciated. I will read up on it and test my program again I work with S7-200 a lot and find it much simpler than the S7-300 PID control, but sadly there is no simulator I am aware of. I unfortunately do not know what a SLC50x is.
 
DDV

I don't know how 'realistic' you want your process simulation to be. You may never achieve it using what you've identified so far.

To clarify a few things so far - you are not 'simulating' a PID block in PLC-SIM, you are executing it. So let's say initially you have identical PV and SP, therefore zero error, therefore zero output. If you raise the SP, the PID block execution will respond by producing an output value. However without a process to react to this increased output the PV will stay at the same value it was previously. Depending on your P, I and D tuning parameters you may find that the loop output will continue to rise, eventually reaching 100%, still with no effect on the PV. This is not because of any issue or problem with PLC-SIM or the FB41 PID block.

To add a connection between the output and the PV I've suggested the FB80 (well found!) and Peter has suggested some other code. If you want to create realistic simulations of your process dynamics then you need to know exactly how your process operates at present and try to recreate these conditions within the software. However I've never been convinced that PLC-SIM can be used for time-critical analyses with any degree of accuracy or realism. It's really designed I think for proving the operation of logic and basic functionality of the application code. Even the execution and response rates of FB41 may be slightly different considering the different environments it will be running in: PLC operating system vs. Windows and PLC-SIM.

So provided you only want to show a movement of PV and LMN responding to changes in SP in a trend screen then the issue of realism doesn't really enter in to it. If you seriously want to get in to realistic process simulation then you will need some specialist process simulation software plus a real PLC to execute the control exactly as it will be in the real plant. You're entering a whole different world!

regards

Ken
 
Thank you Ken. I must be doing something wrong because I do not get any output from the block while executing it from within PLC SIM. By the look of it, it seems that my initial question has been answered, and that is that it should be possible to run the simulation in some form, even if I will not easily achieve simulating the actual plant environment. For me, I will do some more tests, for the rest of you, “baie dankie” , that’s Afrikaans for “thank you”.

 
Hi DDV

Try creating a simple project with only a single FB41 and download to PLC-SIM. Don't provide any actual parameters to the block's formal parameters. You should be able to get something happening just to prove the block itself is executing.

I'm not at a PC with STEP7 at present but there is a PID setup tool installed with STEP7 (find it from Start > Simatic > STEP7 > PID Setup {or something like that!} ). This provides a small utility for putting in tuning parameters, adjusting the mode etc. There is also a trending window to see the results of changes you make.

Beware of things like the MAN_ON parameter. The default status of this in the instance data block is TRUE. To get the FB to control the output value, you have to ensure MAN_ON is FALSE. In real life this may be done by code controlling an actual parameter, code controlling the data in the instance block, input from a SCADA or HMI, or a link to a physical input address. When you've got nothing else interacting with PLC-SIM you're obviously free to adjust this in the DB (or using a VAT) as you please.

Try tinkering with this trivial set-up just to convince yourself that the block is capable of working. Then gradually add other bits and eventually substitute your own project.

Good luck

Ken
 
Thanx Ken, I managed to get a basic block going, I suspect that the MAN_ON was my problem as I was not changing the default true value from the simulator; this is done in the field from a TP170. My output keeps on rising, as you said; because I don’t give the block any feedback, I will now try simulating the plant conditions using FB80.

I have been reading some of the previous treads, and I must say, the people giving advice on this site is some of the sharpest I have encountered.



Any one a expert on Factory link?
 

Similar Topics

Dear all . I made a program for boiler tank using TIA V15 , the program consists of 2 PID blocks in OB30 . but the PID didn’t work automatically...
Replies
3
Views
2,665
Dear all . I made a program for boiler tank using TIA V15 , the program consists of 2 PID blocks in OB30 . but the PID didn’t work...
Replies
1
Views
1,126
Hello Friends; I am working on a GE Funac LM 90-30 software. I face the problem to set the CV value when PID in auto mode. The parameters are set...
Replies
13
Views
3,031
I had a problem on a hydraulic servo controlled cylinder, which I believe was caused by the PID loop and the cylinder reaching a hard stop at one...
Replies
10
Views
2,450
We have a machine we're trying to commission. It's a web converting machine. It takes webs of foil, wicking paper & a label and creates a chemical...
Replies
1
Views
1,310
Back
Top Bottom