Results & Conclusions

Results

At the conclusion of this project, we successfully programmed the system to play 23 different songs on the xylophone. Our final song list spanned across several genres, from nursery rhymes to holiday tunes to pop songs. The end results of the songs were also easily recognizable to someone less familiar with our system, showing that we achieved proper timing and control of all the servos. 

While testing, we did encounter a few difficulties and limitations with our design. One significant issue that arose was the jittering behavior seen in some of the servos. Occasionally, the servo mallet would continuously oscillate up and down after striking a key until we tap it to stop moving. We found that this was more common when powering the servos at the higher voltages than at lower voltages, so we decided to keep the power supply at 4V. This was tedious to do while testing and took away from the self-playing aspect of the xylophone. After doing some research, the results suggested that these servos were dying, but we could not replace them because they had been glued into the servo mounts. As a solution, we added a layer of foam padding between the tops of the servo mallets and the top lid of the mounting structure to act as mechanical damping. This eliminated the oscillation produced by the jittering servos.

We also discovered issues from playing multiple notes at the same time. To initially test timing and our state machine, we programmed all eight servos using the same PWM channel. We found that playing more than four notes at once resulted in the desynchronization of these servos, which we believe was due to power limitations. We decided to leave this issue unresolved, since none of the songs we wanted to include would ever be playing more than four notes at once. 

The system performed better than expected with even our fastest songs, such as “A Thousand Miles.” We were limited to a minimum beat period of approximately 130 ms due to the timing requirements of state transitions for moving down and up, but this proved to be sufficient for our songs. 



Below are a few of songs that we able to implement successfully:

Figure 7. Demonstration of "A Thousand Miles" by Vanessa Carlton

Figure 8. Demonstration of Carol of the Bells

Figure 9. Demonstration of Cornell's Alma Mater

Figure 10. Demonstration of a simple chords progression

To check out all of the songs currently available, click here!

To check out our final in class demonstration, click here!

Conclusions

There were some aspects of the mechanical design that we would want to change if given the opportunity. While we were encountering issues with servo jitter, we had considered replacing the servos, since we thought the jittering meant that the servos were dying. However, we were not able to easily swap them out since we had hot glued the servos into their mounts. If we could revise this design, we would instead put more thought into how to mount the servos to make them easy to remove. Additionally, we would want to improve the way the foam padding used for damping is added so that it is neater and more secure. 

In terms of electrical hardware, we would want to experiment with using solenoids instead of servos to strike the xylophone keys if we had more time and money in our budget. This would be good to test if we can achieve a faster reaction time from using solenoids, which could enable us to play even faster songs by requiring less time to strike a key. Another hardware experiment would be to try powering the servos at a greater voltage (5V) after the addition of the foam padding to see if the jittering was still a problem.  

For future software changes, we could try to improve our timing by using both cores on the microcontroller, since we had only used core 0 on our project. Instead, each core would control half of the servos, which could potentially improve performance. We also would like to determine if we can have the size of our note arrays be different for each song; we currently programmed each to have a fixed length of 160 with extra 0s appended to the end, but that may not be necessary if the size of the array in the struct does not matter. 

This project would not have been possible without help from schematics and source code written by Hunter Adams for his ECE 4760 course. We based our initial PWM control, serial monitor UART interface, and optoisolator circuit off of his materials. Additionally, we recognize that some of our songs are copyrighted. Reproduction of copyrighted music in an original format (“cover”) is covered under the Fair Use doctrine of US copyright law as this project is for educational purposes. All reproductions will cite the original song author.

Overall, we are extremely satisfied with the results of this project. While we underestimated how much time it would take to complete and hoped to be able to add additional smaller features, the baseline design still exceeded our expectations. The system was able to showcase a wide range of musical ability, including crisp synchronization, quickness and agility with fast or repetitive melodies, and realistic recreations of well-known songs. We did not expect to be able to play all 23 songs that we had written as intended (or that we would even be able to write and include that many). We had predicted there would be some limitations from both software and hardware that would require us to modify the songs, such as by forcing a song to play at a slower (and less satisfying) tempo or eliminate harmony due to servos not being in sync. However, we had achieved a system that was capable of reproducing each of these songs to our standards and creating music for all to listen and enjoy.