Water outlet control method of intelligent faucet and faucet body
By constructing a phase plane of temperature deviation and a recursive graph of flow signal, the nonlinear hysteresis effect of the mixing valve is identified, enabling precise control of the water temperature of the smart faucet. This solves the control deviation problem caused by the mechanical structure of the mixing valve and improves the stability and accuracy of constant temperature control.
Patent Information
- Application Number
- CN202511364791.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-09-23
AI Technical Summary
In the thermostatic control of smart faucets, the nonlinear hysteresis effect of the valve core caused by the mechanical structure characteristics of the mixing valve leads to problems with the accuracy and stability of water temperature control.
By acquiring the opening command of the mixing valve and the outlet water temperature of the temperature sensor in real time, a temperature deviation phase plane is constructed, the residence time is calculated and it is determined whether the threshold is exceeded, a recursive graph is generated by combining the flow signal sequence, the divergence value and deterministic percentage are calculated, the displacement-flow response dead zone is identified, and compensation adjustment is performed.
It significantly improves the accuracy and anti-interference ability of temperature control, quickly eliminates steady-state errors, and achieves stable maintenance of outlet water temperature.
Smart Images

Figure CN120848645A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fluid temperature control and valve regulation technology, and in particular to a water outlet control method and faucet body for an intelligent faucet. Background Technology
[0002] Smart faucets typically use an electronic control unit to drive a mixing valve to adjust the ratio of hot and cold water to achieve constant water temperature. Existing technologies generally employ a closed-loop control strategy, which calculates and outputs a signal to the actuator of the mixing valve based on the deviation between the set temperature and the actual temperature fed back by the sensor, thereby regulating the water temperature. This feedback-based control method can maintain a basically stable water temperature under ideal conditions.
[0003] However, due to the inherent mechanical characteristics of the mixing valve, such as friction and gaps between components, the valve core exhibits a nonlinear hysteresis effect when moving in both directions. This results in different actual water flow ratios when the valve core reaches the same target opening command from different directions. In other words, the valve core displacement and the actual flow output have a non-single corresponding functional relationship. This inherent mechanical characteristic makes it difficult to accurately execute precise control commands, causing deviations in the system response. Consequently, the outlet water temperature fluctuates around the set value, affecting the accuracy and stability of the constant temperature control effect. Summary of the Invention
[0004] This invention addresses the technical problems existing in the prior art by providing a water outlet control method and a faucet body for an intelligent faucet.
[0005] The technical solution of the present invention to solve the above technical problems is as follows: This invention provides the following technical solution: A method for controlling the water flow of a smart faucet, comprising: S1. Real-time acquisition of the current opening command of the mixing valve and the actual outlet water temperature detected by the temperature sensor; S2. Calculate the real-time temperature deviation value and the real-time temperature deviation change rate based on the actual outlet water temperature and the set temperature, construct the temperature deviation phase plane, calculate the residence time of the phase trajectory in the preset annular area, and determine whether it exceeds the residence threshold. S3. When the dwell time exceeds the dwell threshold, record the trend of the current opening command to determine the movement direction of the valve core. S4. Collect the flow signal sequence output by the flow sensor, convert the flow signal sequence into a symbol sequence and calculate the probability distribution of the symbol sequence. At the same time, generate a recursion graph based on the flow signal sequence and calculate the deterministic percentage of the recursion graph. S5. Calculate the divergence value between the probability distribution of the symbol sequence and the pre-stored baseline probability distribution; when the divergence value exceeds the first threshold and the certainty percentage is lower than the second threshold, determine that the current operation point is in the displacement-flow response dead zone. S6. Adjust the current opening command according to the movement direction of the valve core and the range of the displacement-flow response dead zone.
[0006] Furthermore, the current opening command of the mixing valve and the actual outlet water temperature detected by the temperature sensor are acquired in real time, including: The current opening command value sent to the mixing valve actuator is read in real time through the output terminal of the electronic control unit; At the same time, the actual water temperature measurement value is collected in real time through the signal output terminal of the temperature sensor.
[0007] Furthermore, based on the actual outlet water temperature and the set temperature, the real-time temperature deviation value and the real-time temperature deviation change rate are calculated, a temperature deviation phase plane is constructed, the residence time of the phase trajectory within the preset annular zone is calculated, and it is determined whether the residence threshold is exceeded, including: The real-time temperature deviation value is obtained by subtracting the actual outlet water temperature from the set temperature. The rate of change of real-time temperature deviation is obtained by performing a differential operation on the real-time temperature deviation value. A temperature deviation phase plane is constructed with the real-time temperature deviation value as the x-axis and the real-time temperature deviation change rate as the y-axis. A ring-shaped region centered on the origin of the coordinate system is drawn in the temperature deviation phase plane as a preset ring zone region; The motion of the phase trajectory is tracked within a preset annular zone, and the continuous dwell time of the phase trajectory within the preset annular zone is accumulated as the dwell time. The dwell time is compared with a preset dwell threshold to determine whether the dwell time exceeds the dwell threshold.
[0008] Furthermore, when the dwell time exceeds the dwell threshold, the trend of the current opening command is recorded to determine the movement direction of the valve core, including: After determining that the dwell time exceeds the dwell threshold, retrieve the current opening command value within the preset time. Analyze the increase or decrease characteristics of the current opening command value over a preset time period; Based on the increase or decrease characteristics of the current opening command value, determine whether the valve core moves in the direction of increasing the opening or in the direction of decreasing the opening; The determined direction of movement is recorded as the direction of movement of the valve core.
[0009] Furthermore, the flow signal sequence output by the flow sensor is acquired, converted into a symbol sequence, and the probability distribution of the symbol sequence is statistically analyzed. Simultaneously, a recurrence graph is generated based on the flow signal sequence, and the deterministic percentage of the recurrence graph is calculated, including: A flow signal sequence is formed by continuously collecting flow measurement values at multiple time points from a flow sensor; Calculate the difference between adjacent flow measurements in the flow signal sequence, and convert the flow signal sequence into a sign sequence according to the positive or negative sign of the difference; The frequency distribution of different symbol patterns in a statistical symbol sequence is used as a probability distribution. Phase space reconstruction of the traffic signal sequence is performed by selecting time delay and embedding dimension; Calculate the recursive matrix based on the phase space points reconstructed from the phase space; The length distribution of the diagonal structure in the recursion matrix is statistically analyzed, and the ratio of the total length of the diagonal structure to the total number of all recursive points is calculated as the deterministic percentage of the recursion graph.
[0010] Furthermore, the frequency distribution of different symbol patterns in a statistical symbol sequence, as a probability distribution, includes: Set a fixed-length symbol pattern window, and slide the symbol pattern window over the symbol sequence to extract all possible symbol pattern combinations; Count the number of times each symbol pattern appears in the symbol sequence; Calculate the ratio of the occurrence frequency of each symbol pattern to the total length of the symbol sequence to obtain the probability distribution of the symbol sequence.
[0011] Furthermore, calculating the recursive matrix based on the phase space points reconstructed from the phase space includes: Calculate the Euclidean distance between any two points in phase space; Compare the Euclidean distance with a preset distance threshold; If the Euclidean distance is less than the distance threshold, then the corresponding position in the recursion matrix is marked as a recursive point; otherwise, it is marked as a non-recursive point.
[0012] Further, the divergence value between the probability distribution of the symbol sequence and the pre-stored baseline probability distribution is calculated; when the divergence value exceeds a first threshold and the certainty percentage is lower than a second threshold, it is determined that the current operating point is in the displacement-flow response dead zone, including: The probability distribution of the symbol sequence is compared with the baseline probability distribution pre-stored in memory, and the divergence value is obtained by calculating the difference between the two probability distributions. The calculated divergence value is compared with a preset first threshold; at the same time, the deterministic percentage of the recursive graph is compared with a preset second threshold. When the divergence value is greater than the first threshold and the certainty percentage is less than the second threshold, the current operation point is determined to be in the displacement-flow response dead zone.
[0013] Furthermore, the current opening command is compensated and adjusted based on the valve core's movement direction and the range of the displacement-flow response dead zone, including: The direction of compensation adjustment is determined based on the already determined direction of valve core movement; The magnitude of the compensation adjustment is determined based on the range of the displacement-flow response dead zone; The compensation amount is generated according to the determined compensation adjustment direction and compensation adjustment range; The compensation amount is added to the current opening command to obtain the compensated opening command; The compensated opening command is sent to the actuator of the mixing valve.
[0014] On the other hand, the present invention provides a faucet body, comprising: A mixing valve, whose valve core is driven by an actuator to adjust the mixing ratio of hot and cold water; A temperature sensor is installed in the outlet channel of the mixing valve to detect the actual outlet water temperature; A flow sensor is installed in the outlet channel of the mixing valve to detect the outlet flow rate; The electronic control unit is electrically connected to the temperature sensor, flow sensor, and actuator of the mixing valve, respectively. The electronic control unit is configured to execute a water dispensing control method for a smart faucet.
[0015] The beneficial effects of this invention are: 1. By establishing an analysis method based on the phase plane of temperature deviation, the control hysteresis phenomenon caused by the nonlinear characteristics of the valve core can be effectively identified. By calculating the residence time of the phase trajectory in the annular region and combining it with the valve core movement direction, the precursors of control instability caused by mechanical hysteresis can be accurately captured. At the same time, by combining flow signal symbolization processing and recursive graph analysis, the dynamic characteristics of the system are quantitatively characterized from both the time domain and phase space dimensions. This makes the detection of the displacement-flow response dead zone no longer dependent on a precise mathematical model, but based on the statistical characteristics and recursive characteristics of the actual system operation data, which significantly improves the reliability and adaptability of dead zone identification.
[0016] 2. By combining the valve core movement direction with the dead zone range characteristics, a compensation quantity with clear physical meaning is generated, which effectively overcomes the control deviation caused by the inherent mechanical nonlinearity of the mixing valve. It can not only quickly eliminate steady-state error, but also adaptively adjust the compensation strategy according to the actual response characteristics of the system. Thus, while maintaining the stability of the control system, it significantly improves the accuracy of temperature control and anti-interference ability, and ultimately enables the outlet water temperature to be stably maintained near the set value. Attached Figure Description
[0017] Figure 1 This is a flowchart of a water outlet control method for an intelligent faucet according to the present invention; Figure 2 This is a schematic diagram of the structure of a faucet body according to the present invention.
[0018] In the diagram: 1. Mixing valve; 2. Temperature sensor; 3. Flow sensor; 4. Electronic control unit. Detailed Implementation
[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0020] Example 1: Figure 1 The present invention discloses a water outlet control method for an intelligent faucet, comprising: S1. Real-time acquisition of the current opening command of the mixing valve and the actual outlet water temperature detected by the temperature sensor; S2. Calculate the real-time temperature deviation value and the real-time temperature deviation change rate based on the actual outlet water temperature and the set temperature, construct the temperature deviation phase plane, calculate the residence time of the phase trajectory in the preset annular area, and determine whether it exceeds the residence threshold. S3. When the dwell time exceeds the dwell threshold, record the trend of the current opening command to determine the movement direction of the valve core. S4. Collect the flow signal sequence output by the flow sensor, convert the flow signal sequence into a symbol sequence and calculate the probability distribution of the symbol sequence. At the same time, generate a recursion graph based on the flow signal sequence and calculate the deterministic percentage of the recursion graph. S5. Calculate the divergence value between the probability distribution of the symbol sequence and the pre-stored baseline probability distribution; when the divergence value exceeds the first threshold and the certainty percentage is lower than the second threshold, determine that the current operation point is in the displacement-flow response dead zone. S6. Adjust the current opening command according to the movement direction of the valve core and the range of the displacement-flow response dead zone.
[0021] S1. Real-time acquisition of the current opening command of the mixing valve and the actual outlet water temperature detected by the temperature sensor, specifically implemented as follows: In the water dispensing control process of a smart faucet, real-time acquisition of the current opening command of the mixing valve and the actual outlet water temperature detected by the temperature sensor are fundamental steps in the control process. Specifically, the current opening command value sent to the mixing valve actuator is read in real-time through the output terminal of the electronic control unit (ECU). The connection between the ECU output terminal and the mixing valve actuator uses a standard electrical interface, such as an analog voltage signal interface or a digital pulse width modulation (PWM) signal interface. The current opening command value is transmitted in the form of an electrical signal, and the ECU continuously monitors the signal status of this output port through its built-in analog-to-digital converter (ADC) or digital signal receiver. The reading process is performed at fixed sampling intervals, determined according to the real-time requirements of the control system, for example, acquiring the opening command value every 100 milliseconds. The range of the opening command value typically corresponds to the fully closed to fully open state of the mixing valve, and the value is expressed as a percentage value relative to full scale or an absolute position count value; for example, 0% represents the fully closed state, and 100% represents the fully open state.
[0022] Simultaneously, the actual outlet water temperature is acquired in real time through the signal output terminal of the temperature sensor. The temperature sensor is a thermocouple or resistance temperature detector (RTD) type, installed in the outlet channel of the mixing valve to ensure full contact with the water flow. The signal output terminal of the temperature sensor is connected to the analog input channel of the electronic control unit (ECU), outputting an analog voltage or current signal proportional to the temperature value, such as a 4-20 mA current signal or a 0-10 V voltage signal. The ECU converts the analog signal into a digital signal through its built-in analog-to-digital converter (ADC), with a conversion resolution of at least 12 bits to ensure measurement accuracy; for example, a 16-bit ADC can achieve higher measurement accuracy. The acquisition of temperature measurements is synchronized with the reading of opening commands, ensuring that both the opening command and the temperature measurement value are obtained simultaneously in each control cycle. The acquired actual outlet water temperature measurement value is converted into a temperature value expressed in degrees Celsius using the following formula: Temperature value = (Original digital value × Range coefficient) / Resolution + Zero offset value.
[0023] The temperature sensor's calibration data, including zero-point offset and sensitivity coefficient, is stored in the non-volatile memory of the electronic control unit (ECU) and used to compensate for and correct the original measurements. The acquisition of actual outlet water temperature measurements includes signal filtering, employing moving average filtering or finite impulse response (FIR) digital filtering algorithms to eliminate measurement noise caused by instantaneous fluctuations in water flow. The filter window size is determined based on the water flow characteristics, typically choosing a window length of 3 to 7 sampling points to strike a balance between response speed and noise suppression. The temperature sensor's sampling rate is kept consistent with the main cycle of the control system to ensure that the latest temperature measurement data is obtained in each control cycle; for example, when the main cycle is 100 milliseconds, the temperature sampling interval is also set to 100 milliseconds.
[0024] The reading of the current opening command value includes signal validity verification, checking whether the value is within a preset reasonable range. The lower limit of the reasonable range is the command value corresponding to the fully closed position of the mixing valve, and the upper limit is the command value corresponding to the fully open position of the mixing valve. For example, when expressed as a percentage, the reasonable range is 0% to 100%. When the opening command value is detected to be outside the reasonable range, the abnormal state is recorded, and the previous valid opening command value is used for subsequent processing. The acquisition of the actual outlet water temperature measurement value also includes data validity checks. By comparing the rate of change of values at multiple consecutive sampling points, sensor malfunctions or abnormal signal transmission are identified. When an abnormal temperature measurement value is detected, the average value over a recent period is used as a temporary replacement value to ensure the continuous operation of the control system. For example, the moving average of the most recent 10 sampling values is used as the replacement value.
[0025] The electronic control unit (ECU) maintains a first-in, first-out (FIFO) data buffer, storing the opening command values and temperature measurements from the most recent several cycles. The buffer depth is determined according to the needs of the control algorithm, typically storing historical data for 10 to 30 sampling cycles. This historical data is used for trend analysis and status judgment in subsequent steps, providing data support for temperature control decisions. The acquisition timestamps of the opening command values and temperature measurements are accurate to the millisecond level, ensuring the consistency of the time series data. At the beginning of each control cycle, the data acquisition task is completed first, and then the subsequent control algorithm calculations are executed, ensuring that the latest sensor data is used for decision-making. The data acquisition process also includes signal quality assessment, which determines the reliability of the acquired data by calculating the variance and signal-to-noise ratio. When the signal quality falls below a preset threshold, a data re-acquisition mechanism is triggered.
[0026] The electronic control unit (ECU) ensures data transmission integrity through a cyclic redundancy check (CRC) mechanism, adding a checksum to each data packet. When a data transmission error is detected, it automatically requests a retransmission of the most recent data packet. The temperature sensor's periodic self-calibration function compares measurements from multiple sensors; when a sensor's reading differs from other sensors by more than a threshold, the sensor is automatically flagged as needing calibration. The acquisition of the opening command value also includes signal smoothing processing, employing an exponentially weighted moving average algorithm to eliminate minor fluctuations in the control command. The smoothing coefficient is determined based on the system response characteristics, for example, a value between 0.1 and 0.3. All these data processing measures ensure that the acquired current opening command value and the actual outlet water temperature measurement value have high reliability and accuracy, providing a reliable data foundation for subsequent control decisions.
[0027] S2. Calculate the real-time temperature deviation and the rate of change of the real-time temperature deviation based on the actual outlet water temperature and the set temperature, construct the temperature deviation phase plane, calculate the residence time of the phase trajectory within the preset annular zone, and determine whether it exceeds the residence threshold. Specifically, the implementation is as follows: After obtaining the actual outlet water temperature measurement and the set temperature, the temperature deviation analysis step begins. The real-time temperature deviation value is obtained by subtracting the actual outlet water temperature from the set temperature. This calculation is performed within each control cycle. The set temperature is obtained from user input or a preset program, and the actual outlet water temperature measurement is obtained from real-time data collected by the temperature sensor. The unit of the real-time temperature deviation value is Celsius; a positive value indicates that the actual temperature is lower than the set value, and a negative value indicates that the actual temperature is higher than the set value. To eliminate the influence of measurement noise on the deviation calculation, the real-time temperature deviation value is processed by moving average filtering. The size of the filtering window is determined according to the system response speed; for example, a window length of 3 sampling points is selected. The filtered real-time temperature deviation value is used for subsequent calculations.
[0028] The real-time temperature deviation value is differentiated to obtain the real-time temperature deviation rate of change. The differentiation operation is implemented using the backward difference method, which involves subtracting the previous real-time temperature deviation value from the current value and then dividing by the sampling time interval. The sampling time interval is consistent with the main loop period of the control system; for example, when the main loop period is 100 milliseconds, the sampling time interval is 0.1 seconds. The unit of the real-time temperature deviation rate of change is degrees Celsius per second, representing the rate of change of the temperature deviation. To prevent the differentiation operation from amplifying high-frequency noise, the real-time temperature deviation value is low-pass filtered before differentiation. The cutoff frequency of the filter is selected according to the system characteristics, for example, a value between 0.5 Hz and 2 Hz. The filtered real-time temperature deviation rate of change is used for phase plane construction.
[0029] A temperature deviation phase plane is constructed with real-time temperature deviation values on the x-axis and the real-time temperature deviation rate of change on the y-axis. The phase plane is a two-dimensional coordinate system, with each sampling moment corresponding to a point in the phase plane. The real-time temperature deviation values are measured in degrees Celsius, and the real-time temperature deviation rate of change is measured in degrees Celsius per second. To ensure consistent coordinate dimensions, the real-time temperature deviation rate of change is normalized by multiplying it by a time constant, for example, 10 seconds, so that the y-axis also has a temperature dimension. The coordinate range of the phase plane is determined based on the system's maximum possible deviation. For example, the x-axis range is set to -10 degrees Celsius to +10 degrees Celsius, and the y-axis range is set to -5 degrees Celsius to +5 degrees Celsius. The coordinate range should cover all possible operating states.
[0030] A ring-shaped region centered at the origin is drawn within the temperature deviation phase plane as a preset annular zone. This annular zone is defined by two parameters: an inner radius and an outer radius. The inner radius represents the minimum allowable steady-state error range of the system, while the outer radius represents the maximum allowable transient deviation range. The inner radius is determined based on the temperature control accuracy requirements, for example, 0.5 degrees Celsius, while the outer radius is determined based on the system's dynamic characteristics, for example, 2 degrees Celsius. The center of the annular zone is located at the origin, representing the ideal steady-state state, i.e., a state where both the temperature deviation and the rate of change of deviation are zero. The width of the annular zone affects the system's sensitivity to deviations; the smaller the width, the more sensitive the system is to deviations. The boundary of the annular zone is mathematically defined as follows: the square of the inner radius is less than or equal to the square of the horizontal axis plus the square of the vertical axis, which is less than or equal to the square of the outer radius.
[0031] The system tracks the movement of a phase trajectory within a preset annular zone. The phase trajectory is a path formed by connecting temperature state points at consecutive moments in the phase plane. Timing begins when the phase trajectory enters the annular zone, recording the entry time (time stamp). Timing ends when the phase trajectory leaves the annular zone, recording the departure time (time stamp). The cumulative dwell time of the phase trajectory within the preset annular zone is recorded as the residence time, which is equal to the time difference between the departure and entry times. To handle cases where the phase trajectory crosses the boundary of the annular zone, a minimum dwell time threshold is set, for example, 0.5 seconds. The cumulative residence time is only counted when the continuous dwell time exceeds the minimum dwell time threshold, thus avoiding misjudgments caused by measurement noise.
[0032] The dwell time is compared with a preset dwell threshold to determine whether it exceeds the threshold. The dwell threshold is determined based on the system response characteristics and represents the longest acceptable adjustment time within the allowable deviation range. The dwell threshold is typically determined experimentally by observing the system's adjustment process under different operating conditions, statistically analyzing the time required for the system to recover to steady state from a disturbance, and taking the upper limit of the statistical result as the dwell threshold, for example, 30 seconds. When the dwell time exceeds the threshold, it indicates an abnormality in the system adjustment process, requiring the initiation of subsequent fault diagnosis and compensation adjustment procedures. The setting of the dwell threshold also needs to consider the system's operating state. For example, during the warm-up phase, the dwell threshold can be appropriately increased to avoid false alarms, while a smaller dwell threshold is used during steady-state operation to improve detection sensitivity.
[0033] During phase trajectory tracking, a numerical integration method is used to calculate the dwell time. The trapezoidal rule is used to integrate the time, and the integration step size is consistent with the sampling period of the control system. Boundary detection of the annular region uses a point-to-circle positional relationship method, calculating the distance from the phase trajectory point to the origin and determining whether this distance lies between the inner and outer radii. To handle cases where the phase trajectory portion is located within the annular zone, a linear interpolation method is used to accurately calculate the entry and exit points of the annular zone, improving the accuracy of dwell time calculation. All calculations are performed in real-time within the electronic control unit, and the results are stored in an annular buffer for subsequent analysis.
[0034] The dwell time determination process includes an anomaly handling mechanism. When a phase trajectory is detected to remain outside the annular zone for an extended period, the dwell time counter is reinitialized. A maximum dwell time limit is also set to prevent calculation errors caused by sensor malfunctions or system anomalies. The maximum dwell time is twice the dwell threshold, for example, 60 seconds. When the dwell time exceeds the maximum dwell time, a system fault alarm is triggered, indicating the need for maintenance and inspection. These measures ensure the reliability and accuracy of dwell time detection, providing a reliable basis for subsequent control decisions.
[0035] S3. When the dwell time exceeds the dwell threshold, record the trend of the current opening command to determine the direction of valve core movement. Specifically, the implementation is as follows: When the system detects that the dwell time exceeds a preset dwell threshold, it initiates the valve core movement direction determination step. After determining that the dwell time exceeds the threshold, it immediately retrieves the historical data of the current opening command value within a preset time period from the data buffer of the electronic control unit. The length of the preset time is determined based on the system's dynamic response characteristics, typically two to three times the system time constant. For example, if the system time constant is 10 seconds, the preset time can be 20 to 30 seconds. The retrieved data includes a timestamp and the corresponding current opening command value. The timestamp is accurate to the millisecond level to ensure the accuracy of the time series. During data retrieval, an integrity check is performed to verify the uniformity of the time intervals between data points. Missing data points are filled in using a linear interpolation method, calculated based on the numerical change trend of adjacent data points.
[0036] This study analyzes the increase and decrease characteristics of the current opening command value over a preset time period and uses the least squares method to fit the trend line of the opening command value over time. First, the first-order difference of the current opening command value sequence is calculated to obtain the change between adjacent sampling points. Then, the frequency and magnitude of positive and negative changes are statistically analyzed. Simultaneously, the slope of the current opening command value is calculated; a positive slope indicates an overall increasing trend, while a negative slope indicates an overall decreasing trend. To eliminate noise, the current opening command value sequence is smoothed using a moving average filter. The window size is selected based on the sampling frequency; for example, when the sampling period is 100 milliseconds, the window size can be 5 to 10 sampling points, corresponding to a time window of 0.5 seconds to 1 second.
[0037] Based on the increasing or decreasing characteristics of the current opening command value, determine whether the valve core moves towards increasing or decreasing the opening. Set a trend judgment threshold; for example, confirm the trend direction when the absolute value of the slope exceeds the threshold and the sign remains consistent. The trend judgment threshold is determined based on the magnitude of the opening command change, typically taking 1% to 2% of the entire opening range. For example, when the opening range is 0% to 100%, the threshold is 1% to 2%. Considering the requirement for the persistence of change, a trend is only confirmed when changes in the same direction persist for a certain proportion of time; for example, requiring more than 80% of sampling points to show the same direction of change. For cases with large fluctuations, a voting mechanism is used to statistically analyze the main directions of change in each time period, and the direction with the majority agreement is used as the final judgment result.
[0038] The determined movement direction is recorded as the valve core's movement direction. The recorded information includes the movement direction identifier, the judgment confidence level, and a timestamp. The movement direction identifier is represented by an enumerated value; for example, 0 indicates an unknown direction, 1 indicates movement towards increasing opening, and -1 indicates movement towards decreasing opening. The judgment confidence level is calculated based on the degree of trend significance, considering factors such as slope magnitude, consistency of change, and signal quality. The confidence level ranges from 0 to 100%. A confidence level below 60% is considered unreliable and requires reanalysis. The recorded timestamp is accurate to the millisecond level and synchronized with the current control system time. All recorded data is stored in non-volatile memory, including a valve core movement direction record table and historical trend data, for subsequent compensation and adjustment.
[0039] An abnormal data handling mechanism is implemented during trend analysis. When an abnormal jump in the current valve opening command value is detected, a data re-verification process is initiated. The criterion for an abnormal jump is that the change in adjacent sampling points exceeds three times the normal range. For example, if the normal range is 1% to 5% per second, a change exceeding 15% is considered abnormal. For abnormal data, interpolation of the preceding and following normal data is used for replacement, and the data reliability for that time period is marked as reduced. Trend analysis results also need to be cross-validated with the system status. For example, when the system is in a stable operating state, the opening command should not show significant changes; if an abnormal change is detected, a possible sensor malfunction is indicated. The movement direction determination process also includes trend reversal detection. When a change in trend direction is detected, the statistical change characteristics are restarted to ensure the timeliness of the determination results. All these measures ensure the accuracy and reliability of the valve core movement direction determination, providing correct directional information for subsequent compensation adjustments.
[0040] S4. Acquire the flow signal sequence output by the flow sensor, convert the flow signal sequence into a symbol sequence, and statistically analyze the probability distribution of the symbol sequence. Simultaneously, generate a recurrence graph based on the flow signal sequence and calculate the deterministic percentage of the recurrence graph. Specifically, the implementation is as follows: In the control process of smart faucets, the acquisition and analysis of flow signals is a crucial step in monitoring the system's operational status. A flow signal sequence is formed by continuously collecting flow measurements from multiple time points using a flow sensor. The flow sensor, employing either a turbine or electromagnetic flow meter, is installed in the outlet channel of the mixing valve and outputs a pulse signal or analog voltage signal proportional to the flow velocity. The acquisition frequency is determined based on the system's dynamic characteristics; for example, a flow measurement might be acquired every 100 milliseconds, resulting in a 1000-point flow signal sequence corresponding to a 100-second time span. The length of the flow signal sequence must cover the typical dynamic process of the system, typically including multiple complete flow fluctuation cycles to ensure statistical significance in subsequent analysis. The acquisition process includes signal conditioning steps, amplifying, filtering, and performing analog-to-digital conversion on the raw signal. The signal amplifier gain is adjusted according to the sensor's output range, a low-pass filter with a cutoff frequency of 10 Hz is used, and the analog-to-digital converter resolution is no less than 12 bits to ensure the accuracy and reliability of the flow measurement values.
[0041] The difference between adjacent flow measurements in the flow signal sequence is calculated, and the flow signal sequence is converted into a symbol sequence based on the sign of the difference. The formula for calculating the difference is the difference between the previous and subsequent flow measurements. A positive value indicates an increase in flow, a negative value indicates a decrease in flow, and a zero value indicates no change in flow. Each symbol in the symbol sequence represents the direction of change of adjacent flow measurements; for example, "1" represents a positive value, "-1" represents a negative value, and "0" represents a zero value. To handle minor fluctuations caused by measurement noise, a threshold value is set. The symbol change is only recorded when the absolute value of the difference exceeds the threshold value. The threshold value is set to 0.5% of the flow range; for example, when the flow range is 10 liters / minute, the threshold value is 0.05 liters / minute. This avoids misjudgments caused by noise and improves the reliability of the symbol sequence.
[0042] The frequency distribution of different symbol patterns in a statistical symbol sequence is used as the probability distribution. First, a fixed-length symbol pattern window is set, the length of which is determined based on the system's dynamic characteristics; for example, a window of 3 symbols corresponds to a 300-millisecond time span. The symbol pattern window is slid across the symbol sequence to extract all possible symbol pattern combinations, sliding one symbol position at a time until the entire symbol sequence has been traversed, ensuring all possible patterns are covered. The frequency of each symbol pattern in the symbol sequence is counted, and the ratio of the frequency of each symbol pattern to the total length of the symbol sequence is calculated to obtain the probability distribution of the symbol sequence. The sum of the probability distributions equals 1. The probability distribution reflects the statistical characteristics of flow change patterns, providing basic data for subsequent anomaly detection. For example, the probability distribution under steady flow conditions differs significantly from that under pulsating flow conditions.
[0043] Phase space reconstruction of the traffic signal sequence is performed by selecting time delay and embedding dimension. The time delay is determined using the autocorrelation function method. The autocorrelation function of the traffic signal sequence is calculated, and the time when the autocorrelation function first drops to the initial value 1 / e is taken as the optimal time delay, where e is the natural constant. The embedding dimension is determined using the spurious nearest neighbor method. The embedding dimension is gradually increased, starting from 2, and the proportion of spurious nearest neighbors in each dimension is calculated. When the proportion of spurious nearest neighbors is lower than a set threshold of 5%, that dimension is determined as the optimal embedding dimension. Phase space reconstruction transforms the one-dimensional traffic signal sequence into trajectory points in a high-dimensional phase space. Each phase space point consists of traffic values from multiple consecutive time points, which can better reveal the dynamic characteristics of the system.
[0044] The recursive matrix is calculated based on the reconstructed phase space points. The Euclidean distance between any two phase space points is calculated using the formula: the square root of the sum of the squares of the differences in each dimension. This Euclidean distance is compared to a preset distance threshold, determined based on the distribution density of the phase space points. The threshold is a fixed percentage of the median distance between phase space points, for example, 10% of the median. If the Euclidean distance is less than the threshold, the corresponding position in the recursive matrix is marked as a recursive point with a value of 1; otherwise, it is marked as a non-recursive point with a value of 0. The recursive matrix is a symmetric two-dimensional matrix where each element indicates whether corresponding phase space points are in a similar state. The dimension of the matrix is equal to the number of phase space points.
[0045] This section analyzes the length distribution of diagonal structures in the recursion matrix. A diagonal structure refers to a line segment consisting of consecutive recursive points distributed along the main diagonal of the matrix. All diagonal structures in the recursion matrix are identified by scanning each diagonal and recording the start and end positions of consecutive recursive points. The length of each diagonal structure, i.e., the number of consecutive recursive points, is calculated, excluding short lines with a length less than 2 to avoid noise interference. The ratio of the total length of the diagonal structures to the total number of recursive points is calculated as the deterministic percentage of the recursion graph. The deterministic percentage reflects the predictability of the system's dynamic behavior; a higher value indicates more regular system behavior. For example, a deterministic percentage exceeding 95% indicates that the system is in a highly deterministic periodic state.
[0046] The symbol sequence analysis process also includes a stationarity test. This is achieved by dividing the symbol sequence into multiple segments, calculating the probability distribution of each segment, and using a chi-square test to compare the differences in distributions across different segments to assess the stability of the symbol sequence. When a significant change in the probability distribution is detected (i.e., a p-value less than 0.05), it indicates a potential change in the system's operating state, requiring a re-establishment of the baseline probability distribution. The calculation of the recurrence matrix also includes normalization, applying z-score standardization to the flow signal sequence to achieve a mean of 0 and a standard deviation of 1, ensuring comparability of flow signals at different time scales. All these analysis steps are performed in real-time within the electronic control unit (ECU), using 32-bit floating-point arithmetic to ensure computational accuracy, while a circular buffer is used to store intermediate results to reduce memory usage.
[0047] The acquisition of the traffic signal sequence also includes data quality assessment. Data reliability is determined by calculating the variance and signal-to-noise ratio (SNR). Variance is calculated as the average of the squares of the differences between each measurement and the mean, while SNR is the ratio of signal power to noise power. When a data quality degradation is detected, i.e., the SNR falls below 20 dB, the acquisition parameters are automatically adjusted, including increasing the sampling frequency, raising the filter cutoff frequency, or triggering a re-acquisition mechanism. The symbol sequence conversion process also includes symbol encoding optimization. Compression algorithms such as Huffman coding are used to compress and store the symbol sequence, reducing storage space requirements; compression ratios typically reach over 50%. The calculation of the recursive matrix employs a block-based processing strategy, decomposing a large matrix into multiple sub-matrices for separate calculation, reducing memory requirements and computational complexity. The size of the sub-matrices is determined by the processor cache size, for example, a block size of 256×256.
[0048] The calculation of the percentage of certainty also includes confidence assessment, which improves the reliability of the results by averaging multiple repeated calculations. The number of repetitions is determined based on computing resources, typically 3 to 5 times. The statistical analysis of the probability distribution of the symbol sequence also includes uncertainty quantification, using the information entropy index to measure the uniformity of the distribution. The information entropy formula is the sum of the negative logarithms of the probabilities of each mode. All these auxiliary analysis indicators, together with the main characteristic parameters, constitute a complete feature vector, providing multi-dimensional decision-making basis for subsequent dead zone determination. The entire flow signal analysis process adopts a pipeline architecture, with each processing step executed in parallel, ensuring that real-time performance meets the requirements of the control system, and the analysis delay is controlled within 1 second to guarantee the timeliness of the control response.
[0049] S5. Calculate the divergence value between the probability distribution of the symbol sequence and the pre-stored baseline probability distribution; when the divergence value exceeds the first threshold and the certainty percentage is lower than the second threshold, determine that the current operation point is in the displacement-flow response dead zone. Specifically, this is implemented as follows: After calculating the probability distribution of the symbol sequence and the deterministic percentage of the recursion graph, the process of determining the dead zone of the displacement-flow response begins. The probability distribution of the symbol sequence is compared with a baseline probability distribution pre-stored in memory, and the divergence value is obtained by calculating the difference between the two probability distributions. The baseline probability distribution is a reference distribution obtained through long-term statistics under normal system operating conditions, stored in the non-volatile memory of the electronic control unit. It contains all possible symbol patterns and their corresponding probabilities of occurrence. The number of symbol patterns is determined by the length of the symbol sequence window; for example, when the window length is 3, there are 27 possible symbol patterns. The divergence value is calculated using Kullback-Leibler divergence, which is mathematically expressed as the sum of the probabilities of each symbol pattern multiplied by the logarithm of the ratio of the two probabilities. This calculation reflects the degree of information difference between the current probability distribution and the baseline distribution. To handle cases where the probability value is zero, the probability distribution is smoothed before calculation, assigning a very small probability value, such as 10 to the power of -6, to all symbol patterns to avoid infinitely large calculation results.
[0050] The calculated divergence value is compared with a preset first threshold, which is determined based on the statistical characteristics of divergence values during normal system operation. By collecting divergence value data from multiple time periods under normal operating conditions, the mean and standard deviation of these data are calculated. The mean plus three times the standard deviation is used as the first threshold. For example, if the mean divergence value under normal operating conditions is 0.1 and the standard deviation is 0.05, then the first threshold is set to 0.25. Simultaneously, the deterministic percentage of the recursive graph is compared with a preset second threshold, which is determined based on the system's dynamic characteristics. By analyzing the distribution of the deterministic percentage in dead-zone and non-dead-zone states, a value that best distinguishes between the two states is selected as the second threshold, for example, 80%. The comparison process is implemented using a numerical comparator, which monitors in real time whether the divergence value and the deterministic percentage exceed their respective thresholds. The comparison results are stored in a status register for subsequent judgment.
[0051] When the divergence value is greater than the first threshold and the certainty percentage is less than the second threshold, the current operating point is determined to be in the displacement-flow response dead zone. This determination uses a logical AND operation; a dead zone determination signal is only generated when both conditions are met simultaneously. The dead zone determination result includes a timestamp, divergence value, certainty percentage, and determination confidence level, which are stored in the system status register. The determination confidence level is calculated based on the degree to which the divergence value and certainty percentage deviate from the threshold; the greater the deviation, the higher the confidence level. For example, when the divergence value exceeds the first threshold by 50% and the certainty percentage is less than the second threshold by 20%, the determination confidence level is 100%. The determination process includes de-jitter processing, requiring the dead zone state to persist for a certain period before confirming the determination result. For example, it requires that the determination conditions be met for three consecutive sampling periods to avoid misjudgments caused by instantaneous interference. The duration of each sampling period is consistent with the main loop cycle of the control system.
[0052] The divergence calculation process also includes normalization, mapping the results to a range of 0 to 1 for easier comparison with a threshold. The normalization method uses max-min normalization, scaling based on the maximum and minimum historical divergence values, with historical data storing the divergence values from the most recent 1000 sampling points. A baseline probability distribution update mechanism is included in the system. When the system is detected to be operating under normal conditions for an extended period, the baseline probability distribution is automatically updated, incorporating the new statistical results into the original distribution using a weighted average. The weighting coefficients are determined based on data reliability, with the weights for new data typically between 0.1 and 0.3. The calculation of the deterministic percentage also includes temperature compensation, adjusting calculation parameters according to water temperature changes to ensure consistency across different temperatures. The compensation coefficients are experimentally determined and stored in the calibration database.
[0053] The dead-zone determination process also includes a self-diagnostic function. When abnormal fluctuations in divergence or deterministic percentage are detected, the sensor calibration procedure is initiated. The determination results are recorded using a circular buffer, saving the most recent 100 determination records, including timestamps, determination results, and relevant parameter values, facilitating subsequent analysis and fault diagnosis. The system also provides an interface for manually setting thresholds, allowing users to adjust the values of the first and second thresholds according to actual usage, improving system adaptability. The threshold adjustment range is determined based on system characteristics: the first threshold is adjustable from 0.1 to 0.5, and the second threshold is adjustable from 70% to 90%. The entire determination process employs a fault-tolerant design. When a sensor fails, it automatically switches to a backup algorithm to ensure continuous and stable system operation. The backup algorithm uses a predictive model based on historical data to provide alternative data during sensor failures. All calculation processes include overflow checks and anomaly handling. When a calculation anomaly is detected, the previously valid calculation result is automatically used to ensure the continuity of system control.
[0054] S6. Compensate and adjust the current opening command according to the valve core's movement direction and the range of the displacement-flow response dead zone. Specifically, the implementation is as follows: After confirming that the current operating point is within the displacement-flow response dead zone, the compensation adjustment step begins. The direction of compensation adjustment is determined based on the known movement direction of the valve spool, which is derived from the judgment result of the previous step and includes two possible scenarios: moving towards increasing the opening or moving towards decreasing the opening. The compensation adjustment direction is consistent with the valve spool's movement direction; that is, when the valve spool moves towards increasing the opening, the compensation adjustment direction is positive, and when the valve spool moves towards decreasing the opening, the compensation adjustment direction is negative. The direction determination process includes a direction verification mechanism. The stability of the direction is confirmed by checking the movement direction records of the most recent several cycles. The final compensation direction is confirmed only if the direction is consistent for three consecutive cycles to avoid errors in the compensation direction due to momentary judgment mistakes. Historical data used in the verification process is stored in a circular buffer. The buffer depth is determined based on the system response time; for example, it stores the direction records of the most recent 10 sampling cycles.
[0055] The compensation adjustment magnitude is determined based on the range of the displacement-flow response dead zone, which is experimentally determined and stored in the system parameter table. The dead zone range is expressed as the ratio of the change in opening degree to the change in flow rate. For example, a dead zone range of 2% opening degree / liter per minute means that a 2% change in opening degree is needed to produce a 1 liter per minute flow rate change. The compensation adjustment magnitude is calculated based on the dead zone range and the desired flow rate change, which is taken as a typical value during normal system adjustment, such as 0.5 liters per minute. The compensation magnitude calculation formula is the dead zone range multiplied by the desired flow rate change. For example, when the dead zone range is 2% opening degree / liter per minute and the desired flow rate change is 0.5 liters per minute, the compensation magnitude is 1% opening degree. The magnitude calculation process includes an adaptive adjustment mechanism, dynamically adjusting the calculation parameters based on historical compensation effects to improve compensation accuracy.
[0056] The compensation amount is generated according to the determined compensation adjustment direction and amplitude. The compensation amount is a signed numerical value; a positive sign indicates positive compensation, and a negative sign indicates negative compensation. The absolute value represents the compensation amplitude. The compensation amount generation process includes amplitude limit checks to ensure that the compensation amount does not exceed the maximum allowable value. The maximum allowable value is determined based on the characteristics of the actuator, for example, 5% of the full opening. It also includes a rate-of-change limit to ensure smooth changes in the compensation amount and avoid impacting the actuator. The rate-of-change limit is determined based on the actuator's response speed, for example, no more than 2% of the opening per second. The compensation amount also includes timestamp and sequence number information for subsequent tracking and debugging. The timestamp is accurate to the millisecond level, and the sequence number is assigned in an incrementing manner.
[0057] The compensated opening command is obtained by adding the compensation amount to the current opening command. The addition operation uses algebraic addition, taking into account the sign direction of the compensation amount. The current opening command comes from the output register of the electronic control unit and is the original, uncompensated command value. A range check is performed before addition to ensure the result is within the valid range. The lower limit of the valid range is the command value corresponding to the fully closed position of the mixing valve, and the upper limit is the command value corresponding to the fully open position of the mixing valve. For example, when using percentage representation, the valid range is 0% to 100%. When the calculated result exceeds the valid range, it is automatically truncated to the nearest valid value. For example, if the calculated result is less than 0%, it is taken as 0%; if it is greater than 100%, it is taken as 100%. The addition operation uses 32-bit fixed-point arithmetic to ensure that the calculation accuracy meets the control requirements. The calculation result is rounded to the specified precision, for example, retaining one decimal place.
[0058] The compensated opening command is sent to the actuator of the mixing valve. The transmission process uses a standard control interface protocol, such as analog voltage signals or digital pulse width modulation (PWM) signals. Analog voltage signals typically range from 0 to 10V, corresponding to 0% to 100% of the opening command. The duty cycle of the PWM signal is proportional to the opening command. Before transmission, signal validity is verified to ensure the command value is within the allowable range and the signal format is correct. A retry mechanism is included during transmission; if a transmission error is detected, the signal is automatically retransmitted. The maximum number of retries is determined based on communication reliability, for example, three times. After transmission, feedback signals from the actuator are awaited to verify correct execution of the command. Feedback signals include the current position signal and motion status signal. The entire transmission process includes timeout protection. If no correct feedback is received within a set time, an exception handling procedure is triggered, an error log is recorded, and a maintenance check is indicated. The timeout period is determined based on the actuator's response characteristics, for example, 500 milliseconds. The compensation adjustment process also includes an adaptive adjustment mechanism that dynamically adjusts compensation parameters based on the compensation effect. By monitoring the system response after compensation, the compensation effect is evaluated, and the compensation amplitude is automatically adjusted when the effect is unsatisfactory. The adjustment amplitude is determined based on the response deviation, for example, a 10% change in amplitude each time. It also includes a learning function, recording successful compensation parameters and establishing a parameter knowledge base, prioritizing the use of historically successful parameters under similar operating conditions. All compensation operations are recorded in non-volatile memory, including timestamps, compensation direction, compensation amplitude, and compensation effect information, providing data support for subsequent optimization. The compensation process also includes a safety protection mechanism. If the system state does not improve after multiple consecutive compensations, compensation is automatically stopped and a system alarm is triggered to avoid system instability caused by continuous ineffective compensation. The threshold for stopping compensation is determined based on system characteristics, for example, stopping after five consecutive ineffective compensations. The entire compensation adjustment process adopts a closed-loop control method, monitoring the compensation effect in real time and dynamically adjusting parameters to ensure the system quickly and stably exits the dead zone state and resumes normal operation.
[0059] Example 2: Figure 2 A schematic diagram of the structure of a faucet body according to the present invention is provided. A faucet body includes: Mixing valve 1, whose valve core is driven by an actuator to adjust the mixing ratio of hot and cold water; Temperature sensor 2 is installed in the outlet channel of the mixing valve to detect the actual outlet water temperature; Flow sensor 3 is installed in the outlet channel of the mixing valve to detect the outlet flow rate; The electronic control unit 4 is electrically connected to the temperature sensor 2, the flow sensor 3, and the actuator of the mixing valve 1, respectively; the electronic control unit 4 is configured to execute a water outlet control method for an intelligent faucet.
[0060] All calculations involved in the embodiments are dimensionless numerical calculations, and the preset parameters and thresholds in the calculations are set by those skilled in the art according to the actual situation.
[0061] It should be noted that this invention can be deployed on the device itself to realize embedded applications, or it can run on a PC or other terminal with a user interface, thereby meeting various hardware environments and usage requirements.
[0062] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wireless or wired transmission; wired transmission methods include optical fiber, twisted pair, coaxial cable, etc.; wireless transmission includes infrared, microwave, etc. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center containing one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0063] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0064] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0065] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0066] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0067] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0068] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0069] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for controlling the water flow of an intelligent faucet, characterized in that, include: S1. Real-time acquisition of the current opening command of the mixing valve and the actual outlet water temperature detected by the temperature sensor; S2. Calculate the real-time temperature deviation value and the real-time temperature deviation change rate based on the actual outlet water temperature and the set temperature, construct the temperature deviation phase plane, calculate the residence time of the phase trajectory in the preset annular area, and determine whether it exceeds the residence threshold. S3. When the dwell time exceeds the dwell threshold, record the trend of the current opening command to determine the movement direction of the valve core. S4. Collect the flow signal sequence output by the flow sensor, convert the flow signal sequence into a symbol sequence and calculate the probability distribution of the symbol sequence. At the same time, generate a recursion graph based on the flow signal sequence and calculate the deterministic percentage of the recursion graph. S5. Calculate the divergence between the probability distribution of the symbol sequence and the pre-stored baseline probability distribution; When the divergence value exceeds the first threshold and the determinism percentage is lower than the second threshold, the current operation point is determined to be in the displacement-flow response dead zone. S6. Adjust the current opening command according to the movement direction of the valve core and the range of the displacement-flow response dead zone.
2. The water outlet control method for an intelligent faucet according to claim 1, characterized in that, Real-time acquisition of the current opening command of the mixing valve and the actual outlet water temperature detected by the temperature sensor, including: The current opening command value sent to the mixing valve actuator is read in real time through the output terminal of the electronic control unit; At the same time, the actual water temperature measurement value is collected in real time through the signal output terminal of the temperature sensor.
3. The water outlet control method for an intelligent faucet according to claim 2, characterized in that, Based on the actual outlet water temperature and the set temperature, calculate the real-time temperature deviation value and the real-time temperature deviation change rate, construct a temperature deviation phase plane, calculate the residence time of the phase trajectory within the preset annular zone, and determine whether it exceeds the residence threshold, including: The real-time temperature deviation value is obtained by subtracting the actual outlet water temperature from the set temperature. The rate of change of real-time temperature deviation is obtained by performing a differential operation on the real-time temperature deviation value. A temperature deviation phase plane is constructed with the real-time temperature deviation value as the x-axis and the real-time temperature deviation change rate as the y-axis. A ring-shaped region centered on the origin of the coordinate system is drawn in the temperature deviation phase plane as a preset ring zone region; The motion of the phase trajectory is tracked within a preset annular zone, and the continuous dwell time of the phase trajectory within the preset annular zone is accumulated as the dwell time. The dwell time is compared with a preset dwell threshold to determine whether the dwell time exceeds the dwell threshold.
4. The water outlet control method for an intelligent faucet according to claim 3, characterized in that, When the dwell time exceeds the dwell threshold, the trend of the current opening command is recorded to determine the direction of valve core movement, including: After determining that the dwell time exceeds the dwell threshold, retrieve the current opening command value within the preset time. Analyze the increase or decrease characteristics of the current opening command value over a preset time period; Based on the increase or decrease characteristics of the current opening command value, determine whether the valve core moves in the direction of increasing the opening or in the direction of decreasing the opening; The determined direction of movement is recorded as the direction of movement of the valve core.
5. The water outlet control method for an intelligent faucet according to claim 4, characterized in that, The process involves acquiring flow signal sequences output from flow sensors, converting these sequences into symbol sequences, statistically analyzing the probability distribution of the symbol sequences, generating a recurrence graph based on the flow signal sequences, and calculating the percentage of determinism in the recurrence graph. This includes: A flow signal sequence is formed by continuously collecting flow measurement values at multiple time points from a flow sensor; Calculate the difference between adjacent flow measurements in the flow signal sequence, and convert the flow signal sequence into a sign sequence according to the positive or negative sign of the difference; The frequency distribution of different symbol patterns in a statistical symbol sequence is used as a probability distribution. Phase space reconstruction of the traffic signal sequence is performed by selecting time delay and embedding dimension; Calculate the recursive matrix based on the phase space points reconstructed from the phase space; The length distribution of the diagonal structure in the recursion matrix is statistically analyzed, and the ratio of the total length of the diagonal structure to the total number of all recursive points is calculated as the deterministic percentage of the recursion graph.
6. The water outlet control method for an intelligent faucet according to claim 5, characterized in that, The frequency distribution of different symbol patterns in a statistical symbol sequence, as a probability distribution, includes: Set a fixed-length symbol pattern window, and slide the symbol pattern window over the symbol sequence to extract all possible symbol pattern combinations; Count the number of times each symbol pattern appears in the symbol sequence; Calculate the ratio of the occurrence frequency of each symbol pattern to the total length of the symbol sequence to obtain the probability distribution of the symbol sequence.
7. The water outlet control method for an intelligent faucet according to claim 5, characterized in that, The calculation of the recursive matrix based on the phase space points reconstructed from the phase space includes: Calculate the Euclidean distance between any two points in phase space; Compare the Euclidean distance with a preset distance threshold; If the Euclidean distance is less than the distance threshold, then the corresponding position in the recursion matrix is marked as a recursive point; otherwise, it is marked as a non-recursive point.
8. The water outlet control method for an intelligent faucet according to claim 5, characterized in that, Calculate the divergence between the probability distribution of the symbol sequence and the pre-stored baseline probability distribution; When the divergence value exceeds the first threshold and the determinism percentage is lower than the second threshold, the current operating point is determined to be in the displacement-flow response dead zone, including: The probability distribution of the symbol sequence is compared with the baseline probability distribution pre-stored in memory, and the divergence value is obtained by calculating the difference between the two probability distributions. The calculated divergence value is compared with a preset first threshold; at the same time, the deterministic percentage of the recursive graph is compared with a preset second threshold. When the divergence value is greater than the first threshold and the certainty percentage is less than the second threshold, the current operation point is determined to be in the displacement-flow response dead zone.
9. The water outlet control method for an intelligent faucet according to claim 8, characterized in that, The valve core's movement direction and the range of the displacement-flow response dead zone are used to compensate for and adjust the current opening command, including: The direction of compensation adjustment is determined based on the already determined direction of valve core movement. The magnitude of the compensation adjustment is determined based on the range of the displacement-flow response dead zone; The compensation amount is generated according to the determined compensation adjustment direction and compensation adjustment range; The compensation amount is added to the current opening command to obtain the compensated opening command; The compensated opening command is sent to the actuator of the mixing valve.
10. A faucet body, characterized in that, include: A mixing valve (1) whose valve core is driven by an actuator to adjust the mixing ratio of hot and cold water; Temperature sensor (2) is installed in the outlet channel of the mixing valve to detect the actual outlet water temperature; A flow sensor (3) is installed in the outlet channel of the mixing valve to detect the outlet flow rate; The electronic control unit (4) is electrically connected to the temperature sensor (2), the flow sensor (3), and the actuator of the mixing valve (1), respectively; The electronic control unit (4) is configured to perform a water dispensing control method for a smart faucet.
Citation Information
Patent Citations
Tap drainage control method and control device
CN105822810A
An intelligent reverse flow valve based on fuzzy control
CN119760918A
Intelligent control faucet and faucet body
CN120143714A
Water-cooling air conditioning system control method suitable for overtime work
CN120292679A
Intelligent temperature control method and system for melting holding furnace
CN120444930A