I was able to solve this problem by doing the following: I changed the settings to 800 steps = 1mm and removed the clearances between steps, now everything is fine.
How to prevent loss of steps in the stepper motor?
3 views (last 30 days)
Show older comments
Hello, I'm having trouble finding things about the NI USB-6009 because most people use arduino, so I decided to ask them here.
I'm having problems with loss of steps, I'm using this code in MATLAB R2016a:
xDir=daq.createSession('ni');
xAddDir = addDigitalChannel(xDir,'Dev1', 'Port0/Line0','OutputOnly');
xStep=daq.createSession('ni');
xAddStep = addDigitalChannel(xStep,'Dev1', 'Port0/Line1','OutputOnly');
outputSingleScan(yDir, 1);
pause(0.01);
for motorstep = 1:800
outputSingleScan(yStep, 1);
pause(0.01);
outputSingleScan(yStep, 0);
pause(0.01);
end
The motor is set to 1600 steps = 1 millimeter
And I realize that little by little it does not return to the correct position.
I researched and said that working with micro steps is better because it works with more precision.
If someone can help me by telling me that I can improve on the code, or if the problem is in the engine, or if you can recommend me some better place to practice this micro step (I have no idea how you use it, I am very layman in it ), I'll be very grateful!
Answers (0)
Communities
More Answers in the Power Electronics Control
See Also
Categories
Find more on Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!