As the name suggests, my final project was to enable the Segbot to play a duet alongside me, while dancing to my portion of the duet we play. The song I chose is a classic duet amongst pianists, "Heart and Soul", originally composed by Hoagy Carmichael in 1938. To do this, the most important function was to utilize FFT signal processing to trigger different actions, such as starting the song or various dance moves, for the Segbot based on specific frequency signals. In the duet, the Segbot plays the rhythm using the original buzzer and three more buzzers which were added for this project, while I play the melody on the piano. The Segbot will react to the different frequencies output as the notes from the piano and dance to the melody. I wonder what the original composer would think of the Segbot's rendition of his work.
Throughout my final semester at UIUC, working on this Segbot was the main focus of one of the courses I have found most challenging, but also most compelling during my undergraduate career. To develop my final project for the class, my primary goal was to build upon the self balancing capabilities and use the microphone sensor. To do this, I would not only need to introduce some new code, but I would also be relying heavily on the material taught throughout the course and the versatility of the TI F28379D Launchpad.
The code used in my final project draws on all of the lab assignments which we have done in this course so far. The two most important labs for this project however were Lab 3 and Lab 7. In Lab 3, we were introduced to the Segbot's buzzer, and the ability to use a PWM (pulse width modulation) pin from the Launchpad to play a song to the period, or tempo of the chosen CPU timer interrupt. Lab 7 builds upon labs 4, 5, and 6 to enable the Segbot to self balance, and be controlled using keyboard buttons. The code from Lab 1 is also implemented to have the LED lights on the Segbot display different numbers corresponding to the different dance moves.
While the prior coursework provided a solid start to the project there were still some remaining steps. The first step was to solder three additional buzzers and resistors to the Segbot, and sending each of those buzzer and resistor series to an available PWM pin. This was the only physical modification to the Segbot, but to accommodate this change, the Lab 3 based code also needed to be changed to play four notes simultaneously using the four different PWM pins assigned to each of the buzzers. The Lab 7 based code also needed to be changed to allow the Segbot to dance and perform other actions in response to specific frequencies. To do this, first a ping pong buffer style code was introduced to read the FFT signal given by the microphone. Using this, the Segbot can be set to perform different functions based on the frequency and volume recorded by the microphone.
After a few nights of Segbot dance class, the robot could both recite the duet and perform a variety of dance moves based on the FFT scaled frequency of the notes from the piano.
Comments
Please log in or sign up to comment.