A linear temperature control method
By self-tuning PID parameters and combining them with PD/PID control, the problems of poor linearity and severe overshoot during linear heating are solved, achieving a unified and efficient system for linearizing the heating process and controlling constant temperature, while simplifying PID parameter tuning.
Patent Information
- Application Number
- CN202411644883.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-11-18
AI Technical Summary
The existing linear heating method has poor linearity and serious overshoot, and the existing PID controller is time-consuming and laborious in adjusting linear heating and constant temperature.
By self-tuning PID parameters, combining PD and PID control, the target temperature is set according to the temperature gradient threshold and control interval. Proportional derivative control is adopted and integral control is added during the isothermal process to unify linear heating and isothermal PID control.
The heating process is linearized, overshoot is reduced, PID parameter tuning is simplified, and regulation efficiency is improved.
Smart Images

Figure CN119512263B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of temperature control, in particular to a linear temperature control method. BACKGROUND
[0002] The existing temperature control method is mainly PID control, but in the actual PID control process, some systems need to control linear temperature rise, but the current linear temperature rise method generally splits the temperature rise process into multiple targets, sets the target value according to the control time each time, and then the PID controller calculates normally, which causes two problems, one is that the temperature rise curve is obviously wavy during temperature rise, and the temperature rise curve is not linear, and the second is that the overshoot is serious. And the constant temperature and linear temperature rise generally use two PID controllers, which is time-consuming and laborious to adjust, and the efficiency is not high.
[0003] The above problems need to be solved, and therefore a linear temperature control method is proposed. SUMMARY
[0004] The technical problem to be solved by the present application is how to solve the problems of poor linear temperature rise and serious overshoot in the current linear temperature rise method, and unify the linear temperature rise and constant temperature PID controller, and provide a linear temperature control method.
[0005] As shown in Figure 1 The present application solves the above technical problems by the following technical solutions, and the present application comprises the following steps:
[0006] S1: self-tuning the PID controller to obtain PID parameters, including proportional parameter m_p, integral parameter m_i and differential parameter m_d;
[0007] S2: after the PID self-tuning is completed, the temperature is controlled to be the set target value F, the target temperature T is set, and whether linear temperature rise is needed is determined;
[0008] S3: when selecting no, that is, constant temperature control is needed, the temperature gradient threshold is set, the temperature is controlled by PD at this time, and the temperature gradient threshold is determined, when the temperature gradient threshold requirement is reached, I control is added, and complete PID control is performed;
[0009] S4: when selecting yes, that is, linear temperature control is needed, the entire temperature rise process is segmented, the control interval t and the temperature rise speed V per minute are set, the temperature value S that can be raised in a single control interval t is calculated, and the stage temperature rise target Tj of each time is determined;
[0010] S5: the constant temperature control threshold M and the linear temperature rise allowable range D are set, and the P value is scaled according to the system resolution to obtain the scaling coefficient sc;
[0011] S6: Compensate the temperature rise error and calculate the compensation value;
[0012] S7: Calculate the temperature rise difference D1 between two adjacent times and update the I value;
[0013] S8: Calculate the pwm and determine whether the actual temperature R at the current time reaches the target temperature T for the first time. If not, return to step S6. If so, go to step S9;
[0014] S9: At this time, switch to constant temperature state, record the current I value, set the constant temperature integral quantity as I_I, and calculate the updated I value and pwm if the constant temperature control threshold M is exceeded;
[0015] S10: When the actual temperature R at the current time first falls within the constant temperature control threshold M, i.e., R < T + M, perform constant temperature PID control based on the current I value.
[0016] Further, in the step S1, the specific processing process is as follows:
[0017] S11: Set the setpoint value F, the maximum pwm output of the system is 1 and the minimum value is 0;
[0018] S12: When the setpoint value is reached, the input pwm is the minimum value, and when it is lower than the setpoint value, the input pwm is the maximum value;
[0019] S13: Cross and repeat step S12 at least three times to obtain multiple amplitudes and corresponding periods;
[0020] S14: Calculate the PID parameters according to the last two periods and corresponding amplitudes, including the proportional parameter m_p, the integral parameter m_i and the differential parameter m_d.
[0021] Further, in the step S14, the PID parameters are calculated by the empirical formula of the algorithm.
[0022] Further, the specific processing process is as follows:
[0023] S31: After the PID self-tuning is completed, the control temperature is stabilized at the setpoint value F, and the target temperature T is set;
[0024] S32: When constant temperature is selected, first set the temperature rise gradient threshold, and at this time the pwm is in PD control mode, and the control formula is as follows:
[0025] pwm = m_i * err + m_d * lasterr
[0026] Wherein, the target temperature is T, the actual temperature at the current moment is R, the actual temperature at the last moment is R1, then err=T-R, lasterr=R-R1;
[0027] S33: When the temperature rising gradient is less than the temperature rising gradient threshold value, then the pwm is switched to the PID control mode, and the control formula is as follows:
[0028] I=I+m_i*err
[0029] pwm=m_p*err+I+m_d*lasterr
[0030] Wherein, I is the integral of error.
[0031] Further, the calculation formula of the temperature value S that can be raised by a single control interval t is as follows:
[0032] S=V / 60*1000*t.
[0033] Further, in the step S6, when lasterr≤S, the compensation value errp=err+lasterr, when lasterr>S, the compensation value errp=err.
[0034] Further, if D1>S and T-R>D are met at the same time, then I=I-m_i*err; otherwise, I=I+m_i*err.
[0035] Further, in the step S8, the calculation formula of pwm is as follows:
[0036] pwm=m_p*sc*errp+I+m_d*lasterr.
[0037] Further, in the step S9, the update formula of I value is as follows:
[0038] I=I*(threshold / exceeding threshold part)+I_I*(1-(threshold / exceeding threshold part))
[0039] Wherein, the threshold is the constant temperature control threshold M, and I_I is the I value when the target temperature T is reached for the first time.
[0040] Further, in the step S10, the constant temperature PID control formula is as follows:
[0041] pwm=m_p*err+I+m_d*lasterr
[0042] Wherein, I=I+m_i*err.
[0043] Compared with the prior art, the linear temperature control method has the following advantages: in the constant temperature process, proportional and differential control is adopted, then the gradient value in the temperature rising process is calculated, integral control is added according to the set gradient value, at this time, overshoot can be effectively inhibited; the concept of speed is introduced, so that the linear temperature rising is better, the strong wave phenomenon existing in the temperature rising is overcome, the PID values of the linear temperature rising and the constant temperature are unified, and the PID parameters do not need to be tested artificially, so that the debugging time is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 is the main step flowchart of the linear temperature control method of the present application.
[0045] Figure 2 is the flowchart of the linear temperature control method in the embodiment of the present application. DETAILED DESCRIPTION
[0046] The embodiment of the present application will be described in detail below, the embodiment is implemented on the premise of the technical scheme of the present application, and detailed implementation modes and specific operation processes are given, but the protection scope of the present application is not limited to the following embodiment.
[0047] As shown in the following table, the embodiment provides a technical scheme: a linear temperature control method, comprising the following steps: Figure 2
[0048] Step 1: assuming that the set target value F is 100 DEG C, the maximum value of the pwm (duty ratio) output of the system is 1, and the minimum value is 0, when the set target value is reached, the input pwm is the minimum value, and when it is lower than the set target value, the input pwm is the maximum value, which is crossed, in order to improve the speed, three cycles are generally run, the amplitude and cycle time are obtained, the PID parameters are calculated by using the last two cycles, and the specific mode of calculation is that the empirical formula of the algorithm is used to obtain the PID parameters m_p, m_i and m_d, wherein m_p is the proportional parameter, m_i is the integral parameter, and m_d is the differential parameter.
[0049] Step 2: after the PID self-tuning is completed, the temperature is controlled to be stable at 100 DEG C, the set target temperature T is set to 150 DEG C, if constant temperature control is selected, the temperature rising gradient threshold value is set first, in order to be simple to identify, the temperature rising gradient threshold value is set to 1, then the pwm is controlled by PD, and the control formula is: pwm = m_i * err + m_d * lasterr, (wherein, err = T-current actual temperature R, lasterr = R-R1, R1 is the actual temperature at the last moment), when the temperature rising gradient is less than 1, the PID control mode is switched to, and the control formula is: I = I + m_i * err, pwm = m_p * err + I + m_d * lasterr.
[0050] It should be noted that in each control interval in step 2, it is necessary to judge whether the temperature rise gradient exceeds the temperature rise gradient threshold value, when the temperature rise gradient does not exceed the temperature rise gradient threshold value, PD control is always used, after the first time exceeds the temperature rise gradient threshold value, PID control is used subsequently, and PD control is not used.
[0051] Step 3: Selecting linear temperature rise, first determine the basic parameters, set the basic parameters as: 1, control interval 50ms, 2, temperature rise speed V = 10℃ / min, then S = (10 / 60000)*50; the actual temperature at the current time R = T = 100, then the stage temperature rise target Tj of each control = Tj + S (Tj is the stage temperature rise target, so it is always changing and will always slowly rise to the final target value T); the actual temperature at the current time is R, the constant temperature control threshold M is set to 0.5℃, and the linear temperature rise allowed range D = 0.1℃.
[0052] Step 4: Amplify the value of P (the amplification multiple needs to be set according to the system resolution, generally the higher the resolution, the smaller the value, the smaller the resolution, the larger the value, the default amplification is 2 times (the resolution is 0.01 degree)
[0053] Step 5: Compensate for the temperature rise error, when lasterr≤S, the compensation value errp = err + lasterr, when lasterr>S, errp = err.
[0054] Step 6: Calculate the adjacent two temperature rise difference D1, if D1>S and T-R>D are both satisfied, I = I-m_i*err; otherwise I = I+m_i*err;
[0055] Step 7: Calculate pwm = m_p*2 (amplification coefficient)*errp + I + m_d*lasterr; if pwm<0, then pwm is 0, if >1, then pwm is 1, if I>1, then I is 1, if I<0, then I is 0;
[0056] Step 8: Judge whether the actual temperature R reaches the final target value 150 of linear temperature rise, if not, return to step 5, if yes, go to step 9.
[0057] Step 9: At this time, it is converted to constant temperature state, record the current I value, set the constant temperature integral as I_I, if it exceeds the constant temperature control threshold M (0.5℃ in this embodiment), calculate the weighted I value = I*(threshold value / exceeding threshold value part) + I_I*(1-(threshold value / exceeding threshold value part)), and then calculate pwm; wherein, the threshold value is the constant temperature control threshold M, and I_I is the I value when the target temperature T is first reached.
[0058] Step 10: When the actual temperature R falls into the constant temperature control threshold M for the first time, i.e. < 150.5, the constant temperature PID control is normally performed based on the current I, and the control formula is: pwm = m_p*err + I + m_d*lasterr, wherein I = I + m_i*err.
[0059] Although the embodiments of the present application have been shown and described above, it should be understood by those having ordinary skill in the art that the above embodiments are exemplary and are not to be construed as limiting the present application, and that changes, modifications, substitutions and variations of the above embodiments can be made within the scope of the present application.
Claims
1. A linear temperature control method, characterized by, The method comprises the following steps: S1: self-tuning of the PID controller, PID parameters including proportional parameter m_p, integral parameter m_i and differential parameter m_d are calculated and obtained; S2: after the PID self-tuning is completed, the temperature is controlled to be the self-tuning target value F, the target temperature T is set, and whether linear heating is needed is determined; S3: when the answer is no, i.e. constant temperature control is needed, the heating gradient threshold is set, the temperature is controlled in PD mode at this time, and the heating gradient threshold is determined, when the heating gradient threshold requirement is reached, I control is added, and complete PID control is performed; S4: when the answer is yes, i.e. linear heating control is needed, the whole heating process is segmented, the control interval t and the heating speed V per minute are set, the temperature value S that can be raised in a single control interval t is calculated, and the stage heating target Tj of each time is determined; S5: the constant temperature control threshold M and the linear heating allowable range D are set, and the P value is scaled according to the system resolution to obtain the scaling coefficient sc; S6: the heating error is compensated, and the compensation value is calculated; S7: the heating difference D1 between adjacent two times is calculated, and the I value is updated; S8: the pwm is calculated, and it is determined whether the actual temperature R at the current time reaches the target temperature T for the first time, if not, the step S6 is returned, and if yes, the step S9 is entered; S9: at this time, the constant temperature state is converted, the current I value is recorded, the constant temperature integral quantity I_I is set, if the constant temperature control threshold M is exceeded, the updated I value is calculated, and the pwm is calculated; S10: when the actual temperature R at the current time falls back to the constant temperature control threshold M for the first time, i.e. R < T + M, the constant temperature PID control is performed based on the current I value.
2. The linear temperature control method of claim 1, wherein, In the step S1, the specific processing process is as follows: S11: the self-tuning target value F is set, the maximum value of the pwm output of the system is 1, and the minimum value is 0; S12: when the self-tuning target value is reached, the input pwm is the minimum value, and when the self-tuning target value is lower, the input pwm is the maximum value; S13: the step S12 is repeated at least three times, and multiple amplitudes and corresponding periods are obtained; S14: the PID parameters including the proportional parameter m_p, the integral parameter m_i and the differential parameter m_d are calculated according to the last two periods and the corresponding amplitudes.
3. A linear temperature control method according to claim 2, wherein In the step S14, the PID parameters are calculated by An empirical formula of the algorithm calculates the PID parameters.
4. The linear temperature control method of claim 2, wherein, In the step S3, the specific processing process is as follows: S31: after the PID self-tuning is completed, the temperature is controlled to be stable at the self-tuning target value F, and the target temperature T is set; S32: when the constant temperature is selected, the heating gradient threshold is set first, the pwm is in PD control mode at this time, and the control formula is as follows: pwm = m_i * err + m_d * lasterr Wherein, the target temperature is T, the actual temperature at the current time is R, the actual temperature at the last time is R1, then err = T-R, and lasterr = R-R1; S33: when the heating gradient is less than the heating gradient threshold, the pwm is switched to the PID control mode, and the control formula is as follows: I = I + m_i * err pwm = m_p * err + I + m_d * lasterr Wherein, I is the integral of the error.
5. A linear temperature control method according to claim 4, characterized in that In the step S4, the temperature value S that can be raised by the single control interval t is calculated according to the following formula: S = V / 60*1000*t.
6. A linear temperature control method according to claim 5, wherein In the step S6, when lasterr≤S, the compensation value errp=err+lasterr, and when lasterr>S, the compensation value errp=err.
7. A linear temperature control method according to claim 6, wherein In the step S7, if D1>S and T-R>D are satisfied at the same time, I=I-m_i*err; otherwise, I=I+m_i*err.
8. The linear temperature control method of claim 7, wherein, In the step S8, the calculation formula of pwm is as follows: pwm=m_p*sc*errp+I+m_d*lasterr.
9. The linear temperature control method of claim 8, wherein, In the step S9, the update formula of I value is as follows: I=I*(threshold / exceeding threshold part)+I_I*(1-(threshold / exceeding threshold part)) Wherein, the threshold is the constant temperature control threshold M, and I_I is the I value when the target temperature T is reached for the first time.
10. The linear temperature control method of claim 9, wherein, In the step S10, the constant temperature PID control formula is as follows: pwm=m_p*err+I+m_d*lasterr Wherein, I=I+m_i*err.
Citation Information
Patent Citations
Semiconductor laser temperature control device based on fuzzy control and control method
CN105223977A
Quick constant temperature control method and control device for PCR (polymerase chain reaction) detector and PCR detector
CN114647186A