A teaching-oriented artificial intelligence assisted interferometer measurement error self-compensation method, system and application
By constructing an M-Loop-PID dual-layer intelligent compensation architecture, and utilizing neural network algorithms and digital PID modules to collaboratively control the interferometer, the problem of interferometer measurement accuracy being affected by the environment was solved, achieving real-time error compensation and improving teaching effectiveness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- EAST CHINA NORMAL UNIV
- Filing Date
- 2025-06-17
- Publication Date
- 2026-05-22
AI Technical Summary
In undergraduate physics experiments, the measurement accuracy of interferometers is greatly affected by environmental factors. Traditional manual adjustment methods are time-consuming and prone to errors. The lack of examples of artificial intelligence technology makes it difficult for students to understand the combination of modern technology and physics knowledge, thus limiting their innovation capabilities.
A neural network algorithm is used for interferometer phase optimization, combined with digital PID real-time error compensation, to construct an M-Loop-PID dual-layer intelligent compensation architecture, realizing global intelligent optimization and local rapid stabilization control. Through the collaborative control of the M-Loop machine learning loop package and the digital PID module, external environmental errors are monitored and automatically compensated in real time.
It improves the accuracy and efficiency of experimental measurements, cultivates students' innovative thinking and interdisciplinary literacy, and significantly enhances the stability and measurement accuracy of the interferometer, making it suitable for high-precision optical measurement and control in teaching and scientific research.
Smart Images

Figure CN120800173B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of optical interferometry and precision control, specifically relating to a teaching-oriented artificial intelligence-assisted interferometer measurement error self-compensation method, system, and application. Background Technology
[0002] With the development of artificial intelligence (AI) technology, its advantages in physics research are becoming increasingly apparent. AI can help improve experimental performance, automate equipment operation, reduce human error, and increase experimental accuracy and efficiency, among other things. However, the lack of concrete examples of AI technology in undergraduate physics experimental teaching makes it difficult for students to combine physics knowledge with modern technology, potentially limiting their innovative abilities.
[0003] Interferometers, as key tools in precision measurement, are crucial in undergraduate physics experiments. However, their phase stability is easily affected by environmental factors such as temperature fluctuations, mechanical vibrations, and air turbulence, leading to interference signal drift and impacting measurement accuracy and experimental repeatability. Traditional methods of manually adjusting optical devices are time-consuming and error-prone. Therefore, quickly and accurately locking the interferometer to any phase and maintaining long-term stability is essential for precision measurement. Summary of the Invention
[0004] Addressing the needs of physics experiment teaching, this invention applies a neural network algorithm for interferometer phase optimization, uses digital PID to compensate for errors in real time and lock the interferometer phase, and innovatively constructs a dual-layer intelligent compensation architecture of global optimization by artificial intelligence and local stabilization control by digital PID. This provides a teaching-oriented AI-assisted interferometer measurement error self-compensation method, system, and application, solving the problems of insufficient teaching cases for dynamic error compensation and inadequate integration of cutting-edge technologies in traditional experimental teaching. The system in this invention demonstrates how combining M-Loop and PID with interferometer experiments improves interferometer performance. Furthermore, it creates an M-Loop-PID hierarchical control system, integrating the latest achievements such as adaptive optics compensation technology. This dual-layer architecture collaboratively controls the interferometer, improving experimental measurement accuracy and efficiency. It also provides undergraduate students with opportunities to engage with cutting-edge measurement methods, gain a deeper understanding of interferometers and artificial intelligence, cultivate innovative thinking, enhance hardware control capabilities, and improve undergraduate students' interdisciplinary literacy.
[0005] This invention provides an AI-assisted interferometer measurement error self-compensation method for teaching purposes. The method primarily utilizes machine learning and digital PID to construct a two-layer intelligent architecture, achieving global intelligent optimization and local rapid stabilization. It dynamically and automatically compensates for phase shifts in the interferometer caused by external environmental errors in real time. The error self-compensation method introduces a real-time triggering mechanism that continuously monitors the interferometer output and automatically re-optimizes and adjusts the control when the error exceeds a set threshold. The error self-compensation method includes the following steps:
[0006] Step 1: Construct an optical interferometer containing a dual-phase modulator; the dual-phase modulator includes a first phase modulator and a second phase modulator;
[0007] Step 2: The interference signal is detected by a photodetector, acquired by a data acquisition card, and transmitted to the M-Loop-PID dual-layer control architecture in the Python computing platform, which includes the M-Loop machine learning loop package and the digital PID control module.
[0008] Step 3: Establish hardware communication for the feedback closed-loop control system. Transmit the output of the Python computing platform to the second voltage controller via USB cable, and transmit the output of the second voltage controller to the second phase controller in the optical interferometer via BNC cable.
[0009] Step 4: Establish a pseudo-error simulation mechanism. Transmit the output of the random module in Python to the first voltage controller via USB cable, and transmit the output of the first voltage controller to the first phase controller in the optical interferometer via BNC cable.
[0010] Step 5: Activate the real-time monitoring mechanism; the system monitors the interference signals transmitted from the data acquisition card in real time.
[0011] Step 6: Run the random module to modulate the first phase modulator with a random voltage signal, simulating random environmental interference experienced by the optical interferometer;
[0012] Step 7: Real-time triggering mechanism of M-Loop-PID dual-layer control architecture: The M-Loop-PID dual-layer control architecture can automatically run when the system detects that the error caused by environmental disturbance exceeds the preset real-time triggering threshold. Under the synergy of global intelligent optimization of M-Loop and local rapid control and stabilization of PID, the optical interferometer feeds back the voltage signal to the second phase modulator in real time, and compensates for the system error after training and prediction of the M-Loop-PID dual-layer control architecture.
[0013] In the two-layer control architecture, the M-Loop machine learning loop package is the upper-layer intelligent agent, and the digital PID control module is the lower-layer controller.
[0014] In step seven, specifically, when the real-time monitoring mechanism in the system detects that the deviation between the interference signal and the optimal phase-sensitive point exceeds a threshold, the M-Loop machine learning loop package globally searches for the optimal parameter that minimizes the cost function. After finding the optimal parameter, the M-Loop machine learning loop package feeds the minimum cost and the optimal parameter to the digital PID control module. The digital PID control module sets the minimum cost as the locking point and takes a preset interval centered on the optimal parameter as the fine-tuning range of the feedback signal, achieving local fine-tuning to compensate for errors. The M-Loop machine learning loop package constructs a cost function based on the deviation between the interference signal intensity and the optimal phase-sensitive point, and performs global optimization through a neural network; specifically, it uses an internal neural network algorithm to find the point that minimizes the cost function globally.
[0015] The digital PID control module uses the minimum cost output by the M-Loop machine learning loop package as the locking point, and takes a preset interval centered on the optimal parameters as the fine-tuning range of the PID feedback signal to achieve rapid fine-tuning and compensation of interferometer errors.
[0016] The global optimization refers to finding the optimal parameters that minimize the cost function during the training iteration process, and optimizing the parameters in the optical interferometer in the direction of minimizing the cost function.
[0017] The optimal phase-sensitive point is the interferometer signal output value corresponding to the maximum phase sensitivity of the calibrated interferometer. In the experiment, the smaller the deviation between the interference signal and the optimal phase-sensitive point, i.e. the cost function, the higher the phase sensitivity of the interferometer.
[0018] The optimal phase-sensitive point can be obtained through a calibration process or set as a fixed reference value by the teacher or the system. The system supports importing this value as a configuration file or allowing the user to manually input it in the graphical user interface, ensuring that the target state can be freely set according to the experimental task during teaching demonstrations, thus enhancing the interpretability and flexibility of the experiment.
[0019] The first phase modulator introduces random interference to simulate an error environment; and / or,
[0020] The dual-layer control architecture has differentiated timing characteristics; the optimization cycle of the M-Loop machine learning loop package is in the second range; the adjustment cycle of the digital PID control module is in the millisecond range; and the M-Loop machine learning loop package and the digital PID control module achieve time-domain decoupling through serial communication.
[0021] After receiving the optimal cost function predicted by the M-Loop machine learning loop package, the digital PID control module applies fast voltage feedback to the second phase modulator to compensate for errors and stabilize the output of the optical interferometer.
[0022] The artificial neural network algorithm of the M-Loop machine learning loop package, combined with the digital PID control module, is used to optimize the parameters of the optical interferometer.
[0023] The cost function describes the difference between the experimental output and the optimal phase-sensitive point under the prediction parameter settings of the M-Loop machine learning loop package.
[0024] And / or,
[0025] The real-time trigger threshold satisfies: k = α·I 目标 Where k is the real-time trigger threshold, α∈[0.05,0.15], I 目标 This represents the target value, achieving a dynamic balance between global optimization of the M-Loop and local stability of the PID.
[0026] The M-Loop-PID dual-layer control architecture in this invention leverages the advantages of both the M-Loop and PID algorithms while mitigating their disadvantages. While the M-Loop can find the optimal parameters for error compensation in experiments, it cannot continuously provide real-time feedback on the compensation error. The PID, after finding the optimal parameters at a certain moment, can take over the experiment to achieve this function. However, the limitation of using the PID control algorithm alone is that the strength of the proportional, integral, and derivative terms needs to be appropriately adjusted to quickly and effectively stabilize errors within a certain range. This makes proper adjustment of the three proportional coefficients of the PID crucial; improper adjustment can lead to excessively long oscillation time before locking and potentially loss of locking accuracy. The global optimization of the M-Loop can precisely compensate for this. Before the PID starts running, the M-Loop has already found the optimal parameters for the experiment globally, lowering the starting point of PID compensation, shortening the oscillation time, and reducing the sensitivity of PID locking accuracy to the proportional coefficients.
[0027] This invention also provides a global optimization method for finding the optimal phase-sensitive point in an interferometer, the method comprising:
[0028] Step i: Construct an optical interferometer containing a dual-phase modulator; the dual-phase modulator includes a first phase modulator and a second phase modulator;
[0029] Step ii: Detect the interference signal using a photodetector, acquire it via a data acquisition card, and transmit it to the Python computing platform;
[0030] Step iii: Establish a communication link between the computer and the interferometer to form a global parameter optimization loop of the M-Loop;
[0031] Step iv: Using the neural network model in M-Loop with nonlinear feature extraction capability, a cost function is established based on the deviation between the interference signal intensity and the optimal phase-sensitive point. When the cost function exceeds the threshold, the global search algorithm of M-Loop is started. The parameters that minimize the cost function are obtained through reinforcement learning iteration in the loop, thus completing the global optimization.
[0032] If the cost function cost is greater than the preset threshold k, the artificial neural network iterates through the training set to predict new parameters.
[0033] If the cost function does not reach its minimum value, then continue to feed back and predict new parameters;
[0034] or,
[0035] If the cost function reaches its minimum value, the optimal cost is output.
[0036] This invention also provides a method for fine-tuning and compensating for errors in local parameters of an interferometer based on digital PID control, the method comprising:
[0037] Step a: Construct an optical interferometer containing a dual-phase modulator; the dual-phase modulator includes a first phase modulator and a second phase modulator;
[0038] Step b: Establish a communication link between the computer and the interferometer, form a high-frequency feedback fine-tuning loop for the local parameters of the PID, and set the target locking point;
[0039] Step c: Detect the interference signal using a photodetector, acquire it via a data acquisition card, and transmit it to the Python computing platform;
[0040] Step d: Adjust the proportional (P), integral (I), and derivative (D) parameters of the PID controller to optimize the PID locking effect;
[0041] Step e: Run the PID controller to generate a fast high-frequency feedback signal, drive the second phase modulator to compensate for errors, and stabilize the output.
[0042] Step d further includes:
[0043] Step 1) Set the integral and derivative parameters to 0, and select a preset conservative P value, for example, starting from 10% of the system's maximum control quantity (the maximum control quantity is the theoretical upper limit of the controller's output signal, corresponding to the output capability of the actuator in 100% working state), so that the system can operate stably.
[0044] Step 2) Gradually increase the value of P and observe the system response. When the P value increases to the point where the system amplitude begins to oscillate sinusoidally with time, return to the previous stable P value. This improves the system response speed while avoiding oscillations.
[0045] Step 3) After adjusting the P value, gradually increase the I value to eliminate steady-state error and avoid system oscillation.
[0046] Step 4) After adjusting P and I, gradually increase the value of D to reduce overshoot and oscillation while maintaining the fastest system response speed;
[0047] Step 5) Repeat steps 2)-4) above, gradually fine-tuning the P, I, and D parameters until the system achieves the most ideal dynamic and steady-state performance.
[0048] The present invention also provides a system for implementing any of the above methods, the system comprising: an optical interferometer, a first phase modulator, a second phase modulator, a first voltage controller, a second voltage controller, a photodetector, a data acquisition card, and the M-Loop machine learning loop package, a digital PID module, and a random module in a Python computing platform;
[0049] The optical interferometer is used to output phase information related to the measured physical quantity;
[0050] The first phase modulator is mounted on one arm of the optical interferometer and connected to the first voltage controller. It receives random signals from the random module to simulate random errors in the real environment.
[0051] The second phase modulator is mounted on the other arm of the optical interferometer and connected to the second voltage controller. It is used to receive feedback from the M-Loop or PID and apply it to the interferometer to achieve automatic error compensation.
[0052] The first voltage controller receives random voltage values generated by the random module in the Python module to drive the first phase modulator;
[0053] The second voltage controller receives the voltage value fed back to the interferometer from the M-Loop or PID in the Python module to drive the second phase modulator;
[0054] The photodetector is used to receive the outgoing light from the interferometer and convert the optical signal into an electrical signal for output.
[0055] The data acquisition card is used to acquire the electrical signals of the photodetector and transmit them to the local computer for interference system error detection.
[0056] The M-Loop machine learning loop package is used to make a preliminary judgment on system stability by subtracting the experimental values obtained by the data acquisition card from the cost function formed by the optimal phase sensitivity point. In the loop, the neural network is trained by controlling the parameter input voltage of the second phase modulator to find the optimal cost and optimal parameters for the experiment. In the method described in Experiment 3, M-Loop will feed its optimal cost to the underlying controller PID module.
[0057] The PID module is used to implement negative feedback regulation of the interferometer output to stabilize it at the target locking point by superimposing proportional, integral, and derivative calculations. In the method described in Experiment 3, the upper-level intelligent agent M-Loop finds the optimal cost and uses that optimal cost as its locking setpoint.
[0058] The random module is used to send random signals to the first voltage controller and is installed in the Python computing platform.
[0059] The present invention also provides the application of the above-mentioned method or system in teaching demonstrations, intelligent experimental platform construction, and high-precision optical measurement and control.
[0060] This invention significantly improves the system's robustness training capability against non-ideal environmental disturbances by introducing a random disturbance simulation mechanism, enabling students to understand the principle of adaptive control under "semi-real error" conditions. At the same time, through a two-layer asynchronous decoupling, automatic re-triggering mechanism and modular communication structure, it realizes an intelligent compensation architecture for a general interferometer platform, which has good teaching and research expansion value.
[0061] The beneficial effects of this invention include: The proposed AI-assisted interferometer measurement error self-compensation method for teaching purposes, by constructing a dual-layer intelligent control architecture combining M-Loop and digital PID, achieves real-time detection and dynamic compensation of interferometer measurement errors, effectively improving the stability and measurement accuracy of the optical interferometer system. Compared to traditional manual adjustment or single control strategies, this invention utilizes the M-Loop module for global optimization of interferometer system parameters, possessing nonlinear feature extraction and autonomous learning capabilities, enabling rapid optimization even under external disturbances. Simultaneously, the introduction of a digital PID module performs millisecond-level high-frequency fine-tuning of the optimal target output by the M-Loop, further enhancing system response speed and output stability, achieving coordinated control of global intelligent optimization and local rapid stabilization. The M-Loop-PID dual-layer intelligent architecture leverages the advantages of both the M-Loop and PID algorithms while mitigating their disadvantages. While M-Loop can find the optimal parameters for error compensation in experiments, it cannot continuously provide real-time feedback on the compensation error. PID control, after finding the optimal parameters at a certain moment through M-Loop, can take over the experiment to achieve this function. However, the limitation of using the PID control algorithm alone is that the strength of the proportional, integral, and derivative terms needs to be appropriately adjusted to quickly and effectively stabilize errors within a certain range. This makes proper adjustment of the three proportional coefficients of the PID crucial; improper adjustment can lead to excessively long oscillation time before locking and potentially loss of locking accuracy. M-Loop's global optimization precisely compensates for this. Before the PID starts running, M-Loop has already found the optimal parameters for the experiment globally, lowering the starting point of PID compensation, shortening the oscillation time, and reducing the sensitivity of PID locking accuracy to the proportional coefficients. This method is not only suitable for the intuitive presentation of dynamic error compensation principles in teaching demonstration environments but also for the stable control of high-precision interferometric measurements in scientific research experiments. By constructing a closed-loop system with a real-time re-trigger mechanism, the interferometer output can be continuously monitored, and automatic re-optimization and control can be performed when the error exceeds a set threshold, significantly improving the system's adaptability to environmental changes. Attached Figure Description
[0062] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 This is a schematic diagram of Experiment 1 of an AI-assisted interferometer measurement error self-compensation method proposed in this invention for teaching purposes.
[0064] Figure 2 This is a schematic diagram of Experiment 2 of the AI-assisted interferometer measurement error self-compensation method proposed in this invention for teaching purposes.
[0065] Figure 3 This is a flowchart of Experiment 3 of an AI-assisted interferometer measurement error self-compensation method proposed in this invention for teaching purposes.
[0066] Figure 4 This is a schematic diagram of an AI-assisted interferometer measurement error self-compensation system for teaching proposed in this invention. Detailed Implementation
[0067] The present invention will be further described in detail below with reference to the specific embodiments and accompanying drawings. Except for the contents specifically mentioned below, the processes, conditions, and experimental methods for implementing the present invention are all common knowledge and general knowledge in the art, and the present invention does not have any particular limitations.
[0068] This invention provides an AI-assisted self-compensation method for interferometer measurement errors, geared towards educational purposes. The method is based on the open-source machine learning loop package M-Loop and the digital PID control package from the Python scientific computing ecosystem. Experiment 1 demonstrates how combining M-Loop with an interferometer experiment achieves global optimization of the interferometer's optimal phase sensitivity point. Experiment 2 demonstrates how the digital PID module acts as a low-level controller, performing millisecond-level fine-tuning of the interferometer's phase in the linear parameter domain to compensate for errors. Experiment 3 combines M-Loop and PID algorithms to construct a two-layer intelligent compensation architecture. The M-Loop module acts as the upper-level intelligent agent for global optimization, while the digital PID module acts as the low-level controller for high-frequency fine-tuning, collaboratively controlling the optical interferometer experimental platform, demonstrating the process of real-time monitoring of the interferometer and automatic compensation of measurement errors.
[0069] This invention presents an AI-assisted interferometer measurement error self-compensation method for educational purposes. Through three experiments, it demonstrates the application of M-Loop (Machine-learning Online Optimization Package) for interferometer phase optimization, the application of digital PID (Proportional Integral Derivative) for real-time interferometer phase stabilization, and the creation of an M-Loop-PID hierarchical control system. Through training and iteration using the open-source machine learning package M-Loop as the upper-level agent, the system automatically optimizes the interferometer parameters towards the minimum cost function. The found optimal cost is fed back to the digital PID as the lower-level controller. The digital PID stabilizes the interferometer output as the optimal cost predicted by M-Loop through small, rapid feedbacks, achieving automatic error compensation for the interferometer measurement system over a long period. Furthermore, the system monitors the interferometer output in real time. When environmental changes cause the cost function to exceed a threshold, the M-Loop is restarted to find a new optimal cost and optimized parameters.
[0070] The M-Loop, or M-Loop Hybrid Learning Loop Package, is a machine learning package that uses artificial neural network algorithms (ANN) to communicate and interact with experiments, thereby achieving global optimization of experimental parameters.
[0071] The PID controller is a combination of three control algorithms: Proportional, Integral, and Differential. In closed-loop control that communicates with the experiment, it can effectively and quickly correct small deviations of the controlled object, enabling the experimental output to reach a stable state.
[0072] The cost function, in this method, describes the difference between the experimental output under the M-Loop's predicted parameter settings and the calibrated optimal phase-sensitive point. Its specific form is: Cost Function = Interferometer Experimental Output Value - calibrated Optimal Phase-Sensitive Point. The value k is a pre-set threshold for starting the M-Loop. When external factors cause the interferometer output to deviate from the optimal phase-sensitive point by more than k, the M-Loop uses an artificial neural network algorithm to predict new parameters and feed them back to the experiment in a loop to compensate for the error. Ultimately, it finds the globally optimal parameters and the optimal cost that allow the experiment to reach the optimal phase-sensitive point. In the M-Loop-PID hierarchical control system, after the optimal cost is fed to the PID controller, the PID controller provides a small amount of rapid feedback to stabilize the experimental output at the optimal cost. The setting of k is determined by the experiment. Within a certain range, the smaller k is, the more sensitive the system is to external disturbances, and the higher the compensation accuracy. However, if the k value is too small, it will increase the system's operating time cost and may even prevent the optimal parameters from being found. Based on the actual adjustable range of the experimental parameters, the M-Loop is set to search for the optimal parameters within this range.
[0073] Example 1
[0074] like Figure 1 As shown, Experiment 1 in this embodiment is used to demonstrate the specific steps of M-Loop in global optimization of the optimal phase-sensitive point of the interferometer, including:
[0075] Step i, Initialization settings. Construct an optical interferometer with dual phase modulators, where the first phase modulator simulates environmental interference through a pseudo-random phase signal generated by the random module, and the second phase modulator is connected to the M-Loop feedback output;
[0076] Step ii: Use a photodetector to detect the interference signal and use a data acquisition card to collect it. Transmit the interference signal intensity to a Python computing environment with M-Loop installed.
[0077] Step iii: Establish a communication link between the computer and the interferometer to form a global parameter optimization loop of the M-Loop;
[0078] Step iv: Construct a neural network model with nonlinear feature extraction capability through M-Loop, establish a cost function based on the deviation between the interference signal intensity and the optimal phase-sensitive point, and start the global search algorithm of M-Loop when the cost function exceeds the threshold. Obtain the parameters that minimize the cost function through reinforcement learning iteration in the loop.
[0079] Example 2
[0080] like Figure 2As shown, Experiment 2 in this embodiment demonstrates the specific steps for fine-tuning and compensating for errors in the local parameters of an interferometer under digital PID control, and for stabilizing the interferometer phase in real time. These steps include:
[0081] Step a, Initialization settings. Construct an optical interferometer with dual-phase modulators, where the first phase modulator simulates environmental interference through a pseudo-random phase signal generated by the random module, and the second phase modulator is connected to the PID feedback output;
[0082] Step b: Establish a communication link between the computer and the interferometer, form a high-frequency feedback fine-tuning loop for the local parameters of the PID, and set the target locking point;
[0083] Step c: Use a photodetector to detect the interference signal and use a data acquisition card to collect it. Transmit the interference signal intensity to a Python computing environment with PID control.
[0084] Step d: Adjust the proportional (P), integral (I), and derivative (D) parameters of the PID controller until the PID locking effect is optimal.
[0085] Step e: Run the PID controller. The linear control algorithm of the digital PID controller generates a high-frequency fine-tuning signal to provide a small amount of fast feedback for the experiment, so that the system outputs stably.
[0086] Example 3
[0087] like Figure 3 As shown, Experiment 3 in this embodiment outlines the specific steps for constructing an M-Loop-PID hierarchical control system, including:
[0088] Step 1: Set up the interferometer;
[0089] Step 2: Establish communication between the computer (Python) and the interferometer's experimental value output and control parameter input devices.
[0090] Step 3: M-Loop Initialization Setup. Based on the experimental objective, determine the parameters that need to be optimized. Input the initialization data, such as the threshold k of the cost function, the parameter range, and the target value of the cost function, into the M-Loop machine learning loop package to complete the initialization setup of the M-Loop machine learning loop package.
[0091] Step 4: PID initialization settings. Adjust the PID parameters according to the experiment.
[0092] Step 5: Run the M-Loop program. The interferometer's output is detected and judged through the M-Loop hybrid learning loop package. When external disturbances cause the cost function value to exceed the set threshold k, the neural network algorithm (ANN) will predict new parameters in the iteration and determine whether the cost function has reached its minimum value. If it has not, the new parameters are input into the experimental feedback control interferometer. The M-Loop receives the interferometer's output again for detection and judgment, forming a closed-loop control. In this loop process, the cost function is updated in the direction of minimization until the cost function value is less than the threshold k or the minimum cost value is found.
[0093] Step 6: At this point, the M-Loop pauses. To ensure the compensation effect on the interferometer over a long period of time, the M-Loop feeds the optimal cost to the PID controller as its lock-in setpoint and locks it through the communication line. The PID controller provides a small amount of fast feedback by superimposing proportional, integral, and derivative calculation methods to achieve stable output over a long period of time.
[0094] Specifically, to further enhance the continuity and response accuracy of the control process, this invention establishes an interruption-recovery mechanism between the M-Loop and the PID module. Specifically, when the M-Loop detects that the interferometer output deviation is less than a preset threshold k, it automatically enters a pause state and transmits the optimal cost value obtained in the current loop as the setpoint to the PID module. The PID module then takes over control, implementing high-frequency fine-tuning to maintain stable system output. When the system detects an error exceeding the threshold k again during continuous monitoring, the M-Loop is automatically reactivated and retrains the neural network iteratively. This mechanism ensures the system possesses good dynamic response capabilities and long-term stability, while significantly reducing the computational resource consumption of the neural network.
[0095] Step 7: If external environmental interference causes the cost function to exceed the threshold k again, the M-Loop will restart and repeat steps 5 and 6. The interferometer dynamically adjusts under the feedback of the M-Loop algorithm and the PID algorithm, realizing self-compensation of interferometric measurement system errors under long-term monitoring.
[0096] Figure 3 The control flow of a two-layer intelligent architecture-assisted interferometer measurement error self-compensation method for teaching purposes, as described in this invention, is demonstrated.
[0097] The image includes:
[0098] Initialization settings: First, set the parameters required for the experiment, including the optimal phase sensitivity point, threshold k, stopping conditions, etc.
[0099] Experimental value acquisition: The interferometer operates under simulated environmental disturbances (such as random interference applied by the first phase modulator) and outputs experimental values read by the data acquisition device and transmits them to the Python platform.
[0100] Error assessment: The M-Loop module in Python is used to calculate the cost function, which is the deviation between the experimental value and the optimal phase-sensitive point. When the deviation (i.e., cost) is greater than the threshold k, the M-Loop neural network training set is started to update the parameters.
[0101] M-Loop optimization: The neural network iteratively optimizes the system parameters until it finds the minimum cost or reduces the error to a threshold range.
[0102] PID takeover control: When the M-Loop output meets the conditions, the optimal cost is used as the setpoint and transmitted to the digital PID module, which is responsible for fine-tuning the interferometer at a high frequency (such as acting on the second phase modulator) to compensate for errors and ensure stable system output.
[0103] Closed-loop control: When the system detects a new error exceeding the threshold k, it triggers the M-Loop again to enter the optimization loop, achieving continuous adaptive error compensation.
[0104] Example 4
[0105] This embodiment demonstrates an AI-assisted interferometer measurement error self-compensation system for teaching purposes.
[0106] The system mainly comprises an optical interferometer, a first phase modulator, a second phase modulator, a first voltage controller, a second voltage controller, a data acquisition card, and the M-Loop machine learning loop package, digital PID module, and random module from the Python module. The interferometer can measure the physical quantity to be measured based on phase information. However, interference from non-measured physical quantities in the environment can cause a decrease in experimental accuracy and efficiency. This device utilizes artificial intelligence algorithms for experimental loop training and feedback to find the optimal parameters, and uses a PID algorithm to provide fast, small-scale, stable feedback output for the experiment, compensating for phase shifts caused by real-time environmental errors over long periods.
[0107] The optical interferometer is used to accurately measure the physical quantity to be measured by outputting phase information.
[0108] The first phase modulator is used to simulate random errors in a real environment. It is mounted on one arm of the interferometer and connected to a first voltage controller. By randomly changing the voltage applied to it, random errors can be generated in the interferometric system.
[0109] The second phase modulator is used to receive feedback from the M-Loop or PID controller and apply it to the interferometer to achieve automatic error compensation. It is mounted on one arm of the interferometer and connected to a second voltage controller. The feedback parameters, as voltage inputs, can change the relative phase of the two arms of the interferometer.
[0110] The first voltage controller is used to drive the first phase modulator. It communicates with the Python module via a USB cable through VISA, and receives random voltage values generated by the random module called by Python as the voltage driver connected to the first phase modulator.
[0111] The second voltage controller is used to drive the second phase modulator. It communicates with Python via a USB cable through VISA, and receives the voltage value fed back to the interferometer from the M-Loop or PID as the voltage output to drive the second phase modulator;
[0112] The data acquisition card is used to input the interferometer's output experimental values into Python. It communicates with Python via a USB cable using VISA, and inputs the real-time experimental values into Python for interferometric system error detection during each loop.
[0113] The M-Loop hybrid learning loop package is publicly available and can be installed on a computer and programmed using Python. It compares the cost function, derived by subtracting the experimental values obtained from the data acquisition card from the optimal phase-sensitive point, with a set threshold to make a preliminary judgment on system stability. Through neural network control of the parameter input voltage of the second phase modulator, and after multiple training loops, it can find the optimal parameters for locking the target phase to compensate for phase shifts caused by environmental fluctuations, enabling the interferometer system to quickly reach the target phase.
[0114] The digital PID module, a digital PID control package within the Python scientific computing ecosystem, provides high-frequency, low-volume feedback to experimental parameters through the superposition of proportional, integral, and derivative algorithms, enabling the interferometer to remain stable at the target phase-locked value for an extended period. For the M-Loop-PID hierarchical control system, the optimal cost function received from the M-Loop is the optimal phase-locked value.
[0115] The random module is used to randomly generate voltage signals to input to the first voltage controller to simulate random environmental interference.
[0116] like Figure 4 The figure shown is a schematic diagram of a teaching-oriented artificial intelligence-assisted interferometer measurement error self-compensation method system proposed in this invention.
[0117] The figure shows the structural composition of the system of the present invention in terms of hardware and software connection and inter-module interaction, which is divided into three main parts: interferometer interface, VISA communication device, and Python control platform.
[0118] Interferometer interface:
[0119] It includes a first phase modulator and a second phase modulator, which are used to introduce random disturbances and receive control feedback, respectively.
[0120] The photodetector receives the interference output light signal and converts it into an electrical signal, which is then transmitted to the data acquisition card.
[0121] VISA communication equipment:
[0122] The first / second voltage controller receives voltage settings from the Python platform to drive the corresponding phase modulator.
[0123] The data acquisition card transmits the detected signals back to the Python platform in real time via the VISA communication interface.
[0124] Python control platform:
[0125] The random module is responsible for generating the simulated random perturbation voltage for the first phase modulator.
[0126] The M-Loop package and the digital PID module are responsible for building a two-layer control architecture, where M-Loop trains the neural network and outputs the optimal parameters, and PID performs high-frequency fine-tuning control.
[0127] The dual-layer control output voltage is fed back to the second phase modulator through the voltage controller, thereby controlling the interferometer output in a closed loop.
[0128] The scope of protection of this invention is not limited to the above embodiments. Any variations and advantages that can be conceived by those skilled in the art without departing from the spirit and scope of this invention are included in this invention and are protected by the appended claims.
Claims
1. A method for self-compensation of measurement errors in an AI-assisted interferometer for teaching purposes, characterized in that, The method constructs a two-layer intelligent architecture through collaborative machine learning and digital PID, enabling global intelligent optimization and local rapid stabilization, and dynamically and automatically compensates for phase shifts in the interferometer caused by external environmental errors in real time; it includes the following steps: Step 1: Construct an optical interferometer containing a dual-phase modulator; the dual-phase modulator includes a first phase modulator and a second phase modulator; Step 2: The interference signal is detected by a photodetector, acquired by a data acquisition card, and transmitted to the M-Loop-PID dual-layer control architecture in the Python computing platform, which includes the M-Loop machine learning loop package and the digital PID control module. Step 3: Transmit the output of the Python computing platform to the second voltage controller, and transmit the output of the second voltage controller to the second phase controller in the optical interferometer to establish hardware communication for the feedback closed-loop control system. Step 4: Transmit the output of the random module in the Python computing platform to the first voltage controller, and transmit the output of the first voltage controller to the first phase controller in the optical interferometer to establish a pseudo-error simulation mechanism. Step 5: The system monitors the interference signals transmitted from the data acquisition card in real time; Step 6: Run the random module to modulate the first phase modulator with a random voltage signal, simulating random environmental interference experienced by the optical interferometer; Step 7: When the random environmental interference exceeds the preset real-time trigger threshold, the M-Loop-PID dual-layer control architecture is used to coordinate the global intelligent optimization of M-Loop and the local rapid control and stabilization of PID, and the voltage signal is fed back to the second phase modulator in real time to compensate for the error. In the M-Loop-PID dual-layer control architecture, the M-Loop machine learning loop package is the upper-layer intelligent agent, and the digital PID control module is the lower-layer controller. When the deviation between the interference signal and the optimal phase-sensitive point exceeds a preset threshold, the M-Loop machine learning loop package searches globally for the optimal parameter that minimizes the cost function. After finding the optimal parameter, the M-Loop machine learning loop package feeds the minimum cost and the optimal parameter to the digital PID control module. The digital PID control module sets the minimum cost as the locking point and sets the fine-tuning range of the feedback signal to achieve local fine-tuning to compensate for the error. The cost function is constructed by the M-Loop machine learning loop package based on the deviation between the interference signal intensity and the optimal phase-sensitive point. The M-Loop machine learning loop package uses an internal neural network algorithm to find the point that minimizes the cost function globally. The optimal phase-sensitive point is the interferometer signal output value corresponding to the best phase sensitivity of the calibrated interferometer. The digital PID control module uses the minimum cost output by the M-Loop machine learning loop package as the locking point, sets the fine-tuning range of the feedback parameters of the digital PID control module, and performs fine-tuning to compensate for the interferometer error. The global intelligent optimization refers to finding the optimal parameters that minimize the cost function during the training iteration process, and the parameters in the optical interferometer are optimized in the direction of minimizing the cost function.
2. The method as described in claim 1, characterized in that, After receiving the optimal cost function predicted by the M-Loop machine learning loop package, the digital PID control module applies fast voltage feedback to the second phase modulator to compensate for errors and stabilize the output of the optical interferometer. The artificial neural network algorithm of the M-Loop machine learning loop package, combined with the digital PID control module, is used to optimize the parameters of the optical interferometer. The real-time trigger threshold satisfies: Where k is the real-time trigger threshold, ∈[0.05,0.15], This represents the target value, achieving a dynamic balance between global optimization of the M-Loop and local stability of the PID controller; The dual-layer control architecture has differentiated timing characteristics; the optimization cycle of the M-Loop machine learning loop package is in the second range; the adjustment cycle of the digital PID control module is in the millisecond range; and the M-Loop machine learning loop package and the digital PID control module achieve time-domain decoupling through serial communication.
3. The method as described in claim 1, characterized in that, The global intelligent optimization method includes: Step i: Construct an optical interferometer containing a dual-phase modulator; the dual-phase modulator includes a first phase modulator and a second phase modulator; Step ii: Detect the interference signal using a photodetector, acquire it via a data acquisition card, and transmit it to the Python computing platform; Step iii: Establish a communication link between the computer and the interferometer to form a global parameter optimization loop of the M-Loop; Step iv: Using the neural network model in M-Loop with nonlinear feature extraction capability, a cost function is established based on the deviation between the interference signal intensity and the optimal phase-sensitive point. When the cost function exceeds the threshold, the global search algorithm of M-Loop is started. The parameters that minimize the cost function are obtained through reinforcement learning iteration in the loop, thus completing the global optimization.
4. The method as described in claim 3, characterized in that, If the cost function is greater than the preset threshold k, the artificial neural network iterates through the training set to predict new parameters. If the cost function does not reach its minimum value, then continue to feed back and predict new parameters; or, If the cost function reaches its minimum value, the optimal cost is output.
5. A system for implementing the method as described in any one of claims 1-4, characterized in that, The system includes: an optical interferometer, a first phase modulator, a second phase modulator, a first voltage controller, a second voltage controller, a photodetector, a data acquisition card, and the M-Loop machine learning loop package, digital PID module, and random module in the Python computing platform; The optical interferometer is used to output phase information related to the measured physical quantity; The first phase modulator is mounted on one arm of the optical interferometer and connected to the first voltage controller. It receives random signals from the random module to simulate random errors in the real environment. The second phase modulator is mounted on the other arm of the optical interferometer and connected to the second voltage controller. It is used to receive feedback from the M-Loop or PID and apply it to the interferometer to achieve automatic error compensation. The first voltage controller receives random voltage values generated by the random module in the Python module to drive the first phase modulator; The second voltage controller receives the voltage value fed back to the interferometer from the M-Loop or PID in the Python module to drive the second phase modulator; The photodetector is used to receive the outgoing light from the interferometer and convert the optical signal into an electrical signal for output. The data acquisition card is used to acquire the electrical signals of the photodetector and transmit them to the local computer for interference system error detection. The M-Loop machine learning loop package is used to make a preliminary judgment on the system stability by subtracting the experimental values obtained by the data acquisition card from the cost function formed by the optimal phase sensitivity point. In the loop, the neural network is trained by controlling the parameter input voltage of the second phase modulator to find the optimal cost and optimal parameters for the experiment. The PID module is used to provide feedback by superimposing proportional, integral and derivative operations to stabilize the interferometer output at the target locking point. The random module is used to send random signals to the first voltage controller and is installed in the Python computing platform.
6. The application of the method as described in any one of claims 1-4, or the system as described in claim 5, in teaching demonstrations, intelligent experimental platform construction, and high-precision optical measurement and control.