Hello, I’m new here and I am interested in any information you might have on using commercially available 3D printer boards (like the BTT Kraken, SKR 3, etc.) as generic motor controllers either directly or by step and direction pulses to external stepper or servo drivers in the 40 - 50 KHz range.
For my application, I need to not just send steps but also run motors at precise angular velocity rates.
I’m guessing that someone somewhere has probably done this already, any help would be greatly appreciated.
You can likely use any board, but pulsing at a specific frequency will likely depend on the motor driver. Most of the late btt boards use the TMC 2209 stepper driver chips that are marketed as “silent” drivers. I’m not sure if that will limit the pulse frequency range or not.
I use klipper software to control both 3d printer and CNC because it is easy to configure. If you can change frequency with that control, it would be in the klipper documentation. If all you want to do is step the motor at a specific speed, you just tell it what the rotational distance is and set the speed. That would be super easy.
Okay, so use whatever printer firmware your board uses…
Let’s say you use 16× microstepping on a 1.8° (200 steps/revolution) motor. That’s 3200 microsteps/revolution.
Define an axis and tell the firmware that your axis is 3200steps/mm. (Say it’s X for example sake.)
G1 X(the number of times you want to rotate the motor) F(the RPM you want it to rotate at)
Example:
G91
G1 X320 F45
Would rotate the stepper 320 times at 45 RPM. (From this it should be possible to calculate the duration of the rotation as well.)
Using that steps/mm means that the feed rate goes from mm/minute to RPM.
If you aren’t sure you want to leave the motor spinning for 7 minutes, you can just send moves of partial revolutions every couple seconds, the feed rate still determines RPM, unless it runs out of commands and stops.
I suppose RPM then is as accurate as the clock on your control board, but should be pretty close.
From what you are saying, it looks like all I have to do is send the 3D printer board commands using gcode like sending serial commands to a plotter or modem.
I’ve put a polulo stepper driver on a breadboard to drive it using an arduino. I left it at full stepping and I only drove the STEP and DIR pins. It wasn’t difficult, but I only needed it to turn one way or the other from a button press. I wasn’t particular about the speed, I only adjusted it so that it was reasonable, but it’s certainly possible to time it more precisely. If you just want to drive a stepper from a computer program you just need to be able to send a logic signal to two pins, so just a stepper driver is necessary. With the full control board, sending gcode is easy enough.
I’m trying to get the motors to run continuously at a precise constant rate with intermittent commanded acceleration/deceleration to a higher or slower speed for a fixed period of time, then go back to the previous original constant rate.
It would be like having a CNC machine or plotter move slowly until the end of travel with a control that slew quickly a fixed number of steps ahead or behind the current location then resume moving forward at the same slow speed again.