A dual-mode incremental PID control method and device based on temperature difference switching

CN123010902APending Publication Date: 2026-10-30ACCELINK TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611164112.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

传统单一比例积分微分(Proportional-Integral-Differential,简写为:PID)控制策略在宽温度范围内难以兼顾快速升温和精确稳温这两种矛盾的需求:升温阶段需要快速响应;接近目标温度时则需精细调节

Benefits of technology

实时获取当前温度误差,并根据当前温度误差决定PID调节模式,在当前温度误差的绝对值较大时,采用功耗PID模式实现快速响应的调节,在当前温度误差的绝对值较小时,采用温度PID模式实现高精度调节,以满足不同切换场景的需求,并能实现调节模式的自主切换,同时满足了快速响应和精确控温的需求;并且在需要进行调节模式的切换时,通过多个过渡周期作为调节模式切换的过渡,避免瞬间切换导致的电流跳变,提高了整个调节过程的稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123010902A_ABST
    Figure CN123010902A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of PID regulation, and provides a dual-mode incremental PID control method and device based on temperature difference switching, which acquires a current temperature error in real time, and determines a PID regulation mode according to the current temperature error; when the absolute value of the current temperature error is large, a power consumption PID mode is adopted to realize rapid response regulation; when the absolute value of the current temperature error is small, a temperature PID mode is adopted to realize high-precision regulation, so as to meet the needs of different switching scenarios, and realize autonomous switching of the regulation mode, while meeting the needs of rapid response and accurate temperature control; and when switching of the regulation mode is needed, a plurality of transition periods are used as a transition for switching of the regulation mode, so as to avoid current jump caused by instantaneous switching, and improve the stability of the entire regulation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of PID control technology, and more specifically, relates to a dual-mode incremental PID control method and device based on temperature difference switching. Background Technology

[0002] In fields such as adaptive control technology and communication equipment, the thermal density requirements of chips are increasing, and the demands for precise temperature control are becoming increasingly stringent. Traditional single proportional-integral-differential (PID) control strategies struggle to simultaneously address the conflicting needs of rapid heating and precise temperature stabilization over a wide temperature range: rapid response is required during the heating phase, while fine adjustment is needed as the temperature approaches the target temperature. Using fixed PID parameters cannot meet the requirements of all scenarios, nor can it simultaneously satisfy the needs for both rapid response and precise temperature control.

[0003] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention

[0004] The problem this invention aims to solve is how to simultaneously meet the requirements of rapid response and precise temperature control in PID temperature control.

[0005] Firstly, a dual-mode incremental PID control method based on temperature difference switching is provided, including: The current temperature error between the target temperature and the actual temperature is calculated in real time. If the absolute value of the error is greater than the preset temperature difference threshold, the power consumption PID mode with power consumption error as input is executed; otherwise, the temperature PID mode with temperature error as input is executed. When the relative magnitude relationship between the absolute value of the current temperature error and the preset temperature difference threshold is reversed, the control output corresponding to the mode to be switched at the current moment is obtained, and a transition mechanism is used to adjust the control output corresponding to the current mode to be consistent with the control output of the mode to be switched. Execute the PID control process after switching modes.

[0006] Preferably, the method further includes: The transition strategy is executed sequentially over N transition cycles. The transition coefficient corresponding to each transition cycle is calculated. Based on the transition coefficient, the control output corresponding to the current mode is adjusted to be consistent with the control output of the mode to be switched.

[0007] Preferably, as the number of transition cycles increases, the transition coefficient gradually decreases from 1 to 0.

[0008] Preferably, the method further includes: The algorithm for determining the transition coefficient is based on the difference between the control output corresponding to the mode to be switched and the control output corresponding to the current mode before the transition. The transition coefficient corresponding to each transition cycle is calculated according to the corresponding algorithm. For each transition cycle, the control output is weighted and fused according to the transition coefficient corresponding to the corresponding transition cycle to obtain the control output corresponding to the corresponding transition cycle. When the control output corresponding to the transition period is consistent with the control output corresponding to the mode to be switched, it means that the control output corresponding to the current mode has been adjusted to be consistent with the control output of the mode to be switched.

[0009] Preferably, the method further includes: The expression for the control output corresponding to the respective transition period is: u_total = α × u1 + (1-α) × u2; Where u_total is the control output corresponding to the corresponding transition period, α is the transition coefficient, u1 is the control output corresponding to the current mode before transition, and u2 is the control output corresponding to the mode to be switched.

[0010] Preferably, the method further includes: Calculate the absolute value of the difference between the control output corresponding to the mode to be switched and the control output corresponding to the current mode before the transition, and compare the absolute value of the difference with a preset difference threshold. When the absolute value of the difference is greater than the preset difference threshold, the transition coefficient corresponding to each transition cycle is calculated using the smooth transition method. When the absolute value of the difference is less than or equal to the preset difference threshold, the transition coefficient corresponding to each transition cycle is calculated using the linear transition method.

[0011] Preferably, the expression for calculating the transition coefficient using the smooth transition method is: α(i)=0.5×[1+cos(π×i / (N-1))]; The expression for calculating the transition coefficient using the linear transition method is as follows: α(i) = 1 - i / (N - 1); Where α(i) is the transition coefficient corresponding to the (i+1)th transition cycle; i is the current transition cycle number, i is 0~N-1; N is the number of transition cycles required to complete the mode switch.

[0012] Preferably, when calculating the control increment based on the respective errors and their historical errors, and executing a temperature PID mode with temperature error as input, the specific steps include: Calculate the current temperature error between the target temperature and the actual temperature; The change in temperature error is obtained based on the current temperature error and the historical temperature errors from the previous two rounds of debugging. The control increment is calculated based on the preset PID coefficients of the temperature PID mode, the current temperature error, and the change in the temperature error.

[0013] Secondly, a dual-mode incremental PID control device based on temperature difference switching is provided, including at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor for performing a dual-mode incremental PID control method based on temperature difference switching.

[0014] Thirdly, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors to perform the method of the first aspect.

[0015] Fourthly, a chip is provided, comprising: a processor and an interface for calling and running a computer program stored in memory, performing the method as described in the first aspect.

[0016] Fifthly, a computer program product containing instructions is provided that, when executed on a computer or processor, causes the computer or processor to perform the method as described in the first aspect.

[0017] In a sixth aspect, a dual-mode incremental PID control device based on temperature difference switching is provided, including the dual-mode incremental PID control device based on temperature difference switching as in the second aspect, and using the dual-mode incremental PID control method based on temperature difference switching as in the first aspect.

[0018] Unlike existing technologies, the present invention has at least the following beneficial effects: The system acquires the current temperature error in real time and determines the PID control mode based on it. When the absolute value of the current temperature error is large, a power consumption PID mode is used for fast response control. When the absolute value of the current temperature error is small, a temperature PID mode is used for high-precision control, meeting the needs of different switching scenarios. It can also achieve autonomous switching of control modes, satisfying both the requirements of fast response and precise temperature control. Furthermore, when switching control modes is required, multiple transition cycles are used as a transition period to avoid current jumps caused by instantaneous switching, thus improving the stability of the entire control process. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0020] Figure 1 This is a flowchart of a dual-mode incremental PID control method based on temperature difference switching provided in an embodiment of the present invention; Figure 2 This is a flowchart of a method for obtaining the control increment of the power consumption PID mode in a dual-mode incremental PID control method based on temperature difference switching provided in an embodiment of the present invention; Figure 3 This is a flowchart of a method for obtaining the control increment of the temperature PID mode in a dual-mode incremental PID control method based on temperature difference switching provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of the control logic of a dual-mode incremental PID control method based on temperature difference switching provided in an embodiment of the present invention; Figure 5 This is a flowchart of the mode switching method in a dual-mode incremental PID control method based on temperature difference switching provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the control logic of another dual-mode incremental PID control method based on temperature difference switching provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of a dual-mode incremental PID control device based on temperature difference switching provided in an embodiment of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0022] Unless the context otherwise requires, throughout the specification and claims, the term "comprising" is interpreted as openly inclusive, meaning "including, but not limited to." In the description of the specification, terms such as "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this disclosure. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics mentioned may be included in any suitable manner in any one or more embodiments or examples; that is, although they may be incorporated into embodiments or examples using the above terms for reasons such as order and position, it does not limit them to be incorporated in combination by a single embodiment or example.

[0023] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more. Furthermore, for example, the description may use the prefix "A" or "B" to describe the same type of nouns as two independent entities. In this case, the corresponding features defined with "A" and "B" are used only to distinguish between similar entities and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.

[0024] In the description of this invention, the expression “A and / or B” (where A and B are used to formally represent specific features) will be used. The corresponding expression includes the following three combinations: only A, only B, and a combination of A and B.

[0025] As used in this invention, “about,” “approximately,” or “approximately” includes the stated value and the average value within an acceptable range of deviation from a particular value, wherein the acceptable range of deviation is determined by a person skilled in the art taking into account the measurement under discussion and the error associated with the measurement of the particular quantity (i.e., the limitations of the measurement system).

[0026] Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0027] Example 1: This embodiment provides a dual-mode incremental PID control method based on temperature difference switching, such as... Figure 1 As shown, the method flow includes: In step 101, the current temperature error between the target temperature and the actual temperature is calculated in real time. If its absolute value is greater than the preset temperature difference threshold, the power consumption PID mode with power consumption error as input is executed; otherwise, the temperature PID mode with temperature error as input is executed.

[0028] Both modes calculate the control increment based on their respective errors and historical errors, and update and accumulate the control increment to the control output to obtain the control output corresponding to the current mode.

[0029] The application scenario of this method is to precisely control the temperature of communication chips through different modes to meet the requirements of rapid response and fine adjustment in the temperature control process. In practical application scenarios, when the difference between the actual temperature and the target temperature is large, it is necessary to ensure a rapid response in the debugging process so that the actual temperature can quickly approach the target temperature and improve the debugging efficiency. When the difference between the actual temperature and the target temperature is small, the requirements for debugging accuracy are higher, and the rapid response debugging method cannot meet the accuracy requirements.

[0030] Therefore, in this embodiment, the actual temperature is detected in real time, and the actual temperature is compared with the target temperature to obtain the current temperature error, i.e., the difference between the actual temperature and the target temperature. The absolute value of the current temperature error is compared with a preset temperature difference threshold. If the absolute value of the current temperature error is greater than the preset temperature difference threshold, it means that the error between the actual temperature and the target temperature is too large, and a fast response method is needed for adjustment, i.e., power consumption PID mode is used for adjustment based on the current power consumption error. The power consumption error is the difference between the current power consumption and the target power consumption. If the absolute value of the current temperature error is less than or equal to the preset temperature difference threshold, it means that the error between the actual temperature and the target temperature is small, and a high-precision method is needed for adjustment, i.e., temperature PID mode is used for adjustment based on the current temperature error. It should be noted that the preset temperature difference threshold is set by those skilled in the art according to the actual situation.

[0031] When using the power consumption PID mode for actual adjustment, it is necessary to obtain the current power consumption error and the change between the current power consumption error and the historical power consumption error. Substitute the parameters obtained above into the calculation of the PID coefficient to obtain the control increment corresponding to the current power consumption PID mode adjustment. Add the obtained control increment to the historical control output to obtain the control output corresponding to the current mode. In the power consumption PID mode, the corresponding control output is the power consumption duty cycle.

[0032] When using temperature PID mode for actual control, the current temperature error and the change between the current temperature error and the historical temperature error are required. The parameters obtained above are substituted into the calculation of the PID coefficient to obtain the control increment corresponding to the current temperature PID mode control. The obtained control increment is accumulated to the historical control output to obtain the control output corresponding to the current mode. In temperature PID mode, the corresponding control output is the temperature duty cycle.

[0033] It is important to note that in each round of debugging, the current temperature and the target temperature need to be compared to determine whether a switch to a different adjustment mode is necessary. If the adjustment mode remains unchanged, the control output and historical error from the previous round of debugging can be used. If a switch to a different adjustment mode is required, the corresponding parameters need to be mapped and adjusted to ensure the correctness of the parameters used in the next round of debugging. Therefore, this embodiment also involves the following design: In step 102, when the relative magnitude relationship between the absolute value of the current temperature error and the preset temperature difference threshold is reversed, the control output corresponding to the mode to be switched at the current moment is obtained, and a transition mechanism is used to adjust the control output corresponding to the current mode to be consistent with the control output of the mode to be switched, and it is determined that the previous mode has been completely transitioned to the new mode.

[0034] In step 103, the PID control process of the switched mode is executed.

[0035] In this embodiment, the preset temperature difference threshold is set by those skilled in the art according to the actual situation. When the absolute value of the current temperature error changes from less than or equal to the preset temperature difference threshold to greater than the temperature difference threshold, and when the absolute value of the current temperature error changes from greater than the preset temperature difference threshold to less than or equal to the temperature difference threshold, it represents that the "relative size relationship has been reversed", which can trigger mode switching.

[0036] When a mode switch is required, there are two scenarios: switching from temperature PID mode to power consumption PID mode, and switching from temperature PID mode to power consumption PID mode. In either case, before performing the mode switch, the control output of the previous mode needs to be smoothly transitioned to the control output of the new mode.

[0037] For example, when switching from temperature PID mode to power consumption PID mode, the temperature duty cycle needs to be adjusted to match the power consumption duty cycle. In this case, the temperature duty cycle is the control output corresponding to the current mode, and the power consumption duty cycle is the control output of the mode to be switched to.

[0038] The duty cycle adjustment process before the execution mode switch cannot be completed in a short time, otherwise current jumps may easily occur. Excessive current jumps can easily lead to malfunctions. Therefore, in this embodiment, the control output corresponding to the current mode is gradually adjusted through multiple transition cycles until the control output corresponding to the current mode is adjusted to be consistent with the control output of the mode to be switched. The transition coefficient determines the adjustment amount of the control output in each transition cycle, ensuring a stable transition throughout the adjustment process. Once the adjustment is complete, the mode switch is considered complete. Simultaneously, the historical power consumption error needs to be initialized. Based on the adjusted control output and the initialized historical power consumption error, PID control is performed according to the switched mode.

[0039] It should be noted that during the temperature PID mode adjustment, the temperature duty cycle changes normally, determining the corresponding control output of the temperature PID mode. At the same time, the power consumption duty cycle also changes synchronously, determining the control output of the power consumption PID mode. The power consumption duty cycle and the temperature duty cycle are numerically different. If the temperature PID mode is directly switched to the power PID mode, the control output also needs to be switched synchronously. This will cause the control output corresponding to the temperature duty cycle to be directly switched to the control output corresponding to the power duty cycle. Making a switch adjustment of the control output with an excessively large value in a short period of time can easily cause current jumps.

[0040] During the transition adjustment process, an alternative control mode is essentially introduced. The purpose of this control mode is to gradually bring the control output of the current mode closer to the control output of the mode to be switched. In this process, the control output is adjusted only based on the transition mechanism, without adjusting the coefficients and parameters in the corresponding PID algorithm.

[0041] It should be noted that in this embodiment, when the device is initially powered on, in order to ensure overshoot protection during startup, it is determined whether the device is in the startup phase. When in the startup phase and in power consumption PID mode, the initial power consumption duty cycle is calculated based on the current power consumption error, and the power consumption duty cycle is linearly increased from 0 to the specified power consumption duty cycle within a preset time before device startup to prevent overshoot due to excessive initial error. After the preset time ends, the startup flag is cleared, and the overshoot protection is deactivated. When in the startup phase and in temperature PID mode, the initial temperature duty cycle is calculated based on the current temperature error, and the temperature duty cycle is linearly increased from 0 to the specified power consumption duty cycle within a preset time before device startup to prevent overshoot due to excessive initial error. After the preset time ends, the startup flag is cleared, and the overshoot protection is deactivated.

[0042] In this embodiment, the current temperature error is acquired in real time, and the PID adjustment mode is determined based on the current temperature error. When the absolute value of the current temperature error is large, the power consumption PID mode is used to achieve fast response adjustment, and when the absolute value of the current temperature error is small, the temperature PID mode is used to achieve high-precision adjustment, so as to meet the needs of different switching scenarios and realize autonomous switching of adjustment modes. Furthermore, when it is necessary to switch the adjustment mode, multiple transition cycles are used as the transition for the adjustment mode switching to avoid current jumps caused by instantaneous switching and improve the stability of the entire adjustment process.

[0043] In this embodiment, before executing the above method, it is necessary to initialize and set various parameters of the system, including: target temperature, preset temperature difference threshold, target power consumption, proportional coefficient, integral coefficient, derivative coefficient, initial historical error, initial transient coefficient, initial control output, and control output safety range. The initial historical error and the initial control output are both 0.

[0044] The system monitors the actual temperature in real time and compares it with the target temperature to obtain the current temperature error. The absolute value of the current temperature error is then compared with a preset temperature difference threshold. If the absolute value of the current temperature error exceeds the preset temperature difference threshold, it is determined that a power consumption PID mode adjustment is needed to achieve rapid response. The specific method for power consumption PID mode adjustment is as follows: The control increment is calculated based on the individual errors and their historical errors. When executing the power consumption PID mode with power consumption error as input, as follows... Figure 2 As shown, the method flow includes: In step 201, the current power consumption error between the target power consumption and the actual power consumption is calculated.

[0045] In this embodiment, the expression for the current power consumption error is: e_G = Gd - Gm; Where e_G is the current power consumption error, Gd is the actual power consumption, and Gm is the target power consumption.

[0046] In step 202, the change in power consumption error is obtained based on the current power consumption error and the historical power consumption error of the previous two rounds of debugging.

[0047] Specifically, the difference between the current power consumption error and the historical error from the most recent first round of debugging is obtained as the first change quantity. The expression for the first change quantity is: Δe_G1=e_G-e_G_prev1; Where Δe_G1 is the first rate of change, e_G is the current power consumption error, and e_G_prev1 is the historical error of the most recent first round of debugging.

[0048] Based on the current power consumption error, the historical error from the most recent first round of debugging, and the historical error from the most recent second round of debugging, the second change is obtained, and the expression for the second change is: Δe_G2=e_G-2×e_G_prev1+e_G_prev2; Where Δe_G2 is the second change, and e_G_prev2 is the historical error of the most recent second round of debugging.

[0049] In summary, the first change and the second change are used together as the power consumption error change.

[0050] In step 203, the control increment is calculated based on the preset PID coefficients of the power consumption PID mode, the current power consumption error, and the change in the power consumption error.

[0051] In this embodiment, the expression for the control increment is: Δu=kp_p×Δe_G1+ki_p×e_G+kd_p×Δe_G2; Where Δu is the control increment, kp_p is the proportional coefficient, ki_p is the integral coefficient, and kd_p is the derivative coefficient.

[0052] The control increment is accumulated into the control output, and the obtained control output is adjusted according to the safety range of the control output to obtain the control output corresponding to the current mode, so as to ensure that the control output obtained in each round of adjustment is compliant. The corresponding expression is: u_total=max(u_min,min(u_max,u_total)); Where u_total is the control output corresponding to the current mode, u_min is the minimum value of the control output safety range, and u_max is the maximum value of the control output safety range. In this embodiment, the control output obtained by the power consumption PID mode adjustment is the power consumption duty cycle.

[0053] When the absolute value of the current temperature error is less than or equal to the preset temperature difference threshold, it is determined that a temperature PID mode needs to be used for adjustment to achieve a rapid response. The specific method for temperature PID mode adjustment is as follows: The control increment is calculated based on the individual errors and their historical errors. When executing the temperature PID mode with the temperature error as input, as follows... Figure 3 As shown, the method flow includes: In step 301, the current temperature error between the target temperature and the actual temperature is calculated.

[0054] In this embodiment, the expression for the current temperature error is: e_T = Td - Tm; Where e_T is the current temperature error, Td is the actual temperature, and Tm is the target temperature.

[0055] In step 302, the change in temperature error is obtained based on the current temperature error and the historical temperature errors of the previous two rounds of debugging.

[0056] Specifically, the difference between the current temperature error and the historical error from the most recent first round of debugging is obtained as the first change quantity. The expression for the first change quantity is: Δe_T1=e_T-e_T_trev1; Where Δe_T1 is the first rate of change, e_T is the current temperature error, and e_T_trev1 is the historical error of the most recent first round of debugging.

[0057] Based on the current temperature error, the historical error from the most recent first round of debugging, and the historical error from the most recent second round of debugging, the second change is obtained, and its expression is: Δe_T2=e_T-2×e_T_trev1+e_T_trev2; Where Δe_T2 is the second change, and e_T_trev2 is the historical error of the most recent second round of debugging.

[0058] The first change and the second change are used as the temperature error change.

[0059] In step 303, the control increment is calculated based on the preset PID coefficients of the temperature PID mode, the current temperature error, and the change in the temperature error.

[0060] In this embodiment, the expression for the control increment is: Δu=kt_t×Δe_T1+ki_t×e_T+kd_t×Δe_T2 Where Δu is the control increment, kt_t is the proportional coefficient, ki_t is the integral coefficient, and kd_t is the derivative coefficient.

[0061] The control increment is accumulated into the control output, and the obtained control output is adjusted according to the safety range of the control output to obtain the control output corresponding to the current mode, so as to ensure that the control output obtained in each round of adjustment is compliant. The corresponding expression is: u_total=max(u_min,min(u_max,u_total)); Where u_total is the control output corresponding to the current mode, u_min is the minimum value of the control output safety range, and u_max is the maximum value of the control output safety range. In this embodiment, the control output obtained by temperature PID mode adjustment is the temperature duty cycle.

[0062] like Figure 4 As shown, this embodiment provides a feasible temperature control system architecture. The system acquires the current temperature through temperature acquisition, the mode selection module determines the control mode to be used based on the temperature deviation, the corresponding PID controller selects the appropriate initial value for calculation based on the actual situation, and finally the temperature execution module outputs the corresponding data for temperature control.

[0063] Furthermore, when the absolute value of the current temperature error changes from less than or equal to the temperature difference threshold to greater than the temperature difference threshold, it is marked as "switching to power consumption PID mode", meaning that the original temperature PID mode needs to be switched to power consumption PID mode; when the absolute value of the current temperature error changes from greater than the temperature difference threshold to less than or equal to the temperature difference threshold, it is marked as "switching to temperature PID mode", meaning that the original power consumption PID mode needs to be switched to temperature PID mode.

[0064] After determining that a mode switch is required, the following steps need to be performed in advance to prepare for the mode switch: Save the control output of the current mode to obtain the control output corresponding to the current mode and the control output of the mode to be switched to, i.e., obtain the temperature duty cycle and power consumption duty cycle under the current state. During this process, if the current mode is a temperature PID control mode, the temperature duty cycle can be directly obtained from the control output of the temperature PID control mode. In this case, the power consumption duty cycle is obtained by comparing the device's system parameters with a preset reference set. If the current mode is a power consumption PID control mode, the power consumption duty cycle can be directly obtained from the control output of the power consumption PID control mode. In this case, the temperature duty cycle is obtained by comparing the device's system parameters with a preset reference set.

[0065] Furthermore, in this embodiment, to avoid current jumps caused by instantaneous switching, mode switching is performed through multiple transition cycles. The design is as follows: a transition strategy is executed sequentially within N transition cycles, a transition coefficient is calculated for each transition cycle, and the control output corresponding to the current mode is adjusted to match the control output of the mode to be switched to based on the transition coefficient. Figure 5 include: In step 401, an algorithm for determining the transition coefficient is used based on the difference between the control output corresponding to the mode to be switched and the control output corresponding to the current mode before the transition. The transition coefficient corresponding to each transition cycle is calculated according to the corresponding algorithm.

[0066] In this embodiment, the transition coefficient is the weight of the control output corresponding to the current mode before the transition. The control output corresponding to the mode to be switched and the control output corresponding to the current mode before the transition are weighted and fused through the transition coefficient, so that the control output corresponding to the current mode is gradually transformed into the same as the control output corresponding to the mode to be switched. Therefore, the transition coefficient needs to be gradually reduced, that is, as the number of transition cycles increases, the transition coefficient gradually decreases from 1 to 0.

[0067] Calculate the absolute value of the difference between the control output corresponding to the mode to be switched and the control output corresponding to the current mode before the transition, and compare the absolute value of the difference with a preset difference threshold, which is set by those skilled in the art according to the actual situation.

[0068] When the absolute value of the difference is greater than the preset difference threshold, it indicates a large difference between the two control outputs. If a faster adjustment method is used, it can easily lead to current jumps. Therefore, a smooth transition method is used to calculate the transition coefficient corresponding to each transition cycle. The expression for calculating the transition coefficient using the smooth transition method is as follows: α(i)=0.5×[1+cos(π×i / (N-1))]; Where α(i) is the transition coefficient corresponding to the (i+1)th transition cycle; i is the current transition cycle number, and the value of i ranges from 0 to N-1; N is the number of transition cycles required to complete the mode switch.

[0069] When the absolute value of the difference is less than or equal to the preset difference threshold, it indicates that the difference between the two control outputs is small, and a faster adjustment method can be used to ensure response efficiency. Therefore, the linear transition method is used to calculate the transition coefficient corresponding to each transition cycle. The expression for calculating the transition coefficient using the linear transition method is: α(i) = 1 - i / (N - 1).

[0070] The linear transition method and the smooth transition method described above are both used to reduce the transition coefficient from 1 to 0.

[0071] In step 402, for each transition cycle, the control output is weighted and fused according to the transition coefficient corresponding to the corresponding transition cycle to obtain the control output corresponding to the corresponding transition cycle.

[0072] In step 403, when the control output corresponding to the corresponding transition period is consistent with the control output corresponding to the mode to be switched, it means that the control output corresponding to the current mode has been adjusted to be consistent with the control output of the mode to be switched, and it is determined that the previous mode has been completely transitioned to the current new mode.

[0073] The expression for the control output corresponding to the respective transition period is: u_total = α × u1 + (1-α) × u2; Where u_total is the control output corresponding to the corresponding transition period, α is the transition coefficient, u1 is the control output corresponding to the current mode before transition, and u2 is the control output corresponding to the mode to be switched.

[0074] As can be seen from the expression of the control output corresponding to the above transition period, when the transition coefficient α gradually decreases from 1 to 0, the weight of the control output u1 corresponding to the current mode before the transition gradually decreases, and the weight of the control output u2 corresponding to the mode to be switched gradually increases, thereby realizing the transformation of the control output into the control output corresponding to the mode to be switched, which means that the mode switching has been completed.

[0075] After the transition period is completed, monitor the effect of the change in control output. When the effect of the change meets the expectations, that is, when the control output at this time is the control output corresponding to the mode to be switched, confirm that the switch is completed. At the same time, confirm that the system has no overshoot and no oscillation. When adjusting with the new PID mode, simply accumulate the control output obtained above.

[0076] It should be noted that after the previous mode has been fully transitioned to the current new mode, e_T_trev1 / e_G_prev1 in the first round of debugging in the current new mode is set to the error corresponding to the last transition cycle during the mode switching process; e_T_trev2 / e_G_prev2 in the first round of debugging in the current new mode is set to the error corresponding to the second-to-last transition cycle during the mode switching process; e_T_trev1 / e_G_prev1 in the second round of debugging in the current new mode is set to the historical error in the first round of debugging in the current new mode; and e_T_trev2 / e_G_prev2 in the second round of debugging in the current new mode is set to the error corresponding to the last transition cycle during the mode switching process.

[0077] like Figure 6 The diagram shown illustrates a feasible mode switching flowchart provided in this embodiment, demonstrating the control logic of the method. After system initialization, continuous sampling and mode determination are performed. Based on the selected mode, corresponding incremental PID calculations are executed, and the overall control output is updated. In each loop, the mode switching conditions are checked; if met, a smooth transition algorithm is invoked to ensure a smooth switch. Finally, the historical error value is updated, completing one control cycle.

[0078] Compared with the prior art, the method provided in this embodiment has the following beneficial effects: (1) Solving the integral saturation problem: By adopting the incremental PID algorithm, the control output is only related to the three most recent errors, without accumulating historical errors, thus fundamentally avoiding the integral saturation problem and improving the stability and reliability of the system. (2) Perfect combination of fast response and precise control: By creatively proposing two different control modes (power consumption PID mode / temperature PID mode) and adaptively switching according to the preset temperature threshold, the problem of slow response speed of traditional single PID control when dealing with hysteresis is effectively solved. (3) Parameter tuning optimization: The control objectives and parameter tuning principles of the two PID controllers are different. The power consumption PID mode takes power as the controlled variable, and the temperature PID mode takes temperature as the controlled variable, effectively solving the problem of complex parameter tuning and difficult optimization of traditional PID controllers. (4) Disturbance-free switching: By adopting the disturbance-free initialization method, the relevant algorithm ensures that there will be no sudden change in current during the mode switching process, maintaining absolute stability in the control process, effectively solving the disturbance problem existing in the traditional temperature control system when switching control modes.

[0079] Example 2: This embodiment, based on Embodiment 1, provides a 5G optical module TEC (Thermoelectric Cooler) temperature control system deployed in an outdoor cabinet to demonstrate the method provided in more detail. This system must withstand extreme environments such as 45°C high temperatures in summer and -10°C low temperatures in winter. Its core objective is to precisely control the internal chip temperature within a set value to ensure wavelength stability and transmission quality.

[0080] (1) System parameter initialization.

[0081] After the system is powered on and reset, the preset control parameters and state variables are loaded first: Set the temperature difference threshold Te=5℃, the target temperature Td=60℃, the measured temperature Tm, the target power consumption Gd=100W, and the measured power consumption Gm; initialize the PID parameters: for the power consumption PID, the proportional coefficient kp_p=2.0, integral coefficient ki_p=0.5, and derivative coefficient kd_p=1.0; for the temperature PID, the proportional coefficient kp_t=0.5, integral coefficient ki_t=0.1, and derivative coefficient kd_t=0.2; set the system flag to start_flag=TRUE, and the mode switching threshold |ΔK|=10%; initialize the error variables e_G_prev1=0, e_G_prev2=0, e_T_prev1=0, and e_T_prev2=0; initialize the control output increment Δu=0, and the cumulative control output u_total=0; set the control output range u_min=0 and u_max=100.

[0082] (2) Transient impact and start-up phase under high summer temperatures.

[0083] (2.1) The mode determination system calculates the current temperature error: e_current = 60 - 35 = 25℃, where the current temperature is 35℃. It determines whether the absolute value of the temperature error e_current, 25℃, is greater than the temperature threshold difference Te = 5℃. Since |e_current| > Te, the power consumption PID control process is initiated.

[0084] (2.2) Power-on start protection.

[0085] To prevent current surges caused by the TEC being fully loaded upon power-up, the system introduces a startup and final-state backtracking mechanism: The system flag is start_flag=TRUE, and the system first performs startup logic. The output duty cycle linearly increases from 0% to a safe initial value (where 0% and the safe initial value are determined by technical personnel based on the specific context. For example, the safe initial value is defined as follows: 40% when the initial temperature is less than 20℃; 60% when the initial temperature is greater than or equal to 20℃ and less than 50℃; and 80% when the initial temperature is greater than or equal to 50℃). During this process, the system continuously samples the actual power consumption, recording the power consumption G_prev2=75W at the penultimate moment before startup ends and G_prev1=80W at the final moment.

[0086] (3) PID stage: (3.1) First round of power consumption PID numerical calculation after startup: After startup ends (this embodiment assumes startup time is 5s, data is updated once per second), start_flag=FALSE, the system uses the final state data to initialize the PID historical error, thereby avoiding sudden changes in the integral term: Error register initialization (final state backtracking): First historical error: e_G_prev1=Gd-G_prev1=100-80=20W; Second historical error: e_G_prev2=Gd-G_prev2=100-75=25W; Current power consumption error calculation: Assuming that the actual power consumption rises slightly to Gm=86W when just exiting startup, the current error e_G=Gd-Gm=100-86=14W.

[0087] Calculation of error change: First-order difference: Δe_G1=e_G-e_G_prev1=14 20= 6; Second-order difference: Δe_G2 = e_G - 2 × e_G_prev1 + e_G_prev2 = 14 40 + 25 = 1; Incremental control calculation: Substituting into the incremental PID formula Δu=kp_p×Δe_G1+ki_p×e_G+kd_p×Δe_G2=2.0×( 6) + 0.5 × 14 + 1.0 × ( 1)= 12+7 1= 6.

[0088] Output update and limiting: Based on the final output u_total=60% at startup, calculate the total output: u_total=u_total+Δu=60+( 6) = 54; After amplitude limiting, u_total=max(0,min(100,54))=54.

[0089] (3.2) Normal PID closed-loop regulation.

[0090] In the third round after a smooth transition, the system enters the standard incremental PID control phase. Assuming that in the previous round (k-1 rounds), the system output duty cycle was 54%, the current power consumption error was 14W, and the historical errors were e_G_prev1=15W and e_G_prev2=16W, when entering the new round (k rounds) of control, due to continuous TEC heating, the actual power consumption drops back to 80W, and the system begins a new round of incremental PID calculation: Step 1: Current actual power consumption Gm = 80W, target power consumption Gd = 100W. Current error e_G = Gd - Gm = 100 - 80 = 20W.

[0091] Step 2, calculate the change in error (difference): First-order difference: Δe_G1=e_G-e_G_prev1=20 15 = 5; Second-order difference: Δe_G2 = e_G - 2 × e_G_prev1 + e_G_prev2 = 20 30 + 16 = 6; Step 3, substitute the values ​​into the incremental PID formula to calculate the control increment: Δu=kp_p×Δe_G1+ki_p×e_G+kd_p×Δe_G2=2.0×(5)+0.5×20+1.0×(6)=10+10+6=26.

[0092] Step 4, Output Update and Amplitude Limiting: Taking the actual output of 54% from the previous round as the reference, the current increment is superimposed: u_total=u_total+Δu=54+(26)=80. After amplitude limiting processing, u_total=max(0,min(100,80))=80.

[0093] (4) Smooth mode switching when approaching the target.

[0094] (4.1) Switching determination: As the TEC continues to operate efficiently, the module temperature gradually rises to 55.5°C. At this point, the temperature error is recalculated: e_current=60-55.5=4.5°C. Since |e_current|<Te, the switching condition is satisfied, the system enters a switching locked state, shields short-term repeated switching commands, and prevents oscillation at the critical point.

[0095] (4.2) Smooth transition execution.

[0096] To prevent output step change at the moment of control mode switching, the system executes the following smooth transition logic: State saving: record the current power consumption PID output u1=70%. Then derive the theoretical initial value u2 of 40% based on the current temperature value (this value is determined by those skilled in the art according to the specific context). Transition algorithm selection: calculate the difference between the two |70%-40%|=30%. Since the preset threshold |ΔK|=10%, the system selects the cosine smooth curve transition method. The aforementioned cosine smooth curve transition method is selected to determine the transition coefficient α. The variation trend of the transition coefficient α under different algorithms is illustrated by taking 5 transition cycles in Table 1 below as an example: Table 1 Transition Cycle Table

[0097] The power consumption duty cycle value is gradually transitioned to the temperature duty cycle value within 5 control cycles: the transition coefficient α decreases monotonically from 1 to 0. The unified interpolation calculation formula is: u_total=α×u1+(1-α)×u2. The u_total control output at the end of the transition cycle is kept within the safe range, and applied to the temperature PID after mode switching.

[0098] (5) PID Stage: This stage is similar to the PID algorithm process executed after soft protection. Assume that the temperature sampling values ​​corresponding to the last two transition cycles (i.e., i=3 and i=4) during the switching process are T_prev2 = 55.8℃ and T_prev1 = 56.0℃, respectively. The real-time sampling Tm = 56.1℃ for the first control cycle after the switch is then given as e_T = Td - Tm = 60 - 56.1 = 3.9; historical errors: e_T_prev1 = 60 - 56 = 4℃, e_T_prev2 = 60 - 55.8 = 4.2℃. Error change calculation: First-order difference: Δe_T1 = e_T - e_T_prev1 = 3.9 4 = 0.1; Second-order difference: Δe_T2 = e_T - 2 × e_T_prev1 + e_T_prev2 = 3.9 8 + 4.2 = 0.1; Substituting into the incremental PID formula to calculate the control increment: Δu = kp_t × Δe_T1 + ki_t × e_T + kd_t × Δe_T2 = 0.5 × ( 0.1) + 0.1 × 3.9 + 0.2 × (0.1) = 0.05 + 0.39 + 0.02 = 0.46.

[0099] Based on the previous round's actual output of 40%, the incremental value is added: u_total = u_total + Δu = 40 + 0.46 = 40.46. After limiting, u_total = max( 0 , min (100 , 40.46)) = 40.46. Over time, the temperature stabilizes within the range of 60℃±0.1℃, meeting the stringent temperature control requirements of the optical module.

[0100] Example 3: like Figure 7 The diagram shown is a schematic representation of a dual-mode incremental PID control device based on temperature difference switching according to an embodiment of the present invention. This dual-mode incremental PID control device based on temperature difference switching includes one or more processors 41 and a memory 42.

[0101] Processor 41 and memory 42 can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.

[0102] The memory 42, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the dual-mode incremental PID control method based on temperature difference switching in the above embodiment. The processor 41 executes the dual-mode incremental PID control method based on temperature difference switching by running the non-volatile software program and instructions stored in the memory 42.

[0103] Memory 42 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 42 may optionally include memory remotely located relative to processor 41, which can be connected to processor 41 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0104] The program instructions / modules are stored in memory 42. When executed by one or more processors 41, they perform the dual-mode incremental PID control method based on temperature difference switching in the above embodiments.

[0105] This invention also provides a computer storage medium storing computer program instructions; when executed by a processor, the computer program instructions implement the dual-mode incremental PID control method based on temperature difference switching provided in this invention.

[0106] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A dual-mode incremental PID control method based on temperature difference switching, characterized in that, include: The current temperature error between the target temperature and the actual temperature is calculated in real time. If the absolute value of the error is greater than the preset temperature difference threshold, the power consumption PID mode with power consumption error as input is executed; otherwise, the temperature PID mode with temperature error as input is executed. When the relative magnitude relationship between the absolute value of the current temperature error and the preset temperature difference threshold is reversed, the control output corresponding to the mode to be switched at the current moment is obtained, and a transition mechanism is used to adjust the control output corresponding to the current mode to be consistent with the control output of the mode to be switched. Execute the PID control process after switching modes.

2. The dual-mode incremental PID control method based on temperature difference switching according to claim 1, characterized in that, The method further includes: The transition strategy is executed sequentially over N transition cycles. The transition coefficient corresponding to each transition cycle is calculated. Based on the transition coefficient, the control output corresponding to the current mode is adjusted to be consistent with the control output of the mode to be switched.

3. The dual-mode incremental PID control method based on temperature difference switching according to claim 2, characterized in that, As the number of transition cycles increases, the transition coefficient gradually decreases from 1 to 0.

4. The dual-mode incremental PID control method based on temperature difference switching according to claim 2, characterized in that, The method further includes: The algorithm for determining the transition coefficient is based on the difference between the control output corresponding to the mode to be switched and the control output corresponding to the current mode before the transition. The transition coefficient corresponding to each transition cycle is calculated according to the corresponding algorithm. For each transition cycle, the control output is weighted and fused according to the transition coefficient corresponding to the corresponding transition cycle to obtain the control output corresponding to the corresponding transition cycle. When the control output corresponding to the transition period is consistent with the control output corresponding to the mode to be switched, it means that the control output corresponding to the current mode has been adjusted to be consistent with the control output of the mode to be switched.

5. The dual-mode incremental PID control method based on temperature difference switching according to claim 4, characterized in that, The method further includes: The expression for the control output corresponding to the respective transition period is: u_total = α × u1 + (1-α) × u2; Where u_total is the control output corresponding to the corresponding transition period, α is the transition coefficient, u1 is the control output corresponding to the current mode before transition, and u2 is the control output corresponding to the mode to be switched.

6. The dual-mode incremental PID control method based on temperature difference switching according to claim 4, characterized in that, The method further includes: Calculate the absolute value of the difference between the control output corresponding to the mode to be switched and the control output corresponding to the current mode before the transition, and compare the absolute value of the difference with a preset difference threshold. When the absolute value of the difference is greater than the preset difference threshold, the transition coefficient corresponding to each transition cycle is calculated using the smooth transition method. When the absolute value of the difference is less than or equal to the preset difference threshold, the transition coefficient corresponding to each transition cycle is calculated using the linear transition method.

7. The dual-mode incremental PID control method based on temperature difference switching according to claim 4, characterized in that, The expression for calculating the transition coefficient using the smooth transition method is as follows: α(i)=0.5×[1+cos(π×i / (N-1))]; The expression for calculating the transition coefficient using the linear transition method is as follows: α(i) = 1 - i / (N - 1); Where α(i) is the transition coefficient corresponding to the (i+1)th transition cycle; i is the current transition cycle number, i is 0~N-1; N is the number of transition cycles required to complete the mode switch.

8. The dual-mode incremental PID control method based on temperature difference switching according to claim 1, characterized in that, The control increment is calculated based on the individual errors and their historical errors. When executing a temperature PID mode with temperature error as input, the specific steps include: Calculate the current temperature error between the target temperature and the actual temperature; The change in temperature error is obtained based on the current temperature error and the historical temperature errors from the previous two rounds of debugging. The control increment is calculated based on the preset PID coefficients of the temperature PID mode, the current temperature error, and the change in the temperature error.

9. A dual-mode incremental PID control device based on temperature difference switching, characterized in that, The system includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor for performing the dual-mode incremental PID control method based on temperature difference switching as described in any one of claims 1-8.

10. A non-volatile computer storage medium, characterized in that, The computer storage medium stores computer program instructions that, when executed by one or more processors, implement the dual-mode incremental PID control method based on temperature difference switching as described in any one of claims 1-8.