Run a stepper motor at constant speed indefinitely
-
Hi,
I am using a Mainboard 6HC on RRF 3.5.2.
My duet machine uses a stepper pump to essentially drain a small tank continuously. My X, Y, and Z motors are run via macros that are triggered by an external PLC. When the machine is "idle" (waiting for a command from the PLC), I would like my stepper pump to be running indefinitely until a macro is triggered by the PLC.
I can't seem to find a way to "turn on" a stepper driver without giving it a distance/extrusion to move and making the duet board "busy", which won't work as it needs to be ready to run a macro at any time.
Is there such a way to do what I'm trying to do? I saw @dc42 commented about a planned feature addition here: https://forum.duet3d.com/topic/31768/motor-stop-command/2.
Thanks!
-
@jonathanbrent
Steppers need a command for how many steps.
There's numerous threads on continuous rotation but all are either doing many short moves in a loop or trying to use segmentation to allow the move to be broken.In your case, I don't see why you'd want to use a stepper for a pump.
There are any number of dc motor drivers that would allow you to set the pump running at a given speed.
Some are quite powerful and use 3.3v signals.
So you would connect your pump to 12 or 24v via the driver and control the speed via a pwm output
https://www.phippselectronics.com/product/bts7960-43a-double-dc-stepper-motor-driver-h-bridge-pwm/?gad_source=1&gbraid=0AAAAAC21rdLT9b09FegAU4k-7PlluEc3U&gclid=Cj0KCQjwwae1BhC_ARIsAK4JfrzRHhunk4n02UTjOUBX7TOWentEziMkU8awhxg7F9SEU8MLXgeJpe8aAtquEALw_wcB -
@jonathanbrent If it has to be a stepper motor, (peristaltic pump?) you can use simpleFOC running on a separate controller (eg. RP2040 or ESP32) and a dual H-bridge driver (eg. TB6612). You can control the driver-enable with a GPIO pin from Duet to start/stop the pump anytime.
Speed of the pump is PWM controlled and can be changed via UART command or pot-meter/encoder -
@jonathanbrent you might be able to achieve behaviour close to that by using daemon.g to control that motor as an axis or an extruder using the second motion system.
-
@dc42 Thank you! Exactly what I needed