Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I measure a fraction of a pulse

I have a pulse signal that is somewhat steady and I need to be able to count the pulses very accurately.  The pulses are streaming in(from 10 Hz to 100,000Hz) and then an external trigger marks the beginning of the count and then sometime later(maybe 6 seconds to 20 minutes) the same external trigger marks the end of the count.  The beginning of the count will have a fraction of a pulse before the whole pulses are counted. Also the end of the pulse will have a fraction after the last whole pulse was counted.  We do this now with an "in house" made ckt bd that uses 555 timers and J-K flip flops etc, to achieve pulse interpolation out to 4 decimal places. This gating board was made in the late 80's has served us well, but we are upgrading our system and we would like to replace it with something that is supported, without losing accuracy.  The type of pulse interpolation we currently use is a Duel Chronometry, but the new one can be Quadruple Timing or Phase-Locked-Loop, etc. types of pulse interpolation.   This pulse count is then sent so we can use in calculations.
 
If you have hardware that can do this, I will need 2 (possibly 3) of them.
 
Thanks, Charley
0 Kudos
Message 1 of 4
(4,088 Views)
Hi Charley,

National Instruments offers Counter/Timer boards that could suit your application. I’m not entirely sure what you mean when you say fraction of a pulse. Are you implying that the pulse width will be smaller than the subsequent pulses or do you mean that the amplitude will be smaller. Also, will the pulses be coming in at a constant rate or will it vary per 6 seconds to 20 minutes interval. I ask this because of my first question of inquiring about a fraction of a pulse. The National Instruments boards use 32 bit counters and can detect pulses that meet TTL/CMOS specifications. So if you are trying to count pulses, you will count the fraction of a pulse as well as the other pulses. You can then use another counter to measure the pulse width of the first and last pulse and use this information in conjunction with the total pulses counted. In general, these boards are handle many counter applications including encoder position measurement, event counting, period measurement, pulse width measurement, pulse generation, pulse train generation and frequency measurement. You can find more information about these boards here: http://sine.ni.com/nips/cds/view/p/lang/en/nid/4553 If your counter needs to be more customizable or you need to use analog input lines, I would recommend the R-series or M-series line respectively.

If you feel that any of these products fit your needs, I can have somebody get in contact with you to discuss the various options.

PBear
NI RF
0 Kudos
Message 2 of 4
(4,073 Views)

Patrick, thanks for a timely response. 

Our pulses are constant amplitude AND width.  The width may vary some during duration of the count by +/- 2%.  What I mean by "fraction" of a pulse can best be explained by the following example. 

Let's say the pulses coming in at 100Hz and are slowly varying from 98 to 102 Hz.  Then an external trigger (that is unrelated to the device producing the pulses) triggers your device to start counting. Counting whole pulses is easy by counting every up signal(or down).  But our trigger may have occured when our pulse was 23% into a cycle before whole pulses start being counted.  So our device counts whole pulses until the same trigger device triggers us to stop counting. That 2nd trigger may have occurred when the pulse was 82% into its last cycle. Suppose the time between the two triggers was measured with 7 decimal precision and was 165.773xxxx seconds and our device counted 166,685 whole pulses.  But our device may have counted the 1st "up signal" as  a whole pulse when in reality it was 67% of a pulse.  And the last up "signal" that was counted as a whole pulse was fine, but 82% of that next pulse didnt get counted because the next "up signal" was at the end of its cycle. So if our device could do some kind of pulse interpolation and calculate 16685 pulses for 165.773xxx seconds is an average of 100.65 pulses/second and there was only 23.27% of a pulse for that 1st one (so 66.73% of a pulse needs to be subtracted) AND for the 2nd trigger there was 82.15 % of a pulse that didnt get counted(so 82.15% of a pulse needs to be added). This net is a +15.42%, so our final pulse count is 16685.1542 pulses.

Our pulse frequency for any given test may be as low as 6 Hz or as high as 100,000 Hz. The duraion of the test may be as short as 1 second or as long as 2000 seconds.

I hope this clarifies our needs and I hope you can help us do this.

Thanks ..Charley

0 Kudos
Message 3 of 4
(4,054 Views)
Hi Charley,

I understand your problem now. Thanks for the details. If your width is constant then yes, you will be able to measure the width of a fraction of a pulse using multiple counters and some programming. You would count the pulses coming in, the internal 80MHz timebase, and use the trigger on a PFI line to start and stop all your tasks. You could use the incoming pulses as the read clock for the counter that is counting the timebase and, assuming constant width of the incoming pulses, you can calculate the difference between how many timebase ticks were counted in a full cycle (two ticks of the pulses) and how many were counted from the first trigger to the first rising edge of the pulse. The pulse fraction will be measured in multiples of 12.5ns which (assuming 50% duty cycle of the incoming pulses) will be 0.025% of the width of the pulse at 100kHz. You can use this concept at the end of the pulse train as well. The duty cycle requirement is not required, just used as an example to give an accuracy percentage.

When counting for a long period of time, you may exeed the 32bit register of the counter. This is not a problem because you can monitor the CtrnTerminalOutput pin which will indicate when this happens and you can account for this. I hope this information is useful and you feel that an NI counter/timer board such as the 6602 or the 6608 can perform the desired application.
PBear
NI RF
0 Kudos
Message 4 of 4
(4,034 Views)