Design and implementation of control software for radar antenna performance index test system

According to the actual requirements of radar antenna performance testing, focusing on the design of the instrument control software of the test system, in this paper, the functional requirement of the instrument control software of the system is analyzed, the basic framework of the software design is put forward, and the design ideas and implementation methods of the instrument and equipment management as well as the specific design methods of the instrument and equipment control are given. Practical applications have shown that the control software has advantages such as an intuitive interface, convenient operation, and good interactivity. Combined with system hardware, it can achieve fast and accurate measurement of radar antenna performance and has high practical value.


Introduction
The radar testing system is mainly used for testing the technical performance indicators and antiinterference performance of radar systems and has been widely used in various aspects such as radar development, production, and use.To improve the measurement accuracy and efficiency of radar testing systems, scholars in relevant fields have conducted in-depth research on the design of radar testing systems.For example, Gu and Liu analyzed the construction method of injection-type radar testing systems and conducted in-depth research on key technologies in response to the testing requirements of radar systems [1] .Zhou et al. proposed a new radar testing method based on simulation technology, which constructs a static combat electromagnetic environment and implements precise detection from terminal to terminal in the radar system [2] .Liu et al. proposed a design scheme for a Doppler navigation radar testing system based on semi-physical simulation, focusing on the hardware structure, software design, and semi-physical simulation system structure based on an echo simulator [3]   .The above research results provide technical support for the construction of a radar antenna performance index testing system from a theoretical perspective.
The radar antenna performance testing system, abbreviated as the antenna performance testing system, is an automatic testing system designed specifically for rapid testing of radar antenna lobe width, sidelobe level, zero-depth, and other indexes [4][5][6][7][8] .A typical antenna performance testing system consists of two parts: hardware and software, as shown in Figure 1.Among them, the system hardware mainly consists of programmable measurement instruments, communication equipment, testing antennas, measurement control computers, and other components.Program-controlled measuring instruments mainly include the RF signal source, spectrum analyzer, digital storage oscilloscope, etc.The RF signal source is mainly used to generate test signals, the spectrum analyzer is mainly used to measure the antenna pattern of the received signal, and the oscilloscope is used to collect antenna azimuth data.The system software mainly includes instrument control software and data analysis software.Among them, the instrument control software mainly realizes the program control of RF signal source, spectrum analyzer, digital storage oscilloscope, and other measuring instruments, which is the key to system software design.Focusing on the design and implementation of the instrument control software of the antenna test system, in this paper, the Functional requirement of the instrument control software of the system is first analyzed, then the basic framework of the design of the instrument program control software on this basis is put forward, and finally, the specific program of the software design from the two aspects of instrument management and instrument control is given.

Functional requirement of instrument control software
The software of the antenna performance testing system mainly includes instrument control software and data analysis software.Among them, the instrument control software mainly realizes the program control of RF signal source, spectrum analyzer, digital storage oscilloscope, and other measuring instruments.The data analysis software mainly analyzes the data collected by measuring instruments, generates the curve of the tested radar antenna pattern, and automatically generates an "antenna performance test report" based on the antenna performance test results and technical index requirements.This paper focuses on the design and implementation of instrument control software, which mainly includes two parts: instrument and equipment management and instrument and equipment control.The specific functional requirement is as follows: (1) Instrument and equipment management function: for commonly used electronic measuring instruments with typical communication interfaces such as serial port (RS232), GPIB, LAN, etc., the programmable computer can establish a test connection with them, automatically identify the device identity (manufacturer, instrument model, etc.), display the communication address, port number, and other status information of the instrument and equipment, and achieve management such as adding, deleting, and online status monitoring of the instrument and equipment.
(2) Instrument and equipment control function: first, the instrument parameter programming setting function.For RF signal sources, it is required to achieve programmable settings of signal frequency, output power, and other parameters.For the spectrum analyzer, it is required to be able to realize programmed settings of IF frequency, bandwidth, reference level, scanning time, and other parameters.For digital storage oscilloscopes, it is required to be able to achieve programmable settings of time sensitivity, vertical sensitivity, trigger source, and trigger electrical parameters.The second is the storage and display function of instrument data.For oscilloscopes, it is required to be able to read the signal waveform displayed by the instrument in real-time, store the waveform data on a programmable computer, and display it at the same time.For the spectrum analyzer, it is required to read the signal spectrum displayed by the instrument in real time, store the spectrum data in the programmable computer, and display it at the same time.

The basic architecture of instrument control software
To improve universality and portability, the system software adopts a virtual instrument software architecture, designed according to a three-layer structure of hardware layer, driver layer, and application layer [9][10][11] .This makes the testing system driver and hardware transparent and also makes the complex underlying bus control protocols and communication protocols more open.The system software design can be completed through simple secondary development based on the driver provided by the RF instrument.The basic architecture of the software system is shown in Figure 2. In the figure, the system software consists of three parts: hardware layer, driver layer, and application layer.
(1) Hardware layer.The spectrum analyzer, RF signal source, digital storage oscilloscope, and other measuring instruments in the system hardware communicate with the control computer remotely through the serial port (RS232), GPIB, LAN, and other typical communication protocols, to realize the remote control of the measuring equipment by the system software.
(2) Driver layer.It mainly includes a serial port to USB, GPIB to USB, and other communication interface drivers, as well as an RF signal source, spectrum analyzer, digital storage oscilloscope, and other measurement instrument drivers.The control computer controls the corresponding measuring equipment through driver layer-related programs.
(3) Application layer.According to the functional definition in software design, the application layer mainly includes two functional modules: instrument equipment management and instrument equipment control.Among them, the instrument and equipment management function module mainly realizes the online addition and deletion of instruments, the selection of serial port, GPIB, LAN, and other communication methods, the setting of GPIB address, IP address, and other communication addresses, and the setting of communication ports, as well as the display of the status information of measuring instruments, the communication between the control computer and measuring instruments (spectrum analyzer, RF signal source, oscilloscope, etc.), and the identification of measuring instruments.The instrument equipment control function module mainly realizes the setting of parameters such as measuring instrument signal frequency, output power, and reference level, as well as the reading and display of waveform data or spectrum data.Specifically, the parameter settings of the Spectrum analyzer mainly include center frequency, frequency span, starting frequency, ending frequency, amplitude reference level, scanning time, scanning mode, etc.The parameter settings of RF signal sources mainly include frequency, power, modulation switch, radio frequency switch, etc.The parameter settings of the oscilloscope mainly include horizontal sensitivity (time sensitivity), vertical sensitivity, trigger source, trigger electricity, etc.

Implementation of instrument and equipment management module
The design and implementation of control software will be discussed from two aspects: instrument equipment management and instrument equipment control.Among them, the instruments and equipment include a signal source, spectrum analyzer, oscilloscope, etc, which is under control.

Functional requirement of instrument control software
The instrument equipment management module mainly implements functions such as online addition and deletion of instruments.The instrument addition function mainly involves the selection of communication methods, IP settings, and port settings, as well as the connection testing and display of status information for instrument equipment communication status.The instrument and equipment management interface designed based on the above functional definition is shown in Figure 3.In the figure, on the left is the "Tree structure of instrument and equipment resource management", which mainly implements the functions of adding and deleting instruments and equipment.On the right is the "Instrument Equipment Communication Parameter Settings Bar", which mainly implements functions such as communication mode selection, communication parameter settings, connection status testing, and status information display.
In the figure, when adding instruments in the instrument equipment management module, corresponding communication methods can be selected based on the specific communication interface of the measuring instrument.The communication interfaces that can be selected include a serial port (RS232), GPIB, LAN, and other methods.When serial communication mode is selected, communication parameter settings include port number (COM1, COM2, COM3), Baud, etc.When selecting the GPIB communication method, the communication parameter settings specifically include the GPIB address, port number, etc.When selecting the LAN communication method, the communication parameter settings specifically include IP address, port number, etc.After selecting the communication mode and setting the communication parameters of the instrument, the connection test of the communication status can be carried out.The status information of the instrument equipment will be displayed in the "Status Information Bar".

Specific implementation
The core content of the instrument and equipment management module shown in Figure 3 mainly consists of two parts: one is the editing of the Tree structure of instruments and equipment.The second is the connection and status testing between computers and instrument equipment.The specific implementation of the above two functions will be discussed below.

Editing Tree structure of instruments and equipment.
TreeView control in VisualStudio is mainly used for adding and deleting instruments and equipment.The Tree structure node of the number of instruments and equipment can be added through the Add method of the Nodes attribute of the control, and the Tree structure node of the number of instruments and equipment can be deleted through the Remove method of the Nodes attribute of the control.The Tree structure of instruments and equipment can be classified according to the communication interface, and the instruments and equipment linked online by the system or linked can be displayed according to the serial port (RS-232), GPIB, LAN, VXI, and other communication interfaces.

Connection and status testing between computers and instrument equipment. SCPI (Standard
Commands for Programmable Instruments) is a standardized instrument programming language developed to solve programming problems for programmable instruments.It specifies the message structure and content between the PC and the instrument on the information exchange layer, suitable for the development of automatic measurement systems.At the same time, the Virtual Instrument Software Architecture (VISA) interface library provides rich functional instructions to establish the exchange of control instructions and test parameters between computers and instruments.The connection testing between the controller and instrument equipment can be achieved using VISA library functions and SCPI commands.The basic procedure of the VISA control instrument is shown in Figure 4. First, the "Ivi.Visa.Interop.dll" Dynamic-link library is added to the reference of the control software project file.Then, the VISA resource manager handle (commonly used function is viOpenDefaultRM()) is open, and the instrument handle (commonly used function is viOpenf()) is open, that is, instrument control instructions through the iPrintf() function is sent through the SCIP command to make the instrument act or query the instrument status.Alternatively, the information returned by the instrument can be received through the viScanf() function and stored.It reads data from the output queue of the instrument and formats the resulting data in a certain string, thus, achieving control functions such as querying instrument model, setting instrument status, controlling instrument operation, reading measurement data, and processing instrument events.

Write Command
Reading data from instrument cache For example, by sending the "*IDN?" command, the instrument model can be queried, as shown in the status information column in Figure 3.After executing the "Query Instrument Signal" command, the return string is "AGILENTTECHNOLOGIES, 54641A, MY42000845, A.02.20".The string contains "54641A", which suppresses the model of the connected digital storage oscilloscope.From this, it can be confirmed that the model of the instrument being operated is correct and subsequent control can be carried out.This command is usually used as an initialization detection command to determine whether the communication hardware connection is normal.If the "*RST" command is sent, the factory settings of the instrument equipment can be restored.On a multi-instrument control platform, different SCPI control command streams can be selected based on the returned instrument information.Finally, the VISIA resource manager is released to handle through the viClose() function.

Implementation of Instrument Equipment Control Module
The design and implementation of control software will be discussed from two aspects: instrument equipment management and instrument equipment control.Among them, instrument and equipment control specifically include signal source, spectrum analyzer, oscilloscope, etc.In the design of instrument control software, the RF signal source only involves the setting of signal frequency, output power, and other parameters, while the spectrum analyzer and oscilloscope involve not only the setting of instrument parameters but also the reading and display of waveform data or spectrum data.The above three instrument programmable designs have certain similarities.Here we choose the RF signal source to specifically discuss the realization of its control function.

Function Definition and Interface Design
The parameters involved in the control of RF signal sources mainly include signal frequency, output power, modulation method, modulation type, modulation parameters, modulation switch, and RF switch.The modulation methods include external modulation and internal modulation.The modulation types include amplitude modulation, frequency modulation, and pulse modulation.The selection of modulation parameters depends on the modulation method and modulation type.In the internal modulation mode, when selecting the amplitude modulation type, the modulation parameter options include amplitude modulation frequency (kHz), amplitude modulation depth (%), etc.When selecting a frequency modulation type, its modulation parameter options include modulation frequency offset (kHz), etc.When selecting a pulse modulation type, its modulation parameters include pulse width (ȝs), Pulse repetition frequency (kHz), etc.
The RF signal source control interface designed based on the above functional definition is shown in Figure 5. Through the interaction columns of signal frequency, output power, signal form, modulation method, modulation parameters, modulation switch, RF switch, etc. in the figure, the setting of RF signal source-related parameters can be achieved.For example, In Figure 5, the signal frequency is set to 870 MHz, the output power is -10 dBm, and the modulation method is pulse modulation.The repetition period of the pulse signal is 2.5 ms, and the pulse width is 200 ȝs.

The specific implementation of the program control function.
(1) The generation and verification of continuous wave signals: The following is an example of generating a continuous wave signal with a frequency of 30 MHz and a power of -10 dBm to illustrate the implementation of its specific program control function.The corresponding SCPI commands are as follows: ķ "FREQuency: CW30MHZ"//Set the signal waveform type to fixed-point frequency continuous wave and frequency to 30 Hz.
In software design, first, the VISA resource manager handle and instrument handle are open.Then, sending the SCIP commands from ķ to Ĺ above can generate a continuous wave signal with corresponding frequency and power.The generated continuous wave signal can be tested and verified in a time domain and frequency domain respectively through an oscilloscope and spectrum analyzer.The test results are shown in Figure 6. Figure 6(a) shows the oscilloscope test results, which show a continuous wave waveform and a signal frequency of 30.12 MHz. Figure 6(b) shows the measurement results of a spectrum analyzer.The signal frequency is 30 MHz and the signal power level is -11.68 dBm.The measured signal power is 1.68 dB lower than the set value of the RF signal source (10 dBm), mainly due to the insertion loss of the test cable.The signal form, signal frequency, and output power set are compared to meet the signal setting requirements.(Note: the signal frequency displayed by the oscilloscope is not completely consistent with the signal frequency measured by the Spectrum analyzer, with a difference of 0.12 MHz, which is mainly caused by the error of the signal frequency measured by the oscilloscope).(2) Generation and Verification of Pulse Modulation Signals: Next, we generate a pulse width of 200 ȝs.The pulse modulation signal with a pulse repetition period of 2.5 ms (corresponding to a pulse repetition frequency of 400 Hz), a frequency of 870 MHz, and a power level of -10 dBm is used as an example to illustrate the implementation of its specific program control function.The corresponding SCPI commands are as follows: ķ "FREQuency: CW 870 MHZ"//Set the signal waveform type to fixed-point frequency continuous wave and frequency to 870 MHz.
ĸ "POWER -10 DBM" //Set the power output of the signal to -10 dBm.

Conclusion
The radar antenna performance index testing system is an automatic testing system designed specifically for radar antenna pattern testing.It is mainly used to quickly measure radar antenna lobe width, sidelobe level, zero-depth, and other parameters in actual environments.This paper focuses on the design of the instrument control software of the system.The functional requirement of the software is analyzed, the basic framework of software design is put forward, the design ideas and implementation methods of instrument and equipment management, and the specific design methods of instrument and equipment control are given.Practical applications have shown that the control software has advantages such as an intuitive interface, convenient operation, and good interactivity.Combined with system hardware, it can achieve fast and accurate measurement of radar antenna performance index, which has high practical value and good promotion prospects.

Figure 3 .
Figure 3. Interface Design of Instrument and Equipment Management Module.

Figure 4 .
Figure 4. Basic Process of Instrument Control.

Figure 5 .
Figure 5. Basic Process of Instrument Control.

4. 2 .
The specific implementation of functional code 4.2.1.RF signal source SCPI command.The RF signal source is mainly controlled by SCPI program control commands, which can be used to set the signal frequency, output power, modulation method, and related modulation parameters of the RF signal source.
ĺ "OUTPut: Modulation: STATe 1" //Turn on the modulation switch.Ļ "PULM: STATe 1" //Turn on the pulse output switch.ļ "PULM: SOURCE 1" //Set the pulse input to internal modulation.Ľ "PULM: Internal: Period 2.5 ms" //Set the pulse repetition cycle.ľ "PULM: Internal: PWIDth 200 us" //Set the pulse width.During software design, first, the VISA resource manager handle and instrument handle are open.Then, sending the above ķ to ľ SCIP commands can generate the corresponding pulse modulation signal.The generated pulse modulation signal can be tested and verified in the time domain and frequency domain respectively through an oscilloscope and spectrum analyzer.The test results are shown in Figure 7.
Figure 7(a) shows the oscilloscope test results, which display a pulse-modulated signal with a pulse repetition frequency of 403.2 Hz and a pulse width of 200 ȝs.

Figure 7 .
Figure 7. Measurement Results of Pulse Modulation Signal.