slcman

Change P in running PID

7 posts in this topic

Hi all,

I need to change the gain in a PID instruction while pid is running. I can't just write new gain in KP variable (it will be too easy), it make a hudge bump in CV..not really what we need (see picture). Rockwell suggest to put pid in manual (.SWM) then change the gain and put back to auto. It's work but not fast enought, it's look like pid take time to calculated few thing on manual to auto transition. I'm sure there's a way to do this, I can't be the first who need to do that.

Thanks for help

 

Capture.PNG

Edited by slcman

Share this post


Link to post
Share on other sites

What are your I and D settings

you can change P, I, and D in the tag.  That’s the best place to make the change. 

What PLC?

Share this post


Link to post
Share on other sites

We don't care about I & D, my question is "I need to change P while pid is in run".

I can't change P direct in the tag LOOK THE TREND! Rockwell also says it's not a good idea.

plc: 1769-L33ER

any suggestion?

Share this post


Link to post
Share on other sites

Ok... then you really don't understand how tuning parameters interact with each other do you.

I doubt if Rockwell says that. If they did you were talking to someone that doesn't know how to tune a loop. I've been tuning loops for 40+ years so I have some idea. I'm not in a classroom, I work in running gas processing facilities. I just this morning left a plant of ours where we tuned two loops (the way you're supposed to) with the process online, the loop was running, and we used the HMI to write to the loop tags.

Your trend looks like a trend from a closed loop built in a classroom environment. The scaling is 0-100, no units, very simplistic and not at all like real life. If that's what it is it's going to be pretty squirrelly if you kept the default loop setup.

If you're still with me - See the stair steps in your CV? That's a pretty clear indication that the integral is set pretty fast. You didn't tell me if you're using a PIDE loop. If it is a PID loop how is it configured? Under the General Configuration Tab, middle right side, you'll see Equation Type. Independent or Dependent. Depending will make the I units min/repeat and the D units minutes.  Independent is the inverse, ie I unites are 1/min (or repeats per min) and D units are also minutes. If the loop has default values here then Equation Type will be Dependent and Integral will = 0. OR 1/0 <--- divide be zero is never good. Switch to Independent and set Integral to 15m (or some large number to get it out the way.

ControlLogix has nice trending. Much better than whatever your screenshot is

 

 

2019-09-24 15_55_32-Properties - PID1.png

1 person likes this

Share this post


Link to post
Share on other sites

Sorry if my answer was rought a little, very often I got answer from people who doesn't know what they are talking about. They just answer without answer, it's look like it's not your case Wow thanks for reply. I do programming since 25 years, however I do not pretend to be an expert on pid subject. My experience is more related in manufacturing not process.

I've really ask Rockwell on how to change P while loop running and they recommend to put loop in manual. This is strange, I already change loop parameter on the fly with Schneider M258 and Siemens plc. Maybe it's wrong to put it in manual..honestly this is a good new and it make sense. I'm not always impress by AB tech connect.

You're right about the trend, it's look like a classroom environement. I made it with Studio 5000 emulator v30 for testing and try to figure out what to do before the visit to customer. I'm sure you understand this, production environnement is not a good lab. I'm actually try to figure out how to fix this loop. Altough emulator is not real life, it help to test the idea.

You're right again about the very small value of I. The loop have to respond very fast. It drive a 125Hp fan and the load is very variable. PV is pressure. Now let's talk about real life, real trend. 

PLC: 1769-L33ER v30

Instruction is PID (not PIDE), it run in a periodic task at 75ms.

Tunning.png.2c1cc4bb75010e927eb173eefd92Config.png.f181efb1b304ae916143b7466296b

 

Fan is used as exhaust from combustion from boiler. At any time a boiler should start and create hudge change while purging. The idea was to use an higher P while purging. But if you have better sugestion GO I like to learn.

This is a trend at normal operation, you can see variation from press transmitter. They will always have some variation on press because of combustion. We ran few test without any boiler in run and pressure signal is quite linear, combustion create fluctuation, we have to deal with. This is why I use an average value.

light blue is instant reading from pressure transmitter

blue is average value I calculated and use for pid, hmi and so on

red is PID.ERR tag

brown is speed command 0-100% 

green speed feedback 0-100%

dashed white is setpoint

*pay attention, pen are not on the same Y scale

trend.PNG.55bb715420b8ecd58a960071f5d2f2

 

Thanks again for your time, this kind of forum is very usefull for people like us, I'm member since 2005, each time I got an answer I try to answer about 10 questions to keep to forum alive.

 

regards

Scaling.png

Alarms.png

trend.PNG

trend.PNG

Share this post


Link to post
Share on other sites

I understand your frustration. I looked back at some of your posts and you clearly have a high level of experience. Onward through the fog we go then...

I usually work in situations where there are as few as 6 loops in the FB and as many as 50 or more. It depends on the processes. With that in mind, I typically run the periodic task at 250ms. It's fast enough to not add to dead time and slow enough to prevent a lot of loops from "loading" the processor. That said, the equation "knows" the update time and it doesn't hurt to run a loop faster if the processor isn't pushing the edge of maximum. It'll cut down on dead time to run it faster but that may also be why you need a filter? It's hard to say.

You can definitely write to the P_gain, I_gain, and D_gain tag

Your idea to vary the gain by where you are in the startup process is spot on. We call that Adaptive Gain. There's a lot of uses for it. For example, in the natural gas processing business we use compression to pull gas from the field and feed the plant (or other facility) at higher pressure. Pulling field pressure down also allows the well to flow at a higher rate. Some places pull into the vacuum range. The compressor(s) have suction control valves on them. If they've been down for maintenance or the control system shut it down the field pressure can rise high enough to cause the flow capability of the suction valve to be much higher. Ie higher delta P causes the loop gain to increased (loop as in controller / valve / and compressor). So, you calculate the Delta P across the valve and use that to dynamically adjust the gain down or up as desired. As the delta P comes down the Gain needs tol increase. Eventually the valve is wide open and no longer on control. The FGEN Function Block is very handy for this. Ideally you would create an X range of Delta P values and try to capture the Gain value for each of those values and put that in the Y range. The FGEN calculates the values between and sends that to the output (for Gain). It's a nice little function generator.

Lets talk about P and I. You won't require D. If this gets too far in the weeds, apologies. I just want to cover the bases.

P in the PID and PIDE loop is  Gain. A gain of 1 the same as 1/1 or 100% proportional band (the origin of P). A Gain of 2 is 1/2 or 50% proportional band (faster response). Some of us started when all you had was a pneumatic proportional only controller and PB was in %. A really nice pneumatic controller had reset (time in minutes). The Cadillac had derivative and you almost never saw it used. <-- I don't miss those days :) 

You should see an improvement in the Manual to Auto jump you're experiencing if you turn on PV Tracking. SP tracks PV in manual when that is on.

You've selected Independent vs Dependent. There's nothing wrong with that. I like my Integral units to be in minutes per repeat so I select Dependent. Independent is just 1/x or repeats per minute. Either works. It's just a slightly different equation.

If I were going to tune your loop I'd move the Integral value out to 15m or 1/15 in your case. That gets it out of the way. Try to tune the loop with Gain only. Find the Gain value that stabilizes the PV, bump it (move the setpoint a small amount), and watch the response. It should settle out somewhere. It might not track setpoint. No worries, that's what I is for. I is used to correct the offset that occurs due to Gain. The equation see the SP to PV difference and "integrates" a little signal into the CV to bring the SP and PV together when the setpoint and PV don't match. I affects the overall loop gain so it's very important that it isn't too fast. You can find a low gain, like 1 or even .5 (that's very slow) to start with and keep doubling it until the loop is no longer stable. 1 to 2 to 4 to 8. Above 8 I'd go up in 2's. Once it gets unstable, go 1/2 way back (if it's 8 then go to 4). It it stabilizes, go 1/2 of the distance higher, so from 4 to 6, if that oscillates, drop to 5, and so on. Eventually you'll find a good compromise between good response and oscillation. 

Once you have Gain set where you like the response you see when you bump the controller (no oscillation, oscillation drives the integral term of the equation nuts. So does noise) start decreasing reset time or increasing the number of repeats per minute (1/t). I usually go "1/2 way back". In the 15m example I'd set back to 7.5m. Bump the controller. No oscillation? another 1/2 in the same direction (3.25). Bump... oscillation.. increase 1/2 way back to 7.5m or (7.5+3.25) / 2 = 5.375. You don't have to be that precise by the way. Gain, Integral, and Derivative (don't need D) interact with one another so you may find that you've decreased the integral time to a point where you need to increase gain. I'd try to leave the gain (sensitivity is a good way to look at gain) where it is and increase time or decrease 1/t

++Autotune actually works pretty good but I think that's a PIDE function. Besides that it's more fun to tune it yourself. Personally I prefer the PIDE loop. I think it's more robust. But it could be that I never liked the PID loop in the SLC and the CLX version reminds me of it.

Edited by Michael Lloyd
2 people like this

Share this post


Link to post
Share on other sites
On 9/25/2019 at 10:15 PM, Michael Lloyd said:

Your idea to vary the gain by where you are in the startup process is spot on. We call that Adaptive Gain. There's a lot of uses for it. For example, in the natural gas processing business we use compression to pull gas from the field and feed the plant (or other facility) at higher pressure. Pulling field pressure down also allows the well to flow at a higher rate. Some places pull into the vacuum range. The compressor(s) have suction control valves on them. If they've been down for maintenance or the control system shut it down the field pressure can rise high enough to cause the flow capability of the suction valve to be much higher. Ie higher delta P causes the loop gain to increased (loop as in controller / valve / and compressor). So, you calculate the Delta P across the valve and use that to dynamically adjust the gain down or up as desired. As the delta P comes down the Gain needs tol increase. Eventually the valve is wide open and no longer on control. The FGEN Function Block is very handy for this. Ideally you would create an X range of Delta P values and try to capture the Gain value for each of those values and put that in the Y range. The FGEN calculates the values between and sends that to the output (for Gain). It's a nice little function generator.

A great idea for the FGEN application to maximize/minimum P.

Thanks for the share.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now