Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: russher on May 25, 2015, 11:20:54 AM

Title: PID and PID Auto-Tune Issue
Post by: russher on May 25, 2015, 11:20:54 AM
I have a control system using a Do-More PLC that has an auger feeding grain to a disc mill that grinds the grain. The Do-More monitors the amperage on the disc mill motor (4-20 mA input) and also delivers an analog output (0-10 VDC) to a variable speed drive that is controlling the speed of the auger. I am attempting to use a PID to control the speed of the auger based on the disc mill motor amperage - higher amperage slows the auger; lower amperage speeds up the auger - to maintain a setpoint amperage. I have used this before with great success. On this system, however, there is at least 40 seconds delay between the auger and the flow of the product to the mill motor giving the amperage reaction. This is the first problem - a long delay in the speed control and reaction. The PID Auto-Tune doesn't seem to be very effective on such a long delay. I have tried to counter this with delaying the PID until the disc mill amperage was brought up very close to the setpoint using an initial speed on the auger. I'm finding, however, even if the motor amperage is very close - or even slightly above - the setpoint when the PID kicks in, the PID output goes high, the amperage soars and the mill motor often plugs and overloads. Any ideas would be welcome!
Title: Re: PID and PID Auto-Tune Issue
Post by: Garyhlucas on May 26, 2015, 09:01:54 AM
I think you need a second auger, the long one is a transport auger and the second short one is a feed regulator.  The first could be continuous speed on and off just keeping the second one supplied.

I face a similar issue with feeding waste water into a treatment plant.  When the feed pump kicks on the dissolved oxygen (DO) level drops like a rock and the PID controlling DO overshoots badly. The current project uses a positive displacement feed pump that is on a PID loop to keep the tank level constant, then DO regulates nicely.
Title: Re: PID and PID Auto-Tune Issue
Post by: russher on May 26, 2015, 09:42:08 AM
I don't think a second auger is an option in this application - but I understand what you're saying, and I appreciate your insight. Thanks.
Title: Re: PID and PID Auto-Tune Issue
Post by: Controls Guy on May 26, 2015, 11:39:28 AM
Yeah, that's a tough situation.  I assume the volume between the feed auger and the point where it feeds the mill is somewhat variable, or the feed rate would track the auger speed well.   Here would by my suggestions in order of preference.

1) Reduce or eliminate the dead time if possible.  Probably by moving the CV closer to the process, or getting rid of that feed system volume/rate variability.  One solution might be a cableveyor (tube with a cable in the center with discs moving your product through the tube) discharging near the entry point to the mill.  Then run the cableveyor on the VFD.

2) Put in an instrument to measure the feed rate at the point where the grain enters the mill.  Then you could do a cascade PID with the feed rate as the CV in the mill loop and the auger modulating to maintain feed rate.  This might require removal of some of that elasticity in the feed system between the auger and mill.

3) See if you can write a Smith predictor for your process.

4) Tune the loop slow enough so that it doesn't wind up faster than you get feedback.  Not very good response but if you can't do any of those other things, it's probably the best you can get.
Title: Re: PID and PID Auto-Tune Issue
Post by: BobO on May 26, 2015, 12:03:33 PM
When I developed the FOTD model for the Sim's process simulator, I quickly found that long delay times are nearly impossible to control. My semi-educated guess is that if the delay time is much longer than the response time, you have virtually zero chance of controlling well using PID. Might try using the process simulator in DMSIM to test alternative control schemes.
Title: Re: PID and PID Auto-Tune Issue
Post by: russher on May 26, 2015, 12:46:35 PM
Thanks for the suggestions - all are appreciated.
I did try the PID setup in the Do-More SIM with a .DeadTime of 45 seconds and a .TimeConstant of 60 seconds. After an Auto-Tune, I got values that are radically different than the on-site application Auto-Tune results. Armed with some of these results, I may try, next, a much slower loop and see where that gets me. As pointed out, the response time to transients will also be slow, but in this application that may not be a problem.
Title: Re: PID and PID Auto-Tune Issue
Post by: ATU on May 26, 2015, 07:35:21 PM
If the auger doesn't feed directly up to the mill, what is in-between? Can you post a photo?
Title: Re: PID and PID Auto-Tune Issue
Post by: Controls Guy on May 27, 2015, 02:02:17 AM
Another option: put a bigger motor on the mill so it doesn't stall so readily, and then use a rolling average of the amps as your PV for a slow loop.
Title: Re: PID and PID Auto-Tune Issue
Post by: russher on May 27, 2015, 09:40:04 AM
If the auger doesn't feed directly up to the mill, what is in-between? Can you post a photo?

Sorry, no photo, but we're talking a large (commercial size) feedmill with a number of ingredient bins each holding up to 100,000 kgs of grain. Each of 5 bins have an auger that feeds a grain cleaner. The grain cleaner feeds a transfer auger. The transfer auger feeds the disc mill. This is why the lengthy delay between the bin auger and the mill. Our initial control system used an Allen-Bradley SLC-500 with a PID controlling the speed of the ingredient auger. This was not completely successful either, as I had to cap the ingredient auger speed so as not to overload the mill. I changed out the AB for the Do-more (for a number of reasons) and was hoping for a better result with its PID. The goal here is to load the mill motor to its optimum amperage for 2 reasons - 1) consistent grind and 2) make the best and most efficient use of the mill motor. The mill motor is already 100 hp so increasing the size would not be an option.
Title: Re: PID and PID Auto-Tune Issue
Post by: ATU on May 27, 2015, 10:09:55 AM
Is there any accumulator after the grain cleaner? If there was, you could use level sensing to control your bin augers. Is the final feed auger controlled by the PID with the current sensing from the mill motor?
Title: Re: PID and PID Auto-Tune Issue
Post by: russher on May 27, 2015, 10:19:54 AM
There is no buffer past the bin ingredient auger. Ingredient auger --> grain cleaner --> transfer auger --> disc mill. The bin ingredient auger is on a VFD with speed controlled by PID with feedback from the mill motor amperage - hence the long delay between auger speed adjustment and mill motor amperage reaction. The grain cleaner and transfer auger run full speed all the time.
Title: Re: PID and PID Auto-Tune Issue
Post by: plcnut on May 27, 2015, 10:33:02 AM
I don't think you are going to be able to use an auto-tune. You will probably have to 'hand-tune' this one, or just use a very basic feed-forward method. ie: Have a preset for each product type that gets loaded when the run starts, and then: if PV=50HP, increase the Output by 200 counts, wait 40 seconds (or whatever the update time actually is), and then either increase, decrease, or hold our output.
What kind of accuracy are you looking for? 20amps? 5amps?
How long are your process runs? 20 minutes? 20 hours?
Title: Re: PID and PID Auto-Tune Issue
Post by: ATU on May 27, 2015, 11:01:04 AM
There is no buffer past the bin ingredient auger. Ingredient auger --> grain cleaner --> transfer auger --> disc mill. The bin ingredient auger is on a VFD with speed controlled by PID with feedback from the mill motor amperage - hence the long delay between auger speed adjustment and mill motor amperage reaction. The grain cleaner and transfer auger run full speed all the time.

I have no experience with that type of feed system, but I think if you had any buffer there, you could probably control the final feed auger to get a consistent feed rate to the mill. It wouldn't take much, but I have no concept on how fast the grain is moving through there.   
Title: Re: PID and PID Auto-Tune Issue
Post by: russher on May 27, 2015, 11:16:42 AM
I really appreciate all the feedback on this forum,and I am starting to realize the PID Auto-Tune may not be too effective in this application. The answer may be a "hand-tuned" - very slow - PID or perhaps some form of Ramp and Soak.
This application is a batching system, so a process run is 15 to 20 minutes. Goal accuracy would be +/- 3 amps on a 100 amp setpoint.
I hadn't used the Do-More simulator until now - testing PID loop parameters. In the simulator setup is a .DeadTime setting (the period in seconds before an Output change begins to effect the PV). I was thinking this would be handy in a real-time PID setup.
A buffer within the flow system would certainly be preferred, but would make for substantial hardware changes in the mill at this point. I will have to make the best of the existing system. I have a number of existing similar systems where the delay from auger to mill is substantially shorter, and the PID Auto-Tune works just fine. Typical system throughput is about 3-5 kgs per second.
Title: Re: PID and PID Auto-Tune Issue
Post by: plcnut on May 27, 2015, 12:13:05 PM
This is an important question for the situation you describe:
If you set the feed speed at a specific setpoint (no PID, just a constant speed on the feed auger), how much fluctuation is there in the amp load?
Title: Re: PID and PID Auto-Tune Issue
Post by: russher on May 27, 2015, 12:37:29 PM
The short answer is that with a simple, constant, ingredient auger speed the mill amps vary minimally (1 to 2 amps).
The longer answer is that there are other variables involved in the system, that, in an attempt to not over-complicate things, I have not described. Other variables include: 1) more than one type of grain is being milled: Barley grinds harder (more amps) than wheat for a given auger speed; 2) the control system automates a gap setting for the disc mill grinding plates. The larger the gap between plates the lower the amps on the mill motor for a given product - and, conversely, the smaller the gap the higher the amps for a given product; 3) the control system also automates the speed of the mill motor for optimum grinding. The mill motor amps, for a given product, will be slightly less at 3400 rpm than at 2200 rpm. The goal - beyond accurate and efficient grinding - is a constant, stable, amperage on the mill motor. Given all these variables, and the single common denominator being the amperage on the mill motor, I was thinking PID would be the way to go for controlling the speed of the ingredient auger relative to the mill motor amps.
Title: Re: PID and PID Auto-Tune Issue
Post by: Controls Guy on May 27, 2015, 02:15:45 PM
Remember, AutoTune is just a convenience.  If it gets to the point that AutoTune does a better job tuning than you do manually, it means you're not doing enough of them manually and you're out of practice.

Doing your own job yourself should always be the default and AutoTune is there simply to be a convenience and give you a semi-reasonable starting point, if you bother to use it at all.  A loop that you need help to tune well is one thing, but being baffled that AutoTune can't tune it is pointless, IOW.
Title: Re: PID and PID Auto-Tune Issue
Post by: russher on May 27, 2015, 02:56:47 PM
You make a good point. I could use some brushing up. Can you point me towards good information for manually tuning PID's?
Title: Re: PID and PID Auto-Tune Issue
Post by: Controls Guy on May 27, 2015, 03:16:34 PM
Not offhand.  There's a wealth of information online which would give you a head start, but honestly, once you've done a quick review of it, I think experience is the best teacher.  Just play with loops to brush up your intuitive feel for when you need more proportional, less integral, etc., and when you can trade them off against each other.  Here's one tip:  many many loops don't need differential.  The traditional approach to tuning is to disable I&D, and tune P till you find what it takes to make the loop oscillate, back off a little and then turn on and tune your I.

Your loop however, will defy that simple works-most-of-the-time approach.  When you get into a weird situation, you just have to stop and think through the loop and figure out what's causing your problem, and what steps to take to deal with it.  Sometimes I limit the bias (accumulated integral), or keep the integral turned off till within a window around the setpoint.  That's the cool thing about PLC PID, is that you have a lot of flexibility.  I was controlling pipeline pressure with a VFD on a pump one time where it took 20 minutes to fill the two miles of pipe!  Even in "PID mode" from the operator's point of view, I had to pump for 20 minutes at a fixed speed, before actually turning over control of pump speed to the loop.

In your case, I'd consider doing a couple things.  First, it's the transfer auger that directly impacts mill load, so that's where the (a) VFD needs to be.  You can control the grain hopper augers based on the fill level at the transfer auger inlet hopper.  The other problem is the different behavior of the mill with different grains, but you know what the mix of hard and easy-milling grains is at any given time at the transfer auger (do you even mix them?).  Therefore you can tune separately for each grain (if you even need to once you're controlling the transfer auger instead of the feed augers), and switch or slide between gain sets depending on the grain being milled at any given time.  I assume the disc separation is another independent variable that must be set according to the flour particle size desired and you aren't free to manipulate it to control motor amps.
Title: Re: PID and PID Auto-Tune Issue
Post by: Garyhlucas on May 27, 2015, 07:46:31 PM
Now that the OP has given more information it looks to me like the issue is as simple as a speed control on the transfer conveyor that is PID controlled by the grinder motor current.  Then for each conveyor feeding into the transfer conveyor use a scaling factor such that it keeps pace with the transfer conveyor depending on how that particular grain feeds.  So if the transfer conveyor is running at half speed the conveyor feeding it runs at half of its scaled speed.  The effect will be that the transfer conveyor can respond almost instantly to the grinder motor current, and the material in the transfer conveyor will always be nearly constant along the conveyor, smoothing everything out.
Title: Re: PID and PID Auto-Tune Issue
Post by: ATU on May 28, 2015, 10:05:42 AM
What about the grain cleaner?  Any buffer before the grain enters?