Top view of bank of mounted solenoids

Firmware

Our Arduino runs firmware which manages the complex actions required to make all 16 moving parts of our system function correctly. The firmware connects over serial to the Raspberry Pi and these two systems exchange information to print a document. In simple terms, the firmware controls all of the low-level actions of the system and the Raspberry Pi manages all of the high-level ones. This means that the firmware receives commands to move the x-axis to position 10 or to fire solenoids 1 and 3 and sends the signals which actually execute those actions.

The firmware is structured in four separate classes, one for each stepper, one for the solenoids, and one for the serial interface. The two stepper classes inherit from the AccelStepper library and define methods specific to their function. Each one has a home function to either load paper or home the x-axis and each has a function to move an exact number of millimeters from their home. The solenoid class handles firing the selected solenoids out of 14, and simply turns on each selected solenoid for .2 seconds then turns them off again. The final class handles reading and writing over serial and interpreting serial commands. This interpreter class takes the commands which are sent and runs the functions associated with them then returns a finished signal when they are done. It stores a list of allowed commands and variables such as motor speeds that are associated with them. This allows the motors and solenoids to be controlled differently by different commands and have more flexibility in their motion.

 

The firmware is fully standalone and can be used over a serial monitor to control the printer manually. The commands for this control can be found in the firmware user guide which details the command structure and function. The firmware user guide can be found on the Github in the Firmware folder.

 

Requirements:

 

Arduino Mega or equivalent

 

Dependencies:

 

AccelStepper library for Arduino

Arduino standard libraries