programs for interactive control of a frequency-modulated ... in Python, it provides graphical user interface allowing simple and convenient user interaction ... This board has an embedded ... Microcontroller Software Interface Standard (CMSIS).
Development of Embedded and User-side Software for Interactive Setup of a Frequency-Modulated Continuous Wave Ground Penetrating Radar Dedicated to Educational Purposes Margarita Chizh1, Andrea Pietrelli2, Vincenzo Ferrara2, and Andrey Zhuravlev1 1
Remote Sensing Laboratory, Bauman Moscow State Technical University, 5, 2nd Baumanskaya, 105005, Moscow, Russia
2
Department of Information Engineering, Electronics and Telecommunications (DIET), Sapienza University of Rome, 18, Via Eudossiana, 00184, Rome, Italy
Abstract This paper describes the software and firmware programs for interactive control of a frequency-modulated continuous-wave ground-penetrating radar (GPR). The presented radar system is being developed at Sapienza University of Rome in the framework of the project carried out by European Cooperation in Science and Technology (COST) Action TU1208. The research is focused on developing an affordable GPR and introducing it into the educational process. At the current stage of the project a GPR prototype was implemented from off-the-shelf components, it combines cheapness with fine operating characteristics and allows studying different signal modulation patterns. The developed software for the GPR prototype proper functioning was written in Python, it provides graphical user interface allowing simple and convenient user interaction with the system. Moreover, a complementing firmware program was developed to realize control functionalities such as selecting frequency range, period and waveform of the transmitted signal. Index Terms — Ground penetrating radar, engineering education, radar system design, radar interactive control, radar graphical user interface.
I. INTRODUCTION Creating an affordable ground-penetrating radar (GPR) and introducing it into the educational process will allow engineering students to learn this effective non-invasive and non-destructive technique. For this purpose, a frequencymodulated continuous-wave (FMCW) GPR is being developed in the framework of the project carried out by European Cooperation in Science and Technology (COST) Action TU1208. Under this project, a radar system composed of a modulator, radio frequency (RF) chain and video amplifier was designed and implemented at Sapienza University of Rome [1]. The inspiration for this project was the radar course arranged by Lincoln Laboratory at Massachusetts Institute of Technology (MIT) [2], during which students attended lectures on the fundamentals of radar and, divided in groups of three people, build their radars from the provided kits. Such radar course enhances the overall technical literacy of students, enables them to develop their own radar using minimum prerequisite knowledge of the radar theory and encourages independent research. At the current stage of the project the radar prototype on the basis of which students’
kits will be made is assembled and tested, user-friendly and free development environments and off-the-shelf affordable components are selected. An embedded and user-side software including graphical interface is developed and described in the rest of this paper. II. RADAR SYSTEM DESIGN AND FIRMWARE FMCW radar architecture was used for designing the system; it is composed of modular sections, which allows replacing the components and implementing alternative configurations and enables future update such as, for example, UWB solution. The block diagram of the radar is shown in Fig. 1, a photo of our basic radar system prototype is given in Fig. 2. The photo shows components and device that implement a GPR prototype of more reduced bandwidth than the new version described in this article. To pilot components of the radar system, an mbed LPC1768 microcontroller (MCU) board, with high performance ARM Cortex-M3 core, was selected. This board has an embedded digital-to-analog converter (DAC) that provides up to 3.3 V, which is used to tune a voltage-controlled oscillator (VCO). As the VCO the ZX95-2700A+ device with 1.3-2.7 GHz operating frequency band was used, for implementing our new version of the radar system prototype. To provide tuning voltage up to 25 V and utilize the whole frequency range of the VCO a low-frequency amplifier, based on LT1077 micropower precision operational amplifier by Linear Technology, was inserted between the DAC and the VCO input. RF chain of the system includes the VCO, a VAT-3+ SubMiniature version A (SMA) attenuator, two ZX60P105LN+ as low-noise amplifiers, ZAPD-2-272-S+ as a splitter, ZX05-43MH-S+ as a mixer. The video amplifier utilizes a quad precision operational amplifier, the Analog Devices OP467, to implement video gain and a 15 kHz antialiasing filter. In the receiver chain the signal is digitized using an audio input port of a personal computer (PC). To create the synchronization pulse one of the general-purpose input/output (GPIO) pins of the mbed board is used. On the PC acquired data (the received signal and the synchronization pulse) is recorded as .wav files and visualized.
means that the VCO frequency should change in time with a defined period T in the selected range f min ÷ f max corresponding to the DAC tuning voltage of Vmin ÷ Vmax . It can be seen from VCO ZX95-2700A+ documentation that dependence of the VCO output frequency on the tuning voltage is nonlinear, Fig. 3. Fig. 1.
General block diagram of the FMCW radar.
Fig. 3. Dependence of the VCO output frequency on the tuning voltage.
Fig. 2.
Photo of our basic radar system prototype.
The initial version of the project for controlling the mbed LPC1768 prototyping board was written in C language in the integrated development environment (IDE) CooCox [1]. In this first stage of the project, drivers to use several interfaces for data transmission to a PC and generation of a triangular wave were implemented. However, it did not allow interactive control of the MCU, was based on Cortex Microcontroller Software Interface Standard (CMSIS) package, and as CMSIS included only basic functions, the project had complex structure. Changing the radar signal parameters implied altering the firmware code each time, which would be inconvenient for the students’ radar kit. Considering all this, the firmware was rewritten with the help of ARM mbed OS [3] which is an open-source embedded operating system that includes CMSIS as a low level component and provides higher level programming interface. For communication between the user’s host PC and the peripheral radar system, Universal Serial Bus (USB) was selected, to establish the serial connection mbed MCU was configured as a USB Virtual Serial Port with default connection settings of 9600 baud, 8 bits, 1 stop bit, no parity data packing. The correct communication between the LPC1768 mbed-board and the PC was ensured by a test program in C++ language compiled on-line on the official mbed website [3], allowing downloading firmware binary file to flash the mbed MCU. On the PC-side at first an opensource terminal program for engineering and debugging RealTerm [4] was used to form the data package, and then it was replaced by a program in the Python language. The next step was to obtain a signal with a desired waveform: either triangular, rectangular or saw-tooth, which
For simplicity at first a linear dependency was considered. From the VCO ZX95-2700A+ documentation the coefficient of linear dependency of the voltage on the output frequency: Vctrl _ min − Vctrl _ max ( f min − f max ) was calculated. At the normal temperature of 25°C for Vctrl _ min = 0 V the output f min = 1216.7 MHz, for Vctrl _ max = 25 V – is f max = 2902.5 MHz . Using these parameters the required control voltage Vctrl for each selected frequency f sel can be calculated:
Vctrl ( f sel ) =
Vctrl _ min − Vctrl _ max f min − f max
( f sel − f min ) + Vctrl _ min .
(1)
The mbed’s LPC1768 chip has a 10-bit DAC. For each digital value input to the DAC, there is a corresponding analog output value given by V = ( D 2n ) (Vmax − Vmin ) , where Vmin , Vmax are maximum and minimum output voltages, D is the digital input, n = 10 for the 10-bit DAC, 210 = 1024 . The step size, or resolution, is therefore 3.3/1024, i.e. 3.2mV per bit [5]. Mbed OS provides functions for various pins and interfaces configurations. Thus, it provides AnalogOut function to utilize the embedded DAC. AnalogOut function, by default, takes as an analog object a floating point number between 0.0 and 1.0 and outputs it to the single LPC1768 analog output pin – pin 18. The actual output voltage on pin 18 is between 0V and 3.3V, so the floating point number that is output as voltage is scaled by a factor of 3.3. On the PC-side in the Python language a function was created for calculating the tuning voltage values for the selected waveform, bounding frequencies f min , f max in range 1216.7–2902.5 MHz and the signal period T = 10–100 ms. The calculated tuning voltage values and the selected signal
period value were packed into a string in asci format and transferred to the mbed MCU through the Serial connection with the help of another realized data packing and transferring function. On the mbed-side a universal function was created to receive and parse data from the PC. It was decided to use one of the 26 available on the mbed board GPIO pins for generating a square wave with which the measured radar signal would be synchronized. For implementing the synchronizing signal DigitalOut function provided by Mbed OS was used, which sets the state of the output pin (pin 25 in this case) and reads back the current output state. To form a regular signal the DAC values should be updated at regular time intervals, which is usually accomplished by using the MCU clock and interrupt routines. In this project, two functions for triggering the signal were tested, wait and Ticker, the latter is used to setup a recurring interrupt to repeatedly call a function at a specified rate. Testing these two functions at different period values of the signal with the help of a Tektronix oscilloscope showed that Ticker provides time resolution of tens of microseconds, while wait – only of a hundred microseconds. For Ticker at 10 us period the signal is stable, the measured period standard deviation is less than 200 picosecond. Therefore, the obtained square wave on the GPIO has a high time resolution of 10 us, fully meeting the specified requirement of 100 us, and can be applied for synchronization in the radar system. The final firmware project is organized as a main cycle with interrupts. In the main cycle the program waits for data transmission initialized from the GUI on the user’s PC, it parses the data package into the DAC buffer values and the signal period value according to the predefined format. After the parsing, the Ticker interrupt routine is called with the read parameters. During the period T every T/N microseconds Ticker updates the DAC value according to the DAC buffer, where N is the buffer size. After T microseconds, the cycle counter is restarted and a new period of the radar signal is transmitted. The project was designed in the way that the firmware program does not depend on the radar signal parameters chosen by the user, it follows the same instructions and receives data in universal format for each radar signal range and waveform defined in the user software. Such design of the project encourages its further development, for example, a modification of the RF-chain part of the system will require making changes only in the software, implemented in Python, while keeping the firmware program unchanged. III. GRAPHICAL USER INTERFACE FOR THE INTERACTIVE CONTROL OF THE RADAR SYSTEM
For developing a graphical user interface (GUI) the Python programming language was chosen, because it allows using various open-source libraries and provides simple, powerful and flexible functions. For the GUI creation several popular libraries were examined, Tkinter [6] package was selected for fast layouts implementation. The developed GUI was aimed at providing interactive control of the radar
system, specifically enabling user to setup the frequency range of the transmitted signal, select its period and change the waveform. These control options were realized in the form of four sliders, moving the handlers of which the user can choose the desired parameters values. The main window of the designed GUI is shown in Fig. 4.
Fig. 4. The main window of the developed GUI with the default sliders positions.
After the user specifies the values, he or she should press the Confirmation button. In the developed GUI program the change of the button’s state evokes a function which reads the sliders values, uses them in data buffer calculations, packs the data and sends them to the mbed MCU. The function also performs a check whether the initial frequency of the signal set with the slider is lower than the final one, in case of violating this condition, a warning appears. The Stop button at the GUI panel stops the radar signal transmission. The developed software performs all the calculations on the user side, which increases the speed of radar data generation in comparison to the calculations on the side of mbed MCU. This program provides functions to compute the buffer of the DAC voltage values required to obtain the desired waveform at the VCO output and to pack the buffer into binary format and transmit it to mbed MCU through the serial connection. All new control functionalities for the GPR prototype were tested with the help of the oscilloscope: three types of the signal waveform were successfully realized, the synchronizing square signal matches the DAC output signal with high precision, and the period of the signal T can be interactively changed. IV. VCO VOLTAGE PREDISTORTION IMPLEMENTATION A strong feature of the developed software program is the consideration of nonlinear dependence of the VCO output frequency on the tuning voltage shown in Fig. 3. The Python program on the user side provides functions for the DAC buffer calculation required for obtaining the desired waveform at the VCO output. In these calculations the created predistortion function was used which maps the desired frequencies to the tuning voltage values performing linear interpolation of the actual coefficients specified in the VCO ZX95-2700A+ documentation. It should also be mentioned that DAC voltage values are scaled by a factor of 3.3/25.0 to consider the effect of the voltage amplifier
switched between the DAC and VCO to enable generating the full range of VCO frequencies. Fig. 5 presents one 20 ms-long period of the three computer-simulated waveforms at the VCO output (blue) and the corresponding calculated DAC voltage values (red).
Rectangular waveform, T = 20 ms
Triangular waveform, T = 20 ms
Sawtooth waveform, T = 20 ms Rectangular waveform, T = 20 ms
Sawtooth waveform, T = 20 ms Fig. 6. Oscillograms of the predistorted values of the DAC voltages corresponding to the desired VCO frequency values.
Comparison of Fig. 5 and Fig. 6 shows that the results of the voltage measurements are in good agreement with the computer simulation.
Fig. 5. Computer-calculated predistorted values of the DAC voltages corresponding to the desired VCO frequency values.
The measured oscillograms showing the real DAC output voltage corresponding to the VCO frequency values specified by the user with the help of the developed GUI in range 1216.7–2902.5 MHz are given in Fig. 6. Channel 1 – yellow – Analog output of the DAC Channel 2 – blue – Synchronizing square wave on GPIO 25 Triangular waveform, T = 20 ms
V. CONCLUSIONS The developed software and firmware programs allow interactive control of the GPR functioning, the implemented GUI program is user-friendly and will facilitate students’ interaction with the radar system. Future work will include designing antennas and proper radar kit form-factor. Thus, for example, metal cans could be used as open-ended circular waveguide antennas to keep the radar system price low. Sizes of the cans, position and length of the emitting probes should be selected considering the waveguide cutoff frequency to optimize the antennas functioning in the operating frequency range of the radar. It is also planned to complement the software program with a radar data processing algorithm. ACKNOWLEDGEMENT Authors would like to thank COST for funding COST Action TU1208 and this project. This work was also supported by the Russian Science Foundation, Project #1519-30012.
REFERENCES [1] V. Ferrara, F. Troiani, F. Frezza, F. Mangini, L. Pajewski, P. Simeoni, N. Tedeschi, Design and Realizationon of a cheap Ground Penetrating Radar prototype @ 2.45 GHz, Proceedings of the 10th European Conference on Antennas and Propagation (EuCAP 2016), Davos, Switzerland, 10-15 April 2016, pp. 1-4, doi: 10.1109/EuCAP.2016.7482008 [2] Gregory Charvat, Jonathan Williams, Alan Fenn, Steve Kogon, and Jeffrey Herd. RES.LL-003 Build a Small Radar System Capable of Sensing Range, Doppler, and Synthetic Aperture Radar Imaging. January IAP 2011. Massachusetts Institute of Technology: MIT OpenCourseWare, https://ocw.mit.edu. License: Creative Commons BY-NC-SA. [3] Mbed OS: https://www.mbed.com/en/development/mbed-os/ [4] RealTerm serial terminal program for engineering: https://sourceforge.net/projects/realterm/ [5] Mbed DAC course-notes: https://developer.mbed.org/media/uploads/robt/mbed_course_n otes_-_analog_input_and_output.pdf [6] Tkinter package: https://docs.python.org/2/library/tkinter.html