Pulse Counting

godfrey

Member
Join Date
Apr 2002
Location
Charlotte, NC
Posts
412
I need to count short pulses from a dry contact which is feeding into one of the digital inputs of my SLC 5/04. The frequency of the pulses is about 1 second. The duration of the pulses is 15 milliseconds. My scan time is about 20-30 milliseconds. Will I miss the pulses? If so, what can I do to capture them?
 
You can either use a high speed counter card or since your frequency is so low, your best bet might be a pulse stretcher.

I've never used one but perhaps an STI might work here also but I think the pulse stretcher is the best way to go here.
 
How about using interrupt programming to "view" that particular input more often during the scan? Usually works for me.
beerchug
 
Will I miss the pulses?

You can count on it! or would that be, You can't count on it? Puns can be difficult sometimes.

You will miss pulses.


If so, what can I do to capture them?

If your PLC has Pulse-Stretching capabilities... that's the easiest way to go.


On another note, using a dry-contact to provide a 15-mSec pulse, once every second, can be pretty hard on a contact... even if the signal is 24-VDC... the low voltage stuff might even be worse. It has a way of building up a resistive oxide coating on the contact... then you'll miss all kinds of pulses. Using 120-VAC helps to keep the contact cleaner... not clean, but cleaner.

If possible, you might want to look at providing the signal through an Opto-Isolator.

What is the original source of the 15-mSec signal?
 
More Info

The source of the pulses are from LMI chemical pumps. The chemicals treat raw water in a water treatment plant. There are six of them. I don't have to totalize or control flow, just alarm if no pulses are detected after x seconds. The pumps have speed control which would space the pulses between 0.5 sec. and 30 sec. apart. The manufactures literature says 15 millisecond minimum pulse duration. I will contact them Monday to inquire on typical and maximum pulse widths. I don't have the option to change what the customer is sending me but I have to find a way to deal with it.
I like the cap idea. Simple. It probobly needs a series resistor to control bleed off. I'll play with it. More on Monday. Thanks to all.
 
The capacitor may be used to stretch it, but turning it off before next pulse starts may not be very definite. Banner have a "one shot amplifier" which stretches in terms or milliseconds or seconds based on selection. It is small in size and your documentation will be neat either. I can't remember the model number, if you need I can let you know on Monday.

It will a lot easier if your source itself can be varied, check it out before proceed.
 
Have a look at the 1746-ITB16 or 1746-ITV16 fast response input module. From memory they are 0.3 msecs on 0.5 msecs off cards. Use the Discrete Input Interrupt (DII) command with this card. AB states with 100usec polling you can read up to 1 Khz. Regards Alan Case
 
don't miss pulses

Firstly you need to eliminate the dry contact and replace it with
an optocoupler. The relay simply will not last at that operational rate. As it wears off it will bounce more and more. If you have to use
relay then I suggest that you use CHAVAK's suggestion and use
Banner one shot module. Custom designed one shot can be accomplished with a 555 timer or a 74123 retriggerable one shot.
Once you have streched the pulse you can use a standard ladder
logic to process it.
If you use an optocoupler you should use an STI and process the
pulse in the STI routine. 15 mS should be no problem what so ever.
Been there done that.
You can count on it! or would that be, You can't count on it? Puns can be difficult sometimes.

You will miss pulses.

I say that you will never miss pulses if you use STI!

If so, what can I do to capture them?

If your PLC has Pulse-Stretching capabilities... that's the easiest way to go.

Your PLC can't stretch something that it cannot see! You need to stretch the pulses outside of the PLC!


Use the Discrete Input Interrupt (DII) command with this card. AB states with 100usec polling you can read up to 1 Khz. Regards Alan Case

Problem with this idea is that it requires you to put the DII and associated logic in the ladder program numerous times.
DII is not a vector type interrupt it only gets processed when you scan the instruction.


I like the cap idea. Simple. It probobly needs a series resistor to control bleed off. I'll play with it. More on Monday. Thanks to all.

I would like to know what type of capacitor you will be using?
Tantalum, electrolytic, monolythic etc etc??
Caps have tendency to leak after a while.
Most caps have tolerance of about 20%, so if you get it somehow working with one will you get it working again with another?
What formula will you be using to calculate your time duration?
It's not going to be a one shot! Would you let me know how you get this working? I can tell you that the 74123 one shot chip
is well documented in TI's manuals and 555 timer is well documented in
in National's handbooks.


Use an optocoupler and an STI and YOU WILL NOT LOSE ANY PULSES!
 
Ya know, if you don't need to count these pulses, just alarm if you stop getting them, why not let the !input ---|/|--- run a timmer that re-starts when the contact opens. Your bound to see it open now and again unless the pumps quit. If you miss a few who cares. If the timer times out then alarm.

Ya it's crude but it could work for you. Do replace the relay though with something less likely to fail.

Lenny
 
forgot to mention

I forgot to mention one thing, you need to use the DII instruction within the STI. Sorry.
 
I tend to agree with Lenny, unless you have a particular need to count every pulse then why bother.
Another question, is it actually a relay that you are getting these 15 millisecond pulses from? I know you said a dry contact in your statement but it is hard to believe that a relay can maintain that hz. for any length of time. I would hope it is just a pulse point that was provided by the manufacturer and in fact not a relay.

Roger
 
Godfrey, I also design controls for water treatment systems, but use the Prominent www.prominent.cc line of metering pumps. These pumps are available with a semiconductor pulse output with a "closed" duration of 100ms. They also have relay outputs, but only have a life of 200,000 switch cycles at 24vdc 100mA. Prominent also has a new metering pump with 4-20mA output for flow monitoring. Like Lenny said, who cares if you miss a pulse or 2, its only going to be in the range when the pump is at maximum stroke rate. The majority will probally be 2-5 second durations
 

Similar Topics

Hi, any advice would be useful. We have an EL1512 that is counting pulses from a flow meter. We need to ascertain the frequency of the pulses as...
Replies
16
Views
5,716
Hi everyone first of all. This is first question in the forum. I am using HSC application. I'm reading A and B pulse count. 1 round of the motor...
Replies
12
Views
4,379
HELLO I have' a flow meter that continuously passes the milk and milk passage of which is shown on the display. So far, I have no problem...
Replies
3
Views
1,847
Hi There, I want to use a Zelio to monitor pulses coming from a device. If the pulses are higher than 0.5Hz, then the output is on but if it drops...
Replies
3
Views
1,883
Hello All, I am using a Micrologix 1100 with a HSC counter. The HSC counter is working the way it should be. I am trying to detect the Duty Cycle...
Replies
3
Views
2,355
Back
Top Bottom