Welcome: Hunan Intelligent Applications Tecgnology CO.,ltd.-HNIAT.com
Language: Chinese ∷  English

Smart test

Research on Antenna Real-time Measurement System Using Multithread Technology

The system software user interface can complete the input and setting of all measurement parameters and respond to user operations in a timely manner. In addition to this thread, create additional worker threads to achieve parallel work of other functions, improve the real-time performance of the system, and update and display the operation of the instrument in the user interface in real time The status and measurement progress of the system allow users to understand the status of the system. At the same time, the measurement data can be read and saved in real time, which is convenient for further processing and research in the later period.

  0 Preface

With the application and popularization of computer technology and modern electronic measurement technology in the field of instruments, especially the emergence of computer interfaces and corresponding standards for electronic measurement instruments, the communication between the computer and the instrument is simple and easy to obtain, and users can control and control the instrument through computer programs. Data reading and storage. The development of these technologies makes it possible to realize the antenna automatic measurement system.

In the past simple measurement system based on single thread, the response to user operations and the switching between multitasks needed to be completed by "interrupt processing", which greatly affected the real-time performance and work efficiency of the system, and the software entered data reading during the measurement process. The cyclic process with storage makes the user interface enter a "fake death" state, and it is impossible to control the measurement and understand the real-time progress of the system measurement. In order to make up for these shortcomings, it is necessary to achieve multi-task parallel work, and multi-threading technology avoids blocking, performs multiple tasks at the same time, reduces the interaction between the running process and the user interface, and takes advantage of the unique advantages of multi-processor performance. It satisfies this requirement well.

This paper designs a set of antenna real-time measurement system based on multi-threading technology. It provides a user interface with simple layout and complete functions. It can complete the input and setting of all measurement parameters and respond to user operations in a timely manner. It uses different threads to implement multiple tasks in parallel. Work, improve the real-time performance of the system, update the running status of the display instrument and the measurement progress of the system in the user interface in real time so that the user can understand the system status, and realize the real-time reading and storage of measurement data, which is convenient for further processing and research.

1 System overview

1.1 The working principle of the system

This measurement system uses the rotating antenna measurement method. The auxiliary antenna (source antenna) is connected to the vector network transmitting port, and the antenna to be tested is connected to the vector network receiving port. The plane to be measured of the antenna to be tested is parallel to the rotation plane of the turntable, and the vector network is used for measurement. The transmission parameters (S-parameters) of different angles can be used to make the antenna pattern at a specific frequency by using these data. In addition, the frequency sweep characteristic of the vector net provides another advantage for antenna measurement. In the measurement, the measurement data of multiple frequency points in a certain frequency band can be obtained. The antenna can be compared with the data of different frequency points and the antenna pattern. Comparison and analysis of frequency characteristics.

1.2 System composition

The test system consists of five parts: microwave anechoic chamber, computer (system software), vector network analyzer, program-controlled turntable and source antenna. Its layout is shown in Figure 1.



Figure 1 System composition

The main control computer and the vector network analyzer are interconnected through a LAN cable. Compared with the traditional GPIB bus mode, it breaks through the communication distance limitation and has the advantages of large data flow, flexible control, easy equipment sharing, and data sharing.

The vector network analyzer is used to transmit and receive the frequency sweep signal. The source antenna is connected to the power amplifier connected to the power transmitting end of the vector network analyzer through a coaxial line, and the antenna to be tested is connected to the power receiving port of the vector network analyzer through a coaxial line Connected.

The main control computer is connected with the turntable control box through the USB interface, and there is no need to consider the mechanical process of the turntable control. Only the communication with the control box needs to be programmed to control the turntable and obtain the state data of the turntable.

The vector network analyzer and the turntable control box are connected by a BNC connector coaxial cable, and the turntable control box sends the trigger pulse required for measurement to the vector network analyzer through this cable.

2 System software implementation

The compilation environment used for writing system software is MFC (Microsoft Foundation Classes) based on VC++, object-oriented programming (Object Oriented Programming, OOP) method, and SCPI (Standard) library based on VISA (Virtual Instrument Software Architec-ture) Commands for Programmable Instruments) instructions and Mint motion control language for programming to complete the communication between the computer and the vector network analyzer and turntable, control the instrument and read information and data.

2.1 Software hierarchical structure and information interaction

The system software is the control of the entire system, and its function is transparent to the user. For the user, as long as the correct measurement parameters are selected and input, the system can automatically complete the corresponding measurement function.

According to software requirements and functions, it can be divided into three-layer structure:

user interface part, data processing part and hardware interface part.

The information interaction between the various layers of the system software is shown in Figure 2.



Figure 2 Information interaction between various layers of the software

The user interface part, in response to user operations, transmits the hardware settings to the hardware interface part, sends the input data to the data processing part, and displays the data and status information sent by the data processing part to the user, so that the user can easily complete the measurement control And monitoring.

The data processing part, on the one hand, processes the data and status information passed by the hardware interface and converts them into the format required by the user for display and storage; on the other hand, it converts the data information set by the user into data instructions to the hardware interface part.

The hardware interface part completes the communication between the computer and the instrument. On the one hand, the program language such as instructions and data is converted into machine language that can be recognized by the instrument and sent to the instrument; on the other hand, the data and status information transmitted back by the instrument are converted into recognizable language. The data processed by programming is used by the data processing part.

2.2 Software task analysis

According to the working principle of the system, the system software needs to complete the following tasks:

(1) Establish communication between the computer and the turntable control box: establish a channel so that the computer can read the real-time operating status of the turntable, and can control the turntable at any time to change its operating status.

(2) Display of the operating status of the turntable: Display the movement speed and angle information of the turntable on the user interface and update it in real time.

(3) Setting of the operating parameters of the turntable: Set the movement speed, start and end positions and pulse output mode of the turntable according to user input, and control the start and stop of its movement.

(4) Establish the communication between the computer and the vector network analyzer: establish a channel so that the computer can read the vector network status and measurement data, and can control the vector network at any time to change its operating state.

(5) Initialization of the vector network analyzer and setting of measurement parameters: Use SCPI commands based on the VISA library to initialize the vector network to enter the measurement state, and complete the setting of the measurement parameters according to the user's input.

(6) Establishment and update of measurement data storage files: establish a file in the computer for storage of measurement data, and record the measurement process from the measurement data read by the vector network in a specific format in real time.

(7) Display of the system measurement progress: the software running node during the measurement process, when a measurement is completed during the measurement process, and after the measurement is completed, the corresponding prompt text is output to the user interface.

In the real-time measurement system, the computer is required to complete multiple tasks at the same time, and has high real-time requirements. Multithreading technology avoids blocking, can perform multiple tasks at the same time, and reduces the interaction between the running process and the user interface. And the unique advantages of multi-processor performance are well used to meet this requirement.

2.3 The realization of software multithreading

There are two types of threads in MFC, user interface threads and worker threads. The former has its own message queue and message loop, which are generally used to process user input independent of the execution of other threads, and respond to events and messages generated by users and the system; the latter does not have a message loop, and is usually used to perform background calculations and Maintenance tasks, such as lengthy calculation process, cyclic reading of data, etc.

Any MFC program has at least one thread, which is also the main thread of the program. Any number of threads can be spawned or terminated through the main thread, and the main thread will exist until the program terminates. Among them, the user interface thread is the main thread that the program starts by default, which mainly implements the operation of the software and responds to user operations and control. According to the software task analysis part, three worker threads are generated in the main thread. Through the communication between the computer and the measuring instrument, the background work such as the setting of instrument parameters and the real-time data collection and processing are completed.

The working order and survival time of each thread are shown in Figure 3.



Figure 3 Working sequence and survival time of each line layer

The specific work done by the three worker threads is as follows:

Turntable status thread: establish the communication between the computer and the turntable control box, continuously read the position information and speed information of the turntable and update it to the user interface, corresponding to the tasks (1) and (2) of the software task analysis part, as shown in the flow chart 4 shown.



Figure 4 Turntable status thread

Turntable start thread: first enter the waiting state, after the initialization of the vector network and the establishment of the data file, send instructions to the turntable control box to set the operating parameters of the turntable to start moving, corresponding to the task (3) of the software task analysis part, as shown in the flow chart 5 shown.



Figure 5 Turntable start thread flow chart

Vector network work thread: its function is to send instructions to the vector network for initial settings, make the vector network enter the trigger waiting state, and establish a data storage file, and continuously read the vector network measurement status during the measurement process, every time the measurement is completed, the measurement The data is read and saved in the file, and the measurement progress is displayed on the user interface at the same time, corresponding to the tasks (4) ~ (7) of the software task analysis part, the process is shown in Figure 6.



Figure 6 Flowchart of the vector network work thread

3 System performance

3.1 System software user interface

The system software user interface is divided and laid out according to functions to ensure clear view and easy operation. As shown in Figure 7, the functions of the areas marked with serial numbers are as follows:

(1) System menu: You can complete some general system settings, such as instrument switching, data output format and instrument operation mode selection. These settings do not need to be changed frequently, just use the default settings for general testing.

(2) Common settings: used to input vector network measurement parameters and turntable operating parameters, as well as the selection of file output locations and the input of custom file names. This part is a setting that often needs to be changed when the system is running, and it has frequent interactions with users.



Figure 7 The main dialog box of the user interface

(3) Measurement control: control the start and stop of measurement, and also control the operation of the turntable in the non-measurement state. The user can control the operation of the system and adjust the position of the turntable by operating this part.

(4) System operation status display: real-time display of the rotation speed and current position of the turntable, and continuously update the operation progress of the display system during the measurement process. Through this information, the user can know the system status well in order to make appropriate operations.

3.2 Measurement example The BJ-32 standard rectangular pyramid horn antenna in the laboratory was selected, and the Agilent and Anritsu vector network analyzers were used for measurement. The relevant parameters are shown in Table 1.



Select the 3.26 GHz frequency point data in the data file obtained from the two measurements to make the antenna normalized pattern, as shown in Figure 8 and Figure 9.



Figure 8 Agilent measurement results



Figure 9 Anritsu measurement results

  4 Conclusion

This system is based on a computer, making full use of the computer communication interface of the laboratory's advanced instruments. The user interface of the system software has a clear layout and comprehensive functions, which reduces the direct operation of the instrument, protects the valuable instrument and reduces the maintenance cost. The use of a vector network analyzer in the system makes the system have the ability to obtain multi-frequency antenna data by scanning and measuring. Common standard instructions are used in programming, which enhances the portability and scalability of the software. The use of multi-threading technology realizes multi-task parallel work and meets the real-time requirements of the system. Users can intuitively understand the system operation status and measurement progress through the user interface. At the same time, the antenna measurement data can be read and saved in real time. For further processing and research.

CONTACT US

Contact: Manager Xu

Phone: 13907330718

Tel: 0731-22222718

Email: hniatcom@163.com

Add: Room 603, 6th Floor, Shifting Room, No. 2, Orbit Zhigu, No. 79 Liancheng Road, Shifeng District, Zhuzhou City, Hunan Province

Scan the qr codeClose
the qr code