Jump to content

Read 500Hz pulse on regular input?


Recommended Posts

I have an application that requires 6 encoder inputs, all of them are 1 channel (1 signal output, not quadrature encoder).

 

Maximum pulse rate is 460Hz, let´s make it 500Hz

At this rate, I have a square wave that is 1mS high and 1mS low.

 

On my tests, a V350 can run at 1400 scans/second, which is barely enough to see a high input level on a PLC scan, and a low input level on the next scan.

 

 

Is there any hardware limitation to keep me from doing this?

A low-pass filter?

Software debounce?

 

 

These encoders will be used to measure flow, but not total volume.

In other words, I can miss a pulse once in a while, or make CLP run faster by not calling subroutines that are not important during flow measurement, which will take 100mS or 200mS, once or twice a second.

After I measure the flow, I call these subroutines again (linearization, table write, SD write, Modbus scan, etc.)

 

Thanks

Link to comment
Share on other sites

Hi Amirm,

As stated in the V350 documentation (available here), the typical response time for a normal digital input is 10ms. Hence for a 500Hz signal you will be able to reach a maximum resolution of sampling every 5 pulses. This calculation doesn't take in consideration the scan time, which will make the system even less accurate. Even if the PLC would response faster, according to the  Nyquist–Shannon sampling theorem the perfect reconstruction of a signal is possible when the sampling frequency is greater than twice the maximum frequency of the signal being sampled. Hence the maximum scan time+digital input response should be less than 1/1000Hz, which is less than 1ms.

Link to comment
Share on other sites

Thanks, Eyal.

 

About Nyquist, I might be wrong, but I just want to count how many pulses I have over some time.

If I cared about aliasing, having the exact frequency, or be able to reproduce the signal, then I´d need a sample rate at least twice the signal frequency.

 

Unfortunately, 10mS response time for digital input makes it impractical.

 

The solution: use relays to multiplex the high-speed inputs.

As stated before, I just need to read flow.

I can sample flow every 2 minutes, and it changes very little over time.

 

Thank you very much!

Link to comment
Share on other sites

Thanks, Eyal.

 

About Nyquist, I might be wrong, but I just want to count how many pulses I have over some time.

If I cared about aliasing, having the exact frequency, or be able to reproduce the signal, then I´d need a sample rate at least twice the signal frequency.

 

Unfortunately, 10mS response time for digital input makes it impractical.

 

The solution: use relays to multiplex the high-speed inputs.

As stated before, I just need to read flow.

I can sample flow every 2 minutes, and it changes very little over time.

 

Thank you very much!

 

Aliasing and signal reproduction are irrelevant in your case. however, the (relatively) low sampling rate might cause "skipping" of sampling, resulting in wrong flow reading.

Anyway, your solution seems very elegant for your system needs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...