A method and system for millimeter wave power monitoring and compensation of an ECRH system
By constructing a time delay alignment method and deploying a low-bit model under energy integral constraints in the ECRH system, and combining edge machine learning and FPGA hardware, the high precision and real-time performance issues of millimeter-wave power monitoring in the ECRH system were solved, achieving high-precision real-time monitoring and microsecond-level interlocking protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
- Filing Date
- 2026-05-11
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies in ECRH systems struggle to simultaneously achieve high-precision real-time monitoring of millimeter-wave power and microsecond-level interlocking protection under long-pulse, high-power operating conditions, especially since the high-speed response of diode detectors and the high precision of calorimetry are difficult to achieve at the same time.
By constructing a time delay alignment method under energy integral constraints, a millimeter-wave power thermal drift compensation model is established and quantized into a low-bit model for deployment on an edge control platform. A dual-rate compensation architecture is adopted, utilizing slow loop inference and fast loop execution to achieve dynamic compensation. Combined with edge machine learning and FPGA hardware platform, high precision and high-speed response are achieved.
It achieves high-precision real-time monitoring and microsecond-level interlocking protection of millimeter-wave power under long-pulse conditions, reduces power errors caused by thermal drift, is suitable for resource-constrained edge devices, and meets the steady-state operation requirements of fusion devices.
Smart Images

Figure CN122171876A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of magnetic confinement nuclear fusion plasma heating and microwave measurement technology, and relates to a method and system for monitoring and compensating millimeter-wave power in an ECRH (Electron Cyclotron Resonance Heating) system. Background Technology
[0002] Electron cyclotron resonant heating systems are widely used in magnetically confined nuclear fusion devices such as tokamaks and stellarators for plasma breakdown, electron heating, current driving, and suppression of magnetohydrodynamic instabilities. High-precision, real-time monitoring of the forward incident power and reverse reflected power in the transmission waveguide under megawatt-level, long-pulse, and even steady-state operating conditions is crucial for ensuring heating efficiency, conducting physical analysis, and implementing equipment safety interlocking protection.
[0003] In existing technologies, millimeter-wave power monitoring typically employs a directional coupler combined with a Schottky diode detector. This approach offers the advantage of fast response speed, capable of capturing power abrupt changes at the microsecond or even nanosecond level. However, its output signal varies significantly with factors such as detector temperature, ambient thermal drift, and thermal accumulation during long pulses, leading to a substantial increase in measurement error during long pulse or high duty cycle operation. On the other hand, calorimetry can invert the average millimeter-wave power by measuring changes in heat absorbed by the cooling medium, offering high absolute accuracy. However, its slow response time, typically on the order of seconds or even longer, limits its application to pre- and post-experiment calibration or steady-state averaging measurements, making it unsuitable for microsecond-level online protection and control.
[0004] Currently, there are also technical approaches that utilize AI models deployed on host computers, industrial PCs, or in the cloud to compensate for sensor temperature drift. However, these solutions suffer from drawbacks such as communication latency, operating system scheduling jitter, high resource overhead of floating-point models, and difficulty in direct deployment on underlying real-time control hardware. They also struggle to simultaneously meet the requirements of high precision, low latency, strong robustness, and hard real-time interlocking protection. Therefore, how to balance the high-speed response of diode detectors and the high precision of calorimetry under long-pulse, high-power operating conditions, while meeting the stringent requirements of microsecond-level interlocking protection for fusion devices, is a pressing technical problem that needs to be solved in this field. Summary of the Invention
[0005] The technical solution of this invention is used to solve the problem of how to achieve high-precision, real-time monitoring of millimeter-wave power in the ECRH system.
[0006] This invention provides a method for millimeter-wave power monitoring and compensation in an ECRH system, comprising the following steps:
[0007] During the operation of the ECRH system, detector voltage signals, temperature signals, and calorimetric power true values obtained by calorimetry inversion are acquired. The time delay alignment method under energy integral constraint is used to align the detector voltage signals, temperature signals, and calorimetric power true values on the time axis, thereby constructing an offline training dataset containing thermal drift features. A millimeter-wave power thermal drift compensation model is established and trained. The input features of the millimeter-wave power thermal drift compensation model include at least the detector voltage signal and the temperature signal, and the output is the power compensation coefficient. The trained millimeter-wave power thermal drift compensation model is quantized to obtain a low-bit quantization model, which is then deployed on the edge control platform. On the edge control platform, the low-bit quantization model is periodically invoked at a first rate based on the real-time acquired temperature signal to infer and generate dynamic power compensation coefficients. At a second rate higher than the first rate, the real-time power compensation value is calculated based on the real-time acquired detector voltage signal and the dynamic power compensation coefficients.
[0008] Furthermore, the step of aligning the detector voltage signal, temperature signal, and calorimetric power true value signal on the time axis using the time delay alignment method under energy integral constraints to construct an offline training dataset containing thermal drift features specifically includes: Within the candidate time delay interval, the optimal alignment time delay τ is found by minimizing the objective function, which is the absolute value of the difference between the integral of the detector power estimate and the integral of the true calorimetric power after shifting by the time delay τ within a complete microwave pulse time interval. By utilizing the optimal alignment delay τ, the time axis of the detector voltage signal, temperature signal, and calorimetric power true value signal is aligned to construct training sample pairs that satisfy the energy conservation relationship.
[0009] Furthermore, the formula for the objective function is as follows:
[0010] in, This is the real-time power estimate obtained by converting the detector voltage signal through the initial calibration curve. This is the true value of the calorimetric power. This is the initial value for a complete microwave pulse time interval. This represents the end value of a complete microwave pulse time interval. This represents the lower limit of the candidate delay interval. This represents the upper limit of the candidate delay interval.
[0011] Furthermore, the millimeter-wave power thermal drift compensation model employs a multilayer perceptron neural network model, whose output layer contains two neurons, corresponding to the gain coefficient k and offset coefficient b of the power compensation, respectively; the real-time power compensation value The calculation formula is: ,in This refers to the detector voltage signal acquired in real time.
[0012] Furthermore, the input features of the multilayer perceptron neural network model are 2-dimensional to 10-dimensional feature vectors, which include at least the detection voltage signal and the temperature signal.
[0013] Furthermore, the edge control platform includes a slow-loop inference unit and a fast-loop execution unit; the slow-loop inference unit is implemented by a real-time processor and periodically infers and generates dynamic power compensation coefficients at a first rate of 10ms or less; the fast-loop execution unit is implemented by an FPGA and periodically calculates real-time power compensation values at a second rate of 10μs or less.
[0014] Furthermore, the millimeter-wave power monitoring and compensation method of the ECRH system also includes a fast interlocking protection step: executed by the logic inside the FPGA, the real-time power compensation value is continuously compared with the preset power threshold multiple times, and when the number of times the power compensation value exceeds the threshold continuously reaches the preset number N, an interlocking protection signal for cutting off the high-voltage power supply is directly output, where N≥2.
[0015] The present invention also provides a millimeter-wave power monitoring and compensation system for an ECRH system, used to execute the above-mentioned millimeter-wave power monitoring and compensation method for an ECRH system. The system includes: a directional coupling sampling module, an attenuation and detection module, a temperature acquisition module, a power true value acquisition module, an edge control platform, and a communication and management module. The edge control platform is configured with: The first processing unit is used to periodically call a pre-deployed low-bit quantization model at a first rate to infer and generate dynamic power compensation coefficients based on real-time temperature signals. The second processing unit communicates with the first processing unit and is used to calculate the real-time power compensation value at a second rate higher than the first rate, based on the real-time detection voltage signal and the latest dynamic power compensation coefficient, and to perform threshold comparison and interlocking logic judgment.
[0016] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the above-described ECRH system millimeter-wave power monitoring and compensation method, and the processor is configured to execute the program stored in the memory.
[0017] The present invention also provides a storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described ECRH system millimeter-wave power monitoring and compensation method.
[0018] The beneficial effects of this invention are as follows: This invention constructs an offline training dataset with time delay alignment under energy integral constraints to train a millimeter-wave power thermal drift compensation model with detector voltage and temperature as inputs. After quantizing the model into a low-bit model, it is deployed on an edge control platform, forming a dual-rate compensation architecture of "slow-loop inference - fast-loop execution": the slow loop periodically infers dynamic compensation coefficients, and the fast loop uses these coefficients to perform real-time linear compensation of the high-speed detector voltage and execute microsecond-level interlocking protection. This invention simultaneously considers high accuracy and high-speed response, combining the high-precision truth-value capability of calorimetry with the high-speed response capability of diode detection. Through an energy integral ratio time alignment strategy, it addresses the challenges of high-frequency electrical signals, slowly varying temperature signals, and low-frequency signals. It addresses the time misalignment issue between thermal truth values; it continuously tracks thermal drift during millimeter-wavelength pulse operation, dynamically updates compensation parameters, and significantly reduces power errors caused by thermal drift; it reduces model storage overhead and computational burden through INT8 quantization compression, making it suitable for long-term stable operation of resource-constrained edge devices; it adopts a dual-rate architecture, separating slow neural network inference from fast multiply-accumulate execution to meet protection requirements of less than 10μs; it reduces dependence on complex physical constant-temperature water cooling systems, can be directly adapted to the ECRH system of existing tokamak devices, is compatible with mainstream FPGA / real-time controller hardware platforms, exhibits strong robustness, and meets the steady-state operation requirements of fusion devices. Attached Figure Description
[0019] Figure 1 This is an overall flowchart of the millimeter-wave power monitoring and compensation method for the ECRH system according to Embodiment 1 of the present invention; Figure 2 This is a flowchart of constructing a time-delay aligned offline training dataset under energy integral constraints according to Embodiment 1 of the present invention; Figure 3 This is a flowchart of model training according to Embodiment 1 of the present invention; Figure 4 This is a diagram illustrating the effect of millimeter-wave power monitoring and compensation in the ECRH system according to Embodiment 1 of the present invention. Figure 5 This is a block diagram of the overall structure of the ECRH system millimeter-wave power monitoring and compensation system according to Embodiment 2 of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments: Example 1 like Figure 1 As shown, this embodiment provides a method for millimeter-wave power monitoring and compensation in an ECRH system, including the following steps: Step 1: Collect multi-source heterogeneous raw data and construct a time-delay aligned offline training dataset under energy integral constraints. To address the significant thermal drift of Schottky diode detectors under ECRH long-pulse conditions and the low-frequency hysteresis of calorimetric power measurements, this embodiment constructs an offline training dataset for an edge machine learning compensation model. This offline training dataset is used to establish the mapping relationship between detector voltage, temperature signals, and actual millimeter-wave power.
[0022] 1.1 Data Collection Objects and Sources During the ECRH system calibration experiment, multiple rounds of pulse experiments were carried out covering the entire operating range, and multi-source heterogeneous raw data were collected simultaneously.
[0023] A dual directional coupler is installed at the mitered bend of the waveguide in the ECRH system to extract the incident and reflected millimeter-wave coupled signals with a predetermined coupling degree. The coupled signals are then input to a Schottky diode detector via an attenuation network, and the output is a high-speed detection voltage signal. A PT100 platinum resistance temperature sensor is mounted on the base of the Schottky diode detector to collect real-time temperature signals from the core heating area of the detector. This serves as the input for thermal drift characteristics; simultaneously, the inlet and outlet temperature difference and volumetric flow rate of cooling water are collected in real time in the dummy load loop using calorimetry, and the true value signal of calorimetric power is obtained by inversion based on the law of conservation of energy. .
[0024] 1.2 Data Acquisition System and Offline Processing Software Environment Online data acquisition utilizes LabVIEW Real-Time and LabVIEW FPGA to achieve data acquisition, trigger synchronization, cache management, and raw file recording. The hardware employs an NI cRIO-9049 real-time controller as the core acquisition module, and an NI-9223 high-speed analog acquisition module (4 channels, 16-bit resolution, maximum sampling rate 1MSPS) to acquire the analog voltage signal output from the detector; an NI-9217 temperature acquisition module (8 channels, 24-bit resolution) to acquire the PT100 temperature sensor signal; and an NI-9203 analog acquisition module (8 channels, 16-bit resolution) to acquire the flow meter and differential temperature transmitter signals.
[0025] Offline data processing utilizes Python to perform batch cleaning, time-series alignment, feature construction, and sample generation. The raw acquired data is first recorded as TDMS files using LabVIEW, and then batch-parsed into HDF5, Parquet, or CSV files by the Python program. To balance compression ratio, reading speed, and hierarchical organization capabilities for large-scale time-series data, HDF5 is preferred as the primary training database format.
[0026] 1.3 Database storage method The preferred approach is a two-tier structure consisting of a raw data warehouse and a feature sample library.
[0027] Raw data warehouse: Used to store the original high-speed waveform and slow state variables of each experimental pulse, preferably organized with the pulse number as the primary key.
[0028] Feature sample library: Used to store supervised learning samples that can be directly used for model training after alignment. Preferably, it includes: input feature matrix X, label matrix Y, sample source pulse number pulse_id, and alignment delay parameter tau. The data quality flag is `quality_flag`, and the training / validation / test set split flag is `dataset_split`.
[0029] For scenarios with a large sample size, it is preferable to use SQLite, DuckDB, or PostgreSQL to store index information, pulse metadata, and search tags, while storing large time series arrays in HDF5 files; this facilitates both fast retrieval and high-throughput read and write operations.
[0030] 1.4 Data Preprocessing Flow Step A: Importing raw data and unifying timestamps Data files from different sources are imported into an offline processing program, and the timestamps of each channel are unified to the same reference clock. If different sampling frequencies exist, a common reference time axis is established.
[0031] Step B: Outlier Removal and Signal Cleaning For the detector voltage signal, obvious glitches, sampling saturation values, and missing sample intervals are removed; for the temperature signal, abrupt jumps are removed; and for the calorimetric power true value signal, the sensor startup phase and unstable sections are removed. Median filtering, amplitude limiting filtering, and sliding window consistency checks are preferred.
[0032] Step C: Pulse Segmentation and Stage Identification Based on external gate control signals, detector voltage thresholds, or pulse synchronization trigger signals, the start, sustain, and end intervals of a single microwave pulse are identified. For a complete pulse, it is divided into at least a preheating segment, a steady-state segment, and a cooling segment so that the model can learn the drift characteristics under different thermal states.
[0033] Step D: Resampling and Scale Unification To address the time scale inconsistency between high-frequency detector voltage signals and low-frequency, delayed calorimetric power true signals, a time delay alignment method under energy integral constraints is adopted. This method performs backward resampling, delay compensation, and physical constraint alignment on multi-source heterogeneous original data, ensuring that the training dataset satisfies the energy conservation relationship.
[0034] Due to the detector voltage signal Temperature signal and the true value signal of calorimetric power Since the sampling rates differ significantly, it is preferable to first keep the original sampling of the detector voltage signal unchanged, and then interpolate or resample the true values of temperature and calorimetric power signals according to a unified time base, thereby obtaining a multi-source data sequence on the same time axis.
[0035] In a preferred implementation, candidate delay intervals are first defined [ , The candidate delay interval can be preset based on the cooling circuit structure, fluid hysteresis time, and empirical calibration results, for example, 0.5s to 20s; then, continuous optimization is performed within the candidate delay interval, within a complete microwave pulse time interval. Within this framework, the constrained detector power integral is consistent with the calorimetric absorption energy integral; therefore, the objective function for continuous optimization can be defined as:
[0036] in, This is the real-time power estimate obtained by converting the detector voltage signal through the initial calibration curve. This is the true value of the calorimetric power. This is the initial value for a complete microwave pulse time interval. This represents the end value of a complete microwave pulse time interval. This represents the lower limit of the candidate delay interval. This represents the upper limit of the candidate delay interval.
[0037] By finding the objective function Minimize the time delay to obtain the optimal alignment time delay τ.
[0038] Preferably, a heat conduction inverse delay estimation model can also be introduced to perform deconvolution approximation on the first or second order inertial response of the calorimetric circuit, thereby obtaining the pseudo-instantaneous true value after inverse delay compensation. Based on this, further local cross-correlation search and energy consistency constraints can improve the accuracy of time delay estimation and form a correlation with the detected voltage signal. Temperature signal Synchronized data tags.
[0039] 1.5 Feature Construction and Sample Labeling By combining the inverse time-delay model of heat conduction, pulse boundary detection, window integral matching, and time-delay search, training sample pairs for supervised learning are constructed, where the direct power label format is:
[0040] Converted to discrete form as follows:
[0041] in, For discrete detector voltage signals, It is a discrete temperature signal. It is the true value signal of discrete calorimetric power.
[0042] 1.6 Dataset Partitioning and Quality Control The valid samples that pass the validation are divided into training dataset, validation dataset, and test dataset in a ratio of 7:2:1. The training dataset is used for training the model's weights and optimizing the parameters; the validation dataset is used for verifying the model's generalization and tuning hyperparameters during the training process; and the test dataset is used for the final accuracy evaluation of the model after training is completed and does not participate in the training process.
[0043] To ensure data quality, the following rejection rules can be set: pulses with unstable calorimetric circuits or abnormal flow rates will not be included in training; pulses with saturated detector voltage, obvious clipping, or ADC overflow will not be included in training; pulses with open circuits, sudden jumps, or excessive drift in temperature sensors will not be included in training; pulses with optimal alignment delays exceeding the physically reasonable range will be marked as abnormal samples.
[0044] Figure 2This embodiment demonstrates the process of constructing a time-delay aligned offline training dataset under energy integral constraints. This process resolves the time-scale inconsistency between high-frequency detection signals and low-frequency hysteresis ground truth signals, ensuring that the constructed training samples simultaneously satisfy both temporal consistency and energy conservation constraints. Through this process, a high-quality offline training dataset containing information on thermal drift, impulse dynamics, and calorimetric ground truth constraints can be constructed, ensuring the dataset's traceability and reproducibility, and providing standardized input for subsequent model training.
[0045] Step 2: Establishment and Training of Millimeter-Wave Power Thermal Drift Compensation Model 2.1 Establishing a millimeter-wave power thermal drift compensation model Preferably, the millimeter-wave power thermal drift compensation model in this embodiment adopts a multilayer perceptron neural network (MLP) model; the structural design of the multilayer perceptron neural network model is as follows: The model preferably has 2 to 4 hidden layers, more preferably 3 hidden layers. An example structure is as follows: Input layer: 2 to 10 nodes; First hidden layer: 32 neurons; Second hidden layer: 32 neurons; The third hidden layer consists of 16 neurons; Output layer: 2 neurons, corresponding to output power compensation coefficients—gain coefficient k and offset coefficient b.
[0046] The activation function for the hidden layer can be ReLU, LeakyReLU, or SiLU, with ReLU being the preferred choice; the output layer can be without an activation function and can directly output real values.
[0047] To improve training stability, it is preferable to add a normalization layer to the input layer, or to perform feature normalization before offline training. It is also preferable to save the normalization parameters such as the mean, standard deviation, maximum, and minimum values of each input feature, and to solidify them as supporting parameters for subsequent edge deployment.
[0048] 2.2 Model Training like Figure 3 As shown, the millimeter-wave power thermal drift compensation model is trained using the training dataset constructed in step 1, and a floating-point model suitable for edge deployment is obtained. The specific steps are as follows: (1) Software environment configuration for model training Model training is performed on a lab server or GPU server. An MLP model is built using Python and PyTorch. Training samples are stored in HDF5 files, while impulse metadata and training partitioning information are stored in an SQLite database. The training program reads samples from the HDF5 files in batches and extracts corresponding subsets based on the SQLite index, improving the efficiency of training large-scale samples.
[0049] (2) Definition of input and output for model training and calculation of power compensation value Preferably, the model input is defined as a 2D feature vector. The model output is defined as a 2D power compensation coefficient vector. .
[0050] In the extended approach, the model input can use 4-dimensional to 10-dimensional feature vectors, for example, a 7-dimensional feature vector. ,in, The rate of change of voltage. For the rate of temperature change, For stage markers, The average voltage over a window of several milliseconds. This represents the average temperature over a window of several milliseconds.
[0051] The gain coefficient k and offset coefficient b obtained from model inference are used to quickly calculate the power compensation value online. The calculation formula is: The advantage of this approach is that the edge loop only needs to perform one multiplication and one addition, resulting in low computational resource consumption, making it suitable for deployment in FPGA logic.
[0052] (3) Training process and database management Supervised learning regression training is preferred, and the loss function can be the mean squared error loss. Mean absolute error loss or mean square error loss and mean absolute error loss The weighted combination loss.
[0053] The mean square error loss and mean absolute error loss The formula for the weighted combination loss function is as follows:
[0054] in, Mean square error loss The weight, Mean absolute error loss The weight.
[0055] The Adam optimizer is used, and the optimal learning rate is 10. -4 ~10 -3 The optimal batch size is 256, 512, or 1024, and the optimal number of training epochs is 50–300. To make the model focus more on critical operating conditions such as high power, long pulses, and large temperature rises, sample weights can be introduced into the loss function, that is, higher loss weights can be assigned to high reflection risk intervals, the steady-state end of long pulses, and high-temperature intervals. A model database or model file library should be established to support the training process, storing information such as the feature set definitions, model structure parameters, normalization parameters, floating-point model weight files, final validation metrics, pre-quantization exported files, and deployment version numbers in an SQLite database, YAML configuration file, JSON metadata file, or MLflow management directory.
[0056] (4) Model export After completing model training and selecting the optimal model, the floating-point model is exported as a quantizable intermediate format, specifically in ONNX format, for subsequent post-training quantization, quantization-aware training, and then exported or converted to a parameter file loadable at the edge. Simultaneously, information such as model weights, model topology, input / output node definitions, normalization parameters, feature order definitions, version number, and checksum are also exported to obtain the floating-point model.
[0057] Step 3: Model Quantization and Edge Deployment 3.1 Quantization of the Model The floating-point model is quantized using INT8 (8-bit integer) to obtain an INT8 quantized model. This maps the floating-point model's weights, biases, and activation values to the INT8 numerical domain, reducing storage and computational complexity. Quantization methods can include Post-Train Quantization (PTQ) or Quantization-Aware Training (QAT). This embodiment prioritizes QAT for INT8 quantization, introducing pseudo-quantization nodes during model training to simulate the rounding and truncation errors of INT8 quantization. This allows the model to adapt to quantization noise during training and perfectly matches the INT8 operational characteristics of the FPGA's underlying hardware circuit's multiply-accumulate units. Alternatively, Post-Train Quantization (PTQ) can be used. This eliminates the need for retraining the floating-point model; it only requires using a representative calibration dataset to statistically analyze the dynamic range of each layer's weights and activations, calculate the quantization scaling factor, and convert the model to INT8 format. This method is suitable for prototype verification and short-pulse operation.
[0058] The INT8 quantization process includes the following steps: 1) Select a calibration dataset. Choose representative samples from the training or validation dataset that cover different power levels, different temperature rise states, and different pulse lengths to form a calibration dataset. The preferred number of samples is several hundred to several thousand pulse windows.
[0059] 2) Statistical weight range, for each layer of the weight matrix Calculate its minimum value With the maximum value Calculate the weight quantization scaling factor .
[0060] 3) Calculate the activation range and output activation values for each layer. Forward inference is performed on the calibration dataset to statistically analyze its dynamic range and calculate the activation quantization scaling factor. .
[0061] 4) Establish an integer mapping relationship, using either symmetric or asymmetric quantization, with symmetric quantization being preferred for the weights. The expression is: ,in A similar approach can be used for activation values: During edge reasoning, the integer multiplication and addition results are combined with the scaling factor to restore the actual dimensions.
[0062] 5) Fixed-point biasing: Bias terms typically require higher bit widths, such as INT16, INT24, or INT32, to avoid overflow after multi-level accumulation. It is preferable to store biases using INT32, with a scaling factor equal to the product of the input quantization factor and the weight quantization factor.
[0063] 3.2 Edge Deployment of the Model When deploying at the edge, to reduce the complexity of real-time computation, it is preferable to merge the multi-layer scaling factors in advance, minimize online division operations, and convert them into table lookup, shift addition, or fixed-point constant multiplication forms.
[0064] After quantization, the model is no longer saved simply as a general deep learning framework file, but is preferably packaged into a parameter package that can be directly loaded by the edge control platform. The parameter package includes at least: an INT8 array of weights for each layer, an INT32 array of biases for each layer, input / output scaling factors for each layer, input normalization parameters, output denormalization parameters, model layer structure definitions, and version number. It is preferably stored as a binary parameter file, an INI configuration file, or a data cluster file readable by LabVIEW.
[0065] In a preferred embodiment, the Python script exports the trained PyTorch model to ONNX, then generates a binary parameter package using a custom quantization toolchain, uses NIcRIO-9049 as the edge real-time controller, and is subsequently read and written to real-time memory by the LabVIEW Real-Time program at startup.
[0066] In terms of system architecture, edge deployment is preferably divided into two layers: The first layer employs a real-time processor (slow-loop inference unit) with a preferred cycle of 10ms. Its tasks include reading the current temperature value and statistical characteristics, normalizing the input characteristics, calling the quantization model to infer the current compensation coefficients k and b, limiting, smoothing, and validating the inference results, writing the latest k and b to the FPGA shared register or DMAFIFO, logging, and communicating with the host computer.
[0067] The second layer employs an FPGA (Fast Loop Execution Unit), running within cRIOFPGA logic, with a preferred cycle time of 10μs. Its tasks include: high-speed reading of analog sample values, retrieval of the latest compensation parameters, and real-time calculation of power compensation values.
[0068] Step 4: Dual-rate compensation and interlocking protection Considering that the cRIO-9049's real-time processor is better suited for executing low-frequency logic and lightweight neural network inference, this embodiment preferably places the neural network inference of the INT8 quantization model on the real-time processor side, while only retaining the final multiply-accumulate compensation and threshold comparison logic on the FPGA side. The edge control platform is used to carry edge inference, I / O synchronization, parameter loading, and interlocking execution logic. The cRIO-9049, as a real-time controller, combined with the FPGA architecture, is suitable for implementing dual-rate hierarchical execution. The INT8 quantization model outputs not the power compensation value for each high-speed sampling point in the slow loop, but a set of dynamic compensation parameters k and b under the current thermal state. This significantly reduces the FPGA implementation complexity and meets the fast protection requirements. If FPGA resources are sufficient, the complete INT8 quantization model can also be implemented on the FPGA, but the implementation complexity is higher. In comparison, the preferred solution remains "neural network slow-loop inference + fast-loop linear recovery".
[0069] The specific execution process of the dual-rate compensation is as follows: (1) After the system is powered on, the real-time processor loads the parameter package, normalization parameters and initial compensation coefficients k and b of the INT8 quantization model from the non-volatile memory and writes them into the shared register of the FPGA.
[0070] (2) The slow loop inference unit executes in a loop with a period of 10ms or less: read the current value T of the temperature sensor; read optional auxiliary features (such as dV / dt, dT / dt, etc.); normalize the input features; call the INT8 quantization model to perform forward inference and obtain the current compensation coefficients k_new and b_new; perform amplitude limiting and low-pass filtering smoothing on k_new and b_new; write the updated compensation coefficients into the shared register of the FPGA and record the running log.
[0071] (3) The fast loop execution unit executes cyclically with a period of 1μs or less: reads the current detector voltage from the high-speed ADC. Read the latest compensation coefficient from the shared register; perform fixed-point multiply-add operation to calculate the power compensation value, and output it to the subsequent monitoring and interlocking logic.
[0072] The dual-rate compensation architecture of this invention deploys the quantized compensation model on an edge control platform. A slow-loop inference channel is formed by a real-time processor, and a fast-loop power monitoring and interlocking channel is formed by an FPGA, thereby achieving high-precision, low-latency online dynamic compensation and safety protection.
[0073] The specific implementation of fast interlock protection is as follows: The calculated power compensation value A continuous multi-acknowledgment algorithm is executed within the FPGA and compared with a preset reflection power threshold. Comparison. The specific logic of the continuous multiple confirmation algorithm is as follows: Set a counter cnt, initially set to 0. In each sampling period, if... If the signal is positive, then cnt = cnt + 1; otherwise, cnt = 0. When cnt reaches the preset number of confirmations N (N≥2, preferably N=3), it is determined to be a real waveguide arcing or severe high reflection event. At this time, the FPGA directly generates a high-level cutoff signal from the digital output port and sends it to the high-voltage power supply interlock port to achieve rapid shutdown protection. The entire process does not rely on the host computer software, and the end-to-end delay can be compressed to within 10 microseconds.
[0074] In summary, this invention constructs an offline training dataset under calorimetric truth constraints to train a millimeter-wave power thermal drift compensation model with detection voltage and temperature characteristics as input. After INT8 quantization of the model, it is deployed on an edge control platform. The compensation parameters are periodically inferred in the slow-loop inference unit, and real-time power recovery and threshold comparison are performed in the fast-loop execution unit, thereby achieving high-precision real-time monitoring and microsecond-level interlocking protection of millimeter-wave power in the ECRH system.
[0075] like Figure 4 The figure shows the effect of millimeter-wave power monitoring and compensation in the ECRH system. The figure illustrates the results of a typical long-pulse experiment. The true calorimetric value is calculated by integrating the cooling water temperature difference, serving as a high-precision reference. The compensation model uses edge machine learning to achieve dynamic gain and bias correction. Statistical results (plateau phase 20~140s): The uncompensated average relative error is 7.32%, and the compensated average relative error is 1.42%, representing an error improvement of 5.90%. Uncompensated error characteristics: Continuous negative drift during the plateau period, with a maximum negative error of approximately -12% and an average relative error of approximately 7.32%. Compensated error characteristics: Small fluctuations around zero error, with a maximum error of approximately ±3% and an average relative error of approximately 1.42%.
[0076] Example 2 like Figure 5As shown, this embodiment provides a millimeter-wave power monitoring and compensation system for an ECRH system, including: a directional coupling sampling module, an attenuation and detection module, a temperature acquisition module, a power truth acquisition module, a data alignment and training module, a model quantization module, an edge control platform, and a communication and management module; the output of the directional coupling sampling module is connected to the attenuation and detection module; the edge control platform is configured with a detection voltage acquisition channel connected to the attenuation and detection module, a temperature acquisition channel connected to the temperature acquisition module, and a power truth signal input channel connected to the power truth acquisition module; the edge control platform is connected to the communication and management module and outputs the power monitoring signal to the communication and management module.
[0077] The directional coupling sampling module is used to extract millimeter-wave coupling signals from millimeter-wave waveguides; The attenuation and detection module is used for attenuation and detection of the coupled signal, and outputs a high-speed detection voltage signal. ; The temperature acquisition module is used to acquire real-time temperature signals of the core heating area of the detector. , as input for thermal drift characteristics; The power true value acquisition module is used to acquire the temperature difference and volumetric flow rate of cooling water inlet and outlet in real time in a dummy load loop using calorimetry, and to obtain the calorimetric power true value signal by inversion based on the law of conservation of energy. ; The data alignment and training module ( Figure 5 (Not shown in the text) is used to align the detector voltage signal, temperature signal and calorimetric power true value signal on the time axis according to the principle of minimizing the error between detector power integral and calorimetric energy integral, and to construct an offline training sample dataset, as well as to train a millimeter-wave power thermal drift compensation model based on the training sample dataset. The model quantization module ( Figure 5 (Not shown in the image) is used to quantize the millimeter-wave power thermal drift compensation model in Example 1 into a low-bit model, such as the INT8 quantization model; The edge control platform includes a slow-loop inference unit and a fast-loop execution unit; The slow-loop inference unit is used to call the low-bit model based on temperature and auxiliary features to infer the power compensation coefficient. The fast-loop execution unit is used to calculate the power compensation value based on the sampled high-speed detector voltage and the current power compensation coefficient. The fast loop execution unit also includes a threshold comparison and interlocking output module, which is used to compare the power compensation value with a preset threshold and output a cut-off protection signal when the interlocking condition is met. The communication and management module is used for parameter configuration, data recording, operation status monitoring, and model updates.
[0078] Example 3 This embodiment provides an electronic device, including a memory and a processor. The memory is used to store a program that supports the processor in executing the millimeter-wave power monitoring and compensation method of the ECRH system in Embodiment 1. The processor is configured to execute the program stored in the memory.
[0079] Example 4 This embodiment provides a storage medium on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the millimeter-wave power monitoring and compensation method for the ECRH system in Embodiment 1.
[0080] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for millimeter-wave power monitoring and compensation in an ECRH system, characterized in that, Includes the following steps: During the operation of the ECRH system, detector voltage signals, temperature signals, and calorimetric power true values obtained by calorimetry inversion are acquired. The time delay alignment method under energy integral constraint is used to align the detector voltage signals, temperature signals, and calorimetric power true values on the time axis, thereby constructing an offline training dataset containing thermal drift features. A millimeter-wave power thermal drift compensation model is established and trained. The input features of the millimeter-wave power thermal drift compensation model include at least the detector voltage signal and the temperature signal, and the output is the power compensation coefficient. The trained millimeter-wave power thermal drift compensation model is quantized to obtain a low-bit quantization model, which is then deployed on the edge control platform. On the edge control platform, the low-bit quantization model is periodically invoked at a first rate based on the real-time acquired temperature signal to infer and generate dynamic power compensation coefficients. At a second rate higher than the first rate, the real-time power compensation value is calculated based on the real-time acquired detector voltage signal and the dynamic power compensation coefficients.
2. The millimeter-wave power monitoring and compensation method for the ECRH system according to claim 1, characterized in that, The step of aligning the detector voltage signal, temperature signal, and calorimetric power true value signal on the time axis using the time delay alignment method under energy integral constraints to construct an offline training dataset containing thermal drift features specifically includes: Within the candidate time delay interval, the optimal alignment time delay τ is found by minimizing the objective function, which is the absolute value of the difference between the integral of the detector power estimate and the integral of the true calorimetric power after shifting by the time delay τ within a complete microwave pulse time interval. By utilizing the optimal alignment delay τ, the time axis of the detector voltage signal, temperature signal, and calorimetric power true value signal is aligned to construct training sample pairs that satisfy the energy conservation relationship.
3. The millimeter-wave power monitoring and compensation method for the ECRH system according to claim 2, characterized in that, The formula for the objective function is as follows: in, This is the real-time power estimate obtained by converting the detector voltage signal through the initial calibration curve. This is the true value of the calorimetric power. This is the initial value for a complete microwave pulse time interval. This represents the end value of a complete microwave pulse time interval. This represents the lower limit of the candidate delay interval. This represents the upper limit of the candidate delay interval.
4. The millimeter-wave power monitoring and compensation method for the ECRH system according to claim 1, characterized in that, The millimeter-wave power thermal drift compensation model employs a multilayer perceptron neural network model, with its output layer containing two neurons corresponding to the power compensation gain coefficient k and offset coefficient b, respectively; the real-time power compensation value... The calculation formula is: ,in This refers to the detector voltage signal acquired in real time.
5. The millimeter-wave power monitoring and compensation method for the ECRH system according to claim 4, characterized in that, The input features of the multilayer perceptron neural network model are 2-dimensional to 10-dimensional feature vectors, which include at least the detection voltage signal and the temperature signal.
6. The millimeter-wave power monitoring and compensation method for the ECRH system according to claim 1, characterized in that, The edge control platform includes a slow-loop inference unit and a fast-loop execution unit; the slow-loop inference unit is implemented by a real-time processor and periodically infers and generates dynamic power compensation coefficients at a first rate; the fast-loop execution unit is implemented by an FPGA and periodically calculates real-time power compensation values at a second rate.
7. The millimeter-wave power monitoring and compensation method for the ECRH system according to claim 1, characterized in that, It also includes a fast interlock protection step: executed by the logic inside the FPGA, the real-time power compensation value is continuously compared with the preset power threshold multiple times, and when the number of times the power compensation value exceeds the threshold continuously reaches the preset number N, the interlock protection signal for cutting off the high voltage power supply is directly output, where N≥2.
8. A millimeter-wave power monitoring and compensation system for an ECRH system, characterized in that, The system is used to perform the millimeter-wave power monitoring and compensation method for the ECRH system as described in any one of claims 1 to 7, the system comprising: a directional coupling sampling module, an attenuation and detection module, a temperature acquisition module, a power true value acquisition module, an edge control platform, and a communication and management module; The edge control platform is configured with: The first processing unit is used to periodically call a pre-deployed low-bit quantization model at a first rate to infer and generate dynamic power compensation coefficients based on real-time temperature signals. The second processing unit communicates with the first processing unit and is used to calculate the real-time power compensation value at a second rate higher than the first rate, based on the real-time detection voltage signal and the latest dynamic power compensation coefficient, and to perform threshold comparison and interlocking logic judgment.
9. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store programs that support the processor in executing the millimeter-wave power monitoring and compensation method for the ECRH system according to any one of claims 1 to 7, and the processor is configured to execute the programs stored in the memory.
10. A storage medium storing a computer program, characterized in that, When a computer program is run by a processor, it executes the steps of the millimeter-wave power monitoring and compensation method for the ECRH system as described in any one of claims 1 to 7.