You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old May 31st, 2020, 08:39 PM   #1
PatrickH
Member
United States

PatrickH is offline
 
Join Date: May 2020
Location: PA
Posts: 2
Velocity Control PID in CompatLogix

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
  Reply With Quote
Old May 31st, 2020, 10:09 PM   #2
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 5,585
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 by drbitboy; May 31st, 2020 at 10:27 PM.
  Reply With Quote
Old May 31st, 2020, 11:02 PM   #3
rupej
Member
United States

rupej is offline
 
Join Date: Sep 2014
Location: NC
Posts: 950
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?
  Reply With Quote
Old June 1st, 2020, 12:10 AM   #4
PatrickH
Member
United States

PatrickH is offline
 
Join Date: May 2020
Location: PA
Posts: 2
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 by PatrickH; June 1st, 2020 at 01:03 AM.
  Reply With Quote
Old June 1st, 2020, 05:06 AM   #5
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 4,295
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.
  Reply With Quote
Old June 1st, 2020, 07:52 AM   #6
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 5,585
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 by drbitboy; June 1st, 2020 at 07:56 AM.
  Reply With Quote
Old June 1st, 2020, 09:22 AM   #7
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 4,295
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.
  Reply With Quote
Old June 1st, 2020, 09:40 AM   #8
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 7,968
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=qzr6...Mp_BpGbT5wKm2r

Yes, I cover modeling aka "system identification"
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old June 1st, 2020, 09:46 AM   #9
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 4,295
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.
  Reply With Quote
Old June 1st, 2020, 09:55 AM   #10
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 7,968
Quote:
Originally Posted by parky View Post
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.
This is why I am not as active. I don't have time to spend play 20 questions.


If a person doesn't understand the problem then how will he understand the answer?
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old June 1st, 2020, 10:26 AM   #11
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 4,295
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.
  Reply With Quote
Old June 1st, 2020, 04:56 PM   #12
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 5,585
Quote:
Originally Posted by Peter Nachtwey View Post
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.



Quote:
Originally Posted by Peter Nachtwey View Post
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=qzr6...Mp_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 by drbitboy; June 1st, 2020 at 04:58 PM.
  Reply With Quote
Old June 1st, 2020, 06:39 PM   #13
rupej
Member
United States

rupej is offline
 
Join Date: Sep 2014
Location: NC
Posts: 950
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?
  Reply With Quote
Old June 4th, 2020, 12:20 PM   #14
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 5,585
Quote:
Originally Posted by drbitboy View Post
This system is so simple it is all but begging for a model, then trying several different approaches could be done quickly.

Done. I'll publish it later today, D.V.
  Reply With Quote
Old June 4th, 2020, 12:56 PM   #15
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 7,968
Quote:
Originally Posted by drbitboy View Post
Done. I'll publish it later today, D.V.
This will be interesting.

You must be assuming the fan is pressurizing the cabinet to keep a small positive pressure. This would keep the dirt/dust out. That hasn't been confirmed by the OP yet.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
PID control hapetter LIVE PLC Questions And Answers 4 February 18th, 2010 04:37 PM
PID control of motor drive considering the diameter and an external Potentiometer rajesh_gklm LIVE PLC Questions And Answers 2 January 16th, 2010 12:19 AM
Siemens S7 PID Control Problem qee LIVE PLC Questions And Answers 27 May 15th, 2007 11:53 AM
GE Fanuc VersaMax PID control problem Shawn Cassidy LIVE PLC Questions And Answers 6 May 16th, 2004 09:10 AM
how often should I trigger the PID? Ron Beaufort LIVE PLC Questions And Answers 11 February 22nd, 2003 11:57 AM


All times are GMT -4. The time now is 03:18 PM.


.