We've just published a small project implementing stepper motor control for peristaltic pumps.
Peristaltic pumps, also known as roller pumps, are widely used in labs, agriculture, medicine, and other fields. A significant advantage of roller pumps is that the liquid never comes in contact with the pump's moving parts, eliminating contamination issues.
When coupled with stepper motors, these devices can be used in applications requiring precision dosing. You may read more about peristaltic pumps here.
For our demo, we have selected the KPST dual-channel pump from Kamoer, a well-known roller pump supplier.
Driving the pump is Kamoer's 4460.5 board. This board can be controlled via the RS485 Modbus interface.
The project showcases AppBlock's prowess in working with Modbus devices.
The Driver Board
The Driver Board implements quite a few Modbus registers. To view them all, open the Modbus Master page of the Features tab.
By writing and reading these registers:
- It is possible to select the rotation direction (peristaltic pumps are "symmetrical").
- You may set the motor to run continuously or execute a given number of "pulses."
- There are also registers controlling the maximum speed, as well as the motor's acceleration and deceleration.
- Finally, there is a way to know when the board has finished executing the target number of pulses.
All-in-all, this little board turned out to be a capable controller!
In our demo application, the pump is controlled via two web interface pages:
- The Settings page defines the operating parameters, such as the running speed, acceleration, and deceleration.
- The Dashboard contains all the necessary controls.
In this application, we took advantage of the newly introduced canvas tabs. There are three tabs in this app, so make sure to check out the flow diagram on each tab.
Connect the Driver Board to the pump and the RS485 port of your TPS. Make sure you provide adequate 24V power.
On the Settings page, review the Target Speed, Acceleration, and Deceleration settings. All values are in degrees/second. Starting with "360" for all settings (that is, one complete turn) works is a great starting point for your tests.
Now access the Dashboard. When you are in the Continuous Mode, putting the Run switch in the Running position turns on the motor. The motor will keep running until you set the Run switch to Idle.
When in the Steps Mode, input the desired rotation angle in the Rotations widget, and press SEND. The motor will execute the command and stop. For example, if you input 3600 (degrees), the motor will perform ten full turns. When starting, maintaining speed, and stopping, the motor will observe the parameters set on the Settings page.
The project is available in our examples section, try out the project here