A temperature control method and system for a gas chromatography-mass spectrometer
By acquiring and analyzing temperature and flow rate data from a gas phase mass spectrometer in real time, and using a random forest model to predict thermal disturbances and adjust the PID controller, the dynamic thermal disturbance problem of the gas phase mass spectrometer temperature control system was solved, achieving precise control of the transfer line temperature and accurate quantitative analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG ZHONGTONG TESTING TECH CO LTD
- Filing Date
- 2026-05-14
- Publication Date
- 2026-07-17
AI Technical Summary
The temperature control system of existing gas chromatography-mass spectrometers is unable to cope with dynamic thermal disturbances, resulting in large temperature fluctuations in the transmission line and affecting the accuracy of quantitative analysis.
By acquiring the temperature of the chromatographic column and transfer line and the carrier gas flow rate in real time, calculating the temperature difference sequence and predicting the heat flow, predicting thermal disturbances using a random forest model, and adjusting the proportional coefficient of the PID controller based on the disturbance factor, feedforward compensation and adaptive control are achieved.
It significantly improves the control precision of the transmission line temperature, ensuring the accuracy of quantitative analysis by the gas chromatography-mass spectrometer, while taking into account the system's stability and response speed.
Smart Images

Figure CN122193481B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of temperature control technology for analytical instruments. In particular, it relates to a temperature control method and system for a gas chromatograph-mass spectrometer. Background Technology
[0002] A gas chromatography-mass spectrometry (GC-MS) system consists of two parts: a gas chromatograph and a mass spectrometer. The two parts are connected by a transmission line. The stability of the temperature control of the transmission line directly determines the accuracy and reliability of the analytical results.
[0003] Two main problems exist in the temperature-programmed analysis of samples using gas chromatography-mass spectrometry (GC-MS): First, the heat generated in the column oven during steep temperature ramps is conducted to the transfer line through physical connections, causing temperature overshoot. Second, when the carrier gas flows from the column to the transfer line, high carrier gas flow rates or large temperature differences create thermal load shocks, rapidly carrying away heat from the transfer line and causing a temperature drop. Current technologies often employ independent PID control between temperature control zones, relying solely on a fixed target temperature for lag adjustment. This approach struggles to handle the aforementioned dynamic thermal disturbances, resulting in large transfer line temperature fluctuations, control lag, and compromised accuracy of quantitative results.
[0004] Therefore, there is a need in the art for a temperature control method and system for gas chromatography-mass spectrometry to solve the problem that the above-mentioned temperature control system is unable to cope with dynamic thermal disturbances, resulting in large temperature fluctuations in the transmission line. Summary of the Invention
[0005] To address the technical problem that the aforementioned temperature control system struggles to cope with dynamic thermal disturbances, resulting in large temperature fluctuations in the transmission line, this invention provides solutions in the following aspects.
[0006] In the first aspect, a temperature control method for a gas phase mass spectrometer includes: Step S1: Real-time acquisition of column temperature, transfer line temperature and carrier gas flow rate of gas chromatograph-mass spectrometer, and acquisition of column temperature sequence and transfer line temperature sequence within a preset time window with the current time as the endpoint; Step S2: Calculate the temperature difference sequence between the transfer line temperature sequence and the chromatographic column temperature sequence, calculate the predicted heat flow rate for the next moment based on the temperature difference sequence and the current carrier gas flow rate, and calculate the perturbation factor based on the temperature difference sequence; Step S3: Correct the original temperature deviation of the PID controller based on the predicted heat flow to obtain a composite deviation; adjust the proportional coefficient of the PID controller according to the disturbance factor, and the proportional coefficient decreases as the disturbance factor increases; calculate the control quantity based on the composite deviation and the adjusted proportional coefficient to control the temperature of the transmission line. The step of calculating the predicted heat flow for the next moment based on the temperature difference sequence and the current carrier gas velocity includes: weighting and fusing the temperature difference values at each sampling moment in the temperature difference sequence using a preset time decay weight to obtain the window accumulated heat, wherein the sampling moment closer to the current moment has a larger time decay weight; obtaining the rated carrier gas velocity, and calculating the velocity coefficient based on the current carrier gas velocity and the rated carrier gas velocity; inputting the window accumulated heat and the velocity coefficient into the trained random forest model, and outputting the predicted heat flow for the next moment.
[0007] Preferably, the method for constructing the preset time decay weight includes: for each sampling moment, calculating the time interval between the current moment and the sampling moment, calculating the product of the time interval and the preset decay coefficient, using the negative of the product as the exponent and the natural constant e as the base, constructing a time decay exponential function, thereby obtaining the time decay weight for the sampling moment.
[0008] Preferably, the step of calculating the perturbation factor based on the temperature difference sequence includes: performing linear fitting on multiple temperature difference values, including the current time, to obtain a trend slope; multiplying the absolute value of the trend slope, the absolute value of the temperature difference value at the current time, and a preset scaling factor, and mapping the resulting product to obtain a perturbation factor with a value range between 0 and 1.
[0009] Preferably, the step of mapping the resulting product uses a sigmoid function.
[0010] Preferably, the step of correcting the original temperature deviation of the PID controller based on the predicted heat flow to obtain the composite deviation includes: calculating the difference between the transmission line set temperature value set by the system and the transmission line temperature at the current moment to obtain the original temperature deviation; and calculating the difference between the original temperature deviation and the predicted heat flow to obtain the composite deviation.
[0011] Preferably, the step of adjusting the proportional coefficient of the PID controller according to the disturbance factor includes: calculating the product of the disturbance factor and a preset adjustment coefficient, constructing an exponential function with the negative number of the product as the exponent and the natural constant e as the base, and multiplying the value of the exponential function with a preset benchmark proportional coefficient to obtain the adjusted proportional coefficient.
[0012] Preferably, the step of calculating the velocity coefficient based on the current carrier gas velocity and the rated carrier gas velocity includes: calculating the ratio of the current carrier gas velocity to the rated carrier gas velocity to obtain the velocity coefficient.
[0013] Preferably, the collected column temperature and transfer line temperature retain their original physical dimensions.
[0014] In a second aspect, a temperature control system for a gas chromatograph-mass spectrometer includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-described temperature control method for the gas chromatograph-mass spectrometer is implemented.
[0015] The present invention has the following effects: 1. This invention constructs a temperature difference sequence between the chromatographic column and the transfer line and calculates the predicted heat flow. The predicted heat flow is used as a feedforward term to correct the temperature deviation of the PID controller, enabling the temperature control system to sense the direction and intensity of thermal disturbances caused by column heating or carrier gas impact in advance. This achieves feedforward compensation for temperature overshoot and temperature drop, effectively solving the problem of transfer line temperature fluctuation caused by control lag in the prior art.
[0016] 2. This invention calculates the disturbance factor and adaptively adjusts the proportional coefficient of the PID controller accordingly, so that the proportional coefficient decreases exponentially as the disturbance intensity increases. This achieves the dual objectives of suppressing temperature oscillations under strong disturbances and maintaining a fast response under weak disturbances, thus taking into account both system stability and response speed.
[0017] 3. This invention separates the solid conduction tendency from the fluid convection intensity, quantifies them separately through windowed accumulated heat and flow rate coefficient, and integrates the two information using a random forest model, thereby achieving accurate prediction of complex thermal disturbances, significantly improving the control accuracy of transmission line temperature, and ensuring the accuracy of quantitative analysis by gas phase mass spectrometry. Attached Figure Description
[0018] Figure 1 This is a flowchart of steps S1-S3 in a temperature control method for a gas phase mass spectrometer according to an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0020] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0021] Reference Figure 1 A temperature control method for a gas chromatography-mass spectrometer includes steps S1-S3, as detailed below: Step S1: Real-time acquisition of column temperature, transfer line temperature and carrier gas flow rate of gas chromatograph-mass spectrometer, and acquisition of column temperature sequence and transfer line temperature sequence within a preset time window with the current time as the endpoint.
[0022] The sampling frequency is set (e.g., 10Hz), and the column temperature is acquired in real time by a platinum resistance temperature sensor installed on the outer wall of the column or inside the column oven. An analog-to-digital converter (AD converter) is then used to convert the analog temperature signal into a digital signal. Column temperature is the core variable in the programmed temperature ramp process; its value and trend directly reflect the intensity of heat radiated from the column to the transfer line, and it is also a key basis for determining the thermal hysteresis effect. The transfer line temperature is acquired in real time by a platinum resistance temperature sensor embedded in the transfer line heating block.
[0023] The gas chromatograph-mass spectrometer was divided into two regions: the column oven was defined as the first region, and the transfer line as the second region. The second region was the target region for isothermal control, while the first region served as the source of dynamic thermal disturbance in the second region. The carrier gas flow rate was collected in real time by the flow sensor built into the mass flow controller, obtaining the carrier gas flow rate from the first region into the second region at the moment of acquisition.
[0024] The purpose of collecting carrier gas flow rate data is to calculate the flow rate coefficient, which is the ratio of the current carrier gas flow rate to the rated carrier gas flow rate. In this invention, the flow rate coefficient is a key parameter for quantifying thermal load shocks. The carrier gas used in gas chromatographs (GC-MS) is typically helium or hydrogen. During programmed temperature ramping, temperature changes in the first region (i.e., changes in column temperature) affect the carrier gas temperature. When a significant temperature difference exists between the carrier gas temperature and the temperature setpoint of the second region (i.e., the transfer line temperature setpoint), the high- or low-temperature carrier gas flow will create a thermal load shock, directly causing transfer line temperature fluctuations. By introducing the flow rate coefficient, the intensity of this shock can be assessed more accurately.
[0025] Set the time window size (e.g., 5 seconds), and obtain the column temperature, transfer line temperature, and carrier gas flow rate within the time window ending at the current time, resulting in the column temperature sequence, transfer line temperature sequence, and carrier gas flow rate sequence. Since subsequent PID control needs to be calculated based on actual physical temperatures, this embodiment does not perform normalization on the temperature data, preserving the original physical dimensions.
[0026] Step S2: Calculate the temperature difference sequence between the transfer line temperature sequence and the column temperature sequence, calculate the predicted heat flow rate at the next moment based on the temperature difference sequence and the current carrier gas flow rate, and calculate the perturbation factor based on the temperature difference sequence.
[0027] The temperature difference between the transfer line temperature and the column temperature is calculated point by point within each sampling moment of the time window. After traversing all sampling moments of the time window, the temperature difference sequence is obtained. ,in , This represents the total number of sampling points within the time window. The value of the temperature difference at the current moment is represented by the time interval. The second region (transfer line) is the target for isothermal control, and its temperature is relatively stable; the first region (chromatographic column oven) is the source of dynamic disturbance, and its temperature changes drastically. The temperature difference between the two regions can intuitively reflect the driving force of heat transfer. The absolute value of the temperature difference is positively correlated with the intensity of the heat load impact. The sign of the temperature difference can be used to directly determine the direction of heat transfer, which is convenient for subsequent trend judgment.
[0028] The calculation of the predicted heat flow for the next time step based on the temperature difference sequence and the current carrier gas velocity includes: weighting and fusing the temperature difference values at each sampling time in the temperature difference sequence using a preset time decay weight to obtain the window accumulated heat, where the sampling time closer to the current time has a larger time decay weight; obtaining the rated carrier gas velocity, calculating the ratio of the current carrier gas velocity to the rated carrier gas velocity to obtain the velocity coefficient; and inputting the window accumulated heat and velocity coefficient into a trained random forest model to output the predicted heat flow for the next time step.
[0029] The method for constructing the preset time decay weight includes: for each sampling moment, calculating the time interval between the current moment and that sampling moment, calculating the product of that time interval and the preset decay coefficient, using the negative of the product as the exponent, and using the natural constant. Using this as the base, a time decay exponential function is constructed to obtain the time decay weight at that sampling moment.
[0030] The specific formula for calculating the accumulated heat of the window is as follows: In the formula, This indicates the accumulated heat at the window; This represents the total number of sampling points within the time window; The preset attenuation coefficient, The range of values is In the embodiments ; Indicates the first time within the time window The sampling time of each sampling point, i.e., the current time; Indicates the first time within the time window The sampling time of each sampling point; Indicates the first time within the time window The temperature difference value corresponding to each sampling point. Then, the attenuation coefficient and... After multiplication, it can be divided. The dimensions of the unit, so that It becomes a dimensionless parameter.
[0031] The attenuation coefficient is determined based on the system's response time. A larger value is used when the system response is fast and the sensitivity to recent disturbances is high; a smaller value is used when the system response is slow and historical data needs to be smoothed. Those skilled in the art can determine the optimal value through simple step response experiments.
[0032] The temperature difference sequence is weighted and fused using a time decay exponential function, where the sampling point closer to the current time has a larger weight. The weighted fusion result is used as the window of accumulated heat between the first and second regions, and the window of accumulated heat represents the historical temperature difference between the two regions dominated by heat conduction.
[0033] The random forest model is pre-trained using historical data. During training, the accumulated heat and velocity coefficient of the window in the historical operation are used as input features, and the actual temperature change at the next moment (i.e., the difference between the transmission line temperature at the next moment and the current moment) is used as the training label. After training, the accumulated heat and velocity coefficient of the window at the current moment are input into the random forest model, and the output of the random forest model is the predicted heat flow, which is used to characterize the estimated value of the transmission line temperature change at the next moment.
[0034] The calculation of the perturbation factor based on the temperature difference sequence includes: linearly fitting the temperature difference values from multiple consecutive sampling times, including the current time, to obtain a trend slope. The number of temperature difference values used for linear fitting can be set according to the sampling frequency; for example, if the sampling frequency is 10Hz, then 10 consecutive sampling times' temperature difference values are used for linear fitting. The absolute value of the trend slope, the absolute value of the temperature difference value at the current time, and a preset scaling factor are multiplied, and the resulting product is mapped to obtain the perturbation factor, which ranges from 0 to 1. The specific calculation formula is as follows: In the formula, Indicates the current time The perturbation factor; This indicates the preset scaling factor. The range of values is In this embodiment The scaling factor is obtained through experimental calibration, which enables the disturbance factor to effectively reflect the change in disturbance intensity under typical operating conditions. Indicates the current time The slope of the trend; Indicates the current time Temperature difference value; when scaling factor With trend slope and temperature difference value After multiplication, the trend slope can be removed. and temperature difference value The dimensions of the unit, so that It is a dimensionless parameter; express Functions used to map perturbation factors to Within this interval, it becomes a dimensionless relative intensity index. Those skilled in the art will understand that, except... In addition to the function, other nonlinear functions with saturation characteristics, such as the hyperbolic tangent function (tanh) and the arctangent function (arctan), can also be used to achieve a similar mapping effect.
[0035] The absolute value of the trend slope characterizes the rate of change of temperature difference, reflecting the abruptness of the disturbance; the absolute value of the temperature difference at the current moment represents the instantaneous intensity of the thermal load shock. Multiplying both by a scaling factor integrates the disturbance information from both the trend and instantaneous amplitude dimensions, while simultaneously converting it into a dimensionless relative quantity. The disturbance factor obtained after function mapping represents the severity of the disturbance after considering both the instantaneous rate of change and the impact intensity. The larger the disturbance factor, the more the PID controller needs to adjust its parameters to suppress temperature oscillations and ensure temperature control stability.
[0036] S3: Correct the original temperature deviation of the PID controller based on the predicted heat flow to obtain the composite deviation; adjust the proportional coefficient of the PID controller according to the disturbance factor, and the proportional coefficient decreases as the disturbance factor increases; calculate the control quantity based on the composite deviation and the adjusted proportional coefficient to control the temperature of the transmission line.
[0037] The core correction logic of a traditional PID controller is based on closed-loop regulation using the static temperature deviation of the transmission line (i.e., the original temperature deviation). The original temperature deviation at the current moment is obtained by the difference between the set temperature of the transmission line and the current temperature of the transmission line. Predicting heat flow can anticipate the thermal shock caused by the first region to the second region, therefore it is used as a feedforward term to correct the original deviation. The correction process includes: calculating the difference between the original temperature deviation and the predicted heat flow to obtain the composite deviation.
[0038] By predicting heat flow to correct the original temperature deviation of the PID controller, feedforward compensation for thermal load shocks is achieved. When the chromatographic column is at a low temperature, the temperature difference between the column and the transfer line is extremely large. The carrier gas forms strong convection at low temperature, generating a severe thermal load shock that rapidly removes heat from the transfer line. At this time, the predicted heat flow is negative, and the composite deviation increases accordingly. The PID controller increases the heating power in advance to compensate for the heat removed by the carrier gas, preventing the transfer line temperature from dropping or becoming under-temperatured. When the column temperature is higher than the transfer line temperature, high-temperature conduction forms a thermal load shock. At this time, the predicted heat flow is positive, and the composite deviation decreases accordingly. The PID controller reduces the heating power in advance to prevent temperature overshoot.
[0039] Adjusting the proportional gain of the PID controller based on the disturbance factor includes: calculating the product of the disturbance factor and the preset adjustment coefficient, using the negative of the product as the exponent, and using the natural constant... Using the base as the base, an exponential function is constructed. The value of this exponential function is then multiplied by a preset baseline scaling factor to obtain the adjusted scaling factor. The specific formula is as follows: In the formula, Indicates the current time The proportional coefficient after adjustment by the PID controller; This represents a preset baseline scaling factor, in this embodiment... This value was determined through experimental comparison and can achieve a balance between system stability and response speed; This indicates the preset adjustment coefficient. The range of values is In this embodiment ; Indicates the current time The disturbance factor.
[0040] The adjustment coefficient is used to control the rate at which the proportional coefficient decays with the intensity of the disturbance. The closer it is to 0, the lower the sensitivity of the proportional coefficient to changes in disturbance, and the system behavior tends to be similar to that of a traditional fixed-parameter PID. The closer the coefficient is to 1, the faster the proportionality coefficient decays with increasing disturbance, and the more aggressively the system suppresses disturbances. In practical applications, The specific value can be adjusted according to the system's thermal inertia and control accuracy requirements.
[0041] The disturbance factor is used to characterize the severity of instantaneous thermal load shocks. The magnitude of the disturbance factor directly determines the direction of adjustment of the proportional coefficient: when the disturbance factor is large, it indicates severe temperature fluctuations and high system dynamic uncertainty. In this case, the proportional coefficient needs to be reduced to decrease the response speed and suppress temperature oscillations; when the disturbance factor is small, the proportional coefficient needs to be increased to quickly eliminate residuals. The above adjustments are achieved through exponential mapping, making the proportional coefficient transition nonlinearly and smoothly with the disturbance intensity.
[0042] After obtaining the composite deviation and the adjusted proportional coefficient, the composite deviation is substituted into the adjusted PID parameters. The control quantity at the current moment is calculated by the PID control algorithm. The control quantity is then converted into a PWM drive signal and output to the transmission line heating actuator to adjust the heating power in real time.
[0043] Simultaneously, the column temperature, transfer line temperature, and carrier gas flow rate are continuously collected. The predicted heat flux calculation and disturbance factor calculation in step S2, as well as the deviation correction and proportional coefficient adaptive adjustment in step S3, are executed cyclically to form a closed-loop control. This ensures that the temperature in the second region remains stable near the set temperature value throughout the entire temperature program in the first region, meeting the analytical accuracy requirements of the gas chromatograph-mass spectrometer.
[0044] This application also discloses a temperature control system for a gas chromatograph-mass spectrometer. The system includes a processor and a memory. The memory stores computer program instructions. When the computer program instructions are executed by the processor, the temperature control method of the gas chromatograph-mass spectrometer according to the above embodiments of the present invention is implemented.
[0045] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0046] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A temperature control method for a gas chromatograph-mass spectrometer, characterized in that, include: Step S1: Real-time acquisition of column temperature, transfer line temperature and carrier gas flow rate of gas chromatograph-mass spectrometer, and acquisition of column temperature sequence and transfer line temperature sequence within a preset time window with the current time as the endpoint; Step S2: Calculate the temperature difference sequence between the transfer line temperature sequence and the chromatographic column temperature sequence, calculate the predicted heat flow rate for the next moment based on the temperature difference sequence and the current carrier gas flow rate, and calculate the perturbation factor based on the temperature difference sequence; The step of calculating the perturbation factor based on the temperature difference sequence includes: performing linear fitting on multiple temperature difference values including the current time to obtain a trend slope; multiplying the absolute value of the trend slope, the absolute value of the temperature difference value at the current time, and a preset scaling factor, and mapping the resulting product to obtain a perturbation factor with a value range between 0 and 1. Step S3: Correct the original temperature deviation of the PID controller based on the predicted heat flow to obtain the composite deviation; adjust the proportional coefficient of the PID controller according to the disturbance factor, and the proportional coefficient decreases as the disturbance factor increases; calculate the control quantity based on the composite deviation and the adjusted proportional coefficient to control the temperature of the transmission line. The calculation of the predicted heat flow for the next moment based on the temperature difference sequence and the current carrier gas velocity includes: weighting and fusing the temperature difference values at each sampling moment in the temperature difference sequence using a preset time decay weight to obtain the window accumulated heat, where the sampling moment closer to the current moment has a larger time decay weight; obtaining the rated carrier gas velocity, and calculating the velocity coefficient based on the current carrier gas velocity and the rated carrier gas velocity; inputting the window accumulated heat and the velocity coefficient into the trained random forest model to output the predicted heat flow for the next moment.
2. The temperature control method for a gas chromatography-mass spectrometer according to claim 1, characterized in that, The method for constructing the preset time decay weight includes: for each sampling moment, calculating the time interval between the current moment and the sampling moment, calculating the product of the time interval and the preset decay coefficient, using the negative of the product as the exponent, and using the natural constant. Using this as the base, a time decay exponential function is constructed to obtain the time decay weight at that sampling moment.
3. The temperature control method for a gas chromatography-mass spectrometer according to claim 1, characterized in that, The step of mapping the resulting product uses a sigmoid function.
4. The temperature control method for a gas chromatograph-mass spectrometer according to claim 1, characterized in that, The step of correcting the original temperature deviation of the PID controller based on the predicted heat flow to obtain the composite deviation includes: calculating the difference between the transmission line set temperature value set by the system and the transmission line temperature at the current moment to obtain the original temperature deviation; and calculating the difference between the original temperature deviation and the predicted heat flow to obtain the composite deviation.
5. The temperature control method for a gas chromatography-mass spectrometer according to claim 1, characterized in that, The step of adjusting the proportional coefficient of the PID controller according to the disturbance factor includes: calculating the product of the disturbance factor and the preset adjustment coefficient, and using the negative of the product as the exponent, and using the natural constant... Using the base, construct an exponential function, and multiply the value of the exponential function by a preset benchmark proportional coefficient to obtain the adjusted proportional coefficient.
6. The temperature control method for a gas phase mass spectrometer according to claim 1, characterized in that, The step of calculating the velocity coefficient based on the current carrier gas velocity and the rated carrier gas velocity includes: calculating the ratio of the current carrier gas velocity to the rated carrier gas velocity to obtain the velocity coefficient.
7. The temperature control method for a gas chromatography-mass spectrometer according to claim 1, characterized in that, The collected column temperature and transfer line temperature retain their original physical dimensions.
8. A temperature control system for a gas phase mass spectrometer, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the temperature control method for a gas chromatograph-mass spectrometer according to any one of claims 1-7.