LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency fpga

Solved!
Go to solution

I need to measure the frequency pulse from a Cox turbine flow meter using the FPGA on my 9074.

I can't measure anything below about 10 hertz and then display freezes. If the frequency source stops (ie: turbine stopping) it freezes with the last good value which I understand from the code but the range I need is 0-2500 Hz.

It exhibits the same behavior in FPGA as it does in Scan Mode. Can you tell us what we’re doing wrong?

 

0 Kudos
Message 1 of 6
(3,875 Views)
It sounds like you need to put a time-out on your VI so that if no pulses are detected in a period, then set the output to 0.

Your VI only updates the 'Period 1' value on the rising edge of the 9411 Digital Input - so if there are no rising edges (because the pulse train has stopped) then it will always use the last value, hence the need for a time-out.

The value of the time-out is important - if you set it to be too long then it take a long time to register that the flow has stopped. You should set it to be the minimum period of pulses that you could consider the flow to be stopped for.

In reality, you're only able to detect the range <some small number - the timeout value) - 2500Hz but you interpret your small number to be 0.

I hope that helps - the problem is similar to velocity estimation from quadrature encoders (which also output a pulse train) - so if you want to do some more reading then that might point you in the right direction.

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 6
(3,871 Views)

Basically what Sam said.

 

If I have a digital line go low for 0.5 seconds, then high for 0.5 seconds the signal has a frequency of 1Hz, but what if my digital signal goes high for 60 seconds, and low for 60 seconds?  Does it have a rate of 0.008Hz?  Well the FPGA doesn't know how long it will be between pulses, so it just keeps waiting for a pulse to happen.  If it sees a signal go low it will wait forever for it to go high again to calculate the period.  You need a timeout in Ticks to determine how long no change in state should be considered 0Hz.  I don't know if this is all of your problems but it is one of them.

0 Kudos
Message 3 of 6
(3,855 Views)

I used the earlier suggestion and added a time out of 20000000 ticks with no change to call the frequency zero, that works well. My problem now remains that below 10 Hz input signal I don't get valid numbers from the VI the period measurement number goes up to trillions.

 

0 Kudos
Message 4 of 6
(3,848 Views)

@mikeburrow wrote:

I used the earlier suggestion and added a time out of 20000000 ticks with no change to call the frequency zero, that works well. My problem now remains that below 10 Hz input signal I don't get valid numbers from the VI the period measurement number goes up to trillions.

 


Possibly a roll over condition?

0 Kudos
Message 5 of 6
(3,835 Views)
Solution
Accepted by topic author mikeburrow

The final soulution was fpga_image.jpgpainfully simple.

 

0 Kudos
Message 6 of 6
(3,795 Views)