LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stepper motor_digital output - pulse

Hello everyone,

I am trying to generate pulses for moving a stepper motor through digital ouput (create channel). Up to now i used counter output to generate pulses but because my DAQ device has only four counters (CTR) and my project needs to move more than four stepper motors, i need to generate pulses through digital output. I created a VI which works fine, but the way i created it , the velocity of the stepper motor is defined through the high and the low time pulse duration. When i define (0,001 sec/1msec) high- low pulse duration or greater than 1ms it works fine. When i reduce the high - low duration (e.g. 0,0001sec/0,1msec) to make the stepper motor goes faster, the velocity remains the same as it was with 0,001/1msec. I dont know the reason why in this level of time bigger than this threshold, my stepper motor does not goes faster. Is there any other way with digital ouptut to do it??

Thank you in advance.

I attach my VI.

0 Kudos
Message 1 of 4
(3,906 Views)

I Chris,

 

When you use the counter of your card the generation will be Hardware Timed which gives you access to the minimum timing for generation.

 

When you implement the timing control on your LabVIEW code, that task is software timed. I suppose that you are running this code on a Windows machine. The internal clock is 1 ms so you won’t be able to go faster than that.

 

The other option will be generating a Hardware Time Digital Output task (without using the counters) but you will have to provide in advance a big enough array of data.

 

Regards,

AGJ,

NI

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

Depending on your DIO device, you may be able to run it faster than 500 Hz (a transition every 0.001 second) -- the "native speed" of the device (unclocked) might be faster.  For example, I just plugged in a USB-6009 (a very inexpensive multi-function I/O product from NI) and ran the following test --

DO Speed Test.png

As you can see, it toggles a single digital line as fast as the DAQ function will run.  If it ran at 1KHz, the Delta-t would be 1.000, but instead it takes from 0.55 to 0.59 seconds (the timing is variable, depending on what Windows is doing).  I suspect a "better" DIO component would be considerably faster, but also unclocked.

 

Check your DAQ device -- see if it is possible to drive the DIO with a clock signal.  If so, you can use your Counter/Timer to make the clock and use an "inverting loop" such as I've used here to make a digital pulse train at half the Counter's clock frequency.

 

Bob Schor  

Message 3 of 4
(3,849 Views)
First of all thank you for your answers. I am running this code in Windows 10..
AGJ_CR , I didn't know about the internal clock (1ms) so with this code I cant make it go faster.
Bob_Schor , I am trying to understand the code that you posted. When you say to see if it is possible to drive the DIO with a clock signal, you mean to start a digital output task like I did and to see if I can use in this task a clock signal? I think that I didnt understand it.
Finally is it possible in labview to use one counter for two different counter tasks which are used in a different frame of a stack sequence? I am asking this if I can eventually avoid digital output tasks to move the stepper motors and to use only counter output tasks.

Thank you in advance
Chris Ev
0 Kudos
Message 4 of 4
(3,798 Views)