I posted in the general section seeking help in writing a sketch but realize my knowledge here is minimal at best and writing code is not my thing.
I need a sketch produced that will drive 2 Nema 34 stepper motors at high speed,; higher than 600 rpm, in unison with one turning CW and the other CCW.
I also would like the steppers to accelerate and decellerate somewhat.
and they need to be controlled by a potentiometer(foot pedal).
I also need the motors to reverse direction and to halt one stepper and only have one rotating. I believe I can install switches to make this happen.
I am running an Elegoo Uno R3
with a s-400-60 volts power supply and 2 HBS86H drivers.
The Nema 34 stepper motors are Model 86HB250-156B
Any assistance would be great and I hope ive included everythoing needed to complete the sketch.
That is a very high speed for a stepper - that 60V will come in handy, and acceleration is mandatory to stand a chance reaching it.
Did you test those motors and your driver already to see they are even able to reach that speed at whatever load you put on them? That must be a serious load, considering the steppers you picked. 6A current, 12.5 Nm torque, that are pretty beefy numbers.
Without access to the actual hardware this is a pretty tall order to get right...
Thanks for the response, I was able to get approx. 150 rpm out of the steppers with the sketch i was using, and tried to increase speed but motors became unstable. Most sketches I have used call for very low speeds and I have had poor success trying to alter them.
This sounds like it's more of an electrical or mechanical problem than anything in software at first glance.
Let's do some math:
Assuming a 200 steps/revolution stepper motor being half-stepped, you have 400 steps per revolution. At 600RPM that's 10 revolutions, or 4,000 steps/second. As wvmarle said, that's a bit speedy.
It's not impossible, but if you've hit a 150RPM limit, I would agree that you might have run up against a voltage limitation. Are you running into this problem with the motors unloaded? How long is the wiring between the motor drive and the motors themselves? Finally, I don't see anything in your post about needing to stop at specific positions. If you don't need (accurate) positioning then a DC gearmotor might be a simpler solution.
I've reached close to 600 rpm with a smaller stepper at 12V so there may be other issues, such as trying to speed up too fast. That I remember having to play around with to get that kind of speeds. Doing 500-600 rpm at 16x or 32x microstepping made it even more interesting to pull off, and turned it in a software problem as well
I believe the sketch parameters dictated the slow speed and the erratic motor behaviour seemed to be caused by a lack of acceleration built into the sketch. The wiring from driver to stepper right now is only two feet. Will be up to 6 feet with final install.
Yes the motors have to stop and start in unison which is why I chose steppers over dc in the first place, trust me I’d much rather drive a dc.
In the accelstepper library they are claiming to get over 1500 rpm out of large steppers but code is too complicated for me to manipulate properly.
I'd start by writing the simplest possible sketch with acceleration and stepping using delayMicroseconds i.e. gradually decrease the delays and see how fast you can go. Once you prove to yourself that the hardware can achieve the speeds you need, you can build (or buy) the full sketch.