Temperature control method and device, electronic equipment and storage medium
By applying PID control algorithms and PWM signal technology in the temperature control system, the problem of relying on a large amount of training data and computing resources in the existing technology is solved, and the adaptation and precise adjustment of temperature control in multiple scenarios is achieved, which improves the stability and efficiency of the system.
Patent Information
- Application Number
- CN202411660598.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The method of temperature regulation through neural network models in the prior art requires relying on a large amount of training data and computing resources, and cannot be adapted to the current temperature control process of multiple scenarios.
Using PID control algorithm and PWM signal technology, by obtaining the current temperature digital signal of the target device, generating control instructions, and generating PWM signals based on the instructions, accurately adjusting the temperature of the target device.
Accurate adjustment of the temperature of the target equipment is achieved, unnecessary frequent startup is avoided, and the stability and service life of the electronic equipment are improved.
Smart Images

Figure CN119536422A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automation control technology, and in particular to a temperature control method, device, electronic device and storage medium. Background Art
[0002] At present, for a cabinet, the temperature of the cabinet can be predicted and adjusted through a neural network model. Specifically, the neural network model is a computing model that simulates the work of human brain neurons, can adapt to the environment and can learn to optimize the temperature adjustment process.
[0003] However, in the above method, the temperature adjustment method using a neural network model requires reliance on a large amount of training data and computing resources, and cannot be adapted to the current temperature control process in multiple scenarios. Summary of the invention
[0004] The present application provides a temperature control method, device, electronic device and storage medium, which solves the technical problem that the method of temperature regulation through a neural network model in the related art requires reliance on a large amount of training data and computing resources and cannot adapt to the current temperature control process in multiple scenarios.
[0005] In a first aspect, the present application provides a temperature control method, comprising: obtaining a digital signal, which is used to characterize the current temperature of a target device; generating a control instruction based on a PID control algorithm and the digital signal; generating a PWM signal based on the control instruction; and adjusting the current temperature of the target device to a target temperature based on the PWM signal.
[0006] In a second aspect, the present application provides a temperature control device, comprising: an acquisition module and a processing module; the acquisition module is used to acquire a digital signal, the digital signal is used to characterize the current temperature of a target device; the processing module is used to generate a control instruction based on a proportional integral differential PID control algorithm and the digital signal; the processing module is also used to generate a pulse width modulation PWM signal based on the control instruction; the processing module is also used to adjust the current temperature of the target device to a target temperature based on the PWM signal.
[0007] In a third aspect, the present application provides an electronic device comprising: a processor and a memory configured to store processor executable instructions; wherein the processor is configured to execute the instructions to implement any one of the optional temperature control methods in the first aspect above.
[0008] In a fourth aspect, the present application provides a computer-readable storage medium having instructions stored thereon. When the instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to execute any one of the optional temperature control methods in the first aspect described above.
[0009] In a fifth aspect, the present application provides a computer program product, including a computer program or instructions, which, when executed on an electronic device, enables the electronic device to execute any one of the optional temperature control methods in the first aspect.
[0010] The temperature control method, device, electronic device and storage medium provided by the present application can obtain a digital signal for characterizing the current temperature of a target device, and generate a control instruction based on a PID control algorithm and the digital signal. Afterwards, the electronic device can generate a PWM signal based on the control instruction and adjust the current temperature of the target device to the target temperature based on the PWM signal. Since the control instruction includes the temperature parameter that needs to be adjusted, the electronic device can accurately adjust the temperature of the target device. In addition, since the PWM technology can be used to achieve accurate adjustment during the temperature adjustment process, unnecessary frequent startup of the electronic device is avoided, thereby improving the stability of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0012] Figure 1 A schematic diagram of a temperature control method provided in an embodiment of the present application;
[0013] Figure 2 A schematic flow chart of another temperature control method provided in an embodiment of the present application;
[0014] Figure 3 A schematic flow chart of another temperature control method provided in an embodiment of the present application;
[0015] Figure 4 A schematic flow chart of another temperature control method provided in an embodiment of the present application;
[0016] Figure 5 A schematic diagram of the internal structure of an electronic device provided in an embodiment of the present application;
[0017] Figure 6 A schematic diagram of the structure of a temperature control device provided in an embodiment of the present application;
[0018] Figure 7 A schematic diagram of the structure of another temperature control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The temperature control method, device, electronic device and storage medium provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0020] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0021] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0022] In the description of the present application, unless otherwise specified, “plurality” means two or more.
[0023] The following explains some concepts involved in a temperature control method, device, electronic device and storage medium provided in the embodiments of the present application.
[0024] The proportional integral derivative (PID) control algorithm is a control algorithm that combines proportional (P), integral (I), and differential (D). It is widely used in industrial control systems and has the advantages of simple principle, easy implementation, and wide application. The PID control algorithm controls the controlled quantity through the error signal. Its basic principle is to perform calculations according to the functional relationship of proportional, integral, and differential based on the input deviation value, and the calculation results are used to control the output. Specifically, the proportion (P) is used to directly adjust the control quantity proportionally according to the size of the error to reduce the error. The integral (I) is used to accumulate the error and eliminate the static error, but it may cause the system response to slow down. The differential (D) is used to make adjustments in advance according to the rate of change of the error, speed up the system response, and reduce overshoot and oscillation.
[0025] Finite impulse response (FIR) filtering algorithm is one of the commonly used filtering algorithms in digital signal processing. FIR filter (also known as non-recursive filter) is the most basic component of signal processing system. Its main features include linear phase, easy implementation, good stability and flexible design. Its design is usually based on window function method or least squares method. Window function method is mainly used to design low-pass and band-pass filters, while least squares method is suitable for designing band-stop filters.
[0026] Metal oxide semiconductor field effect transistor (MOSFET), also known as MOS module or MOS tube for short, is a semiconductor device widely used in modern electronic circuits. MOS module plays a vital role in chips and is usually used in amplification circuits and switching circuits. Its working principle is based on the electric field effect, which controls the current between the source and the drain by applying a voltage on the gate.
[0027] Pulse width modulation (PWM) technology is a technology that uses the digital output of a microprocessor to control analog circuits. PWM encodes the level of analog signals by adjusting the width of the pulse (i.e., duty cycle), thereby controlling the voltage or current in the circuit. PWM technology is widely used in various electronic devices, especially in motor control, light emitting diode (LED) brightness adjustment and communication systems.
[0028] At present, traditional temperature control systems rely only on simple switch control logic, which may not be able to achieve fine temperature regulation, resulting in large temperature fluctuations and failure to meet the needs of some temperature-sensitive application scenarios. Specifically, when the ambient temperature changes rapidly, the traditional temperature control system may lag behind and fail to adjust the working state of the heating device or cooling device in time, resulting in unstable temperature control. Due to the non-intelligent nature of traditional temperature control systems, they may not be able to effectively manage energy, resulting in the heating device or cooling device being in working state when it is not necessary, thus increasing energy consumption. In addition, frequent full-power startup and shutdown will cause increased wear of the heating device or cooling device, shortening the service life of the relevant device / equipment.
[0029] In some embodiments, the temperature of the cabinet can be adjusted based on a fuzzy logic algorithm. Specifically, the fuzzy logic algorithm can simulate the human thinking process to make decisions for complex systems. Although the fuzzy logic algorithm can process uncertain information, the disadvantage is that it requires a large amount of fuzzy rules and training data.
[0030] In other embodiments, the temperature of the cabinet can be predicted and adjusted through a neural network model. Specifically, the neural network model is a computing model that simulates the work of human brain neurons, can adapt to the environment and can learn to optimize the temperature adjustment process. However, the method of temperature adjustment through a neural network model requires a large amount of training data and computing resources, and cannot adapt to the temperature control process of multiple scenarios.
[0031] Based on this, the embodiments of the present application provide a temperature control method, device, electronic device and storage medium. Since the control instruction includes the temperature parameter to be adjusted, the electronic device can accurately adjust the temperature of the target device. In addition, since the PWM technology can be used to accurately adjust the temperature during the temperature adjustment process, unnecessary frequent startup of the electronic device is avoided, and the stability of the electronic device is improved.
[0032] Exemplarily, the electronic device that executes the temperature control method provided in the embodiment of the present application can be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, and a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) device, and the embodiment of the present application does not impose any special restrictions on the specific form of the electronic device. It can interact with the user through one or more methods such as a keyboard, a touchpad, a touch screen, a remote control, voice interaction or a handwriting device.
[0033] Optionally, the above-mentioned electronic device can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (content delivery network, CDN), as well as big data and artificial intelligence platforms.
[0034] like Figure 1 As shown, the temperature control method provided in the embodiment of the present application may include S101-S104.
[0035] S101: Acquire a digital signal.
[0036] The digital signal is used to represent the current temperature of the target device.
[0037] Exemplarily, the target device may be a cabinet or a constant temperature cabinet, etc.
[0038] In an optional implementation, the electronic device may acquire an initial electrical signal representing the current temperature of the target device, and convert the initial electrical signal to obtain the above digital signal.
[0039] S102: Generate a control instruction based on a PID control algorithm and a digital signal.
[0040] Specifically, the electronic device may determine the temperature parameter that needs to be adjusted based on the control algorithm and the digital signal, thereby generating the above control instruction.
[0041] Optionally, the above control instruction may include a temperature parameter that needs to be adjusted, specifically the temperature that needs to be adjusted.
[0042] In the embodiment of the present application, the control instruction generated by the electronic device is a control signal calculated based on the PID control algorithm, which can also be understood as a total output signal. The total output signal (or control instruction) is used to indicate the degree of temperature adjustment of the target device.
[0043] S103, generating a PWM signal based on the control instruction.
[0044] It should be understood that the electronic device may include a MOS module (or MOS tube). After generating the control instruction, the electronic device may convert the digital signal into a control signal (ie, a PWM signal) suitable for the MOS module through PWM technology.
[0045] S104: Adjust the current temperature of the target device to the target temperature based on the PWM signal.
[0046] It should be understood that the above-mentioned MOS module may include a gate module. Specifically, the above-mentioned PWM signal will be transmitted to the gate module (or the gate of the MOS tube). When the voltage of the gate module exceeds the voltage threshold, the MOS module will be turned on, allowing current to flow from the source to the drain. By changing the voltage of the gate module or the duty cycle of the PWM signal, the conduction degree of the MOS tube is adjusted, thereby controlling the current flowing through the MOS tube.
[0047] In addition, as the MOS module is turned on, the temperature adjustment process begins to execute. Specifically, for the heating process in the temperature adjustment process, the current generates heat through the heating element, and for the cooling process in the temperature adjustment process, the current drives the fan or other cooling equipment. By adjusting the on-time and on-degree of the MOS module, the power output of the temperature adjustment process can be controlled to achieve the desired temperature adjustment effect, that is, to adjust the current temperature of the target device to the target temperature.
[0048] The technical solution provided by the above embodiment can at least bring the following beneficial effects: From S101-S104, it can be known that the electronic device can obtain a digital signal for characterizing the current temperature of the target device, and generate a control instruction based on the PID control algorithm and the digital signal. Afterwards, the electronic device can generate a PWM signal based on the control instruction and adjust the current temperature of the target device to the target temperature based on the PWM signal. Since the control instruction includes the temperature parameter that needs to be adjusted, the electronic device can accurately adjust the temperature of the target device. In addition, since the PWM technology can be used to achieve accurate adjustment during the temperature adjustment process, unnecessary frequent startup of the electronic device is avoided, and the stability of the electronic device is improved.
[0049] Combination Figure 1 ,like Figure 2 The above-mentioned acquisition of digital signals specifically includes S1011-S1013.
[0050] S1011. Acquire an initial electrical signal representing the current temperature.
[0051] Specifically, the electronic device may acquire (or detect) the current temperature of the target device, and convert the temperature signal into the above-mentioned initial electrical signal through a thermistor.
[0052] Optionally, the temperature signal includes resistance, voltage, current and frequency.
[0053] S1012: Filter the initial electrical signal to obtain a target electrical signal.
[0054] It should be understood that the process of an electronic device obtaining a target electrical signal can also be understood as signal conditioning of the initial electrical signal, such as filtering to remove noise, amplifying the signal to make it reach the optimal input range of the analog-to-digital converter, etc.
[0055] In the embodiment of the present application, the above-mentioned electrical signal (including the initial electrical signal and the target electrical signal) may be an analog electrical signal.
[0056] Optionally, the electronic device may filter the initial electrical signal using a preset filtering algorithm.
[0057] Exemplarily, the above-mentioned preset filtering algorithm is a FIR filtering algorithm.
[0058] S1013: convert and quantize the target electrical signal to obtain a digital signal.
[0059] Specifically, the electronic device can obtain a series of digital values by quantizing the target electrical signal, and can convert the continuous target electrical signal into a discrete digital signal through an analog-to-digital converter.
[0060] It should be understood that when an electronic device (specifically an analog-to-digital converter) converts a target electrical signal into a digital signal, it will specifically quantize the sampled analog voltage and map it to a limited set of digital values. In addition, the quantization process involves determining the resolution (i.e., the number of bits). The higher the resolution, the closer the converted digital signal is to the target electrical signal. These quantized values are then encoded into binary form to facilitate the subsequent digital signal processing process.
[0061] In one implementation of the embodiment of the present application, the filtering process of the initial electrical signal to obtain the target electrical signal may specifically include steps A and B.
[0062] Step A: acquiring the quantized initial electrical signal, the wavelength of the filter for filtering the initial electrical signal, the index of the filter, the quantization compensation coefficient and the phase compensation coefficient.
[0063] The quantization compensation coefficient is used to compensate for the error in the quantization process, and the phase compensation coefficient is used to compensate for the phase delay of the filter.
[0064] Step B: obtaining a target electrical signal based on the quantized initial electrical signal, the wavelength of the filter, the index of the filter, the quantization compensation coefficient and the phase compensation coefficient.
[0065] It should be understood that in the process of digital signal processing, the initial electrical signal will be affected by quantization error after digital-to-analog conversion. Quantization error refers to the error caused by rounding the electrical signal to the nearest representable value during the quantization process. Adding quantization compensation coefficients can compensate for these errors during the filtering process, thereby improving the fidelity of the signal. The phase compensation coefficient can be used to adjust the additional phase delay introduced by the filter to ensure that the initial electrical signal still maintains the original phase relationship after filtering. By using quantization compensation coefficients and phase compensation coefficients, the accuracy of signal processing and the reliability of electronic equipment can be improved.
[0066] In an optional implementation, the target electrical signal may satisfy the following formula:
[0067]
[0068] Where y[t] represents the target electrical signal, t represents the current time, k represents the index of the kth coefficient of the filter, b[k] represents the kth coefficient of the filter, α represents the quantization compensation coefficient, and x q represents the quantized initial electrical signal, λ represents the phase compensation coefficient, N represents the wavelength of the filter, and [t-(k+λ)] represents the time delay equivalent to the current moment. 0.95≤α≤1.05, 1≤k≤N, k and N are positive integers.
[0069] The above phase compensation coefficient satisfies the following formula:
[0070]
[0071] Specifically, λ represents a phase compensation coefficient, N represents the wavelength of the filter (ie, the number of taps of the filter), and N is a positive integer.
[0072] In another optional implementation, the target electrical signal may also satisfy the following formula:
[0073]
[0074] Where y[t] represents the target electrical signal, t represents the current time, k represents the index of the kth coefficient of the filter, b[k] represents the kth coefficient of the filter, and x q represents the initial electrical signal after quantization, N represents the wavelength of the filter, 1≤k≤N, k and N are positive integers.
[0075] Combination Figure 1 ,like Figure 3 The above-mentioned control instructions are generated based on the PID control algorithm and the digital signal, and specifically may include S1021-S1023.
[0076] S1021, determining a proportional gain of the digital signal, an integral gain of the digital signal, a differential gain of the digital signal, a feedforward control item of the target temperature, and a compensation item of the target temperature.
[0077] Among them, the proportional gain is used to characterize the error of the digital signal at the current moment, the integral gain is used to characterize the accumulated error of the digital signal from the initial moment to the current moment, the differential gain is used to characterize the error change trend of the digital signal at the current moment, the feedforward control item is used to characterize the change of the target temperature over time, and the compensation item is used to compensate for the impact of the target device on the target temperature. The proportional gain, integral gain and differential gain are gain coefficients of the PID control algorithm.
[0078] It should be understood that the integral part (i.e., integral gain) of the PID controller can eliminate static errors and ensure that the target device can remain near the desired target value (i.e., target temperature) after long-term operation. The differential part (i.e., differential gain) helps to meet the trend of deviation and respond in advance, preventing overshoot and oscillation, thereby contributing to the stability of the electronic device. In addition, the differential part (or differential term) can meet the changing trend of the electronic device's behavior and adjust the output signal in advance, which can speed up the response speed of the electronic device and reduce the overshoot.
[0079] In an optional implementation, the compensation item includes at least one of capacitance compensation, resistance compensation, and friction compensation. The capacitance compensation is used to compensate for the effect of the capacitance of the target device on the target temperature, the resistance compensation is used to compensate for the effect of the resistance of the target device on the target temperature, and the friction compensation is used to compensate for the effect of the internal friction of the target device on the target temperature.
[0080] S1022. Determine a temperature difference between a current temperature and a target temperature based on the digital signal.
[0081] Specifically, the electronic device may determine the current temperature of the target device based on the digital signal, thereby determining the temperature difference between the current temperature and the target temperature.
[0082] It is understandable that the electronic device (specifically the PID controller) can quickly adjust its output according to the deviation (ie, the temperature difference between the current temperature and the target temperature), thereby quickly responding to changes in the deviation and allowing the target device to approach the target value more quickly.
[0083] S1023, generating a control instruction based on the proportional gain, the integral gain, the differential gain, the feedforward control term, the compensation term and the temperature difference.
[0084] It should be understood that when the target temperature changes frequently, the PID controller needs to be able to respond quickly to these changes. By adjusting the gain coefficients of the PID control algorithm, especially the differential gain, the controller's response speed to rapid changes can be improved. The integral gain can help reduce steady-state errors. Even when the target temperature changes frequently, the output can be gradually adjusted by accumulating errors to ensure that the new target temperature is eventually reached. When the target device is far away from the set point, the integral gain may accumulate a large amount of error, resulting in the so-called "integral saturation."
[0085] In addition, higher capacitance will lead to more energy loss during the switching process, which will affect the energy efficiency of the target device. If the capacitance increases, the charging and discharging time of the circuit will become longer, which will cause the target device to respond more slowly and affect the timeliness of temperature control. Resistance will cause energy to be lost in the form of heat, which is particularly important in temperature control because it may cause additional heat, thereby affecting the temperature control accuracy of the target device. Changes in resistance will affect the control accuracy of the current, which will indirectly affect the power output during the temperature adjustment process, and ultimately affect the accuracy of temperature control. In addition, friction inside the target device will cause energy loss between mechanical parts, increase power consumption, and generate additional heat, affecting the temperature control of the target device.
[0086] Taking into account the frequent changes in the target temperature, the accumulation of integral gain, and the effect of the capacitance, resistance, and friction of the target device on the target temperature over time, the above total output signal (i.e., the control command) can satisfy the following formula:
[0087]
[0088] Wherein, u(t) represents the above total output signal, t represents the current moment, τ represents any moment in the time interval from the initial moment to the current moment, and e(τ) represents the error of the control signal at any moment. K p Represents the proportional gain, which is used to directly affect the error of the control signal at the current moment; K i Represents the integral gain, which is used to accumulate the error of the control signal from the initial moment to the current moment; K d represents the differential gain, which is used to predict the error change trend of the control signal at the current moment. e(t) represents the temperature difference between the current temperature and the target temperature, and F(t) represents the feedforward control term, which is used to characterize the change of the target temperature over time and adjust the output signal in advance. comp (t) represents a compensation term, which is used to compensate for the impact of the target device's internal temperature on the target.
[0089] In addition, the above and represent the maximum value of the current and the minimum value of the current, respectively.
[0090] In an optional implementation, the above compensation items include capacitance compensation, resistance compensation and friction compensation. That is, the compensation items can satisfy the following formula:
[0091]
[0092] Among them, C comp (t) represents the above compensation term, K C represents the capacitance compensation coefficient, C(t) represents the capacitance value of the target device at the current moment, C 0 Indicates standard capacitance, K R represents the resistance compensation coefficient, R(t) represents the resistance value of the target device at the current moment, R 0 Indicates standard resistance, K μ represents the friction compensation coefficient, μ(t) represents the internal friction of the target device at the current moment, and μ 0 Indicates standard friction force. 0.5≤K C ≤1.5,0.5≤K R ≤1.5,0.5≤K μ ≤2.
[0093] Optionally, the above feedforward control term may satisfy the following formula:
[0094]
[0095] Where F(t) represents the feedforward control term, K F represents the feedforward gain coefficient, T tarepresents the target temperature, Indicates the rate of change of target temperature over time, 0≤K F ≤2.
[0096] In another implementation of the embodiment of the present application, the above total output signal may also satisfy the following formula:
[0097]
[0098] Where u(t) represents the total output signal, t represents the current moment, τ represents any moment in the time interval from the initial moment to the current moment, and e(τ) represents the error of the control signal at any moment. p Represents the proportional gain, which is used to directly affect the error of the control signal at the current moment; K i Represents the integral gain, which is used to accumulate the error of the control signal from the initial moment to the current moment; K d represents the differential gain, which is used to predict the error change trend of the control signal at the current moment; e(t) represents the temperature difference between the current temperature and the target temperature.
[0099] In the embodiment of the present application, the electronic device can accurately adjust the temperature deviation by adopting the PID control algorithm, combining the effects of proportional gain, integral gain and differential gain, and can quickly respond even to frequent changes in the target temperature. In addition, by adding feedforward control items and compensation items, the change of the target temperature over time and the changes of the device parameters (including capacitance, resistance, friction) inside the target device are fully considered, making the electronic device more stable and reliable, thereby achieving precise control of the temperature of the target device, and improving the response speed and control accuracy of the electronic device.
[0100] Combination Figure 1 ,like Figure 4 In one implementation of the embodiment of the present application, the control instruction includes the target power. The above-mentioned generating the PWM signal based on the control instruction specifically includes S1031-S1033.
[0101] S1031. Obtain the maximum power during the temperature adjustment process of the target device.
[0102] In the embodiment of the present application, the above target power can also be understood as power adjustment information in the temperature adjustment process. The maximum power can be understood as the power level specified by the electronic device.
[0103] It should be understood that before obtaining the above maximum power, the electronic device needs to set the basic parameters of the PWM controller, which include frequency and resolution. The frequency is used to determine the period of the PWM signal, and the resolution is used to determine how many different duty cycles are included in each period.
[0104] S1032: Determine a target duty cycle based on the maximum power and the target power.
[0105] The target duty cycle is used to characterize the ratio of the power-on time of the PWM signal in one pulse cycle to the total time.
[0106] It should be understood that the duty cycle of the PWM signal can also be used to represent the proportion of the high level of the PWM signal in one cycle.
[0107] Optionally, the target duty cycle may satisfy the following formula:
[0108]
[0109] Where, DC represents the target duty cycle, T p represents the above target power, M p Indicates the maximum power mentioned above.
[0110] S1033. Generate a PWM signal based on the target duty cycle.
[0111] In combination with the description of the above embodiments, it should be understood that after the electronic device generates a PWM signal, the PWM signal can be applied to the gate module to control the conduction degree and conduction time of the MOS module. By changing the duty cycle of the PWM signal, the conduction time and conduction degree of the MOS module are adjusted to control the power output during the temperature adjustment process.
[0112] In the embodiment of the present application, PWM technology allows efficient energy conversion, because in each cycle of the PWM signal, the MOS tube is either fully turned on or fully turned off, which reduces the loss in the intermediate state and improves efficiency. By changing the duty cycle of the PWM signal (i.e., the ratio of the duration of the high level to the entire cycle time), the electronic device can very accurately control the output power in the temperature regulation process, which is very useful for processes that require fine temperature control. In the temperature control method provided in the embodiment of the present application, PWM technology can provide a stable average power output, thereby helping to maintain temperature stability. And by adjusting the duty cycle of the PWM signal, it is possible to achieve output power regulation from extremely low to extremely high, providing a larger dynamic range. In addition, since PWM technology can reduce unnecessary full-on and full-off operations in the temperature regulation process, it can effectively avoid the wear of electronic equipment caused by frequent startup of the temperature regulation process, thereby extending the service life of the electronic equipment.
[0113] In an optional implementation, the above-mentioned generating a PWM signal based on the target duty cycle may specifically include steps C to E.
[0114] Step C: Setting the timing module to control the period and duty cycle of the PWM signal.
[0115] Specifically, the process of setting the timing module of the electronic device is as follows:
[0116] / / Select timer TIM2
[0117] TIM_HandleTypeDef htim2;
[0118] / / Initialize the timer
[0119] htim2.Instance = TIM2;
[0120] htim2.Init.Prescaler = 83; / / Assuming the system clock is 16MHz, the prescaler is 83, and the counting frequency is 16MHz / 84≈190kHz
[0121] htim2.Init.CounterMode=TIM_COUNTERMODE_UP;
[0122] htim2.Init.Period = 999; / / Set a period to 1ms (assumed)
[0123] htim2.Init.ClockDivision=TIM_CLOCKDIVISION_DIV1;
[0124] if(HAL_TIM_PWM_Init(&htim2)!=HAL_OK)
[0125] {
[0126] Error_Handler();
[0127] }
[0128] Step D: Set the output pin to high level and keep T on time; and set the output pin to low level and keep TT on time.
[0129] Where T represents the time length of a complete cycle of the PWM signal, T on Indicates the length of time the PWM signal remains high in each cycle, TT on Indicates the length of time the PWM signal remains at a low level in each cycle.
[0130] In the embodiment of the present application, the PWM signal maintaining a high level can also be understood as the PWM signal maintaining a high level. Similarly, the PWM signal maintaining a low level can also be understood as the PWM signal maintaining a ground level.
[0131] Step E: Repeat the switching between the high level and the low level in a complete cycle until the required signal duration T is reached, that is, a PWM signal is generated.
[0132] like Figure 5 As shown, the electronic device in the embodiment of the present application may include a temperature sensing unit 201, a signal processing unit 202, a control unit 203, a heating and cooling unit 204 and a power management unit 205.
[0133] Specifically, the temperature sensing unit 201 is used to detect the current temperature of the target device and convert the temperature signal into an electrical signal through a thermistor.
[0134] The signal processing unit 202 is used to convert the electrical signal transmitted by the temperature sensing unit 201 into a digital signal through an analog-to-digital converter.
[0135] The control unit 203 is used to receive the digital signal converted by the signal processing unit 202, and calculate the temperature parameter to be adjusted according to the PID control algorithm to generate a control instruction. In the process of generating the control instruction, the control unit 203 takes into account the frequent changes of the target temperature, the accumulation of integral terms, and the influence of the change of the capacitance, resistance and friction of the target device over time.
[0136] The heating and cooling unit 204 is used to receive control instructions from the control unit 203 to adjust the temperature of the target device.
[0137] Optionally, the heating and cooling unit 204 includes a heating module and a cooling module. Specifically, the heating module receives an instruction to increase (or decrease) the current of the heating element (or to switch the heating module on and off) to ensure that the temperature of the target device is not lower than a set minimum temperature (T min The cooling module receives a command to increase the cooling power of the cooling device to ensure that the temperature of the target device does not exceed the set maximum temperature (T max ).
[0138] The power management unit 205 is used to control the power supply of the heating and cooling unit 204 by utilizing the switching characteristics of the MOS module, so as to achieve accurate power regulation.
[0139] The embodiment of the present application can divide the functional modules of the electronic device etc. according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0140] In the case of dividing each functional module into corresponding functional modules, Figure 6 A possible structural diagram of the temperature control device involved in the above embodiment is shown. Figure 6 As shown, the temperature control device 30 may include: an acquisition module 301 and a processing module 302 .
[0141] The acquisition module 301 is used to acquire a digital signal, where the digital signal is used to represent the current temperature of the target device.
[0142] The processing module 302 is used to generate a control instruction based on the PID control algorithm and the digital signal.
[0143] The processing module 302 is further configured to generate a PWM signal based on the control instruction.
[0144] The processing module 302 is further configured to adjust the current temperature of the target device to a target temperature based on the PWM signal.
[0145] Optionally, the acquisition module 301 is specifically configured to acquire an initial electrical signal representing the current temperature.
[0146] The processing module 302 is further used to filter the initial electrical signal to obtain a target electrical signal.
[0147] The processing module 302 is further used to perform conversion processing and quantization processing on the target electrical signal to obtain the digital signal.
[0148] Optionally, the acquisition module 301 is also used to obtain the initial electrical signal after quantization processing, the wavelength of the filter that filters the initial electrical signal, the index of the filter, the quantization compensation coefficient and the phase compensation coefficient, the quantization compensation coefficient is used to compensate for the error in the quantization processing process, and the phase compensation coefficient is used to compensate for the phase delay of the filter.
[0149] The processing module 302 is specifically configured to obtain the target electrical signal based on the initial electrical signal after the quantization processing, the wavelength of the filter, the index of the filter, the quantization compensation coefficient, and the phase compensation coefficient.
[0150] Optionally, the temperature control device 30 further includes a determination module 303 .
[0151] The determination module 303 is used to determine the proportional gain of the digital signal, the integral gain of the digital signal, the differential gain of the digital signal, the feedforward control item of the target temperature and the compensation item of the target temperature, wherein the proportional gain is used to characterize the error of the digital signal at the current moment, the integral gain is used to characterize the accumulated error of the digital signal from the initial moment to the current moment, the differential gain is used to characterize the error change trend of the digital signal at the current moment, the feedforward control item is used to characterize the change of the target temperature over time, and the compensation item is used to compensate for the influence of the target device on the target temperature. The proportional gain, the integral gain and the differential gain are gain coefficients of the PID control algorithm.
[0152] The determination module 303 is further configured to determine the temperature difference between the current temperature and the target temperature based on the digital signal.
[0153] The processing module 302 is specifically configured to generate the control instruction based on the proportional gain, the integral gain, the differential gain, the feedforward control term, the compensation term and the temperature difference.
[0154] Optionally, the above compensation items include at least one of capacitance compensation, resistance compensation and friction compensation, wherein the capacitance compensation is used to compensate for the influence of the capacitance of the target device on the target temperature, the resistance compensation is used to compensate for the influence of the resistance of the target device on the target temperature, and the friction compensation is used to compensate for the influence of internal friction of the target device on the target temperature.
[0155] Optionally, the control instruction includes a target power.
[0156] The acquisition module 301 is further used to acquire the maximum power during the temperature adjustment process of the target device.
[0157] The determination module 303 is used to determine the target duty cycle based on the maximum power and the target power. The target duty cycle is used to represent the proportion of the power-on time of the PWM signal in a pulse cycle to the total time.
[0158] The processing module 302 is specifically configured to generate the PWM signal based on the target duty cycle.
[0159] In the case of an integrated unit, Figure 7 FIG. 2 shows a possible structural diagram of the temperature control device involved in the above embodiment. Figure 7As shown, the temperature control device 40 may include: a processing module 401 and a communication module 402. The processing module 401 may be used to control and manage the actions of the temperature control device 40. The communication module 402 may be used to support the communication between the temperature control device 40 and other entities. Figure 7 As shown, the temperature control device 40 may further include a storage module 403 for storing program codes and data of the temperature control device 40 .
[0160] The processing module 401 may be a processor or a controller. The communication module 402 may be a transceiver, a transceiver circuit or a communication interface, etc. The storage module 403 may be a memory.
[0161] When the processing module 401 is a processor, the communication module 402 is a transceiver, and the storage module 403 is a memory, the processor, the transceiver, and the memory may be connected via a bus. The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
[0162] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0163] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0165] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0166] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing a computer program instruction on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or may contain one or more servers, data centers and other data storage devices that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0167] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A temperature control method, characterized in that: include: Acquire a digital signal, where the digital signal is used to represent the current temperature of the target device; Generate a control instruction based on a proportional-integral-derivative (PID) control algorithm and the digital signal; Generate a pulse width modulation (PWM) signal based on the control instruction; The current temperature of the target device is adjusted to a target temperature based on the PWM signal.
2. The method according to claim 1, characterized in that The obtaining of the digital signal comprises: Acquiring an initial electrical signal representing the current temperature; Performing filtering on the initial electrical signal to obtain a target electrical signal; The target electrical signal is converted and quantized to obtain the digital signal.
3. The method according to claim 2, characterized in that The filtering the initial electrical signal to obtain the target electrical signal includes: Acquire the initial electrical signal after quantization processing, the wavelength of the filter for filtering the initial electrical signal, the index of the filter, a quantization compensation coefficient, and a phase compensation coefficient, wherein the quantization compensation coefficient is used to compensate for errors in the quantization processing process, and the phase compensation coefficient is used to compensate for the phase delay of the filter; The target electrical signal is obtained based on the initial electrical signal after the quantization processing, the wavelength of the filter, the index of the filter, the quantization compensation coefficient and the phase compensation coefficient.
4. The method according to claim 1, characterized in that: The generating of control instructions based on the proportional integral differential PID control algorithm and the digital signal comprises: Determine the proportional gain of the digital signal, the integral gain of the digital signal, the differential gain of the digital signal, the feedforward control item of the target temperature, and the compensation item of the target temperature, wherein the proportional gain is used to characterize the error of the digital signal at the current moment, the integral gain is used to characterize the accumulated error of the digital signal from the initial moment to the current moment, the differential gain is used to characterize the error change trend of the digital signal at the current moment, the feedforward control item is used to characterize the change of the target temperature over time, and the compensation item is used to compensate for the influence of the inside of the target device on the target temperature, and the proportional gain, the integral gain, and the differential gain are gain coefficients of the PID control algorithm; determining a temperature difference between the current temperature and the target temperature based on the digital signal; The control command is generated based on the proportional gain, the integral gain, the derivative gain, the feedforward control term, the compensation term, and the temperature difference.
5. The method according to claim 4, characterized in that The compensation item includes at least one of capacitance compensation, resistance compensation and friction compensation. The capacitance compensation is used to compensate for the influence of the capacitance of the target device on the target temperature. The resistance compensation is used to compensate for the influence of the resistance of the target device on the target temperature. The friction compensation is used to compensate for the influence of internal friction of the target device on the target temperature.
6. The method according to any one of claims 1 to 5, characterized in that The control instruction includes a target power, and the generating of a pulse width modulation (PWM) signal based on the control instruction includes: Acquire the maximum power during the temperature adjustment of the target device; Based on the maximum power and the target power, determining a target duty cycle, wherein the target duty cycle is used to characterize the proportion of the power-on time of the PWM signal in a pulse cycle to the total time; Based on the target duty cycle, the PWM signal is generated.
7. A temperature control device, characterized in that: include: Acquisition module and processing module; The acquisition module is used to acquire a digital signal, where the digital signal is used to represent the current temperature of the target device; The processing module is used to generate a control instruction based on a proportional-integral-differential (PID) control algorithm and the digital signal; The processing module is further used to generate a pulse width modulation (PWM) signal based on the control instruction; The processing module is further configured to adjust the current temperature of the target device to a target temperature based on the PWM signal.
8. An electronic device, characterized in that: The electronic device comprises: processor; a memory configured to store instructions executable by the processor; The processor is configured to execute the instructions to implement the temperature control method according to any one of claims 1 to 6.
9. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to execute the temperature control method according to any one of claims 1 to 6.
10. A computer program product comprising instructions, characterized in that When the instruction is executed on an electronic device, the electronic device executes the temperature control method according to any one of claims 1 to 6.
Citation Information
Patent Citations
High-precision temperature-compensation MEMS (Micro-Electromechanical System) oscillator based on parasitic capacitance adjustment
CN102594260A
Handheld laser gas concentration monitor and control method thereof
CN104792729A
Friction stir welding apparatus and method, and friction stir welding control device
CN108687439A
Automatic temperature control correcting device and method for resistance type heating device
CN109164851A
Low-consumption mute electrical cabinet automatic temperature control device and temperature control system thereof
CN111290448A