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.

Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Stepper Motor Using NI Motion

Hi all,

 

I need to do a real simple application of a stepper motor rotating at steps 60 degrees apart, and after 360 degrees, it comes back to where it started (home/0 point). I have a PXI with a NI 7342 motor controller card, UMI 7772 connector block, 70360 stepper drive, and NI NEMA 34 motor with an NI encoder. I know this hardware is a bit overkill for the current application, but the system might be expanded to more complex applications in the future.

 

I looked on the forums and it seems as if everyone uses DAQmx to control their stepper motors and I can't seem to find any examples using the NI-Motion driver. I assume I have to use the NI-Motion driver since I am using the 7342 motor controller card. Does anyone know the correct VI's to use or have any examples?

 

I already looked through a bunch of examples through LabVIEW help and they all looked like 1D, 2D, or 3D motion rather than any sort of stepper motion. However, I found one that said "One-Axis Move with Position Monitor" which is the closest to my application but it only monitors the current position. I want a closed loop system utilizing the encoder to ensure accuracy which I don't believe this VI does.

 

Thank you for the help!

0 Kudos
Message 1 of 2
(3,118 Views)

cdolan25,

 

Since you are using a single motor, then you want to look at the 1D examples. The single axis example you mentioned should be a good starting point. To do closed loop stepper control, you first need to configure the axis in NI MAX (assuming you have NI-Motion installed). In MAX, expand My System >> Devices and Interfaces >> NI Motion Devices and you should see your PXI-7342 there. You can then configure the axis settings for your setup. You will want to set the axis as a stepper with encoder feedback, set the 3 of steps/ revolution for the stepper and counts per revolution for the encoder. You will also need to tune the PID gains in the control loop settings. After everything is configured, save the settings and click Initialize to deploy them to the board.

 

In LabVIEW, I would start with either the Single Axis with Position Monitoring or 1D Straight-line move examples. You will want to add the Set Stepper Loop Mode.flx VI to set the axis to closed-loop mode. With those settings, you can then command a position move in number of steps and the driver will handle the control loop in the background. For more info, check out this getting started guide:

 

http://www.ni.com/pdf/manuals/373329e.pdf

 

J. Calvert

Applications Engineer

National Instruments

Message 2 of 2
(3,095 Views)