Energy-saving shower hot water circulation temperature control system and control method
By combining mains power and lithium battery dual-engine power supply with MPID algorithm, the flow gain is dynamically adjusted, and the electric regulating valve is linked with the circulation pump. This solves the problems of insufficient power and unstable temperature control in shower systems under low temperature or high flow conditions in winter, and realizes the efficient operation of energy-saving shower hot water circulation temperature control system.
Patent Information
- Application Number
- CN202511308667.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-12-19
AI Technical Summary
Existing shower systems suffer from insufficient power and unstable water temperature regulation in low-temperature or high-flow-rate winter scenarios. Traditional temperature control algorithms are poorly adaptable, leading to waste of water resources and energy, and lacking an effective hot water recycling mechanism.
It adopts a dual-power supply of mains power and lithium battery, combined with MPID algorithm and dynamic flow gain adjustment, and achieves precise and rapid water temperature control and stabilization through linkage between electric regulating valve and circulation pump. The circulation module recovers residual water in the pipeline, saving energy and water.
In winter, when the water temperature is low or the water flow is high, it can achieve precise water temperature control, reduce energy waste, improve temperature control accuracy, improve the bathing experience, quickly stabilize the water temperature, and realize the recycling of hot water.
Smart Images

Figure CN121165831A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of shower technology, in particular to an energy-saving shower hot water circulation temperature control system and control method. BACKGROUND
[0002] Shower is a daily bathing method that sprays hot water on the human body surface through a shower head to achieve cleaning and relaxation. Hot water is usually provided by a water heater, delivered to the shower head through a pipeline, and adjusted to a suitable temperature by combining cold water before use. It is an indispensable sanitary habit and lifestyle in modern family life.
[0003] The existing shower system has two significant technical problems in use: first, when the instant heater relies solely on mains power, it often cannot heat the water to the set value in winter or under high-flow water conditions due to insufficient power. The adaptability of traditional temperature control algorithms to water flow changes is poor, resulting in large water temperature fluctuations, low steady-state accuracy, and affecting the bathing experience. Second, the shower system lacks an effective hot water recycling mechanism. The residual cold water in the pipeline and the unused hot water are directly discharged, causing waste of water resources and energy. At the same time, the water temperature adjustment response is lagging, making it difficult to quickly and stably reach the set temperature. Therefore, an energy-saving shower hot water circulation temperature control system and control method are proposed. SUMMARY
[0004] (I) Technical problems solved
[0005] To address the shortcomings of the prior art, the present application provides an energy-saving shower hot water circulation temperature control system and control method. The system ensures power supply through mains power and lithium battery dual-engine, realizes accurate water temperature control through MPID algorithm and flow gain dynamic adjustment, recycles residual water in the pipeline through the circulation module to save energy and water, and realizes rapid and stable water temperature through the linkage of the electric regulating valve and the circulation pump. The problems of waste of water resources and energy caused by the lack of effective hot water recycling mechanism in the existing shower system are solved. The water temperature adjustment response is lagging, making it difficult to quickly and stably reach the set temperature.
[0006] (II) Technical solutions
[0007] To achieve the above-mentioned purpose of ensuring power supply through mains power and lithium battery dual-engine, realizing accurate water temperature control through MPID algorithm and flow gain dynamic adjustment, recycling residual water in the pipeline through the circulation module to save energy and water, and realizing rapid and stable water temperature through the linkage of the electric regulating valve and the circulation pump, the present application provides the following technical solutions: an energy-saving shower hot water circulation temperature control system, comprising:
[0008] A hot water supply module: including an instant heater body, a mains power supply unit 220VAC, a lithium battery system DC power supply, and a heating cup. The input end of the heating cup is connected to the output end of the mains power supply unit and the output end of the lithium battery system through a relay switch. The output end of the heating cup is connected to the shower head through a hot water pipeline.
[0009] Cold water supply module: contains cold water pipeline, electric regulating valve and water inlet temperature sensor DS18B20, electric regulating valve is connected in series with cold water pipeline, cold water pipeline output end is connected to shower nozzle after converging with hot water pipeline at water mixing valve, water inlet temperature sensor DS18B20 is installed at cold water pipeline input end;
[0010] Circulation module: contains circulation pump, check valve and circulation pipeline, circulation pipeline one end is connected to water return interface below shower nozzle, the other end is connected to heating cup input end of hot water supply module through check valve, circulation pump is connected with PWM output end of central control module through driving circuit;
[0011] Temperature monitoring module: contains hot water outlet sensor DS18B20, outlet water temperature sensor DS18B20 and return water temperature sensor DS18B20, hot water outlet sensor is installed at heating cup output end, outlet water temperature sensor is installed at water mixing valve output end, return water temperature sensor is installed at circulation pipeline return end, data output ends of three are connected with I / O port of central control module through single bus;
[0012] Flow monitoring module: contains hot water flow sensor, cold water flow sensor and outlet water flow sensor, hot water flow sensor is connected in series with hot water pipeline, cold water flow sensor is connected in series with cold water pipeline, outlet water flow sensor is connected in series with pipeline between water mixing valve and shower nozzle, pulse output ends of three are connected to counter interface of central control module;
[0013] Central control module: STC89C52 single-chip microcomputer is adopted, I / O port thereof is connected with power supply unit relay, lithium battery system relay and step motor driver of electric regulating valve through optical coupling isolation circuit, serial port thereof is connected to PC end through USB to TTL module, AD conversion interface thereof is connected with signal conditioning circuit of each temperature sensor;
[0014] The central control module runs temperature control program based on MPID algorithm, the algorithm calculation formula is as follows:
[0015]
[0016] Wherein, K is sampling time and is positive integer, u(k) is system output duty ratio at K time, K s is system gain coefficient and measured value is 47, K L is flow gain coefficient and is taken from water flow and gain relationship data, K p is proportional coefficient and value is 1.2, K i is integral coefficient and value is 1.2, K dD(k) is the differential coefficient and the value is 0, e(k) is the difference value between the set water temperature and the actual outlet water temperature at K moment, DutyCtl(k) is the control duty ratio at K moment, SetWaterTemp(k) is the set water temperature at K moment, and OutWaterTemp(k) is the actual outlet water temperature at K moment.
[0017] Preferably, the water flow and gain relationship data is stored in the ROM of the central control module, and specifically:
[0018] The flow rate 2L / min corresponds to the gain 0.18, the flow rate 3L / min corresponds to the gain 0.23, the flow rate 3.5L / min corresponds to the gain 0.29, the flow rate 4L / min corresponds to the gain 0.31, the flow rate 4.5L / min corresponds to the gain 0.34, the flow rate 5L / min corresponds to the gain 0.39, the flow rate 5.5L / min corresponds to the gain 0.55, the flow rate 6L / min corresponds to the gain 0.9, the flow rate 7L / min corresponds to the gain 1.07, the flow rate 7.5L / min corresponds to the gain 1.12, the flow rate 8L / min corresponds to the gain 1.17, the flow rate 9L / min corresponds to the gain 1.22, and the flow rate 10L / min corresponds to the gain 1.27.
[0019] When the flow sensor detects a value not included in the above, the central control module calculates the corresponding K L value through linear interpolation.
[0020] Preferably, the PWM driving module is arranged in the connection circuit of the central control module and the heating cup, the module includes the optocoupler isolation chip TLP521, the MOS tube IRF540, and the freewheeling diode 1N4007, the PWM output end of the central control module is connected to the gate of the MOS tube after being isolated by the optocoupler, the drain of the MOS tube is connected to the power supply end of the heating cup, the source is grounded, and the freewheeling diode is connected in parallel to the two ends of the heating cup.
[0021] Preferably, the control circuit of the electric regulating valve includes the stepping motor 28BYJ-48 and the driving chip ULN2003, the I / O ports P1.0-P1.3 of the central control module are connected to the input end of the driving chip, the output end of the driving chip is connected to the coil of the stepping motor, and the stepping motor is mechanically connected to the valve core of the regulating valve through a screw rod transmission mechanism, and the displacement calculation formula is:
[0022]
[0023] wherein is the step pitch angle of the stepping motor and the value is 5.625° / 64, S is the pitch of the screw rod and the value is 2mm, Δ is the target displacement of the valve core and the unit is mm, and i is the required pulse number.
[0024] Preferably, the method for building the MPID algorithm model includes:
[0025] Step 1: Establish a closed-loop control model in MATLAB / Simulink. The input module includes PWMDutyMax (duty cycle upper limit), PWMDutyMin (0), SetWaterTemp (set temperature), OutWaterTemp (actual temperature), and FlowValue (water flow rate). The output module is DutyCtl (control duty cycle).
[0026] Step 2: Embed the Lookup Table module in the model and import the water flow rate and gain relationship data into the module;
[0027] Step 3: Generate C code from the model using Real-Time Workshop, compile it using Keil C51 compiler, and then burn it into the Flash memory of the STC89C52 microcontroller.
[0028] Preferably, the parameter training method for the MPID algorithm includes:
[0029] Step 1: Set the inlet water temperature to 15℃, water flow rate to 7L / min, and set the temperature to 44℃. Conduct a steady-state performance experiment and record the K values at different temperatures. p K i Steady-state error under combination;
[0030] Step 2: When the water flow rate jumps from 7L / min to 6.5L / min, record the time it takes for the system to recover to the set temperature within ±1.5℃, and filter the parameter combinations that make the recovery time ≤30s;
[0031] Step 3: Substitute the parameters selected in Step 2 into the rapidity experiment. When the set temperature jumps from 44℃ to 40℃, select the parameter that reaches stability within 55 seconds as the final value, i.e., K. p =1.2, K i =1.2, K d =0.
[0032] Preferably, the operation method of the central control module includes:
[0033] Step 1: After the system is powered on, initialize all sensors and I / O ports, and the digital tube display module displays the ready code "00";
[0034] Step 2: Connect to P3.0-P3.3 via independent buttons to read the user-set temperature T. set If T set Exceeding the inlet water temperature T in When the hot water reaches its highest temperature range, the buzzer connects to the P3.7 alarm and displays error code "E1";
[0035] Step 3: Collect water flow rate Q in real time. When Q > 2 L / min, calculate the required total power according to the formula:
[0036]
[0037] Where C = 4.2 kJ / (kg·℃) is the specific heat capacity of water, Q is in L / min, and T is in T. set T in The unit is ℃;
[0038] Step 4: If P>7kW, the central control module controls the relay to close the lithium battery power supply circuit and start the dual-engine mode, that is, the mains power + lithium battery power supply.
[0039] Preferably, the deployment method of the temperature sensor includes:
[0040] The hot water outlet sensor is fixed to the outer wall of the heating cup output pipe by a stainless steel clamp, and its temperature probe is in contact with the inner wall of the pipe.
[0041] The outlet water temperature sensor is embedded in the copper temperature measuring base of the mixing valve outlet, and the gap is filled with thermally conductive silicone grease.
[0042] All sensor signal cables are threaded through metal corrugated pipes, with a distance of ≥5cm from high-voltage power lines.
[0043] An energy-saving shower hot water circulation temperature control method, including an energy-saving shower hot water circulation temperature control system, also includes the following steps:
[0044] Step 1: After the system starts up, the temperature monitoring module collects the inlet water temperature T in real time. in Hot water outlet temperature T hot Outlet water temperature T out and return water temperature T back The flow monitoring module collects the hot water flow rate Q in real time. out Cold water flow rate Q cold and water flow rate Q out All data is transmitted to the central control module every 0.5 seconds;
[0045] Step 2: The central control module will collect the T data. out With user-set temperature T set Substituting into the MPID algorithm formula, calculate the current control duty cycle DutyCtl(k), and simultaneously determine K based on the water flow and gain relationship data. L value;
[0046] Step 3: Adjust the heating cup power according to the calculated DutyCtl(k). When the required power P≤7kW, only control the mains power supply unit relay to close; when P>7kW, simultaneously close the lithium battery system relay to supplement power through dual-engine mode.
[0047] Step 4: The electric regulating valve is adjusted according to T. out With T set The deviation ΔT = T out ―T set Dynamic adjustment: When ΔT > 2℃, the central control module sends forward rotation pulses to the stepper motor to increase the cold water flow; when ΔT < -2℃, it sends reverse rotation pulses to decrease the cold water flow. The number of pulses is determined according to the formula. calculate;
[0048] Step 5: The loop module based on T back With T set Relationship linkage: When T back <T set At 5℃, the central control module outputs a PWM signal to control the circulating pump to run at 1500 r / min; when T back ≥T se At t-2℃, reduce the pump speed to 500 r / min;
[0049] Step 6: Repeat steps 1-5 every 1 second, continuously and dynamically adjusting to ensure T out Stable at T set Within ±1℃ range.
[0050] Preferably, the shutdown control method for the loop module includes:
[0051] When the water flow rate Q out =0 and lasts for 5 seconds, then the shower is considered over, and the central control module records the current T. back and the remaining water volume in the circulation pipes;
[0052] Calculate the required continuous operating time t of the circulating pump according to the formula:
[0053]
[0054] Where V pipe =1.5L is the volume of the circulation pipe, ρ = 1kg / L is the density of water, Q pump =3L / min is the flow rate of the circulating pump;
[0055] After running for time t, if T back ≥T set If the temperature is -3℃, turn off the circulation pump and heating cup; if T back <T set -3℃, run for 30 seconds and then shut down.
[0056] (III) Beneficial Effects
[0057] Compared with the prior art, the present invention provides an energy-saving shower hot water circulation temperature control system and control method, which has the following beneficial effects:
[0058] 1. This energy-saving shower hot water circulation temperature control system and control method, when the water temperature is low or the flow rate is high in winter, the mains power supply unit of the hot water supply module and the lithium battery system achieve dual-engine power supply through the relay switch of the central control module to make up for the insufficient power of a single power supply; the central control module runs a temperature control program based on the MPID algorithm, and dynamically adjusts the flow gain coefficient in combination with the water flow data of the flow monitoring module, and adjusts the heating cup power through the PWM drive module, which solves the water temperature fluctuation caused by the poor adaptability of traditional algorithms, improves the temperature control accuracy, and improves the bathing experience.
[0059] 2. This energy-saving shower hot water circulation temperature control system and control method: The circulation module's circulation pump pumps the residual water in the pipe below the shower head back to the heating cup input end through the circulation pipe. The one-way valve prevents backflow, realizing hot water recycling and reducing waste. The central control module controls the stepper motor of the electric regulating valve to adjust the valve core displacement based on the deviation between the outlet water temperature of the temperature monitoring module and the set temperature. Combined with the circulation pump speed adjustment, it accelerates the water temperature stabilization speed and solves the response lag problem. Attached Figure Description
[0060] Fig. 1 This is a schematic diagram of the energy-saving shower hot water circulation temperature control structure of the present invention;
[0061] Fig. 2 This is a schematic diagram of the energy-saving shower hot water circulation method of the present invention. Detailed Implementation
[0062] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments and accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0063] Please see Figs. 1-2 An energy-saving shower hot water circulation temperature control system includes:
[0064] Hot water supply module: includes an instant water heater body, a 220VAC mains power supply unit, a DC power supply for a lithium battery system, and a heating cup. The input end of the heating cup is connected to the output end of the mains power supply unit and the output end of the lithium battery system through a relay switch. The output end of the heating cup is connected to the shower head through a hot water pipe.
[0065] Cold water supply module: includes cold water pipes, electric regulating valve and inlet water temperature sensor DS18B20. The electric regulating valve is connected in series with the cold water pipe. The cold water pipe output end and the hot water pipe merge at the mixing valve and are connected to the shower head. The inlet water temperature sensor DS18B20 is installed at the cold water pipe input end.
[0066] Circulation module: includes circulation pump, check valve and circulation pipe. One end of circulation pipe is connected to the return water interface under the shower head, and the other end is connected to the heating cup input end of the hot water supply module through the check valve. Circulation pump is connected to the PWM output end of the central control module through the drive circuit.
[0067] Temperature monitoring module: includes hot water outlet sensor DS18B20, outlet water temperature sensor DS18B20 and return water temperature sensor DS18B20. The hot water outlet sensor is installed at the output end of the heating cup, the outlet water temperature sensor is installed at the output end of the mixing valve, and the return water temperature sensor is installed at the return water end of the circulation pipe. The data output ends of the three are connected to the I / O port of the central control module through a single bus.
[0068] Flow monitoring module: includes hot water flow sensor, cold water flow sensor and outlet flow sensor. The hot water flow sensor is connected in series with the hot water pipe, the cold water flow sensor is connected in series with the cold water pipe, and the outlet flow sensor is connected in series with the pipe between the mixing valve and the shower head. The pulse output terminals of the three are all connected to the counter interface of the central control module.
[0069] Central control module: It adopts STC89C52 microcontroller. Its I / O ports are connected to the mains power supply unit relay, lithium battery system relay and electric regulating valve stepper motor driver through optocoupler isolation circuit. Its serial port is connected to the PC through USB to TTL module. Its AD conversion interface is connected to the signal conditioning circuit of each temperature sensor.
[0070] The central control module runs a temperature control program based on the MPID algorithm, and the algorithm's calculation formula is as follows:
[0071]
[0072] Where K is the sampling time and is a positive integer, u(k) is the system output duty cycle at time K, and K s The system gain coefficient is 47, and the measured value is K. L K is the flow gain coefficient, taken from the data on the relationship between water flow and gain. p K is a proportionality constant with a value of 1.2. i K is the integral coefficient with a value of 1.2. dThe differential coefficient is 0, e(k) is the difference between the set water temperature and the actual outlet water temperature at time K, DutyCtl(k) is the control duty cycle at time K, SetWaterTemp(k) is the set water temperature at time K, and OutWaterTemp(k) is the actual outlet water temperature at time K.
[0073] An energy-saving shower hot water circulation temperature control method, including an energy-saving shower hot water circulation temperature control system, also includes the following steps:
[0074] Step 1: After the system starts up, the temperature monitoring module collects the inlet water temperature T in real time. in Hot water outlet temperature T hot Outlet water temperature T out and return water temperature T back The flow monitoring module collects the hot water flow rate Q in real time. out Cold water flow rate Q cold and water flow rate Q out All data is transmitted to the central control module every 0.5 seconds;
[0075] Step 2: The central control module will collect the T data. out With user-set temperature T set Substituting into the MPID algorithm formula, calculate the current control duty cycle DutyCtl(k), and simultaneously determine K based on the water flow and gain relationship data. L value;
[0076] Step 3: Adjust the heating cup power according to the calculated DutyCtl(k). When the required power P≤7kW, only control the mains power supply unit relay to close; when P>7kW, simultaneously close the lithium battery system relay to supplement power through dual-engine mode.
[0077] Step 4: The electric regulating valve is adjusted according to T. out With T set The deviation ΔT = T out ―T set Dynamic adjustment: When ΔT > 2℃, the central control module sends forward rotation pulses to the stepper motor to increase the cold water flow; when ΔT < -2℃, it sends reverse rotation pulses to decrease the cold water flow. The number of pulses is determined according to the formula. calculate;
[0078] Step 5: The loop module based on T back With T set Relationship linkage: When T back <T set At 5℃, the central control module outputs a PWM signal to control the circulating pump to run at 1500 r / min; when T back ≥T set At -2℃, reduce the pump speed to 500 r / min;
[0079] Step 6: Repeat steps 1-5 every 1 second, continuously and dynamically adjusting to ensure T out Stable at T set Within ±1℃ range.
[0080] Example 1:
[0081] This embodiment details the selection, installation, and connection methods of the hardware components for an energy-saving shower hot water circulation temperature control system, in order to realize the system architecture.
[0082] In the hot water supply module, the instant water heater body uses an instant heating unit with power matching. The heating cup is made of 304 stainless steel and has a rated power of 19kW (7kW mains power plus 12kW lithium battery). The mains power supply unit is connected to a 220VAC household circuit and is protected by a 16A air switch. The output terminal is connected to the heating cup input terminal via a relay model JQC-3FF-1C-12V. The lithium battery system uses a lithium iron phosphate battery pack with a nominal voltage of 48V and a capacity of 50Ah. It is equipped with a BMS battery management system. The output terminal is connected in parallel with the heating cup input terminal via a relay of the same model. The relay control terminal is connected to the I / O ports P2.0 and P2.1 of the central control module through an optocoupler isolation circuit TLP521.
[0083] The heating cup output end is connected to the mixing valve through a DN15 hot water pipe made of PPR material, and the outer wall of the pipe is wrapped with 20mm thick insulation cotton.
[0084] In the cold water supply module, the cold water pipes are made of PPR pipes of the same specification. The electric regulating valve is a DN15 copper ball valve driven by a 28BYJ-48 stepper motor, which is connected in series in the cold water pipe 1m away from the mixing valve. The inlet water temperature sensor DS18B20 is fixed to the outer wall of the cold water pipe input end by a stainless steel clamp. The temperature probe is coated with thermal grease and then contacts the inner wall of the pipe. The signal cable is passed through a metal corrugated pipe and laid along the pipe to the central control module.
[0085] In the circulation module, the circulation pump is a miniature hot water circulation pump model RS15-6 with a rated flow rate of 3L / min and a head of 6m. It is installed at the return water interface 0.5m below the shower head. The circulation pipe is a DN10 copper pipe, with one end connected to the return water interface and the other end connected to the heating cup input end via a one-way valve model H12W-16T. The flow direction of the one-way valve is from the return water pipe to the heating cup. In the circulation pump drive circuit, the MOSFET IRF540 is connected in series with the pump motor, and its gate is optocoupled to the PWM output terminal P3.5 of the central control module via a TLP521. The freewheeling diode 1N4007 is connected in parallel across the pump motor.
[0086] In the temperature monitoring module, the hot water outlet sensor DS18B20 is installed 50cm from the heating cup on the pipe at the output end of the heating cup. The temperature probe is embedded in the pre-set temperature measuring hole with a diameter of 5mm on the inner wall of the pipe, and the gap is filled with thermally conductive silicone grease. The outlet water temperature sensor is installed in the copper temperature measuring base at the output end of the mixing valve, flush with the outlet. The return water temperature sensor is installed 10cm from the one-way valve at the return end of the circulation pipe. The signal terminals of the three sensors are all connected to the I / O port P1.4 of the central control module through a single bus DQ line, and the bus is connected in series with a 4.7kΩ pull-up resistor to the 5V power supply.
[0087] In the flow monitoring module, the hot water flow sensor model YF-S201 is connected in series on the hot water pipe 0.8m from the heating cup, the cold water flow sensor of the same model is connected in series on the cold water pipe 0.5m from the electric regulating valve, and the outlet flow sensor is installed on the pipe between the mixing valve and the shower head 0.3m from the mixing valve; the pulse output terminals of all three are connected to the counter interface P3.2, P3.3, and P3.4 of the central control module, the power supply terminal is connected to a 5V power supply, and the ground terminal is the same as the system ground.
[0088] The central control module uses an STC89C52 microcontroller in a DIP40 package, with an external 11.0592MHz crystal oscillator and a 10μF electrolytic capacitor reset circuit. The digital tube display module uses a 3-digit common anode LED digital tube, connected to the microcontroller's P0 port via a 74HC573 latch, for displaying temperature and status codes. Four independent buttons are connected to P3.0-P3.3 respectively, corresponding to the functions of switching between cold and hot water temperature display, switching between set and current temperature, temperature increment, and temperature decrement. The buzzer model SFM-27 is connected to P3.7 via a PNP transistor 8550, triggering an alarm when a low level is detected.
[0089] The microcontroller's serial port is connected to the PC via a USB-to-TTL module CH340 for program burning and data debugging.
[0090] Example 2:
[0091] This embodiment details the specific steps for building the MPID algorithm model and training its parameters, and demonstrates the algorithm deployment using MATLAB / Simulink.
[0092] When building the MPID algorithm model, first start MATLAB 2022a, create a new Simulink model, and add the PIDController module located in the Control System Toolbox as the core control unit.
[0093] The input modules include PWMDutyMax set to 100% via the Constant module, PWMDutyMin set to 0, SetWaterTemp simulates the user-set temperature via the Step module, OutWaterTemp receives actual temperature feedback from the Scope module, and FlowValue simulates water flow via the Signal Generator module; the output module is DutyCtl, which controls the duty cycle and is connected to the Display module for display.
[0094] The Lookup Table module, located in Simulink / LookupTables, is embedded in the model. Double-click the module to import the water flow rate and gain relationship data.
[0095] The flow rates are 0.18 for 2L / min, 0.23 for 3L / min, 0.29 for 3.5L / min, 0.31 for 4L / min, 0.34 for 4.5L / min, 0.39 for 5L / min, 0.55 for 5.5L / min, 0.9 for 6L / min, 1.07 for 7L / min, 1.12 for 7.5L / min, 1.17 for 8L / min, 1.22 for 9L / min, and 1.27 for 10L / min; the interpolation method is set to Linear, and the extrapolation method is set to Clip.
[0096] Output terminal K of the Lookup Table module L The proportional coefficient input of the PID controller is connected in series, and then the system gain coefficient K is connected in series. s The value is set to 47, which is achieved through the Gain module.
[0097] After the model is built, generate C code using Real-Time Workshop:
[0098] In the model configuration parameters, select TIC2000 as the Target selection and TI CodeComposer Studio as the Toolchain, then click Build to generate the code;
[0099] Import the generated code into Keil C51 compiler version V9.60, select the STC89C52 chip model, configure the compilation options Xtal to 11.0592MHz and Memory Model to Small, compile to generate a .hex file, and burn it to the microcontroller's Flash memory using STC-ISP download software. When burning, select a baud rate of 9600 and a minimum baud rate of 1200.
[0100] During parameter training, the first step is to conduct steady-state performance experiments:
[0101] Connect the system hardware, set the inlet water temperature to 15℃ and control it through a constant temperature water tank, set the water flow rate to 7L / min through flow meter calibration, and set the temperature to 44℃.
[0102] Write a test program into the microcontroller and adjust K sequentially. p 0.8-1.5 and K i For combinations of 0.8-1.5, record the deviation between the actual temperature and the set temperature over 300 consecutive seconds for each set of parameters, and filter parameter combinations with an error ≤ ±1℃, such as K. p =1.2, K i When the value is 1.2, the error is ±0.8℃.
[0103] The second step is to conduct an anti-interference experiment:
[0104] Maintain the inlet water temperature at 15℃ and the set temperature at 53℃. First, allow the system to run stably at a flow rate of 7L / min for 300s. Then, increase the flow rate to 6.5L / min. Record the time it takes for the system to recover to the set temperature within ±1.5℃ under different parameter combinations. Select parameters with a recovery time ≤30s. The recovery time for the above combination is 28s.
[0105] The third step involves conducting rapidity experiments:
[0106] The initial temperature was set to 44℃. After stable operation, the set temperature was changed to 40℃. The time it took for the parameter combination to reach a stable ±1℃ was recorded. Parameters that were stable within 55 seconds were selected, and K was finally determined. p =1.2, K i =1.2, K d =0 because PI control is commonly used in water heater systems, so the derivative coefficient is set to 0.
[0107] Example 3:
[0108] This embodiment details the operation of the central control module, including specific operations for system initialization, parameter setting, power control, and dual-engine mode switching.
[0109] After the system is powered on and connected to 220VAC, with the lithium battery switch turned ON, the central control module automatically executes the initialization program:
[0110] First, initialize each I / O port: P0 port for digital tube output, P1 port for sensor input, P2 port for relay control, P3 port for key and alarm, and set the counter interface to fall-edge triggered interrupt.
[0111] The DS18B20 temperature sensor is initialized by sending a reset signal via a single bus for 480μs low and 15-60μs high, and then waiting for the sensor to respond. The flow sensor is initialized by enabling external interrupt counting.
[0112] The digital tube display module shows the ready code 00, and the buzzer sounds a short beep for 100ms to indicate that the system is ready.
[0113] Users can set the temperature via a separate button:
[0114] Press the set / current temperature switch key P3.1, the digital display will show SET, then use the temperature increase and decrease keys P3.2 and P3.3 to adjust the set temperature T. set Range 30-55℃, step 1℃, press the switch key to confirm;
[0115] The central control module reads the inlet water temperature T in real time. in The maximum output temperature of the heating cup, measured by the inlet water sensor and the highest hot water temperature, is 60℃. If T... set >60℃ or T set <T in The buzzer sounds continuously at 200ms intervals, and the digital tube displays error code E1 until the user resets it.
[0116] After the system starts, the flow monitoring module collects the outflow rate Q (in L / min) every 0.5 seconds. When Q > 2 L / min, the central control module calculates the required total power according to the formula:
[0117]
[0118] For example, when Q = 7 L / min, T set =44℃, T in At 15℃, P = (4.2 × 7 × 29 × 1000) / 60 ≈ 18.13 kW.
[0119] If P≤7kW, the central control module controls P2.0 to output a high level, driving the mains relay to close, while the lithium battery relay remains open. P2.1 outputs a low level, and is powered only by mains power.
[0120] If P > 7kW, P2.0 and P2.1 simultaneously output a high level, the two relays close, and the mains power and lithium battery are used for power supply. At this time, the actual power of the heating cup is adjusted by the MPID algorithm.
[0121] T set Compared with the actual outlet water temperature T out Substituting the deviation e(k) into the formula:
[0122]
[0123] Calculate the control duty cycle DutyCtl(k), and adjust the heating cup power through a PWM signal frequency of 1kHz to make T out Stable at T setWithin ±1℃ range.
[0124] Example 4:
[0125] This embodiment details the specific control logic for the operation of the cyclic module, the adjustment of the electric regulating valve, and the shutdown of the system.
[0126] When the circulation module is running, the return water temperature sensor collects the return water temperature T_back every 0.5 seconds, and the central control module compares it with T_set:
[0127] When T back <T set -5℃ as T set =44℃, T back <39℃, output a 1kHz PWM signal with a 50% duty cycle to the circulating pump drive circuit to control the pump speed at 1500r / min, accelerating the recirculation and heating of cold water in the pipe; when T back ≥T set If the temperature is -2℃ or ≥42℃, output a PWM signal with a duty cycle of 17%, reduce the pump speed to 500r / min, and maintain the pipe insulation.
[0128] Electric regulating valve according to T out With T set Deviation ΔT adjustment: When ΔT > 2℃T out If the temperature is too high, the central control module sends a forward rotation pulse to the stepper motor driver chip ULN2003, which outputs timing signals through P1.0-P1.3. The stepper motor then drives the valve core to open via the lead screw transmission mechanism, increasing the cold water flow. (Pulse count...) in S = 2mm, Δ is the distance the valve core needs to move. If the cold water flow needs to be increased so that ΔT = 0, the calculated Δ = 0.5mm, then i = (5.625 / 64 × 2) / (360 × 0.5) ≈ 0.0003, taking 1 pulse; when ΔT < -2℃T out If the temperature is too low, a reverse pulse is sent to reduce the cold water flow.
[0129] When the system is shut down, if the outlet flow sensor detects Q... out =0 and lasts for 5 seconds, then the shower is considered over, and the central control module records the current T. back and the remaining water volume V in the circulation pipe pipe =1.5L.
[0130] According to the formula:
[0131]
[0132] Calculate the required running time of the circulating pump, where ρ = 1 kg / L, Q pump=3L / min, so t = (1.5 × 1) / 3 = 0.5 min = 30 s.
[0133] After running for 30 seconds, if T back ≥T set If the temperature is -3℃ or ≥41℃, shut off the circulation pump and heating cup, and disconnect the relay; if T back If the temperature is below 41℃, extend the operation for 30 seconds and then shut it off to ensure that the residual water temperature in the pipeline meets the standard and reduce the discharge of cold water during the next use.
[0134] During the entire system operation, the central control module repeats the above acquisition, calculation, and adjustment steps every 1 second, and displays the current outlet water temperature in real time with a digital tube accurate to 0.1℃, until the user turns off the power or a fault occurs such as a sensor disconnection, in which case an E2 alarm is displayed.
[0135] In summary, this energy-saving shower hot water circulation temperature control system and method, when the water temperature is low or the flow rate is high in winter, achieves dual-engine power supply from the mains power supply unit of the hot water supply module and the lithium battery system through the relay switch of the central control module, compensating for the insufficient power of a single power supply; the central control module runs a temperature control program based on the MPID algorithm, dynamically adjusts the flow gain coefficient in combination with the water flow data of the flow monitoring module, and adjusts the heating cup power through the PWM drive module, solving the water temperature fluctuation caused by the poor adaptability of traditional algorithms, improving temperature control accuracy, and enhancing the bathing experience.
[0136] Furthermore, this energy-saving shower hot water circulation temperature control system and method utilizes a circulation module where the circulation pump returns residual water from the pipe below the shower head to the heating cup input end via the circulation pipe. A one-way valve prevents backflow, achieving hot water recycling and reducing waste. The central control module, based on the deviation between the outlet water temperature from the temperature monitoring module and the set temperature, controls the stepper motor of the electric regulating valve to adjust the valve core displacement. Combined with the circulation pump speed adjustment, this accelerates water temperature stabilization, resolving the response lag problem. This addresses the issue of water and energy waste caused by the lack of an effective hot water recycling mechanism in existing shower systems, as well as the problem of delayed water temperature regulation response and difficulty in quickly stabilizing at the set temperature.
[0137] The relevant modules involved in this system are all hardware system modules or functional modules that combine computer software programs or protocols with hardware in the prior art. The computer software programs or protocols involved in these functional modules are technologies known to those skilled in the art and are not improvements to this system. The improvement of this system lies in the interaction or connection between the modules, that is, in improving the overall structure of the system to solve the corresponding technical problems that this system aims to address.
[0138] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An energy-saving shower hot water circulation temperature control system, characterized in that, include: Hot water supply module: includes an instant water heater body, a 220VAC mains power supply unit, a DC power supply for a lithium battery system, and a heating cup. The input end of the heating cup is connected to the output end of the mains power supply unit and the output end of the lithium battery system through a relay switch. The output end of the heating cup is connected to the shower head through a hot water pipe. Cold water supply module: includes cold water pipes, electric regulating valve and inlet water temperature sensor DS18B20. The electric regulating valve is connected in series with the cold water pipe. The cold water pipe output end and the hot water pipe merge at the mixing valve and are connected to the shower head. The inlet water temperature sensor DS18B20 is installed at the cold water pipe input end. Circulation module: includes circulation pump, check valve and circulation pipe. One end of circulation pipe is connected to the return water interface under the shower head, and the other end is connected to the heating cup input end of the hot water supply module through the check valve. Circulation pump is connected to the PWM output end of the central control module through the drive circuit. Temperature monitoring module: includes hot water outlet sensor DS18B20, outlet water temperature sensor DS18B20 and return water temperature sensor DS18B20. The hot water outlet sensor is installed at the output end of the heating cup, the outlet water temperature sensor is installed at the output end of the mixing valve, and the return water temperature sensor is installed at the return water end of the circulation pipe. The data output ends of the three are connected to the I / O port of the central control module through a single bus. Flow monitoring module: includes hot water flow sensor, cold water flow sensor and outlet flow sensor. The hot water flow sensor is connected in series with the hot water pipe, the cold water flow sensor is connected in series with the cold water pipe, and the outlet flow sensor is connected in series with the pipe between the mixing valve and the shower head. The pulse output terminals of the three are all connected to the counter interface of the central control module. Central control module: It adopts STC89C52 microcontroller. Its I / O ports are connected to the mains power supply unit relay, lithium battery system relay and electric regulating valve stepper motor driver through optocoupler isolation circuit. Its serial port is connected to the PC through USB to TTL module. Its AD conversion interface is connected to the signal conditioning circuit of each temperature sensor. The central control module runs a temperature control program based on the MPID algorithm, and the algorithm's calculation formula is as follows: Where K is the sampling time and is a positive integer, u(k) is the system output duty cycle at time K, and K s The system gain coefficient is 47, and the measured value is K. L K is the flow gain coefficient, taken from the data on the relationship between water flow and gain. p K is a proportionality constant with a value of 1.
2. i K is the integral coefficient with a value of 1.
2. d The differential coefficient is 0, e(k) is the difference between the set water temperature and the actual outlet water temperature at time K, DutyCtl(k) is the control duty cycle at time K, SetWaterTemp(k) is the set water temperature at time K, and OutWaaterTemp(k) is the actual outlet water temperature at time K.
2. The energy-saving shower hot water circulation temperature control system according to claim 1, characterized in that, The data relating water flow rate and gain is stored in the ROM of the central control module, specifically: The gain is 0.18 for a flow rate of 2 L / min, 0.23 for 3 L / min, 0.29 for 3.5 L / min, 0.31 for 4 L / min, 0.34 for 4.5 L / min, 0.39 for 5 L / min, 0.55 for 5.5 L / min, 0.9 for 6 L / min, 1.07 for 7 L / min, 1.12 for 7.5 L / min, 1.17 for 8 L / min, 1.22 for 9 L / min, and 1.27 for 10 L / min. When the flow sensor detects a value not included above, the central control module calculates the corresponding K using linear interpolation. L value.
3. The energy-saving shower hot water circulation temperature control system according to claim 1, characterized in that, The connection circuit between the central control module and the heating cup is equipped with a PWM drive module. This module includes an optocoupler isolation chip TLP521, a MOSFET IRF540, and a freewheeling diode 1N4007. The PWM output terminal of the central control module is connected to the gate of the MOSFET after optocoupler isolation. The drain of the MOSFET is connected to the power supply terminal of the heating cup, and the source is grounded. The freewheeling diode is connected in parallel across the heating cup.
4. The energy-saving shower hot water circulation temperature control system according to claim 1, characterized in that, The control circuit of the electric regulating valve includes a stepper motor 28BYJ-48 and a driver chip ULN2003. The I / O ports P1.0-P1.3 of the central control module are connected to the input terminals of the driver chip, and the output terminals of the driver chip are connected to the stepper motor coil. The stepper motor is mechanically connected to the regulating valve core via a lead screw transmission mechanism. Its displacement calculation formula is as follows: in S is the step angle of the stepper motor, with a value of 5.625° / 64; S is the lead screw pitch, with a value of 2mm; Δ is the target displacement of the valve core, with the unit being mm; and i is the required number of pulses.
5. The energy-saving shower hot water circulation temperature control system according to claim 2, characterized in that, The method for constructing the MPID algorithm model includes: Step 1: Establish a closed-loop control model in MATLAB / Simulink. The input module includes PWMDutyMax (duty cycle upper limit), PWMDutyMin (0), SetWaterTemp (set temperature), OutWaterTemp (actual temperature), and FlowValue (water flow rate). The output module is DutyCtl (control duty cycle). Step 2: Embed the Lookup Table module in the model and import the water flow rate and gain relationship data into the module; Step 3: Generate C code from the model using Real-Time Workshop, compile it using Keil C51 compiler, and then burn it into the Flash memory of the STC89C52 microcontroller.
6. The energy-saving shower hot water circulation temperature control system according to claim 1, characterized in that, The parameter training method for the MPID algorithm includes: Step 1: Set the inlet water temperature to 15℃, water flow rate to 7L / min, and set the temperature to 44℃. Conduct a steady-state performance experiment and record the K values at different temperatures. p K i Steady-state error under combination; Step 2: When the water flow rate jumps from 7L / min to 6.5L / min, record the time it takes for the system to recover to the set temperature within ±1.5℃, and filter the parameter combinations that make the recovery time ≤30s; Step 3: Substitute the parameters selected in Step 2 into the rapidity experiment. When the set temperature jumps from 44℃ to 40℃, select the parameter that reaches stability within 55 seconds as the final value, i.e., K. p =1.2, K i =1.2, K d =0.
7. The energy-saving shower hot water circulation temperature control system according to claim 1, characterized in that, The operation method of the central control module includes: Step 1: After the system is powered on, initialize all sensors and I / O ports, and the digital tube display module displays the ready code "00"; Step 2: Connect to P3.0-P3.3 via independent buttons to read the user-set temperature T. set If T set Exceeding the inlet water temperature T in When the hot water reaches its highest temperature range, the buzzer connects to the P3.7 alarm and displays error code "E1"; Step 3: Collect water flow rate Q in real time. When Q > 2 L / min, calculate the required total power according to the formula: Where C = 4.2 kJ / (kg·℃) is the specific heat capacity of water, Q is in L / min, and T is in T. set T in The unit is ℃; Step 4: If P>7kW, the central control module controls the relay to close the lithium battery power supply circuit and start the dual-engine mode, that is, the mains power + lithium battery power supply.
8. The energy-saving shower hot water circulation temperature control system according to claim 1, characterized in that, The deployment method of the temperature sensor includes: The hot water outlet sensor is fixed to the outer wall of the heating cup output pipe by a stainless steel clamp, and its temperature probe is in contact with the inner wall of the pipe. The outlet water temperature sensor is embedded in the copper temperature measuring base of the mixing valve outlet, and the gap is filled with thermally conductive silicone grease. All sensor signal cables are threaded through metal corrugated pipes, with a distance of ≥5cm from high-voltage power lines.
9. An energy-saving shower hot water circulation temperature control method, characterized in that, The energy-saving shower hot water circulation temperature control system according to claims 1-8 further includes the following steps: Step 1: After the system starts up, the temperature monitoring module collects the inlet water temperature T in real time. in Hot water outlet temperature T hot Outlet water temperature T out and return water temperature T back The flow monitoring module collects the hot water flow rate Q in real time. out Cold water flow rate Q cold and water flow rate Q out All data is transmitted to the central control module every 0.5 seconds; Step 2: The central control module will collect the T data. out With user-set temperature T set Substituting into the MPID algorithm formula, calculate the current control duty cycle DutyCtl(k), and simultaneously determine K based on the water flow and gain relationship data. L value; Step 3: Adjust the heating cup power according to the calculated DutyCtl(k). When the required power P≤7kW, only control the mains power supply unit relay to close; when P>7kW, simultaneously close the lithium battery system relay to supplement power through dual-engine mode. Step 4: The electric regulating valve is adjusted according to T. out With T set The deviation ΔT = T out ―T set Dynamic adjustment: When ΔT > 2℃, the central control module sends forward rotation pulses to the stepper motor to increase the cold water flow; when ΔT < -2℃, it sends reverse rotation pulses to decrease the cold water flow. The number of pulses is determined according to the formula. calculate; Step 5: The loop module based on T back With T set Relationship linkage: When T back <T set At 5℃, the central control module outputs a PWM signal to control the circulating pump to run at 1500 r / min; when T back ≥T set At -2℃, reduce the pump speed to 500 r / min; Step 6: Repeat steps 1-5 every 1 second, continuously and dynamically adjusting to ensure T out Stable at T set Within ±1℃ range.
10. The energy-saving shower hot water circulation temperature control method according to claim 1, characterized in that, The shutdown control method for the loop module includes: When the water flow rate Q out =0 and lasts for 5 seconds, then the shower is considered over, and the central control module records the current T. back and the remaining water volume in the circulation pipes; Calculate the required continuous operating time t of the circulating pump according to the formula: Where V pipe =1.5L is the volume of the circulation pipe, ρ = 1kg / L is the density of water, Q pump =3L / min is the flow rate of the circulating pump; After running for time t, if T back ≥T set If the temperature is -3℃, turn off the circulation pump and heating cup; if T back <T set -3℃, run for 30 seconds and then shut down.