Piano Player Project
Updated: Aug 29, 2024
In one of my engineering classes, my team and I were tasked with designing and constructing a 2.5-degree-of-freedom cartesian motion machine. The initial prompt was very open-ended, and the three of us wanted to let our personalities and ideas show through in our final design. One of our members was a jazz musician, so we decided on a piano-playing machine. Here is a preview of what we ended up designing and building!
We did so because it fulfilled the requirements of the project. In addition, we thought this machine would also demonstrate our ability to program and design precise and swift-acting machinery with a practical purpose. With this in mind, we began to design.
We first began with a proof of concept, where we designed a quick 3D printed slider and belt mechanism in conjunction with a stepper motor, all affixed to one aluminum extrusion and all connected by a singular belt. This worked smoothly and efficiently with our control board, the MKS Version 1.6, which ran Marlin firmware to interpret G-Code and physically controlled through a 3D printer software called Repetier Print. This board and software were chosen as they are commonly used in 3D printer controls, so there would be a large amount of documentation on any issues we would encounter in our project.
After finishing this proof of concept, we got to work with our overall design. We began with an elementary sketch on paper, defining our X-axis as the line along the keyboard, moving along one octave. We then defined the Y-axis as the line across the keyboard, which would swap the white notes for the sharp and flat notes in our machine. Lastly, we defined our Z-axis as the axis normal to the keys, where our end effector would press down on a key and play music.
We then began talking more practically about how we planned to move and control this machine. We agreed to use two motors for our X-axis, connecting the wires for said stepper motors in parallel to control both despite the single slot for the X-axis on our control board. From here, we decided on a single stepper motor for our Y-axis and tried using a servo motor for our Z-axis. We split the modelling between the three of us and began to produce parts that we would later 3D print. We chose to 3D print mainly due to how complex some of our part geometry was and to manage our time commitment to this project and ensure that it did not interfere with our other obligations.
We also decided to pivot away from the servo motor during the early modeling stages, as it would require precise design and modeling in conjunction with detailed measurement work. Considering our timeframe, this seemed unrealistic, so we switched to a solenoid-based design that would press into a keyboard. I was tasked with modelling a slider for this that moved across an aluminium extrusion. I was also charged with wiring this system and was responsible for all programming regarding the project.
Then, using the measurements we took of the keyboard, we put together an aluminum frame out of 25x25mm extrusions in Boston University's Engineering Product Innovation Center. We also measured the distance between the ends of this frame and cut an additional piece of extrusion to hold the Y-axis motor and the entirety of the Z-axis assembly. This came together quickly and easily, and we were then ready to add our 3D-printed parts.
We began by adding the X-axis motor brackets and belt tensioners, which were built with sliders and adjustable to decrease the small amounts of slack left in the belt after assembly. We also put our Y-axis sliders between these two parts to prepare ourselves for the next assembly phase.
Next, we affixed the gantry's Y-axis portion on the extra extrusion piece onto the accompanying sliders. Finally, after some experimentation, we moved away from the solenoid design and moved towards a stepper design for more precise control on the Z-axis. This design operated nearly flawlessly, and its presentation and operation videos are below.
Finally, below is the MATLAB code used to control this device. It involves taking a matrix of notes and copying the G-Code to the clipboard.




Comments