Water level sensor detection control method
Patent Information
- Application Number
- CN202610615690.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-07
- Publication Date
- 2026-08-18
AI Technical Summary
然而现在市场上使用的传感器质量参差不齐,其可靠性也待验证,并且大多数使用时都是依靠实车使用后才知道该传感器的实际质量如何,不确定性偏高,同时,现在传感器款式和品种越来越多,如果企业想采购多种传感器应用在多款车型上,亟需有一种装置和控制方法来对各类传感器的可靠性和耐久性进行检测
[0022] 1. This invention first utilizes the water level height measured by a standard sensor to set a full-level threshold and a lower-level threshold to effectively control the outlet water valve and the inlet water pump, enabling automatic water circulation inside the water tank and simulating the water level changes in a real vehicle. Simultaneously, it automates and intelligently completes the entire testing process, requiring minimal manual intervention and automatically generating test results. Furthermore, it thoroughly breaks down the various scenarios during system startup, taking into full account all possible situations, potential problems, and system bugs, thus accurately recording experimental data and providing reliable comparative and supporting data for the testing of the sensor under test.
Smart Images

Figure CN122593437A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sensor detection technology, and in particular to a water level sensor detection and control method. Background Technology
[0002] With the development of sanitation vehicles, water level sensors are being used more and more widely on sanitation vehicles. Some vehicles are even equipped with multiple water level sensors for water level monitoring to ensure that the upper structure can still operate normally even if one sensor is damaged, while also protecting the water pump motor. Therefore, the reliability and durability of water level sensors are crucial for the normal operation of vehicles. However, currently, sanitation vehicles of this type frequently experience malfunctions due to inaccurate sensor readings, leading to false water level alarms. In some cases, the water tank level shows as full even when it is low, meeting the operating conditions. In such situations, the water pump motor continues to operate, causing the pump to run dry and become damaged, posing a serious safety hazard. In other cases, the actual water tank level meets the operating conditions, but a false alarm for low water levels prevents the upper structure from functioning, affecting the normal work of the personnel. Both of these situations are common malfunctions in water-related vehicles used in the sanitation field. The former has serious consequences, not only damaging the water pump but also posing a serious safety hazard, while the latter affects operational efficiency. Currently, resolving these malfunctions generally requires after-sales personnel to replace the sensor on-site, significantly increasing after-sales costs. Currently, some companies purchase different sensors for comparison. However, many water level sensors on the market require testing to verify their reliability and durability. Often, there's a lack of methods and equipment for such testing, leading to direct application to actual vehicles for verification. This not only causes more after-sales issues but also makes it difficult to avoid the aforementioned problems. Other companies may be working on bench testing of their sensors, but these benches are typically semi-automatic, requiring manual operation to start and stop, manually simulate real-vehicle environments, or monitor sensors in a static environment. This makes it difficult to achieve fully automated monitoring of the sensors under test.
[0003] Currently, water level sensors on the market can be divided into two main categories: digital water level sensors and analog sensors. The former primarily detects whether a container has water, while the latter detects the water level height. In the sanitation vehicle sector, these two types of sensors are the main tools for monitoring water level height, primarily used in water-related sanitation vehicles such as sprinkler trucks, sweeper trucks, and road maintenance trucks. Their function is to monitor water level height, thereby enabling closed-loop control of the water pump motor and various solenoid valves. This provides early warning when water is insufficient and protects the water pump, extending its lifespan, reducing after-sales costs, and improving vehicle intelligence. However, the quality of sensors used in the market varies greatly, and their reliability needs to be verified. Furthermore, the actual quality of a sensor is often only determined after testing it in a real vehicle, leading to high uncertainty. At the same time, with the increasing variety of sensor types and models, companies wishing to purchase multiple sensors for use in various vehicle models urgently need a device and control method to test the reliability and durability of various sensors. While some companies are doing this, most of their testing methods are quite basic. Some use static water tanks for testing, while others use dynamic testing, but these methods rarely accurately simulate the conditions of a real vehicle. Furthermore, devices for detecting water level sensors are extremely rare. Summary of the Invention
[0004] To address the problems existing in the prior art, the purpose of this invention is to provide a water level sensor detection and control method. This invention can accurately record test data and provide reliable comparison and support data for the testing of the sensor under test.
[0005] To achieve the above objectives, the technical solution adopted by this invention is: a water level sensor detection and control method, comprising: setting a reference sensor and multiple analog and digital sensors to be detected at the same horizontal level near the bottom of a water tank; the reference sensor collects water level data of the water tank, and controls the working sequence of the water tank inlet valve and outlet valve by comparing the set water level height with the actual water level height, thereby realizing the water level cyclic change process of the water tank; simultaneously, the water level height data collected by the reference sensor is statistically analyzed, and water level height data at the same time and position are collected synchronously, dividing the water tank water level height into multiple nodes; for analog sensors, the variance of each analog sensor within a set number of cycles is calculated at each node, and then compared with a set reasonable variance, and if it exceeds the set variance, it is judged as unqualified; for digital sensors, the number of opening and closing times of the inlet and outlet valves is compared with the number of triggering times of the digital sensor, and a reasonable deviation number is set, and if it exceeds the reasonable deviation number, it is judged as unqualified.
[0006] As a further improvement to the present invention, the specific process of realizing the water level circulation change in the water tank is as follows:
[0007] According to the water level height value detected by the reference sensor, compare the actual water level height H with the set water level full threshold Hh and the water level low threshold Hl:
[0008] At startup, if H >= Hh, it means the system is in a full water level state. After startup, initialize the water filling pump to 0, that is, turn it off. After waiting for the preset time of the timer, the water outlet valve is powered on and starts to discharge water. When the actual water level value H keeps decreasing until H <= Hl, the water outlet valve closes. At this time, the water filling pump is powered on and starts to fill water. The water level starts to increase from the low level until H >= Hh, the system pauses for the preset time, and then controls the water level change in a cyclic manner;
[0009] At startup, if H <= Hl, after startup, the water filling pump is powered on and the system starts to fill water. When the water level starts to increase from the low level until H >= Hh, stop filling water. At this time, trigger the timer to count the preset time. After the end, the water outlet valve is powered on and the system starts to discharge water. The water level starts to change cyclically in this way;
[0010] At startup, if Hl < H < Hh, the water filling pump is directly opened and the system directly fills water. When the water level height H of the water tank changes to H >= Hh, the system stops filling water into the water tank. After the timer counts the preset time, the system starts to control the water outlet valve to open until H <= Hl, and the system starts to work cyclically.
[0011] As a further improvement of the present invention, at startup, if Hl < H < Hh, the system uses a state variable to save whether it is in the water filling state or the water discharging state currently, and stores it in the ferroelectric data area. If the system stops working or is directly powered off during the interval of Hl < H < Hh, according to the recorded water filling or water discharging state, continue the corresponding water filling or water discharging operation based on the previous situation.
[0012] As a further improvement of the present invention, before realizing the cyclic change of the water level in the water tank, it further includes:
[0013] First, judge the state of the reference sensor to see if there is an abnormal fault, that is, whether the current value of the reference sensor is lower than the lower limit value or higher than the upper limit value. If it is within the normal value range, it means the reference sensor is normal, and then realize the cyclic change of the water level in the water tank.
[0014] As a further improvement of the present invention, the method for judging whether a digital quantity sensor is qualified is specifically as follows:
[0015] The number of triggers of multiple digital sensors under test is counted throughout the entire test cycle. At the same time, the number of times the water outlet valve is opened and the number of times the water pump is started are counted as one complete cycle number N. This cycle number is used as the comparison standard for the trigger number of digital sensors. After setting the allowable deviation number CI, if the difference between the cycle number and the trigger number M of each digital sensor is less than or equal to CI, it is considered qualified. If the difference is greater than CI, it is considered unqualified. That is, it is judged whether N-Mi is greater than CI. If it is true, it is unqualified; if it is not true, it is qualified.
[0016] As a further improvement of the present invention, the method for determining whether an analog sensor is qualified is as follows:
[0017] The system calculates water level height data from a control sensor and multiple tested analog sensors in real time. At each node, the water level height value for each analog sensor is calculated. In one water level cycle, each analog sensor calculates the water level height twice at each point. Therefore, the total number of calculations for each sensor at each point is twice the number of cycles, i.e., 2N. The system calculates the sample variance of each sensor at each node relative to the control sensor. An acceptable variance value is set to determine the pass / fail status of the analog sensors. The variance is set as Sset. First, at each node: the average value of the control sensor is Avgi = (Hi1 + Hi2 + ... + Hi2N) / 2N, where Avgi represents the average water level height of the control sensor over all cycles at the node, and i represents the node. The variance formula for the analog sensors corresponding to each node is: To calculate the variance of each sensor, where j represents the number of all height statistics for each analog sensor at that node, k represents the variance for each analog sensor, n is 2N, and x... ijk This represents the 2N data points corresponding to each sensor at each node. This represents the average water level height from the control sensor at each node, i.e. =Avgi, therefore the variance of each analog sensor at each node can be obtained;
[0018] As a further improvement of the present invention, the difference between the variance of the analog sensor at each node and the set variance is used. Set as T ij The deviation between the number of triggers and the number of cycles of the digital sensor is set to C, which is the set allowable deviation value. jTij and Cj represent the state of the sensor. The sensor's qualification can be directly determined by this state. The state matrix T is generated by combining Tij and Cj to record the state values of each sensor in the entire reliability and durability testing process, thereby determining whether the analog or digital sensor is qualified.
[0019] As a further improvement of the present invention, it also includes: synchronously collecting and saving the data of all analog and digital sensors once at a preset time interval to the local storage, so that the data source can be viewed in real time. If a defective sensor is encountered, the abnormal situation can be found out at what time and corresponding cycle number by viewing the original data.
[0020] In this invention, the water level circulation of the entire detection system utilizes the water level height measured by a standard reference sensor. Full-level and lower-level thresholds are set to effectively control the outlet valve and inlet pump, enabling automatic water circulation within the tank and simulating real-vehicle water level changes. Secondly, the previous operating state of the outlet valve and pump is recorded and stored. When the water level is neither above full level nor below the lower limit, this serves as the condition for restarting the system, preventing inaccuracies in the count of cycle times and zero-level sensor drops, and avoiding the inability to start the system when the water level is in the middle range. A pause function is added to the system control. When the system needs to replace the tested sensor or undergo maintenance, it can be temporarily paused without stopping the entire system. When the pause is canceled and the system resumes operation, it can directly continue the previous steps without judging numerous conditions and status values. Furthermore, the system water level is divided into multiple intervals, and the variance of each sensor data is calculated at each node to determine whether the sensor is qualified.
[0021] The beneficial effects of this invention are:
[0022] 1. This invention first utilizes the water level height measured by a standard sensor to set a full-level threshold and a lower-level threshold to effectively control the outlet water valve and the inlet water pump, enabling automatic water circulation inside the water tank and simulating the water level changes in a real vehicle. Simultaneously, it automates and intelligently completes the entire testing process, requiring minimal manual intervention and automatically generating test results. Furthermore, it thoroughly breaks down the various scenarios during system startup, taking into full account all possible situations, potential problems, and system bugs, thus accurately recording experimental data and providing reliable comparative and supporting data for the testing of the sensor under test.
[0023] 2. This invention simulates real-vehicle water level changes using a relatively high-cost and high-quality standard control sensor to monitor the water tank level. The data collected by this sensor is used to effectively control the inlet and outlet valves, achieving automatic water level circulation control. The user simply clicks to start the system, which automatically simulates real-vehicle water level changes. Pausing and restarting resumes the actions from before the pause. Simultaneously, various sensors are installed on the water tank for monitoring. Two types of sensors are tested: analog and digital. Data from each sensor is collected, analyzed, and compared to determine sensor quality. Therefore, this invention enables reliability and durability testing of the sensors used, allowing for early detection of sensor quality and avoiding after-sales problems caused by sensor instability during real-vehicle application. It also improves the stability of sanitation vehicles, providing users with a better driving experience. Attached Figure Description
[0024] Figure 1 This is a flowchart of an embodiment of the present invention. Detailed Implementation
[0025] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0026] Example
[0027] Explanation of relevant terms:
[0028] Water level sensor: A device for monitoring the water level in a water tank;
[0029] Closed-loop control: The sanitation vehicle water pump starts when the water level detected by the sensor is greater than the starting value, and automatically stops when the water level falls below the stopping value;
[0030] Sensor reliability: The stability of the sensor used, that is, the water level value collected must be consistent with the actual water level height;
[0031] Sensor reliability: the lifespan of the sensor;
[0032] Automatic simulation: The sensor detection device is capable of automatically simulating the actual water level changes of a real vehicle.
[0033] Analog sensors: The output type is analog, such as voltage output of 0-5V, current output of 4-20mA, etc.
[0034] Digital sensor: A sensor whose output type is either high level or low level, that is, a sensor with only two states.
[0035] like Figure 1As shown, a water level sensor detection and control method first sets up a reference sensor and multiple analog and digital sensors to be tested at the same horizontal level near the bottom of the water tank. Water level data from the water tank is collected through the standard reference sensor. By comparing the set water level height with the actual water level height, the working sequence of the inlet and outlet valves is automatically controlled to realize the cyclical change process of the water level in the tank throughout the detection system. By adding pause and cycle count functions, the system can be paused and automatically stopped at any time, thereby achieving automatic detection of the water level sensor under test, enabling both reliability and durability testing. Simultaneously, water level data collected by the sensors are statistically analyzed, and water level data at the same time and location are collected synchronously. The water level of the entire tank is divided into 5 nodes. For analog sensors, the variance of each sensor within a set number of cycles is calculated at each node and compared with a set reasonable variance. If the variance exceeds the set variance, the sensor is considered unqualified. For digital sensors, the number of opening and closing cycles of the inlet and outlet valves is compared with the number of trigger cycles of the digital sensor. A reasonable deviation is set, and if the deviation exceeds the set number, the sensor is considered unqualified. In addition to the above data analysis, data from all sensors is collected once per second and saved locally for real-time data source viewing. If a sensor fails, the original data can be reviewed to determine the time and corresponding cycle number at which the anomaly occurred. By conducting reliability and durability testing on these sensors, sensor screening can be performed before mass application, which can significantly reduce the increase in after-sales costs caused by batch reliability or lifespan issues of sensors. It also reduces the number of sensor types used in actual vehicle applications, facilitating standardization.
[0036] The specific implementation process and working principle of this embodiment will be further explained below:
[0037] The entire detection system is divided into two processes: water inlet and water outlet, to achieve the cyclical change of water level in the tank. The water inlet pump is set to Vi, and the water outlet valve is set to Vo. The sensor data is read from five points, with corresponding reference sensor data P at these five points. The data from analog sensor 1 is read as P1, the data from analog sensor 2 is read as P2, the data from analog sensor 3 is read as P3, and the data from analog sensor 4 is read as P4. There are also four digital sensors, namely I1, I2, I3, and I4.
[0038] First, regarding the technical solution of the circulation system, by reading the number of cycles n set on the upper screen and clicking "start" on the screen, the system first judges the status of the standard sensor to see if there is any abnormality or fault, that is, whether the sensor current value is lower than the lower limit or higher than the upper limit. If it is within the normal range, it means that the sensor is normal. Therefore, the second step begins: based on the water level height value detected by the reference sensor, the actual water level height H is compared with the set full water level threshold Hh (in this invention, the simulated actual vehicle height is set to 150cm) and the low water level threshold Hl (set to 8cm) (Hh is always greater than Hl).
[0039] If H>=Hh, it indicates that the system is at full water level. Upon startup, the water pump is initialized to 0 (i.e., shut down). Simultaneously, the actual water level and the low water level threshold (H>Hl) must always be true. The system waits for a 60-second timer before the outlet valve is energized and water begins to flow. The water level then begins to decrease, simulating the actual vehicle water level change. During this process, if a pause signal is triggered, water flow stops. After canceling the pause, the system resumes energizing the outlet valve. If a stop signal is triggered, the outlet valve also stops. Upon restarting, the above conditions need to be re-evaluated. As the actual water level H decreases until H<=Hl, the outlet valve closes. At this point, the water pump is energized and begins to flow water, increasing the water level from the low level until H>=Hh. The system then pauses for 60 seconds and repeats the water level control cycle.
[0040] If the water level H <= Hl at startup, it indicates that the system is in a low water level state. After clicking start, the water pump is energized and the system starts adding water. If the pause switch is triggered during this process, the system pauses and water addition stops. After canceling the pause, the system resumes adding water. As the water level increases from the low level, it stops adding water when H >= Hh. At this time, the timer is triggered for 60 seconds. After the timer expires, the outlet valve is energized and the system starts discharging water. The water level changes in this cycle.
[0041] The above two cases respectively consider the situations where the actual water level H >= Hh and H <= Hl when the system starts. These two cases are relatively intuitive and easy to control. At this time, the considered water level height intervals are not continuous, only the two end cases are considered. In addition to the above two cases, the case of Hl < H < Hh should also be included. Because when the water level changes to this interval, the entire system may be directly stopped manually. Whether it decreases from a high level to this interval or increases from a low level to this interval, there may be a sudden power outage or stop. If only following the above control logic, when power is restored and the start button is clicked, the actual water level H is neither greater than or equal to Hh nor less than or equal to Hl. At this time, the entire system cannot start and will become paralyzed. Therefore, to avoid such serious Bug problems, the system now additionally considers the water level in the middle section. First, when the system is initially used, the system defaults to the water addition state. At this time, if the water level is in the interval Hl < H < Hh, the water addition pump is directly turned on and the system directly adds water. At this time, the system will use a state variable to save whether it is currently in the water addition state or the water discharge state, and store it in the ferroelectric data area (the latest state value can be saved when power is off). If the system stops working or the power is directly cut off when in this interval and the saved state value is the water addition state, then after restarting, the recorded state is the water addition state, and the system will continue to add water based on the previous situation. When the water level height H of the water tank changes to H >= Hh, the system stops adding water to the water tank. Similarly, the timer counts for 60s. After the timing ends, the system starts to control the opening of the water discharge valve, and the water level of the water tank starts to drop. If the system stops working or the power is cut off during this process and the recorded state is the water discharge state, then after restarting, the system determines that the water discharge from the water tank is interrupted, continues to open the water discharge valve, and the water level of the water tank continues to drop until H <= Hl, and the system starts to work in a cycle.
[0042] It should be noted that whether it is during the water addition process or the water discharge process, as long as the pause signal of the upper-mounted screen is triggered, the corresponding process will stop. When the pause is cancelled, the corresponding process will directly resume without rejudgment. When the water level of the water tank is in the interval Hl < H < Hh and the system stops working, it will record whether it is stopped during water addition or water discharge. Therefore, the next step will continue with the unfinished steps before, which can be understood as an advanced version of the pause function.
[0043] If the water valve state is not memorized and stored, after power-on or restart, the system will initialize the un-stored variables. Whether the system stopped during the water filling or water discharging process, after restart, the system always meets the water discharging condition that the water level is greater than the low threshold, i.e., H > Hl. Then, after each restart of the system, it will start to cycle from the water discharging step. Although this can implement the function and enable the entire detection system to operate normally, and the water level will eventually change cyclically, when the system receives the set number of cycles, the number of times the standard sensor in the water tank triggers the low water level is used to represent one cycle, and the remaining number of cycles of the system is the set number of cycles minus one each time. In fact, the actual number of cycles executed by the system is not the complete set number of cycles. Similarly, the count of each complete cycle is inaccurate. Therefore, using the number of cycles to compare the number of triggers of the digital quantity sensor to determine whether the digital quantity sensor is reliable is inaccurate. Since the cycle count is incorrect, the count of the low water level triggers of the standard sensor is also incomplete, and thus it cannot measure the accuracy of the digital quantity sensor.
[0044] The purpose of the above-described process of stopping water filling when the water level increases to the full level and then timing for 60s before opening the water discharging valve to discharge water is to keep the water level in the water tank at the full level for a period of time to detect the reliability of the sensor at the full level. When the water level drops to the low level, no delay processing is performed. After reaching the low level condition, the water discharging valve is directly stopped, and the water pump is started to fill water. At the same time, the reference sensor used is a special sensor with a high cost and extremely high precision. The measured data has been repeatedly verified and is consistent with the actual water level data. Therefore, it is used as the reference sensor.
[0045] For the reliability detection of digital quantity sensors, each type of sensor should have a maximum lifespan value, which is uniformly replaced by the set maximum number of cycles. If data is statistically counted within this maximum number of cycles and the sensor is also determined to be qualified after exceeding the maximum number of cycles, first, the trigger times of sensors I1 to I4 throughout the test period are statistically counted. At the same time, the number of times the water discharging valve is opened and the number of times the water pump is started are also statistically counted as the number of times of a complete cycle N. This cycle count is used as the comparison standard for the trigger times of the digital quantity sensor. When the set allowable deviation count CI is set, if the difference between the cycle count and the trigger times M of each digital quantity is less than or equal to CI, it indicates that it is qualified. If the difference is greater than CI, it is reported as unqualified, that is, N - Mi > CI? If it holds, it is unqualified; if it does not hold, it is qualified.
[0046] For analog sensors, the water level data of the reference sensor and the tested sensor P1, P2, P3, and P4 are first calculated in real time. The entire water storage container is divided into 5 segments: L1, L2, L3, L4, and L5. At each segment node, the water level value of each sensor is calculated. In one water level cycle, each sensor will calculate the water level twice at each point. Therefore, the total number of calculations for each sensor at each point is twice the number of cycles, i.e., 2N. To test the reliability of each sensor at each node, the calculation of each sensor's water level at each point is performed. The system uses the sample variance of the control sensor at each node to determine whether the sensor is qualified or not by setting an acceptable variance value. The variance is set as Sset. First, at each node: the average value of the control sensor is Avgi = (Hi1 + Hi2 + ... + Hi2N) / 2N, where Avgi represents the average water level height of the control sensor over all cycles at the node, Hi1 represents the first height value at the node, Hi2 represents the second height value, and so on, with the value of i varying in the range of [1,5]. The variance formula for the sensor corresponding to each node is: To calculate the variance for each sensor, where i represents a node, j represents the number of height statistics for each sensor at that node, k represents each sensor, n is 2N, and x... ijk This represents the 2N data points corresponding to each sensor at each node. This represents the average water level height from the control sensor at each node, i.e. =Avgi, therefore the variances of sensors P1-P4 at node L1 can be obtained as follows: , , , The variances at node L2 are as follows: , , , The variances at node L3 are as follows: , , , The variances at node L4 are as follows: , , , The variances at node L5 are as follows: , , , .
[0047] In the entire testing system, if the deviation between the trigger count and the cycle count of the digital sensor under test exceeds the set allowable deviation value, or if the variance of the analog sensor at each node compared to the control sensor exceeds the set allowable variance value, the system will determine that the sensor is unqualified. The remaining cycle count is then fed back using the data measured by the control sensor, thereby enabling the system to automatically stop operating.
[0048] In this scheme, the difference between the variance of the analog sensor at each node and the set variance is used. Set as T ij The deviation between the number of triggers and the number of cycles of the digital sensor is set to C, which is the set allowable deviation value. j Since Tij and Cj both represent the sensor's state, and the sensor's qualification can be directly determined from this state, they are combined to generate a state matrix T[6×4] (6 rows and 4 columns), which is used to record the state values of each sensor throughout the reliability and durability testing process, thereby determining whether the sensor is qualified. Therefore, the state matrix T[6×4] is:
[0049]
[0050] In the state matrix above, the first 5 rows T 1j ~T 5j The values represent the states of the analog sensor at the five nodes, in line 6, T. 6j The states of digital sensors are represented as follows: T11~T14 represent the states of analog sensors P1, P2, P3, and P4 at node L1; T21~T24 represent the states of analog sensors P1, P2, P3, and P4 at node L2; T31~T34 represent the states of analog sensors P1, P2, P3, and P4 at node L3; T41~T44 represent the states of analog sensors P1, P2, P3, and P4 at node L4; T51~T54 represent the states of analog sensors P1, P2, P3, and P4 at node L5; and T61~T64 represent the states of digital sensors I1, I2, I3, and I4 during the cyclic operation of the detection system.
[0051] T ij C j When the value is greater than 0, it is set to -1; when it is less than or equal to 0, it is set to 1. After a certain number of cycles, the resulting state matrices of each sensor are as follows:
[0052]
[0053] The matrix above indicates that during the operation of the detection system, sensor P3 at node L1 exhibited a variance exceeding the set allowable variance, thus it was deemed unqualified. Simultaneously, the same sensor at node L5 also showed an anomaly, with its variance exceeding the set variance. This indicates that the sensor malfunctioned at both low and high water levels throughout the detection process, demonstrating poor reliability, inconsistent performance, and unstable performance. The collected water level data was inaccurate, therefore this sensor cannot be used on a real vehicle. Furthermore, digital sensor I2 also showed a significant deviation during the test, indicating that when the water level was below the sensor's installation position, the difference between the number of times it failed to trigger and the number of water level cycles exceeded the set allowable deviation. Therefore, this sensor is unreliable, unqualified, and cannot be used on a real vehicle.
[0054] Using the matrix above, we can intuitively determine which sensor malfunctions at which node and how consistently it behaves. For example, a sensor might malfunction in shallow water but behave normally in deep water, forming a matrix like the one below:
[0055]
[0056] The matrix indicates that the surface analog sensor P2 is malfunctioning at node L1 (shallow water area) and cannot be used in areas with low water levels in the tank. However, if it can be ensured that the water level in the tank remains high throughout the process and does not trigger the critical value that causes the sensor to malfunction, then the sensor can still be used.
[0057] This sensor testing system enables one-click reliability testing of the sensors used, as well as testing their durability. During the testing process, water resources are recycled, and there is no need to manually collect data. All statistical data are automatically recorded on the operation screen, allowing users to intuitively see the final test results. The system can also accurately count the number of cycles and the test data of the sensors under test, achieving full automation and intelligence throughout the process.
[0058] This embodiment uses data collected by a reference sensor as the control input for the entire system. Therefore, the accuracy of the reference sensor is guaranteed, and although it is relatively expensive, it is feasible for experimental verification. The entire system can also be executed normally, which is based on the PLC system. The timers and other functions used in it are internal functions. The key is the control method of this detection system and the reliability detection method of the sensor under test. The durability test is completed during the entire reliability test, and the reliability test is also completed during the entire durability test. They complement each other.
[0059] The embodiments described above are merely illustrative of specific implementations of the present invention, and while the descriptions are detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. A water level sensor detection and control method, characterized in that, Including: At the same horizontal level position near the bottom end of the water tank, a reference sensor, multiple analog sensors and digital sensors to be detected are set; the reference sensor collects the water level data of the water tank, and by comparing the set water level height with the actual water level height, controls the working sequence of the water inlet valve and the water outlet valve of the water tank to realize the water level cyclic change process of the water tank; at the same time, the water level height data collected by the reference sensor is statistically analyzed, and the water level height data at the same time and the same position is synchronously collected. The water level height of the water tank is divided into multiple nodes. For the analog sensors, the variance of each analog sensor within the set number of cycles is calculated at each node, and then compared with the set reasonable variance. If it is greater than the set variance, it is determined as unqualified; for the digital sensors, the opening and closing times of the water inlet valve and the water outlet valve are compared with the triggering times of the digital sensors, and a reasonable deviation number is set. If the reasonable deviation number is exceeded, it is determined as unqualified.
2. The water level sensor detection and control method according to claim 1, characterized in that, The specific process of realizing the water level cyclic change process of the water tank is as follows: According to the water level height value detected by the reference sensor, the actual water level height H is compared with the set water level full threshold Hh and the water level low threshold Hl: At startup, if H >= Hh, it means that the system is in the full water level state. After startup, the water filling pump is initialized to 0, that is, closed. After waiting for the preset time of the timer, the water outlet valve is powered on and starts to discharge water. When the actual water level value H continuously decreases until H <= Hl, the water outlet valve is closed. At this time, the water filling pump is powered on and starts to fill water, and the water level starts to increase from the low level until H >= Hh, the system pauses for the preset time, and then the water level change control is carried out in a cycle. At startup, if H <= Hl, after startup, the water filling pump is powered on and the system starts to fill water. When the water level starts to increase from the low level until H >= Hh, the water filling stops. At this time, the timer is triggered to count the preset time. After the timer ends, the water outlet valve is powered on and the system starts to discharge water, and the water level starts to change in a cycle. At startup, if Hl < H < Hh, the water filling pump is directly opened and the system directly fills water. When the water level height H of the water tank changes to H >= Hh, the system stops filling water into the water tank. After the timer counts the preset time, the system starts to control the water outlet valve to open until H <= Hl, and the system starts to work in a cycle.
3. The water level sensor detection and control method according to claim 2, characterized in that, At startup, if Hl < H < Hh, the system uses a state variable to save whether it is in the water filling state or the water discharging state currently and stores it in the ferroelectric data area. If the system stops working or the system is directly powered off in the interval of Hl < H < Hh, according to the recorded water filling or water discharging state, the corresponding water filling or water discharging operation is continued on the previous basis.
4. The water level sensor detection and control method according to claim 2 or 3, characterized in that, Before realizing the water level cyclic change process of the water tank, it also includes: First, judge the state of the reference sensor to see if there is an abnormal fault, that is, whether the current value of the reference sensor is lower than the lower limit value or higher than the upper limit value. If it is within the normal value range, it means that the reference sensor is normal, and then the water level cyclic change process of the water tank is realized.
5. The water level sensor detection and control method according to claim 1, characterized in that, The specific method for judging whether the digital sensor is qualified is as follows: The number of triggers of multiple digital sensors under test is counted throughout the entire test cycle. At the same time, the number of times the water outlet valve is opened and the number of times the water pump is started are counted as one complete cycle number N. This cycle number is used as the comparison standard for the trigger number of digital sensors. After setting the allowable deviation number CI, if the difference between the cycle number and the trigger number M of each digital sensor is less than or equal to CI, it is considered qualified. If the difference is greater than CI, it is considered unqualified. That is, it is judged whether N-Mi is greater than CI. If it is true, it is unqualified; if it is not true, it is qualified.
6. The water level sensor detection and control method according to claim 5, characterized in that, The specific method for determining whether an analog sensor is qualified is as follows: The system calculates water level height data from a control sensor and multiple tested analog sensors in real time. At each node, the water level height value for each analog sensor is calculated. In one water level cycle, each analog sensor calculates the water level height twice at each point. Therefore, the total number of calculations for each sensor at each point is twice the number of cycles, i.e., 2N. The system calculates the sample variance of each sensor at each node relative to the control sensor. An acceptable variance value is set to determine the pass / fail status of the analog sensors. The variance is set as Sset. First, at each node: the average value of the control sensor is Avgi = (Hi1 + Hi2 + ... + Hi2N) / 2N, where Avgi represents the average water level height of the control sensor over all cycles at the node, and i represents the node. The variance formula for the analog sensors corresponding to each node is: To calculate the variance of each sensor, where j represents the number of all height statistics for each analog sensor at that node, k represents the variance for each analog sensor, n is 2N, and x... ijk This represents the 2N data points corresponding to each sensor at each node. This represents the average water level height from the control sensor at each node, i.e. =Avgi, therefore the variance of each analog sensor at each node can be obtained.
7. The water level sensor detection and control method according to claim 6, characterized in that, The difference between the variance of the analog sensor at each node and the set variance. Set as T ij The deviation between the number of triggers and the number of cycles of the digital sensor is set to C, which is the set allowable deviation value. j Tij and Cj represent the state of the sensor. The sensor's qualification can be directly determined by this state. The state matrix T is generated by combining Tij and Cj to record the state values of each sensor in the entire reliability and durability testing process, thereby determining whether the analog or digital sensor is qualified.
8. The water level sensor detection and control method according to claim 1, characterized in that, Also includes: The system synchronously collects and saves data from all analog and digital sensors to the local machine at preset time intervals, allowing for real-time viewing of the data source. If a faulty sensor is encountered, the system can identify the time and corresponding cycle number of the anomaly by reviewing the original data.