Has anyone tried using a stepped motor instead of a DC motor peristaltic pump for dosing to achieve higher low-flow accuracy? If so please share your wiring configuration to the motor driver.
If not I will try to figure it out and report back how I did it.
At the small chance someone else wants to do this heres how I did it.
I used a TB6600 motor driver because I had it on hand but you can use a smaller one depending on your motor size. They have the same pins and many wiring tutorials on YouTube. I ordered a KPHM100 but so far tested it with a stepper motor I had on hand.
To get it working I connected GND to pioreactor/RPI Ground header pin and connected PUL+ directly to GPIO13 header pin which gives a signal to pioreactor PWM 2 channel. This allows you to use the dosing code as is by choosing a specific frequency for speed and 50% duty cycle in your calibration.
I tried connecting to the PWM 2 channel directly but that doesn’t work I believe because it is a current controlled connection. You can use any PWM channel upstream header pin to whatever you have the pump set to in your config file.
I will likely modify the dosing code to use another free GPIO pin so as not to take up the pioreactor PWM channel. I will also use another free GPIO pin for the ENA+ to disable the motor between dosing.
Do you mean the input control on the stepper driver? If so yes it does work even though amazon listings dont say they do. If you want to recreate this id recommend a smaller driver anyways this is oversize for this pump I just had it on hand but regardless you can choose current using dip switches.
One other thing i dont love abt this driver is that it is enabled when there is no voltage difference between the ena pins. So if the pi is off for any reason and the driver is on the motor will be energized (not moving just hum). I added some code to pump.py to turn off/on ena pin during normal operation