My final project is a sound following segbot that tracks frequencies sent by a phone. The segbot operates on three different modes, dependent to the two different frequencies the phone releases. When the segbot does not detect any of the frequencies, it stays in “Standby” mode and does not make any movements. When it detects a 2500 Hz signal, the segbot enters “Halting” mode. It would rotate at the same place without axial movement while locating the direction of the phone. When the segbot detects a 4000 Hz signal, it enters “Follow” mode. If the signal amplitude, or the intensity of the sound, is above a set Threshold 1, the segbot determines that it is close enough to the phone and would stop all movements while playing a sound through the buzzer for indication. If the signal amplitude is lower than Threshold 1 but higher than another Threshold 2, the segbot determines that it is facing the direction of the phone and would move towards the phone in decaying velocity. Finally, if the signal amplitude is lower than Threshold 2, the segbot would start the tracking process similar to that of the “Halting” mode. It would rotate, find the direction of the phone and move towards it.
For the movement of the segbot, I use the MPU-9250 IMU to read the acceleration and gyro values. Through implementing a Kalman filter and Proportional Integral (PI) speed controllers, the segbot balances itself while responding to the tilt offset variable change to move forward and backward, as well as the turnref variable change to rotate itself. The Kalman filter uses sequential measurements as well as predicted states to generate a responsive feedback while decreasing signal noise
[i].
The PI speed controllers are feedback loops that take the difference of current states and input commands to smoothly respond to commands and avoid sudden, intense changes that the segbot could not handle[ii].
For the sound detection aspect, I use a microphone facing forward. The mic samples at 10 kHz, and with two 81st order band-pass filters, the segbot identifies sound samples for 2500 Hz and 4000 Hz. The filtered results oscillate, but their wave amplitude reflects the intensity of sound received, and it is used to determine the distance between the segbot and the phone, as well as identify the relative direction of the phone. The bandpass filter is a filter that stacks lowpass and high pass filters to reject unwanted signals and only pass frequencies within a determined range
[iii].
During tracking and halting processes, the segbot rotates clockwise for 1080 degrees, saving the direction in which it receives the largest sound signal with the specific frequency. Then, it rotates counterclockwise back to the saved direction. To prevent random noises or other errors affecting the accuracy of detection, the amplitude of sound signal must be continuously incrementing when moving towards the direction and continuously declining when moving away. The “halt” frequency also takes priority over the “follow” frequency if both signals are received.
While the project functions as intended, there are two stability improvements that I would like to work on. First, the rotation of the segbot would interfere with its balancing operation, so when it rotates it would sometimes drift slightly and not stay at the same point. Therefore, the relative direction of the sound source would be different from the saved direction. If I can prevent drifting during rotation or record the amount of drifting, I can improve the accuracy of tracking. Secondly, since I am using a single microphone and the amplitude of sound signals to locate the sound, it could lead to inaccuracy. For example, the microphone sticks out to the left of the segbot. If the segbot is tracking when it is very close to the phone, it would occasionally save the direction when the phone is at the left of the segbot, since the mic is closer to the phone in that direction and would record a louder sound signal. If I use a omnidirectional microphone that can record the direction of the sound source, the tracking process would be easier and more accurate.
Using the TMS320F28379D LaunchPad, I built a segbot that tracks and follows specified sound frequencies. Please refer to the videos to see its operations.
[i]
Kim, Y., & Bang, H. (2018, November 05). Introduction to Kalman Filter and Its Applications. Retrieved December 17, 2020, https://www.intechopen.com/books/introduction-and-implementations-of-the-kalman-filter/introduction-to-kalman-filter-and-its-applications[ii]
Clifford, P. (n.d.). Understanding PI Controller, Optionally Control Speed with Closed Loop Proportional-integral Controller. Retrieved December 17, 2020, http://www.mosaic-industries.com/embedded-systems/instrumentation/motor-control/pi-control[iii]
Band Pass Filter - Passive RC Filter Tutorial. (2018, May 15). Retrieved December 17, 2020, https://www.electronics-tutorials.ws/filter/filter_4.html
Comments