Need Guidance for an Application

Vision2014

Member
Join Date
Sep 2014
Location
Rochester, NY
Posts
2
I am working on an application in which I will need to compare two PNP (or NPN) pulses, each of which coming from light sensors at two separate points on a high speed conveyor.

I need to compare the phase of the two pulses (Boolean AND function), and measure the pulse width resulting from the comparison.

I then need to use the pulse width of the result to trigger an alarm if the width gets too narrow.

The frequency of the pulses is around 100 HZ.

I need a low-cost solution that can send the result to an Allen Bradley PLC currently used in a factory.

I considered using a data aquisition card in a computer, but I think a low cost PLC like the Automation Direct Click series can do this.

I'm an electrical engineer with a background in machine vision systems and photonics, but with very limited experience with PLCs.

Any help on this would be appreciated. Thanks in advance.
 
100 Hz could be detected by many PLC's standard digital inputs, and many PLC's have built-in High Speed Counter inputs. You might need a PLC that has 2 high-speed inputs. Some PLCs only have 1 or no high-speed inputs.

The Allen Bradley MicroLogix 1400 BWAA AND BXBA PLCs have 12 high-speed inputs that are rated for up to 100000 Hz, and 8 standard digital inputs rated for 1000 Hz. The Automation Direct Click basic unit appears to have 2 inputs rated for 50000 Hz maximum, and the other 5 are rated for 100 Hz maximum.

ANDing the 2 digital inputs together in a PLC program will result in an output that is only ON at the time that both pulses are ON. If each time both inputs are ON, you read the AND output and get no TRUE (within a specified time period), then it means the pulse AND combination was too narrow to detect. You could use that as your alarm output.

The above method will not give you an analog measure of the AND pulse width, but only an ON/OFF or TRUE/FALSE digital reading, meaning that the 2 pulses were ON at the same time within the PLCs ability to detect the pulses. If you need an analog measure, then you would need to use 2 analog-type photosensors to send analog values to the PLC, where you could use a timer, or the internal PLC clock, to measure the width (in miliseconds) of each photosensor pulse.
 
Last edited:
If I am reading this correctly, you want to measure the overlap in the two signals? If so, what is the minimum time duration of the overlap that triggers the alarm? At 100Hz and a 50% duty cycle, the "On" duration of the pulse is 5ms. A lower cost PLC will only scan in the 5-10ms range. With a PLC scanning at 5ms, it will only see the pulse on for 1 scan, therefore never be able to measure overlap in the two pulses.

So let's say you use an interrupt input to catch the exact rising edge of the first pulse and start a timer. If your PLC is scanning at 5ms, then your timer updates at the same rate, therefore you still would not be able to measure the overlap.

What this comes down to is that you need to scan at a maximum time of 1/2 of your limit that causes the alarm. If your alarm triggers at 20% overlap, that is a 1ms overlap, so your PLC will have to scan at 0.5ms.

What is the voltage of the pulses? I am thinking you may need something like a Beckhoff CX8090 with EtherCAT IO that will update in the sub-millisecond range. That would put you in about the $600 hardware range. Another option is to use an Arduino, it can read inputs and update in the range of 10's of microseconds (0.00001s). The arduino is very low cost, but not really an industrial piece of hardware.
 
...and measure the pulse width resulting from the comparison.
One way would be use a PLC High-Speed Counter input (not tied to the PLC scan rate otherwise it could not measure at 100,000 Hz) to count the number of pulses in a longer, measurable time period (1 or 2 seconds), then divide the count by time to get the pulse width of each input sensor.
 
I need to compare the phase of the two pulses (Boolean AND function), and measure the pulse width resulting from the comparison.

I then need to use the pulse width of the result to trigger an alarm if the width gets too narrow.

The frequency of the pulses is around 100 HZ.
The way I am interpreting this (which may not be correct), is that he has 2 pulse trains of 100Hz with the phases shifted relative to each other. He wants to essentially measure this phase shift by measuring the overlap period.

Let's say signal one is the first to go high. The second signal then goes high some milliseconds later. You would need a very accurate time stamp of the rising edge of the 2nd signal. Then another time stamp of the 1st signal's falling edge. The difference between those time stamps would give the pulse duration of the two signals ANDed together.

If you assume both signals are 100Hz with a 50% duty cycle, then the pulse duration of the signal being high is 5ms for each one. If the 2nd signal goes high 3ms after the first one went high, then the ANDed result of the two signals would be a 2ms pulse width. I'm thinking this resulting pulse width is what needs to be measured.
 
More Detail about the PLC Application

I think we need more details about the purpose and goal of the measurement.

Thanks to all for your input. Here's more info:

Consider a long web moving through a large machine. The material is thin plastic, like that used for product packages.

There are registration rectangles printed along the edges. A Keyence optical sensor will be used to detect the registration rectangles along the edge. I plan to use two of them, approximately 30-50 ft apart. The sensors have a PNP output, but I might switch to NPN to get the fastest possible rise/fall times.

I am interested in monitoring a displacement in the relative position of the two rectangular markers, as an indicator of mechanical distortion of the material that could be caused by mechanical stress of the material as it threads through the process.

So imagine having a system set up with the two sensors. One sensor will be located at the beginning of the web, and the other about 50 ft down the web. As the machine runs in a steady state, with no distortion problems, we will align the sensors so that the pulses from each are coincident in time and pulse width.

Now suppose that there is mechanical distortion introduced to the material during processing. This will cause the phase of the pulse from the second sensor to move with respect to the pulse from the first sensor.

If both of these pulses were put through an AND gate, the resulting output will be high only when both pulses are concurrently high. This means that the width of the resulting pulse is proportional to how well aligned the registration marks on the product material are with respect to each other. In effect, the width of the output pulse will be inversely proportional to the quality parameter we are monitoring in the system.

Rather than take a discrete component approach to accomplish this, I would like to use a PLC.

I would also like the PLC to have a short learning curve, as I need to minimize the amount of time to implement this solution.

We typically use 24V pulses in our system, but because of the speed requirements, we might go with 5V pulses (shorter rise/fall times.)
 
Last edited:
Thanks to all for your input. Here's more info:

Consider a long web moving through a large machine. The material is thin plastic, like that used for product packages.

There are registration rectangles printed along the edges. A Keyence optical sensor will be used to detect the registration rectangles along the edge. I plan to use two of them, approximately 30-50 ft apart. The sensors have a PNP output, but I might switch to NPN to get the fastest possible rise/fall times.

I am interested in monitoring a displacement in the relative position of the two rectangular markers, as an indicator of mechanical distortion of the material that could be caused by mechanical stress of the material as it threads through the process.

So imagine having a system set up with the two sensors. One sensor will be located at the beginning of the web, and the other about 50 ft down the web. As the machine runs in a steady state, with no distortion problems, we will align the sensors so that the pulses from each are coincident in time and pulse width.

Now suppose that there is mechanical distortion introduced to the material during processing. This will cause the phase of the pulse from the second sensor to move with respect to the pulse from the first sensor.

If both of these pulses were put through an AND gate, the resulting output will be high only when both pulses are concurrently high. This means that the width of the resulting pulse is proportional to how well aligned the registration marks on the product material are with respect to each other. In effect, the width of the output pulse will be inversely proportional to the quality parameter we are monitoring in the system.

Rather than take a discrete component approach to accomplish this, I would like to use a PLC.

I would also like the PLC to have a short learning curve, as I need to minimize the amount of time to implement this solution.

We typically use 24V pulses in our system, but because of the speed requirements, we might go with 5V pulses (shorter rise/fall times.)

Why not use an encoder/transducer master in a servo drive or motion controller, and use these as teach inputs, and 'capture' the position of the virtual master when they fire? All you'd need to do is store the captured positions, and do the math.

Or, if a motion controller isn't available, just simulate an encoder using the velocity of the web...making your own virtual encoder.
 
What is the time duration of the resulting ANDd pulse at the point it should trigger the alarm?

If your "on time" for each individual pulse is about 10ms, then you will need to a PLC capable of fairly fast scan rates
 
Archie, that Beckhoff is looking pretty good right now.
I am thinking you may need something like a Beckhoff CX8090 with EtherCAT IO that will update in the sub-millisecond range. That would put you in about the $600 hardware range.
 

Similar Topics

I've got this 3-phase 575V motor that we're controlling with a VFD (Variable Frequency Drive), which has been quite the learning curve in itself...
Replies
10
Views
264
So, my job is pretty much giving me a PLC lab to train with. I just finished up some basic analog signaling and processing using a process meter...
Replies
14
Views
8,994
Hey guys, I would like to ask some advice. I am working on the LogixPro bottle line simulator and I am having trouble figuring out the logic in a...
Replies
0
Views
1,270
Hello everybody. I am into technical marketing of various automation products except PLC's. Recently I have been given the responsibility of after...
Replies
3
Views
3,594
CheezyMane13
C
I am an electrical engineer working for an A-E which designs all sorts of facilities. I’ve had all kinds of experience in lighting systems, fire...
Replies
13
Views
5,474
Back
Top Bottom