LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper Motor Speed Control

Hello fellow practitioners of Labview.

 

I've been working for the past month on controlling the speed of a bi-polar stepper motor.

 

Said motor is attached to a worm screw with 20 threads per inch that raises and lowers a platform.

 

As the stepper motor takes 200 steps per revolution that would suggest that per revolution the platform would move 1/20 of an inch (1.27mm), and per step would be .00635mm.

 

I initially used a simple case structure that flipped between true and false with a millisecond delay between each flip.

However, millisecond timing is proving to be my downfall.

 

I then tried using a simulated waveform signal to try and drive the motor, but I haven't had any luck on that front.

 

My hope is that an outside opinion might be able to help me figure out how to best control the speed of the motor.

 

My goal is have a range of speed inputs in mm/sec with an accuracy to within 0.01mm/sec and the maximum being 3.33mm/sec

 

Below I've attached what equipment I'm using along with the 2 .vi programs I've mentioned and a picture of the setup.

 

Thanks!

 

Equipment:

 

Easy Driver 4.4                                     http://www.schmalzhaus.com/EasyDriver/

USB DAQ-6009

OMHT Stepper Motor 17-075                  http://www.omega.com/ppt/pptsc.asp?ref=OMHT_Series

Message 1 of 11
(5,660 Views)

1.  It would probably be faster to write a word to the port than to have five separate writes to individual lines.

2. The USB-6009 may not be able to keep up.  Is uses software timed digital I/O and is not very fast.

3. The for loop is not needed.

 

Can you step OK at slow rates like 1 or 2 steps per second?  If it works at that rate, then gradually speed it up until it stops working.

 

Lynn

0 Kudos
Message 2 of 11
(5,647 Views)

Thanks for the reply.

 

In regards to the 6009 using sofware timed digital I/O, what hardware would be a better solution?

0 Kudos
Message 3 of 11
(5,628 Views)

Any device with hardware timed digital outputs should work fine.  The on-line specifications for NI devices indicate this.

 

Lynn

0 Kudos
Message 4 of 11
(5,623 Views)

Just piggybacking on johnsold's always-worth-heeding advice:

 

Personally, I would highly recommend an X-series device for this so that you can control both the # of pulses

and the shape of the motion profile with precision and relative ease.    You could make constant-speed profiles

(and I have) using DIO on an M-series, but only X-series supports the more versatile buffered frequency output

approach.

 

A simple trapezoidal profile will allow you to move at a much faster top speed than a constant-speed profile

due to the nature of stepper motor dynamics.  It all depends on the system, but in my experience you can

usually cut your motion travel time by maybe 50-70%.

 

-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 5 of 11
(5,610 Views)

I would recommend getting a DAQ with a counter that is capable of generate a pulse train, any X series should do.  With this functionality you could do something similar to the attached example, from NI examples.  The 6009 only has a counter for input application not output.

 

The DIO you currently have just isn’t meant for what you are trying to do.  You may be able to use an AO on your device to trigger a step but it will never be fast enough to achieve the 2.6 revolutions per second ((3.33mm/sec)/1.27mm that you want.

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 6 of 11
(5,609 Views)

Hi, I'm not sure whether this is the right place for asking this question or not and if not, then please guide me to the right place for asking such question. Thanks.

I have a stepper motor with the Vector Network Analyzer Anritsu MS4623B. I got it up and running with the LabWindows/CVI. I need to sync the motion of the stepper motor with my data acquisition. Basically, I have to acquire the data in a way that in the start the motor will come back to home position wherever it was on the ball-screw linear positioning system and then I want to move it to the specific position to do the measurements (For Example, I want to measure the 40 GHz channel between 1m to 3m movement of a stepper motor on a linear positioning system (ball-screw)). I've interfaced the VNA with the PC using LabWindows/CVI and I've controlled the clockwise and anti-clockwise movements of the stepper motor using LabWindows/CVI but I'm unable to sync the system in a way that whenever I run the code, the motor will run back to the home position and then move to a specific measurement start position and move till the end position and in between do the increment and stop and acquire the data. Is there any one to help me please? It's really urgent please and I'm doing this thing first time so please guide me in a proper way. I shall really apprecaite that and will be highly obliged with you. Thanks for your time and concern.

 

Thanks and Regards.

:smileyhappy:

0 Kudos
Message 7 of 11
(5,585 Views)

No, this isn't the right place.  I see you have a message at http://forums.ni.com/t5/Motion-Control-and-Motor-Drives/stepper-motor-Labwindows-5-5-PCI-DIO-96/m-p/....

 

That is in the correct forum, though you really should have started a new message thread there instead of replying to a 6 year old thread.

0 Kudos
Message 8 of 11
(5,582 Views)

I've been thinking about the x-series and have a few questions coming to mind.

 

If I were to purchse one, would it be as simple as switching out my old daq for the new x-series?

 

Or would need to re-write the code?

 

I guess the major question here is how am I sure that I'm using hardware timing to run my program?

0 Kudos
Message 9 of 11
(5,529 Views)

Hi Mann-Onion,

 

Depending on what you are doing it maybe as simple as just switching out the cards. Please read through the documents below for more information about X-Series and timing. If you are using Traditional DAQ you will probably have to change your code to DAQmx.

 

What is NI X Series?
http://zone.ni.com/devzone/cda/tut/p/id/9376

 

Timing and Synchronization Features of NI-DAQmx

http://zone.ni.com/devzone/cda/tut/p/id/4322

 

Transition from Traditional NI-DAQ to NI-DAQmx in LabVIEW
http://zone.ni.com/devzone/cda/tut/p/id/4342#1

 

Tim O

Applications Engineer
National Instruments
0 Kudos
Message 10 of 11
(5,507 Views)