Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I use counter to generate a pulse train with different pulse intevals between two pulse?

I want to use a counter to generate a pulse train which will be used as a trigger signal.
 
The pulse width should be less than 1ms and the time intevals will be different between two pulses.For example,after 2ms the counter started,there will be a pulse,then after 5ms,a pulse again,  after 10ms,a pulse again(see the picture).....the time interval can be programed.
 
In addition,I use NI AO series-PXI-6733 which contains two 32 bit counter and LabVIEW 8.2 DAQmx to do this job.
 
 
0 Kudos
Message 1 of 4
(4,064 Views)
Unfortunately, NI doesn't support variable-frequency pulse trains for counter / timers.  I've been wanting such a feature since before Y2K.
 
However, you *could* do this fairly easily with a low-cost M-series board using the "correlated DIO" feature.
 
-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
(4,058 Views)
Hi Kaven,

I read your old posts and I  think you might help me.  I try to control a stepper motor and make the velocity profile to be in Sine waveform,  which means the frequency output from the counter should vary in a Sine wavefrom.  It'd be greatly appreciated by any chance you can advise. Thanks in advance!

best wishes,
Ian

btw. I think the ramp VI you developed is great (http://forums.ni.com/attachments/ni/40/2411/1/Finite%20Ramping%20Pulse%20Train%20-%20WIP.vi_http://forums.ni.com/attachments/ni/40/2411/1/Finite%20Ramping%20Pulse%20Train%20-%20WIP.vi), I try to run it but have problem making it work thoughSmiley Sad, I am using 4 counter/timers on two USB 6210 cards, should them work for this VI? Thank you very much.
0 Kudos
Message 3 of 4
(4,025 Views)

Don't have LV handy to open the old code, but I did read through the thread you referenced.  It sounds like the example configured 2 counters to create the variable-freq finite pulse train and configured a 3rd counter to count the # steps generated as verification.   That 3rd counter would be a problem for you as there is no internal timing signal connection between your 2 USB devices.  You would need to run a physical wire connection and change some of the config code to match.  Alternately, you could just delete all the code associated with the 3rd counter for now because it isn't strictly necessary.

Further advice/questions:  Are you planning on a pure sine wave of frequency such that you oscillate with both positive and negative velocity (example: varying from -1000 to +1000 Hz clockwise)?  Or is there a nominal average frequency with a small sine wave superimposed (example: nominal of 1000 Hz clockwise, variation of +/- 50 Hz)?

I *think* you may be dealing with more of a continuous pulsetrain situation, which is actually much simpler.  You would only need 1 counter/timer, though you would still perform the freq changes in a timed loop which uses the pulsetrain as its timing source.  You'd just need to keep track of your total elapsed time so you could figure out the right sinusoidal freq value at the moment you're ready to update it.

Another subtlety to watch out for if you're oscillating about 0 velocity  -- don't try to create a frequency that is lower than the rate at which you need to update.  Also, with steppers you may have mechanical stability issues at low freqs like 10's to low 100's of Hz.    These kinds of things may need to be managed as special cases which force you to deviate from a "pure" sine wave.

-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,987 Views)