Level control using s7-300 pid block

sirhiss2

Member
Join Date
Oct 2003
Posts
109
Newbie to level control/somewhat familiar with this PLC.
I'm Trying to figure out how to set up a basic level control using s7-300 PID Block (Cont_C). banghead

I have a Delta P (4-20mA) connected to A/I card.
A/O connected to I/P to control valve (3-15psi).

I'm having trouble setting up Block in programming.
Am I using the right block?
Is there another way of setting this up?
Any suggestions as to how I would setup this block?
Someone told me that I may have to use a data table. What's up with that? :unsure:
 
If you are interested I can give you the manual of Siemens PLCs (for S7-300 of course).
There is another trick: you should besides plc programming know that level control has special tricks and I can't help you more if you don't provide more information.
 
sirhiss2 said:
.
A/O connected to I/P to control valve (3-15psi).

Someone told me that I may have to use a data table. What's up with that? :unsure:

The control output is controlling a pressure not a flow. Since the flow is proportional to the square root of the pressure this is not a linear function. I would have the PID output a flow and then square this number and then scale it to the 3-15 psi. You shouldn't need a table for this. A few math blocks should work well. S7s are good at this sort of thing. I would do the math in STL.

WHY 3 PSI as the minimum? What pressure drop occurs at no flow? It had better be 0. What you are saying is that there is alway some fluid flowing.

I have an S7-315DP. I haven't played with the PID on it yet. I have looked at it and it looks easy enough.
 
Having 3psi as the minimum pressure is analogous to having 4mA instead of 0mA as the minimum current. I/P is current to pressure. Typically a 4-20 mA signal goes into the transducer. An air supply typically of 60-100 psi is connected to the valve actuator. At 4 mA the transducer supplies 3 psi. At 20 mA the transducer supplies 15 psi. At 3 psi the valve closes. At 15 psi the valve is full open.
 
You are assuming a lot.

godfrey said:
At 3 psi the valve closes.

What closes the valve? A spring? Gravity? sirhiss2 did not mention that. Now one must not only control the tank level, but must also have feed back to control the valve position. This requires cascaded control. sirhiss2 didn't mention the need for that either.

Obviously for any of us to say anymore requires assumptions that may be wrong. sirhiss2 will need to find out what he is really controlling. Filling out the parameters on a PID is meaning less until the basic control strategy is clear.
 
Peter, trust me the valve position doesn't need to be controlled. A normal valve, if it is very important, has an element called positioner that takes care of the valve's exact position. It is actually a mechanical/pneumatical PI controller located on the body of the valve.
The main issue and one of the possible causes of sirhiss2's problems is that he is newbie to level control. When controlling level important things are: what is the diameter of the tank, how high is it, is it conical (gain sheduling needed for P), is the controlling valve located before the tank or behind or both, what is the diameter and shape of the tanks outlet; usually cascaded control is necessary where either flow control or pressure control is in the inner loop. Now digitally controling all this for a new guy in the businness is a great challenge.
 
:(

Looks like you guys misunderstood my problem.

Let me offer this information:

I'm Planning on using:

S7-300 CPU315-2DP
AI Card - AI8x12 Bit - 6ES7-331-7KF01-0AB0
AO Card - AO8x12 Bit - 6ES7-332-5HD01-0AB0

A delta P (don't matter what type) as input to analog card.
and analog output card to control valve.(dont matter what type of valve.) Programming in plc will use info. form delta P to manipulate valve control. Very basic level control setup. My problem is not with setting up the process it's just with the PLC. Just want to get familure with control using the Pid block of this PLC. banghead Getting very frustrated!!!

What PID Block can be used effectively with this PLC?

I think from my research I have available "PID_CP" & "CONT_C".
Some examples that I have don't explain where the information in the block came from or why they used these addresses and values.

I want to know what Pid block can be used with this plc and if you can give me or point to where I can find out how exactly do I setup this block. Or mabie one of you guys can walk me through this.
Not many people know how to do this, and if they do their answer is way over my head.

Thanks for all your help. (y)
 
sirhiss2 - I used the same cpu 3 years ago. I had 3 pid loops and used the CONT_C block.

Setup hints:

I put the PID blocks in an OB35 block, which is the cyclic interupt, set to 100 ms. Somewhere you have to enable the OB35 and set it's time. I can get the Run Time Properties of the CPU and see it, but can't rememeber the steps to edit/change it. Seimens Tech. Support should be able to help with that. Or maybe you can't change it for that CPU ?!?


After adding the block (FB41) to your project, insert a empty block (right click on the rung) into your logic and type in CONT_C.

The DB above the block will show as '???'. edit that to a new DB name and S7 will ask if it should generate it. Say yes. You now have a DB with all the PID vars in it.

While some people may write directly to the DB for such things as SP, Manual, PV, I defined tags in another DB and entered them as inputs to the block. IIRC, someone told me I had to do it that way.

IIRC, you can configure it to read the AI (PV_PVR)and write the AO (LMN_PER) directly by setting the PVPER_ON to True, but again, I output the MV (LMN) to another tag for some scaling before converting and sending to the AO. Further looking at the on-line help for the block indicates that the 'preipherie' (as they call them) addresses in the DB, may only be scaled for peripheral format and not the actual card address.


Again, a call to Tech. Support can help with this. Or just used the LMN in REAL format and convert and read/write yourself.


So, for my block, I have REAL inputs going to SP_INT and PV_IN, the REAL output at LMN, used the MAN_ON input for manual/auto control, have set, via the DB, the Derivative Off, set the LMN_HLM to 1.0e+02, CYCLE to T#1S,P_SEL TRUE, I_SEL TRUE, D_SEL FALSE, PVPVR_ON FALSE, PV_FAC = 1.0 LMN_FAC = 1.0

HTH,
Dave
 
beerchug
Thanks Dave,

I'm going to try what you have suggested and see how far I can get.

Thanks to all you guys that took the time to reply.
(y)
 
JustDaveIII,

I did what you said.

I have OB35 created. I inserted Cont_c in rung, addressing it to DB1.

Info:

My A/I address starts at 448 and ends at 463. I set channel 1 to 2dmu current (2 wire transmitter 4-20 mA)and deactivated the other 3 channels.
My A/O address starts at 464 and ends at 471. I set channel 1 to I (current) 4-20 mA and deactivated other 3 channels.

Questions: :unsure:

#1 - Where do I enter my analog Input and output addresses?
Is it in DB1 under address? PV_PER indicates 14.0 (under address) set for word W#16#0.
LMN_PER indicates 76.0 (under address) set for word W#16#0.

#2 - If I were to create other DB's, would I use these addresses In DB1 for A/I and A/O addresses?

#3 - Can I use OB1 to do the scaling and can I call A/I info or DB info after it has been scaled from DB1?

#4 - When you said
I output the MV (LMN) to another tag for some scaling before converting and sending to the AO.
Why do you whish to do this?

Thanks in advance for all the help.
beerchug
 
Unfortunatly I can't answer most of your questions as I never did direct I/O to/from the PID block. You'll have to find a manual and/or call Tech. Support for that.

What I did for the PV is read it from the AI card, scale it to a REAL as 0-100 in some logic. I did that 'cause all my other logic and MMI readout were best that way.

I took the output from the PID block (LMN) which (IIRC) is a REAL, 0-100, and had to sometimes override it, depending on my process state. ie, if certain alarms were active I wanted 100% output to my process.

I'm not familliar with OB1.

The rule I followed, wheather to write directly to the PID DB was that if the PID block (in ladder logic) had rung connections I put some other DB location feeding the inputs and take the outputs to some other DB addresses. If the block didin't have connections, then it was OK to read/write directly into the DB for it. Like Gains.

Dave
 
🍺

Thanks JustdaveIII,

I sent an email to Siemens Tech support and have yet to hear anything.
I will let you know what I find out.

Thanks
 
You are required to program the plc to implement automatic or manual PID level control on level control rig. You required to implement level control incorporating the following:
Differential Pressure Meter
Variable Speed Drive (VSD)
PLC with analog I/O
Electronic Chart recorder.
You will be required to configure the VSD.
Auto/Manual control must be via a on/off switch connected to the PLC.
In manual mode the VSD must be controlled via a additional analog input on the PLC.
Chart recorder must display the liquid level also coupled to the PLC.
Use a variable table to display the following:
• Liquid Level
• Auto/Manual mode
• VSD analog input signal
im using a siemans s7 300 plc in simatic 7 im use to programming in ladder can u give ame advice in on where to start​
 

Similar Topics

Anyone have a plc program example of speed control on a vfd using high/low level switches. Speed increases for every second the low level is on...
Replies
31
Views
9,819
Hi all, I am going to be programming a demo station for a project, the intended purpose is to demonstrate the control processes in petrol storage...
Replies
0
Views
1,004
Hello.. i need help doing my project..i dont know how to start using CJ1M plc..can anyone?
Replies
2
Views
2,650
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
384
Have a logix controller and I'm using the PIDE block for the autotuner. I've got the hang of doing it for direct control things like pressure...
Replies
21
Views
1,669
Back
Top Bottom