archlinux - Arduino + 3 step motors with a bipolar steppermotor controllor

2 vues (au cours des 30 derniers jours)
Thomas
Thomas le 6 Mai 2013
Hallo First of all I am useing archlinux and the mablab support package from http://www.mathworks.se/matlabcentral/fileexchange/32374 So for our university project we have to make a robotic arm which has to move en the 2D plane and rotate about it's own axis - We are confined to by the university to do this with an arduino and step motors and they prefer we program it all in MATLAB - I am using a bipolar steppermotor controllor to control the stepmotors, individually it is working fine, but I can't get them to run simultaneously and at this time I haven't been able to figure out the code to use - the code i am useing now is:
step=1800; %1800 steps
for i=1:step
a.digitalWrite(13,1);
pause(0.001)%Pause is neassesary not to stall step motor
a.digitalWrite(13,0);
pause(0.001)
end
What I was thinking might work is
tic
while toc/30<1
step=1800; %1800 steps
for i=1:step
a.digitalWrite(13,1);
pause(0.001)%Pause is neassesary not to stall step motor
a.digitalWrite(13,0);
pause(0.001)
end
end
while toc/60<1
step=1800;
for i=1:step
a.digitalWrite(8,1);
pause(0.001)
a.digitalWrite(8,0);
pause(0.001)
end
end
But this is not working like I had hoped. Hope anyone has an idea that can help me :)

Réponses (0)

Communautés

Plus de réponses dans  Power Electronics Control

Catégories

En savoir plus sur Arduino Hardware dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by