You can't just step from stationary at a high rate - you need to accelerate the motor smoothly to
keep the necessary torque within limits. Try stepping at more like 200Hz rather than 5kHz
You don't mention how you've wired it up, what power supply you use, nor how the stepper
controller jumpers are configured..
You only need to limit the acceleration - you can still go to 5kHz (or a lot higher), just not instantly as there is
a mass of metal to be spun-up and that can't happen instantaneously (what actually happens
is you miss steps, or the motor get stuck humming rather than turning).
For each motor, driver, supply and mechanical load you can experiment to find the maximum
acceleration that works without miss-stepping, and the same for the rotation speed. Once you
have determined these values, de-rate them by about 10-15% each to ensure reliable stepping.
BTW use microstepping, at least 16x, to get smooth operation.
One more question, you said that those inputs are an optocuplor with built-in resistors. That means that my Arduino board is fully protected, or should I take more precautions? If so, what precautions should I take? Another serial resistor on board pins that are used?
Another series resistor might be a good idea if you were going to swap in other motor controllers, but
for this one the input is already current limited and isolated from the rest of the circuit, should be fine.
BTW guys, I have a serious problem with this driver. I won't start another topic on this to keep forum clean, but please help. These are the details:
I can't test everyday the driver and the stepper, because they are in a lab where I do not have access. That means I have to get things right without testing.
Stepper is a big 1A turning table, 1.8 degree step. That means 200 steps per revolution.
Arduino commands correctly other stepper with other drivers (same code). Driver 2M542 works correctly the turning table, with other input. All wiring is good.
Code for Arduino is here: gist:5656149 · GitHub , but that's beyond of my questions. It's suffice to know that I try to control the stepper with Stepper.h library with this commands: myStepper.step(_steps); delay(500); where myStepper is myStepper(200, 7,8); , 200 means that are 200 steps by revolution. Speed is 60.
Problem:
stepper doesn't make correct number of steps. I give it to make 400 steps, but it doesn't make the full rotation; it turn like less than a quarter or a quarter of revolution. Then I tried to give 1 step, but no motion was detected. I give it 10 steps and the turning table made only 1 step or so. I believe there is a non-syncronize between Arduino and driver, and not between driver and stepper, because driver and stepper works correctly with other input. The Arduino supplies the 400 steps for the one revolution, but somewhere in between is not recognized as 400, more like 40. Probably because of the library?
Question:
What's wrong?
Forget the code and the problem. Can you please supply a correct code? I hope the author of this topic would see this post.
Thanks in advanced and God bless. I have finish until Thursday.
I can't test everyday the driver and the stepper, because they are in a lab where I do not have access. That means I have to get things right without testing.
Frustrating (to say the least). Depends what you need to test but using an ultra-cheap miniature stepper from eBay
might be a way forward.
[ Its a good discipline to program with the aim of getting it to work first time its tested ]
I can't test everyday the driver and the stepper, because they are in a lab where I do not have access. That means I have to get things right without testing.
Frustrating (to say the least). Depends what you need to test but using an ultra-cheap miniature stepper from eBay
might be a way forward.
[ Its a good discipline to program with the aim of getting it to work first time its tested ]
I quote from my self:
Arduino commands correctly other stepper with other drivers (same code).
]
That means that Arduino with the same code, an cheap driver and a scrap stepper from an old CD-ROM make the correct steps required. The 2M542 + turning table doesn't.