Preliminary Detailed Design
Team Vision for Preliminary Detailed Design PhaseThis phase our team focused on testing the sensor options we developed previously and designing new control circuits for the solenoids. We also assessed the code written by the previous team to see what changes we need to make in the future. Several sensors such as microphones, piezoelectric, vibration, and accelerometers were tested to verify functionality. A new board schematic with passive components and an IC that generates PWM signals was also designed to control the power and speed of the solenoids. We interfaced with the IC and generated PWM signals that will eventually allow us to dynamically change the volume of the keys being played. The microphone sensor had initially good results, but real-time analysis revealed poor sampling at high frequencies. The piezoelectric sensor revealed itself to work well in our conditions and is a likely candidate for feedback analysis moving forward.
Feasibility: Prototyping, Analysis, Simulation
- Vibration Sensors (Piezo)
- *Prototyping: Mounting piezo strips onto the piano keys by attaching sensors to wooden mounting at a slight angle.
- *Simulation: Interfaced sensor to Arduino Uno to plot and read sensor outputs while pressing a sensor mounted key and keys surrounding sensor mounted key.
- *Analysis: A lot of debouncing required, could be able to determine the volume by relating rise time of the signal to a volume. Definitely can determine order of keys played and what key was played.
- Snap Action Switches
- *Prototyping: Attached switch to wooden mounting at slight angle to level is resting on piano key. Supposed to allow voltage to pass when the level is torqued and presses the button.
- *Simulation: Need to detect whether the switch allows voltage to pass, hooked leads up to a voltmeter to determine continuity when lever was torqued
- *Analysis: Simple debouncing, would determine what key was pressed and is extremely easy to mount at connect to GPIOs
- *Prototyping: Attempted to hook up to the Arduino Uno and read response when object passed through
- *Analysis: Extremely invasive and tough to attach to piano, the size required to allow for the shaft of the hammer to fly back into it is too big to have 100% certainty a key (hammer) was pressed (passed through).
- *Prototyping: Would attach sensor to piano key
- *Analysis: No reliable way to attach the sensor to the piano key without modifying the piano permanently.
- *Prototyping: Attached microphone to mounting brackets and analyzed output through Arduino ADC.
- *Simulation: Modelled noise using C coding, and looked at the direct output of the microphone over an oscilloscope.
- *Analysis: Complex output that is easily affected by noise, difficult to analyze under average conditions.
Sensor DesignAfter our feasibility analysis it was found that the Microphone and Piezoelectric Vibration Sensors would be the most viable options.
Piezo Electric SensorThe Piezoelectric Vibration Sensors would be implemented such that there would be one sensor which rests on the back portion of each key. This sensor will read a key press this data is then transferred to a microcontroller which packages it and sends it serially to the Raspberry PI.
The microphone sensor would be implemented such that a small number of microphones <12 would be used. Each would cover a range of keys. These microphones would then be used to transfer the analog sound data to a microcontroller where a FFT would be used to determine the frequency of the notes being played and thus the notes. This system is also able to determine the intensity at which the notes are being played thus determining their volume.
Mounting hardware was also designed for the sensors. The different types simulated are shown below.
Control CircuitThe existing design for controlling the Solenoids is insufficient due to its known and unknown issues; burnouts, delays, etc. The solution to this issue is to redesign the control circuit. The solenoids will now be controlled by several PWM ICs and MOSFET amplifier circuits. The PWM IC is controlled by the Raspberry PI via SPI communication. Each IC has 24 individual channels which can be set to a different PWM duty cycle. This signal controls a MOSFET. The fet acts as a switch on the power line of the solenoid. By turning the fet on and off at the specific frequency dictated by the PWM signal the solenoid effectively receives a different DC voltage. Varying this voltage level allows the solenoid to be fired at various speeds. The diagrams below show a high level overview of this.
Physical InstalationThe existing design for the instalation and positioning of the solenoids is adequate for the expansion to all 88 keys. The main issue with the current installation of soleniods is the sound they make apon actuation. The Proposed remidy to this issue is to Epoxy Rubber O-rings to the bottom of a solenoid.
The current UI is very barebones in terms of appearance: plain back text on white background & only the necessary information on each page. While it does function properly, it could be made more visually appealing with a lightly colored background and slightly more stylized text/font.
UML Diagram of Current Server Code
Revised UML Diagram
Most parts of the flowchart will remain the same from the last group’s iteration. The main changes for our iteration are:
- Have the piano play at variable tempo based on the value selected on the tempo slider
- Have the piano play notes at variable volumes based on the values obtained from the MIDI files
- Take in player input & adjust piano playback based on the tempo & volume that the player is playing at
SensorsA feasability simulation was connducted for the microphone.
This clear waveform was produced by applying a 1.35 KHz tone to the microphone in a relatively noise free environment. This test shows a consistent waveform across the device and consistent frequency response. This test shows that in an isolated environment the microphone performs quite well considering its size and cost.
A feasability simulation was conducted for the Piezoelectric Sensor as well
This clear waveform was produced by tapping on a table next to the Peizoelectric Sensor. This test shows that a clear response to vibration can be seen by the sensor. It also shows that the sensor can respond well to rapid pulses.
ActuatorsThe MOSFET circuit used to control the solenoids was also tested. The diagram below shows the voltage across the solenoid when a PWM signal is applied. The voltage varied when the duty cycle of the PWM was changed. The soleniod moved to its limit when the voltage was applied.
Test PlansSeveral tests were condcted during this phase and more tests are planned for the future.
SensorsThe microphone sensor was tested on the actual piano. The microphone was placed optimally near the cords of the piano. The sound of a keypress was then recorded.
The above plot shows the captured data from the microphone sampled at 4KHz through an Arduino Uno. The data was then plotted in Matlab. Two C Notes were played on the piano nearby the microphone, noted at the two large spikes in the waveform. Fourier analysis on this result however leaves much to be desired, the C3 frequency of 130Hz was not found. More analysis and testing is required to rule out the sensor, but the potential looks limited from here.
The vibration sensor was also tested. The sensor was placed on the backside of the key and the key was pressed. The key press registered on the sensor. Keys near the sensor were also pressed. These keys did not register large disturbances on the vibration sensor. This means that the sensor can practically be used to measure a keypress.
The solenoids were also tested. The voltage to sound ratio of the solenoids was found. This ratio proves that the solenoids can be actuated at different voltages to get a full range of sounds from the piano. The test below was conducted with the current solenoids in their current rack. This allows us an exact model of the system to see if the solenoids can be controlled practically.
Planned TestsMore tests are planned for the next phase.
- The PWM IC is to be tested with the MOSFET control circuit
- The Microphone is going to continue to undergo test to examine the practicallity of its use.
- The piezoelectric sensor is going to be tested with the microcontroller architecture designed to connect it to the Raspberry PI.
- Use microphone to analyze loudness (in decibels) of solenoid clicking with and without o-ring.
Bill of Material (BOM)
Plans for next phaseZachary Blough
- Make the solenoids work
- Finalize solenoid controller board design
- PCB layout for solenoid controller board design
- Find epoxy to attach o-rings to solenoids
- Do solenoid testing
- Continue designing rack to hold sensors
- Continue analyzing existing code
- Reliable testing environment for RPi
- Learn Node.JS to work with existing code
- Understand existing Python code
- Assist Zach with designing and testing solenoid controller boards
- Sensor mounting strategies
- Investigate new microphone sensors
- Develop more robust tests for the existing microphone
- Choose microcontroller for feedback system
- Integrate the PWM IC with the solenoid controller board
- Solve the 88 parallel sensor problem
- Make new solenoid brackets
- Mounting hardware for sensors
- Investigate mounting solutions inside the piano for additional space