Pump Stroke Counter

attaching an old one

this old example for a ML1000 (no floats) I dug up is really not much different than yours.

attachment.php


RSLogix500 rate_calc r001.png
 

Attachments

  • Stroker.zip
    20 KB · Views: 23
1. At every count, you must start a counter
2. Flag whether first count received
4. If this is first count received, zero the strokes per minute and exit
3. If this is not the first count received, then read the counter and reset it.
4. Determine Strokes Per Minute by dividing 60000 by elapsed time in milliseconds.
5. Exit
6, Track the counter every second, if it reaches 8 seconds elapsed time, zero the strokes per minute, and flag the count as not being the first count. This means the stroke counter cannot read any lower than 8 strokes per minute, which is unreasonable for a pump anyway.
 
1. At every count, you must start a counter
2. Flag whether first count received
4. If this is first count received, zero the strokes per minute and exit
3. If this is not the first count received, then read the counter and reset it.
4. Determine Strokes Per Minute by dividing 60000 by elapsed time in milliseconds.
5. Exit
6, Track the counter every second, if it reaches 8 seconds elapsed time, zero the strokes per minute, and flag the count as not being the first count. This means the stroke counter cannot read any lower than 8 strokes per minute, which is unreasonable for a pump anyway.

actually i have seen pumpjacks set to run at less than 8 strokes per minute...
 
The problem is, if you don't time it out, then it will retain the last reading it had until the pump starts again thereby showing you a false reading. We manufacture pump stroke counters as a stand alone unit, thousands of them are currently at use in the oilfield for drilling (mud pumps), and this is the algorithm used in our counter.
 
I reded the pdf

During my test I logger over 1450 "strokes" based on 17 strokes per minute. I ended up with a calculted 16.997168 strokes per minute, with the calculation being update per stroke.

Here's a Logix 5k version:

I reded your pdf but i did not see any tim in the couter can you repet the instruction with simple explanation
 
Well, suppose you wanted to know your average speed over the course of a trip. You would start a stopwatch and then drive where you wanted to go. At the end of the trip you would divide the time that it took to complete the trip into the number of miles that you drove.

But since your stopwatch measures in seconds, and miles per *second* isn't very useful, we have to do some conversion first.

You could divide the number of seconds that transpired by 3600 (giving you hours), but this will introduce errors in your math due to the limitations of floating point math.

But if your variable has the capacity, multiply the number of miles by 3600 instead, and then divide the seconds into that to give you MPH.

You would use the first method if you were at risk of overflowing your variable, the second if not. It works out to be the same result.


So getting back to the stroke counter:

Rung 0 just resets the test logic.

Rung 1 simulates the pulse you would get from your machine each time it stroked. (See rung 3 for the explanation of why this number does not match the calculated time in rung 3).

Rung 2 drives a timer that will run when ever your machine is running. Put your running bit at the beginning of the rung. The counter portion of the same rung will increment the count each time the machine cycles, or "strokes". Keep in mind that in the Rockwell world, the timers count by milliseconds, not seconds. Hence 3510 is actually 3.51 seconds.

Rung 3 will give you a running result per stroke by using the same input as you would use to increment the stroke counter. The first divide instruction divides the total number of strokes into the total elapsed time. The second divide instruction divides the average time that it takes per stroke (keep in mind that this is in milliseconds) into 60000 milliseconds (60 seconds).

Notice that the measured stroke period is 20 milliseconds more than the timer preset in rung 1. The extra 20 milliseconds is the time that the timer doesn't account for due to what we call "housekeeping" routines. This is a slice of time that the PLC uses to service the I/O, solve logic, and order takeout pizza.

If you want to (mostly) avoid this, in a Rockwell PLC you can use a STI (Selectable Timed Interrupt). Set it for 1000 milliseconds minus your overhead time (which on average will be the same). You will have to calculate what your housekeeping time slice is, but that's easy. The STI will fire an interrupt to a routine where you will add 1 to an existing count. These are seconds. Pretty accurate seconds in fact. Back in your main routine you will use this as your elapsed time (keep in mind that it will be in seconds, not milliseconds).
 

Similar Topics

Hi everyone, I wonder if some one can help with code to have one short pulse on out put for every piston stroke on piston pump. I have input from...
Replies
1
Views
2,290
Hi, I would like to assemble a simulator/practice booster pump system that uses PID to maintain steady water pressure under various outlet demands...
Replies
0
Views
86
I've gotten to the learning curve where I can program a call for pump to come on at set point but I'm not sure how to turn the same pump off when...
Replies
1
Views
140
Hey Guys, I was looking for a little help on a school project. I was asked to program three pumps with two inputs, more and less. The project...
Replies
23
Views
2,524
My department has been tasked with writing the program for a 4 pump lift station that alternates all four pumps (one lead, one lag, two on...
Replies
4
Views
1,080
Back
Top Bottom