Author Topic: Frequency Read  (Read 12207 times)

glouw

  • Guest
Frequency Read
« on: January 06, 2015, 08:27:23 PM »
Hi all,

Can an IO module read the frequency of a 0.3V peak to peak sinewave that is biased at 5volts within the range of 10 - 100Hz? That is, can I read the frequency of a sinewave with a max peak of 5.15V and a min peak of 4.85V within the range of 10 - 100Hz?

Thanks in advance.

Offline oiltronic

  • PLUS+1 Guru
  • *****
  • Posts: 170
  • Karma: +15/-0
Re: Frequency Read
« Reply #1 on: January 19, 2015, 07:43:55 PM »
PLUS+1® Controller Family Technical Information Manual
Input Configurations for PLUS+1® Controllers Technical Information Manual

"Good luck with that" comes to mind.  Won't work for frequency or digital input (and measuring it yourself) because the configurable thresholds won't go that high when the input range is set to 5V.

In theory you could do this with an analog input and your own software in the main controller.  100Hz has a period of 10 msec, so you'd want to sample at least double that at 5msec, which an analog input and CAN-connected i/o module can do.   A pair of analog comparators , an OR gate, and a period measurement could do it.  Pretty dicey though given the 2.56msec analog sample rate and 75mV analog voltage accuracy.  If I really had to, then I'd test this with reduced thresholds and different frequencies to see what kind of margin I had.  Better yet, just get an amplifier for the signal.

I suggest also removing that cross-post of yours with the same question.


glouw

  • Guest
Re: Frequency Read
« Reply #2 on: January 22, 2015, 11:40:18 PM »
Interesting. Thanks for the response. I removed the cross post.

I'm sure I'd be able to filter out the 5V DC offset and amplify with something external. Setting the pin config to '1' on one of the Freq pins, the a rising edge would trigger in transition to the 0.191V-0.279V region and the falling edge would trigger in transition to the 0.067V-0.187V region.

Correct me if I'm wrong.

The software idea frequency read is not a bad idea either. I will consider this.