From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

bipolar 2 phase stepper control in labview

I have an available PCI 6024E and USB 6009 daq card. I have already programmed bipolar control for a four wire stepper using VHDL and on microprocessors. I want to trigger the four stepper wires in the following fashion , AB, BAnot, AnotBnot, BnotA and cycle back. Each transition from one to another is one step on the motor. I have the following motor:

I am new to Labview and the aspect of graphical programming but i know what i want bascially user puts in number of step the motor should move and then at a set frequency using the ms i can control that. Then each time around the counter is incremented and when the counter reaches the number as desired the motor steps seize to step forward. How would i the switching from AB to BAnot and so on in Labview?


Message Edited by niyant on 08-25-2005 07:11 PM

0 Kudos
Message 1 of 6
(3,031 Views)

You can use the counters on the 6024 to output a pulse train with variable frequency and number of pulses. To make things easier since you have to cycle 4 inputs sequentially and repeatedly- use a 4 bit counter chip with some karnaugh logic that takes a freqency input and produces the 4 sequential bit pattern states. You can probably seach the web for such a circuit.

Or you could purchase a stepper motor driver unit off the shelf that take a direction input and step input. Again, use the counter output on the 6024 to provide the pulse train to step the motor.

And another, much less desirable option IMO, use the digital output bits on the 6024 to toggle the A and B signals directly in a pattern (state machine or sequence) with variable software loop timing to act as the freqency. May be sloppy in freqency stability due to software overhead.

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 6
(3,021 Views)

Hi All-

AnalogKid's suggestions are excellent- the hardware-timed approach using a counter output with some external logic circuitry is the best option, but if software-timed latencies are not a huge concern you can use the method I suggest in the attached VI.

Basically each of your four control signals will be attached to different digital lines on the DAQ board.  In the method I show, the lines will be as follow:

A == Port0/Line0
B == Port0/Line1
A'== Port0/Line2
B'== Port0/Line3

The data to be written is dictated by the states of the boolean switch controls and the number of iterations of the complete pattern is set by the "Number of Loops" control.

Please take a look and let us know if you have any additional questions.

Thanks

Message Edited by Tom W. on 08-26-2005 01:40 PM

Tom W
National Instruments
0 Kudos
Message 3 of 6
(3,014 Views)
One thing to be aware of with stepping motors is that if you run them fast, you need to ramp the speed up and back down or you can miss steps or go extra steps due to rotor inertia.

Commercial stepper motor drivers will often do this ramp-up/ramp-down for you.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 4 of 6
(3,009 Views)
I thank everyone for their helpful comments on this problem. I took up Tom's advice and his VI with some modifications and it is working fine, i am running the stepper for position and not velocity control so i dont need to worry about high speed stepper problems (although i am aware of these). My application requires a stepping maximum rate of 100Hz, a software delay comes pretty close to reaching this. If someone would provide more help on a hardware way to do this i would appreciate it. Although it is not critical for me to have a hardware timed system.

Thank you
0 Kudos
Message 5 of 6
(3,004 Views)
Hi All-
 
niyant, I'm glad to hear you were able to get the motor running with our suggestions.  If you're not very concerned with hardware-timing then I would suggest staying with your current setup- it seems easier and it definitely already works.Smiley Wink
 
If anyone else has any suggestions please don't hesistate to chime in-
Tom W
National Instruments
0 Kudos
Message 6 of 6
(3,002 Views)