NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
DSP56824 AN2086/D CH370 DSP65824 400SR-400ST DSP56824EVM MC145483 ADS774 - Datasheet Archive
Simple Real-time Sonar with the DSP56824 Application Note by Mihai V. Micea, Lucian Muntean, and Daniel Brosteanu AN2086/D Rev.
Freescale Semiconductor Simple Real-time Sonar with the DSP56824 DSP56824 Application Note by Mihai V. Micea, Lucian Muntean, and Daniel Brosteanu AN2086/D AN2086/D Rev. 0, 06/2001 How to Reach Us: Home Page: www.freescale.com E-mail: support@freescale.com USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, CH370 CH370 1300 N. Alma School Road Chandler, Arizona 85224 +1-800-521-6274 or +1-480-768-2130 support@freescale.com Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) support@freescale.com Japan: Freescale Semiconductor Japan Ltd. Headquarters Information in this document is provided solely to enable system and software ARCO Tower 15F implementers to use Freescale Semiconductor products. There are no express or 1-8-1, Shimo-Meguro, Meguro-ku, Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no any integrated implied copyright licenses granted hereunder to design or fabricate warranty, Tokyo 153-0064 guarantee regarding the suitability of its products foror integrated circuits based on the information in this document. liability representation or circuits any particular purpose, nor does Motorola assume any Japan out of the application or use of any product or circuit, and specifically disclaimsreserves the right to make changes without further notice to arising Freescale Semiconductor any and all liability, including without limitation 0120 191014 or +81 3 5437damages. "Typical" parameters which may be provided in Motorola data sheets and/orwarranty, representation or consequential or incidental 9125 any products herein. Freescale Semiconductor makes no specifications can and do vary in different applications and actual performance may vary over time. the operating parameters, including "Typicals" must does guarantee regarding All suitability of its products for any particular purpose, nor support.japan@freescale.com be validated for each customer application by customer's technical experts. Motorolaassumenot conveyarising out of the application or use of Freescale Semiconductor does any liability any license under its patent rights nor the any product or circuit, and specifically disclaims any and all liability, including without Asia/Pacific: rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended Semiconductor Hong Kong body, limitation consequential or life, or damages. "Typical" parameters which the Freescalefor surgical implant into the Ltd. or other applications intended to supportincidentalfor any other application in which may be failure of the Motorola product could create a situation whereprovided in Freescale Semiconductor data sheets and/or specifications canuse do personal injury or death may occur. Should Buyer purchase or and Technical products for Center Information any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, Motorola vary in different applications and actual performance may vary over time. All operating 2 Dai King Street employees, subsidiaries, affiliates, and distributors harmless parameters, including "Typicals" must be validated for each customer application by against all claims, costs, damages, and expenses, and reasonable Tai Po Industrial Estateout of, directly or indirectly, any claim of personal injury or death associated with such not convey anyor attorney fees arising customer's technical experts. Freescale Semiconductor does unintended license unauthorized use, Kong under its patent rights nor the rights or manufacture of the part. Tai Po, N.T., Hong even if such claim alleges that Motorola was negligent regarding the designof others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for +800 2666 8080 Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer. implant into the body, or other applications intended to support or sustain life, surgical support.asia@freescale.com or for any other application in which the failure of the Freescale Semiconductor product Motorola and the Stylized Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. or death may occur. Should Buyer could create a situation where personal injury Off. For Literature Requests Only: purchase or use Freescale Semiconductor products for any such unintended or Freescale Semiconductor Literature Distribution Center unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor P.O. and its officers, employees, subsidiaries, affiliates, and distributors harmless against all How Boxreach us: to 5405 claims, costs, damages, and expenses, and reasonable attorney fees arising out of, Denver, Colorado 80217 directly or indirectly, any claim of personal injury or 1-800-441-2447 or 303-675-2140 Listed: Motorola Literature Distribution; P.O. Box 5405, Denver, death associated with such USA/EUROPE/Locations Not Colorado, 80217. unintended or unauthorized use, even if such claim alleges that Freescale Fax: 303-675-2150 or 18004412447 13036752140 Semiconductor was negligent regarding the design or manufacture of the part. LDCForFreescaleSemiconductor@hibbertgroup.com JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3201, MinamiAzabu, Minatoku, Tokyo 1068573 Japan. 81334403569 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd., Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tai Po, N.T., Hong Kong. 85226668334 Technical Information Center: 18005216274 HOME PAGE: http://www.motorola.com/semiconductors/ © Copyright Motorola, Inc., 2001 Abstract and Contents The focus of this paper is on the techniques of analysis and implementation of a simple real-time SONAR system with a DSP56824-based board connected to a host computer. SONAR system's general architecture and its principles of functioning are further presented. Specific digital signal processing algorithms developed for the ultrasound frequencies are described in detail, along with their implementation using the DSP56824 DSP56824 processor. Finally, a particular application developed with the proposed SONAR system is presented as a case study. Some prospects and future work related to this subject are also mentioned as conclusion. 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 General Description of a Sonar System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Proposed Sonar System Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1 2.2 2.3 General System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Transducer Interface Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Stepper Motor Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 Sonar Implementation on the DSP56824 DSP56824 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.1 3.2 3.3 3.4 3.5 3.6 Definition and Initialization Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Emitted Wave Generation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Echo Signal Sampling and Storing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Target Polar Coordinates Calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Transmission of Results to the Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Transducer Platform Rotation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4 Sonar Implementation on the Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.1 4.2 Serial Data Link Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Graphical User Interface Implementation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Abstract and Contents iii iv Simple Real-Time Sonar with the DSP56824 DSP56824 1 Introduction SONAR (SOund NAvigation and Ranging) systems, like RADAR and electro-optical systems, have a large field of applications in robotics, navigation, and target detection. The common principle of functioning is based on the propagation of waves between a target and the detector. Sonar, however, differs fundamentally from radar and electro-optics because the energy is transferred by acoustic waves. Digital signal processing techniques increase the versatility of modern sonar systems, resulting in a wider range of detection, better precision, data storage and post-processing capabilities, as compared to previous, analog sonar systems. Digital filtering algorithms can be applied to the received data, thus improving the target detection capabilities in noisy environments. Therefore, using digital signal processors (DSPs) to enhance sonar performance is advantageous. This application note presents a simple real-time sonar implementation using the DSP65824 DSP65824. Section 1.1, "General Description of a Sonar System," explains a typic sonar system, along with its principles of operation. Section 2, "Proposed Sonar System Description," introduces the suggested sonar implementation using the DSP56824 DSP56824. Also presented is a general block diagram of the system, the hardware and functional description of its components, and the specialized DSP algorithms. The focus of Section 3, "Sonar Implementation on the DSP56824 DSP56824," provides details of the sonar-specific algorithms on the DSP56824 DSP56824 processor. This section also discusses the routines developed for generating the emitted wave samples, echo signal reception and pre-processing, noise filtering, emitted pattern recognition and target distance calculation. The implementation of data communication routines between DSP and the host computer are also presented. Section 4, "Sonar Implementation on the Host," describes the sonar implementation on the host side: the data link routines with the DSP and the graphical user interface developed under the Windows platform. Finally, Section 5, "Conclusions," presents a synthesis of the work along with practical results, performance estimations of the sonar system, and investigates additional applications for simple sonar systems. 1.1 General Description of a Sonar System The basic sonar system estimates the distance to a target by calculating the overall propagation time of a specially selected audio or ultrasound wave between the sonar and target. In an active sonar system the wave propagates from the transmitter to the target and back to the receiver analogous to pulse-echo radar and passive sonar systems in which the target is the source of the energy that propagates to the receiver. In an active sonar system, the source of the acoustic wave is part of the sonar system. The electrical energy from the transmitter must be converted into acoustic energy, by a transducer. In a passive sonar system, the source is the target itself. Knowing the propagation speed of the acoustic waves in the particular environment where the sonar operates-say, in air-the estimated target distance from the sonar is determined using Equation 1. Introduction 1 t propagation D = v s -2 where: Eqn. 1 m - - is the propagation speed of acoustic waves in air, and; v s = 340 -s t propagation [ s ] - is the total propagation delay of acoustic waves. Transducers are used to receive acoustic energy. When they are designed to receive equally in all directions, they are called omni-directional. Transducers can be constructed with minimal directionality in which case they have a range of angles, known as beamwidth, from which to receive energy. While receiving, the narrow beamwidth allows the transducer to reject interfering noise because the ambient noise comes from all directions. This is represented mathematically by a logarithmic term called the directivity index, DI. The criterion for detection requires that the amount of power collected by the receiver to exceed the noise level by a certain threshold. The ratio of signal-to-noise in logarithmic form is the SNR. The minimum SNR for detection is called the detection threshold, DT. Therefore detection generally occurs, meaning more than 50% of the time, whenever SNR > DT. The transmission loss (noted here as TL) represents the signal loss from source to receiver. The transmission loss term includes all the effects of the energy spreading out, attenuation, and other various effects. As a result, the SNR at the sonar receiver can be written explicitly for a passive system (which has a one-way transmission) as shown in Equation 2. SNRpassive = SL + DI - TL - NL Eqn. 2 where: SL- is the source level of emitted acoustic energy; DI- directivity index of the receiver; TL- transmission loss; NL- noise level. For an active system, there is an additional term, called target strength (TS), which describes the reflection of energy from the target. The target strength acts as a source level after reflection, and therefore includes any directional effects of reflection. The target strength is a function of the target size, surface material, shape, and orientation in the same way that radar cross-section varies. Equation 3 also shows that there is a two-way transmission loss for the active system. SNRactive = SL - 2TL + TS - NL + DI Eqn. 3 Although these terms look similar in active and passive systems the values for each term will generally be quite different. 2 Simple Real-Time Sonar with the DSP56824 DSP56824 General System Architecture 2 Proposed Sonar System Description This section introduces the proposed sonar implementation using the DSP56824 DSP56824 processor. Also presented is a general block diagram of the system, the hardware and functional description of its components, and the specialized DSP algorithms. 2.1 General System Architecture The application presented uses the DSP65824 DSP65824 to implementation an active sonar system. Figure 1 illustrates the general system architecture of our example. Figure 1. Sonar System Architecture The primary feature of this active sonar system is that both the acoustic wave source and the receptor are assembled together on a rotating platform. The two transducers were selected as a pair of ultrasonic emitter and receiver with similar electro-acoustic properties. They define the sonar working frequency for the acoustic signals as: fSonar = 40 kHz. The emitter/receiver platform is driven by a stepper motor, controlled from the DSP board. The electronic amplifier and driver circuits for the ultrasound transducers, as well as the analog-to-digital conversion logic for properly receiving of the incoming echo signal are additional features of this system. They can be assembled on a separate circuit board, or on the rotating platform, in close proximity to the transducers. The first option is preferred because it reduces the total weight of the platform, thus requiring a stepper motor with relatively low parameters (for example, size, power consumption, and weight). We used the DSP56824-based Evaluation Module (EVM) as the core unit of the sonar system. It is directly connected to the transducer interface logic through Port B, configured as the General Purpose I/O port (GPIO). It is also connected to the host computer using the standard PC serial interface. The DSP performs all the sonar-specific data processing operations (for example, emitted-wave samples generation, received signal filtering, detection of the emitted pattern in the received data buffer, and target distance calculation), as well as the data communication routines for both the host side and the transducer interface, the analog-to-digital converter, and the stepper motor control routines. The host computer provides the graphical user interface of the sonar. The user starts and stops the sonar operation and the GUI displays the detected targets in a graphical, intuitive manner, simulating the real-life radar and sonar scopes. Proposed Sonar System Description 3 When activated, the proposed sonar system performs the steps illustrated in the general data flow shown in Figure 2. Figure 2. General Sonar Operations Flow Figure 2 emphasizes the most important routines developed for the sonar system, as well as their relative position in time during the operation of the sonar. One of the most important characteristics of the sonar general data flow, evident in the illustration, is the parallelism of routine execution between the host side and the DSP side. Items denoted in Figure 2 as `' and `' are stable states of the data flow. When the execution on the DSP reaches the `' state, it waits asynchronously for an external event in order to go further-that is, the host computer signal is ready to receive results from the DSP. After receiving the signal, the DSP executes a series of routines ultimately reaching the distance calculation loop which corresponds to a 1.8 degree horizontal scan (two 0.9 degree step rotations of the stepper motor) from a total of 180 degrees-the sonar angular detection range. In the same manner, when the execution on the host side reaches the `' state, the computer sends a `wait for data' command to the DSP and loops indefinitely until one of the following conditions occur: the DSP sends results through the serial link, or the user stops the sonar operation from the graphical user interface. Detailed descriptions of the routines depicted in Figure 2 are provided in Section 3 and in Section 4 of this application note. 4 Simple Real-Time Sonar with the DSP56824 DSP56824 Transducer Interface Circuits 2.2 Transducer Interface Circuits Two ultrasound transducers, one for acoustic emission and the other for echo reception, and the corresponding signal conditioning circuits represent the analogue component of the sonar. We used a 400SR-400ST 400SR-400ST pair of capacitive transducers because of their good acoustic characteristics: 40 kHz ultrasound transducers, frequency tolerance of ± 1 kH z , good directivity, and small size. To accommodate the small emitting transducer impedance and to increase the signal gain, an operational amplifier-based interface logic was implemented, as presented in Figure 3. Figure 3. Emitter and Receiver Transducer Circuits This scheme obtains a theoretical voltage gain of +20, for the emitted signal. Filtering capacitors were provided to eliminate the noise on the circuit power lines. From the DSP Evaluation Module's GPIO Port, the 40 kHz generated rectangular signal is amplified and filtered through the emitting transducer interface circuits, resulting in a sine wave of the same frequency as the input of the transducer. For the echo signal reception and conditioning we implemented a similar signal amplification (this time with a theoretical voltage gain of +40) and impedance regulation circuit. Consecutively, the resulted output signal needs to be converted from analog to digital in order to be sent to the DSP for further processing. Because of the relatively high frequency of the ultrasound signal (40 kHz), the DSP56824EVM DSP56824EVM on-board audio codec (MC145483 MC145483 13-bit linear single-channel) is not appropriate for our sonar application. Instead, we developed a Burr-Brown sampling ADS774-based analog-to-digital scheme, able to work at 108 kSps (kilo-Samples per second). The ADS774 ADS774 is controlled by the DSP through two dedicated GPIO lines: one for starting the conversion cycles on the ADS and the other for pooling the conversion status to detect an `end of conversion' that acknowledges available data from ADS shown in Figure 4. From the total of 12 bits output of the converter, the DSP uses the 9 most significant bits as a supplementary noise-reduction measure. Proposed Sonar System Description 5 Figure 4. Analog-Digital Converter Circuit 2.3 Stepper Motor Control Both transducers, assembled on a small platform are driven by the stepper motor (see Figure 1 on page 3). The motor is controlled by the DSP through 2 dedicated GPIO lines interfaced by the control circuit illustrated in Figure 5. Figure 5. Stepper Motor Control Circuit The stepper motor rotates the transducers platform with a total angle of 180 degrees. left and right, with a two-step resolution; one step corresponds to 0.9 degrees. More details on commanding the stepper are provided in Section 3. 6 Simple Real-Time Sonar with the DSP56824 DSP56824 Program Definition and Initialization Phase 3 Sonar Implementation on the DSP56824 DSP56824 As shown in previous sections, all the sonar-specific algorithms are implemented on the DSP56824 DSP56824. The main program on the DSP follows the general steps presented in Figure 2 on page 4. Code Listing 1 presents the main program sequence of sonar implementation. First, the general data structures used by the main program and the subsequent routines are defined, and the DSP initialization is made. In the Section 3.1 we describe this initial phase of the program. The main program incorporates into an infinite loop all the routines developed for the target detection, distance calculation and communicates the results to the host. Code Listing 1. Sonar main program on DSP Defines_and_Init ; here are the general data structures defines ; and the Sonar initialization main jsr jsr jsr jsr jsr jsr move jsr move jsr jsr jmp Gen_Signal Read_ADC Moving_Average Seek_MAX Calc_Position Gen_Sincro angle,y1 Out_y1 distance,y1 Out_y1 rotate_motor main Generation of the emitted signal is the first step performed by the sonar program - the `Gen_Signal' routine. Next, the DSP commands the analog-to-digital converter to fill a 2048-word buffer with samples from the received echo signal. This is accomplished by the `Read_ADC' procedure. Actual calculation of the distance to a target is performed on the data buffer written during the `Read_ADC' step. First, the received signal is filtered using a Moving Average type of low-pass digital filter. Next, we look for the maximum value on the buffer. Its relative position will then be represented in millimeters and stored into the `distance' variable. The `Calc_Position' results in the angular coordinate of the target-the `angle' parameter. At this point, the DSP has a complete set of results to be sent to the host computer through the serial data link. It starts the synchronization procedure, `Gen_Sincro', which waits for the host to acknowledge it is ready to receive the results and at the same time ensures a correct data transaction on the serial interface. After the correct synchronization step the two target coordinates (`distance' and `angle') are sent to the host computer for display. Finally, the stepper motor is commanded for a 1.8 degree rotation of the transducer platform, and the main sonar program loops back to the next target detection iteration. Extensive implementation details of all the above routines will be given in the following sub-sections. 3.1 Program Definition and Initialization Phase All the general program parameters and variables are defined in this section: peripheral and core DSP registers used by the sonar program, temporary values, sonar functional parameters, constants, and so on. Sonar Implementation on the DSP56824 DSP56824 7 Code Listing 2. General Program Defines ; Program defines define ipr 'x:$fffb' ; Interrupt priority register define bcr 'x:$fff9' ; Bus control register define pcr1 'x:$fff3' ; PLL control register 1 define pcr0 'x:$fff2' ; PLL control register 0 define pbd 'x:$ffec' ; Port B data register define pbddr 'x:$ffeb' ; Port B data direction register define pbint 'x:$ffea' ; Port B Interrupt register define pcd 'x:$ffef' ; Port C data register define pcddr 'x:$ffee' ; Port C data direction register define pcc 'x:$ffed' ; Port C control register define spcr1 'x:$ffe6' ; spi 1 control register define spsr1 'x:$ffe5' ; spi 1 status register define spdr1 'x:$ffe4' ; spi 1 data register ; Variables used in program to retain temporary values, ; results and to perform software loops. define go 'x:$0' define loopc1 'x:$1' define loopc2 'x:$2' define save_r0 'x:$3' define save_m 'x:$4' define leftcount 'x:$5' define rightcount 'x:$6' define angle 'x:$7' define distance 'x:$8' ; Program equates SPIF equ $0080 ; SPIO Interrupt complete flag dummy equ $0000 ; dummy value to write pc7 equ $0080 ; port C bit 7 WRITEUP equ $0080 ; write upper instruction byte READ equ $0000 ; read command PLL_DIV equ 19 ; PLL Feedback Multiplier dim equ 2048 ; receive buffer dimension dim_mot_buf equ 4 ; the dimension of command motor ; buffer words no_detection equ 0 ; constant used to indicate that ; no object is detected noise_level equ 6 ; maximum noise level av_points equ 20 ; the number of coefficients for ; moving average filter no_wave equ 40 ; the number of periods for the ; emitted signal In the next sequence of code, we define a circular buffer for the stepper motor command. In order to perform a 0.9 degrees one-step rotation, the stepper we used needs a two-bit input code explained in Table 1. Table 1. Stepper Motor Command Sequence GPIO Pin Numbers: 14,15 One Step Left Rotation One Step Right Rotation 11 01 00 10 8 Simple Real-Time Sonar with the DSP56824 DSP56824 Program Definition and Initialization Phase Depending on the current configuration of the two command lines (GPIO Pin 14 and 15), the next step rotation will be commanded by following the corresponding direction shown in Table 1 (see also Figure 5 on page 6). For example, if the current command lines configuration is `01' and we need to perform a one step right rotation of the stepper motor, the next sequence on the GPIO lines 14, 15 needs to be: `00'. The motor command data structure implements a circular buffer, which will be scanned upwards or downwards, depending on the rotation type needed. The command is shown in the Code Listing 3. Code Listing 3. Stepper Motor Command Data Structure org x:$1000 ; this circular buffer retains the command words for the motor buffer m,dim_mot_buf pas dc $0000 dc $8000 dc $c000 dc $4000 endbuf Further on, the DSP stack initialization, along with the PLL, GPIO, and interrupts setup is made: Sonar Implementation on the DSP56824 DSP56824 9 Code Listing 4. Main Program Initialization Sequence org ; receive buffer buffer m_buf ds endbuf x:$2000 m,dim dim org jmp org jsr org p:$0000 Start p:$0014 Irqa_ISR p:$0100 move #$40,sp move #$0000,bcr move #(PLL_DIV-1)ProcessMessages(); outportb(0x3f8,b); } unsigned char readByte() { while (!(inportb(0x3fd)&0x01) Application->ProcessMessages(); return inportb(0x3f8); } 20 Simple Real-Time Sonar with the DSP56824 DSP56824 Graphical User Interface Implementation After the synchronization between host computer and DSP is established, a set of detection results is automatically sent to PC. The results are then processed by the graphical user interface on the host for display, and, at the same time, the DSP starts a new detection iteration for the next angular step (1.8 degrees). A new synchronization phase will begin after the host displays the current results and the DSP finishes its detection iteration. 4.2 Graphical User Interface Implementation The sonar GUI was designed to run under Windows 9x/NT platforms on a recommended graphical resolution of 800 × 600 pixels. Users control the general sonar behavior-'start', `stop', and `exit'-using the corresponding buttons provided by the interface. Sonar activity and detection results are displayed in real-time using three modes: 1. Graphical display window-depicts the detected targets at relative coordinates corresponding to their real position to the sonar transducers. This is the most intuitive mode, similar to classical radar and sonar scopes. 2. Numerical mode-displays the exact polar coordinates of the currently displayed target in two separate boxes: one for the target range (in millimeters) and one for the angular position (in degrees). 3. Progress bar display-presents the distance to the currently displayed target in an intuitive manner by showing a scale of the sonar minimum and maximum detection range. Figure 6 presents a screen capture of the sonar graphical user interface during a real-time example. Sonar Implementation on the Host 21 Figure 6. Sonar Graphical User Interface 5 Conclusions A simple real-time sonar implementation with the DSP56824 DSP56824 is presented in this paper. We described the general characteristics of a sonar system, emphasizing the advantages of introducing a specialized DSP as the core of the system. Additionally, we provided details of the general architecture of the proposed sonar system and the hardware components. The implementation of the sonar-specific digital signal processing algorithms on the DSP56824 DSP56824 is extensively explained in the Section 3, along with the serial communication routines developed for data transactions with a host computer. A classical sonar scope-like graphical user interface was also designed on the PC, for visualizing the results as intuitively as possible. The proposed sonar system was tested using targets of different sizes, shapes, and surfaces. Theoretical performance characteristics are based on two main parameters. 22 Simple Real-Time Sonar with the DSP56824 DSP56824 Graphical User Interface Implementation First, the maximum sonar detection range is a parameter of sound velocity (application-independent variable) and of the data buffer length and echo sampling rate, the two application-dependent variables: v sound L buff D max = - -F sampling 2 Eqn. 4 where: Lbuff = 2048 words- is the received data buffer length used; Fsampling = 108 kHz- represents the sampling frequency used for echo receiving; vsound = 340 m/sec- is the velocity of acoustic waves in air at normal temperature. As a result, the theoretical maximum detection range of the implemented sonar is: Dmax = 3223.7 mm Eqn. 5 The value in Equation 5, resulting from Equation 4, is a theoretical one, because we ignored the energy loss of acoustic waves during their propagation in the air, from source to the target and backwards, and also because of the reflection loss on the target. These parameters are dependent on local air pressure and temperature, as well as the size, surface, and shape of a particular target (see discussion in Section 1.1). The acoustic noise present in the environment as well as the inducted electrical noise at the reception side were also ignored. Our practical results demonstrate the importance of the parameters ignored in the equations above. At the maximum theoretical limit of the distance (about 3.2 m) and using a large surface (1000 × 500 mm rectangle) the system was able to detect the target, but the results were highly unstable (at the limit of error threshold). The second main sonar parameter is the so-called detection resolution-the uncertainty of distance calculation. For the proposed sonar implementation, the detection resolution is given by: vsound = - = 3.148 mm F sampling Eqn. 6 Again, practical evaluations of this parameter issued higher results, for the same reasons explained above. Further improvements of the sonar system will start by reducing the noise in the system as much as possible. Transducer interface circuits will be better designed, the amplification schemes optimized (especially on the receiver side) with special care on maximizing the Signal-to-Noise Ratio (SNR). Optimization of the sonar-specific algorithms implementation on the DSP is another potential performance enhancement of the system. We intend to develop and test a sonar detection algorithm based on the cross-correlation of digital signals. For increasing sonar's detection range, a more powerful ultrasound transducer pair can be used along with higher gain amplifier circuits, as well as a CODEC with higher sampling rate and conversion resolution. A straightforward application of the proposed sonar system is an autonomously, self-guided mini-robot, able to move from a predefined start point towards a destination, avoiding possible obstacles encountered on its route. Other possible applications include intelligent devices like autonomous vacuum-cleaners, object searchers operating in difficult environments (gas-poisoned or no-visibility areas), self-guided devices, car-parking systems, etc. A simple sonar system can also serve as a very versatile and intuitive support for teaching and experimenting with digital signal processing algorithms and their implementation on DSPs. Conclusions 23 6 References [1] DSP56800 DSP56800 16-Bit DSP Family Manual (order number DSP56800FM/D DSP56800FM/D). [2] DSP56824 DSP56824 16-Bit DSP User's Manual (order number DSP56824UM/D DSP56824UM/D). [3] DSP56824 DSP56824 Evaluation Module Hardware Reference Manual (order number DSP56824EVMUM/D DSP56824EVMUM/D). [4] Motorola DSP Assembler Reference Manual, Motorola, Inc., 1996. [5] 3D Tracking Sonars with High Accuracy of Range Measurements for Autonomous Mobile Robot Navigation, A. M. Sabatini, EUSIPCO'96, European Signal Processing Conference, Trieste, Italy, 1996. [6] Wideband Inverse Filtering to Improve Active Sonar Detection in Background Reverberation, P. Delachartre et. al., EUSIPCO'96, European Signal Processing Conference, Trieste, Italy, 1996. [7] RADAR Signal Extraction Using Correlation, F. Lancon et. al., EUSIPCO'96, European Signal Processing Conference, Trieste, Italy, 1996. 24 Simple Real-Time Sonar with the DSP56824 DSP56824