archlinux - Arduino + 3 step motors with a bipolar steppermotor controllor
조회 수: 2 (최근 30일)
이전 댓글 표시
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 :)
댓글 수: 0
답변 (0개)
커뮤니티
더 많은 답변 보기: Power Electronics Community
참고 항목
카테고리
Help Center 및 File Exchange에서 Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!