Velocity Control PID in CompatLogix

PatrickH

Member
Join Date
May 2020
Location
PA
Posts
2
Hello All,

This is more of a sanity check then anything. I have a project that I need to control the velocity of a fan based on the pressure inside the enclosure. The loop time is pretty long with a update of about 300 - 1000ms and I will likely only be using the PI terms. I am running the control through an 5069-L330ER with and running studio V32. I do not think there is a way to directly execute a velocity PID using the PID function in CompactLogix. The way I have it setup is the PV and SP are fed into the PID function. The output of the PID is used for the change in velocity. So with the output at 100% the fan will ramp at max accel at an output of zero the speed will stay the same. The wonky part of this setup is changing the control action from PV-SP to SP-PV based on the PV and SP difference to get a negative value when it climbs too high to apply a decel to the fan. Is this the best way to implement this functionality? Are there any performance issues I may run into? I can't seem to figure out a better way to do this. Any suggestions would be greatly appreciated. If you have done the same then please reply. Sanity.....

-Patrick Hughes
 
okay, I'll bite: either that is insane, or I am insane, or I don't understand.


I think it's door number three, but let's see if I understood:


You seem to be saying if the pressure is low (PV less than SP), then the output will tell the fan to increase speed at some rate i.e. the output will not be telling the fan at what speed to run, only to run faster.



And then on the other side, if the pressure gets to high, you flip the SP vs. PV comparison, which will somehow cause the fan to to start ramping down.


If I have that right, I would think that it would be easier to write a simple algorithm that tells the fan to

  • ramp up (accelerate) when pressure is below some target-Δ,
  • ramp down when pressure is above some target+Δ;
  • keep the current speed (do nothing) when the pressure is between target-Δ and target+Δ
So +/-Δ becomes the deadband. Am I insane or is it possible that this is something like four instructions and two rungs, and much simpler than the funny business I think is being suggested for the PID?


That is basically an all-I control; the ramp rates could be different so it climbs quickly and then comes down into the range slowly if (when?) it overshoots.
 
Last edited:
Yeah, I'm lost too.


How is the fan controlled? Is it on a drive that you send a speed setpoint to, or something else? Why do you say that the controller can't directly control it with a PID? Why does the loop update time have to be so slow?
 
I am not sure if the PID is needed but the customer requested it. Currently the Output of the PID is driving Acceleration. Basically there is a ramp calculation that the PID output is fed into. The larger the output the faster the change in Frequency over time. So as the error goes to zero the change in frequency goes to zero as well. And then when the fan overspeeds the frequency is dropped over time to compensate by swapping the control mode. I just don't know how else to implement the Compactlogix PID Function to control the Frequency of the drive based on the vacuum reading. since as the error decreases the output will decrease as well. If I am totally misunderstanding something please set me straight.


-- EDIT ---
So I was overthinking this as you say and I think it has to do with a previous job where I needed a PID controller for flow control on a micro 1100. in that case when I started up the machine the output went wild with a valve opening and closing at a high rate. I though the issue was that PID could not control the rate of change. (fundamental misunderstanding) So when the error was large the valve would go from 0-100% which caused the flow to increase drastically and then the valve would slam closed since it overshot the SP. So I thought that I needed to feed the Error into a ramp function the same I am trying to use now. My main issue was I thought I was missing something from the code instead of misunderstanding that the tune was off. Now the only reason I turned to this was since I was in the hot seat and had to get the system running and I had no idea what else to do. It worked fine (since it was basically purely an integral controller as you said). Let me know if I am on the right track. This has been eating at me since I knew something was wrong with this. I just needed the confirmation to get my brain unstuck. (Bad feedback loop) :)

-Patrick
 
Last edited:
I have done many control loops on various systems and just assuming a PID will not run as required is a bit of a red herring, have you tried to tune the loop, either manually or automatic. Sometimes the best way to tune a loop is to set a reasonable proportional band, no integral and derivative, reduce the proportional band until the system becomes unstable, re-adjust it up until it becomes stable again, then introduce some integral. I don't really think you will need derivative. It may also help to run the loop in manual to bring up the control within a band, then switch it over to auto, I have done this on adaptive loops to get good control. Many systems I have found that it seems better to roll your own PI controller in a simple manner. I have even removed PID control & done it in simple code, an example was where as the temperature of the sauce increased so did it's thixotropic properties, as this was direct steam injection it eventually blew holes in the sauce so the temperature stopped increasing towards set-point, the answer was to use an array of fixed valve positions based on temperature, this effectively reduced the pressure/flow stopping the blow through.
Vacuum can sometimes be tricky, also is your sensor absolute or gauge ?.
Also make sure the PID loop is not called too fast i.e. 1 a second rather than every scan, this also reduced the sudden changes. I still think that setting a manual output close to what will be the normal speed for the vacuum you require for x seconds means the loop will often go into control without too much overshoot/undershoot.
 
So we understood correctly, and the PID only sets the ramp velocity, dSpeed/dTime, of the fan(s)?



If the PID is changing the slope the ramp, then that is P masquerading as I (Integral) control so there will be no need for any I in the PID. Strictly speaking there is no P in the normal sense but the customer does not need to know that.



Also, I do not see the need for swapping the SP-PV vs. PV-SP configuration on the fly. Instead set up so

  • PID 50% output is zero ramp,
  • 50+ to 100% output set increasingly positive ramp,
  • 50- to 0% sets increasingly negative ramp?

The output will always end up at 50% for steady operations; I'm not sure how that affects bumpless transfer. Don't forget the deadband at around three times the stddev of the pressure signal, so it won't be chasing noise.



It is possible that D might be needed, because this P-as-I-control may not tune well against the I-like system response of the process (pressure in an enclosure, i.e. accumulation i.e. integral); it all depends on the time constant of the system (ratio of enclosure volume to fan flow rate; i.e. deadtime). That said, it is more likely that if the P gain is low enough and the customer is satisfied with a slower response time, then D will be unnecessary, as parky said.


This system is so simple it is all but begging for a model, then trying several different approaches could be done quickly.


Hmmm, now that I think about it, I am wondering if this dynamics might be equivalent to motion control, mathematically, and could be controlled with MAM or MAJ or MAsomething instructions that are controlling pressure as an axis.
 
Last edited:
To be honest it does not really matter if it is pressure, vacuum, flow or temperature it's the response curve it does not need to know the type all it is doing is adjusting an output with reference to an input.
Most controllers (I'm referring to PID loops either plc based or stand alone) have bumpless control so setting a pre-position value can reduce the over/undershoot. Limiting the output can also give better control i.e. min max of output variable to reduce hunting. There are other things to consider, VFD response time (ramp) etc.
 
I really wish people would ask question correctly by providing enough information to get an answer.

1. It isn't clear whether the fan is blowing air into or out of the cabinet. I could assume the air is being blown into the cabinet to create a positive pressure to keep dirt out but I have assumed wrong before so now I just complain about the OP not providing this fact.

2. If the fan isn't blowing then how long does it take for the pressure to drop to ambient? This is important because the sample rate must be much shorter than the time "constant" of the system.

3. This is yet another example of where the time "constant" is not constant. It varies depending on the pressure since air will tend to leak out as a function of the square root of the pressure difference.

4. Doesn't anybody know the difference between integrating and non-integrating systems? Non-integrating systems will return to ambient when control is off. The OPs system is probably a non-integrating system but that that is an assumption. A integrating system would require that air be removed with a fan as mentioned in the first post.


5. If the pressure must be exact then a PI controller will be need. Otherwise I would start with just a P controller and live with the proportional drop.

We have pressurized cabinets before to keep dirt and dust out. It doesn't take much pressure to make the cabinet expand to the point of damage. We deformed a cabinet with as little as 1/4 psi.

Do you guys know when the derivative gain is required? It can be proven mathematically. It isn't a guess.

Look guys, if you want good answers then ask good questions.

drbitboy. It appears you may be able to understand my control videos on YouTube.
It is called "Peter Ponders PID".
It is for college grads in control theory. Most people bail after 3 minutes because they don't understand the math. The few that stay really like it.
https://www.youtube.com/watch?v=qzr6eL90Aok&list=PLw-2GTeWbpjTpQNJKmDMp_BpGbT5wKm2r

Yes, I cover modeling aka "system identification"
 
It does appear he is using a vacuum sensor ? so sounds like he is trying to create a vac rather than a pressure, it's a bit vague.
 
Agreed Peter, This seems to be happening on most posts at the moment.
I too am getting a little fed up of these posts I don't mind helping anybody but please give us some relevant information. what is the actual process. what are the problems what have you got so far, what equipment are you using etc.
 
4. Doesn't anybody know the difference between integrating and non-integrating systems? Non-integrating systems will return to ambient when control is off. The OPs system is probably a non-integrating system but that that is an assumption. A integrating system would require that air be removed with a fan as mentioned in the first post.


Granted we don't know the details for certain, but since the PID output as I interpreted it drives the fan speed ramp rate i.e. the second derivative of accumulating air, when the PID output is the equivalent of "off" (i.e. the PID output sets the ramp rate to zero), then the system will not return to ambient but will hold its equilibrium pressure. Of course the process is non-linear because of the varying fan curve and varying air leakage to ambient being a function of pressure, but basically the enclosure is accumulating air i.e. pressure is the integral of net flow in = fan flow in - air leakage out. For all intents an purposes, that is roughly analogous to a motion control axis.



drbitboy. It appears you may be able to understand my control videos on YouTube.
It is called "Peter Ponders PID".
It is for college grads in control theory. Most people bail after 3 minutes because they don't understand the math. The few that stay really like it.
https://www.youtube.com/watch?v=qzr6eL90Aok&list=PLw-2GTeWbpjTpQNJKmDMp_BpGbT5wKm2r

Yes, I cover modeling aka "system identification"


It's been some decades since I considered the meaning of a Bode plot, and although I spent most of that semester programing mastermind on my TI calculator, your video sounds interesting and has been duly bookmarked. Thank you!
 
Last edited:
OP, I want to help you but I still have no idea what you're trying to accomplish. How about a drawing showing the process and your I/O you're working with?
 

Similar Topics

The is the first system that uses complex or imaginary poles. Complex poles oscillate. RLC circuits, masses on springs, pendulums, masses on...
Replies
19
Views
16,982
So you thought you would take the weekend off! No way. The link below is saying download me! Give me a try! The link is to a spreadsheet that...
Replies
15
Views
23,428
A query for the motion control experts: I have an app where I measure the position (encoder ∝ K * angle) of a rotating device, and use that along...
Replies
15
Views
3,693
A bit of background here: We use an incremental encoder with a counting module in our PLC configuration. Using dual phase / quadrature counting...
Replies
26
Views
8,773
I have a 1746-QV. I just replaced one that had gone bad. I am looking for an electrical schematic for it so I can attempt to repair it just for...
Replies
0
Views
1,601
Back
Top Bottom