Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6251 Pulse Width Modulation Generation

Hi,

 

I would like to generate a PWM waveform through ao0. I obtain the PWM waveform by intersecting a sine wave with a triangle wave. Once I output it via ao0 and then read from a oscillopscope.  The waveform is non continuous. I wonder it was the sampling rate problem but actually what was the major reason for this?

 

Here is the non continuous waveform and my program.

 

I am using Labview7.1.

0 Kudos
Message 1 of 5
(7,681 Views)

Sorry,

 

Here is the correct version of my program.

Message Edited by nangroy on 05-08-2009 04:29 AM
Download All
0 Kudos
Message 2 of 5
(7,674 Views)

Hi,

 

The best way to create a PWM signal with the PCI-6251 is to use one of the counter outputs instead of an analog output.  When using the counter output you are able to adjust the duty cycle of the square wave (PWM) signal on the fly when the program is running.  I would recommend to check out the links below if you are interested in doing it this way.  We have examples that accomplish this with little to no development time.

 

Pulse Width Modulation (PWM) Using NI-DAQmx and LabVIEW
http://zone.ni.com/devzone/cda/tut/p/id/2991#toc23

 

Change Counter Output Frequency on the Fly 

http://zone.ni.com/devzone/cda/epd/p/id/5493

 

How Can I Change the Duty Cycle on My Continuous Pulse Train?

http://digital.ni.com/public.nsf/allkb/82C9F3C15F62974E86256EBA0058CAF5?OpenDocument

 

After looking at your picture and running your program it makes sense that you are seeing that behavior.  I attached a screenshot below to illustrate what you are seeing.  I graphed the sine  wave, triangle wave and the PWM signal output to show how the PWM varies when the triangle wave varies.  So, the way your program is set up the output is positive when the triangle wave is greater than the sine wave.  Depending on your frequency of the triangle wave, this output will not be a correct PWM signal.  Try very low frequencies of your triangle wave (80Hz, 200Hz, etc.) so you can gain a better understanding of how the PWM is being created.

Message Edited by Jordan F on 05-11-2009 01:33 PM
Regards,
Jordan F
National Instruments
0 Kudos
Message 3 of 5
(7,645 Views)

Jordan, I have a similar question: I am trying to get better resolution out of AO output by using PWM / delta-sigma modulation since the system under test has a characteristic bandwidth of 1 KHz, much lower than the maximum supported by the 6251, but it needs to be driven by a highly linear source (better than the 16 bit output resolution of the 6251). Is there some example of how to achieve this, e.g. by modulating only the LSBs of the actual bits being sent to the AO DAC?

0 Kudos
Message 4 of 5
(6,476 Views)

Thank you for posting on the forums! I noticed that you've posted on a thread that has been inactive for a few years. As a suggestion, you might want to create a new thread, because we have many trusted enthusiasts who monitor the forums, and they tend to look at new threads, but they don't watch the older threads as much. Might give you a better chance of getting an answer. 

 

Just a thought!

Nathan S.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(6,465 Views)