Hello everyone,
I have a question about steppermotor control on matlab. the code that I wrote on matlab works very slow and I need moch more faster for my project.
Stepper( nema 34)
Using these codes;
%%%%%%%%%%PUL = 11 from CWD 556 driver and using +PUL, +DIR and +ENA
%%%%%%%%%%DIR = 10
%%%%%%%%%%ENA = 9
clear all;
global a;
a = arduino('com3');
writeDigitalPin(a, 9, 0);
writeDigitalPin(a, 10, 0);
for i=1:1000
tic
writeDigitalPin(a,11,1);
pause(0.001);
writeDigitalPin(a,11,0);
toc
end
Note: When I run this code on arduino it works fine , but on matlab, the motor rotates 1 rev about 40 seconds.
For Matlab ;
using adio code from Matlab package.