Filling problem

Thank you for all the replies! I will try as many of these ideas as i can today.

To clarify my setup. It goes pump ->manual valve->flow sensor->solenoid valve. There is a smallish space between the sensor and valve but since I'm overfilling that shouldn't matter. As for the volume in the line after the valve i give it time to drain out. In the actual setup the distance from the valve to jug will be very small.

Also to retierate. I am using a Keyence FD-XS20(I think I linked to it in OP. Let me know if it doesnt work.) It is an ultrasonic clamp on meter.

As for the 50ms idea I like that. Would be a tad less accruate possibly but If it save my overfilling that would be a huge step.

More info to come later today!
 
For anyone still interested I think I'm happy with where I am at, atleast enough to fine tune.

In review I tried 3 methods.

1. I made my own flow rate to volume calculator. It had very good repeatability but failed to be a linear solution across various sized containers.

2. Integrated flow measuring. It would calculate on its side the total amount filled and then close a switch. Bad repeatability, however if used correctly, would eliminate the need for a PLC.

3. Pulse method. Similiar to the integrated flow. but pulses the switch every X amount filled. In this case 10ml. Very good accuracy and repeatability. Still need to test with crazy variances in flow rates. I think since I will be using a PLC will combine methods 1 and 3 for error checking/averaging.

For those who were mentioning the 5ms clock problems. I set it to 5ms but it was not staying steady. Looked to be dipping into 4 and 6 ms every couple of cycles. If i reduced the number of steps in the code I may be able to keep that consistent. or like some mentioned. Increase it well beyond where it would be affected.

Thanks for all your help everyone!
 
The only thing to worry about on flow rates if using standard update of the input is if the pulse rate is faster than the scan so you really need to look into interrupt on standard I/O (if it caters for it) or a high speed counter card. Many PLC's have some of the standard I/O that is fast enough but requires a I/O refresh in an interrupt. Mitsubishi FX Range has the first 7 inputs wired to high speed counters (hardware) these are normally programmed as normal inputs but as they are also wired to hardware counters if the counter is enabled in the program will count at a rate of 40khz. Some others have special blocks for interrupts and so on. Another way some PLC's can do it is to refresh the I/O many times through the program so if a scan is 100ms but it is called 10 times throughout the program it reduces the effective scan rate by 10 (not entirely as it depends on the instructions and their processing time).
 
Did you say what brand flowmeter? Endress&Hauser?

I'm sorry.. I missed the very first line of your post. Duh!
What model of click by the way? Specs vary significantly for high speed work. Could be 500us to 2 ms depending on model.

What's your program scan time? Is it fixed or variable?
Relay or sinking DC outputs?

AC or DC Shutoff valve? Length and diameter of pipe from valve to container?
AC Valve can have 8 to 16ms delay plus valve mechanical delay, plus output activation time - the slowest models' sinking and relay outputs switch on at 5us to 2ms and off 5us to 3ms. (2-36) So there's up to 5ms in delay as well.

3 GPM = 0.05 GPS = 8 oz/sec = 0.04 oz/5ms.

So all tolled,
Worst case 5 + 2 + 5 + 16 + ??(Mechanical say 15) + 15 = 43ms/5ms = 8.6 x 0.04 = .344 oz + residual ??
Best case 5 ms + 2us + 2us + 8 +15 = 28ms/5ms = 5.6 x 0.04 = .224 oz + residual

By the calcs being so close I would say possibilities are:
*Not solving all the time every 5 ms. But error of worst case at approx 0.6 oz is still probably acceptable
*Air in your flowmeter. Coriolis flowmeters can only measure accurately in one state. Any mix of solids, liquids or gas will not accurately measure.
*Mechanical hysteresis - most likely possibility. What type of valve is this and is it AC or DC? Is it brand new? My experience in high speed work is there is nothing faster than a brand new DC solenoid and they degrade with time.
*Residual flow after shutoff. Very real possibility here too if there's too much pipe after the valve.

Filling applications dry or liquid very often throttle down at the very end for fine control. Shutting off at full throttle can cause some very real errors as you are finding as well.

That valve has to be right on the delivery tube so there virtually no residual in the pipe.

Two things you can do. Wire an output to an input. Program it to cycle with every scan. Scope it and check to see what you real throughput is.

Also try this: CH1 scope on PLC output, CH2 scope on a homemade device that closes on contact with the pressure from the liquid. See what you min and max realtime delay is.

I did this years ago. For my homemade device I soldered two stiff but not too stiff solid copper wires on a 9 volt battery and adjusted the gap to a fraction of a millimeter. I held it in front of the stream and compared the two to determine my total electrical and mechanical hysteresis.


As for me, high speed work experience was developed in metal container plants (mostly 10 & 12 oz cans) where machinery runs these days at anywhere from 1800 CPM to 2800 CPM.
 
Last edited:
Just looked at the click manual and it has the first two inputs that have a response time of 2 micro secs. so pretty fast, you can also read I/O direct rather than at beginning of scan so calling a routine regularly it will read fast pulses, it also has interrupts but not looked into them.
 
For the calculation ([(Gallons / Hour) / 3600] * 5ms) do you use integer division ?
if it is true then all the flows below 3600 will be 0 after the division.


Even all fractions of flow < 3600 will be discharged and will not add to the total and therefore the accumulated flow will be less than the real one.


Two solutions :
- Use floating point variables
- And for me the best and more accurate : save the remainder of the integer division and add it to the flow in the next calculation (lastRemainder + (Gallons/Hour))/ 3600 * 5ms
 
Last edited:
One detail that some of the respondents to this thread may not know, but you listed in another thread is
Good question OkiePC.

We are pumping from a 60psi diaphram pump (or should i say pumping at 40-60psi).

The tubing at the moment is 3/8" pvc but I think we plan on bumping that up to 1/2".


We are using clamp on flow meters from Keyence, FD-Q series, I think we plan on getting their newer ones soon as well.

Edit: Are there any entrained air bubbles that pass through the flowmeter?

We are pumping into anything between a 32 oz container to a 5 gallon jug. I will have to manually choose the size.

In my opinion the pulse counting from the flowmeter is the only possible method from your system likely to give reliable results.

Edit: are there any entrained air bubbles that pass through the flowmeter?
 
Last edited:
I am running fluid through it at about 3 GPM and its source is well above it so I think it should be full but i could be wrong. We would hopefully be running around 3-5 GPM.


Do you have a measurement of the discharge pressure of the pump?


Did you go with the 1/2" PVC or something bigger?


How long is the pipe downstream of the pump?


Do you know the properties of the fluid (viscosity, density)?
 

Similar Topics

Hi Dears i want to fill gaps between Trend's Graph. i referd to Citect Help And I tried Some Trend Parameters such as...
Replies
8
Views
2,317
Hey guys, We are facing an issue, Krones hotfill line, around 10-15 fillers out of 110 are overfilling the bottle. Please help us what can...
Replies
13
Views
537
Hi, I am just exploring the options to replace an outdated filling valve controller for a can filler. It has 78 filling valves and runs at max...
Replies
15
Views
4,531
Hi guys I am hoping you can help me. I want to use an Allen Bradley HMI and PLC to record information every time a Cask is filled to an SD drive...
Replies
8
Views
3,224
Hello, i am currently trying to create a plc programme from my Tia portal v16 for a package filling machine. But i am kinda new to the plc stuff...
Replies
48
Views
17,298
Back
Top Bottom