资源描述
Vehicular Source LocalizationByJason ChingClayton ChanMichael MarSENIOR DESIGN PROJECTUniversity Of Illinois at Urbana ChampaignDepartment of Electrical and Computer EngineeringFALL 2004TA: Mark WiegertApril 29th, 2004Project No. 35AbstractThis following paper describes the complete system with documentation, graphs and charts of the design and implementation of a Vehicular Sound Localization System. The system will be able to distinguish where the sound is coming from and move accordingly towards the sound signal. It was also implemented with an object detection system to enhance its robustness. The sound localization system consisted of a two 3.5mm stereo jack microphones that were fed into the TI-54X DSP board that would determine the location of the sound signal by calculating the delay in the fourier domain in real time by implementing FFTs. The obstacle detection system was made up of several IR sensors placed around the perimeter of the car. All systems were fed into the BasicX microcontroller which than directed the car. In the end we were successful in our project, it was able to determine and move towards a sound signal with a maximum success rate at around 6 feet.Table of Contents1.INTRODUCTION11.1 Purpose and Motivation11.2 Block Diagram11.3 Specifications22.DESIGN PROCEDURE32.1 Microphones Signal Amplification32.2 Sound-Source Localization32.3 Obstacle Detection System32.4 Stepper Motor32.5 BasicX Microcontroller33.DESIGN DETAILS43.1 Microphones43.2 Sound-Source Localization53.3 Interface Between DSP Board and BasicX Microcontroller73.4 Obstacle Detection with Infrared Sensors73.5 BasicX Microcontroller83.6 Stepper Motor94.DESIGN VERIFICATION124.1 TDOA algorithm Simulation in MATLAB124.2 TDOA Algorithm Testing and Verification124.3 Microphone Response134.4 BasicX Testing154.5 Car Testing154.6 Total System Testing165. COST175.1 Parts175.2 Labor176. CONCLUSIONS186.1 Accomplishments186.2 Challenges186.3 Future Work/Alternatives18APPENDIXAppendix A: tdoa.m19Appendix B: tdoa.c20Appendix C: Basic Code for Obstacle Detection System23Appendix D: Basic Code for Proper Control of Car25Appendix E: Wiring Diagram of Car27Appendix F: Basic Code for Stepper Motors29REFERENCES31311. Introduction1.1 Purpose and MotivationOur team consisted of engineers that were very familiar in a wide range of Electrical Engineering sub-disciplines. We found that it would be most beneficial to undertake a project that would utilize each group members engineering focus. Backgrounds consisted of Digital Signal Processing (DSP), Hardware Design, Sensors, Power and Control systems. We developed a project that was able to expose the group to their respective fields of interest: viz. vehicular sound localization.Our main goal would be to design and implement a system that would be able to distinguish where a sound source was originating from and progress towards that sound accordingly. This would involve a strong knowledge of algorithmic implementation using a digital signal processor. Also, hardware and circuit design were needed to construct microphones and implement control.With that said, there are many possible “real world” applications behind source-localization. For example, steering antennas in the direction of an incoming signal to maximize SNR and minimize interference. Source Localization has many applications for noise and interference cancellation within audio systems as well. Our project is unique in that source localization is being extended to vehicular control. This has a plethora of possibilities in terms of marketing; any where from an automated security systems to a childs toy.1.2 Block DiagramFigure 1.1 shows a very general layout of our proposed design.Sound-Source Localization (T1-54x DSP)Stepper MotorIR SensorsBasicXMicrocontrollerBridge RectifierCapacitor FilterAmplifierDemodulatorFigure 1.1. Finalized Block Diagram of System1. Microphones / Amplifier - a mechanical vibrating source, preferably from a speaker that will generate the signal the car should follow.2. Sound Detection System a Texas Instruments (TI) 54X Digital Signal Processor will digitize the signals from two highly sensitive microphones and perform the necessary processing in order to determine where the sound originated from. This information is then relayed to the microprocessor.3. Obstacle Detection System we plan to use a series of IR sensors placed on the perimeter of the car to alert it of any obstacles in its way.4. Stepper Motor will be used to implement the actuation of the vehicle towards the sound source.5. Demodulator the demodulator converts the AC Signal output from the DSP to a DC component proportional to the amplitude of that AC signal.6. Microcontroller the processing unit that is central to all other sub systems. The car is controlled based on information sent from each of these “so-called” sub systems.1.3 Specifications The sound-localizing vehicle should be able to distinguish the direction of the sound source in room with minimal interference (from either ambient noise introduced from the environment or thermal noise introduced in the system) and progress toward that signal in a controlled manner. Computations to resolve direction will be done real-time in order to make the car responsive as possible. We also specify that the direction finding mechanism within our vehicle to have 360 of resolution. That is, the vehicle will be able to arrive at its destination regardless of what angle the sound signal is arriving from.The distance to which the car will be able to respond will depend on the sensitivity of the microphones. We want to ensure that the vehicle will perform over a range of distances, initially this range was within a radius of 1m. The distance to which the car will respond to obstacles will also depend on the placement and focusing of the IR sensors. Most of the time spent on these two parts of the project will consist mostly of optimization and will be discussed in later sections. Summary of Specifications Performs over an adequate range (initial proposition: 1m radius) Digital Signal Processing done in real time 360 of direction finding resolution Able to avoid obstacles within a radial range of 10cm2. Design Procedure2.1 Microphone Signal AmplificationThe purpose behind the amplification of the microphones will be to boost the sensitivity and increase the robustness of the system. Ideally, the signals the microphones output should have little noise as to not to interfere with the actual signal and thus a compromise between contrast and the actual signal must be decided upon in order to maximize robustness of the system. 2.2 Sound-Source LocalizationThe purpose of the Sound Source Localization Component is to determine the direction from which a single acoustic source originated from. There are several methods of implementing such a system. Two specific methods were considered for our design. The first method considered was high-resolution direction finding as described in 1. The second method considered (the method used in our final design) utilized the time delay of arrival (TDOA) algorithm as discussed in 1. In general, the algorithm estimates the delay between two digitized sources.2.3 Obstacle Detection SystemThis system would consist of a series of IR sensors placed around the perimeter of the car. The basic principle behind the IR sensors uses the property of energy reflection of IR waves off of certain surfaces. The sensors consists will consist of an emitter that will emit IR energy and a detector that will receive any IR energy reflected back. The detector is modeled after a transistor except the gate voltage increases only when IR energy is detected, that is the transistor turns “on” when IR energy is detected and lets current flow through it. 2.4 Stepper MotorIn order to move the car to the sound source, at least two stepper motors would be required in order to turn the two rear wheels of a car. Stepper motors provide accurate positional control for systems and are simple to control. In addition, stepper motors can be used for speed control. The parts shop actually made us a car that encompassed two stepper motors for the rear wheels. The parts shop also made us a ball pivot for the front of the car. All the logic to operate the motors effectively was already completed for the project, and the operation of the stepper motors was through a 6-pin pinout connection for each motor.2.5 BasicX MicrocontrollerThe BasicX microcontroller is a 24 pin programmable microcontroller that consists of 16 general logic I/O pins, 8 of which can be used as a 10-bit analog to digital converter. The BasicX is able to communicate with the computer through a serial port which also uses it to download programs. It is capable of multi-tasking and floating point math. It is powered by a 5 V power supply across pins 21 (+) and 4 (-) and has a combined maximum current of 80 mA.3. Design Details3.1 MicrophonesThe microphones were one of the key components of the sound localization system due to the fact that the sensitivity of the microphones would determine the robustness and responsiveness of the sound detection. This was because the input into the TI-54X had to be large enough for the DSP to be able to detect process the data accordingly without much interference.The microphones used in the system were standard 3.5mm jack microphones, similar to the ones used for computers. They are an electret type microphone-that is the microphone element senses mechanical vibrations as it hits it by inducing a change in voltage across two capacitative plates. This would mean that the plates had to be powered (charged) in order for them to work properly. The 3.5mm jacks consist of three bands corresponding to three different leads. The top conductive band (the tip) was the signal from the microphone. The middle conductive band was for the power and the last band located at the base of the jack was designated to be ground. The schematic diagram of the mount used for the PCB board is shown below in Figure 3.1 along with a picture of a 3.5mm jack and of the actual mount. Initial testing of the microphones showed that the microphones themselves were not able to give enough of a signal into the DSP as expected. Signal5VGroundFigure 3.1. Microphone SetupIt was decided upon that National Semiconductors LM386 amplifier chip would be ideal for our system. The LM386 is a low-voltage power audio amplifier that uses only 5V so a battery can be used for power and is able to perform gains of 20 to 200. This corresponds to a dB gain of 26 dB and 46 dB respectively. Below in Figure 3.2 is the circuit diagram used in our circuit given by National Semiconductors for a gain of 200.Figure 3.2. Circuit Diagram of Audio AmplifierREFERENCE A printed circuit board was also made in order to maintain modularity of the microphones as well as to isolate the power source from each of them (see testing and verification 4.1.2 for the reason). The picture of the final amplification circuit is shown below in Figure 3.3.Figure 3.3. Final Amplification Circuit on PCB 3.2 Sound-Source LocalizationAs mentioned previously, the Sound Source Localization component of our design utilizes the TDOA algorithm which is thoroughly discussed in 1. Two analog audio inputs are first converted into two digital signals by the TI54x DSP board. Essentially, we want to estimate the delay (which can be positive or negative as we will later discuss) between each digital signal. From this delay, we can determine if the audio source is either to the left or right of the car. We define the microphone signals in equations 1 and 2 respectively. (1) (2)Here and are the attenuation factors experienced from sound propagation, while x(n) is the sound signal as seen from the source. Also and are the delays experienced from the source to microphones i and k respectively. Furthermore, we define the delay between the digitized inputs themselves in equation 3. (3)From the estimated delay d, we can determine which microphone received the signal first and therefore which side (right or left) the source originated from. More specifically, if d is positive, microphone i received the signal before microphone k meaning the source is closer to microphone i. Likewise, if d is negative, microphone k is closer to the source. SpeakerRLFrontFigure 3.4. Example of sound path from a given sound sourceThe TDOA algorithm, as mentioned earlier, essentially computes the estimated delay d. For the algorithm we will assume that the source is approximately WSS. With this assumption, the peak cross-correlation function will be maximized at n = d. To determine the cross-correlation function, we will process our data in 1024 sample-blocks. As seen in equation 4, is a simple Fourier based method of determining the cross-correlation of two signals (See Appendix A for a complete proof). As we will later discuss, our estimated delay d can be calculated using , the value of n that maximizes our cross-correlation function. (4) (5)Since the computation of the cross correlation utilizes FFTs, it will essentially be “circular” (analogous to circular convolution). In other words, the delay d is equal to for samples in the range 1,512, otherwise (for the range 513, 1024) d is equal to - 1024. With the computed value we can essentially decide on which direction to turn. One of the specifications for the sound localization component of this project was 360 of resolution. That is, the vehicle will be able to maneuver toward the source regardless of the angle it originated from. For that reason, we adjusted the car either left or right based on the value of : LEFT if , RIGHT if ). We could have easily estimated an approximate angle that the sound arrived at using . However, this would limit the cars direction resolution to 180. (6) (7)As seen in equation 6, the delay (in seconds) experienced between each microphone is a function of the angle of arrival and the spacing between the microphone x (meters). Solving for we get the expression seen in equation 7. The delay can be computed from through normalization of the sampling rate: 44.1 kHz. The inherent resolution of 180 can be clearly seen if considering the case where the sound source is directly behind the vehicle. In this case, the angle of arrival would be 180 which yields the same value of for an angle of 0. This clearly yields a conflict since the vehicle would be traveling in the complete opposite direction of the source. Of course, this direction ambiguity of 180 can be neatly resolved by adding additional microphone elements at the front and rear of the vehicle. Figure 3.5. Sound Arriving From Either Left or Right Gives Vehicle 360 of ResolutionHowever, due to the limited amount of input channels on the DSP board as well as time constraints, we chose a different approach: viz. rotating either left or right by fixed amounts and adjusting as the car progressed. As seen in figure 1, through multiple acquisition periods and the adjusting the direction of the vehicle (rotating it), the vehicle will ultimately end up at the source location.3.3 Interface Between DSP Board and BasicX MicrocontrollerOne of the main concerns in our design was the difficulty of relaying information from the DSP board to the BasicX Microcontroller. Without digital IO pins on the DSP board, there were only two possibilities to consider for interfacing: via serial port and via analog output channel. After little success with serial port communication (as digital communication would be preferable), we decided to use one of the 6 AC coupled output channels on the DSP board. Each output is AC coupled, meaning that signals, at the A/D converter, are offset such that the signal has no DC component. Therefore, we could not simply synthesize a DC signal, namely 0V or 5V DC, to send to a digital IO pin on the BasicX. Instead, we used a modulation technique, when synthesizing an output symbol at the DSP.Modulation Amplitude Shift Keying, a simple yet effective digital modulation scheme, was implemented on the DSP end. We basically want to relay three symbols over to the BasicX: Right, Left, or Stop. This can be achieved by sending the signal represented in Equation 6. (5)The amplitude takes on different values for each message symbol (in this case, three symbols for left, right and stop). Like any other digital modulation scheme, symbols can be represented with a constellation as depicted in Figure 3.6. Figure 3.6. Signal Constellation of ASK schemeDemodulation At the BasicX End, we want to receive a DC value proportional to the amplitude of the modulated signal synthesized by the DSP board. To accomplish this, we simply use a rectifier-filter combo to extract a DC voltage from the incoming sinusoid.3.4 Obstacle Detection with Infrared SensorsThe obstacle detection system as discussed earlier consists of a placement of IR sensors around the perimeter of the car. The amount of sensors used was limited to the number of ADC available after all the primary components were interfaced (DC signal from demodulator and control of stepper motor). At the end, 7 sensors were possible and implemented in the final design. Because of the limited number of sensors great care was needed in the placement to ensure good clearance of all parts of the car and from the movement of the car, the front was most vulnerable to obstacle contact. Three sensors were placed in the front and four more sensors were placed on along the left side of the car. This set up would provide maximum coverage of the front and one side of the car. The other side of the car would be of no consequence if the car was programmed to always turn right if the front sensors were activated. The side sensors were solely responsible for detection of obstacle clearance and therefore the car was programmed to always go straight if the side sensors were activated. Having the sensor output go into the ADC of the microcontroller would allow for more flexibility of obstacle detection, that is any small change by the voltage caused by a slight reflection of light off a surface would let us detect an object, and thus increase the overall sensitivity of the system. The circuit diagram of the sensors is given below in Figure 3.7.The basic code used for the obstacle detection system is shown in Appendix C.Figure 3.7. Circuit Diagram of Infrared Sensor3.5 BasicX MicrocontrollerIn order to integrate each subsystem, the BasicX microcontroller was optimal. The BasicX microcontroller, in a
展开阅读全文