At work we have a system that feeds chemicals into bags in buckets on load cells to weigh out a certain amount of each chemical according to the Chemist's recipes.
We have feeders using vibratory drives and augers with AC variable speed drives.
On augers, we use a coarse and fine dosing. On the vibratory feeders, when it goes into fine dosing, the product feeds out of the vibrating trough faster than it feeds from the bin to the trough, this makes a thin spot in the chemical. So after several cycles on a vibratory bin, you can see waves in the chemical level, thinner where it fine dosed, thicker where it coarse dosed, this created uneven feeding, so we dose all at one speed. This makes the flow more consistent but it's hard to hit tight tolerances.
I'm trying to come up with an algorithm that hits tighter tolerances than the current system.
Currently they stop feeding at the set point - "in fly" and it works OK but not real accurate.
I wrote a routine to take the weight every 40 milliseconds and I calculate the flow based on the last 10 readings, 0.4 seconds. I'm trying to closer estimate the "in fly" amount as a function of flow, figuring if there is more flow, there should be more chemical "in flight". Basic calculations show it's not linear, I thought since flow is a rate, it may be the same formula as braking distance for a car, minus the reaction time, friction, and gravity parts.
I'm thinking that slowing from 2lbs/sec to 1lb/second will flow out more chemical just like braking from 60 to 30 mph takes more feet that slowing from 30 to 0 mph.
If I can get a formula that works for different flow rates, then I can better estimate the point to stop dosing and get fewer out of tolerance after a recipe change with a different set point.
Next, even if I get that closer, there is still too much variation from one time to the next. I'm thinking about, instead of feeding and then stopping, ramping down at a controlled and corrected rate. The idea is that as flow approaches zero and error approaches zero, infly should also approach zero. So maybe after we coarse dose maybe 80-90%, switch to ramping to set point and correct on the way.
BTW, we're using Siemens controls running on a MicroBox Industrial PC. The language I'm using for this part is SCL, a high level text based language similar to Pascal. It seems better for this type of thing than STL, Ladder, and function block diagrams.
Any ideas?
RogerN