Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling an AC heater ban with analog output instead of PWM

I'm up against a problem.  I ordered an NI USB-6009 low-cost multifunctional DAQ and it doesn't have all the "multifunctional" I need.  Apparently, this thing has a counter that counts but doesn't do pulse train generation like my other multifunctional daq devices have.  However, I do have 2 analog outputs.  Any ideas on what I would need to either convert my analog output into a TTL PWM signal?  I've always controlled my heater bans using an AC relay controlled via PWM that is set by a software PID controller using a thermocouple as feedback.  I'm not familiar with what hardware I would need to use in order to take advantage of the analog outputs.
0 Kudos
Message 1 of 7
(3,936 Views)
What frequency do you want to run your PWM signal at?  The AO only runs at 150 Hz.






Message Edited by rpursley8 on 05-29-2008 03:26 PM
Randall Pursley
0 Kudos
Message 2 of 7
(3,925 Views)
Hmm....  I guess I did not consider the possibility of generating a PWM signal out of the analog output.  I want to output 0-10V and then have some sort of converting hardware that would translate that into a PWM with some low frequency pulse-width (on the magnitude of 2-5hz for the width of the pulses).  So for instance, 5V into my device would produce a 50% duty cycle, and likewise 10V would produce a 100% duty cycle.  But if I want to make code to generate a PWM signal, why not just use on of my digital outs then?

The problem with PWM a digital output pin is that my software is responsible for the timing and that will be an extra load on the CPU.  I suppose if it were slow enough (say a 2hz pulse width) it wouldn't make that big of a difference.  I do prefer, however, passing the duty cycle and pulse width frequency to a counter and let the hardware do all the work w/o excess interruption to the CPU.

Hmmmm.......
0 Kudos
Message 3 of 7
(3,918 Views)
You can set up the AO channels to update at 2-5 Hz.  One channel would generate a ramp signal (0-10 V).  The other signal would be your control signal.

You could then run both channels into a comparator to create your PWM signal.

Attached is a suggestion.


Randall Pursley
Download All
0 Kudos
Message 4 of 7
(3,904 Views)
Here is one where you just output the PWM signal directly updating at 5 Hz.  It shouldn't take up too much PC resources since you are only updating the DAQ card 5 times a second.
Randall Pursley
Download All
0 Kudos
Message 5 of 7
(3,876 Views)
Hi!

Thanks!  That will work well!  I was going to make a circuit using opamps to make a sawtooth and then run the voltage through a comparitor.

-Nic
0 Kudos
Message 6 of 7
(3,872 Views)
I did make a mistake.  The sampling rate has to be set at 150 Hz for the USB-6009 and the ramp can only have 75 levels at a 2 Hz PWM.
Randall Pursley
0 Kudos
Message 7 of 7
(3,870 Views)