Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems Reading gas meter flow rate ni 9402 counter

2015/07/13

 

Can any one help with this?

 

I have been trying to overcome the problem of the delay were a value is retained at the output of the counter for a period after the gas meter has stopped. This is causing me a problem as I am feeding this value into an integrator to get a measurement of energy used.(in the system I have other inputs such as gas pressure, barometric pressure and temperature)
 
To solve this I decided to use the quadrature encoder input. I have taken the pulses from the gas meter and built a ripple counter from two JK flip flops (with logic to convert output to gray code) I have also added extra gates to counter propagation delay in the circuit. I am using a line driver IC SN75158PE4 at the output of the circuit. Can you see any problem with this method. I only ask because if I use X1 mode I get intermittent reading as in 0, reading, 0 reading etc. If I use X2 mode I get a value that I believe is correct but am still unsure about it. and in X4 mode I get a value that is lower than expected.?
0 Kudos
Message 1 of 4
(4,587 Views)

What type of flow meter is it, and what is the counter output actually representing flow or flow rate ? If the counter is counting pulses per until flow, then it will be accumulating the flow through the meter over time, when the flow stops, the counter will stay fixed and not reduce to zero. If you want the flow rate instead (which will drop to zero when flow stops) you will need to substract the current counter output from the one at the previous time step.

 

Since you are trying a quadrature encoder input, the point above maybe completely wrong and your flow meter works very different to the simple flow meters I assumed above.

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 2 of 4
(4,549 Views)

The unit produces a pulse per unit flow. the reading that i get using the NI 9402 was set to give me the frequency of pulses. When the gas meter is stopped there is a delay between the gas meter stopping and the reading of frequency shown returning to zero (1 to 2 seconds). i assume this is due to the duration that the frequency is measured over, say if the meter stops part way through the sample period. This adds extra input to the integrator.

0 Kudos
Message 3 of 4
(4,536 Views)

Some ideas:

  1. Monitor the raw DIO data showing the pulses, to make sure there are no spurious pulses after the flow is stopped or if there is any "bouncing" of the signal that might give a false hgh flow as the flow drops to zero - if there are you'll need to find something to deal with that.
  2. What is the max/min range of pulse speeds you are working with and are the default clocks used in the counters and the update rate for your flow /  energy calculations are all approrpiate - if you do the calcs faster the "delay" should be smaller ?
  3. Are you using DAQmx channels or DAQassistant to do programming - using DAQmx will give you much more flexibility on how the measurements are processed, and may be better
  4. I presume you are using a counter to produce a frequency output - if you switch to outputing the counter value itself, this will be the cumulative flow over time and that might be useable directly in your energy calculation without having to do an integration (assuming you are using the frequency to give flow rate (e.g. litres per second) which is being integrated). This might eliminate both any delay in seeing the measurement change and the effect of a delay on the integration.

 

Hope this helps (and is understandable!)

 

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 4 of 4
(4,513 Views)