Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Question of pulse train generation

Hi,

 

      I need to change the frequency of a continuous pulse train to control a stepper motor.

All examples I found is to update the parameters of a counter in a while loop. How fast

the frequency can be updated depends on the execution time of the loop. Most examples

have a 10ms delay function in the loop. I want to update the frequency in 0.01ms interval,

I wonder if is it possible to use this method. Is there a better way to do it?

 

      Thanks for help!

 

      Regards,

 

      Tao

 

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

Tao,

Unfortunately, you're not going to be able to update your frequency at a rate of 0.01 msec (100 kHz) for at least two reasons.

1. If you're using Windows, the OS won't loop at a consistent rate.  The variations wil easily be in the order of milliseconds, possibly more.

2. The counter hw won't allow you to change a frequency until a full pulse has been generated at the prior frequency.  You couldn't change the freq at 100 kHz unless the step rate was in the 100's of kHz.

I've been waiting for NI to provide NI-DAQ support for buffered pulse generation for about 7 years now, largely for the kind of stepper control you're describing.  At this point, I've stopped holding my breath...

Meanwhile, there may be some other options.  You could consider a dedicated motion control card.  Or you could use a card supporting timed DIO (such as the new M-series cards).  Finally, here's a link to an example I worked up that allows you to generate a finite pulse train with varying frequency.  It isn't everything you need, but it might be a nudge in a useful direction...

  http://forums.ni.com/ni/board/message?board.id=40&message.id=2411#M2411

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 4
(3,205 Views)

Hi Kevin,

     Thanks a lot ! I read the thread you mentioned it is very helpful. I wonder is it possible for you

to post your Finite Ramping Pulse Train - WIP.vi in LabVIEW 7.0.

     Thanks again for help!

     Regards,

     Tao

   

  

 

 

0 Kudos
Message 3 of 4
(3,199 Views)

Tao,

Here it is saved back to v7.0...

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(3,189 Views)