PID tuning on SLC 5/05

Robb B

Lifetime Supporting Member
Join Date
Feb 2011
Location
BC, Canuckistan
Posts
356
Hi everyone, yet another PID problem. I'm hoping I understand enough of the process I'm controlling that my request for help is reasonable. If a different approach is needed or more information, we can do that. Testing intervals are few and far between, typically days, which makes data collection tricky. I'm using https://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1747-rm001_-en-p.pdf as a reference, if it helps. Chapter 9.

First, what am I controlling? Air pressure in a treating vessel, in the range of 0 - 180 psi (Pressure Relief Valve setting). The vessel is large, but the volume is relatively low (I don't know exactly what volume, maybe 10 cubic meters?) due to being full of oil and wood.

Second, how is it controlled? The pressure is supplied by a constant speed pump (40 HP motor), pumping the oil from a storage tank. The Control Element is an analog output to a Current to Pressure (I/P) transducer, piloting 3 - 15 psi to a larger valve which modulates the air from the vessel to a vent line. Response time from closed to open is around 8 seconds, if more accurate timing is needed, we can do.

Third, what changed? Current PID settings worked okay when the pressure setpoint was 165 PSI. The process would run up to about 170 PSI, at which time enough error accumulated to drive the valve to a position that maintained setpoint fairly well (around 38 - 40% open), plus or minus a few PSI. The setpoint has now changed to 125 PSI, and results in a lot of overshoot, up to 35 PSI, which is undesirable to the managers.

I have read a lot of the threads here about PID, and I think a complete re-tuning of the PID terms is required, I'm not sure where to start. I have tried a few informed WAG's, and noticed that with increasing D (no D previously used) there is action on the CV before it reaches setpoint, without D, there is no action until the setpoint is reached. Negative error accumulates from the P and I, and doesn't cause any change in the CV. From this, I infer that D is an absolute value, whereas P and I both are a positive, in that negative error produces negative CV. I have also tried the PID in manual mode, entering CV at 40%, then switching to automatic. This provides a very desirable response, although it will increase the time required to get to steady state. I was thinking of implementing feed forward bias, but I can't see how to enter a value into the setup screen, it's grayed out. I tried entering a number directly into word 6 of the control block, but it zeros out. Is it a value that needs to be MOV in by logic? Is a feed forward a reasonable way to proceed if the response is adequate?

I have attached a screenshot of the PID rung. Yes, it is on a conditional rung, this is how I inherited the programming. Ideal results would be the fastest possible PV = SV with minimal overshoot (<5 PSI). Minimal overshoot is more important than time to reach steady state.

Pressure PID.jpg
 
Last edited:
Summat is not making sense to me: pressure supplied (increased?) by pumping oil but relieved (reduced?) by venting air to a vent line?

What happens when you run out of air i.e. when the oil takes up all of the volume? Or does the incoming oil stop when its level in the vessel reaches some target? Or does the oil contain entrained air?
 
I have never used FF in a SLC but it sounds like it may help your situation. The manual (https://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1747-rm001_-en-p.pdf)
states use word 6 of the control block (MOV a value into N16:6 in your case if I read correctly), valid values -16383 to +16383...It appears that FF will always keep that offset in the CV so may have to be careful if you need your I/P to be able to fully close, the offset may prevent that from happening, but I am not sure about that.

Perhaps the easiest way to reduce overshoot would be to reduce controller gain, which also may increase your time to steady state...

One thing to watch out for is to make sure your I/P is keeping up with the PID output. If you have position feedback this should be easy to check, and if you have a considerable lag, you may have to slow down your PID (reduce Kc, Ti) or even increase your loop update time so your PID is not making further changes to the CV before the valve has reached the previous position requested by the CV of the PID. If your valve is moving at a rate of 0-100% in 8s that means that it can only move about 3.125% (assuming its response is linear) per PID loop update (0.25s) so if your CV is changing faster than that, your PID is probably too fast for your system.

Also, I would make sure that the two timers triggering the PID execution in different conditions are set to the same rate if possible, otherwise you probably should have two separate PID instructions each with their own settings...well that's my opinion from afar without really knowing your system.

Hope this helps. It has been a while since I used a PID with an SLC.
 
...The setpoint has now changed to 125 PSI, and results in a lot of overshoot, up to 35 PSI, which is undesirable to the managers. ... Negative error accumulates from the P and I, and doesn't cause any change in the CV.

Negative error does not accumulate P(roportional); the P action's contribution to the CV is decreasing in magnitude* as PV approaches setpoint.

* though not in sign

Also, error does not accumulate: the magnitude of the contribution to the CV accumulates from the the I action.

From this, I infer that D is an absolute value,

Td is zero, so there is no D action, but if it did it would work in the same way as the P and I.

whereas P and I both are a positive, in that negative error produces negative CV.

Yes, this is a direct-acting control: as the pressure increases, the CV increases to release air and lower the pressure. The way this is done in this case is by the definition of the error via the [Control Mode: E=PV-SP] configuration option.

Is a feed forward a reasonable way to proceed if the response is adequate?

Anything is a reasonable way to proceed if the response is adequate ;).

But I don't see what you have to feedforward from. The problem seems to be that a new setpoint changing the (time) response characteristics of the process (how varying the CV affects PV over time) invalidates the model implicit in the PID tuning parameters (Kc, Ti, Td).

In @Nachtwey-speak, the setpoint (i.e. operating point) change has moved the system** poles around.

** system = process + PID

I am pretty sure you need to, at a minimum, increase Kc by ~ √(165/125), because Pressure is proportional to accumulation (pv = nRT for low pressure), so dpressure/dt is proportional to dn/dt, but dn/dt is proportional to √pressure (again assuming critical flow). You probably also need to increase Ti, because the lag time, for a fixed change in PV (CV?), is longer at the lower pressure.
 
Last edited:
Summat is not making sense to me: pressure supplied (increased?) by pumping oil but relieved (reduced?) by venting air to a vent line?

What happens when you run out of air i.e. when the oil takes up all of the volume? Or does the incoming oil stop when its level in the vessel reaches some target? Or does the oil contain entrained air?
I think the OP is saying that the PILOT valve is controlled by oil flow. The PILOT valve controls the position of the main spool that that controls the flow of air. The response of the oil controlled pilot spool should be considered instantaneous relative to the rest of the system response.

The output limit is 0 to 100%. This means if the output wants to go negative to reduce an over shoot, it can't. The system must bleed air by some method without increasing the pressure to the relief valve setting.

Does the system naturally leak air? In this case the air pressure will blead off at some rate until the set point is reached. The output will be zero. The integrator term should not be allowed to wind down. The integrator term should be limited to 0% on the bottom.

A derivative term is not required. Since this is almost a type 1 or integrating system, I would try to tune the P gain first with no integrator. What will happen is that the control will suffer from a little proportional droop. Adding a bias can compensate but usually the integrator is used.

If the tank does not leak air then simply use the P gain since the tank will integrate the air flow into pressure.

The problem is that if the system pressure ( air supply ) is constant, the amount of flow through the valve is going to be a square root function of the pressure drop across the valve. This means the open loop gain is higher when the tank is at 0 pressure and lower when the PV reaches the SP. Therefore the controller gain should be reduced as the PV rises to the SP.

So if you change the CV when the PV is at the normal operating point, the open loop gain will change by Kol(PV) = Kol(SP)sqrt((Supply_pressure-PV)/(Supply_Pressure).)
Kol(SP) is the open loop controller when the pressure is at the SP. Notice that as the PV rises to the supply pressure, the open loop gain drops to 0 because no matter what control signal you send to the valve, there is no flow without a pressure drop.

So the controller gain should be proportional to the inverse the open loop gain. To keep the gain constant.

drbitboy. It is the gains that change, not the poles. However, the poles will change if the amount of material in the tank changes because that changes the volume of air needed to change the pressure in the tank.

I doubt dead time plays much of a part in this system because the air pressure will equalize quickly throughout the system. It is the non-linear flow through the valve as a function of pressure that is the problem.
 
Summat is not making sense to me: pressure supplied (increased?) by pumping oil but relieved (reduced?) by venting air to a vent line?

What happens when you run out of air i.e. when the oil takes up all of the volume? Or does the incoming oil stop when its level in the vessel reaches some target? Or does the oil contain entrained air?

The treating cylinder is held closed, full of wood and oil, there is some air space inside, but very small amount. The oil is pushed into the cylinder by the pump, which is supplied by the storage tank. The pressure inside the cylinder is modulated by the I/P transducer which modulates a larger (3" line I think) proportional valve, which is vented.
 
I have never used FF in a SLC but it sounds like it may help your situation. The manual (https://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1747-rm001_-en-p.pdf)
states use word 6 of the control block (MOV a value into N16:6 in your case if I read correctly), valid values -16383 to +16383...It appears that FF will always keep that offset in the CV so may have to be careful if you need your I/P to be able to fully close, the offset may prevent that from happening, but I am not sure about that.

Perhaps the easiest way to reduce overshoot would be to reduce controller gain, which also may increase your time to steady state...

One thing to watch out for is to make sure your I/P is keeping up with the PID output. If you have position feedback this should be easy to check, and if you have a considerable lag, you may have to slow down your PID (reduce Kc, Ti) or even increase your loop update time so your PID is not making further changes to the CV before the valve has reached the previous position requested by the CV of the PID. If your valve is moving at a rate of 0-100% in 8s that means that it can only move about 3.125% (assuming its response is linear) per PID loop update (0.25s) so if your CV is changing faster than that, your PID is probably too fast for your system.

Also, I would make sure that the two timers triggering the PID execution in different conditions are set to the same rate if possible, otherwise you probably should have two separate PID instructions each with their own settings...well that's my opinion from afar without really knowing your system.

Hope this helps. It has been a while since I used a PID with an SLC.

Your view of the Feedforward setting is the same as I interpret the manual as well, if I enter a value there it will be constantly applied, which might be okay.

I have not timed the response of the system to a full closed to open cycle of the control valve, I will try to do. Your point on update rate may apply.

The two timers are separate steps in the process. The timer done bit is a delayed start, and stays true the entire pressure cycle. The timer timing bit is from the next step, which is to bleed off pressure safely and slowly.
 
SNIP

But I don't see what you have to feedforward from. The problem seems to be that a new setpoint changing the (time) response characteristics of the process (how varying the CV affects PV over time) invalidates the model implicit in the PID tuning parameters (Kc, Ti, Td).

In @Nachtwey-speak, the setpoint (i.e. operating point) change has moved the system** poles around.

** system = process + PID

I am pretty sure you need to, at a minimum, increase Kc by ~ √(165/125), because Pressure is proportional to accumulation (pv = nRT for low pressure), so dpressure/dt is proportional to dn/dt, but dn/dt is proportional to √pressure (again assuming critical flow). You probably also need to increase Ti, because the lag time, for a fixed change in PV (CV?), is longer at the lower pressure.

I think this might be the heart of the issue. To clarify, the setpoint is always 125 PSI (now, it used to be 165, and it will probably change again in the future).

There is no error before the pressure reaches the setpoint, so there is no action from the proportional and integral terms. When I have a value for derivative in, I do see some change in the Control Variable (CV) before the setpoint is reached, but there is unsatisfactory control of the Process Variable, the CV output stays around 20-25% which causes a slow rise above the setpoint. I am searching for a way to get Control Variable response to "anticipate" the value to be at before reaching the setpoint. As I mentioned, bumping the CV to 40% manually, then switching to automatic seemed to give a reasonable response.
 
whew, hopefully I have this all correct...

I think the OP is saying that the PILOT valve is controlled by oil flow. The PILOT valve controls the position of the main spool that that controls the flow of air. The response of the oil controlled pilot spool should be considered instantaneous relative to the rest of the system response.

The pilot valve uses 3 - 15 psi of instrument air to control the larger valve. The larger (Control) Valve modulates the flow of oil from the pressure pump.

The output limit is 0 to 100%. This means if the output wants to go negative to reduce an over shoot, it can't. The system must bleed air by some method without increasing the pressure to the relief valve setting.

Does the system naturally leak air? In this case the air pressure will blead off at some rate until the set point is reached. The output will be zero. The integrator term should not be allowed to wind down. The integrator term should be limited to 0% on the bottom.

Yes, everything around here leaks a little bit. :sick:

A derivative term is not required. Since this is almost a type 1 or integrating system, I would try to tune the P gain first with no integrator. What will happen is that the control will suffer from a little proportional droop. Adding a bias can compensate but usually the integrator is used.

If the tank does not leak air then simply use the P gain since the tank will integrate the air flow into pressure.

The problem is that if the system pressure ( air supply ) is constant, the amount of flow through the valve is going to be a square root function of the pressure drop across the valve. This means the open loop gain is higher when the tank is at 0 pressure and lower when the PV reaches the SP. Therefore the controller gain should be reduced as the PV rises to the SP.

The system pressure is applied by the pumping of oil into the cylinder through the Control Valve, the idea is to push oil into the wood cells, and replace what is absorbed with new oil to maintain an approximate level. About 2300 US gallons goes into the wood each cycle. The pressure applied is not constant, as it builds from 0 PSI to setpoint in a bit of an S curve. When I get a chance, I will trend some cycles.

Controller gain being reduced as PV rises to the SP sounds more like Sliding Mode Control? Maybe PID is not appropriate to this task?

So if you change the CV when the PV is at the normal operating point, the open loop gain will change by Kol(PV) = Kol(SP)sqrt((Supply_pressure-PV)/(Supply_Pressure).)
Kol(SP) is the open loop controller when the pressure is at the SP. Notice that as the PV rises to the supply pressure, the open loop gain drops to 0 because no matter what control signal you send to the valve, there is no flow without a pressure drop.

So the controller gain should be proportional to the inverse the open loop gain. To keep the gain constant.

drbitboy. It is the gains that change, not the poles. However, the poles will change if the amount of material in the tank changes because that changes the volume of air needed to change the pressure in the tank.

I doubt dead time plays much of a part in this system because the air pressure will equalize quickly throughout the system. It is the non-linear flow through the valve as a function of pressure that is the problem.

I would like to go back and correct my initial post. I got some of it confused.
 
Controlling oil pressure, not air. Sorry!

Hi everyone, yet another PID problem. I'm hoping I understand enough of the process I'm controlling that my request for help is reasonable. If a different approach is needed or more information, we can do that. Testing intervals are few and far between, typically days, which makes data collection tricky. I'm using https://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1747-rm001_-en-p.pdf as a reference, if it helps. Chapter 9.

First, what am I controlling? Air pressure in a treating vessel, in the range of 0 - 180 psi (Pressure Relief Valve setting). The vessel is large, but the volume is relatively low (I don't know exactly what volume, maybe 10 cubic meters?) due to being full of oil and wood.

Second, how is it controlled? The pressure is supplied by a constant speed pump (40 HP motor), pumping the oil from a storage tank. The Control Element is an analog output to a Current to Pressure (I/P) transducer, piloting 3 - 15 psi to a larger valve which modulates the air oil from the vessel to a return line to the pump. Response time from closed to open is around 8 seconds, if more accurate timing is needed, we can do.

Third, what changed? Current PID settings worked okay when the pressure setpoint was 165 PSI. The process would run up to about 170 PSI, at which time enough error accumulated to drive the valve to a position that maintained setpoint fairly well (around 38 - 40% open), plus or minus a few PSI. The setpoint has now changed to 125 PSI, and results in a lot of overshoot, up to 35 PSI, which is undesirable to the managers.

I have read a lot of the threads here about PID, and I think a complete re-tuning of the PID terms is required, I'm not sure where to start. I have tried a few informed WAG's, and noticed that with increasing D (no D previously used) there is action on the CV before it reaches setpoint, without D, there is no action until the setpoint is reached. Negative error accumulates from the P and I, and doesn't cause any change in the CV. From this, I infer that D is an absolute value, whereas P and I both are a positive, in that negative error produces negative CV. I have also tried the PID in manual mode, entering CV at 40%, then switching to automatic. This provides a very desirable response, although it will increase the time required to get to steady state. I was thinking of implementing feed forward bias, but I can't see how to enter a value into the setup screen, it's grayed out. I tried entering a number directly into word 6 of the control block, but it zeros out. Is it a value that needs to be MOV in by logic? Is a feed forward a reasonable way to proceed if the response is adequate?

I have attached a screenshot of the PID rung. Yes, it is on a conditional rung, this is how I inherited the programming. Ideal results would be the fastest possible PV = SV with minimal overshoot (<5 PSI). Minimal overshoot is more important than time to reach steady state.

I was incorrect, it is not air pressure modulated but oil pressure. I don't think it's very particular to the discussion though.
 
A 40HP constant-speed pump (re-read the OP) for a PILOT valve? Really?

The 40HP pressure pump moves oil from the vessel, through the control valve, and back to the tank. Pressure sensor is detecting air pressure due to being elevated above the vessel's (cylinder on it's side) full liquid level.

I really appreciate everyone's insights!
 
There is no error before the pressure reaches the setpoint,

Huh?

Error = PV[i.e. pressure] - SP[i.e. setpoint].

So, if I can assume "before the pressure reaches setpoint" means "pressure is some value other than the value of setpoint," then there will definitely be error.

I think we are talking about different things here.

so there is no action from the proportional and integral terms. When I have a value for derivative in, I do see some change in the Control Variable (CV) before the setpoint is reached, but there is unsatisfactory control of the Process Variable, the CV output stays around 20-25% which causes a slow rise above the setpoint. I am searching for a way to get Control Variable response to "anticipate" the value to be at before reaching the setpoint. As I mentioned, bumping the CV to 40% manually, then switching to automatic seemed to give a reasonable response.

What you are seeing is accumulated reset (I => Integral) action resulting in CV (de-)saturation (CV=0%), while the pressure is increasing toward setpoint.

There is also more negative CV motion calculated as long as PV is below SP, because Error (E=PV-SP) is negative, on each update, although anti-windup reset (CVmin = 0) throws that away each time.

There is also a negative Proportional contribution as long as, which decreases as E becomes less negative, but the valve will not crack open until an update when this decrease is not swamped by the I-action.

Only a bit before, or even at, the time PV crosses SP will the valve finally crack open from 0%; exactly when that actually occurs is a function of the time slope of PV, and the Kc and Ti values.

Once PV crosses to be above SP (E becomes positive), the valve will open from both P and I action,

  • with P incrementing the CV proportionally to E on each update,
    • with each P movement canceled once the PV starts dropping,
  • and I accumulating CV (reset) on each update,
    • with that accumulation remaining until PV goes below SP again.
So when you manually move the valve to 40% while the pressure is rising and then switch to manual, what you are doing is lessening by 40% the amount of accumulated CV (reset) the I action has to remove.
 
I would :
1. get rid of D....set it to 0, you don't need it
2. Reduce P by 70%
3. Change I...(make it a slower system) by 50% or more (on an AB PLC I can't recall if this means the number for I should be increased or decreased.)
4. Generally, once the overshoot is eliminated, you can gradually change I to make the system faster once again, and increase P to also make it faster but if go too far with P it will start to overshoot again and remain unstable and fluctuate.. A small amount of overshoot is OK temporarily as it will prove the system is as fast as you can make it.

All 3 strategies can eliminate overshoots, especially # 2 and 3.
 
Last edited:
The 40HP pressure pump moves oil from the vessel storage tank, [into the pressurized treating vessel, then out of the treating vessel] through the control valve, and back to the [storage] tank. Pressure sensor is detecting air pressure [above the oil level in the treating vessel] due to being elevated above the vessel's (cylinder on it's side) full liquid level.

I really appreciate everyone's insights!

Are the blue additions and red removals correct? I don't see how you can pressurize the treating vessel if it is either between the storage tank and the pump suction, or between the outlet of the control valve and the storage tank.

So as a volume of oil is pumped into the treating vessel, it is incompressible (relative to the air in the treating vessel), so it pushes the air into the remaining volume, which compresses the air into the top 8-10% of the treating vessel.


I.e. for air: PV=nRT => P=nRT/V => if nRT is constant (or close to it), then decreasing V in the denominator of [nRT/V] will increase P?
 
Last edited:

Similar Topics

Hello, I'm having a lot of trouble tuning a PID loop on a SLC 5/05. Can someone tell me if I'm doing something wrong? Please see attachment to...
Replies
8
Views
3,815
Hi, I have a system (see attached illustration) that is PID controlled. The pump is used for the injection of chemical from the tank to the...
Replies
5
Views
4,556
Hello, I am using a AB SLC5/05 PLC & using the PID insrtuction for a single loop control. I have assigned N10:0 as the control block starting...
Replies
4
Views
4,943
Hello, I am attempting to tune a PID loop on a process. The process involves a valve with electronic actuator that has quite a high deadband...
Replies
10
Views
2,071
so i have 4 25gpm wells feeding a 1000gal tank (T-1), with an additional 15gpm from a decant tank for 3hrs every 12hrs. P1 and P2 both controlled...
Replies
154
Views
35,517
Back
Top Bottom