Multi-heating-rod flow cell constant temperature control method, flow cell and near infrared spectrum device
Patent Information
- Application Number
- CN202611507318.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]本发明为了解决上述问题,提出了一种多加热棒流通池恒温控制方法、流通池及近红外光谱设备,本发明通过双延迟深度确定性策略梯度算法确定的脉宽调制占空比,实现多加热棒的自适应功率分配,提高了局部加热速度和温度稳定性;引入样品特征吸收峰波长偏移量作为状态输入和奖励函数惩罚项,以及将光谱采集稳定状态引入奖励函数,能够直接感知温度扰动引起的光谱峰位变化,实现温度反馈和光谱峰位反馈双闭环控制,使控制不仅追求温度误差最小,还同时优化了升温速度、温度波动、超调量、能耗、控制量变化、水特征吸收峰波长偏移量和可采集状态进入时间,解决了局部温度不均匀和流动扰动导致光谱不稳定的问题
本发明根据获取的液体样品相关状态数据,以及预设的双延迟深度确定性策略梯度算法,确定与流通池上多个加热棒对应的脉宽调制占空比,根据脉宽调制占空比确定多个加热棒的功率分配;通过双延迟深度确定性策略梯度算法确定的脉宽调制占空比,实现多加热棒的自适应功率分配,提高了局部加热速度和温度稳定性;引入样品特征吸收峰波长偏移量作为状态输入和奖励函数惩罚项,以及将光谱采集稳定状态引入奖励函数,能够直接感知温度扰动引起的光谱峰位变化,实现温度反馈和光谱峰位反馈双闭环控制,使控制不仅追求温度误差最小,还同时优化了升温速度、温度波动、超调量、能耗、控制量变化、水特征吸收峰波长偏移量和可采集状态进入时间,解决了局部温度不均匀和流动扰动导致光谱不稳定的问题。
Smart Images

Figure CN123010939A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of near-infrared spectroscopy online detection and intelligent temperature control technology, and particularly relates to a method for constant temperature control of a multi-heating rod flow cell, the flow cell, and a near-infrared spectroscopy device. Background Technology
[0002] In online near-infrared (NIR) spectroscopy of liquid samples, the sample typically enters the NIR detection region through a flow cell, and the light source obtains a spectral signal reflecting the sample's composition after passing through the sample. However, NIR spectral signals are extremely sensitive to changes in sample temperature. Even small fluctuations in sample temperature can alter molecular vibrational states, hydrogen bonding interactions, and absorption characteristics, leading to peak shifts, changes in peak intensity, baseline drift, and spectral shape. For NIR spectroscopy systems that rely on chemometric models for quantitative analysis, temperature perturbations reduce spectral repeatability and model prediction accuracy.
[0003] In current near-infrared liquid sample detection, temperature control aims to achieve the set overall temperature without incorporating factors such as the stability of spectral peak positions in the near-infrared spectral acquisition area and energy consumption constraints into the control objectives. Furthermore, the characteristic absorption peaks in liquid samples are highly sensitive to temperature changes, local thermal distribution changes, and flow state changes. When the sample temperature or the local thermal state of the flow cell changes, the peak positions of the characteristic absorption peaks acquired in adjacent control cycles will shift. If only temperature sensors are relied upon for feedback control, there are problems such as the sensor measurement position not being completely consistent with the actual spectral detection area, uneven local temperature, and spectral instability caused by flow disturbances. Summary of the Invention
[0004] To address the aforementioned problems, this invention proposes a multi-heater flow cell isothermal control method, a flow cell, and a near-infrared spectroscopy device. This invention utilizes a pulse width modulation duty cycle determined by a dual-delay depth deterministic gradient algorithm to achieve adaptive power allocation across multiple heating rods, improving local heating speed and temperature stability. By introducing the sample's characteristic absorption peak wavelength offset as a state input and a penalty term in the reward function, and by incorporating the stable spectral acquisition state into the reward function, it can directly sense spectral peak position changes caused by temperature disturbances. This enables dual closed-loop control with temperature and spectral peak position feedback, ensuring that control not only minimizes temperature error but also optimizes heating rate, temperature fluctuation, overshoot, energy consumption, control quantity changes, water characteristic absorption peak wavelength offset, and the time to reach the acquireable state. This solves the problems of spectral instability caused by local temperature non-uniformity and flow disturbances.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solution: In a first aspect, the present invention provides a method for constant temperature control of a multi-heating rod flow cell, comprising: Acquire state data related to the liquid sample; the state data includes at least the wavelength shift of the sample's characteristic absorption peak. Based on the state data and the preset dual-delay depth deterministic strategy gradient algorithm, the pulse width modulation duty cycle corresponding to the multiple heating rods on the flow cell is determined. The reward function of the dual-delay depth deterministic strategy gradient algorithm includes a temperature error penalty term, a temperature change penalty term, an overshoot penalty term, an energy consumption penalty term, a control quantity change penalty term, a sample characteristic absorption peak wavelength shift penalty term, and a spectral acquisition stability reward term. The sample characteristic absorption peak wavelength shift is the difference between the peak position of the sample characteristic absorption peak in the current control cycle and the peak position of the sample characteristic absorption peak in the previous control cycle. When both the temperature of the detection area and the sample characteristic absorption peak wavelength shift simultaneously meet the preset stability conditions, the spectral acquisition stability reward term is positive; otherwise, the spectral acquisition stability reward term is zero. The power distribution of multiple heating rods is determined based on the pulse width modulation duty cycle.
[0006] Furthermore, the status data includes one or more of the following: current temperature of the spectral detection area, temperature change amount, temperature change rate, temperature error, wavelength shift of the sample characteristic absorption peak, pulse width modulation duty cycle of the heating rod in the previous control cycle, and cumulative energy consumption.
[0007] Furthermore, the temperature change is the difference between the temperature of the near-infrared spectral detection area at the current moment and the temperature of the near-infrared spectral detection area at the previous moment; the temperature error is the difference between the temperature of the near-infrared spectral detection area at the current moment and the target set temperature.
[0008] Furthermore, the reward function is: ; in, This is the reward value for the current control period; This is a dimensionless temperature error penalty term; This is a dimensionless temperature fluctuation penalty term; This is a dimensionless energy consumption penalty term; This is a dimensionless overshoot penalty term; This is a penalty term for changes in dimensionless control quantities; This is a penalty term for the wavelength shift of the characteristic absorption peak of the dimensionless sample. This is a reward item for the stable state of dimensionless spectral acquisition. , , , , , , All are dimensionless weighting coefficients.
[0009] Furthermore, when the temperature of the detection area and the wavelength shift of the sample's characteristic absorption peak meet the preset stability conditions, the near-infrared spectrum of the liquid sample to be tested is acquired; otherwise, temperature control and spectral peak position feedback control continue to be executed. The preset stability conditions include whether the absolute error between the current temperature and the target temperature is less than a preset temperature threshold, whether the absolute value of the wavelength shift of the sample's characteristic absorption peak before and after adjacent control cycles is less than a preset peak position shift threshold, and whether the duration for which the temperature error and peak position shift simultaneously meet the stability conditions is greater than a preset stability holding time.
[0010] Furthermore, the training environment for the dual-delay deep deterministic strategy gradient algorithm includes a residual temperature prediction model; the residual temperature prediction model includes a physical temperature rise prediction module and a residual prediction module; when the rated power, installation location, or heat transfer efficiency of multiple heating rods are not completely the same, the physical temperature rise prediction module uses a weighted superposition model of multiple heating rods to calculate the base temperature change trend as follows: ; in, The base predicted temperature for the next control cycle obtained by the physical temperature rise prediction module; The sample temperature near the near-infrared spectroscopy detection region during the current control cycle; To control the cycle; Equivalent heat capacity; , , , These are the equivalent heating efficiency coefficients; , , , These represent the actual equivalent heating power of the four heating rods during the current control cycle. The equivalent heat dissipation coefficient between the flow cell detection area and the environment; The ambient temperature.
[0011] Furthermore, the residual prediction module is used to learn the nonlinear residual between the actual flow cell temperature response and the physical temperature rise prediction module. The final predicted temperature is expressed as the sum of the basic predicted temperature obtained by the physical temperature rise prediction module and the temperature residual determined by the residual prediction module.
[0012] Secondly, the present invention also provides a multi-heating rod flow cell, including a flow cell body, a temperature sensor and multiple heating rods disposed on the flow cell body; the temperature sensor and multiple heating rods are all connected to a control terminal, the control terminal being configured to: determine the pulse width modulation duty cycle corresponding to the multiple heating rods on the flow cell based on the acquired state data and a preset dual-delay depth deterministic strategy gradient algorithm; and determine the power distribution of the multiple heating rods based on the pulse width modulation duty cycle; The reward function of the dual-delay deep deterministic strategy gradient algorithm includes a temperature error penalty, a temperature change penalty, an overshoot penalty, an energy consumption penalty, a control quantity change penalty, a sample characteristic absorption peak wavelength shift penalty, and a spectral acquisition stable state reward. The sample characteristic absorption peak wavelength shift is the difference between the peak position of the sample characteristic absorption peak in the current control cycle and the peak position of the sample characteristic absorption peak in the previous control cycle. When the temperature of the detection area and the sample characteristic absorption peak wavelength shift simultaneously meet the preset stability conditions, the spectral acquisition stable state reward is positive; otherwise, the spectral acquisition stable state reward is zero.
[0013] Furthermore, the flow cell body is provided with a threaded through hole, and the temperature sensor is installed in the threaded through hole; the detection end of the temperature sensor extends into the sample flow channel of the flow cell body to detect the temperature of the liquid sample to be tested in the flow cell; fiber optic probes are respectively provided on two opposite sides of the flow cell body; a PTFE gasket is provided between the fiber optic probe and the flow cell body. A flow tank end cap is provided on one side of the flow tank body; a silicone gasket is provided between the flow tank body and the flow tank end cap; an explosion-proof connector is provided on the flow tank end cap, and an explosion-proof cable is connected to the explosion-proof connector.
[0014] Thirdly, the present invention also provides a near-infrared spectroscopy device, including a multi-heating rod flow cell as described in the second aspect.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention determines the pulse width modulation (PWM) duty cycle corresponding to multiple heating rods on a flow cell based on the acquired liquid sample state data and a preset dual-delay depth deterministic strategy gradient algorithm. The power allocation of the multiple heating rods is then determined based on the PWM duty cycle. The PWM duty cycle determined by the dual-delay depth deterministic strategy gradient algorithm enables adaptive power allocation among the multiple heating rods, improving local heating speed and temperature stability. By introducing the sample characteristic absorption peak wavelength shift as a state input and a penalty term in the reward function, and by incorporating the stable state of spectral acquisition into the reward function, the invention can directly perceive spectral peak position changes caused by temperature disturbances. This achieves dual closed-loop control with temperature feedback and spectral peak position feedback, ensuring that the control not only minimizes temperature error but also optimizes heating rate, temperature fluctuation, overshoot, energy consumption, control quantity changes, water characteristic absorption peak wavelength shift, and the time to enter the acquireable state. This solves the problems of spectral instability caused by local temperature non-uniformity and flow disturbances. Attached Figure Description
[0016] The accompanying drawings, which form part of this embodiment, are used to provide a further understanding of this embodiment. The illustrative embodiments and their descriptions are used to explain this embodiment and do not constitute an improper limitation of this embodiment.
[0017] Figure 1 This is an exploded view of the multi-heating rod flow cell of Embodiment 1 of the present invention; Figure 2 This is a cross-sectional view of the multi-heating rod flow cell of Embodiment 1 of the present invention; Figure 3 This is a rear view of the flow cell end cap structure of Embodiment 1 of the present invention; Figure 4 This is a front view of the flow cell end cap structure of Embodiment 1 of the present invention; Figure 5 This is a schematic diagram of the internal functional unit structure of the control terminal in Embodiment 1 of the present invention; Figure 6 This is a schematic diagram of the training connection between the residual LSTM temperature prediction model based on physical temperature rise prediction and the TD3 intelligent control unit in Embodiment 1 of the present invention. Figure 7 This is a flowchart of the temperature stability determination, sample characteristic absorption peak wavelength shift determination, and near-infrared spectrum acquisition triggering process in Embodiment 1 of the present invention. The components include: 1. Flow cell body; 2. Temperature sensor; 3. Pair wire; 4. Fiber optic probe; 5. Heating rod; 6. PTFE gasket; 7. Silicone gasket; 8. Locking nut; 9. Explosion-proof cable; 10. Explosion-proof connector; and 11. Flow cell end cap. Detailed Implementation
[0018] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0019] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0020] Example 1: Near-infrared spectroscopy (NIR) technology offers advantages such as high detection speed, minimal or no sample pretreatment, and the ability to perform online detection. It is widely used in pharmaceutical analysis, food testing, chemical process monitoring, traditional Chinese medicine extraction process monitoring, and bio-fermentation process monitoring. In online detection of liquid samples, the sample typically enters the near-infrared spectroscopy detection region through a flow cell. After the light source passes through the sample, it obtains a spectral signal reflecting the sample's composition.
[0021] However, near-infrared spectral signals are extremely sensitive to changes in sample temperature. Even minute fluctuations in sample temperature can alter molecular vibrational states, hydrogen bonding, and absorption characteristics, leading to peak shifts, changes in peak intensity, baseline drift, and spectral shape in the near-infrared spectrum. For near-infrared spectroscopy systems that rely on chemometric models for quantitative analysis, temperature perturbations reduce spectral repeatability and model prediction accuracy.
[0022] In current near-infrared liquid sample detection, temperature regulation is typically achieved using a constant-temperature water bath, fixed-power heating, or PID control. Constant-temperature water baths are complex in structure and have slow response times, hindering the miniaturization and rapid response of online detection devices. Fixed-power heating cannot adaptively adjust the heating power based on initial sample temperature, flow rate changes, and environmental disturbances, easily leading to insufficient or overheating. Traditional PID control relies on manual parameter tuning, which is prone to overshoot, oscillation, or slow response when dealing with flow cell thermal inertia, time lag, flow rate fluctuations, and initial sample temperature changes.
[0023] Furthermore, existing temperature control devices typically only aim to achieve the set overall temperature, without incorporating the stability of spectral peak positions in the near-infrared spectral acquisition region and energy consumption constraints into the overall control objectives. For online near-infrared spectroscopy detection, the key factors truly affecting spectral stability include not only the sample temperature in the flow cell but also the state of the spectral peak positions of the sample within the corresponding region of the spectral acquisition window at the moment of acquisition.
[0024] Characteristic absorption peaks in liquid samples are highly sensitive to changes in temperature, local thermal distribution, and flow state. When the sample temperature or the local thermal state of the flow cell changes, the peak positions of the characteristic absorption peaks acquired in adjacent control cycles will shift. If only a temperature sensor is relied upon for feedback control, problems may arise such as the sensor measurement location not being completely consistent with the actual spectral detection area, local temperature inhomogeneity, and flow disturbances causing spectral instability.
[0025] The Twin Delayed Deep Deterministic Policy Gradient (TD3) algorithm is a deep reinforcement learning algorithm suitable for continuous action spaces. It is well-suited for optimizing continuous control variables such as pulse-width modulation (PWM) duty cycle and heating power. Applying the TD3 algorithm to distributed temperature control of multiple heating rods in a flow cell allows for dynamic output of the continuous PWM duty cycle based on the current temperature state, temperature change trend, historical control actions, energy consumption information, and sample characteristic absorption peak wavelength shift information. This enables adaptive adjustment of the heating power of multiple heating rods.
[0026] However, training reinforcement learning algorithms directly on real flow cell equipment presents challenges such as long training times, high sample consumption, and the risk of overheating during the exploration process. Therefore, a temperature prediction model can be used as an interactive training environment for the TD3 algorithm. While ordinary LSTM temperature prediction models can learn the patterns of temperature sequence changes, directly predicting the complete temperature requires simultaneously learning complex factors such as heating, cooling, thermal inertia, flow perturbations, and heat transfer non-uniformity. This makes model training difficult and prone to accumulating errors during long-term rolling predictions.
[0027] To solve at least one of the above problems, such as Figure 1 and Figure 2 As shown, one embodiment of the present invention provides a multi-heating rod flow cell, including a flow cell body 1, a temperature sensor 2, a pair of wires 3, an optical fiber probe 4, a heating rod 5, a PTFE gasket 6, a silicone gasket 7, a locking nut 8, an explosion-proof cable 9, an explosion-proof connector 10, a flow cell end cap 11, and a control terminal, etc.
[0028] The flow cell body 1 is the main structure for liquid sample flow, heating, and near-infrared spectroscopy detection. A sample flow channel is provided inside the flow cell body 1. The liquid sample to be tested enters the sample flow channel through the inlet of the flow cell body 1, flows through the near-infrared spectroscopy detection area, and then flows out through the outlet.
[0029] A threaded through hole is drilled on one side of the flow cell body 1, and the temperature sensor 2 is installed in this threaded through hole. The detection end of the temperature sensor 2 extends into or near the sample flow channel to detect the temperature of the liquid sample to be tested in the flow cell in real time. By placing the temperature sensor 2 in the threaded through hole on one side of the flow cell body 1, the stability and sealing of the temperature sensor 2 installation can be improved, and the temperature detection position can be made closer to the near-infrared spectroscopy detection region.
[0030] The flow cell body 1 is provided with four heating rod blind holes, and four heating rods 5 are respectively inserted into the four heating rod blind holes. The heating rod blind holes do not penetrate the flow cell body 1 to avoid leakage of the liquid sample to be tested from the heating rod installation position. The four heating rod blind holes are arranged close to the sample flow channel or the detection area of the fiber optic probe 4, so that the heating rods 5 can perform local rapid heating on the sample flowing through the near-infrared spectroscopy detection area. The four heating rods 5 can have the same or different rated power, and the control terminal can adjust the PWM duty cycle of the four heating rods separately. In some other embodiments, the flow cell body 1 can also be provided with two, three, or more heating rods 5 through a corresponding number of heating rod blind holes.
[0031] The flow cell body 1 is also provided with four threaded blind holes for connection with bolts. The flow cell end cap 11 is fixedly installed to the end of the flow cell body 1 by bolts. The bolts are screwed into the threaded blind holes on the flow cell body 1, thereby pressing and fixing the flow cell end cap 11 to the flow cell body 1. The silicone gasket 7 is disposed between the flow cell body 1 and the flow cell end cap 11 to improve the sealing of the connection of the flow cell end cap 11 and prevent sample liquid leakage. In some other embodiments, the flow cell body 1 may also be provided with two, three, or more threaded blind holes for fixing the flow cell end cap 11.
[0032] Two fiber optic probe threaded holes are respectively provided on opposite sides of the flow cell body 1, and two fiber optic probes 4 are respectively installed in the threaded holes. The two fiber optic probes 4 are arranged opposite each other on both sides of the sample flow channel. One fiber optic probe is used to introduce the light source into the liquid sample to be tested in the flow cell, and the other fiber optic probe is used to receive the near-infrared spectral signal after passing through the sample, thereby forming a near-infrared spectral detection optical path. A PTFE gasket 6 can be placed between the fiber optic probe 4 and the flow cell body 1 to improve the sealing and corrosion resistance of the connection.
[0033] A rectangular groove is provided on one side of the flow cell body 1 for placing the silicone gasket 7.
[0034] The silicone gasket 7 is disposed between the flow cell body 1 and the flow cell end cap 11 to achieve a seal between the flow cell body 1 and the flow cell end cap 11 when the flow cell end cap 11 is pressed and fixed. The silicone gasket 7 includes a plate-shaped gasket body, the size of which is adapted to the size of the rectangular groove of the flow cell body 1.
[0035] The silicone gasket 7 has through holes at its four corners, which correspond to the threaded blind holes on the flow cell body 1 and the bolt mounting holes on the flow cell end cap 11. Bolts are passed through the bolt through holes on the flow cell end cap 11 and the silicone gasket 7, and then screwed into the threaded blind holes on the flow cell body 1, thereby pressing the flow cell end cap 11, the silicone gasket 7, and the flow cell body 1 together.
[0036] In some embodiments, the silicone pad 7 has a shaped through hole in its center. The shaped through hole includes a central through hole and a plurality of radially extending grooves communicating with the central through hole. The central through hole is used to avoid the installation structure of the explosion-proof connector 10, and the radially extending grooves correspond to the installation position of the heating rod 5, allowing the heating rod 5 to pass through and avoiding the heating rod installation structure.
[0037] The heating rod 5 passes through the radial extension groove of the silicone pad 7 and is inserted into the heating rod blind hole on the flow cell body 1. The radial extension groove is used to avoid and position the heating rod. The wire of the heating rod 5 is placed in the radial extension groove and led out to the control terminal through the explosion-proof connector on the flow cell end cover 11.
[0038] When the flow cell end cap 11 is tightened onto the flow cell body 1 with bolts, the silicone gasket 7 is compressed and deformed, forming an elastic seal between the flow cell body 1, the flow cell end cap 11, the heating rod 5 mounting area, and the wire routing area, preventing external liquid from entering. By providing radially extending grooves on the silicone gasket 7, it is possible to simultaneously achieve heating rod 5 installation avoidance, wire routing, end face sealing, and internal space positioning, thereby improving the compactness of the flow cell structure and the reliability of the seal.
[0039] like Figure 3 and Figure 4 As shown, the flow cell end cap 11 includes an end cap body, and bolt through holes are respectively provided at the four corners of the end cap body. The bolt through holes correspond to the threaded blind holes on the flow cell body 1. After the bolt passes through the bolt through holes on the flow cell end cap 11, it is screwed into the threaded blind holes of the flow cell body 1, thereby fixing the flow cell end cap 11 to the flow cell body 1.
[0040] The flow cell end cap 11 has a sealing and pressing surface on the side near the flow cell body 1. The sealing and pressing surface is used to press the silicone gasket 7 between the flow cell body 1 and the flow cell end cap 11. When the bolts are tightened, the flow cell end cap 11 applies a pressing force to the silicone gasket 7 through the sealing and pressing surface, causing the silicone gasket 7 to undergo elastic compression, thereby achieving a sealed connection between the flow cell body 1 and the flow cell end cap 11.
[0041] The flow tank end cap 11 has an explosion-proof connector mounting hole in the middle, and the explosion-proof connector 10 mounting hole penetrates the end cap body. The explosion-proof connector 10 is inserted into the explosion-proof connector mounting hole and is tightened and fixed to the flow tank end cap 11 by a nut.
[0042] The outer side of the flow tank end cap 11 is provided with an installation step, installation groove, or reinforcing boss around the installation hole of the explosion-proof connector 10, which is used to limit, support, or press and fix the explosion-proof connector 10. The inner side of the flow tank end cap 11 is provided with an installation boss around the installation hole of the explosion-proof connector 10, and the installation boss is provided with an installation groove, which is used to accommodate and limit the locking nut 8 of the explosion-proof connector 10.
[0043] The shape of the mounting groove is adapted to the shape of the locking nut 8, allowing the locking nut 8 to be embedded within the mounting groove. The mounting groove provides circumferential restraint for the locking nut 8. When the explosion-proof connector 10 is tightened with the locking nut 8, the locking nut 8 is confined within the mounting groove and does not rotate synchronously with the explosion-proof connector, thus achieving rapid locking and installation of the explosion-proof connector. With this structure, when installing the explosion-proof connector 10, there is no need to use a wrench to hold the locking nut 8; the explosion-proof connector 10 can be rotated to achieve the clamping and fixing between the explosion-proof connector 10 and the flow tank end cover 11. This structure improves assembly convenience, reduces installation space requirements, and enhances the installation stability of the explosion-proof connector 10 on the flow tank end cover 11.
[0044] With the above structure, the flow cell end cap 11 can simultaneously achieve the functions of sealing the end of the flow cell body 1, clamping and fixing the explosion-proof connector 10, and sealing and leading out the electrical connection cable, thereby improving the sealing performance, assembly stability and electrical safety of the device.
[0045] The explosion-proof connector 10 is installed on the end cover 11 of the flow tank to achieve sealed lead-out of the heating rod 5 cable. The explosion-proof cable 9 is connected to the explosion-proof connector 10 to achieve a safe electrical connection between the heating rod 5 and the control terminal.
[0046] The pair wire 3 engages with the threaded hole of the fiber optic probe 4 to press and fix the fiber optic probe 4. After the fiber optic probe 4 is inserted into the threaded holes on both sides of the flow cell body 1, the pair wire 3 is screwed into the threaded hole of the fiber optic probe, so that the fiber optic probe 4 is pressed and fixed on the flow cell body 1, thereby ensuring the relative position stability between the fiber optic probe 4 and the sample flow channel. The PTFE gasket 6 is disposed between the fiber optic probe 4, the pair wire 3, or the flow cell body 1 to improve the sealing and corrosion resistance of the connection of the fiber optic probe 4.
[0047] The fiber optic probe 4 is used to introduce near-infrared light into the liquid sample to be tested within the flow cell body 1, and to receive the near-infrared light signal after transmission, absorption, or scattering by the liquid sample, thereby achieving near-infrared spectral acquisition of the liquid sample. The fiber optic probes 4 are positioned opposite each other on both sides of the flow cell body 1, forming a near-infrared spectral detection area between the two fiber optic probes 4. When the liquid sample flows through this detection area, the near-infrared light interacts with the sample, and the spectral acquisition unit obtains the near-infrared spectral information of the sample based on the received light signal.
[0048] The heating rod 5 is a cylinder, and its size is adapted to the blind hole of the heating rod in the flow cell body 1.
[0049] The explosion-proof cable 9 is connected to the explosion-proof connector 10 and is led out from the end cover 11 of the flow pool via the explosion-proof connector 10, and further connected to the control terminal to realize the electrical connection between the heating rod 5 and the control terminal.
[0050] The control terminal is connected to the heating rod 5, the temperature sensor 2, and the fiber optic probe 4. For example... Figure 5 As shown, the control unit integrates a power acquisition unit, a power drive unit, a near-infrared spectral acquisition unit, a spectral peak shift calculation unit, a TD3 intelligent control unit, and a spectral acquisition trigger unit.
[0051] One embodiment of the present invention also provides a method for isothermal control of a multi-heating rod flow cell, illustrating the content of the control terminal. This method enables dual closed-loop control of temperature feedback and spectral peak position feedback, allowing the sample to rapidly enter and maintain a stable target temperature range within the near-infrared spectral detection region. Simultaneously, it reduces the wavelength shift of the sample's characteristic absorption peaks before and after adjacent control cycles, thereby improving the repeatability of near-infrared spectral acquisition and the stability of the quantitative analysis model. The specific implementation process of the method and the control terminal is as follows: The power acquisition unit is used to collect one or more of the following: heating rod operating voltage, operating current, real-time power, and cumulative energy consumption, to represent the energy consumption of the device. The power drive unit is used to adjust the heating power of multiple heating rods according to the PWM duty cycle output by the TD3 intelligent control unit.
[0052] The near-infrared spectroscopy acquisition unit is used to acquire the near-infrared spectrum of the liquid sample to be tested in the flow cell via a near-infrared spectrometer connected to a fiber optic probe. The spectral peak position shift calculation unit is used to extract the peak positions of the sample's characteristic absorption peaks in the near-infrared spectra of the current and previous control cycles, and to calculate the wavelength shift of the sample's characteristic absorption peaks before and after adjacent control cycles. .
[0053] The wavelength shift of the sample characteristic absorption peak before and after adjacent control cycles is expressed as: ; in, This represents the wavelength shift of the sample's characteristic absorption peak before and after the current control cycle. This represents the peak position of the characteristic absorption peak of the sample acquired during the current control cycle. This refers to the peak position of the characteristic absorption peak of the sample acquired in the previous control cycle.
[0054] The wavelength shift of the sample characteristic absorption peak before and after the current control cycle Used to characterize the degree of change in the peak position of the sample's characteristic absorption peak within adjacent control periods. A large value (e.g., greater than the preset upper limit) indicates that the sample spectral peak position changes significantly within adjacent control periods, suggesting that the sample temperature, local heat distribution, or flow state remains unstable; when When the value is small (e.g., less than the preset lower limit), it indicates that the peak position of the sample's characteristic absorption peak changes little, suggesting that the near-infrared spectroscopy acquisition state is becoming stable.
[0055] The dual-delay deep deterministic policy gradient (TD3) intelligent control unit includes an Actor network, a target Actor network, a first Critic network, a second Critic network, a first target Critic network, a second target Critic network, and an experience replay pool. The Actor network outputs heating control actions based on the current state; the first and second Critic networks estimate the state-action value function respectively, and the smaller of the two estimates is used in the target value calculation to reduce overestimation of the value function; the Actor network uses a delayed update method for policy optimization; smoothing noise is added to the target action to improve the stability of the temperature control strategy. Figure 6 As shown, its Markov Decision Process (MDP) is constructed as follows: The TD3 intelligent control unit constructs a state space based on the temperature of the spectral detection area, temperature error, temperature change rate, real-time wavelength shift of the characteristic absorption peak of the sample, PWM duty cycle of the previous control cycle, and cumulative energy consumption. s t : ; in, T t The current temperature of the spectral detection area; This refers to the change in temperature. The rate of temperature change; This is for temperature error; This refers to the real-time wavelength shift of the characteristic absorption peaks of the sample read by the near-infrared spectrometer. The duty cycle of the heating rod pulse width modulation (PWM) in the previous control cycle; This represents cumulative energy consumption.
[0056] The temperature change is: ; in, T represents the temperature of the near-infrared spectroscopy detection area at the current moment. t-1 The temperature of the near-infrared spectroscopy detection area at the previous moment.
[0057] The temperature error is: ; in, T setSet the target temperature.
[0058] The Actor policy network of the TD3 intelligent control unit Output the duty cycle corresponding to multiple distributed heating elements. In the independent control mode for multiple heating elements, the action space of the TD3 intelligent controller is: ; in, These represent the PWM duty cycle of the four distributed heating rods during the current control cycle.
[0059] The reward function of the TD3 intelligent control unit includes a temperature error penalty, a temperature change penalty, an overshoot penalty, an energy consumption penalty, a control quantity change penalty, a characteristic absorption peak wavelength shift penalty, and a spectrum acquisition stable state reward. These are used to evaluate the quality of the heating rod heating PWM duty cycle control action output by the TD3 intelligent control unit in the current control cycle.
[0060] The reward function of the dual-delay deep deterministic strategy gradient algorithm adopts a dimensionless normalized reward function. Specifically, before calculating the reward value, the temperature error, temperature change, energy consumption, overshoot, control quantity change, and sample characteristic absorption peak wavelength shift are normalized to convert each penalty term into a dimensionless quantity before weighted summation, thereby avoiding the problem of inconsistent reward function scales caused by different dimensions of different physical quantities. The dimensionless normalized reward function is expressed as follows: ; in, This is the reward value for the current control period; This is a dimensionless temperature error penalty term; This is a dimensionless temperature fluctuation penalty term; This is a dimensionless energy consumption penalty term; This is a dimensionless overshoot penalty term; This is a penalty term for changes in dimensionless control quantities; This is a penalty term for the wavelength shift of the characteristic absorption peak of the dimensionless sample. This is a reward item for the stable state of dimensionless spectral acquisition. , , , , , , All are dimensionless weighting coefficients.
[0061] The dimensionless temperature error penalty term is expressed as follows: ; in, The sample temperature near the near-infrared spectroscopy detection region during the current control cycle. Set the temperature for the target. The preset temperature stability threshold is used to indicate the range within which the sample temperature in the near-infrared spectroscopy detection area can deviate from the target temperature. It can be determined based on the temperature stability requirements of spectral acquisition, the accuracy of the temperature sensor, or the experimental calibration results.
[0062] The dimensionless temperature fluctuation penalty term is expressed as follows: ; in, This represents the temperature change between the current control cycle and the previous control cycle. This is a preset temperature fluctuation baseline value, used to represent the allowable temperature change range within adjacent control cycles.
[0063] The dimensionless energy consumption penalty term is expressed as follows: ; in, This represents the actual energy consumption of multiple heating rods during the current control cycle. This is the preset energy consumption baseline value. The maximum theoretical energy consumption, rated energy consumption, or typical energy consumption value can be obtained by taking the data from multiple heating rods within a control cycle and calibrating based on historical temperature control experimental data.
[0064] The dimensionless overshoot penalty term is expressed as follows: ; in, Used to indicate the overshoot amount when the current temperature exceeds the target set temperature.
[0065] When multiple heating rods are controlled by independent PWM, the dimensionless control quantity change penalty term is expressed as: ; in, For the number of heating rods, For the first i The PWM duty cycle of each heating element during the current control cycle. For the first i The PWM duty cycle of each heating rod in the previous control cycle. If the PWM duty cycle has been normalized to between 0 and 1, then the dimensionless control quantity change penalty term can also be expressed as: ; The dimensionless sample characteristic absorption peak wavelength shift penalty term is expressed as follows: ; in, This represents the wavelength shift of the characteristic absorption peak of the sample before and after adjacent control cycles. This is a preset peak position shift stability threshold, used to represent the allowable range of change in the peak position of the sample's characteristic absorption peak before and after adjacent control periods. It can be determined based on the stability requirements of the sample's characteristic absorption peaks and the sensitivity of the chemometric model to peak position shift.
[0066] Spectral Acquisition Stable State Reward Item This is a dimensionless reward item. It is awarded when the current temperature error, the wavelength shift of the sample's characteristic absorption peak, and the duration of stability all simultaneously meet the preset stability conditions. Take a preset dimensionless positive value; when the preset stability condition is not met... Take 0 or a smaller value that is dimensionless. The preset stability condition is expressed as: ,and ,and ; in, The duration for which both temperature error and peak position shift simultaneously satisfy the stability condition. This is the preset stable holding time.
[0067] Through the above dimensionless normalization process, the temperature error, temperature fluctuation, energy consumption, overshoot, control quantity change, and sample characteristic absorption peak wavelength shift in the reward function are all converted into dimensionless indices, enabling different physical quantities to be reasonably weighted and compared in the same reward function, thereby improving the stability of the TD3 intelligent control unit training process and the interpretability of the reward weight settings.
[0068] like Figure 7 As shown, the spectral acquisition trigger unit is used to determine whether the temperature of the detection area and the wavelength shift of the sample's characteristic absorption peak meet preset stability conditions. When the preset stability conditions are met, the spectral acquisition trigger unit controls the near-infrared spectral acquisition unit to acquire the formal near-infrared spectrum of the liquid sample to be tested. When the preset stability conditions are not met, the system continues to execute TD3 temperature control and spectral peak position feedback control.
[0069] The preset stability condition is: ; in, For the preset temperature threshold, This is a preset peak offset threshold. The duration for which both temperature error and peak position shift simultaneously satisfy the stability condition. This is the preset stable holding time.
[0070] The training environment for the TD3 intelligent control unit includes a residual LSTM temperature prediction model based on physical temperature rise prediction.
[0071] The residual LSTM temperature prediction model based on physical temperature rise prediction is trained using historical temperature control experimental data from the flow cell and is used as the interactive training environment for the TD3 algorithm. It includes a physical temperature rise prediction module and a residual LSTM prediction module.
[0072] The physical temperature rise prediction module calculates the basic temperature change trend of the flow cell detection area based on the heating rod input power, ambient temperature, spectral detection area temperature, and control cycle. When the rated power, installation location, or heat transfer efficiency of multiple heating rods are not exactly the same, the physical temperature rise prediction module uses a weighted superposition model of multiple heating rods to calculate the basic temperature change trend.
[0073] The physical temperature rise prediction module calculates the base predicted temperature for the next control cycle based on the energy conservation principle. To avoid inconsistencies between the dimensions of power, time, and temperature, the physical temperature rise prediction module introduces equivalent heat capacity, heating efficiency coefficient, and equivalent heat dissipation coefficient to convert the input energy and heat loss of the heating rod into the temperature change of the sample near the near-infrared spectroscopy detection region. The base predicted temperature is expressed as: ; in, The base predicted temperature for the next control cycle obtained by the physical temperature rise prediction module; The sample temperature near the near-infrared spectroscopy detection region during the current control cycle; To control the cycle; The equivalent heat capacity of the sample near the near-infrared spectroscopy detection region, the local structure of the flow cell body, and related heat transfer areas; , , , These are the equivalent heating efficiency coefficients of the four heating rods to the near-infrared spectroscopy detection area; , , , These represent the actual equivalent heating power of the four heating rods during the current control cycle. The equivalent heat dissipation coefficient between the flow cell detection area and the environment; The ambient temperature. Indicates the first The effective heating power of the heating rod acting on the sample near the near-infrared spectroscopy detection region is expressed in W. This represents the heat power lost from the flow cell detection area to the environment, expressed in W. This represents the net thermal power acting on the detection area during the current control cycle, expressed in W; net thermal power is related to the control cycle. Multiply by the product to obtain the net heat capacity in J; then divide by the equivalent heat capacity. The temperature change is then obtained, with the unit being °C, thus ensuring the consistency of the dimensions of all items in the basic predicted temperature formula.
[0074] The equivalent heat capacity This is used to characterize the equivalent thermal inertia formed by the sample near the near-infrared spectroscopy detection region, the local structure of the flow cell body, the heat transfer region near the heating rod, and related mounting structures. The equivalent heat capacity represents the equivalent heat required to raise the temperature near the near-infrared spectroscopy detection region by one unit temperature, and its unit is J / ℃ or J / K.
[0075] The equivalent heat capacity It can be determined based on sample mass, sample specific heat capacity, mass and specific heat capacity of the local heat transfer part of the flow cell body, heat capacity of the structure near the heating rod, and experimental temperature rise response data, or it can be identified through flow cell temperature response experiments.
[0076] When the TD3 intelligent control unit outputs the PWM duty cycle of the four heating rods, the actual equivalent heating power of the heating rods in the current control cycle is expressed as: ; in, For the first The PWM duty cycle of the heating rod during the current control cycle. For the first The rated power of the heating rod.
[0077] This model can simultaneously consider the effects of different heating rod rated power, PWM duty cycle, installation location, and heat transfer efficiency on the temperature change in the near-infrared spectroscopy detection area.
[0078] The residual LSTM prediction module is used to learn the nonlinear residual between the actual flow cell temperature response and the physical temperature rise prediction module. The inputs of the residual LSTM prediction module include historical temperature sequences, historical PWM duty cycle sequences, ambient temperature, and physical temperature rise prediction values, and the output is the temperature residual prediction value.
[0079] The model's final predicted temperature is expressed as: ; in, To predict the temperature for the next moment, T phy,t+1 This is the base predicted temperature obtained by the physical temperature rise prediction module. This represents the temperature residual output by the residual LSTM prediction module.
[0080] By combining the physical temperature rise prediction module with the residual LSTM prediction module, temperature prediction errors can be reduced. The physical temperature rise prediction module calculates the base temperature change trend based on heating power, ambient temperature, current temperature, and control cycle, ensuring that the model prediction results are constrained by basic thermal laws. The residual LSTM prediction module learns the nonlinear residual between the actual temperature response and the physical temperature rise prediction results, thereby reducing the learning difficulty of the LSTM network.
[0081] Compared to directly using LSTM to predict the temperature at the next moment, the residual LSTM prediction module in this invention only needs to learn the residual errors caused by the thermal inertia of the flow cell, the distribution of heating rods, sample flow disturbances, heat transfer non-uniformity, and environmental changes. Since the main temperature rise trend has been given by the physical temperature rise prediction module, the output amplitude of the residual LSTM prediction module is smaller and the range of variation is narrower, which is beneficial to improving the model training stability and prediction generalization ability.
[0082] During the training of the TD3 intelligent control unit, the temperature prediction model needs to perform continuous rolling predictions. The single-step prediction error of a typical LSTM model tends to accumulate over multiple rolling steps, causing the virtual training environment to gradually deviate from the actual flow cell temperature response. This invention reintroduces the physical temperature rise prediction result in each control cycle, constraining the direction of temperature change. This prevents the predicted temperature from entirely relying on the free extrapolation of the LSTM network, thereby reducing the accumulated error during long-term rolling predictions and improving the realism and stability of the TD3 training environment.
[0083] This invention sets up multiple distributed heating rods near the near-infrared spectral detection area and outputs a continuous PWM duty cycle through the TD3 algorithm to achieve adaptive power distribution of multiple heating units, thereby improving local heating speed and temperature stability.
[0084] This invention introduces the sample characteristic absorption peak wavelength offset Δλ as a high-precision spectral state input and reward function penalty term of the TD3 intelligent control unit, enabling the controller to directly sense the spectral peak position change caused by temperature disturbance, and realize dual closed-loop control of temperature feedback and spectral peak position feedback.
[0085] This invention introduces the steady state of spectral acquisition into the TD3 reward function, enabling the controller to not only minimize temperature error, but also optimize heating rate, temperature fluctuation, overshoot, energy consumption, control quantity changes, wavelength shift of water characteristic absorption peak, and acquisition state entry time.
[0086] The invention employs a residual LSTM temperature prediction model based on physical temperature rise prediction as the interactive training environment for the TD3 algorithm. Compared with the ordinary LSTM model, it can reduce the difficulty of model learning, reduce the cumulative error in the long-term rolling prediction process, and improve the consistency between the reinforcement learning training environment and the actual flow cell temperature response.
[0087] This invention is applicable to online near-infrared spectroscopy detection of various liquid samples, such as water, medicinal liquids, traditional Chinese medicine extracts, food solutions, chemical solutions, and biological fermentation broths, and has good industrial application value.
[0088] One embodiment of the present invention also includes a near-infrared spectroscopy device, comprising the aforementioned multi-heating rod flow cell. Other components of the near-infrared spectroscopy device are implemented using conventional techniques and will not be described in detail here.
[0089] Example 1: This embodiment provides a training method for a TD3 multi-heater temperature control strategy based on residual LSTM of physical temperature rise prediction and sample characteristic absorption peak shift feedback, which can be used to obtain a TD3 temperature control strategy that can be deployed in a real flow cell isothermal acquisition device.
[0090] First, temperature response data and near-infrared spectral data were collected using a real flow cell isothermal acquisition device. Experimental data included initial temperature, target temperature, near-infrared spectral detection area temperature, ambient temperature, PWM duty cycle of each heating rod, heating rod operating voltage, operating current, real-time power, cumulative energy consumption, near-infrared spectral data, peak position of sample characteristic absorption peaks, and timestamps.
[0091] Then, the spectral peak position shift calculation unit in the control terminal processes the near-infrared spectra acquired in adjacent control cycles, and extracts the peak positions of the characteristic absorption peaks of the sample in the current control cycle. Peak position of the characteristic absorption peak of the sample in the previous control cycle And calculate the wavelength shift of the characteristic absorption peak of the sample before and after adjacent control cycles: ; in, This represents the wavelength shift of the characteristic absorption peak of the sample before and after the current control cycle. This represents the peak position of the characteristic absorption peak of the sample acquired during the current control cycle. This refers to the peak position of the characteristic absorption peak of the sample acquired in the previous control cycle.
[0092] The Used to characterize the degree of change in the peak position of the sample's characteristic absorption peak within adjacent control periods. When |Δλ t When |Δλ is large, it indicates that the sample spectral peak position changes significantly within adjacent control periods, suggesting that the sample temperature, local heat distribution, or flow state remains unstable; when |Δλ is large, it indicates that the sample spectral peak position changes significantly within adjacent control periods. t A smaller value indicates that the peak position of the sample's characteristic absorption peak changes less, suggesting that the near-infrared spectral acquisition state is becoming stable. This wavelength offset serves as the spectral state input and reward function penalty term during the TD3 training phase.
[0093] Next, a residual LSTM temperature prediction model based on physical temperature rise prediction is established using temperature response data. The model includes a physical temperature rise prediction module and a residual LSTM prediction module.
[0094] The physical temperature rise prediction module calculates the basic temperature change trend of the flow cell detection area based on the heating rod input power, ambient temperature, spectral detection area temperature, and control cycle. When the rated power, installation location, or heat transfer efficiency of multiple heating rods are not exactly the same, the physical temperature rise prediction module uses a weighted superposition model of multiple heating rods to calculate the basic temperature change trend, expressed as: The basic predicted temperature is expressed as: ; in, The base predicted temperature for the next control cycle obtained by the physical temperature rise prediction module; The sample temperature near the near-infrared spectroscopy detection region during the current control cycle; To control the cycle; The equivalent heat capacity of the sample near the near-infrared spectroscopy detection region, the local structure of the flow cell body, and related heat transfer areas; , , , These are the equivalent heating efficiency coefficients of the four heating rods to the near-infrared spectroscopy detection area; , , , These represent the actual equivalent heating power of the four heating rods during the current control cycle. The equivalent heat dissipation coefficient between the flow cell detection area and the environment; The ambient temperature. Indicates the first The effective heating power of the heating rod acting on the sample near the near-infrared spectroscopy detection region is expressed in W. This represents the heat power lost from the flow cell detection area to the environment, expressed in W. This represents the net thermal power acting on the detection area during the current control cycle, expressed in W; net thermal power is related to the control cycle. Multiply by the product to obtain the net heat capacity in J; then divide by the equivalent heat capacity. The temperature change is then obtained, with the unit being °C, thus ensuring the consistency of the dimensions of all items in the basic predicted temperature formula.
[0095] The equivalent heat capacity This is used to characterize the equivalent thermal inertia formed by the sample near the near-infrared spectroscopy detection region, the local structure of the flow cell body, the heat transfer region near the heating rod, and related mounting structures. The equivalent heat capacity represents the equivalent heat required to raise the temperature near the near-infrared spectroscopy detection region by one unit temperature, and its unit is J / ℃ or J / K.
[0096] The equivalent heat capacity It can be determined based on sample mass, sample specific heat capacity, mass and specific heat capacity of the local heat transfer part of the flow cell body, heat capacity of the structure near the heating rod, and experimental temperature rise response data, or it can be identified through flow cell temperature response experiments.
[0097] When the TD3 intelligent control unit outputs the PWM duty cycle of the four heating rods, the actual equivalent heating power of the i-th heating rod in the current control cycle is expressed as: ; in, For the first The PWM duty cycle of the heating rod during the current control cycle. For the first The rated power of the heating rod.
[0098] This model can simultaneously consider the effects of different heating rod rated power, PWM duty cycle, installation location, and heat transfer efficiency on the temperature change in the near-infrared spectroscopy detection area.
[0099] The residual LSTM prediction module is used to learn the nonlinear residual between the actual flow cell temperature response and the physical temperature rise prediction module. The inputs of the residual LSTM prediction module include historical temperature sequences, historical PWM duty cycle sequences, ambient temperature, and physical temperature rise prediction values, and the output is the temperature residual prediction value.
[0100] The model's final predicted temperature is expressed as: ; in, To predict the temperature for the next moment, T phy,t+1 This is the base predicted temperature obtained by the physical temperature rise prediction module. This represents the temperature residual output by the residual LSTM prediction module.
[0101] During the training phase of the TD3 intelligent control unit, the residual LSTM temperature prediction model based on physical temperature rise prediction serves as the interactive training environment for the TD3 intelligent control unit. The connection between the two is as follows: First, the TD3 intelligent control unit receives the current state s. tThe current status includes the temperature of the spectral detection area, temperature error, temperature change rate, real-time wavelength shift of the characteristic absorption peak of the detected sample, PWM duty cycle of the previous control cycle, and cumulative energy consumption. Secondly, the Actor network in the TD3 intelligent control unit outputs heating control actions based on the current status. This refers to the PWM duty cycle of one or more heating elements. Third, the physical temperature rise prediction module obtains the base predicted temperature for the next moment based on the PWM duty cycle output by TD3. Fourth, the residual LSTM prediction module outputs the temperature residual based on the historical temperature sequence, historical PWM duty cycle sequence, ambient temperature, and predicted physical temperature rise. Fifth, add the predicted physical temperature rise to the temperature residual to obtain the predicted temperature at the next moment. And construct the next state based on that temperature. Sixth, calculate the reward value based on temperature error, temperature fluctuation, overshoot, energy consumption, control quantity changes, wavelength shift of sample characteristic absorption peaks before and after adjacent control cycles, and the stable state of spectral acquisition. Seventh, the current state, action, reward value, and next state are stored as training samples in the experience replay pool. Eighth, the TD3 intelligent control unit samples data from the experience replay pool, updates the first and second Critic networks, and constructs the target value using the smaller of the two Critic network estimates; the Actor network uses a delayed update method for policy optimization.
[0102] In this way, the TD3 intelligent control unit is trained in a virtual flow cell environment constructed by a residual LSTM temperature prediction model based on physical temperature rise prediction. It learns a control strategy that enables the temperature in the near-infrared spectroscopy detection region to reach the target temperature quickly, stably, with low overshoot and low energy consumption, while simultaneously reducing the wavelength shift of the sample's characteristic absorption peaks before and after adjacent control cycles.
[0103] After training, the Actor network parameters in the TD3 intelligent control unit are deployed to the control terminal. During actual operation, the TD3 intelligent control unit obtains the current state based on the temperature sensor, power acquisition unit, spectral peak shift calculation unit, and historical PWM duty cycle, and directly outputs the PWM duty cycle of one or more heating rods through the Actor network. The power drive unit adjusts the heating rod power according to the PWM duty cycle to ensure that the sample temperature in the near-infrared spectroscopy detection area reaches and maintains the target temperature, while reducing the wavelength shift of the sample's characteristic absorption peaks before and after adjacent control cycles.
[0104] Example 2: This embodiment provides a method for triggering near-infrared spectral acquisition based on stable temperature and stable sample characteristic absorption peaks, and applies it to the near-infrared online detection process of traditional Chinese medicine extracts.
[0105] After the liquid sample to be tested enters the flow cell, the temperature sensor collects the sample temperature in the near-infrared spectroscopy detection area in real time. The near-infrared spectroscopy acquisition unit in the control terminal periodically acquires the near-infrared spectrum of the liquid sample to be tested, and the spectral peak position shift calculation unit extracts the peak position of the water characteristic absorption peak and calculates the current wavelength shift Δλ of the water characteristic absorption peak. t .
[0106] The TD3 intelligent control unit outputs the PWM duty cycle of the heating rod based on the current temperature status, energy consumption status, the PWM duty cycle of the heating rod in the previous control cycle, and the spectral peak position shift status. The power drive unit controls the operation of the heating rod based on the PWM duty cycle.
[0107] The spectral acquisition trigger unit determines whether the temperature and wavelength shift of the water characteristic absorption peak in the detection area meet preset stability conditions. The preset stability conditions are... ; in, For the preset temperature threshold, This is a preset peak offset threshold. The duration for which both temperature error and peak position shift simultaneously satisfy the stability condition. This is the preset stable holding time.
[0108] When both the temperature of the detection area and the wavelength shift of the water characteristic absorption peak meet the above-mentioned stability conditions, the spectral acquisition trigger unit sends a formal acquisition signal to the near-infrared spectral acquisition unit, which then acquires the formal near-infrared spectrum of the liquid sample. If the temperature of the detection area or the wavelength shift of the water characteristic absorption peak does not meet the stability conditions, the system continues to execute TD3 temperature control and spectral peak position feedback control.
[0109] Using the device of this invention, the extract enters the sample channel of the flow cell and flows through the near-infrared spectroscopy detection area. The four heating rods dynamically adjust their heating power under the control of the TD3 intelligent control unit, enabling the extract to quickly reach the target temperature in the near-infrared spectroscopy detection area. Simultaneously, the spectral peak shift calculation unit calculates the wavelength shift of the sample's characteristic absorption peaks in real time or periodically, using this as a constraint on the TD3 control state and reward function, further reducing the spectral peak shift. Once the temperature in the detection area and the wavelength shift of the water's characteristic absorption peaks both meet the preset stability conditions, the spectral acquisition trigger unit controls the near-infrared spectral acquisition unit to acquire the formal spectrum of the extract.
[0110] Through the above methods, this invention ensures that the liquid sample being tested is not only at a relatively consistent temperature during each near-infrared spectral acquisition, but also that the peak positions of the sample's characteristic absorption peaks are stable. This reduces the impact of temperature disturbances, local thermal inhomogeneity, and flow disturbances on the spectral acquisition results and subsequent quantitative analysis models. When applied to online detection of traditional Chinese medicine extracts, it can improve the consistency and stability of online near-infrared spectral detection data for traditional Chinese medicine extracts, providing a reliable data foundation for quality monitoring and intelligent control of the traditional Chinese medicine extraction process.
[0111] The above description is merely a preferred embodiment of this practice and is not intended to limit the scope of this practice. Various modifications and variations can be made to this practice by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this practice should be included within the protection scope of this practice.
Claims
1. A method for constant temperature control of a multi-heating rod flow cell, characterized in that, include: Acquire state data related to liquid samples; The status data includes at least the wavelength offset of the sample's characteristic absorption peak; Based on the state data and the preset dual-delay depth deterministic strategy gradient algorithm, the pulse width modulation duty cycle corresponding to the multiple heating rods on the flow cell is determined. The reward function of the dual-delay depth deterministic strategy gradient algorithm includes a temperature error penalty term, a temperature change penalty term, an overshoot penalty term, an energy consumption penalty term, a control quantity change penalty term, a sample characteristic absorption peak wavelength shift penalty term, and a spectral acquisition stability reward term. The sample characteristic absorption peak wavelength shift is the difference between the peak position of the sample characteristic absorption peak in the current control cycle and the peak position of the sample characteristic absorption peak in the previous control cycle. When both the temperature of the detection area and the sample characteristic absorption peak wavelength shift simultaneously meet the preset stability conditions, the spectral acquisition stability reward term is positive; otherwise, the spectral acquisition stability reward term is zero. The power distribution of multiple heating rods is determined based on the pulse width modulation duty cycle.
2. The method for constant temperature control of a multi-heating rod flow cell as described in claim 1, characterized in that, The status data includes one or more of the following: current temperature of the spectral detection area, temperature change amount, temperature change rate, temperature error, wavelength shift of the sample characteristic absorption peak, pulse width modulation duty cycle of the heating rod in the previous control cycle, and cumulative energy consumption.
3. The method for constant temperature control of a multi-heating rod flow cell as described in claim 2, characterized in that, The temperature change is the difference between the temperature of the near-infrared spectroscopy detection area at the current moment and the temperature of the near-infrared spectroscopy detection area at the previous moment; the temperature error is the difference between the temperature of the near-infrared spectroscopy detection area at the current moment and the target set temperature.
4. The method for constant temperature control of a multi-heating rod flow cell as described in claim 1, characterized in that, The reward function is: ; in, This is the reward value for the current control period; This is a dimensionless temperature error penalty term; This is a dimensionless penalty term for temperature fluctuations. This is a dimensionless energy consumption penalty term; This is a dimensionless overshoot penalty term; This is a penalty term for changes in dimensionless control quantities; This is a penalty term for the wavelength shift of the characteristic absorption peak of the dimensionless sample. This is a reward item for the stable state of dimensionless spectral acquisition. , , , , , , All are dimensionless weighting coefficients.
5. The method for constant temperature control of a multi-heating rod flow cell as described in claim 1, characterized in that, If the temperature of the detection area and the wavelength shift of the sample's characteristic absorption peak meet the preset stability conditions, the near-infrared spectrum of the liquid sample to be tested is collected; otherwise, temperature control and spectral peak position feedback control continue to be executed. The preset stability conditions include whether the absolute error between the current temperature and the target temperature is less than a preset temperature threshold, whether the absolute value of the wavelength shift of the sample's characteristic absorption peak before and after adjacent control cycles is less than a preset peak position shift threshold, and whether the duration for which the temperature error and peak position shift simultaneously meet the stability conditions is greater than a preset stability holding time.
6. The method for constant temperature control of a multi-heating rod flow cell as described in claim 1, characterized in that, The training environment for the dual-delay deep deterministic strategy gradient algorithm includes a residual temperature prediction model; the residual temperature prediction model includes a physical temperature rise prediction module and a residual prediction module; when the rated power, installation location, or heat transfer efficiency of multiple heating rods are not completely the same, the physical temperature rise prediction module uses a weighted superposition model of multiple heating rods to calculate the base temperature change trend as follows: ; in, The base predicted temperature for the next control cycle obtained by the physical temperature rise prediction module; The sample temperature near the near-infrared spectroscopy detection region during the current control cycle; To control the cycle; Equivalent heat capacity; , , , These are the equivalent heating efficiency coefficients; , , , These represent the actual equivalent heating power of the four heating rods during the current control cycle. The equivalent heat dissipation coefficient between the flow cell detection area and the environment; The ambient temperature.
7. The method for constant temperature control of a multi-heating rod flow cell as described in claim 6, characterized in that, The residual prediction module is used to learn the nonlinear residual between the actual flow cell temperature response and the physical temperature rise prediction module. The final predicted temperature is expressed as the sum of the basic predicted temperature obtained by the physical temperature rise prediction module and the temperature residual determined by the residual prediction module.
8. A multi-heating rod flow cell, characterized in that, The system includes a flow cell body (1), a temperature sensor (2) and multiple heating rods (5) disposed on the flow cell body (1); the temperature sensor (2) and multiple heating rods (5) are both connected to a control terminal, which is configured to: determine the pulse width modulation duty cycle corresponding to the multiple heating rods on the flow cell based on the acquired state data and a preset dual-delay depth deterministic strategy gradient algorithm. The power distribution of multiple heating rods is determined based on the pulse width modulation duty cycle; The reward function of the dual-delay deep deterministic strategy gradient algorithm includes a temperature error penalty, a temperature change penalty, an overshoot penalty, an energy consumption penalty, a control quantity change penalty, a sample characteristic absorption peak wavelength shift penalty, and a spectral acquisition stable state reward. The sample characteristic absorption peak wavelength shift is the difference between the peak position of the sample characteristic absorption peak in the current control cycle and the peak position of the sample characteristic absorption peak in the previous control cycle. When the temperature of the detection area and the sample characteristic absorption peak wavelength shift simultaneously meet the preset stability conditions, the spectral acquisition stable state reward is positive; otherwise, the spectral acquisition stable state reward is zero.
9. A multi-heating rod flow cell as described in claim 8, characterized in that, The flow cell body (1) is provided with a threaded through hole, and the temperature sensor (2) is installed in the threaded through hole; the detection end of the temperature sensor (2) extends into the sample flow channel of the flow cell body (1) to detect the temperature of the liquid sample to be tested in the flow cell; fiber optic probes (4) are respectively provided on two opposite sides of the flow cell body (1); a PTFE gasket (6) is provided between the fiber optic probe (4) and the flow cell body (1). A flow cell end cap (11) is provided on one side of the flow cell body (1); a silicone gasket (7) is provided between the flow cell body (1) and the flow cell end cap (11); an explosion-proof connector (10) is provided on the flow cell end cap (11), and an explosion-proof cable (9) is connected to the explosion-proof connector (10).
10. A near-infrared spectroscopy device, characterized in that, Includes the multi-heating rod flow cell as described in any one of claims 8-9.
