LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple stepper motor control - LIFA

Solved!
Go to solution

Hi guys,

I'm using labVIEW interface for arduino (LIFA) to run two stepper motors simultaneously. I'm using a slightly modified VI from the LIFA stepper example. However, I cannot get them to run together. When I command the second stepper while the first is running, the first motor stops abrptly and the second one starts running.  I don't have a lot of experience with labVIEW or LIFA so could someone please give any helpful idea on this. What changes should I do to the coding of the stepper example given to run the two motors together. (I'm using easy drivers from sparkfun)

Thanks in advance.

0 Kudos
Message 1 of 12
(9,244 Views)

LIFA can not run two step motors simultaneously.  About the best you can do is use a small number of steps and rapidly alternate sending steps to each motor to make it look like the motors are running concurrently.

There is a method for getting two step motors to run at the same time if you don't use LIFA.  See Example 4 at:

<http://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html>

For a You Tube video on controlling multiple stepper motors with Arduino see:

<http://www.youtube.com/watch?v=ANm8i1Z2SkY>

hrh1818

0 Kudos
Message 2 of 12
(7,458 Views)

Thank you hrh1818. I didn't know LIFA couldn't run multiple stepper simultaneously. Anyway as I said I use easy drivers and when I changed the VI's control method to '4 wire' I was able to get the two motors running. BUT the motors runs pretty slow and runs about 1/4 th of the total number of steps the motor would have run on its own.(i.e if single motor runs 4000 steps, with the same settings the two motors would run about 1000 steps each). Any idea on what's going on here?

Thank you !!

0 Kudos
Message 3 of 12
(7,458 Views)

Sorry I don't understand what you meant by "I changed the VI's control method to '4 wire' ".  Please post a copy of your VI.

hrh1818

0 Kudos
Message 4 of 12
(7,458 Views)

copy of VI

stepper vi.png

Message 5 of 12
(7,458 Views)

The 4 wire selection is meant to be used with a setup that uses 4 wires to connect an Arduino to two H bridges and the two H bridges control one step motor.   It is not designed to be used with two Easy Drivers.  I am unable to help you with a method that is incompatible with the  LIFA stepper Driver.

hrh1818

0 Kudos
Message 6 of 12
(7,458 Views)

Thank you hrh1818. I probably should try using two Arduinos and see if that works. Thanks for your help.

0 Kudos
Message 7 of 12
(7,458 Views)
Solution
Accepted by topic author mudithadias

É possível usar o LIFA para o controle de vários motores de passo sim rodando simultaneamente. Basta colocar laços de eventos dentro do mesmo while e configurar os pinos fora do while. qualquer dúvida salomao_284@hotmail.com

0 Kudos
Message 8 of 12
(7,458 Views)

Sim, eu tenho que trabalhar com dois Arduinos. Eu usei dois loops while paralelo com as estruturas de eventos dentro operado por um único botão 'ok'. Como Lucas diz LIFA pode ser usado para executar dois motores com os pinos colocados fora do loop.

Obrigado por postar Lucas

Yes, I got it to work with two Arduinos. I used two while loops running parallel with events structures within them operated by a single 'ok' button. As Lucas says LIFA can be used to run two stepper motors with the pins placed outside the while loop.

Thanks for posting Lucas

0 Kudos
Message 9 of 12
(7,458 Views)

Não é necessário usar mais que uma placa de arduino nem usar máquinas de estado. Sou professor do SENAI e estou com um projeto de um braço robótico que utiliza um arduino mega e 5 motores de passo. Estou usando cinco botões ok diferentes todos dentro do mesmo laço de envento dentro de um unico while e os motores estao rodando em tempo real perfeitamente.

0 Kudos
Message 10 of 12
(7,458 Views)