Table of Contents
Team Vision for Detailed Design PhaseThis phase our team focused on making final selections for sensors and mounting options, as well as testing the solenoid control circuits and existing code for the project. The two final candidates for sensor options, piezoelectric and microphone, were compared to see which would be the most effective for our feedback system. The piezoelectric sensor was chosen to sense which key was being pressed for its reliability and simplicity in implementation. The microphone sensors were still chosen to sense volume as no other system was adequate for that task. The main task was making a plan for integrating all the individual systems that were designed during previous phases. The PWM generation IC was integrated with the Raspberry Pi to verify that the two can communicate effectively.
CodeThe main goal of this phase was to set up a testing environment for the Raspberry Pi 3 and get it to communicate with the TLC5947 PWM IC. It was decided that the language used to write the code for the RPi to interface with the PWMs would be Python 3 using the Adafruit CircuitPython library. The current state of this effort is that the code is running on the Pi and is able to send signals to the PWM; however, there are still issues with controlling the voltage that goes out when the code calls for the solenoid to retract, so this is something that needs to be worked out next semester. Also, the code will need to be modified to work with multiple PWMs connected together so that signals can be sent to all 88 required solenoids.
Initially, it was a challenge to install anything onto the RPi due to the fact that it was unable to connect to the internet. After consulting with RIT ResNet, however, we were able to get the Pi online, which allowed us to install all of the packages necessary to run the previous team’s code, as well as the code needed for the Pi to send signals to the PWM IC.
In order to get the piano to pick up on the tempo that the player is playing at, the piano will keep track of the notes that the user is playing while the MIDI playback is happening. As the notes are recorded, they, along with the tempo they are being played at, will be compared to a 5 second window of upcoming notes in the MIDI file to check if the player and MIDI are going at a similar pace. The code will measure the speed of notes being played per second by both the MIDI and the player. If the player is going at a rate faster than that of the MIDI playback, the song will not play faster in order to catch up, but rather it will skip ahead to where the player is currently at and start from there with the faster adjusted tempo. Adversely, if the player is going slower than the MIDI, the playback will jump back to where the player is at and resume playback with the slower adjusted tempo.
Along with adjusting the tempo, the code will also be able to send out variable volume levels for each note played by the piano. In order to do this, the code will have to gather not only the notes being played, but also the velocity/volume at which they are being played. Using this value, the code will be able to calculate the voltage that needs to be sent to the solenoid for each note being played. This voltage will vary from our lowest recorded point, 12.1V (or 55dB) to our highest recorded point, 35.7V (or 85dB). Once this value gets calculated, it is sent out to the specific pin on one of the four PWM boards depending on where the solenoid lies.
Another feature that will be implemented in the coming semester will be the ability to start a song playback at any chosen time mark. In order to do this, the user will move the time slider on the UI to the desired timestamp. The frontend code will then pass the value from the slider to the backend, where it will calculate the percentage of the way through the MIDI file the song will need to start at. The MIDI playback will then start from the chosen timestamp once the play button is hit.
As mentioned in the Preliminary Detailed Design, the UI of the site is very barebones in appearance, as it is simply black text over a white background.
MicrophoneA number of sensors were evaluated to be used in the piano’s feedback system, one of them being an embedded microphone. Of the two systems the microphone was evaluated for, tempo and volume, only the latter was chosen as a viable system. While there was a theoretical ability of the microcontroller to analyze the output of the microphone to find the notes played over a small sampled period, testing and analysis showed that this method was more complicated and less reliable than the piezoelectric sensor the team chose over it, utilizes the same rack as the piezo electric sensor
Piezoelectric SensorThe piezo electric sensor was one of the more promising sensors that were obtained by group. The piezo electric sensor showed promise for the following reasons
- Showed clear readings from the sensors
- Simple installation for piano
- Cheap mounting scheme
Some of the cons
- Expensive compared the simple microphone
- Alignment in the mounting mechanism
There was concern that the sensor would suffer from damage from bending over time In order analyze this condition the sensor was kept in at an angle for a week The following captures show that the sensor does suffer damage and misses some reading
There was concern that the sensor would suffer from damage from bending over time. In order analyze this condition the sensor was kept in at an angle for a week. The following captures show that the sensor does suffer damage and misses some reading.
Sustain Rail MountingHooks are attached to a plastic or light, non-conductive material backboard. This arrangement attaches to the sustain rail where the hammers are resting. The piezo sensors are arranged onto the backboard so they are essentially “clamped” by the lower hammer when a key is pressed.
- Sensors/backboard move with the hammers, presses/”clamps” so the piezo gets *clamped more consistently
- Mounting is secure, gravity helps the hooks to stay on
- Can secure wires for piezo onto backboard and other microcontrollers
- May have some effect on the rail’s weight for the sustain pedal
- Will require a little bit of adjustment with angling/weight distribution, *Will need trial and error
- Shaking from the sustain rail may move the position of the mounting or the structural integrity of the sensors mounted onto the backboard
Pillar MountingThere are three sections of keys/hammers that are separated by “pillars”. There specially designed clips attached to a backboard. The backboard is mounted to the pillars with the clips. The resting position of the backboard should be near the lower hammer.
- Closer to the lower hammer, will require less material to create
- The mounting does not move with the sustain rail, would not have to worry *about materials attached to backboard wearing out from shaking
- Easily accessible
- Gravity is the enemy, clips may wear down over time faster than the hooks
- Harder to take out to troubleshoot with the piano assembled and would require taking more piano panels out to access
Micro ControllersUse For
Microphone reading :
- Analog read from microphones one for each micro controller.
- Process reading from the microphone to understand db
- Append data to the end
- Process data from every piezoelectric sensor 88 total values and if it passses output through spi to the teensi