Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Advise for picking the proper USB card to monitor 1kHz PWM.

Hello all,

 

I am familiar with LabVIEW but not so much with NI cards. For a LabVIEW bench, i need to measure 6 * 1kHz PWM signals which can be any amplitude between +/-15V but it will not change during the measurement.

 

We need to continuously display on an indicator:
    - the duty cycle
    - the frequency
    - the maximum voltage of the last 2s (low pass filter needed to remove peaks)
    - the minimum voltage of the last 2s (low pass filter needed to remove peaks)
0.1% resolution for the duty cycle is needed, and is the most important part of the measurement.


Potential solution 1:
I have found it is possible to use an AIN to measure frequency and duty cycle, but in order to reach 0.1% resolution for the duty cycle, that would mean 1Mhz sampling rate.
I can only use a USB type card and I need 6 channels with differential AIN. Considering all of this, that would lead to potentially the use of USB-6356.
The drawbacks are that this card is a bit pricey (~5.5k€), and on LabVIEW side i don't know how easy it is to make all the measurements mentioned above continuously with 1Mhz sampling rate per channel.
Indeed, the LabVIEW SW is also doing a lot of other things.
Does this solution seem appropriate?

 

Potential solution 2:
The other way would be to use an AIN for measuring the voltage with lower sampling rate (such as 100kHz) and using a counter input for measuring frequencies and duty cycles.
This solution would be cheaper (~3k€) if I consider two cards such as USB-6210 and USB-6341 to get the 6 counter inputs.
It's a little bit more dirty though as I would need to use diodes to cut the signal at 0-5V before the counter input.

 

 

Anyway for both solutions I would need a voltage divider to fit the input signal (+/-15V) into +/-10V.
What solution makes more sense software wise? I am not familiar with NI HW so I don't know whether solution 1 would be a struggle for LabVIEW because of the high sampling rate. Especially that I would also need to feed the (for example) 500k samples waveform to a "Butterworth filter" VI and the "Pulse measurements" VI every 500ms.

I would really appreciate your expertise with NI hardware!

BR,

Ludovic

 

0 Kudos
Message 1 of 7
(861 Views)

For 1 KHz of PWM with 0.1% of duty cycle, the smallest pulse is 1ms*0.001 = 1us. According to Nyquist thereom, you would need a sampling frequency of at least two times the signal frequency. Thus you need at least 2 MHz of sample rate if you are going to use analog input. In practice, it is recommended to use 5 to 10 times and you will be looking at 5 MHz or 10 MHz of sampling rate, which is basically a digitizer or oscilloscope. Analog Discovery 2 is a possible cheap solution but you still need a voltage divider. You can Using the Analog Discovery 2 in LabVIEW

 

For the alternative of second solution, you can consider cDAQ-9174 + NI-9221 (8 ch of +/- 60V analog input) + NI-9361 (8 ch of 0-24V counter input) which is around 3.7.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 7
(845 Views)

Hello Zyong,

 

Thanks for your answer, I will definitely have a look tomorrow at the the cDAQ possibility for solution 2, I didn’t think at checking cDAQ. Ethernet connection would even be more convenient than USB. 

About the first solution, I would disagree with your analysis. Shannon refers to the maximum frequency of the signal, you are right that 0.1% DC means a pulse of 1us but that 1us would not be the frequency of my signal. This 1us pulse should be able to be caught with 1MHz sampling rate. Anyway my bad in my original email that I was not clear. I would need to measure with 0.1% resolution for the DC but my minimum DC is around 5% (I can’t recall right now). So I am quite confident that 1MHz would be enough for my application, but I am not sure about how feasible it is to handle 6 AIN at 1MHz with continuous measurement in parallel and with applying the butterworth VI and the pulse measurement VI…

0 Kudos
Message 3 of 7
(822 Views)

Ethernet connection would even be more convenient than USB. 

Please be reminded that Ethernet has a higher latency than USB.

ZYOng_0-1683759701957.png

Reference: How to Choose the Right Bus for Your Measurement System

 

 I would need to measure with 0.1% resolution for the DC but my minimum DC is around 5%

In that case, 1 MHz is sufficient.

 

how feasible it is to handle 6 AIN at 1MHz with continuous measurement in parallel and with applying the butterworth VI and the pulse measurement VI…

Based on What Is the Maximum Throughput On My USB cDAQ Device?

6 ch * 1 MHz * 3 bytes (24-bit ADC) = 18 MB/s

The throughput is well within the 250 MB/s maximum throughput of USB.

 

Perhaps the only concern is how often you would need the data. If you are just streaming and logging the data without needing it to control other thing, you should be all good.

-------------------------------------------------------
Control Lead | Intelline Inc
Message 4 of 7
(815 Views)

Thank you for this link about bus bandwidth, that's very useful!

 

I have checked more in details your solution of using cDAQ-9174 + NI-9221 + NI-9361, unfortunately NI-9361 counters can only measure duty cycle with compactRIO.
I will try to push for the use of USB-6356 (5400€), or USB-6346(3400€) with a resolution of 0.2% if the budget is an issue.

I still would like to understand better the counters though. I have seen in USB-6210 spec that the counters cover following measurements: Edge counting, pulse, semi-period, period, two-edge separation


If I have understood properly, "pulse" is the counter input measurement to get the duty cycle. Therefore is it correct that with the USB-6210, I could measure two PWM of 1kHz using the two counters? I don't need a third counter to generate a clock or anything else?

I have read somewhere (I can't find back) that when the signal is noisy some digital filters could be applied on the counter in order to get a proper duty cycle result. Are these digital filters available for every card (including USB-6210)? I somehow feel that using an AI to measure the duty cycle would be safer as I could post-process the waveform in LabVIEW before applying the "Pulse measurements" VI.

But if the counter input would really work properly, then USB-9210 + USB-9341 would be the cheapest solution (~2900€) which could reach the requirement of 0.1% resolution for the duty cycle measurement.

0 Kudos
Message 5 of 7
(768 Views)

unfortunately NI-9361 counters can only measure duty cycle with compactRIO.

Where did you get this information? Velocity and Duty Cycle Measurements Supports NI 9361 Only states that NI-9361 does support duty cycle measurement with DAQmx.

 

I still would like to understand better the counters though. I have seen in USB-6210 spec that the counters cover following measurements: Edge counting, pulse, semi-period, period, two-edge separation

You can calculate duty cycle using semi period measurement. Most modern DAQ devices support this. See How to Measure the Duty Cycle of PWM Wave

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 6 of 7
(759 Views)

Yes your link doesn’t mention about compactRIO, but the spec does: 

 

Pulse/Duty Cycle Measurement

You can take pulse or duty cycle measurements with the NI-9361 on CompactRIO systems only.

 

At this link:

https://www.ni.com/docs/en-US/bundle/ni-9361-specs/page/specs.html

I guess I could use “pulse width” measurement but then I would need 2 counters per measurement. In your link I have also read that NI-9361 could only have one task, so I guess I could not use all 8 counters. 

0 Kudos
Message 7 of 7
(749 Views)