LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generate digial pulse train with sinusoidal timing

Hi, I'm trying to drive a stepper motor in simple harmonic motion, so I need a digital pulse train of sinusoidally varying delays (not just varying duty cycle). SHM frequency of around 1/2 Hz but I need good resolution. A base frequency of around 50k might be fine - smoothness of the motor will tell. I plan to use a 6210 counter/timer pin.

 

Any thoughts on how to do this?  Maybe create an array with the digital states and have these sent to the counter/timer pin based on the timer?

 

Thanks,

Brian

0 Kudos
Message 1 of 4
(2,425 Views)

Hi Brian,

   The most obvious, since you don't have AO on the 6210, is to create a digital output waveform at 100 kS/s that has a single true value at your sinusoidal varying delays. You can then route this to a PFI that is configured to trigger a counter setup to put out a single retriggerable pulse of whatever width you're looking for. This separates the frequency generation and the pulse generation. You can change either on the fly. You can physically route the signal outside the DAQ which is great for testing, or you can route it internally, though that is sometimes a little trial and error in my experience. I think this is what you were alluding to anyway...

 

You might get away with using a single counter for instance using the "Counter Freq 1Chan NSamp" setup to buffer out frequency duty cycle pairs at 20 kHz, not as smooth but might work.

 

Thanks,

-Gabe 

0 Kudos
Message 2 of 4
(2,398 Views)

Thanks Gabe. I'm "renew" to LabView but will look into these ideas. You mentioned these are options without AO. I don't have the 6210 yet. I assumed DO would be the way to go but if analog is easier I can try to get a 6211. Do you recommend this? Thanks.

 

0 Kudos
Message 3 of 4
(2,365 Views)

Hi,

   Analog out is generally the easiest for me, since you can form whatever voltage vs time waveform your interested in testing and buffer it out using the DAQmx Analog Out 1 Chan N Samp vi. It generally does not take too much more LV programming and saves all the details in setting up the DAQmx drivers to configure the hardware correctly. Some people may disagree. Also, these USB DAQ's can't put out more than a few mA, so you will probably have to amplify the signal, if the motor is loaded at all.

 

Thanks,

-Gabe

0 Kudos
Message 4 of 4
(2,357 Views)