P19363: Player Piano
/public/

Detailed Design

Table of Contents

Team Vision for Detailed Design Phase

This 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.

Code

The 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.

public/Photo Gallery/beethoven.PNG
While not a very high priority, another task that will get done during the next semester of work will be updating the UI with a light color or gradient for the background, while remaining easy on the eyes.

Sensors

Microphone

A 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 Sensor

The 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

Some of the cons

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.

Figure 1: Plots of Stressed Test Piezo Sensor, Noticeable Gaps between key hits

Figure 1: Plots of Stressed Test Piezo Sensor, Noticeable Gaps between key hits

Figure 2: Multiple Key Hits using Sustain Rail Mounting Method (while hitting sustain)

Figure 2: Multiple Key Hits using Sustain Rail Mounting Method (while hitting sustain)

Figure 3: Single Key Hit, Hold and Release using Sustain Rail Mounting Method

Figure 3: Single Key Hit, Hold and Release using Sustain Rail Mounting Method

Figure 4: Two Soft Key Hits using Sustain Rail Mounting Method

Figure 4: Two Soft Key Hits using Sustain Rail Mounting Method

Sustain Rail Mounting

Hooks 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.
Vout Curve of the Solenoid
Vout Curve of the Solenoid
Vout Curve of the Solenoid
Pro:

Con:

Pillar Mounting

There 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.
Vout Curve of the Solenoid
Vout Curve of the Solenoid
Pro:

Cons:

Micro Controllers

Use For

Microphone reading :

Piezoelectric:

System Architecture

Vout Curve of the Solenoid

Bill of Material (BOM)

Vout Curve of the Solenoid

Risk Assessment

public/Photo Gallery/risks_review3.PNG

Plans for next phase

Vout Curve of the Solenoid
Vout Curve of the Solenoid
Vout Curve of the Solenoid
Vout Curve of the Solenoid

Home | Planning & Execution | Imagine RIT

Problem Definition | Systems Design | Preliminary Detailed Design | Detailed Design

Build & Test Prep | Subsystem Build & Test | Integrated System Build & Test | Customer Handoff & Final Project Documentation