Distributed timing synchronization method and system for neutral beam injector
Technical Field
The invention relates to a neutral beam injector experiment technology, in particular to an auxiliary heating neutral beam injector system experiment operation control technology and a distributed timing synchronization technology in the field of fusion.
Background
In order to meet the demand of human society for clean and pollution-free energy, scientists find nuclear fusion as a new energy source. The realization of the controlled nuclear fusion needs to meet three basic conditions of plasma density, plasma temperature and capability constraint time. In tokamak, the temperature requirement cannot be satisfied only by ohmic heating, and therefore, auxiliary heating means such as wave heating and neutral beam injection heating must be employed. The neutral beam injection heating is realized by injecting high-energy neutral beams into a fusion device and mutually colliding with background plasma to exchange energy so as to achieve the purpose of heating the plasma, and the neutral beam injection heating mainly comprises an ion source, a neutralization chamber, a main vacuum chamber, a deflection magnet, an ion phagocytosis device, a power measurement target, a low-temperature condensation screen, a power supply system, a water system, a low-temperature vacuum system and a control system.
The neutral beam injection control system realizes the coordination management of the whole experiment operation process of the neutral beam injection system, controls the synchronous supply of each subsystem and the real-time adjustment of the amplitude and the time sequence of each subsystem, realizes the data acquisition and the data sharing, and carries out the real-time monitoring, the fault alarm and the chain protection on the state of each subsystem. A distributed timing synchronization method of a neutral beam injector is important for safe, synchronous and reliable operation of a neutral beam injection experiment.
At present, there are various methods for realizing distributed timing synchronization in a large-scale device control system, for example, a precision clock synchronization protocol standard of a network measurement and control system is applied to realize synchronous output control on each subsystem, and it is ensured that each subsystem has the same timestamp, but the specific implementation thereof needs the support of a high-performance network, the operation cost is higher, and the method cannot respond to a system fault signal in real time, and has poor capability of handling an unexpected asynchronous event.
Disclosure of Invention
The invention aims to provide a distributed timing synchronization method and a distributed timing synchronization system for a neutral beam injector, which realize synchronous output control of subsystems in the neutral beam injection experiment process, provide a uniform clock reference for the subsystems and ensure that experiment data of the subsystems have the same time stamp.
The technical scheme of the invention is as follows: a method of distributed timing synchronization of neutral beam injectors comprising the steps of:
step 1, configuring server parameters:
(1.1) setting pulse time and operation parameters of each subsystem by the server;
(1.2) the server sends the pulse time and the operation parameters of each subsystem to the timing system;
step 2, time sequence and amplitude synchronous output control:
(2.1) the timing system receives the pulse time and the operation configuration parameters of each subsystem from the server;
(2.2) a timing sequence and amplitude synchronous output module of the timing system sends a timing sequence signal and an amplitude signal to each subsystem through the multifunctional resettable board card;
(2.3) after the network communication module of the timing system receives a network START command sent by the console, the timing and amplitude synchronous output module drives a main cycle running on the FPGA to START running, the cycle period of the main cycle is 10 microseconds, 1 is added to one cycle period of each cycle, when the cycle period is greater than or equal to t1/10 and less than t2/10, the digital signal output channel outputs a high level signal '1', and when the cycle period is other than or equal to t1/10 and less than t2/10, the digital signal output channel outputs a low level signal '0'; the time sequence signal is a square wave signal, wherein t1 is the starting point of the square wave signal, and t2 is the ending point of the time sequence square wave signal;
(2.4) when the cycle period number is equal to the maximum value of all digital output channel setting values t2 divided by 10, or when the main cycle is ended when a system fault occurs in the experimental operation process, the cycle period returns to zero, and the timing sequence and amplitude synchronous output module of the timing system stops sending timing sequence signals and amplitude signals to each subsystem;
and 3, synchronizing the system time of the upper PC of each subsystem:
(3.1) the server periodically sends the system time to the client by taking the system time of the server as a reference;
(3.2) after receiving the system time sent by the server, the client updates the computer system time according to the system time and sends receiving confirmation information to the server;
and (3.3) the client actively asks the server side system time to update the system time per se through the updating command.
Further, all the time sequence configuration information in the configuration parameters acquired by the timing system from the server consists of two time points in the format of (t1, t2), where t1 is the starting point of the square wave signal, and t2 is the ending point of the square wave signal, and the unit is microsecond.
Furthermore, a timing sequence and amplitude synchronous output module of the timing system sends timing sequence signals to each subsystem through the multifunctional resettable FPGA board card, a network communication module of the timing system drives a main cycle running on the FPGA board card to START running after receiving a network START command sent by the console, and the main cycle is mainly used for controlling the actual output of the timing sequence and amplitude signals.
Furthermore, the multi-channel square wave signals output by the time sequence and amplitude synchronous output module control different subsystems to be put into an experiment moment according to the relative moment of t1 and t2 set for each channel time, synchronous output control of each subsystem is achieved, the upper computers of the subsystems provide uniform system time, data collected by the upper computer systems have the same timestamp, and the subsystems can conveniently store and process the experiment data by taking time as a unit.
In another aspect, the present invention provides a distributed timing synchronization system for a neutral beam injector, comprising:
a server, a timing system;
the timing system comprises a network communication module and a time sequence and amplitude synchronous output module;
the time sequence and amplitude synchronous output control module outputs synchronous time sequence and amplitude signals by injecting the neutral beam into each subsystem, so that the accuracy and reliability of the experiment time of each subsystem are guaranteed, and a system time synchronization module of a PC (personal computer) on each subsystem is also guaranteed;
the network communication module comprises a registration service module, an experiment control command receiving service module, an experiment parameter receiving service module and a state feedback value sending service module.
Further, the register service command sends a network register command and a network logout command to the server through hardware timing, so that the register and logout functions of the hardware timing system to the server are realized;
the experiment control command receiving service module is used for the hardware timing system to receive a RESET command, a GETREADY command and a START command from the server through network transmission;
the experiment parameter receiving server module is used for transmitting and receiving experiment parameter configuration information sent by the server through a network by the hardware timing system and converting the experiment parameter configuration information into a data format which can be identified by the hardware board card;
the state feedback value sending service module comprises a state information sending function and an analog quantity feedback value sending function, after the hardware timing system runs, the state information real-time monitoring thread and the analog quantity feedback information real-time monitoring thread read the state information and the analog quantity feedback value in real time, and alarm and safety interlock protection of different systems are carried out according to different experimental modes when a fault state is detected.
The system time synchronization module comprises a client information storage module, a server side active client system time updating module and a client side active local system time updating module.
Further, the client information storage module is responsible for storing and updating the IP address, the equipment number, the Socket and the computer system time information of the client;
the server side actively updates the client side system time module, and sends a system time updating command to the client side by the server side, and updates the client side system time;
the client side actively updates the local system time module, and the client side actively sends a request for updating the system time to the server side, and then updates the local system time according to the system time sent by the server side.
Furthermore, when a subsystem is added to the neutral beam injection system, synchronous output between the neutral beam injection system and other subsystems can be realized only by configuring a time sequence and amplitude output channel corresponding to the hardware timing system, and the IP address, the equipment number and the Socket information of the client are input into a client information storage module of the system time synchronization module, so that the system time of the client can be actively and passively updated at any time, and the experimental data of the newly added subsystem and the experimental data of other subsystems have the same timestamp.
Furthermore, the timing sequence and amplitude synchronous output control is completed through hardware timing, and the hardware timing system is responsible for establishing a synchronization mechanism between the master control and each subsystem, providing uniform and accurate clock signals and trigger signals for each subsystem of neutral beam injection, and ensuring that the whole neutral beam injection system has uniform timing sequence and amplitude output. The hardware timing realizes specific functions in a modularized mode, a network communication module of the hardware timing control system acquires time sequence and amplitude configuration information from a control system server through a high-speed local area network, outputs uniform time sequence and amplitude to each subsystem through a time sequence and amplitude output module, simultaneously reads the state of each subsystem in real time through a state monitoring module, and performs related fault alarm and chain protection.
Further, the system time synchronization method provides a uniform clock reference for the upper PC of each subsystem, and ensures that the data of each subsystem has the same timestamp. The server side application program is developed under a Linux operating system, real-time storage and update of different client side registration information and computer system time information are achieved by applying a shared memory technology, and real-time processing of different requests of different client sides is achieved through a multithreading technology. The client application program works under Linux and Windows operating systems respectively, and is in network communication with the server through a TCP/IP protocol, and the server-side computer system time is obtained from the server and is updated according to the system time.
The invention has the beneficial effects that:
the invention provides a distributed timing synchronization method of a neutral beam injector, which comprises a time sequence and amplitude synchronous output control method and a time synchronization method of a PC system on each subsystem. The invention perfectly combines hardware timing and network clock distribution, realizes synchronous output control of each subsystem, meets the requirements of synchronous operation of the neutral beam injection system experiment and reliable data identification, and provides powerful guarantee for reliable operation of the neutral beam injection system and comparative analysis and processing of data.
Drawings
FIG. 1 is a distributed timing synchronization process;
FIG. 2 is a functional block diagram of a network communication module;
FIG. 3 is a diagram illustrating a timing relationship of digital signals;
fig. 4 is a functional block diagram of a system time synchronization method.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments, and all other embodiments obtained by a person skilled in the art based on the embodiments of the present invention belong to the protection scope of the present invention without creative efforts.
The invention provides a distributed timing synchronization method of a neutral beam injector, which comprises a time sequence and amplitude synchronous output control method and a time synchronization method of a PC system on each subsystem.
The system is applied to all subsystems of a neutral beam injection system, and the subsystems comprise a power supply system (a filament power supply, an arc power supply, a magnet power supply, a high-voltage power supply, a suppression pole power supply, a buffer power supply and the like), a diagnosis system (spectrum diagnosis, thermocouple measurement, water flow measurement and the like), a PLC (programmable logic controller) slow speed control system, a data service system and the like.
As shown in fig. 1, the timing system of the present invention includes a network communication module and a timing and amplitude synchronization output module. The invention perfectly combines hardware timing and network clock distribution to realize synchronous output control of each subsystem. The synchronous output control of the time sequence amplitude is realized by a hardware timing system and a modularized thought;
the network communication module is used for providing various service functions, including registration service, experiment control command receiving service, experiment parameter receiving service and state feedback value sending service.
A functional block diagram of the network communication module is shown in fig. 2.
The registration service comprises that the hardware sends a network registration command and a network logout command to the server at regular time, so that the functions of registering and logout of the hardware timing system to the server are realized;
the experiment control command receiving service is used for receiving a RESET command, a GETREADY command and a START command from the server through network transmission by the hardware timing system;
the experiment parameter receiving service is that the hardware timing system transmits and receives experiment parameter configuration information sent by the server through a network and converts the experiment parameter configuration information into a data format which can be identified by the hardware board card;
the state feedback value sending service comprises state information sending and analog quantity feedback value sending, after the hardware timing system runs, the state information real-time monitoring thread and the analog quantity feedback information real-time monitoring thread read the state information and the analog quantity feedback value in real time, and alarm and safety chain protection of different systems are carried out according to different experimental modes when a fault state is detected.
And the time sequence and amplitude synchronous output module sends uniform time sequence and amplitude signals to each subsystem through a main loop after receiving a network START command sent by the server. The specific implementation of the timing and amplitude synchronous output module outputting timing and amplitude signals to each subsystem is similar, and the following description will be given by taking the specific implementation of the timing and amplitude output of the filament power supply as an example:
the filament power supply is one of important subsystems of a neutral beam injection system, and when the filament power supply works normally, a time sequence and amplitude synchronous output module of a timing system is required to send an over-pulse width protection signal and a starting signal, and the time sequence relation of the two paths of digital signals is shown in figure 3. The filament power supply starting signal is nested in the over-pulse width protection signal, the over-pulse width protection signal triggers the filament power supply to be in a ready state and ready for output at any time, the starting signal is responsible for controlling the actual output of the filament power supply, and the setting values of the starting point and the ending point of the two square wave signals come from the network setting of the server. The timing configuration information of all power supplies acquired by the timing system from the server consists of two time points, and the format is (t1, t2), wherein t1 is the starting point of the square wave signal, and t2 is the ending point of the square wave signal, and the unit is microsecond.
A timing sequence and amplitude synchronous output module of a timing system sends accurate timing sequence signals to each subsystem through a multifunctional resettable PXI-7842R FPGA board card, a network communication module of the timing system drives a main cycle running on the FPGA to START running after receiving a network START command sent by a console, the main cycle is mainly used for controlling actual output of the timing sequence and amplitude signals and is composed of a core of the timing sequence and amplitude synchronous output module, the cycle period of the main cycle is 10 microseconds, 1 is added to the cycle period number of each cycle, when the cycle period number is more than or equal to t1/10 and less than t2/10, a high level signal '1' is output by a digital signal output channel, and when the cycle period number is other times, a low level signal '0' is output by the digital signal. When the cycle period number is equal to the maximum value of all digital output channel setting values t2 divided by 10, or when the main cycle is ended when a system fault occurs in the experimental operation process, the cycle period returns to zero, and the timing sequence and amplitude synchronous output module of the timing system stops sending timing sequence signals to each subsystem.
The filament power supply amplitude configuration information received from the server by the timing and amplitude synchronization output module is in the format of (T1, 0), (T2, F), (T3, F) and (T4, 0), wherein T1 is the time when the amplitude starts climbing, T2 is the time when the amplitude reaches the flat top, F is the filament voltage setting value, T3 is the time when the amplitude starts descending, and T4 is the time when the amplitude finishes descending. The time sequence and amplitude synchronous output module processes the received configuration information again to form a six-row four-column two-dimensional array, wherein the first column represents a time value, the second column represents a time stepping value, the third column represents an amplitude setting value, and the fourth column represents an amplitude stepping value. The time value and the amplitude setting value of the first row of the two-dimensional array are both 0; the second line time value is T1, the amplitude setting value is 0, and so on, the third line time value is T2, the amplitude setting value is F, the fourth line time value is T3, the amplitude setting value is F, the fifth line time value is T4, and the amplitude setting value is 0; the sixth line time value is the longest value in all analog channel time setting values, the amplitude setting value is 0, the time step of each line is 1, and the amplitude step is the time value obtained by subtracting the amplitude of the line from the amplitude of the next line and then dividing the time value of the line by the time value of the next line. And finally, the timing sequence and amplitude synchronous output module generates an amplitude signal waveform by taking the amplitude output board card sampling rate and the two-dimensional array as the basis, outputs the amplitude signal waveform to the filament power supply and controls the amplitude output of the filament power supply. The synchronization of the timing and amplitude signals is realized by a trigger signal provided by the PXIe chassis backplane PXI _ Trig 0.
And the multi-channel square wave signals output by the time sequence and amplitude synchronous output module control the experiment input time of different subsystems according to the relative time of t1 and t2 set by each channel time, so as to realize synchronous output control of each subsystem.
The system time synchronization method provides uniform system time for upper computers of all subsystems of the neutral beam injector, so that data acquired by all upper computer systems have the same time stamp, and the subsystems can conveniently store and process experimental data by taking time as a unit. The method adopts a server/client mode and utilizes a TCP network communication protocol to transmit data.
As shown in fig. 4, the system time synchronization module is relatively independent from the timing system, and mainly includes three functional modules: the client information storage module, the server side active update client system time module and the client side active update local system time module.
The client information storage module is responsible for storing and updating information such as an IP address, an equipment number, a Socket, computer system time and the like of a client; the server side actively updates the client side system time module, and sends a system time updating command to the client side by the server side, and updates the client side system time; the client side actively updates the local system time module, and the client side actively sends a request for updating the system time to the server side, and then updates the local system time according to the system time sent by the server side.
When a subsystem is added in the neutral beam injection system, synchronous output of the neutral beam injection system and other subsystems can be realized only by configuring a time sequence and amplitude output channel corresponding to a hardware timing system, information such as an IP address, an equipment number and a Socket of the client is input into a client information storage module of a system time synchronization module, the system time of the client can be actively and passively updated at any time, and the newly added system experiment data and other system experiment data have the same timestamp. By the method, the distributed timing synchronization of the neutral beam injection is realized, and convenience is provided for system expansion.
Although illustrative embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the embodiments, but various changes may be apparent to those skilled in the art, and it is intended that all inventive concepts utilizing the inventive concepts set forth herein be protected without departing from the spirit and scope of the present invention as defined and limited by the appended claims.