I know there's been some discussion of adding the ability to control stepper peristaltic pumps. I'm thinking about doing some work on that topic and I thought I'd describe my plans to make sure I'm not duplicating any existing work, or going in a direction that doesn't make sense for some reason.
One of my priorities is minimizing stepper noise, so I've been looking at the Trinamic TMC-series stepper drivers. They claim to be able to run silently at lower speeds. The two drivers I've been looking at are the TMC2130 and TMC5160. The TMC5160 is basically a more powerful version of the TMC2130 that includes a step/ramp generator controllable via UART.
My first thought was to use the rpi's serial pins to drive the *5160, allowing multiple drivers to be controlled via a shared serial bus. The problem with the approach is that it could lead to uncontrolled dosing: the reef-pi could instruct the *5160 to ramp up to a given velocity with the intention of instructing it to ramp back down the future, then fail somehow, and leave the driver running for an indefinite amount of time (power loss, OOM, unhandled panic, etc).
So my second thought was to use the TMC2130 and an Arduino Nano to generate the step signals. The *2130's are available in 4-packs for $30 and the Nano costs $10 so it ends up being cheaper to run 2+ steppers. There's a
stepper library for Arduino that can control multiple drivers simultaneously and includes features like acceleration and deceleration. The Arduino could additionally be used to read GPIO pins, which could be useful for things like preventing dosing if a fluid level sensor is triggered (or not). A serial API would be needed between the rpi and the Arduino, ideally something along the lines of "please execute N steps". On the software side, I think this would involve writing a "sketch" to drive the arduino and a driver for reef-pi.
Does this seem reasonable? Are there concerns I should be considering?