Allen Bradley PID Tuning Help

Join Date
Jul 2007
Location
Kiruna
Posts
600
Hi Guys,

First off I'll put my hand up and admit this is my first time ever having to tune a PID Loop. I wasn't involved in the project and have being drafted in for a couple of weeks. However its a perfect opportunity and I'd love to learn. I know there is a lot of PID experts here so hopefully I'll get some help.

The purpose of the PID control is by using a variable speed drive to maintain a constant level of 0.7 metres in a tank and hence a steady flow from the tank. The Platform is a Controllogix L-61 PLC using the standard PID instruction.

I know you guys appreciate as much detail as possible to assist in problem solving so with my limited knowledge of PID control I'll do my best.

The commissioning Engineer has advised me that there is a lot of lag in the system due to the distance between the pumps and the flowmeter we are using as the Process Variable.

As this is my first time tuning I really don't know what I should be doing. Rather than just trial and error I would really like to understand this.What I am asking is for any advice on how you guys approach this. I have tried adjust the gain and integral slowly up and down and the best I can get is close to 0.7M but with on/off control of the Pump. The Pump starts ramps up to 100% and then turns off again.

I apologise for such a poor description of the problem. I have made some trends of the system response in RSLogix if someone would be willing to view them.

From some posts here it might appear the PIDE instruction could help? Also a couple of new instructions have been introduced in Logix V17, the IMC, MMC and CC could be of use. Any thoughts? There is an Autotune function that could be beneficial?
 
DON'T PANIC! Level controls are easy.

MorphuisOGrady said:
The purpose of the PID control is by using a variable speed drive to maintain a constant level of 0.7 metres in a tank and hence a steady flow from the tank. The Platform is a Controllogix L-61 PLC using the standard PID instruction.
So you have a flow AND level feedback?

I know you guys appreciate as much detail as possible to assist in problem solving so with my limited knowledge of PID control I'll do my best.
Is the in flow or out flow variable?


The commissioning Engineer has advised me that there is a lot of lag in the system due to the distance between the pumps and the flowmeter we are using as the Process Variable.
Does the fluid compress in a significant way? If not the fluid going in is equal to the fluid going out of the pipe


As this is my first time tuning I really don't know what I should be doing. Rather than just trial and error I would really like to understand this.What I am asking is for any advice on how you guys approach this.
You should be able to get by with just a proportional gain depending on how much error you can tolerate. How much error can you tolerate?

I have tried adjust the gain and integral slowly up and down and the best I can get is close to 0.7M but with on/off control of the Pump. The Pump starts ramps up to 100% and then turns off again.
Does the pump actual have a ramp is or that how much time it takes to get to speed? Do you only have on off control?
You need to have some speed control or the motor will need to turn on and off and that will be the best you can do.

From some posts here it might appear the PIDE instruction could help? Also a couple of new instructions have been introduced in Logix V17, the IMC, MMC and CC could be of use. Any thoughts? There is an Autotune function that could be beneficial?
Auto tune functions only work if they are designed to tune your type of system. You have an integrating system which means the level is the integration of the net flow. If the autotuner doesn' have that model it will not work.
 
Hi Peter,

Thanks for your reply and taking the time to ask me for specific details I did not include. In response to your questions:

We have flow and level feedback, however it is the level that we are concerned with . This is the Process variable.

The flow variable is an out flow to next stage in process.

The fluid is sludge and does not compress as I understand it.

How much error can I tolerate? Not sure of the answer to that. As it stands the control is on and off and the client does not want this. A VSD has being installed for this purpose. Basically the level is to be at 0.7M. We dont want it to drop below 0.6 or above 0.9M. Does this help?

The pump is ramping to full speed and down to zero as thats what the output of PID is commanding it to do.
 
Hello,

since you have a level control problem, derivative component should be included in your PID controller. I don't think integral component is necessary and think quite good control can be achieved with PD controller only.
If I understand well, VSD is using to control flow out of the tank? In that case manipulated variable is "out flow" from the tank.
You need to at least roughly estimate parameters of your process. Does it have any dead time?
It is very hard from here to say what exactly is causing that ON/OFF behavior (at least for me).

There is also one more thing I don't understand. What exactly is process variable (it seems it is level, but you wrote flow meter in the other post)?
Motor (pump) with VSD should be able to control the level in the tank steadily.

I cannot give you any further advice right now. Please, try adjusting proportional part and derivative part slowly.

Please, have a look at this:
http://www.controlguru.com/wp/p94.html
and also this:
http://www.controlguru.com/2007/042507.html

This will give you idea how to estimate your process parameters. You shouldn't pay too much attention on specific instructions and versions of software, but understand control concepts instead.
 
Last edited:
How much error can I tolerate? Not sure of the answer to that. As it stands the control is on and off and the client does not want this. A VSD has being installed for this purpose. Basically the level is to be at 0.7M. We dont want it to drop below 0.6 or above 0.9M. Does this help?
It sure does. Obviously the set point is set to 0.7m.
Next you want to adjust the controller gain so it will provide full flow when level reaches 0.9m and you want the motor to turn off when the level drops below 0.7m This means that you want the pump to go from 0 to 100% control output or 0 to 10 volts as level changes 0.2m. Now you have a good estimate of how to scale the controller gain. This will keep you in your operating range.

If the level drops below 0.7m what can you do? The pump can't control the inflow. The pump should stop as soon as the PV ( level ) reaches the SP. You don't want the pump to keep pumping as the level drops below 0.7.

You will see that the level will stay in the desired range but there will usually be an error proportional to the inflow. To reduce this error to 0 you need to adjust the integrator time constant. The shorter the integrator time constant the faster the response. At this time is it good to know the fluid surface area and hopefully it doesn't change as a function of level. It is also handy to know the pump capacity, peak inflow and the tank volume.

Now if you have a flow meter that can provide and estimate of how much fluid is coming in then you can create a feed forward or bias. The advantage of using the flow and bias is that the integrator does not need to wind up.

But first, get the proportional gain working.

I will let my distinguished colleague, Ron Beaufort' help you with the Rockwell PID details.

The pump is ramping to full speed and down to zero as thats what the output of PID is commanding it to do.
That may be right depending on what the inflow is doing but only if the in flow is close to maximum. Otherwise It sounds like the gain is a little too high. If the pump speed should change to match the inflow. If the pump has much more capacity than the inflow then you may get by with just the proportional gain.

Knowing the pump capacity, the peak inflow and the tank volume at the set point would be handy. Oh, and the fluid surface area of the tank. Hopefully the tank is a vertical cylinder and it doesn't change as a function of level.
 
It sure does. Obviously the set point is set to 0.7m.
Next you want to adjust the controller gain so it will provide full flow when level reaches 0.9m and you want the motor to turn off when the level drops below 0.7m This means that you want the pump to go from 0 to 100% control output or 0 to 10 volts as level changes 0.2m. Now you have a good estimate of how to scale the controller gain. This will keep you in your operating range.

If the level drops below 0.7m what can you do? The pump can't control the inflow. The pump should stop as soon as the PV ( level ) reaches the SP. You don't want the pump to keep pumping as the level drops below 0.7.

You will see that the level will stay in the desired range but there will usually be an error proportional to the inflow. To reduce this error to 0 you need to adjust the integrator time constant. The shorter the integrator time constant the faster the response. At this time is it good to know the fluid surface area and hopefully it doesn't change as a function of level. It is also handy to know the pump capacity, peak inflow and the tank volume.

Now if you have a flow meter that can provide and estimate of how much fluid is coming in then you can create a feed forward or bias. The advantage of using the flow and bias is that the integrator does not need to wind up.

But first, get the proportional gain working.

I will let my distinguished colleague, Ron Beaufort' help you with the Rockwell PID details.


That may be right depending on what the inflow is doing but only if the in flow is close to maximum. Otherwise It sounds like the gain is a little too high. If the pump speed should change to match the inflow. If the pump has much more capacity than the inflow then you may get by with just the proportional gain.

Knowing the pump capacity, the peak inflow and the tank volume at the set point would be handy. Oh, and the fluid surface area of the tank. Hopefully the tank is a vertical cylinder and it doesn't change as a function of level.

Thanks Guys for your very helpful input. I'm back on site tomorrow so I'll start with the gain.

The problem is as its a working system I have to be very careful not to drop the level too far below 0.7M or there will be other pumps tripping on suction.

Is it fair to say then that I'm jumping the gun by using the PIDE instruction? The PID will do the job despite this "lag" in the system?

I have attached a .PDF of a 5 minute run of the pump with the P= 0.3, I=1.0 D =0.0. I will chage in the morning and use just D. Would you have a quick look at this and tell me a good point to start?
 
The problem is as its a working system I have to be very careful not to drop the level too far below 0.7M or there will be other pumps tripping on suction.
The control signal should go to 0 when the level drops to 0. The only thing the pump can do is stop and let the level rise

Is it fair to say then that I'm jumping the gun by using the PIDE instruction?
I don't think it is necessary. It is just the tools. Understand standing the system is the important part now.

The PID will do the job despite this "lag" in the system?
I think you need to get the P gain going first. Just the P gain. I don't understand what lag you are talking about. When the pump runs the level should go down immediately.

I have attached a .PDF of a 5 minute run of the pump with the P= 0.3, I=1.0 D =0.0. I will chage in the morning and use just D. Would you have a quick look at this and tell me a good point to start?
Don't go past go. Do not use the D gain yet. First get the response stable with the P gain only.
BTW, is I a gain or a time constant. People are never clear about that
Also it looks like the SP is at 40. Is that .7 meters?

Answer the question on my previous post. I have solved these types of problems before.
http://www.plctalk.net/qanda/showthread.php?t=26395&highlight=SIGreg
 
Peter I agree, but I think that he shouldn't use integral part at all for now.
Normally one would start with P controller only. I would add very small derivative component in the begining. I always use derivative component in level control applications.

MorphuisOGrady, if you look closely to your graph, yu can see that PID controller output is start decreasing only when PV become less than SP. Derivative component could counter this and cause CO to start decreasing (pump speed start decreasing before PV is less than SP).
First, I would decrease proportional gain and put very small derivative gain.
 
Last edited:
Peter,

Just to clarify, your saying that when the level drops below the CV should drop to 0 and the pump should completely stop?

The "lag" in the system I'm told is due to the location of the level transmitter in the channel.(I said it was a tank, but its actually a long channel) THe LT is located on the opposite end of the channel to the Pump. At a guess I think its 500m. Would this cause a delay in your opinion?

The question you want an answer to. Is this in relation to the Pump capabilites? If so I will find out from the commissioning team tomorrow.

Dont know why the trend is showing 40. THe SP is definitely at 0.8!!!

Pandiani,

I think that's what I'm am looking to do. If the pump would gradually decrease before the PV is less than SP then that should at least improve it. SO its the D component of the PID that does this???

You say to decrease the proportional gain and put a very small derivitive on it. The P Gain is at 0.3 which I though was quite low. Shall I start at 0.1??
 
Peter,

Just to clarify, your saying that when the level drops below the CV should drop to 0 and the pump should completely stop?
I am saying that when the level ( PV ) goes below the set point ( SP ) the pump should stop. You don't want the pump to keep running and emptying out the tank. The pump must wait until more fluid comes into the tank

The "lag" in the system I'm told is due to the location of the level transmitter in the channel.(I said it was a tank, but its actually a long channel) THe LT is located on the opposite end of the channel to the Pump. At a guess I think its 500m. Would this cause a delay in your opinion?
No gravity will keep the water level constant in the channel unless the fluid truly is more like mud and doesn't flow easily.
 
MorphuisOGrady,

Try setting P at low value than gradually increase it. D component would be small at first and then it should be increased too. Also, it is very important to know which form your AB PID controller is using.

MorphuisOGrady said:
If the pump would gradually decrease before the PV is less than SP then that should at least improve it. SO its the D component of the PID that does this???
Yes, please have a look at this too.
http://www.controlsoftinc.com/mailing/message60.htm
 
The set-point is at 40%. If this is 0.7 m then the range is 1.75 m. Now, since the minimum is 0.6 m, or 34%, you'll want the pump to halt at this level and go at full speed at 0.8 m (46%). The difference between minimum and maximum is 12%, so you'll use this value for proportional band which is a gain of 8.3.

Get rid of the I term pronto, it's way too fast and is what causes the brutish oscillation in the graph. Don't bother with the D term. Set fixed bias to 50%.

The limits of 0.6 and 0.8 m are to keep the set-point symmetrically between them. Since the max level is 0.9 m (51%), you might get away with a set-point of 0.75 and a gain of 5.9.

If a constant offset bothers you, you can restore the integral with a very long TC, but be aware that if there's a major sudden disturbance the system may go off-limits.

You haven't told the width of the channel nor the flow, nominal and max, but anything 500 m long will have a pretty long time constant.

The gain may be a bit high-ish if the liquid is sloshing about. That can be helped by filtering the LT with a TC of about 5% of the channel TC.

Also, if you have the time and the access, set up a "dummy" PID in the software. Adjust PV and SP manually, play around with the parameters and watch the output until you understand how it reacts under various conditions.
 
We all recommended to turn off I part of the controller. First step would be to try to adjust proportional gain. It is likely that there would be a constant offset which could be eliminated with I part but that may introduce oscillations as ydtech suggested. That is why I always use derivative part on level control loops because this overshoot can be avoided.

Anyway, we need to wait for the feedback.
 
Gentlemen,

Once again, thanks for all your input. I'm on site and working on a couple of other things so I haven't got a chance to get back to my PID tuning. I hope to resume tomorrow.

I have being unable to find out the pump capacity or channel volume yet however I have made one mistake. I mentioned the LT was located 500m from the pump. This in fact is only 88Metres from Pump.

I have a couple more questions/observations you may be able to assist my understanding.

The PID instruction in RLL in Logix offers 2 Equations, Dependent or Independent. At present it is set at Independent. Is this correct?

The control action is PV-SP. Is this correct?

The PID is fired off a 500ms timer. The loop update time of the PID instrction is set to 500ms too. DO these have to match? Is every 500mS sufficent? Insufficient?

The VSDs mimium speed and Fieldbus minimum speed is clamped at 25Hz. I'm told if the pump is running any lower than this the pump is doing no work. Surely this is going to have an effect on my PID? Should I set my CV High Limit to 50%??

ydTech, you mentioned fixing the bias to 50%. Is this the output bias parameter in the PID instruction?
 

Similar Topics

I have a PIDE set up for controlling a tank level. I've run the autotune on it and it is working fairly well except for one thing. No matter...
Replies
4
Views
2,257
Dear all, Please help me out in configuring the PID instruction CCW.
Replies
5
Views
10,479
I am using PID first time in Allen Bradley.I have to Tune a PID on the basis of Pressure Transmitter.I have 3 pumps and pumps will run/stop...
Replies
2
Views
1,661
go to work on this again this morning. I have attached the file and have a question that i can not figure out. When monitoring the temperature i...
Replies
5
Views
3,520
Hi, I would like to ask about the allen bradley on how to use the pid block in the programming, the software i use is rslogix500 and model of plc...
Replies
4
Views
3,826
Back
Top Bottom