Rate Counter

dave k

Member
Join Date
Jan 2011
Location
ny
Posts
26
I have a machine that produces 1 pulse per each part it makes. Max input is 100 pulses per minute or 100 parts per minute.
I need a program to produce how many parts I am making or the rate I am making parts at for 1 hour.
I made a counter, counted parts for every 1 sec and multiplied by 3600 for hourly rate.
I am not sure this is the best way. Results are either 3600 or 7200 pph.
I am using a Micrologix 1400.
 
Try capturing the time between parts or the time to produce a fixed number of parts.

For example if you measure 750 milliseconds to make a part, your rate is 1/.75 or 1.333 parts per second or 4800 parts per hour. Pick a number of parts that gives you a reasonable update frequency. In the example you recalculate the rate every .75 seconds. If you timed two parts you would recalculate every 1.5 seconds.
The PLC's internal clock will probably give you a more accurate time than its timer functions.
 
Try capturing the time between parts or the time to produce a fixed number of parts.

For example if you measure 750 milliseconds to make a part, your rate is 1/.75 or 1.333 parts per second or 4800 parts per hour. Pick a number of parts that gives you a reasonable update frequency. In the example you recalculate the rate every .75 seconds. If you timed two parts you would recalculate every 1.5 seconds.
The PLC's internal clock will probably give you a more accurate time than its timer functions.

+1 to this. It will give you a fresh number as soon as you complete a part. It will be more precise. It will also show every little variation, which can be a good thing and a bad thing. If I have a process that is a little inconsistent, I will still calculate it this way, and then do a first order filter or average a few of the most recent results. If the process is consistent and steady, I don't bother with that. The quick feedback can be very useful for making adjustments that impact cycle rate...you know right away if you made it better or worse.
 
Counting parts per second is going to be very imprecise; you will either count 1 or 2 per second, which is why you're seeing either 3600 or 7200 per hour.

It is far more precise to count milliseconds per part.

You can use something as simple as a Timer On Delay (TON) instruction with the timebase set for 1 millisecond, or you can use the controller's free-running clock, or you can use one of the fast inputs and the Discrete Input Interrupt (DII) feature.

Start with the simple timer. Each time the pulse comes in, use a one-shot to Reset the timer, divide its accumulated value by 1000.0, and you will get a floating-point value in seconds.

As the previous example: 3600.0 seconds per part / 0.750 seconds = 4800.0 parts per hour.
 

Similar Topics

Here is my hail Mary pass I have a wheel that produces 33 pulses per revolution. The RPM of that wheel will be anywhere from 25.21 to 62.7 Pulses...
Replies
14
Views
4,698
Hi, I know basic programming on plc. need to program rate counter. I want to count pulse in 1 minute and keep counting continuously last 60 sec...
Replies
3
Views
2,466
Hi, The hardware is: Click Plc model # CO-O1DD1-O HMI model # S3ML-R magnetic-inductive flow meter model # FMM100-1001. I will set the flow meter...
Replies
4
Views
130
I have been looking to this and thought I'd ask for input from others before I take it in a wrong direction. The guy who used to set these up...
Replies
9
Views
404
How can I integrate my S7-300 Simatic with the IFM AS-i Master AC1335 and its slave IOs, such as 2411 and Airbox 2041, into Simatic Manager?
Replies
0
Views
116
Back
Top Bottom