CN110940095A - Constant temperature control method and system - Google Patents

Constant temperature control method and system Download PDF

Info

Publication number
CN110940095A
CN110940095A CN201911050885.5A CN201911050885A CN110940095A CN 110940095 A CN110940095 A CN 110940095A CN 201911050885 A CN201911050885 A CN 201911050885A CN 110940095 A CN110940095 A CN 110940095A
Authority
CN
China
Prior art keywords
temperature
error
preset
sum
preset threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911050885.5A
Other languages
Chinese (zh)
Other versions
CN110940095B (en
Inventor
谢岳荣
谭汝辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Lohua Home Co Ltd
Original Assignee
Guangdong Lohua Home Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Lohua Home Co Ltd filed Critical Guangdong Lohua Home Co Ltd
Priority to CN201911050885.5A priority Critical patent/CN110940095B/en
Publication of CN110940095A publication Critical patent/CN110940095A/en
Application granted granted Critical
Publication of CN110940095B publication Critical patent/CN110940095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F24HEATING; RANGES; VENTILATING
    • F24HFLUID HEATERS, e.g. WATER OR AIR HEATERS, HAVING HEAT-GENERATING MEANS, e.g. HEAT PUMPS, IN GENERAL
    • F24H9/00Details
    • F24H9/20Arrangement or mounting of control or safety devices
    • F24H9/2007Arrangement or mounting of control or safety devices for water heaters

Abstract

The invention discloses a constant temperature control method, which comprises the steps of calculating a temperature error, error accumulation and temperature control output, when the temperature control output is larger than a first preset threshold value, adjusting the power of a heater according to the first preset threshold value, obtaining preset constant temperature and detection voltage, calculating the temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is smaller than zero or not, if so, calculating the error accumulation sum, judging whether the judgment is negative or not, not calculating the error accumulation sum, when the temperature control output is smaller than a second preset threshold value, adjusting the power of the heater according to the second preset threshold value, obtaining the preset constant temperature and the detection voltage, calculating the temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is larger than zero or not, if so, calculating the error accumulation sum, and judging whether the error accumulation sum is negative or not. Correspondingly, the invention also discloses a constant temperature control system. By adopting the invention, the temperature can be adjusted in time according to the real-time water temperature, and the stability of temperature adjustment is improved.

Description

Constant temperature control method and system
Technical Field
The invention relates to a bathroom equipment control technology, in particular to a constant temperature control method and system.
Background
At present, bathing equipment such as a bathtub has a constant temperature function, and the water temperature is controlled at a preset temperature. The common method uses a hysteresis control method to detect the water temperature in real time, controls the heater to heat when the water temperature is lower than a lower limit value, and controls the heater to stop heating when the water temperature is higher than an upper limit value, so that the water temperature is controlled in an interval above and below a preset temperature.
The reference CN204246022U discloses a dynamic constant temperature static bath apparatus, which is characterized in that: the static bath instrument comprises a shell, wherein a power line, a water inlet and a water outlet are arranged on the shell, a circulating water path communicated with the water inlet and the water outlet, an automatic temperature control unit electrically connected with the power line, a water circulating unit and a heating unit are arranged in the shell; the automatic temperature control unit detects the temperature of bath water through the temperature sensor, when the temperature is lower than a first set value, the water circulation unit and the heating unit are started, the water circulation unit enables bath water to flow into the circulation water path from the water inlet and then flow out from the water outlet, the heating unit heats the bath water flowing through the circulation water path, and when the temperature is higher than a second set value, the water circulation unit and the heating unit are closed.
However, in the prior art, if the difference between the lower limit value and the upper limit value is too large, the temperature is liable to swing back and forth between the two set values, and on the contrary, the relay is opened and closed many times in a short time, which deteriorates the life of the heater.
Disclosure of Invention
The invention aims to provide a constant temperature control method and a constant temperature control system, which can adjust in time according to real-time water temperature and improve the stability of temperature adjustment.
In order to solve the technical problem, the invention provides a constant temperature control method, which comprises the following steps: s101, acquiring a preset constant temperature set by a user and a detection voltage detected by a temperature sensor; s102, calculating a temperature error according to a preset constant temperature and a detection voltage; s103, calculating error accumulation sum according to the temperature error; s104, calculating temperature control output according to the temperature error and the error accumulation; s105, judging whether the temperature control output is larger than a first preset threshold value or not, S106, if so, adjusting the power of the heater according to the first preset threshold value to obtain preset constant temperature and detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is smaller than zero or not, if so, returning to S103, if not, returning to S104, if not, judging whether the temperature control output is smaller than a second preset threshold value or not, judging whether the temperature control output is smaller than the second preset threshold value or not, returning to S101, if so, adjusting the power of the heater according to the second preset threshold value to obtain the preset constant temperature and the detection voltage, calculating the temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is larger than zero or not, returning to S103, if not, and returning to S104.
As an improvement of the above scheme, the first preset threshold is greater than the second preset threshold, the thermostatic control method further includes setting the first preset threshold and the second preset threshold in a debugging manner, and the specific steps include: s201, acquiring preset constant temperature precision; s202, acquiring an initial value of a first preset threshold and an initial value of a second preset threshold; s203, carrying out constant temperature adjustment according to the steps from S101 to S107, and detecting the maximum temperature deviation; s204, judging whether the maximum temperature deviation is larger than the preset constant temperature precision or not, if so, S205, lowering the first preset threshold value according to the preset proportion, raising the second preset threshold value according to the preset proportion, returning to the step S203, and if not, finishing debugging.
As an improvement of the above scheme, the step of calculating the temperature error according to the preset constant temperature and the detection voltage includes: acquiring a reference temperature voltage set by a user, and calculating a real-time detection temperature T:
T=(Ui-Uc)×K
wherein K is the temperature coefficient of the thermistor, UiFor reference to temperature voltage, UcT is the real-time detection temperature for detecting the voltage; calculating the temperature error er:
er=Ts-T
where er is the temperature error, TsT is the real-time detection temperature.
As an improvement of the above scheme, the formula for calculating the error accumulated sum according to the temperature error is as follows:
ersum=ersum-pre+er
wherein, ersumFor error cumulative sum, ersum-preThe error accumulated sum is calculated last time, and er is the temperature error.
As an improvement of the scheme, a formula for calculating the temperature control output according to the temperature error and the error accumulation is as follows:
O=p·er+i·ersum+d·(er-erpre)
wherein O is the temperature control output, p is the proportionality coefficient, i is the integral coefficient, d is the differential coefficient, er is the temperature error, erpreIs the temperature error calculated last time.
Correspondingly, the invention also discloses a constant temperature control system, which comprises: the acquisition module is used for acquiring preset constant temperature set by a user and detection voltage detected by the temperature sensor; the temperature difference calculation module is used for calculating a temperature error according to a preset constant temperature and the detection voltage; the error sum calculating module is used for calculating the error accumulated sum according to the temperature error; the temperature control computing module is used for computing temperature control output according to the temperature error and the error accumulation sum; the temperature control output judging module is used for judging whether the temperature control output is greater than a first preset threshold value or not; the temperature reduction control module is used for adjusting the power of the heater according to a first preset threshold value when the judgment result is yes, acquiring preset constant temperature and detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is smaller than zero or not, calling the error and calculation module if the judgment result is yes, and calling the temperature control calculation module if the judgment result is not; and the heating control module is used for judging whether the temperature control output is smaller than a second preset threshold value or not when judging not, judging whether the temperature control output is smaller than the second preset threshold value or not, adjusting the heater power according to the temperature control output and calling the acquisition module, judging whether the temperature control output is larger than the second preset threshold value or not, adjusting the heater power according to the second preset threshold value, acquiring preset constant temperature and detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is larger than zero or not, calling the error and calculation module if the temperature control output is larger than the second preset threshold value.
As an improvement of the above scheme, the first preset threshold is greater than the second preset threshold, the thermostatic control system further includes a threshold setting module, and the threshold setting module is configured to perform debugging setting on the first preset threshold and the second preset threshold, and includes: the constant temperature precision acquisition module is used for acquiring preset constant temperature precision; the initial value acquisition module is used for acquiring an initial value of a first preset threshold value and an initial value of a second preset threshold value; the maximum temperature difference measuring module is used for calling the acquisition module, the temperature difference calculating module, the error and calculating module, the temperature control output judging module, the cooling control module and the heating control module to perform constant temperature regulation and detecting the maximum temperature deviation; the temperature difference precision judging module is used for judging whether the maximum temperature deviation is greater than the preset constant temperature precision or not; the threshold value adjusting module is used for reducing a first preset threshold value according to a preset proportion, increasing a second preset threshold value according to the preset proportion and calling the maximum temperature difference measuring module if the judgment is yes; and the debugging ending module is used for judging whether the debugging is ended or not.
As an improvement of the above scheme, the temperature difference calculation module includes: and the detection temperature calculation unit is used for acquiring the reference temperature voltage set by the user and calculating the real-time detection temperature T:
T=(Ui-Uc)×K
wherein K is the temperature coefficient of the thermistor, UiFor reference to temperature voltage, UcT is the real-time detection temperature for detecting the voltage; a temperature error calculation unit for calculating a temperature error er according to the following formula:
er=Ts-T
where er is the temperature error, TsT is the real-time detection temperature.
As an improvement of the above scheme, the error sum calculation module calculates the error accumulated sum according to the temperature error by the following formula:
ersum=ersum-pre+er
wherein, ersumFor error cumulative sum, ersum-preThe error accumulated sum is calculated last time, and er is the temperature error.
As an improvement of the above scheme, the formula for the temperature control calculation module to calculate the temperature control output according to the temperature error and the error accumulation is as follows:
O=p·er+i·ersum+d·(er-erpre)
wherein O is the temperature control output, p is the proportionality coefficient, i is the integral coefficient, d is the differential coefficient, er is the temperature error, erpreIs the temperature error calculated last time.
The implementation of the invention has the following beneficial effects:
the constant temperature control method and the system can adjust in time according to the real-time water temperature, and improve the stability of temperature adjustment.
Specifically, firstly, the water temperature is detected in real time, then a temperature error is calculated according to the real-time detected temperature and a preset constant temperature, and then temperature control output is calculated according to the temperature error, so that the power of the heater is controlled. When the temperature is detected in real time, the error between the temperature and the preset constant temperature is changed, so that the temperature control output and the power of the heater are changed, the power of the heater is adjusted in time, and the stability of temperature adjustment is improved. Secondly, when the temperature control output is larger than a first preset threshold value, the power is adjusted according to the first preset threshold value to prevent the temperature control output from exceeding the upper power adjustment limit to cause processing errors, and similarly, when the temperature control output is smaller than a second preset threshold value, the power is adjusted according to the second preset threshold value to prevent the temperature control output from exceeding the lower power adjustment limit to cause processing errors. Thirdly, when the temperature control output is greater than the first preset threshold, the error accumulation sum is calculated only when the temperature error is less than 0, so that the temperature control output is prevented from being too large and cannot be adjusted in time when the power is reversely adjusted.
Drawings
FIG. 1 is a general flow diagram of the thermostatic control method of the present invention;
FIG. 2 is a flowchart illustrating the debugging of the thermostatic control method according to the present invention to the first preset threshold and the second preset threshold;
FIG. 3 is a flow chart of the thermostatic control method of the present invention for calculating a temperature error according to a preset thermostatic temperature and a detected voltage;
FIG. 4 is a schematic diagram of the thermostat control system of the present invention;
FIG. 5 is a schematic diagram of the configuration of a threshold setting module of the thermostat control system of the present invention;
FIG. 6 is a schematic diagram of a temperature difference calculation module of the thermostat control system of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings. It is only noted that the invention is intended to be limited to the specific forms set forth herein, including any reference to the drawings, as well as any other specific forms of embodiments of the invention.
Fig. 1 shows a general flow chart of the thermostatic control method of the present invention, which includes:
s101, acquiring preset constant temperature set by a user and detection voltage detected by a temperature sensor.
And S102, calculating a temperature error according to the preset constant temperature and the detection voltage.
The temperature error is an index for measuring the difference between the real-time detection temperature and the preset constant temperature, and is a basic parameter for adjusting the power of the heater.
And S103, calculating error accumulation sum according to the temperature error.
It should be noted that, the heater is controlled to be turned off when the current hysteresis control reaches the upper limit, and the heater is controlled to be turned on and heated when the current hysteresis control reaches the lower limit, and the on-off control cannot achieve a good constant temperature effect when the upper limit and the lower limit are large, and the heater is frequently turned on and off when the upper limit and the lower limit are small, so that the service life of the heater is damaged for a long time. The power can be continuously adjusted through the error accumulation sum, so that the technical problem is solved. The error accumulation sum is an index for measuring all errors, and cannot change along with the change of one error, so that frequent change is prevented. For example, when the error sum is 3 ℃, when the newly calculated temperature error is-0.5 ℃, the two are added, the new error sum is 2.5 ℃, which does not turn off the heater at once but reduces the power of the heater, and if the calculated error is still negative, the error sum is reduced all the time, which also reduces the power of the heater until the power is reduced to zero and finally stops heating, so that the adjustment makes the adjustment more stable and protects the heater.
S104, calculating temperature control output according to the temperature error and the error accumulation;
the temperature control output is calculated by temperature error and error accumulation, and the proportion of the temperature error can prevent the error accumulation and adjustment from being too slow.
S105, judging whether the temperature control output is larger than a first preset threshold value,
s106, when the judgment is yes, adjusting the heater power according to the first preset threshold value, obtaining the preset constant temperature and the detection voltage, calculating the temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is less than zero, if so, returning to S103, if not, returning to S104,
it should be noted that both the temperature control output and the first preset threshold are pulse width values, the pulse width refers to the time for turning on the circuit in the preset period, and the ratio of the pulse width to the preset period can be used for adjusting the heater power, thereby realizing the continuous adjustment of the heater power. This ratio is the duty cycle.
When the temperature control output is larger than a first preset threshold value, the power of the heater is adjusted according to the first preset threshold value, and data overflow caused by the fact that the power proportion of the heater is too high and even exceeds the upper limit of the duty ratio is effectively prevented.
After the power of the heater is adjusted, the latest preset constant temperature and the latest detection voltage are obtained again, and the latest temperature error is calculated.
When the temperature error is less than zero, the process returns to S103 to calculate the error accumulation sum, so that the temperature control output calculated according to the error accumulation sum can be reduced below a first preset threshold, and the power of the heater is reduced at a lower duty ratio, thereby reducing the overhigh water temperature in time.
And when the temperature error is larger than or equal to zero, skipping the calculation of calculating the error accumulated sum, directly returning to S104, calculating the next temperature control output according to the original error accumulated sum and the newly calculated temperature error, and performing subsequent control on the power of the heater according to the next temperature control output, thereby preventing the situation that the calculated temperature control output is farther away from the first preset threshold value due to the fact that the value of the error accumulated sum is larger and larger, and the power of the heater cannot be effectively reduced.
S107, when the judgment result is no, judging whether the temperature control output is smaller than a second preset threshold value, judging whether the judgment result is no, adjusting the heater power according to the temperature control output and returning to S101, judging whether the judgment result is yes, adjusting the heater power according to the second preset threshold value, obtaining a preset constant temperature and a detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is larger than zero, returning to S103 if the judgment result is yes, and returning to S104 if the judgment result is no.
It should be noted that the second preset threshold is also a pulse width value, and the function of the second preset threshold is similar to that of the first preset threshold.
When the temperature control output is smaller than a second preset threshold value, the power of the heater is adjusted according to the second preset threshold value, and the phenomenon that the power of the heater is reduced to a lower limit of a duty ratio to cause data overflow is effectively prevented.
After the power of the heater is adjusted, the latest preset constant temperature and the latest detection voltage are obtained again, the latest temperature error is calculated,
when the temperature error is greater than zero, the step S103 is switched back to calculate the error accumulation sum, so that the temperature control output calculated according to the error accumulation sum can be increased to be higher than a second preset threshold value, and the power of the heater is increased at a higher duty ratio, thereby increasing the over-low water temperature in time.
And when the temperature error is less than or equal to zero, skipping the calculation of calculating the error accumulated sum, directly returning to S104, calculating the next temperature control output according to the original error accumulated sum and the newly calculated temperature error, and performing subsequent control on the power of the heater according to the next temperature control output, so that the situation that the calculated temperature control output is farther away from a second preset threshold value and the power of the heater cannot be effectively improved due to the fact that the value of the error accumulated sum is smaller and smaller is avoided.
Further, the first preset threshold is greater than the second preset threshold, as shown in fig. 2, the thermostatic control method further includes:
s201, acquiring preset constant temperature precision;
the preset constant temperature precision is not the only unchangeable value, and different preset constant temperature precisions can be set according to different precision requirements and used as debugging critical conditions of the first preset threshold and the second preset threshold.
S202, acquiring an initial value of a first preset threshold and an initial value of a second preset threshold.
Preferably, the initial value of the first preset threshold is a pulse width corresponding to a 100% duty cycle, and the initial value of the second preset threshold is a pulse width corresponding to a 0% duty cycle, so that the debugging range is the maximum.
And S203, carrying out constant temperature adjustment according to the steps S101 to S107, and detecting the maximum temperature deviation.
When the temperature is adjusted to a constant temperature, the temperature curve may be detected by a temperature sensor, and after the temperature is kept constant, the temperature deviation may be further measured. For example, if the constant temperature is set to 40 ℃, the deviation of the detected temperature from 40 ℃ is observed after the constant temperature state is entered, and the maximum temperature deviation is ± 0.5 ℃ if the detected temperature is 39.5 ℃ to 40.5 ℃.
S204, judging whether the maximum temperature deviation is greater than the preset constant temperature precision or not,
s205, if yes, the first preset threshold is decreased according to the preset proportion, the second preset threshold is increased according to the preset proportion, and the step S203 is returned,
the maximum temperature deviation is larger than the preset constant temperature precision, which shows that the first preset threshold value needs to be adjusted down, so that the adjusting process of reducing power is started earlier, and the positive deviation value is reduced. Meanwhile, the second preset threshold value needs to be increased, so that the adjusting process of increasing the power is started earlier, and the negative deviation value is improved.
S206, judging no, and finishing debugging.
And when the maximum temperature deviation is less than or equal to the preset constant temperature precision, the constant temperature precision meets the requirement, and the debugging is finished at the moment.
Further, as shown in fig. 3, the step of calculating the temperature error according to the preset constant temperature and the detected voltage includes:
s301, acquiring a reference temperature voltage set by a user, and calculating a real-time detection temperature T:
T=(Ui-Uc)×K
wherein K is the temperature coefficient of the thermistor, UiFor reference to temperature voltage, UcTo detect voltage, T is the real-time detected temperature.
A positive thermistor temperature coefficient K indicates that the voltage increases with increasing temperature, whereas a negative thermistor temperature coefficient K indicates that the voltage decreases with increasing temperature.
S302, calculating a temperature error er:
er=Ts-T
where er is the temperature error, TsT is the real-time detection temperature.
The temperature error is a negative value and indicates that the preset constant temperature is lower than the real-time detection temperature, and the temperature error is a positive value and indicates that the preset constant temperature is higher than the real-time detection temperature.
Further, the formula for calculating the error accumulated sum according to the temperature error is:
ersum=ersum-pre+er
wherein, ersumFor error cumulative sum, ersum-preThe error accumulated sum is calculated last time, and er is the temperature error.
It should be noted that, when the error accumulation sum is calculated for the first time, the error accumulation sum er calculated for the last time issum-preIs 0, the first error accumulation sum is the first calculated temperature error. And adding the temperature error accumulated sum calculated last time and the temperature error calculated this time to obtain the temperature error accumulated sum calculated this time from the second time of calculation.
Further, the formula for calculating the temperature control output according to the temperature error and the error accumulation sum is as follows:
O=p·er+i·ersum+d·(er-erpre)
wherein O is the temperature control output, p is the proportionality coefficient, i is the integral coefficient, d is the differential coefficient, er is the temperature error, erpreIs the temperature error calculated last time.
It should be noted that, when the error accumulation sum is calculated for the first time, the error accumulation sum er calculated for the last time ispreThe value of (d) is 0, and the first temperature control output is (p + i + d) · er. And starting from the second calculation, calculating the temperature control output according to the temperature error calculated last time, the temperature error calculated this time and the error accumulation sum calculated this time.
In conclusion, the temperature control output is calculated through temperature error and error accumulation, and the temperature of the heater is adjusted in a duty ratio mode, so that the continuous and stable adjustment of the heater is realized, and the damage of the heater caused by frequent switching on and off of the heater is effectively prevented.
Accordingly, as shown in fig. 4, the present invention also discloses a thermostatic control system 100, comprising:
the acquisition module 1 is used for acquiring preset constant temperature set by a user and detection voltage detected by the temperature sensor.
And the temperature difference calculation module 2 is used for calculating a temperature error according to a preset constant temperature and the detection voltage.
The temperature error is an index for measuring the difference between the real-time detection temperature and the preset constant temperature, and is a basic parameter for adjusting the power of the heater.
And the error sum calculating module 3 is used for calculating the error accumulated sum according to the temperature error.
It should be noted that, the heater is controlled to be turned off when the current hysteresis control reaches the upper limit, and the heater is controlled to be turned on and heated when the current hysteresis control reaches the lower limit, and the on-off control cannot achieve a good constant temperature effect when the upper limit and the lower limit are large, and the heater is frequently turned on and off when the upper limit and the lower limit are small, so that the service life of the heater is damaged for a long time. The error sum calculation module 3 can continuously adjust the power through the error accumulation sum, thereby solving the technical problem. The error accumulation sum is an index for measuring all errors, and cannot change along with the change of one error, so that frequent change is prevented. For example, when the error sum is 3 ℃, when the newly calculated temperature error is-0.5 ℃, the error sum calculating module 3 will add the two, the new error sum is 2.5 ℃, which will not turn off the heater at once but reduce the power of the heater, if the calculated error is still negative, the error sum will be reduced all the time, and the power of the heater will be reduced until the power is reduced to zero and finally the heating is stopped, so that the adjustment will make the adjustment more stable and protect the heater.
And the temperature control computing module 4 is used for accumulating and computing temperature control output according to the temperature error and the error.
The temperature control output is calculated by temperature error and error accumulation, and the proportion of the temperature error can prevent the error accumulation and adjustment from being too slow.
And the temperature control output judging module 5 is used for judging whether the temperature control output is greater than a first preset threshold value.
And the cooling control module 6 is used for adjusting the power of the heater according to a first preset threshold value when the judgment result is yes, acquiring preset constant temperature and detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is smaller than zero or not, calling the error and calculation module if the judgment result is yes, and calling the temperature control calculation module if the judgment result is no.
It should be noted that both the temperature control output and the first preset threshold are pulse width values, the pulse width refers to the time for turning on the circuit in the preset period, and the ratio of the pulse width to the preset period can be used for adjusting the heater power, thereby realizing the continuous adjustment of the heater power. This ratio is the duty cycle.
When the temperature control output is greater than a first preset threshold, the cooling control module 6 adjusts the heater power according to the first preset threshold, and effectively prevents the data overflow caused by the fact that the heater power proportion is too high and even exceeds the upper limit of the duty ratio.
After the heater power is adjusted, the cooling control module 6 needs to obtain the latest preset constant temperature and the latest detection voltage again, and calculate the latest temperature error.
When the temperature error is less than zero, the cooling control module 6 returns to S103 to calculate the error accumulation sum, so that the temperature control output calculated according to the error accumulation sum can be reduced below the first preset threshold, and the power of the heater is reduced at a lower duty ratio, thereby reducing the excessively high water temperature in time.
When the temperature error is greater than or equal to zero, the cooling control module 6 skips the calculation of the error accumulation sum, directly returns to S104, calculates the next temperature control output according to the original error accumulation sum and the newly calculated temperature error, and performs subsequent control on the power of the heater according to the next temperature control output, thereby preventing the power of the heater from being effectively reduced because the calculated temperature control output is farther from the first preset threshold value due to the fact that the value of the error accumulation sum is larger and larger.
And the heating control module 7 is used for judging whether the temperature control output is smaller than a second preset threshold value or not when judging not, judging whether the temperature control output is smaller than the second preset threshold value or not, adjusting the heater power according to the temperature control output and calling the acquisition module, judging whether the temperature control output is larger than the second preset threshold value or not, adjusting the heater power according to the second preset threshold value, acquiring preset constant temperature and detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is larger than zero or not, calling the error and calculation module if the temperature error is larger than zero, and calling the temperature control.
It should be noted that the second preset threshold is also a pulse width value, and the function of the second preset threshold is similar to that of the first preset threshold.
When the temperature control output is smaller than a second preset threshold, the heating control module 7 adjusts the heater power according to the second preset threshold, and data overflow caused by the fact that the heater power is reduced to a lower limit of a duty ratio is effectively prevented.
After the power of the heater is adjusted, the heating control module 7 needs to obtain the latest preset constant temperature and the latest detection voltage again, calculate the latest temperature error,
when the temperature error is greater than zero, the heating control module 7 returns to S103 to calculate the error accumulation sum, so that the temperature control output calculated according to the error accumulation sum can be increased to above the second preset threshold, and the power of the heater is increased with a higher duty ratio, thereby increasing the excessively low water temperature in time.
When the temperature error is less than or equal to zero, the heating control module 7 skips the calculation of the error accumulation sum, directly returns to S104, calculates the next temperature control output according to the original error accumulation sum and the newly calculated temperature error, and performs subsequent control on the power of the heater according to the next temperature control output, thereby preventing the power of the heater from being effectively increased due to the fact that the calculated temperature control output is farther from a second preset threshold value as the value of the error accumulation sum is smaller.
Further, the first preset threshold is greater than the second preset threshold, the thermostatic control system further includes a threshold setting module 8, the threshold setting module 8 is configured to debug and set the first preset threshold and the second preset threshold, as shown in fig. 5, the thermostatic control system includes:
and the constant temperature precision obtaining module 81 is used for obtaining preset constant temperature precision.
The preset constant temperature precision is not the only unchangeable value, and different preset constant temperature precisions can be set according to different precision requirements and used as debugging critical conditions of the first preset threshold and the second preset threshold.
The initial value obtaining module 82 is configured to obtain an initial value of a first preset threshold and an initial value of a second preset threshold.
Preferably, the initial value of the first preset threshold is a pulse width corresponding to a 100% duty cycle, and the initial value of the second preset threshold is a pulse width corresponding to a 0% duty cycle, so that the debugging range is the maximum.
And a maximum temperature difference measurement module 83, configured to invoke the obtaining module, the temperature difference calculation module, the error and calculation module, the temperature control output determination module, the cooling control module, and the heating control module to perform constant temperature adjustment, and detect a maximum temperature deviation.
The maximum temperature difference measuring module 83 may detect a temperature curve through a temperature sensor when the temperature is adjusted at a constant temperature, and the maximum temperature difference measuring module 83 further measures a temperature deviation after the temperature is kept at the constant temperature. For example, if the constant temperature is set to 40 ℃, the deviation of the detected temperature from 40 ℃ is observed after the constant temperature state is entered, and the maximum temperature deviation is ± 0.5 ℃ if the detected temperature is 39.5 ℃ to 40.5 ℃.
And a temperature difference precision judging module 84, configured to judge whether the maximum temperature deviation is greater than a preset constant temperature precision.
And the threshold adjusting module 85 is used for decreasing the first preset threshold according to the preset proportion, increasing the second preset threshold according to the preset proportion and calling the maximum temperature difference measuring module if the judgment is yes.
The maximum temperature deviation is larger than the preset constant temperature precision, which shows that the first preset threshold value needs to be adjusted down, so that the adjusting process of reducing power is started earlier, and the positive deviation value is reduced. Meanwhile, the second preset threshold value needs to be increased, so that the adjusting process of increasing the power is started earlier, and the negative deviation value is improved.
And a debugging ending module 86, configured to judge that the debugging is ended if the debugging is not ended.
When the maximum temperature deviation is less than or equal to the preset constant temperature precision, which indicates that the constant temperature precision meets the requirement, the debugging ending module 86 ends the debugging at this time.
Further, as shown in fig. 6, the temperature difference calculation module 2 includes:
a detection temperature calculation unit 21, configured to obtain a reference temperature voltage set by a user, and calculate a real-time detection temperature T:
T=(Ui-Uc)×K
wherein K is the temperature coefficient of the thermistor, UiFor reference to temperature voltage, UcTo detect voltage, T is the real-time detected temperature.
A positive thermistor temperature coefficient K indicates that the voltage increases with increasing temperature, whereas a negative thermistor temperature coefficient K indicates that the voltage decreases with increasing temperature.
A temperature error calculation unit 22 for calculating a temperature error er according to the following formula:
er=Ts-T
where er is the temperature error, TsT is the real-time detection temperature.
The temperature error is a negative value and indicates that the preset constant temperature is lower than the real-time detection temperature, and the temperature error is a positive value and indicates that the preset constant temperature is higher than the real-time detection temperature.
Further, the error sum calculating module 3 calculates the error accumulated sum according to the temperature error by the following formula:
ersum=ersum-pre+er
wherein, ersumFor error addition and,ersum-prethe error accumulated sum is calculated last time, and er is the temperature error.
It should be noted that, when the error sum calculating module 3 calculates the error sum for the first time, the error sum er calculated last timesum-preIs 0, the first error accumulation sum is the first calculated temperature error. From the second calculation, the error sum calculation module 3 adds the temperature error accumulated sum calculated last time and the temperature error calculated this time to obtain the temperature error accumulated sum calculated this time.
Further, the formula for the temperature control calculation module 4 to calculate the temperature control output according to the temperature error and the error accumulation sum is as follows:
O=p·er+i·ersum+d·(er-erpre)
wherein O is the temperature control output, p is the proportionality coefficient, i is the integral coefficient, d is the differential coefficient, er is the temperature error, erpreIs the temperature error calculated last time.
It should be noted that, when the temperature control calculation module 4 calculates the error accumulation sum for the first time, the error accumulation sum er calculated last timepreThe value of (d) is 0, and the first temperature control output is (p + i + d) · er. From the second calculation, the temperature control calculation module 4 calculates the temperature control output according to the temperature error calculated last time, the temperature error calculated this time and the error accumulation sum calculated this time.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A method of thermostatic control, comprising:
s101, acquiring a preset constant temperature set by a user and a detection voltage detected by a temperature sensor;
s102, calculating a temperature error according to the preset constant temperature and the detection voltage;
s103, calculating an error accumulation sum according to the temperature error;
s104, calculating temperature control output according to the temperature error and the error accumulation sum;
s105, judging whether the temperature control output is larger than a first preset threshold value,
s106, when the judgment is yes, adjusting the heater power according to the first preset threshold value, obtaining the preset constant temperature and the detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is less than zero, if so, returning to S103, if not, returning to S104,
s107, when the judgment result is no, judging whether the temperature control output is smaller than a second preset threshold value, judging whether the judgment result is no, adjusting the heater power according to the temperature control output and returning to S101, judging whether the judgment result is yes, adjusting the heater power according to the second preset threshold value, obtaining the preset constant temperature and the detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is larger than zero, returning to S103 when the judgment result is yes, and returning to S104 when the judgment result is no.
2. The thermostatic control method of claim 1, wherein the first predetermined threshold is greater than the second predetermined threshold, the thermostatic control method further comprising setting the first predetermined threshold and the second predetermined threshold in a debugging manner, the steps comprising:
s201, acquiring preset constant temperature precision;
s202, acquiring an initial value of the first preset threshold and an initial value of the second preset threshold;
s203, carrying out constant temperature adjustment according to the steps from S101 to S107, and detecting the maximum temperature deviation;
s204, judging whether the maximum temperature deviation is greater than the preset constant temperature precision or not,
s205, if yes, the first preset threshold is decreased according to the preset proportion, the second preset threshold is increased according to the preset proportion, and the step S203 is returned,
s206, judging no, and finishing debugging.
3. The thermostat control method of claim 1, wherein the step of calculating the temperature error based on the preset thermostat temperature and the detected voltage comprises:
acquiring a reference temperature voltage set by a user, and calculating a real-time detection temperature T:
T=(Ui-Uc)×K
wherein K is the temperature coefficient of the thermistor, UiFor said reference temperature voltage, UcThe detection voltage is T, and the real-time detection temperature is T;
calculating the temperature error er:
er=Ts-T
where er is the temperature error, TsAnd T is the real-time detection temperature.
4. The thermostatic control method of claim 1, wherein the formula for calculating the error sum from the temperature error is:
ersum=ersum-pre+er
wherein, ersumFor said error accumulated sum, ersum-preAnd the er is the temperature error for the accumulated sum of the errors calculated last time.
5. The thermostatic control method of claim 1, wherein the formula for calculating the temperature control output based on the temperature error and the accumulated sum of errors is:
O=p·er+i·ersum+d·(er-erpre)
wherein O is the temperature control output, p is a proportionality coefficient, i is an integral coefficient, d is a differential coefficient, er is the temperature errorpreThe temperature error calculated last time.
6. A thermostatic control system, comprising:
the acquisition module is used for acquiring preset constant temperature set by a user and detection voltage detected by the temperature sensor;
the temperature difference calculation module is used for calculating a temperature error according to the preset constant temperature and the detection voltage;
the error sum calculating module is used for calculating an error accumulated sum according to the temperature error;
the temperature control calculation module is used for calculating temperature control output according to the temperature error and the error accumulation sum;
the temperature control output judging module is used for judging whether the temperature control output is larger than a first preset threshold value or not;
the cooling control module is used for adjusting the power of the heater according to the first preset threshold value when the judgment result is yes, obtaining the preset constant temperature and the detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is smaller than zero or not, calling the error and calculation module if the judgment result is yes, calling the temperature control calculation module if the judgment result is no;
the heating control module is used for judging whether the temperature control output is smaller than a second preset threshold value or not when the temperature control output is judged to be not smaller than the second preset threshold value, judging whether the temperature control output is smaller than the second preset threshold value or not, adjusting the heater power according to the temperature control output and calling the acquisition module, judging whether the temperature control output is larger than the second preset threshold value or not, acquiring the preset constant temperature and the detection voltage, calculating a temperature error according to the preset constant temperature and the detection voltage, judging whether the temperature error is larger than zero or not, calling the error and calculation module if the temperature error is larger than zero, and calling the temperature control calculation module if the temperature error is not.
7. The thermostat control system of claim 6, wherein the first preset threshold is greater than the second preset threshold, the thermostat control system further comprising a threshold setting module, the threshold setting module being configured to perform a debugging setting on the first preset threshold and the second preset threshold, the threshold setting module comprising:
the constant temperature precision acquisition module is used for acquiring preset constant temperature precision;
an initial value obtaining module, configured to obtain an initial value of the first preset threshold and an initial value of the second preset threshold;
the maximum temperature difference measuring module is used for calling the acquisition module, the temperature difference calculation module, the error and calculation module, the temperature control output judgment module, the cooling control module and the heating control module to perform constant temperature regulation and detect the maximum temperature deviation;
the temperature difference precision judging module is used for judging whether the maximum temperature deviation is greater than the preset constant temperature precision or not;
the threshold value adjusting module is used for reducing a first preset threshold value according to a preset proportion, increasing a second preset threshold value according to the preset proportion and calling the maximum temperature difference measuring module if the judgment is yes;
and the debugging ending module is used for judging whether the debugging is ended or not.
8. The thermostat control system of claim 6, wherein the temperature difference calculation module comprises:
and the detection temperature calculation unit is used for acquiring the reference temperature voltage set by the user and calculating the real-time detection temperature T:
T=(Ui-Uc)×K
wherein K is the temperature coefficient of the thermistor, UiFor said reference temperature voltage, UcThe detection voltage is T, and the real-time detection temperature is T;
a temperature error calculation unit for calculating the temperature error er according to the following formula:
er=Ts-T
where er is the temperature error, TsAnd T is the real-time detection temperature.
9. The thermostat control system of claim 6, wherein the error sum calculation module calculates the error cumulative sum based on the temperature error by:
ersum=ersum-pre+er
wherein, ersumFor said error accumulated sum, ersum-preAnd the er is the temperature error for the accumulated sum of the errors calculated last time.
10. The thermostatic control system of claim 6, wherein the temperature control calculation module calculates the temperature control output based on the temperature error and the error summation by:
O=p·er+i·ersum+d·(er-erpre)
wherein O is the temperature control output, p is a proportionality coefficient, i is an integral coefficient, d is a differential coefficient, er is the temperature errorpreThe temperature error calculated last time.
CN201911050885.5A 2019-10-31 2019-10-31 Constant temperature control method and system Active CN110940095B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911050885.5A CN110940095B (en) 2019-10-31 2019-10-31 Constant temperature control method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911050885.5A CN110940095B (en) 2019-10-31 2019-10-31 Constant temperature control method and system

Publications (2)

Publication Number Publication Date
CN110940095A true CN110940095A (en) 2020-03-31
CN110940095B CN110940095B (en) 2021-08-10

Family

ID=69906174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911050885.5A Active CN110940095B (en) 2019-10-31 2019-10-31 Constant temperature control method and system

Country Status (1)

Country Link
CN (1) CN110940095B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60186645A (en) * 1984-03-06 1985-09-24 Rumie Itou Detecting device of proper temperature of bathtub water
CN1224823A (en) * 1997-11-07 1999-08-04 兰迪斯及斯特法有限公司 Room temperature control apparatus having feedforward and feedback control and method
CN1269004A (en) * 1997-01-23 2000-10-04 爱尔哥国际股份有限公司 Water heating apparatus
JP2007071444A (en) * 2005-09-06 2007-03-22 Toshiba Electric Appliance Co Ltd Water heater
CN103727677A (en) * 2014-01-02 2014-04-16 福州斯狄渢电热水器有限公司 Instant heating type water heater constant temperature control system and method
CN204246022U (en) * 2014-09-23 2015-04-08 张英栋 The quiet bath instrument of a kind of dynamic thermostatic
CN108181948A (en) * 2018-03-20 2018-06-19 中国工程物理研究院化工材料研究所 A kind of accurate follow-up control method of temperature and control system
KR20180073925A (en) * 2016-12-23 2018-07-03 롯데알미늄 주식회사 Bathtub apparatus with warming structure
CN109419345A (en) * 2017-08-25 2019-03-05 广东美的生活电器制造有限公司 Liquid-heating method and device, liquid heater, storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60186645A (en) * 1984-03-06 1985-09-24 Rumie Itou Detecting device of proper temperature of bathtub water
CN1269004A (en) * 1997-01-23 2000-10-04 爱尔哥国际股份有限公司 Water heating apparatus
CN1224823A (en) * 1997-11-07 1999-08-04 兰迪斯及斯特法有限公司 Room temperature control apparatus having feedforward and feedback control and method
JP2007071444A (en) * 2005-09-06 2007-03-22 Toshiba Electric Appliance Co Ltd Water heater
CN103727677A (en) * 2014-01-02 2014-04-16 福州斯狄渢电热水器有限公司 Instant heating type water heater constant temperature control system and method
CN204246022U (en) * 2014-09-23 2015-04-08 张英栋 The quiet bath instrument of a kind of dynamic thermostatic
KR20180073925A (en) * 2016-12-23 2018-07-03 롯데알미늄 주식회사 Bathtub apparatus with warming structure
CN109419345A (en) * 2017-08-25 2019-03-05 广东美的生活电器制造有限公司 Liquid-heating method and device, liquid heater, storage medium
CN108181948A (en) * 2018-03-20 2018-06-19 中国工程物理研究院化工材料研究所 A kind of accurate follow-up control method of temperature and control system

Also Published As

Publication number Publication date
CN110940095B (en) 2021-08-10

Similar Documents

Publication Publication Date Title
CN107120843B (en) Control method and control device of water heater, water heater and computer equipment
CN111335999B (en) Control method and device of electric heating thermostat and electronic control unit
JP2009247184A (en) Photovoltaic power system and method of starting the same
CN109631151B (en) Automatic control method, device and system for household heating valve
GB2450762A (en) Determining a voltage stability margin for load shedding within an electrical power system
CN106322737B (en) Gas water heater and control method thereof
CN108851992B (en) Heat preservation method of electric kettle
CN105159359B (en) Broad domain oxygen sensor heating means and its control circuit
CN110940095B (en) Constant temperature control method and system
CN112178944A (en) Extremely-speed constant-temperature regulation and control method of quick water heater
JPS5877630A (en) Temperature measuring device
JP2009284685A (en) Charging device
CN116336532A (en) Method and device for heating by heating equipment and heating equipment
CN109668326A (en) A kind of instant heating type dynamic temperature control method based on pid algorithm
JP4440898B2 (en) State determination device and state determination method
CN112460807B (en) Control method of heating device, heating device and intelligent closestool
CN105915087B (en) Method for the trip event for controlling converter
JP3947967B2 (en) Electric water heater
CN110017613B (en) Method for forecasting remaining bath time of water storage type water heater
CN114481078B (en) Heating control method and device for PVD cavity of transparent conductive film and storage medium
CN113446658A (en) Heating system control method, heating system, gas device and storage medium
JP3628871B2 (en) Water heater
CN113867440A (en) Heating temperature control method based on pid algorithm
JP2011058744A (en) Water heater
CN117287816A (en) Equipment control method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 528100 Building 1, No. 1, Kangyu Third Road, Nanshan Town, Sanshui District, Foshan City, Guangdong Province (application for residence)

Applicant after: Wrigley Furniture Group Co.,Ltd.

Address before: 528100 No. 3, South District, Jiangdu Industrial Park, Nanshan Town, Sanshui District, Foshan, Guangdong

Applicant before: GUANGDONG LEHUA HOME FURNISHING Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200331

Assignee: Foshan Lehua Hengye Kitchen and Bathroom Co.,Ltd.

Assignor: Wrigley Furniture Group Co.,Ltd.

Contract record no.: X2024980002619

Denomination of invention: A constant temperature control method and system

Granted publication date: 20210810

License type: Common License

Record date: 20240307

EE01 Entry into force of recordation of patent licensing contract