LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a Tunable Step Function Output

Hello. I wish to create a step function output that will run for a specified period of time and that a delay between steps can also be specified. I know this has to be something simple, but I can't seem to find anything that works properly for me or is applicable to the software package I have ( LabView 71, basic package).
 
The application is to run a stepper motor, the motor will move at the upward edge of each step. We want to be able to control the distance it will go as well as its velocity. We know how many steps are needed to go a certain distance, however we are having trouble setting the velocity. Currently I have a For Loop creating a manual step, with a tunable delay programed in. However, changes in the delay produce a nonlinear output in time of travel, so we can't determine the velocity for any given delay without first explicitly measuring that delay.
 
That is why we want to use a function that will allow us to input a delay and number of steps desired that will give us a linear change in time for a given change in delay.
 
I have attached our current program in case that could be of any use.
 
Sorry for so basic a question and thank you for any help you may be able to offer.
0 Kudos
Message 1 of 5
(2,590 Views)

Which NI hardware are you using?

From your VI, it looks like you are using Digital outputs on it to run the stepper motor.

and can u eloberate more on how you plan to control the stepper motor? if you can draw a signal pattern that you want to source from the DAQ card,it would be easier to suggest

0 Kudos
Message 2 of 5
(2,583 Views)

The hardware we are using is a PCI-6251 break-out box.

We plan on sending a step function with a 5V amplitude to act as the clock for the stepper motor. The actual signal pattern would be a square wave, alternating between 0V and 5V.

To control the stepper motor all we have to do is have the step function acting as a clock and define the direction we want to move in.

We know that 50000 steps is equal to a movement of 10mm in about 27 seconds. Therefore if we wanted to input in terms of distance and velocity would select 10mm and 0.37mm/s respectively, and I believe that conversion can be made with just a few formulas.

Since we want more than one velocity option we want to put a delay in the step (either in a peak or valley, either should affect the motor controller the same way). As it is currently programmed the delay is in both the peak and valley, effectively doubling the stated delay. Yet, the delay doesn't change the time linearly. For the same distance, a 1ms delay has a run time of 82s, a 3ms delay 94s, and a 4ms delay 139s (these numbers may not be exact, I'm writing from memory, but they are representative of the behavior observed).

That's probably more information than you wanted, but I hope that it is helpful and if you need to know anything else let me know. Thank you for your help.

 

and can u eloberate more on how you plan to control the stepper motor? if you can draw a signal pattern that you want to source from the DAQ card,it would be easier to suggest

0 Kudos
Message 3 of 5
(2,579 Views)

There's a LOT of info here on the forums about generating clock signals for steppers.  A bit of determined searching/exploring could unearth a wealth of information, and perhaps exactly what you're looking for.

Meanwhile, here are some brief thoughts.  (Sorry I can't look at the vi you attached  -- my LV PC is far from my network connection.)

1.  If the entire 50000 step move will be at a constant velocity, the simplest method is to use a counter to generate a finite pulsetrain.  Most steppers I've been around would need to be microstepped in order to do a dead start/stop at close to 2 kHz.  Do you have a microstepping drive?

2. If you need to change the step rate on-the-fly while also controlling the total # of steps, it is considerably more difficult to use a counter.  But as long as you know the entire velocity profile before the move begins, then the correlated (hardware-timed) digital output is probably the best way to define such a variable-freq finite pulse train.

3. In a pinch, you may be able to use an analog output signal to define the pulse train.

4. All of the methods above are hardware-timed, producing much more consistent behavior than the software-timed method you described.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 5
(2,570 Views)

Plus, your hardware has a feature called as co-related DIO.

Read about this feature and also look at example codes in support section

Using this feature to generate the stepl/pulses should be the best option for your application.

Any doubts, do get back

regards

Dev

 

0 Kudos
Message 5 of 5
(2,552 Views)