Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Easy driver stepper control via digital outputs

Hi, I have a couple little motors that I'm driving with a Sparkfun easy driver board. The board just takes in pulses, and for each pulse it gets it steps the motor one step. Another digital pin sets the direction. I have attached the VI.

 

I have the digital PFI1 on my DAQ connected to the "pulse" terminal on the board, and it steps when you send pulses to the board. However, the DAQ seems to be operating in burst mode. If I set the frequency to 10 Hz, for instance, with a finite number of steps (say, 1000), the motor steps in little bursts rather than continuously moving. I scoped the output of the DAQ, and it does appear to be turning the square wave on and off.

 

The pulse chain is initiated by:

1. CO Pulse Freq, set to 0.5 duty cycle and the specified frequency using ctr1
2. Implicit timing with finite samples, # of pulses is the number of user provided steps

3. DAQmx Start Task

 

I enter a loop to monitor the progress, which just checks DAQmx Is Task Done every so often and updates a counter.

 

What is a better way to do this? Why is the counter operating in burst mode?

 

Thanks

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

Hm. It appears that Sparkfun has a number of defective units that behave this way. I think my code is actually fine.

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