Pressure PID control M221

goblins

Member
Join Date
Mar 2022
Location
Poland
Posts
2
Hi

I am a beginner and therefore have problems with M221 PLC programming. I want to program the PLC so that the pressure increases slowly (I want to be able to choose 2 the possibility of increasing the pressure 4 and 8 minutes) to 6 bar in the tank. I have a problem with programming PID (I wanted to do the whole thing in PID), to regulate the pressure I want to use a proportional valve on the output to regulate the speed of pressure increase / decrease. Can anyone help me with this? Does anyone have an idea how this can be done?
 
I sort of agree with Goblin, It depends on the PID function I do not know the M221 but there are probably a few options.
1. If the function has a manual mode just switch it to Manual, increment the manual parameter until it gets close to required set point then switch over.
2. Make the set point starting at 0 incrementing it over time then when process variable is close to required SP use the actual SP.
There my be in-built functions that can profile the output i.e. stages this is common on some stand alone controllers.
 
What is the medium in your tank?
Are you using a proportional relief valve?
Do you have a schematic of the system?

You might not need a PID to accomplish this.
 
I want to be able to choose 2 the possibility of increasing the pressure 4 and 8 minutes


Hello, I am not sure I understand this, do you mean this?
Chcę, aby sterownik PLC mógł wybrać jedną z 2 opcji: zwiększenie do stałego ciśnienia końcowego za 4 minuty lub za 8 minut
(I used Google to translate to Polski from "I want the PLC to be able to choose one of 2 options: increase to constant final pressure in 4 minutes or in 8 minutes" - please do not apologize for your English, it is far better than my Polski I am sure)

Anyway, assuming that is correct, then build the model from pieces:

  • A timer, Ramp1sTimer, that can generate a rising edge every 1s
  • A counter, RampCounter, that will have a preset of either 240 (4 minutes) or 480 (8 minutes).
  • A PID that controls the pressure
  • A way to enter either 240 or 480 into the counter preset
  • A way (HMI? discrete input?) to write a 1 to a bit (boolean) named StartRamp, to start the ramp.
  • A bit named RampIsActive: will be 1 when ramping the pressure control PID setpoint
I will assume the pressure starts at 0bar; if it starts somewhere else that changes the arithmetic calculation but not the approach.

There will be several rungs

  • Rung 1: a Start/Stop Circuit pattern (see this link) to determine when the ramping is active
    • Start: Normally Open test of the StartRamp bit
    • Stop: counter is done (accumulator >= preset)
      • Implemented here as [Normally Closed] test of RampCounter
    • Run: the bit named RampIsActive as both
      • the output of the rung, and
      • the seal-in branch i.e. [Normally Open] RampIsActive
  • Rung 2: the repeating timer Ramp1sTimer with a 1s period, that is active when the value of RampIsActive is 1 i.e. [Normally Open] test of RampIsActive, probably in series with a [Normally Closed] test of Ramp1sTimer
  • Rung 3: the counter RampCounter fed by a [Normally Open] test of Ramp1sTimer, so the RampCount counter increments by 1 each time Ramp1sTimer times to 1s
  • Rung 4: if RampIsActive is 1, then the result of the following calculation should be put into PID.Setpoint:
    • 6(bar) * RampCounter.Accumulator ÷ RampCounter.Preset
  • Rung 5: RampCounter should be reset whenever RampIsActive is 0 i.e. [Normally Closed] test of RampIsActive feeding a reset instruction
  • Rung 6: if the 1 in StartRamp was written from an HMI, then there should be a rung to write a value of 0 to StartRamp whenever the value of RampIsActive is 1
Once the StartRamp bit puts a 1 in RampIsActive, the seal-in will maintain that 1 in RampIsActive until the counter completes.

When the counter completes, it will put a 0 into RampIsActive, which will stop the repeating timer (rung 2) ; it will also stop writing to PID.Setpoint (rung 4).

Caveats

It will actually take longer tha 4 or 8 minutes to get to 6bar, because the Integral action of the PID will be doing most of the work, and that will only occur when the PID sees non-zero error i.e. when the measured pressure PV is behind the ramping (moving) setpoint. One way to adjust for this would be to ramp over a shorter time e.g. use presets of 230 or 470 in the counter.

At any time, if StartRamp becomes 1 again, the sequence will repeat from a setpoint of 0; this might be a problem if the process is already steady at 6bar. So it might be useful to have some logic to prevent StartRamp becoming 1 from writing a 1 to RampIsActive, e.g. when the PID setpoint is above 0.05bar.

The PID control is left as an exercise for the user. We do not know the process or how the PID output controls the pressure; it could be anything:

  • The VFD speed reference of a motor driving compressors or pumps to pressurize a tank or piping system
  • The inlet or outlet valve of a tank volume
  • A steam valve into a vessel to cure a product via ramp and soak
  • etc.
P.S. I agree with the others who said the PID might not be necessary, so you should consider at the entire process.
 
It is a little unclear is the proportional valve a relief valve i.e. not controlling inlet but outlet ? that is what seems to be the case.
If so then it would be a negative action.
in other words, starts off at zero (or low pressure), valve open, slowly closes until tank pressure is at set point ?.
perhaps a PI & D drawing even a simple one would help.
 
Thanks for the many replies.



I apologize for my English.



I will try to describe exactly what it looks like.

1) The pressure in the tank is to increase linearly from 0bar to 6 bar or 10 bar (selection), I want the user to be able to choose how quickly the pressure should rise (two types of speed 20min and 30min and a choice of pressure range)).

2) To regulate the rate of pressure increase, I want to use a 0-10V proportional valve, bleed at the outlet of the tank (there is also a pressure sensor installed in the additional outlet in the system)

3) There is nitrogen gas in the tank.

4) I am wondering whether to use an ITV pressure regulator at the input (compressor pressure is 10 bar), which is your idea.

Option selection from the HMI panel.



Thank you for your help so far
 
Well, it looks like you need a reverse acting PID (Many can do it just a setting on the PID block, however, never used the M221 so don't know, you could easy reverse it just subtract it from 100 or what ever your PID output is.
 

Similar Topics

Second guessing myself here, need someone to either tell me I'm wrong or confirm that my thinking is correct please. I have an equal-percentage...
Replies
3
Views
2,744
I have a PID loop I would like to produce a mathematical model for. I may not have paid enough attention in the Control Systems lectures a few...
Replies
1
Views
2,120
Good Morning, This may be an easy question for some...but I'll need a little guidance. I have a project where under a particular condition I...
Replies
2
Views
1,609
Hello all, I'm looking for a bit of advice/help with the above problem. I'm looking at a fuel gas line with two valves (different flow ratings)...
Replies
4
Views
4,499
does anyone have an example of this in a Contrologix FBD? This is my first time having to program one and I want to make sure that I am on the...
Replies
2
Views
2,584
Back
Top Bottom