Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Arduino to control stepper motor driver + stepper motor with LabVIEW

Hello everyone,

 

I am trying to create an interface for controlling an Arduino Uno connected to a stepper motor driver carrier that is wired to a stepper motor using LabVIEW 2016.  The Arduino is connected to the AMIS-30543 stepper motor driver carrier using a SPI bus and an additional digital pin on the Arduino is wired to the STEP (NXT) pin on the motor driver which is used to move the motor current one step up or down.

 

Here is the Arduino pin to motor driver connection:

 

Arduino       Motor Driver

GND        -       GND

9              -       STEP

10            -       SS

11 (MOSI) -      DI

12 (MISO) -      DO

13 (SCK)   -     CLK

 

The motor driver carrier is connected to a NEMA 17 stepper motor and an additional 20VDC is being supplied to power the motor.  

 

Here is a link to information for the stepper motor driver carrier.  You will also find the datasheet for this item there as well.

 

https://www.pololu.com/product/2970

 

 

I have chosen not to use the LINX tool from Makerhub because I will eventually need to recreate this code in LabVIEW 2018 for my job and that version of LabVIEW is not compatible with LINX as far as I know.  I should also mention that LIFA_Base firmware had already been uploaded to the Arduino prior to creating this project in LabVIEW.  Starting with just the Arduino Autodetect function, the VISA Resource control, the Arduino Init, and the Arduino Close functions, run the script and get the Arduino blinking without any error messages.  

 

The next step was to set up the SPI interface and set the digital pin used for STEP.  I also created a while loop which will continue to iterate until a stop button is pressed.  I was able to run the script, and tried running it using different duty cycles for a PWM signals to the STEP pin, but the motor has not moved.  The script appears to run initially, but when I hit the stop button on the front panel, I received the Error code 5003 telling me that the connection to the Arduino was lost.

 

Here is the block diagram. 

 

20190728_Arduino_StepperMotor_Control_LabVIEW_BlockDiagram.PNG

The goal with this script was to be able to set the speed of the motor (using the PWM duty cycle), have it run, and turn it off using the stop button.  Am I heading in the right direction with this?  What changes could/should I make to get this to work properly?  I am very new to LabVIEW so any help or insight would be greatly appreciated.

 

What I would eventually like to be able to do is set the motor speed, direction, duration of run, and be able to use buttons to turn it on and off in the front panel.  

 

Thank you in advanced for helping me.  I apologize for the long post.

0 Kudos
Message 1 of 2
(2,235 Views)

Hi Eric_Chance,

 

I'm not all that familiar with LIFA, but it seems to me you're on the right track. We have a troubleshooting article for error 5003 that has some good next steps to take. It might also be a good idea to post this question on the LIFA forums to get more visibility from LIFA users.

Melanie P.
Technical Support Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,153 Views)