From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Running two stepper motors together

Hi,

I want to run two small stepper motors (with easy drivers) with arduino + labVIEW. After modifying the arduino stepper motor example, I was able to get the correct set up and codes. Now the two motors run at the same time, however with two separate ok/run buttons. I want to be able to run both motors with a single ok/run button. Any ideas? I've attached a snapshot of my code.

 

Thanks in advance

0 Kudos
Message 1 of 18
(8,834 Views)

Hello,

 

I think the following article may be helpful to you :

 

Stopping Parallel While Loops in LabVIEW With One Stop Button

http://digital.ni.com/public.nsf/allkb/267704CDE91156D186256F6D00711AAE

 

Let us know if this helps!

 

Cheers,

 

Andy C.

Applications Engineering

National Instruments 

Message 2 of 18
(8,802 Views)

Hey, the article was really helpful. I figured out a way to control/stop both steppers with one button.

Thanks for the help Andy !!

0 Kudos
Message 3 of 18
(8,778 Views)

I'm going to be running two different sized motors (fairly large) using Arduino-LabView setup and two Gecko Motor Drivers. Do you think this code will be able to accomodate that? 

0 Kudos
Message 4 of 18
(8,446 Views)

I don't think that the size of the motor matters. The arduino is just supplying the control signal to the motors, so you just need to make sure that the motors accept the same signal that the LabVIEW VI is programmed to output.

 

Jeremy P.

Applications Engineer
National Instruments
0 Kudos
Message 5 of 18
(8,421 Views)

Hello All

 

I am trying to run and control two stepper motors individually with easydrivers, Arduino and LabVIEW just like the post mentioned by mudithadias but I would like to use two different pinouts from Arduino (e.g. pin 4 and pin 5) for the second motor. Is there a way I can easily modify the Stepper Motor Example to achieve that? As I am quite new to LabVIEW and Arduino, I've been having a hard time to control the two motors individually.

 

Thanks a lot.

0 Kudos
Message 6 of 18
(7,812 Views)

Hey,

I've also tried using a single Arduino to run two easy steppers concurrently but however it didn't work for me. With everything I tried it would always give me some kind of an error so instead I used two arduinos. But if you are trying to run them one at a time, you should be able to use one arduino with pretty much the same example code given in labVIEW. Make sure you define the correct pins in the source code.

Message 7 of 18
(7,794 Views)

Hi mudithadias

 

Thanks a lot for your reply. So if you use two Arduinos, wouldn't they take up two USB slots on your PC? Will LabVIEW be able to communicate with two Arduinos simultaneously too?

 

Also on running one at a time, with regards to the statement "Make sure you define the correct pins in the source code", how do you go about changing pin numbers? You mean in Arduino Firmware? Could you please show me how to change?

 

Thank you very much in advance.

 

 

0 Kudos
Message 8 of 18
(7,776 Views)

Hey,

Yeah it does take up two USB ports but it sure works. I run the two motors together. In my case the two arduinos are on COM3 and 4. When I upload the LIFA it says Arduino at COM3. It doesnt specify anything about COM4 but when I run the labVIEW program both arduinos communicate and both motors run. About the pins; I meant specify the stepper pins and COM ports on the 'stepper configure' in the block diagram of your labVIEW code. cheers!

0 Kudos
Message 9 of 18
(7,757 Views)

Hi

 

Thank you so much. I will purchase another Arduino UNO to try again. Btw, in this case, the two motors will be running simultaneously, won't they? Can I control each individual motor seperately?

 

Cheers...Smiley Happy

0 Kudos
Message 10 of 18
(7,747 Views)