Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6361: generating square waves on analog output, problem with duty cycle

Solved!
Go to solution

Hello,

 

i want to control a gate driver for MOSFETs and therefor i need square pulses on the two analog outputs. I am already generating two square waves (low: 0V, high: 10V) with a frequency up to 10kHz, the second one has a delay of 180 degree.

 

With the settings you can see in the screenshot, i get a frequency of 10kHz. The problem here is the variation of the duty cycle. In this case i can only set three values: 0%, 50% and 100%. 1% already gives me a duty cycle of 50%, everything >50% gives me 100%.

This continues with lower frequencies. For example when i have 1kHz, i can only do 5%-steps.

 

Everything is measured with an oscilloscope. Hope there are some ideas for me.

 

Best regards,

Patrick

0 Kudos
Message 1 of 3
(2,026 Views)
Solution
Accepted by topic author Patrick_L1

Well, what do you *need* to do?  And why?

 

The DAQ Assistant and Simulate Signal express vis hide too much detail for me to be able to diagnose fully, but it appears that the sample rate of 20 kHz is your main limiting factor.  The available resolution for setting a duty cycle will be proportional to (sample_rate / square_wave_freq).  The larger the # of samples per square wave cycle, the more distinct ratios are available.

 

For example, if you need 1% resolution in setting a duty cycle, you need a sample rate 100x as fast as the square wave freq.   So a 10 kHz square wave with 1% resolution in duty cycle would require a 1 MHz sample rate.

 

I'm surprised the express vi you used seems not to have an input setting for sample rate.  It *should* need to be part of the signal generation algorithm. 

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 3
(2,012 Views)

Right, the sample rate was the limiting factor here.

 

Thanks for your help and explanation!

Patrick

0 Kudos
Message 3 of 3
(1,994 Views)