The segbot can accomplish two major tasks: point navigation and beat detection. The user can draw a desired path using LabView, and the segbot would conceive the path as different coordinates and navigate to each corresponding coordinate. The robot can also detect music beats and perform “dance” using two servo motors.
The MyRio uses wireless communication to receive an array of coordinates. The coordinates will be passed over UART in the form of a string and converted into integers on the F28379D. Once received the segbot will go into navigation mode and turn until lined up with the goal and then apply a forward velocity until it reaches it. If the IR sensor readings are high enough, the robot will go into obstacle avoidance mode and use a feedback loop to turn left and avoid the obstacle. Once both sensors are clear, the robot will travel a set distance before resuming navigation to ensure the obstacle has been cleared. This can be improved by adding an IR sensor on the back of the robot. Once the goal is reached the segbot goes into balancing mode until another set of coordinates is received over UART from the MyRio. A flag is sent over UART once the goal is reached which prompts the MyRio to send the next set of coordinates over UART. This continues until all the points have been reached thus the segbot will complete the entire path. One of the biggest challenges with this project was setting up a reliable UART communication protocol since Labview’s express VI for UART only supports sending characters. The sequence in which the robot sets its flags also had a major impact on the reliability of the system.
The sound signals from music are received by the microphone sensor on the board. A 100-300Hz band-pass filter is implemented to reduce noise signals from the ambient environment. The filter is created using window-based FIR filter design in MATLAB. Then the filtered sound signals are recorded at a sampling rate of 2000Hz. Over a period of 1/16 of a second, the energy of the discrete signals is computed and recorded. If the current interval has a greater energy than the preceding interval, based on a certain ratio threshold, the program marks the presence of a beat. As a beat is detected, PWM signals are sent to drive the two RC servo motors to rotate at a certain angle, when the next beat is detected, the servo motors return to the original position. A drawback of the beat detection program is that the robot is also sensitive to talking because the human voice can also be in the 100-300Hz range, and therefore the algorithm works best for instrumental music. Another problem encountered in the project was the ticking sound from servo motor rotations, which disrupts the beat detection. A magnitude threshold was used to improve the situation so that the light ticking sound does not get marked as beats.
Window-based FIR: https://www.mathworks.com/help/signal/ref/fir1.html