Water outlet control method and intelligent faucet
Patent Information
- Application Number
- CN202610875262.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2046-06-17
AI Technical Summary
[0002]在现代实验室的高通量样品制备、连锁饮品店的标准化配料环节以及规模化植物工厂的营养液精准供给等应用场景中,普遍存在对一系列规格各异、无序放置的容器进行快速、准确液体分装的作业需求,这些容器通常具有不同的物理形态,如高度、口径各异,且材质多样,包括透明玻璃、半透明塑料或反光金属等,其在操作台面上的位置也常呈非严格对齐的随机分布,同时,作业环境中的光照条件可能存在波动,容器在流水线上也可能因机械振动而产生微小位移,传统的人工操作方式不仅效率低下、劳动强度大,更难以保证每次注液量的精确性与落点的一致性,易导致液体外溅、交叉污染或配方误差,难以满足现代化生产对自动化、精准化与可靠性的严苛要求
[0014]本发明的有益效果是:该方案能自动识别并处理接水区域内多样化的容器,通过构建动态任务队列有序规划作业,依据每个容器的几何特征参数,智能计算出防溅射的最优注水点,并驱动多自由度调节机构将出水嘴精准定位,在出水前,自动进行水质安全检测,一旦异常可立即警示、切换水源并恢复流程,保障了作业安全与连续性,在定量注水过程中,融合视觉液面监测与流量信息进行闭环调节,确保水量精确,完成后,系统能将结果反馈至动态任务队列,更新容器的几何特征参数,实现了对未知或同类容器后续作业精度的自学习提升,从而达成从感知、规划、安全校核到精准执行与自我优化的全流程自动化。
Smart Images

Figure CN122411148B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation, and more specifically, to a water outlet control method and a smart faucet. Background Technology
[0002] In applications such as high-throughput sample preparation in modern laboratories, standardized ingredient mixing in chain beverage stores, and precise nutrient solution supply in large-scale plant factories, there is a common need for rapid and accurate liquid dispensing of a series of containers of varying sizes and placed in an unordered manner. These containers typically have different physical forms, such as varying heights and diameters, and are made of diverse materials, including transparent glass, translucent plastic, or reflective metal. Their positions on the work surface are often randomly distributed without strict alignment. At the same time, the lighting conditions in the work environment may fluctuate, and the containers may also experience slight displacement due to mechanical vibration on the assembly line. Traditional manual operation methods are not only inefficient and labor-intensive, but also make it difficult to guarantee the accuracy of the liquid volume and the consistency of the landing point for each dispensing, which can easily lead to liquid splashing, cross-contamination, or formula errors, making it difficult to meet the stringent requirements of modern production for automation, precision, and reliability.
[0003] Currently, existing technologies for automated liquid dispensing suffer from the following core drawbacks: First, they employ fixed-position and-angle nozzles or rely on simple robotic arms that are pre-programmed to teach a single container model. This lack of flexibility makes them unsuitable for heterogeneous container arrays where the three key variables—height, diameter, and position—are uncertain. Any change in container specifications or layout necessitates time-consuming mechanical adjustments or reprogramming, preventing the realization of flexible "dispensing immediately upon placement." Second, their sensing capabilities are weak. Existing solutions often rely on single-type sensors, such as photoelectric switches to determine container presence or simple cameras for rough positioning, making stable and reliable operation difficult. Accurate identification of the three-dimensional contours and real-time liquid level information of containers made of special materials such as transparent and reflective materials leads to unreliable foundations for positioning and quantitative control. Thirdly, functional modules are fragmented. Existing systems often lack an end-to-end integrated process from container identification, spatial positioning, motion trajectory planning, quantitative control to water quality safety monitoring. In particular, they generally neglect the link of real-time water quality detection and safety assurance before water discharge. This poses a major hidden danger in scenarios where water quality fluctuations may have a catastrophic impact on the results of batch operations. Therefore, there is an urgent need for an intelligent liquid dispensing solution that can perceive complex operating environments in real time, autonomously adapt to diverse containers, and integrate full-process quality control. Summary of the Invention
[0004] This invention addresses the technical problems existing in the prior art by providing a water outlet control method and an intelligent faucet to solve the problems mentioned in the background art.
[0005] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: a water outlet control method, specifically including the following steps: Step S1: After the controller is started, it collects images, depth data and flow information of the water receiving area through the vision and ranging sensor array and flow sensor. After fusion processing, it identifies the geometric feature parameters of at least one container. The geometric feature parameters include the height, diameter and spatial coordinates of the container. Based on this, a dynamic task queue containing the geometric feature parameters of each container is constructed. Step S2: For the current container in the dynamic task queue, calculate the optimal water injection point coordinates based on its geometric feature parameters and call the preset anti-splash optimization model. Based on this, calculate the motion parameters of the multi-degree-of-freedom adjustment mechanism and drive the multi-degree-of-freedom adjustment mechanism to position the water outlet to the optimal water injection point coordinates. Step S3: After positioning, the water quality sensor is triggered to obtain the water quality detection result and make a safety judgment. If the judgment is abnormal, the process of issuing an alarm, stopping water discharge and switching to a parallel backup water source is executed. Then, based on the dynamic task queue status, step S2 is re-executed for the current container or step S4 is executed directly. If the judgment is safe, the process continues. Step S4: Control the water outlet valve to open to achieve quantitative water injection. During this process, receive the container liquid level information monitored in real time by the vision and ranging sensor array and the flow information monitored by the flow sensor. Based on this, perform closed-loop water volume adjustment. After completion, feed back the final liquid level information to the dynamic task queue to update the geometric feature parameters of the corresponding container. In a preferred embodiment, in step S1, the controller synchronously triggers the visual and ranging sensor array and the flow sensor to collect images, depth data and flow information of the water contact area; Subsequently, the acquired images are processed using a preset instance segmentation model to segment the pixel-level mask corresponding to each container instance in the water-receiving area and output the category confidence of each pixel-level mask; at the same time, the depth data is converted into a 3D point cloud of the water-receiving area according to a preset coordinate transformation relationship. Then, the pixel-level mask of each container instance is mapped onto this 3D point cloud, thereby separating and extracting the independent 3D point cloud subsets belonging to each container.
[0006] In a preferred embodiment, the operation of constructing a dynamic task queue based on the geometric feature parameters of the independent 3D point cloud subset parsing container specifically involves: For each independent 3D point cloud subset of the container, analyze the parameters that constitute the geometric feature parameters: First, determine the spatial coordinates of the container: calculate the geometric center of the projection area of the independent 3D point cloud subset on the horizontal plane, and obtain the coordinates of the center of the horizontal plane; traverse all points in the independent 3D point cloud subset and find the vertical height value with the smallest value, and use it as the height coordinate of the bottom of the container; the spatial coordinates are composed of the coordinates of the center of the horizontal plane and the height coordinates of the bottom of the container. Next, determine the height of the container: traverse all points in the independent 3D point cloud subset, find the vertical height value with the largest value, calculate the difference between this maximum vertical height value and the height coordinate of the bottom of the container, and this difference is the height of the container. Next, determine the container's diameter: filter out all points in the independent 3D point cloud subset whose vertical height values are within the preset range at the top, and perform circular or elliptical fitting on the selected points in the horizontal plane. The longer diameter in the fitted figure is the container's diameter. After completing the parsing operation for all identified containers, a task entry is created for each container. The task entry records at least the container identifier, all parsed geometric feature parameters, the preset target water injection volume, and an initial flag indicating that the task has not yet started execution. Finally, all task entries are arranged in a preset order to form a dynamic task queue.
[0007] In a preferred embodiment, the specific process of calculating the optimal water injection point coordinates based on its geometric feature parameters and by calling a preset anti-splash optimization model in step S2 is as follows: First, extract geometric feature parameters from the record corresponding to the current container in the dynamic task queue; Subsequently, a preset anti-splash optimization model is invoked, taking the container's diameter, preset liquid density, preset initial outflow velocity, preset liquid surface tension coefficient, and gravitational acceleration constant as inputs. Based on fluid dynamics constraints, the anti-splash optimization model solves a dimensionless relationship, which represents that the product of the optimized hovering height value and the container's diameter is equal to the product of the liquid surface tension coefficient and the container's diameter, divided by the product of the liquid density and the gravitational acceleration constant, multiplied by a preset empirical coefficient, and finally added to a preset safety height constant value used to compensate for unmodeled factors. The optimized hovering height value is obtained by solving this dimensionless relationship. Finally, the horizontal component of the optimal water injection point coordinates is determined based on the coordinates of the center position of the horizontal plane. The vertical component of the optimal water injection point coordinates is generated by summing the coordinates of the bottom height of the container, the height of the container, and the calculated optimized hovering height value. The horizontal and vertical components are combined to synthesize the optimal water injection point coordinates.
[0008] In a preferred embodiment, the specific operation of calculating the motion parameters of the multi-degree-of-freedom adjustment mechanism and driving the multi-degree-of-freedom adjustment mechanism to position the water outlet to the optimal water injection point coordinates is as follows: Obtain the current spatial coordinates of the water outlet, calculate the horizontal displacement difference between the optimal water injection point coordinates and the current spatial coordinates of the water outlet, decompose the horizontal displacement difference into the horizontal lateral component difference and the horizontal longitudinal component difference, and calculate the vertical displacement difference between the optimal water injection point coordinates and the current spatial coordinates of the water outlet. The difference between the horizontal and vertical components is converted into the left and right movement distance and direction commands corresponding to the horizontal pull-out component in the multi-degree-of-freedom adjustment mechanism, and the difference between the vertical displacement is converted into the up and down movement distance and direction commands corresponding to the vertical lifting component in the multi-degree-of-freedom adjustment mechanism. Based on the converted direction and distance commands, the corresponding pulse width modulation waveform signal or level direction signal is generated and sent to the motor drivers of the horizontal pull-out component and the vertical lifting component. The motor driver amplifies the received signal and drives the motor to produce corresponding linear motion of the horizontal pull-out component and the vertical lifting component, thereby linking the water outlet to perform a composite displacement until the distance between the end spatial position of the water outlet and the optimal water injection point coordinates is less than the preset positioning accuracy threshold, thus completing the positioning operation of the water outlet.
[0009] In a preferred embodiment, the specific operation of triggering the water quality sensor to obtain the water quality detection result and make a safety judgment in step S3 is as follows: After the water outlet is positioned, the controller immediately instructs the water quality sensor to perform a high-frequency sampling to obtain measured values of multiple water quality parameters, including total dissolved solids, pH, and turbidity. Subsequently, the preset safety evaluation model is invoked, based on the measured values of multiple water quality parameters, the preset standard values corresponding to each water quality parameter, and a variable tolerance parameter that is related to the current target water injection volume of the container and dynamically determined according to a preset functional relationship. The judgment process of the safety evaluation model includes: First, determining the various water quality parameters involved in the evaluation; for each water quality parameter, calculating the absolute value of the difference between the current measured value of the water quality parameter and the corresponding preset standard value; and then dividing the absolute value by the variable tolerance parameter to obtain the normalized deviation of the water quality parameter. Secondly, the normalized deviation of each water quality parameter is multiplied by a preset weighting coefficient, and all the product results are summed to obtain the cumulative weighted deviation. Finally, subtract the square root of the cumulative weighted deviation from the number one, and the result is used as a comprehensive evaluation value. The safety assessment conclusion is based on comparing the comprehensive evaluation value with a preset safety threshold. If the comprehensive evaluation value is greater than or equal to the safety threshold, the safety assessment result is safe; if the comprehensive evaluation value is less than the safety threshold, the safety assessment result is abnormal.
[0010] In a preferred embodiment, the specific operation of executing the alert, stopping water discharge, and switching to a parallel backup water source, followed by re-executing step S2 for the current container based on the dynamic task queue status or directly executing step S4, is as follows: First, after an anomaly is detected, two operations are performed simultaneously: First, trigger an audible and visual alarm signal on the user interface to issue a warning, and record detailed information including abnormal water quality parameters, corresponding comprehensive evaluation values and the current container identifier in the event log; Second, immediately send a shut-off command to the outlet valve controlling the current main water supply pipeline to stop the water flow; Next, the water source switching decision is initiated, and the list of available parallel backup water sources is queried. For each backup water source, the controller calculates its priority score. The calculation process is as follows: The historical average water quality health of the backup water source is obtained and calculated based on its past comprehensive evaluation value records. It is then compared with the maximum possible difference and multiplied by the first weighting coefficient. The ratio of the estimated delay of the backup water source pipeline switching to the maximum possible difference is added and multiplied by the second weighting coefficient. The two products are added together to obtain the priority score of the backup water source. Compare the priority scores of all backup water sources and select the backup water source with the highest priority score as the switching target; Subsequently, the controller sends an opening command to the valve controlling the backup water source of the switching target and a closing command to the valve of the original main water supply pipeline, thus completing the switching from the abnormal water circuit to the parallel backup water source. Based on the relationship between the water source switching time and the preset delay threshold, select one of the following branches to execute: If the water source switching time is less than or equal to the delay threshold, then based on the current state of the dynamic task queue, step S4 is executed directly. If the time taken to switch water sources exceeds the delay threshold, the pending state of the current container in the dynamic task queue is maintained, and step S2 is re-executed for the current container.
[0011] In a preferred embodiment, step S4 involves receiving real-time monitoring information on the container liquid level from a vision and ranging sensor array and flow information from a flow sensor, and then performing closed-loop water volume regulation accordingly. After the safety assessment result is deemed safe, the controller reads the preset target water injection volume from the dynamic task queue and controls the outlet valve to open; simultaneously, it collects the flow information reported by the flow sensor, as well as the container liquid level height information determined based on the bottom height coordinates of the container obtained by the vision and ranging sensor array. Based on the collected flow rate information and container liquid level information, the controller calls a fusion estimator to perform closed-loop water volume regulation. The fusion estimator operates based on a discrete-time state-space model, which contains two internal state variables: a first state variable that serves as the estimate of cumulative water volume, and a second state variable that serves as the estimate of lumped disturbances. The model's input is flow information, and its output is a fusion estimate of the cumulative water volume. Within each control cycle, the fusion estimator performs the following operations: First, based on the first state variable of the previous cycle and the flow information of the current cycle, it uses discrete-time state equations to predict the first state variable of the current cycle. Secondly, based on the container liquid level information and the currently estimated equivalent average cross-sectional area of the container, the visual volume estimate is calculated. Then, the difference between the predicted first state variable of the current period and the visual volume estimate is calculated to obtain the output error. Next, the output error is amplified using a preset observer gain matrix, and the amplified result is used to correct the predicted first state variable, thereby generating the cumulative water volume fusion estimate of the current period, while updating the second state variable. The controller compares the cumulative water volume fusion estimate obtained in each cycle with the target water injection volume to obtain the real-time water volume error, and calculates the control command to be sent to the outlet valve based on a nonlinear control law. The nonlinear control law includes a proportional control term and a feedforward compensation term. The proportional control term uses a hyperbolic tangent function to handle the real-time water volume error. The feedforward compensation term divides the second state variable estimated by the fusion estimator in the current cycle by a preset control gain coefficient, and directly adds the quotient to the control command. The controller dynamically adjusts the opening of the outlet valve according to this control command until the absolute value of the deviation between the cumulative water volume fusion estimate and the target water volume is less than a preset stop threshold, and then closes the outlet valve to complete the quantitative water injection.
[0012] In a preferred embodiment, the process of feeding back the final liquid level information to the dynamic task queue to update the geometric feature parameters of the corresponding container specifically involves: After the outlet valve is closed and the liquid level stabilizes, the controller obtains the final liquid level height information in the container through the vision and ranging sensor array. Combined with the known and precisely injected target water volume, the controller performs model parameter update calculation. The model parameter update calculation divides the target water volume by the final liquid level height information, and the resulting quotient is the equivalent average cross-sectional area of the container derived when performing this water injection task. Subsequently, the controller uses the calculated equivalent average cross-sectional area of the container as a key correction parameter, feeds it back, and writes it into the task entry record corresponding to this container in the dynamic task queue, in order to update the geometric feature parameters associated with the container.
[0013] This application also provides a smart faucet, including: The faucet body; A multi-degree-of-freedom adjustment mechanism is installed on the faucet body and connected to the spout. The multi-degree-of-freedom adjustment mechanism includes at least a horizontal pull-out component for driving the spout to move horizontally and a vertical lifting component for driving the spout to move vertically. A vision and ranging sensor array is installed on the faucet body to collect images, depth data and flow information of the water receiving area; A water quality sensor is installed on the side of the water outlet. A flow sensor, installed on the water supply pipeline, is used to monitor flow information; The outlet valve is installed on the water supply pipeline to control the on / off state; The controller is electrically connected to the multi-degree-of-freedom adjustment mechanism, the vision and ranging sensor array, the water quality sensor, the flow sensor, and the outlet valve, respectively. The controller is configured to execute a water discharge control method.
[0014] The beneficial effects of this invention are as follows: This solution can automatically identify and process diverse containers within the water receiving area. By constructing a dynamic task queue for orderly operation planning, it intelligently calculates the optimal water injection point for splash prevention based on the geometric feature parameters of each container, and drives a multi-degree-of-freedom adjustment mechanism to precisely position the water outlet. Before water is dispensed, water quality safety testing is automatically performed. If any abnormality is detected, an immediate warning is issued, the water source is switched, and the process is restored, ensuring operational safety and continuity. During quantitative water injection, visual liquid level monitoring and flow information are integrated for closed-loop adjustment to ensure accurate water volume. After completion, the system can feed the results back to the dynamic task queue to update the geometric feature parameters of the containers, achieving self-learning improvement in the accuracy of subsequent operations on unknown or similar containers. This achieves full-process automation from perception, planning, safety verification to precise execution and self-optimization. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a structural block diagram of the smart faucet of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0018] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application. Example
[0019] This embodiment provides, for example Figure 1 The water outlet control method shown includes the following steps: Step S1: After the controller is started, it collects images, depth data and flow information of the water receiving area through the vision and ranging sensor array and flow sensor. After fusion processing, it identifies the geometric feature parameters of at least one container. The geometric feature parameters include the height, diameter and spatial coordinates of the container. Based on this, a dynamic task queue containing the geometric feature parameters of each container is constructed. Step S2: For the current container in the dynamic task queue, calculate the optimal water injection point coordinates based on its geometric feature parameters and call the preset anti-splash optimization model. Based on this, calculate the motion parameters of the multi-degree-of-freedom adjustment mechanism and drive the multi-degree-of-freedom adjustment mechanism to position the water outlet to the optimal water injection point coordinates. Step S3: After positioning, the water quality sensor is triggered to obtain the water quality detection result and make a safety judgment. If the judgment is abnormal, the process of issuing an alarm, stopping water discharge and switching to a parallel backup water source is executed. Then, based on the dynamic task queue status, step S2 is re-executed for the current container or step S4 is executed directly. If the judgment is safe, the process continues. Step S4: Control the water outlet valve to open to achieve quantitative water injection. During this process, receive the container liquid level information monitored in real time by the vision and ranging sensor array and the flow information monitored by the flow sensor. Based on this, perform closed-loop water volume adjustment. After completion, feed back the final liquid level information to the dynamic task queue to update the geometric feature parameters of the corresponding container.
[0020] In this embodiment, it is specifically necessary to explain that in step S1, the controller synchronously triggers the vision and ranging sensor array and the flow sensor to collect images, depth data, and flow information of the water contact area. "Synchronous triggering" means that the controller sends a start command to the vision and ranging sensor array and the flow sensor within the same control cycle, so that both collect data in the same time period as much as possible, thereby ensuring that the image, depth, and flow information have temporal consistency when performing subsequent fusion processing. The vision and ranging sensor array usually refers to a device that integrates an RGB camera and a depth sensing module (such as structured light, ToF, or binocular vision module). The "image" it collects is an RGB color image, and the "depth data" it collects is the depth value or distance value corresponding to each pixel in the RGB image. The flow sensor is an electronic flow meter installed on the water supply pipeline. The "flow information" it collects includes the instantaneous flow value. The main purpose of the controller collecting the flow sensor reading at this time is to obtain the basic flow status of the pipeline, which is used to verify the stability of the water flow in subsequent steps or as an initial reference for flow control, rather than for direct container identification. Subsequently, the acquired images are processed using a preset instance segmentation model to segment the image into pixel-level masks corresponding to each container instance within the water-receiving area, and the class confidence score corresponding to each pixel-level mask is output. The preset instance segmentation model can be a deep learning-based MaskR-CNN or YOLO-ACT model. The class confidence score is used to filter out false recognitions, retaining only pixel-level masks with a class confidence score higher than a first preset threshold (e.g., 0.85) for subsequent processing. At the same time, the depth data is converted into a 3D point cloud of the water-receiving area according to a preset coordinate transformation relationship. The preset coordinate transformation relationship is determined by the intrinsic and extrinsic parameter matrices of the vision and ranging sensor array (such as an RGB-D camera). By back-projecting the two-dimensional coordinates and depth values of each pixel in the depth image using the camera intrinsic parameter matrix, the 3D coordinate points in the camera coordinate system are obtained. Then, the 3D point cloud in the world coordinate system or the robot arm base coordinate system is obtained through coordinate transformation. Then, the pixel-level mask of each container instance is mapped onto this 3D point cloud, thereby separating and extracting the independent 3D point cloud subsets belonging to each container. The mapping operation is as follows: for each pixel coordinate in the pixel-level mask, according to its corresponding position in the depth image, the corresponding 3D point in the 3D point cloud is found, and the 3D points corresponding to all pixels belonging to the same mask are collected together, which constitutes the independent 3D point cloud subset of the container instance. The specific operation of parsing the geometric feature parameters of the container based on independent 3D point cloud subsets and constructing a dynamic task queue is as follows: For each independent 3D point cloud subset of the container, analyze the parameters that constitute the geometric feature parameters: First, determine the spatial coordinates of the container: Calculate the geometric center of the projection region of the independent 3D point cloud subset onto the horizontal plane, thus obtaining the horizontal plane center coordinates; to calculate the geometric center of the projection region, take the arithmetic mean of the X and Y coordinates of all points in the independent 3D point cloud subset, and obtain the X and Y coordinate values of the center point, which together constitute the horizontal plane center coordinates (X_center, Y_center); traverse all points in the independent 3D point cloud subset and find the minimum vertical height value, which is used as the bottom height coordinate of the container; the vertical height value is the Z coordinate value of the point, find the minimum Z coordinate value among all Z coordinate values, denoted as Z_base, as the bottom height coordinate of the container; the spatial coordinates are composed of the horizontal plane center coordinates and the container bottom height coordinates, which is represented as (X_center, Y_center, Z_base); Next, determine the height of the container: traverse all points in the independent 3D point cloud subset, find the vertical height value with the largest value, calculate the difference between this maximum vertical height value and the height coordinate of the bottom of the container, and this difference is the height of the container; let the maximum vertical height value be Z_max, then the container height H = Z_max - Z_base; Next, determine the container's opening diameter: Select all points in the independent 3D point cloud subset whose vertical height values fall within a preset top range; the preset top range can be a set of points with vertical height values greater than or equal to (Z_max - Δh), where Δh is a preset top height tolerance, for example, set to 10 mm, used to capture points at the container opening's edge. Perform circular or elliptical fitting on the selected points in the horizontal plane; the fitting method can be least squares for circular fitting to obtain the center and radius; if the container opening is not perfectly circular, use least squares for elliptical fitting to obtain the major and minor axes of the ellipse. The longer diameter in the fitted graph is the container's opening diameter; for circular fitting, the diameter D is twice the radius; for elliptical fitting, the diameter D is the length of the major axis. After completing the parsing operation for all identified containers, a task entry is created for each container. The task entry records at least the container identifier, all parsed geometric feature parameters, the preset target water injection volume, and an initial flag indicating that the task has not yet started execution. The container identifier can be an automatically generated serial number or an ID based on spatial location encoding. The task entry exists in memory as a data structure of a structure or class, and its "initial flag" field can be set to a specific value such as "PENDING" or 0. Finally, all task entries are arranged in a preset order to form a dynamic task queue. The preset order can be a spatial order from left to right or from front to back based on the coordinates of the center position of the horizontal plane, or an order specified according to the task priority. The dynamic task queue is usually implemented in memory as a linked list or array data structure, supporting the sequential extraction, status update, and parameter update operations of tasks.
[0021] In this embodiment, the specific process of calculating the optimal water injection point coordinates based on its geometric feature parameters and calling the preset anti-splash optimization model in step S2 is as follows: First, extract geometric feature parameters from the record corresponding to the current container in the dynamic task queue. The geometric feature parameters include the coordinates of the horizontal center position of the container, the height coordinates of the bottom of the container, the height of the container, and the diameter of the container. Subsequently, a pre-set anti-splash optimization model is invoked, taking the container's diameter, preset liquid density, preset initial outflow velocity, preset liquid surface tension coefficient, and gravitational acceleration constant as inputs. The preset liquid density is typically 1000 kg / m³ (water), the preset initial outflow velocity can be preset to 0.5 m / s to 1.5 m / s based on pipeline pressure, the preset liquid surface tension coefficient is typically 0.072 N / m (water at 20 degrees Celsius), and the gravitational acceleration constant is 9.8 m / s². Based on fluid dynamics constraints, the anti-splash optimization model solves for a dimensionless relationship. This relationship represents that the product of the optimized hovering height and the container's diameter is equal to the product of the liquid surface tension coefficient and the container's diameter, divided by the product of the liquid density and the gravitational acceleration constant. Then multiply by a preset empirical coefficient, and finally add a preset safety height constant value to compensate for unmodeled factors. The empirical coefficient is a constant calibrated through experiments, with a value range of 10 to 30, for example, 20. The safety height constant value is an empirical constant used to compensate for deviations caused by sensor errors, mechanical vibrations, and model simplifications. Its value range is usually set to 3 mm to 10 mm, for example, 5 mm. The optimized hovering height value is obtained by solving this dimensionless relationship. The solution process is to substitute the container diameter, preset liquid density, preset initial outflow velocity, preset liquid surface tension coefficient, gravitational acceleration constant, preset empirical coefficient, and safety height constant value into the dimensionless relationship, perform basic arithmetic operations (multiplication and division), and directly calculate the numerical result of the optimized hovering height value. Finally, the horizontal component of the optimal water injection point coordinates is determined based on the coordinates of the center position of the horizontal plane. The vertical component of the optimal water injection point coordinates is generated by summing the coordinates of the bottom height of the container, the height of the container, and the calculated optimized hovering height value. The horizontal and vertical components are combined to synthesize the optimal water injection point coordinates. Specifically, the horizontal component of the optimal water injection point coordinates is directly taken from the coordinates of the center position of the horizontal plane of the container, i.e., its X_center and Y_center; the vertical component is calculated as the bottom height coordinate of the container + the height of the container + the optimized hovering height value. The specific operation of calculating the motion parameters of the multi-degree-of-freedom regulating mechanism and driving the multi-degree-of-freedom regulating mechanism to position the water outlet to the optimal water injection point coordinates is as follows: The current spatial position coordinates of the water outlet are obtained. These coordinates are fed back in real time by photoelectric encoders or linear displacement sensors installed on the horizontal pull-out assembly and the vertical lifting assembly. The displacement difference between the optimal water injection point coordinates and the current spatial position coordinates of the water outlet in the horizontal direction is calculated. This horizontal displacement difference is decomposed into a horizontal lateral component difference and a horizontal longitudinal component difference. The displacement difference between the optimal water injection point coordinates and the current spatial position coordinates of the water outlet in the vertical direction is also calculated. The decomposition is based on the mechanical structure coordinate system of the horizontal pull-out assembly in the multi-degree-of-freedom adjustment mechanism. If the horizontal pull-out assembly is a cross slide structure, the horizontal lateral component difference corresponds to the X-axis movement, and the horizontal longitudinal component difference corresponds to the Y-axis movement. The horizontal and vertical component differences are converted into left and right movement distances and direction commands corresponding to the horizontal pull-out components in the multi-degree-of-freedom adjustment mechanism, respectively. The vertical displacement difference is converted into up and down movement distances and direction commands corresponding to the vertical lifting components in the multi-degree-of-freedom adjustment mechanism. The conversion is based on the transmission ratio and motor parameters of the horizontal pull-out components and the vertical lifting components. For example, if the slide moves 5 mm per revolution of the motor, the movement distance is divided by 5 mm and then multiplied by the number of pulses required per revolution of the motor to obtain the number of pulses to be sent to the driver. The direction command is determined by the sign of the displacement difference, with a positive value indicating a forward movement command and a negative value indicating a reverse movement command. Based on the converted direction and distance commands, corresponding pulse width modulation waveform signals or level direction signals are generated; for example, a STEP / DIR control signal containing the number of pulses, pulse frequency, and direction level is generated, and the generated signal is sent to the motor drivers of the horizontal pull-out component and the vertical lifting component; the motor driver is a stepper motor driver or a servo driver; The motor driver amplifies the received signal and drives the motor to produce corresponding linear motion of the horizontal pull-out component and the vertical lifting component, thereby linking the water outlet to perform a compound displacement until the distance between the end spatial position of the water outlet and the coordinates of the optimal water injection point is less than the preset positioning accuracy threshold. The preset positioning accuracy threshold is set according to the water injection accuracy requirements, usually between 1 mm and 3 mm, for example, 2 mm, to complete the positioning operation of the water outlet. The determination of positioning completion can be achieved by comparing the calculated remaining displacement difference with the positioning accuracy threshold, or by the position signal fed back by the driver.
[0022] In this embodiment, it is specifically necessary to explain the specific operation in step S3 of triggering the water quality sensor to obtain the water quality detection result and perform a safety judgment: After the water outlet is positioned, the controller immediately instructs the water quality sensor to perform a high-frequency sampling to obtain measured values of multiple water quality parameters, including total dissolved solids, pH, and turbidity. High-frequency sampling means continuously collecting no less than 10 data points within 100 milliseconds and taking the arithmetic mean as the measured value of the water quality parameter for that sampling. Subsequently, a preset safety evaluation model is invoked, based on the measured values of multiple water quality parameters, preset standard values corresponding to each water quality parameter; for example, the standard value for total dissolved solids is preset to 300 mg / L, the standard value for pH is preset to 7.0, the standard value for turbidity is preset to 1 NTU, and a variable tolerance parameter is dynamically determined according to a preset function relationship and is associated with the current target water injection volume of the container; the preset function relationship is, for example: variable tolerance parameter = basic tolerance parameter + proportional coefficient × current target water injection volume of the container; where the basic tolerance parameter for total dissolved solids can be set to 50 mg / L, and the proportional coefficient can be set to 0.01 per liter; The judgment process of the safety evaluation model includes: First, determining the various water quality parameters involved in the evaluation; for each water quality parameter, calculating the absolute value of the difference between the current measured value of the water quality parameter and the corresponding preset standard value; and then dividing the absolute value by the variable tolerance parameter to obtain the normalized deviation of the water quality parameter. Secondly, the normalized deviation of each water quality parameter is multiplied by a preset weighting coefficient, and all products are summed to obtain the cumulative weighted deviation. The preset weighting coefficients can be allocated according to the relative importance of the water quality parameters. For example, the weighting coefficient for total dissolved solids is set to 0.5, the weighting coefficient for pH is set to 0.3, and the weighting coefficient for turbidity is set to 0.2, with the sum of the three being 1. Finally, subtract the square root of the cumulative weighted deviation from the number one, and the result is used as a comprehensive evaluation value. The safety assessment conclusion is based on comparing this comprehensive evaluation value with a preset safety threshold. The safety threshold can be set to 0.85. If the comprehensive evaluation value is greater than or equal to the safety threshold, the safety assessment result is safe. If the comprehensive evaluation value is less than the safety threshold, the safety assessment result is abnormal. The process of issuing an alert, stopping water flow, and switching to a parallel backup water source, followed by re-executing step S2 or directly executing step S4 for the current container based on the dynamic task queue status, is as follows: First, after an anomaly is detected, two operations are performed simultaneously: First, an audible and visual alarm signal is triggered on the user interface to issue a warning; the audible and visual alarm signal includes controlling the red LED indicator to flash and the buzzer to sound, and recording detailed information including abnormal water quality parameters, the corresponding comprehensive evaluation value and the current container identifier in the event log; the event log is stored in the form of a text file with a timestamp or a database record. Second, immediately send a shut-off command to the outlet valve controlling the current main water supply pipeline to stop the water flow; Next, the water source switching decision is initiated, and the list of available parallel backup water sources is queried. Assuming there are several backup water sources, for each backup water source, the controller calculates its priority score. The calculation process is as follows: The historical average water quality health of the backup water source is obtained, calculated based on its past comprehensive evaluation records. The historical average water quality health can be the arithmetic mean of the comprehensive evaluation values from the most recent 10 tests, compared with the maximum possible difference. The maximum possible difference can be set to 1, since the theoretical maximum value of the comprehensive evaluation value is 1, and then multiplied by a first weighting coefficient. The first weighting coefficient can be set to 0.7, which is used to emphasize water quality health, plus the ratio of the estimated delay of the backup water source pipeline switching to the maximum possible difference. The first weighting coefficient can be set to 0.7, which is used to emphasize water quality health, and then multiplied by a second weighting coefficient. The second weighting coefficient can be set to 0.3, which is used to consider switching efficiency. The two products are added together to obtain the priority score of the backup water source, where the sum of the values of the first weighting coefficient and the second weighting coefficient is the number one. Compare the priority scores of all backup water sources and select the backup water source with the highest priority score as the switching target; Subsequently, the controller sends an opening command to the valve controlling the backup water source of the switching target and a closing command to the valve of the original main water supply pipeline, completing the switching from the abnormal water circuit to the parallel backup water source; the valve is usually a solenoid valve or an electric ball valve. Based on the relationship between the water source switching time and the preset delay threshold, select one of the following branches to execute: If the water source switching time is less than or equal to the delay threshold; the delay threshold can be set to 1 second, then based on the current state of the dynamic task queue, step S4 is executed directly; If the water source switching time is greater than the delay threshold, the current container in the dynamic task queue is kept in a pending state, and step S2 is re-executed for the current container. This is because the multi-degree-of-freedom adjustment mechanism may need fine-tuning, or there may be a very low probability of container disturbance during the waiting period. The controller will not delete the current task from the queue, but will keep its current container state and re-trigger the positioning operation.
[0023] In this embodiment, it is particularly important to explain the specific operation in step S4, which involves receiving the container liquid level information monitored in real time by the vision and ranging sensor array and the flow information monitored by the flow sensor, and then performing closed-loop water volume adjustment accordingly: After the safety assessment result is deemed safe, the controller reads the preset target water injection volume from the current container's record in the dynamic task queue and controls the outlet valve to open. After opening, two data acquisitions are performed simultaneously: Q1, receiving the flow information continuously reported by the flow sensor. The flow information is the instantaneous volumetric flow rate value, and its unit can be liters per second or milliliters per second, depending on the range and output specifications of the flow sensor. The controller needs to perform dimension conversion on the reading according to these specifications to keep the unit consistent with the target water injection volume. Q2, receiving the container liquid level height information obtained by the vision and ranging sensor array through continuous scanning and calculation of the container opening area. This container liquid level height information is determined based on the measurement data of the vision and ranging sensor array and the container bottom height coordinates in the geometric feature parameters. Based on the collected flow rate information and container liquid level information, the controller calls a fusion estimator to perform closed-loop water volume regulation. The fusion estimator operates based on a discrete-time state-space model, which contains two internal state variables: a first state variable that serves as the estimate of cumulative water volume, and a second state variable that serves as the estimate of lumped disturbances. The model's input is flow information, and its output is a fusion estimate of the cumulative water volume. Within each control cycle, the fusion estimator performs the following operations: First, based on the first state variable of the previous cycle and the flow information of the current cycle, it uses the discrete-time state equation to predict the first state variable of the current cycle. The calculation process of the discrete-time state equation is as follows: the first state variable of the current cycle is equal to the first state variable of the previous cycle plus the product of the flow information of the current cycle and the sampling time interval, plus a state increment caused by the second state variable of the previous cycle. Secondly, based on the container liquid level information and the currently estimated equivalent average cross-sectional area of the container, a visual volume estimate is calculated. Then, the difference between the predicted first state variable for the current period and this visual volume estimate is calculated to obtain the output error. The initial value of the container's equivalent average cross-sectional area is estimated based on the container diameter obtained from geometric feature parameters. Specifically, assuming the container cross-section is circular, the initial value of the container's equivalent average cross-sectional area is equal to π multiplied by the square of half the container diameter. For non-circular containers, the corresponding area formula can be selected based on their shape (e.g., elliptical, rectangular), or a proportional coefficient related to the diameter can be set empirically. Next, a preset observer gain matrix is used to amplify the output error, and the amplified result is used to correct the predicted first state variable, thereby generating the cumulative water volume fusion for the current period. The estimated value is updated simultaneously with the second state variable. The calculation process of the observer gain matrix is as follows: the update amount of the second state variable in the current period is equal to the product of the row vector corresponding to the second state variable in the observer gain matrix and the output error; the update amount of the cumulative water volume fusion estimate in the current period is equal to the product of the row vector corresponding to the first state variable in the observer gain matrix and the output error, plus the first state variable from the previous period; the parameters of the observer gain matrix are determined by the pole placement method to ensure the convergence speed and noise immunity of the estimator; the pole placement method is achieved by setting the desired poles of the observer at specific positions within the unit circle of the complex plane. For example, a pair of conjugate poles with a magnitude of approximately 0.8 to 0.95 can be set to obtain faster attenuation and appropriate noise suppression capability; the specific pole positions need to be determined through simulation or experiment, based on the sampling period, system bandwidth, and noise level. The controller compares the cumulative water volume estimate obtained in each cycle with the target injection volume to obtain the real-time water volume error. Based on this error, it calculates the control command to be sent to the outlet valve according to a nonlinear control law. This nonlinear control law includes a proportional control term and a feedforward compensation term. The proportional control term uses a hyperbolic tangent function to handle the real-time water volume error. The input of this hyperbolic tangent function is the real-time water volume error divided by a preset error scaling factor. The error scaling factor is used to normalize the real-time water volume error to a suitable order of magnitude. Its typical value can be set according to the order of magnitude of the target injection volume. For example, for injection volumes from hundreds of milliliters to liters, the error scaling factor can be set to 50 to 200 milliliters. Its specific value needs to be obtained through control parameter tuning to balance response speed and stability. The output increases monotonically with the increase of the input value, but the rate of increase gradually slows down, which provides a larger control action for rapid response when the error is large, and the control action automatically weakens when the error is close to zero to prevent overshoot oscillation; the feedforward compensation term divides the second state variable estimated by the fusion estimator in real time in the current cycle by a preset control gain coefficient; the control gain coefficient is used to map the lumped disturbance estimate to the corresponding control quantity compensation, and its value can be obtained through system identification or experimental tuning. For example, for a specific proportional valve, its value can be set to a constant between 0.1 and 1.0. The size of the control gain coefficient directly affects the strength of the feedforward compensation. If the coefficient is too large, it will introduce overshoot, and if it is too small, the compensation will be insufficient. The obtained quotient value is directly added to the control command to actively offset the disturbance effect; The controller dynamically adjusts the opening of the outlet valve according to this control command until the absolute value of the deviation between the cumulative water volume fusion estimate and the target water volume is less than a preset stop threshold. The stop threshold is set according to the water injection accuracy requirements, usually 0.5% to 2% of the target water volume. For example, for a target water volume of 500 ml, the stop threshold can be set to 5 ml. When the remaining deviation is less than this threshold, the controller considers the water volume to be accurate enough and can trigger the closing action, thereby closing the outlet valve and completing the quantitative water injection. The process of feeding back the final liquid level information to the dynamic task queue to update the geometric feature parameters of the corresponding container is as follows: After the outlet valve is closed and the liquid level stabilizes, the controller acquires the final liquid level height information inside the container through a visual and ranging sensor array. Liquid level stability means that within several consecutive sampling cycles (e.g., 5 times), the change in liquid level height information is less than a small fluctuation threshold (e.g., 0.5 mm), indicating that the water ripples have basically subsided and the measurement value is reliable. Combining the known and precisely injected target water volume, the controller performs model parameter update calculations. The model parameter update calculations divide the target water volume by the final liquid level height information, and the quotient obtained is the equivalent average cross-sectional area of the container derived when performing this water injection task. This calculation is based on a variation of the cylinder volume formula, assuming that the equivalent average cross-sectional area of the container remains constant during the water injection process. This assumption is usually reasonable for upright cylindrical containers within the normal water injection range. Subsequently, the controller uses the calculated equivalent average cross-sectional area of the container as a key correction parameter, feeding it back and writing it into the corresponding task entry record in the dynamic task queue to update the geometric feature parameters associated with the container. The update operation includes directly replacing the original estimated equivalent average cross-sectional area of the container, or using a weighted average to fuse the new calculated value with the original value. For example, the new area value = λ * the area calculated this time + (1-λ) * the original area, where λ is the learning rate factor (e.g., 0.3), to smooth out possible single measurement errors and gradually approximate the true value. This update makes... The container's geometric feature parameters stored internally by the system are more accurate. If the container reappears in the current dynamic task queue, or if the same or similar container is encountered in future operations, the container scale parameters used by the anti-splash optimization model in step S2 to calculate the optimal water injection point coordinates, and the initial value of the container's equivalent average cross-sectional area used by the fusion estimator in step S4 to perform closed-loop water volume adjustment, will all adopt the updated and more accurate geometric feature parameters. This will enable higher accuracy in subsequent positioning and quantitative control. This process allows the system to learn and optimize its own model through the execution process. Example
[0024] This embodiment provides, for example Figure 2 The smart faucet shown includes: The faucet body; A multi-degree-of-freedom adjustment mechanism is installed on the faucet body and connected to the spout. The multi-degree-of-freedom adjustment mechanism includes at least a horizontal pull-out component for driving the spout to move horizontally and a vertical lifting component for driving the spout to move vertically. A vision and ranging sensor array is installed on the faucet body to collect images, depth data and flow information of the water receiving area; A water quality sensor is installed on the side of the water outlet. A flow sensor, installed on the water supply pipeline, is used to monitor flow information; The outlet valve is installed on the water supply pipeline to control the on / off state; The controller is electrically connected to a multi-degree-of-freedom adjustment mechanism, a vision and ranging sensor array, a water quality sensor, a flow sensor, and an outlet valve; the controller is configured to execute an outlet control method.
[0025] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0026] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0027] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0028] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0029] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.
[0030] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0031] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for controlling water discharge, characterized in that, Specifically, the following steps are included: Step S1: After the controller is started, it collects images, depth data and flow information of the water receiving area through the vision and ranging sensor array and flow sensor. After fusion processing, it identifies the geometric feature parameters of at least one container. The geometric feature parameters include the height, diameter and spatial coordinates of the container. Based on this, a dynamic task queue containing the geometric feature parameters of each container is constructed. Step S2: For the current container in the dynamic task queue, calculate the optimal water injection point coordinates based on its geometric feature parameters and by calling the preset anti-splash optimization model. Specifically: First, extract geometric feature parameters from the record corresponding to the current container in the dynamic task queue; Subsequently, a preset anti-splash optimization model is invoked, taking the container's diameter, preset liquid density, preset initial outflow velocity, preset liquid surface tension coefficient, and gravitational acceleration constant as inputs. Based on fluid dynamics constraints, the anti-splash optimization model solves a dimensionless relationship, which represents that the product of the optimized hovering height value and the container's diameter is equal to the product of the liquid surface tension coefficient and the container's diameter, divided by the product of the liquid density and the gravitational acceleration constant, multiplied by a preset empirical coefficient, and finally added to a preset safety height constant value used to compensate for unmodeled factors. The optimized hovering height value is obtained by solving this dimensionless relationship. Finally, the horizontal component of the optimal water injection point coordinates is determined based on the coordinates of the center position of the horizontal plane. The vertical component of the optimal water injection point coordinates is generated by summing the coordinates of the bottom height of the container, the height of the container, and the calculated optimized hovering height value. The horizontal and vertical components are combined to synthesize the optimal water injection point coordinates. Based on this, the motion parameters of the multi-degree-of-freedom adjustment mechanism are calculated, and the multi-degree-of-freedom adjustment mechanism is driven to position the water outlet to the optimal water injection point coordinates; Step S3: After positioning, the water quality sensor is triggered to obtain the water quality detection results and make a safety judgment; If an anomaly is detected, the process of issuing an alert, stopping water flow, and switching to a parallel backup water source is executed. Subsequently, based on the dynamic task queue status, step S2 is re-executed for the current container or step S4 is executed directly. If the process is deemed safe, execution continues. Step S4: Control the water outlet valve to open to achieve quantitative water injection. During this process, receive the container liquid level information monitored in real time by the vision and ranging sensor array and the flow information monitored by the flow sensor. Based on this, perform closed-loop water volume adjustment. After completion, feed back the final liquid level information to the dynamic task queue to update the geometric feature parameters of the corresponding container.
2. The water outlet control method according to claim 1, characterized in that: In step S1, the controller synchronously triggers the visual and ranging sensor array and the flow sensor to collect images, depth data and flow information of the water contact area. Subsequently, the acquired images are processed using a preset instance segmentation model to segment the pixel-level mask corresponding to each container instance in the water-receiving area and output the category confidence of each pixel-level mask; at the same time, the depth data is converted into a 3D point cloud of the water-receiving area according to a preset coordinate transformation relationship. Then, the pixel-level mask of each container instance is mapped onto this 3D point cloud, thereby separating and extracting the independent 3D point cloud subsets belonging to each container.
3. The water outlet control method according to claim 2, characterized in that: The specific operation of parsing the geometric feature parameters of the container based on the independent 3D point cloud subset and constructing a dynamic task queue is as follows: For each independent 3D point cloud subset of the container, analyze the parameters that constitute the geometric feature parameters: First, determine the spatial coordinates of the container: calculate the geometric center of the projection area of the independent 3D point cloud subset on the horizontal plane, and obtain the coordinates of the center of the horizontal plane; traverse all points in the independent 3D point cloud subset and find the vertical height value with the smallest value, and use it as the height coordinate of the bottom of the container; the spatial coordinates are composed of the coordinates of the center of the horizontal plane and the height coordinates of the bottom of the container. Next, determine the height of the container: traverse all points in the independent 3D point cloud subset, find the vertical height value with the largest value, calculate the difference between this maximum vertical height value and the height coordinate of the bottom of the container, and this difference is the height of the container. Next, determine the container's diameter: filter out all points in the independent 3D point cloud subset whose vertical height values are within the preset range at the top, and perform circular or elliptical fitting on the selected points in the horizontal plane. The longer diameter in the fitted figure is the container's diameter. After completing the parsing operation for all identified containers, a task entry is created for each container. The task entry records at least the container identifier, all parsed geometric feature parameters, the preset target water injection volume, and an initial flag indicating that the task has not yet started execution. Finally, all task entries are arranged in a preset order to form a dynamic task queue.
4. The water outlet control method according to claim 3, characterized in that: The specific operation of calculating the motion parameters of the multi-degree-of-freedom adjustment mechanism and driving the multi-degree-of-freedom adjustment mechanism to position the water outlet to the optimal water injection point coordinates is as follows: Obtain the current spatial coordinates of the water outlet, calculate the horizontal displacement difference between the optimal water injection point coordinates and the current spatial coordinates of the water outlet, decompose the horizontal displacement difference into the horizontal lateral component difference and the horizontal longitudinal component difference, and calculate the vertical displacement difference between the optimal water injection point coordinates and the current spatial coordinates of the water outlet. The difference between the horizontal and vertical components is converted into the left and right movement distance and direction commands corresponding to the horizontal pull-out component in the multi-degree-of-freedom adjustment mechanism, and the difference between the vertical displacement is converted into the up and down movement distance and direction commands corresponding to the vertical lifting component in the multi-degree-of-freedom adjustment mechanism. Based on the converted direction and distance commands, the corresponding pulse width modulation waveform signal or level direction signal is generated and sent to the motor drivers of the horizontal pull-out component and the vertical lifting component. The motor driver amplifies the received signal and drives the motor to produce corresponding linear motion of the horizontal pull-out component and the vertical lifting component, thereby linking the water outlet to perform a composite displacement until the distance between the end spatial position of the water outlet and the optimal water injection point coordinates is less than the preset positioning accuracy threshold, thus completing the positioning operation of the water outlet.
5. The water outlet control method according to claim 4, characterized in that: In step S3, the specific operation of triggering the water quality sensor to obtain the water quality detection result and perform a safety judgment is as follows: After the water outlet is positioned, the controller immediately instructs the water quality sensor to perform a high-frequency sampling to obtain measured values of multiple water quality parameters, including total dissolved solids, pH, and turbidity. Subsequently, the preset safety evaluation model is invoked, based on the measured values of multiple water quality parameters, the preset standard values corresponding to each water quality parameter, and a variable tolerance parameter that is related to the current target water injection volume of the container and dynamically determined according to a preset functional relationship. The judgment process of the safety evaluation model includes: First, determining the various water quality parameters involved in the evaluation; for each water quality parameter, calculating the absolute value of the difference between the current measured value of the water quality parameter and the corresponding preset standard value; and then dividing the absolute value by the variable tolerance parameter to obtain the normalized deviation of the water quality parameter. Secondly, the normalized deviation of each water quality parameter is multiplied by a preset weighting coefficient, and all the product results are summed to obtain the cumulative weighted deviation. Finally, subtract the square root of the cumulative weighted deviation from the number one, and the result is used as a comprehensive evaluation value. The safety assessment conclusion is based on comparing the comprehensive evaluation value with a preset safety threshold. If the comprehensive evaluation value is greater than or equal to the safety threshold, the safety assessment result is safe; if the comprehensive evaluation value is less than the safety threshold, the safety assessment result is abnormal.
6. The water outlet control method according to claim 5, characterized in that: The process of issuing an alert, stopping water flow, and switching to a parallel backup water source, followed by re-executing step S2 for the current container based on the dynamic task queue status or directly executing step S4, is as follows: First, after an anomaly is detected, two operations are performed simultaneously: First, trigger an audible and visual alarm signal on the user interface to issue a warning, and record detailed information including abnormal water quality parameters, corresponding comprehensive evaluation values and the current container identifier in the event log; Second, immediately send a shut-off command to the outlet valve controlling the current main water supply pipeline to stop the water flow; Next, the water source switching decision is initiated, and the list of available parallel backup water sources is queried. For each backup water source, the controller calculates its priority score. The calculation process is as follows: The historical average water quality health of the backup water source is obtained and calculated based on its past comprehensive evaluation value records. It is then compared with the maximum possible difference and multiplied by the first weighting coefficient. The ratio of the estimated delay of the backup water source pipeline switching to the maximum possible difference is added and multiplied by the second weighting coefficient. The two products are added together to obtain the priority score of the backup water source. Compare the priority scores of all backup water sources and select the backup water source with the highest priority score as the switching target; Subsequently, the controller sends an opening command to the valve controlling the backup water source of the switching target and a closing command to the valve of the original main water supply pipeline, thus completing the switching from the abnormal water circuit to the parallel backup water source. Based on the relationship between the water source switching time and the preset delay threshold, select one of the following branches to execute: If the water source switching time is less than or equal to the delay threshold, then based on the current state of the dynamic task queue, step S4 is executed directly. If the time taken to switch water sources exceeds the delay threshold, the pending state of the current container in the dynamic task queue is maintained, and step S2 is re-executed for the current container.
7. The water outlet control method according to claim 6, characterized in that: In step S4, the specific operation of receiving the container liquid level information monitored in real time by the vision and ranging sensor array and the flow information monitored by the flow sensor, and adjusting the closed-loop water volume accordingly, is as follows: After the safety assessment result is deemed safe, the controller reads the preset target water injection volume from the dynamic task queue and controls the outlet valve to open; it simultaneously collects the flow information reported by the flow sensor, as well as the container liquid level height information determined based on the bottom height coordinates of the container obtained by the vision and ranging sensor array. Based on the collected flow rate information and container liquid level information, the controller calls a fusion estimator to perform closed-loop water volume regulation. The fusion estimator operates based on a discrete-time state-space model, which contains two internal state variables: a first state variable that serves as the estimate of cumulative water volume, and a second state variable that serves as the estimate of lumped disturbances. The model's input is flow information, and its output is a fusion estimate of the cumulative water volume. Within each control cycle, the fusion estimator performs the following operations: First, based on the first state variable of the previous cycle and the flow information of the current cycle, it uses discrete-time state equations to predict the first state variable of the current cycle. Secondly, based on the container liquid level information and the currently estimated equivalent average cross-sectional area of the container, the visual volume estimate is calculated. Then, the difference between the predicted first state variable of the current period and the visual volume estimate is calculated to obtain the output error. Next, the output error is amplified using a preset observer gain matrix, and the amplified result is used to correct the predicted first state variable, thereby generating the cumulative water volume fusion estimate of the current period, while updating the second state variable. The controller compares the cumulative water volume fusion estimate obtained in each cycle with the target water injection volume to obtain the real-time water volume error, and calculates the control command to be sent to the outlet valve based on a nonlinear control law. The nonlinear control law includes a proportional control term and a feedforward compensation term. The proportional control term uses a hyperbolic tangent function to handle the real-time water volume error. The feedforward compensation term divides the second state variable estimated by the fusion estimator in the current cycle by a preset control gain coefficient, and directly adds the quotient to the control command. The controller dynamically adjusts the opening of the outlet valve according to this control command until the absolute value of the deviation between the cumulative water volume fusion estimate and the target water volume is less than a preset stop threshold, and then closes the outlet valve to complete the quantitative water injection.
8. The water outlet control method according to claim 7, characterized in that: The process of feeding back the final liquid level information to the dynamic task queue to update the geometric feature parameters of the corresponding container is as follows: After the outlet valve is closed and the liquid level stabilizes, the controller obtains the final liquid level height information in the container through the vision and ranging sensor array. Combined with the known and precisely injected target water volume, the controller performs model parameter update calculation. The model parameter update calculation divides the target water volume by the final liquid level height information, and the resulting quotient is the equivalent average cross-sectional area of the container derived when performing this water injection task. Subsequently, the controller uses the calculated equivalent average cross-sectional area of the container as a key correction parameter, feeds it back, and writes it into the task entry record corresponding to this container in the dynamic task queue, in order to update the geometric feature parameters associated with the container.
9. A smart faucet, characterized in that, include: The faucet body; A multi-degree-of-freedom adjustment mechanism is installed on the faucet body and connected to the spout. The multi-degree-of-freedom adjustment mechanism includes at least a horizontal pull-out component for driving the spout to move horizontally and a vertical lifting component for driving the spout to move vertically. A vision and ranging sensor array is installed on the faucet body to collect images, depth data and flow information of the water receiving area; A water quality sensor is installed on the side of the water outlet. A flow sensor, installed on the water supply pipeline, is used to monitor flow information; The outlet valve is installed on the water supply pipeline to control the on / off state; The controller is electrically connected to the multi-degree-of-freedom adjustment mechanism, the vision and ranging sensor array, the water quality sensor, the flow sensor, and the outlet valve, respectively. The controller is configured to perform a water outlet control method as described in any one of claims 1-8.
Citation Information
Patent Citations
Water supply plant water production process unit dosing method, system and equipment based on intelligent sensing and self-adaptive regulation and control and medium
CN120065935A
Water plant whole-process intelligent monitoring and control method and system based on large model
CN122151729A