Construction on the system continued this week. So far, the gantry cart and all three dispensers have been installed.
As we prototyped with controlling motors directly from the Raspberry Pi, we decided to try and design a modular system. Although our build will only contain three ingredient dispensers, a cup dispenser and the gantry cart, future versions could contain more. Using the Raspberry Pi GPIOs may not scale, as each dispenser would require 3 GPIOs per motor and at least 1 or 2 GPIOs for auxillary devices such as switches or hall sensors. Additionally, it may be difficult to coordinate the overall machine operation, sensor reading and GPIO handling at the same time.
A modular system employing a serial communication protocol between the Raspberry Pi as master, and dispensers and cart as slaves was designed. I2C was chosen for its high speed and proported robustness for off-board communications. Each device (such as dispenser, or the gantry cart) would be controlled with it's own microcontroller. Sensors associated with that device would connect to that device's microcontroller. Operation of that device, such as stepper movement and sensor reading, would be handled by the microcontroller, and would communicate information between itself and the Pi master controller.
This circuit will be built on a breadboard next week.