Water flow pulse compensation method, water output detection method, device and cleaning machine
By obtaining the pulse status of the current and previous preset time periods and calculating the pulse compensation value to compensate for the number of water flow pulses, the problem of inaccurate detection of water flow sensors in the cleaning machine is solved, and more accurate water flow pulses and water outlet detection is achieved.
Patent Information
- Application Number
- CN202210906772.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2042-07-29
AI Technical Summary
In existing cleaning machines, due to magnetic interference of metal parts, the water flow sensor detects the water flow pulse inaccurately, which affects the accuracy of the water outlet detection.
By obtaining the pulse status of the current and previous preset time period, it is determined whether it is necessary to compensate for the pulse number of the current preset time period, and calculate the target pulse number based on the pulse compensation value, and use the finite element analysis method to reduce the impact of electromagnetic interference.
It improves the accuracy of water flow pulse detection and the accuracy of water outlet control, reduces the impact of electromagnetic interference on water flow calculation, and avoids the risk of overflow.
Smart Images

Figure CN116105809B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of water flow testing, and in particular to a water flow pulse compensation method, a water output detection method and device, and a cleaning machine. Background Art
[0002] Washing machine water flow sensors typically use the Hall effect to detect water flow. When water flows through the turbine, it drives the magnetic rotor, generating a rotating magnetic field with different magnetic poles. This magnetic field cuts through the magnetic induction lines, producing high and low pulse levels. The controller counts these pulses and calculates the water intake based on the relationship between the sensor's nominal water volume and the pulses.
[0003] Since there are many metal parts in the cleaning machine, metal parts are prone to magnetism, which leads to inaccurate pulse detection by the water flow sensor due to the influence of the magnetism of the metal parts when detecting the water flow of the cleaning machine. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to overcome the defect of inaccurate water flow pulse detection in the prior art, and to provide a water flow pulse compensation method, a water output detection method, a device and a cleaning machine to improve the accuracy of water flow pulse detection.
[0005] The present invention solves the above technical problems through the following technical solutions:
[0006] The present invention provides a method for compensating for water flow pulses, the method comprising:
[0007] Obtain the first pulse state of the current preset time period;
[0008] Obtaining the second pulse state of the previous preset time period;
[0009] determining whether to compensate the number of pulses in the current preset time period according to the first pulse state and the second pulse state;
[0010] If it is determined to compensate for the number of pulses in the current preset time period, a pulse compensation value is calculated based on the pulse data of the previous preset time period;
[0011] The target pulse number is calculated according to the pulse compensation value and the pulse number in the current preset time period.
[0012] Preferably, the step of determining whether to compensate for the number of pulses in the current preset time period according to the first pulse state and the second pulse state includes:
[0013] If the first pulse state is different from the second pulse state, it is determined to compensate the number of pulses in the current preset time period.
[0014] Preferably, the step of calculating the target pulse number based on the pulse compensation value and the pulse number in the current preset time period includes:
[0015] If the first pulse state is a normal state and the second pulse state is an abnormal state, the difference between the pulse number and the pulse compensation value is the target pulse number for the current preset time period;
[0016] If the first pulse state is an abnormal state and the second pulse state is a normal state, the sum of the pulse number and the pulse compensation value is the target pulse number for the current preset time period.
[0017] Preferably, if the pulse state of the current preset time period is normal and the pulse state of the previous preset time period is abnormal, the pulse data includes: the preset time period length T and the minimum time interval t min , the minimum time interval is the minimum time interval among the time intervals between adjacent pulses in the previous preset time period;
[0018] Calculating the pulse compensation value according to the pulse data of the previous preset time period includes calculating the pulse compensation value μ according to the following formula:
[0019]
[0020] Preferably, if the pulse state of the current preset time period is normal and the pulse state of the previous preset time period is abnormal, the pulse data includes: the time interval t' between the end time of the previous preset time period and the last pulse in the previous preset time period and the last adjacent time period t in the previous preset time period. last ;
[0021] Calculating the pulse compensation value according to the pulse data of the previous preset time period includes calculating the pulse compensation value μ according to the following formula:
[0022]
[0023] Preferably, the step of determining whether to compensate for the number of pulses in the current preset time period according to the first pulse state and the second pulse state includes:
[0024] If the pulse state of the current preset time period is the same as the pulse state of the previous preset time period, determining not to compensate the number of pulses in the current preset time period;
[0025] The compensation method further comprises:
[0026] If the pulse state of the current preset time period is the same as the pulse state of the previous preset time period: when the pulse state of the current preset time period is normal, the number of pulses collected in the current preset time period is used as the target pulse number; and / or when the pulse state of the current preset time period is abnormal, the minimum time interval between adjacent pulses in the current preset time period is obtained;
[0027] The target number of pulses is calculated according to the duration of the preset time period and the minimum time interval of the current preset time period.
[0028] The present invention also provides a method for detecting water output, which comprises the following steps:
[0029] Calculate the target pulse number for the current preset time period according to the water flow pulse compensation method as described above;
[0030] Calculating the total pulse water volume according to the target pulse number;
[0031] Calculate the total water output based on the total number of pulses and the nominal number of pulses per unit water volume;
[0032] If the total water output is greater than or equal to the preset water output, it is determined that the water output is completed.
[0033] Preferably, after the step of calculating the total water output according to the total number of pulses and the nominal number of pulses per unit water volume, the step further includes:
[0034] If the total water output is less than the preset water output:
[0035] When the sum of the time of all time periods is greater than or equal to the preset time, it is determined that the water discharge is completed;
[0036] When the sum of the times of all time periods is less than the preset time, the next time period is used as the current preset time period, and the process returns to the step of calculating the target number of pulses for the current preset time period according to the water flow pulse calculation method as described above, until the total water output is greater than or equal to the preset water output or the sum of the times of all time periods is greater than or equal to the preset time, and the water output is determined to be completed.
[0037] The present invention also provides a device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for compensating for water flow pulses or the method for detecting water output as described above is implemented.
[0038] The present invention also provides a cleaning machine, which includes a water flow detector. The water flow detector is arranged at the water inlet of the cleaning machine, and is used to collect the first pulse number. The cleaning machine also includes the device as described above.
[0039] The positive progressive effect of the present invention is that: in the present invention, whether it is necessary to compensate for the number of pulses collected in the current preset time period is determined according to the first pulse state of the current preset time period and the second pulse state of the previous preset time period adjacent to the current preset time period. Since the calculation method of the number of pulses in the preset time period corresponding to different pulse states may be different, the number of pulses may be underestimated or overcounted at the time boundary of the preset time period. Based on this, this embodiment can determine whether it is necessary to compensate for the number of pulses according to the first pulse state and the second pulse state. When compensation is required, the pulse compensation value can be calculated according to the pulse data of the previous preset time period, thereby adding the underestimated pulse compensation value or subtracting the overcounted pulse compensation value to the current preset time period, thereby correcting the number of pulses collected in the current preset time period to obtain a target pulse number that is more accurate and can better reflect the actual water flow conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 Schematic diagram of water flow pulses detected by the water flow sensor without interference.
[0041] Figure 2 Schematic diagram of water flow pulses detected by the water flow sensor in the presence of interference.
[0042] Figure 3 This is a flow chart of the water flow pulse compensation method in Example 1 of the present invention.
[0043] Figure 4 Schematic diagram of the time interval when the pulse is a falling edge in Example 1 of the present invention.
[0044] Figure 5 This is a schematic diagram of the preset time period in Example 1 of the present invention.
[0045] Figure 6 This is a flow chart of the method for detecting water intake in Example 2 of the present invention.
[0046] Figure 7 This is a module diagram of the electronic device in Example 3 of the present invention. DETAILED DESCRIPTION
[0047] For ease of understanding, the following explains the terms that frequently appear in the embodiments:
[0048] [Definition of including] As used herein, the terms "having", "may have", "including" or "may include" indicate the existence of the corresponding functions, operations, elements, etc. of the present disclosure, and do not limit the existence of one or more other functions, operations, elements, etc. In addition, it should be understood that as used herein, the terms "including" or "having" indicate the existence of the features, numbers, steps, operations, elements, parts or their combination described in the specification, and do not exclude the existence or addition of one or more other features, numbers, steps, operations, elements, parts or their combination.
[0049] [Definition of and / or] As used herein, the terms "A or B", "at least one of A and / or B", or "one or more of A and / or B" include any and all combinations of the words listed therewith. For example, "A or B", "at least one of A and B", or "at least one of A or B" means (1) including at least one A, (2) including at least one B, or (3) including at least one A and at least one B.
[0050] [Definition of First and Second] The terms "first," "second," and so on, appearing in the embodiments of this application are for illustration and distinction purposes only. They are not in any order, do not represent a specific limit on the number of devices in the embodiments of this application, and do not constitute any limitation on the embodiments of this application. For example, a first element could be referred to as a second element without departing from the scope of this disclosure. Similarly, a second element could be referred to as a first element.
[0051] In order to better understand this embodiment, the following first describes the overview of this embodiment:
[0052] Figure 1 The diagram schematically shows the water flow pulses detected by the water flow sensor in the absence of other magnetic field interference, which appear as regular continuous high and low levels.
[0053] Figure 2 The schematic diagram shows the water flow pulses detected by the water flow sensor in the presence of other magnetic field interference. The voltage pulses output by the flow sensor will experience pulse loss, which is mainly manifested as irregular continuous high level and continuous low level.
[0054] In the existing water flow pulse calculation method, the flow rate is usually calculated by counting the pulse jump edge (such as the rising edge or the falling edge), that is, counting the jump edge of each pulse and then converting it into water flow. Figure 2 In the case of abnormal flow pulses, the technology may lose pulses, resulting in an over-inflated total water intake and even the risk of overflow. If the water intake is controlled by timing, the real-time fluctuations in water pressure and the water intake per unit time will make it impossible to accurately calculate the water volume.
[0055] In view of this, the present embodiment proposes a finite element analysis method to calculate water flow pulses. Specifically, the present embodiment provides a water flow pulse compensation method, a water volume detection method, a device and a cleaning machine. By setting the minimum time period of the finite element (preset time period), it is determined whether the number of pulses collected in the current preset time period needs to be compensated according to the first pulse state of the current preset time period and the second pulse state of the previous preset time period adjacent to the current preset time period. When compensation is required, the compensated pulse number, that is, the target pulse number, is obtained according to the calculated pulse compensation value, thereby reducing the impact of electromagnetic interference on the water flow pulse calculation, improving the accuracy of the water flow pulse calculation, and further improving the accuracy of water volume control.
[0056] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0057] Example 1
[0058] This embodiment provides a method for compensating water flow pulses, such as Figure 3 As shown, the compensation method includes:
[0059] Step 101: Obtain the first pulse state of the current preset time period;
[0060] Step 102: Obtain the second pulse state of the previous preset time period.
[0061] Among them, the smaller the preset time period is set, the more accurate the final calculation result is, and the larger the preset time period is set, the smaller the calculation pressure is. The preset time period can be selected in combination with the nominal pulse number f per unit water volume of the water flow sensor and the pulse time interval under the standard water pressure. The reasonable water flow rate range under the water pressure fluctuation of the nominal pulse number is [V1, V2]. Therefore, the time interval interval corresponding to the standard flow rate range is In this embodiment, the preset time period is preferably greater than or equal to 3 times.
[0062] In this embodiment, each pulse is represented by a falling edge. It should be understood that in other embodiments, each pulse can also be represented by a rising edge.
[0063] Figure 4 The figure schematically shows the time interval between adjacent pulses when the pulse is a falling edge.
[0064] Among them, the first pulse state and the second pulse state can be determined based on whether a continuous high level and a continuous low level are maintained within the corresponding preset time period. When a continuous high level and a continuous low level are maintained, the corresponding pulse state is determined to be a normal state. When a continuous high level and a continuous low level cannot be maintained, the corresponding pulse state is determined to be an abnormal state.
[0065] The following example takes the current preset time period as an example to illustrate how to determine the pulse state of the preset time period:
[0066] First, the time intervals between adjacent pulses in the current preset time period are collected, and then the pulse state in the current preset time period is determined according to the time intervals.
[0067] Specifically, if the time interval is greater than or equal to the first preset time and less than or equal to the second preset time, the pulse state of the current preset time period is confirmed to be normal, that is, if the time interval between all adjacent pulses in the current preset time period is greater than or equal to the first preset time and less than or equal to the second preset time, the pulse state of the current preset time period is confirmed to be normal.
[0068] If the time interval is greater than the second preset time, the pulse state for the current preset time period is determined to be abnormal. That is, if the time interval between any two adjacent pulses in the current preset time period is greater than the second preset time, the pulse state for the current preset time period is determined to be abnormal. If the time intervals between multiple adjacent pulses are greater than the second preset time, it indicates that a large number of pulses have been lost. In this case, the pulse state for the current preset time period is still considered to be abnormal.
[0069] Among them, the second preset time is greater than the first preset time. In this embodiment, the first preset time can be calculated based on the aforementioned second preset water flow velocity V2 and the nominal pulse number f per unit water volume, that is, the first preset time is the aforementioned The second preset time can be calculated based on the first preset water flow velocity V1 and the nominal pulse number f per unit water volume, that is, the second preset time is the first preset water flow velocity V1 and the nominal pulse number f per unit water volume.
[0070] In a specific embodiment, since electromagnetic interference generally results in a larger time interval, if the time interval is less than the first preset time, it can be considered that the water pressure may be abnormal, while the detection of the water flow pulse is normal, and the number of collected pulses can still be used as the target pulse number.
[0071] In a specific implementation, if the time interval is greater than or equal to a third preset time, the value of the abnormality counter is increased by 1;
[0072] If the value of the abnormality counter is greater than or equal to the preset abnormality value, a fault message is generated.
[0073] Among them, the initial value of the abnormality counter is 0, and the counting starts when the cleaning machine starts to take in water. For example, if there are two adjacent time intervals greater than the third preset time in the first preset time period, the value of the abnormality counter is accumulated to 2. If there is one adjacent time interval greater than the third preset time in the second preset time period, the value of the abnormality counter is accumulated to 3.
[0074] The third preset time is greater than the second preset time. In this embodiment, the third preset time can be calculated based on the second preset time. For example, a multiple k of the second preset time can be used as the third preset time, that is,
[0075] In this embodiment, an abnormality counter is set to count the number of excessive time intervals. Due to objective reasons, there may occasionally be an excessive time interval between adjacent pulses, but if the number of excessive time intervals is too large, it may indicate that the water flow sensor or other equipment has failed, so fault information is generated to remind relevant personnel to handle it.
[0076] In a specific implementation, before the step of generating fault information, the method may further include: if it is detected that the next time interval of the current time interval is less than a third preset time, clearing the abnormality counter.
[0077] In this embodiment, if the time interval between adjacent pulses is not continuously detected to be too large, it can be considered that there is a high possibility that the detection is inaccurate due to other interference. Therefore, the generation of fault information in the case of other interference is excluded, making the generation of fault information more accurate.
[0078] Step 103: Determine whether to compensate for the number of pulses in the current preset time period according to the first pulse state and the second pulse state:
[0079] If it is determined to compensate the number of pulses in the current preset time period, step 104 is executed;
[0080] Step 104: Calculate the pulse compensation value based on the pulse data of the previous preset time period;
[0081] Step 105 : Calculate the target pulse number according to the pulse compensation value and the pulse number in the current preset time period.
[0082] In this embodiment, whether it is necessary to compensate for the number of pulses collected in the current preset time period is determined specifically based on the first pulse state of the current preset time period and the second pulse state of the previous preset time period adjacent to the current preset time period. Since the calculation method of the number of pulses in the preset time periods corresponding to different pulse states may be different, the number of pulses may be underestimated or overcounted at the time boundary of the preset time period. Based on this, this embodiment can determine whether it is necessary to compensate for the number of pulses based on the first pulse state and the second pulse state. When compensation is needed, the pulse compensation value can be calculated based on the pulse data of the previous preset time period. Therefore, the undercounted pulse compensation value is added to the current preset time period or the overcounted pulse compensation value is subtracted, thereby correcting the number of pulses collected in the current preset time period to obtain a target pulse number that is more accurate and can better reflect the actual water flow conditions.
[0083] In this embodiment, step 103 may specifically include the following steps:
[0084] If the first pulse state is different from the second pulse state, determining to compensate the number of pulses in the current preset time period;
[0085] If the first pulse state is the same as the second pulse state, it is determined that the number of pulses in the current preset time period is not compensated.
[0086] In this embodiment, when the first pulse state is different from the second pulse state, the number of pulses that are undercounted or overcounted at the time boundary can be compensated by calculating the pulse compensation value. When the first pulse state is the same as the second pulse state, since the calculation method of the number of pulses in the preset time periods corresponding to the two is usually the same, the influence of the boundary of the preset time period on the number of pulses can be ignored.
[0087] In a specific implementation, step 105 may include the following steps:
[0088] If the first pulse state is a normal state and the second pulse state is an abnormal state, the difference between the pulse number and the pulse compensation value is the target pulse number for the current preset time period;
[0089] If the first pulse state is an abnormal state and the second pulse state is a normal state, the sum of the pulse number and the pulse compensation value is the target pulse number for the current preset time period.
[0090] In this embodiment, when the pulse state is normal, the number of pulses collected is generally used as the number of pulses in the current preset time period; when the pulse state is abnormal, the number of pulses in the current preset time period is generally calculated by other methods. For example, in a specific embodiment, if the pulse state is abnormal, the minimum time interval is obtained, and the time interval is calculated based on the duration T of the current preset time period and the minimum time interval t min Count the number of pulses in the current preset time period.
[0091] The minimum time interval is the smallest time interval between adjacent pulses in the current preset time period. Specifically, the number of pulses in the current preset time period under abnormal conditions can be calculated using the following formula:
[0092]
[0093] In this embodiment, if the first pulse state is a normal state and the second pulse state is an abnormal state, since the abnormal state calculates the number of pulses based on the minimum time interval, the number of pulses may be overcounted in the previous preset time period, so the overcounted number of pulses can be subtracted.
[0094] In this embodiment, when the pulse state is normal, the number of pulses collected in the current preset time period can be used as the target pulse number. When the pulse state is abnormal, the target pulse number can be calculated based on the minimum time interval and the duration T of the current preset time period and the minimum time interval. On the one hand, it can prevent the water flow sensor from obtaining an inaccurate number of pulses due to electromagnetic interference. On the other hand, a relatively large pulse count can be obtained based on the minimum time interval, avoiding the risk of excessively large water flow calculated later and overflow.
[0095] For details, please refer to Figure 5 , assuming the current preset time period is Figure 5 The third T in the figure shows that the time intervals between adjacent falling edges in the current preset time period are all within the time interval range corresponding to the standard flow rate range. Therefore, the pulse state of the current preset time period is normal. The previous preset time period is Figure 5 In the second T, the value of t4 is not within the time interval range corresponding to the standard flow rate range. Therefore, the pulse state of the previous preset time period is abnormal. Therefore, it is necessary to subtract the over-calculated number of pulses from the number of pulses in the current preset time period, that is, the pulse compensation value. That is, when calculating the third T, subtract the part of t5 located in the second t from t5+t6+t7.
[0096] In a specific embodiment, if the pulse state of the current preset time period is normal and the pulse state of the previous preset time period is abnormal, the pulse data includes: the preset time period length T and the minimum time interval t min , the minimum time interval is the minimum time interval among the time intervals of adjacent pulses in the previous preset time period;
[0097] Calculating the pulse compensation value based on the pulse data of the last preset time period includes calculating the pulse compensation value μ according to the following formula:
[0098]
[0099] The symbol [] indicates rounding down, and μ indicates The decimal part after rounding down.
[0100] If the first pulse state is abnormal and the second pulse state is normal, the number of pulses may be underestimated in the previous preset time period. Therefore, the underestimated number of pulses can be added, and the sum of the pulse number and the pulse compensation value is the target pulse number for the current preset time period.
[0101] Assumptions Figure 5 The second T in is the current preset time period. It can be seen that the pulse state of the current preset time period is abnormal, while the pulse state of the previous preset time period is normal. It can be seen that the number of pulses in the boundary part of t3 is underestimated in the current preset time period. Therefore, the pulse data of the previous preset time period can be used to calculate the number of pulses underestimated in this part.
[0102] Specifically, if the pulse state of the current preset time period is normal and the pulse state of the previous preset time period is abnormal, the pulse data includes: the time interval t' between the end time of the previous preset time period and the last pulse in the previous preset time period and the last adjacent time period t in the previous preset time period. last ;
[0103] Calculating the pulse compensation value based on the pulse data of the last preset time period includes calculating the pulse compensation value μ according to the following formula:
[0104]
[0105] In this embodiment, when the first pulse state is different from the second pulse state, the pulse compensation value can be used to correct the number of pulses currently collected. When the first pulse state is the same as the second pulse state, the number of pulses collected can be used as the target pulse number. In this way, electromagnetic interference can be reduced and the accuracy of the number of pulses in each preset time period can be improved.
[0106] Example 2
[0107] This embodiment provides a method for detecting water volume. Figure 6 As shown, the detection method includes the following steps:
[0108] Step 200: start water intake;
[0109] Step 201: Calculate the target pulse quantity for the current preset time period according to the water flow pulse compensation method.
[0110] The target pulse number in the current preset time period can be calculated using the water flow pulse compensation method in Example 1.
[0111] Step 202: Calculate the total number of pulses according to the target number of pulses.
[0112] Specifically, starting from the time when water is introduced into the washing machine, the target pulse numbers of each preset time period are counted, and the total pulse number is calculated based on the latest target pulse number, that is, the target pulse number of the current preset time period.
[0113] Step 203: Calculate the total water intake according to the total number of pulses and the nominal number of pulses per unit water volume.
[0114] Specifically, the product of the total number of pulses and the nominal number of pulses per unit water volume is the total water intake.
[0115] If the total water intake is greater than or equal to the preset water volume, execute step 204;
[0116] Step 204: Determine that water inflow is complete.
[0117] In this embodiment, the number of pulses is calculated based on the minimum time unit, that is, the preset time period. Starting from the start of water intake into the cleaning machine, the number of pulses in the current preset time period is corrected in real time to obtain a target number of pulses that can better reflect the actual water intake situation. Based on this, the total number of pulses is calculated to obtain a more accurate water intake volume, so as to accurately detect the water intake volume.
[0118] Furthermore, after step 203, the detection method further includes: if the total water intake is less than the preset water volume:
[0119] When the sum of the time of all time periods is greater than or equal to the preset time, step 203 is executed to determine that the water inflow is completed;
[0120] When the sum of the time of all time periods is less than the preset time, the next time period is used as the current preset time period, and the process returns to step 201 until the total water intake is greater than or equal to the preset water intake or the sum of the time of all time periods is greater than or equal to the preset time, and step 204 is executed to determine that the water intake is completed.
[0121] Specifically, for example, assuming that the normal water inlet time of the cleaning machine is 60 seconds, set a value greater than the normal water inlet time, such as 100 seconds. If the total water inlet volume still does not reach the preset water volume in 100 seconds, determine whether the water inlet time exceeds 100 seconds. If it exceeds 100 seconds, it is determined that the water inlet is completed, and the water inlet can be controlled to stop. If it does not exceed 100 seconds, continue to inlet water, and calculate the target number of pulses through the minimum time period. This cycle can avoid the risk of excessive water inlet and overflow when the number of pulses is abnormal.
[0122] In order to better understand this embodiment, the present embodiment is described below through a specific example:
[0123] Assuming standard water pressure, the selected Hall effect water flow sensor has a nominal pulse number f per unit water volume, and a reasonable water flow rate range [V1, V2] under water pressure fluctuations that conforms to the nominal pulse number, and satisfies V2<2V1. That is, outside the range of water flow rate [V1, V2], there will be a large error in calculating the total water volume by converting the flow sensor pulse count and the nominal pulse number f per unit water volume.
[0124] The reasonable interval of pulse falling edge interval time t within the flow rate range is calculated as follows:
[0125] Select a buffer of length N [t1, t2…t N ], the buffer area is used to store the time intervals of adjacent falling edges. The number of time intervals N that can be stored in the buffer interval needs to be greater than the number of normal time intervals in a preset time period. The initial values of each value in the buffer area are initialized to
[0126] The minimum time period of the finite element is set to the preset time period T. The value of T can be selected in combination with the nominal pulse number of the flow sensor per unit water volume and the pulse time interval under the standard water pressure. It is preferred that T is greater than However, if the value is too large, the calculation accuracy may decrease, so a balance must be made.
[0127] Real-time record of all pulses and the time intervals between adjacent pulses within the current preset time period. For the current preset time period, real-time detection of whether the time interval between two adjacent falling edges is within the time interval interval corresponding to the standard flow rate range. If so, it will be rolled and stored in the last position of the buffer area with a length of N. That is, after the first valid time interval appears, the buffer area changes to When new data is pushed into the cache, all data in the original storage area are first moved forward by one bit, and the new data is stored in the highest bit.
[0128] Each preset time period corresponds to an abnormal flag bit, and the abnormal flag bit is used to store the pulse state of the corresponding preset time period.
[0129] If the time interval t between two adjacent falling edges detected in real time is outside the time interval corresponding to the standard flow rate range, and The abnormal flag of the current preset time period is set to 1, indicating that the pulse state of the current preset time period is abnormal. Then add 1 to the exception counter value. If After that, the next time interval is detected The exception counter is cleared.
[0130] If the time intervals between adjacent pulses in the current preset time period are all within the time interval interval corresponding to the aforementioned standard flow rate range If the pulse state of the current preset time period is within , it means that the pulse state of the current preset time period is normal, and the corresponding abnormal flag is 0.
[0131] If the real-time accumulated abnormality counter count exceeds the preset value, a fault message is generated.
[0132] If the abnormal flag of the current preset time period is set to 1, the corresponding target pulse number is If the abnormal flag of the current preset time period is set to 1, the corresponding target number of pulses is the number of pulses collected by the water flow sensor.
[0133] If the abnormal flag bit saved in the previous preset time period is 0 and the abnormal flag bit saved in the current preset time period is 1, the over-calculated pulse compensation value needs to be subtracted If the abnormal flag saved in the previous preset time period is 1 and the abnormal flag saved in the current preset time period is 0, the undercounted pulse compensation value needs to be added.
[0134] Execute step 201 and step 202, starting from the start of water intake in the cleaning machine, count the total number of pulses in real time based on a preset time period, and execute step 203 to count the total amount of water intake based on the total number of pulses.
[0135] If the total water intake is greater than or equal to the preset water intake, or the total water intake time is greater than or equal to the preset time, step 204 is executed to determine that the water intake is completed and the water intake is stopped.
[0136] Example 3
[0137] This embodiment provides an apparatus, which can be expressed in the form of a computing device (for example, a server device), including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method in embodiment 1 or embodiment 2 can be implemented when the processor executes the computer program.
[0138] Figure 7 The hardware structure diagram of this embodiment is shown in FIG. Figure 7 As shown, the electronic device 9 specifically includes:
[0139] At least one processor 91, at least one memory 92, and a bus 93 for connecting different system components (including the processor 91 and the memory 92), wherein:
[0140] The bus 93 includes a data bus, an address bus, and a control bus.
[0141] The memory 92 includes a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .
[0142] Memory 92 also includes a program / utility 925 having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0143] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the calibration method of any one of the RF front-end modules in Embodiments 1 to 3 of the present invention.
[0144] The electronic device 9 can further communicate with one or more external devices 94 (e.g., a keyboard, pointing device, etc.). Such communication can be performed via an input / output (I / O) interface 95. Furthermore, the electronic device 9 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 96. The network adapter 96 communicates with other modules of the electronic device 9 via a bus 93. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device 9, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.
[0145] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, depending on the embodiment of the present application, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0146] Example 4
[0147] This embodiment provides a cleaning machine, which includes a water flow detector. The water flow detector is arranged at the water inlet of the cleaning machine, and the water flow detector is used to collect the first pulse number. The cleaning machine also includes a device as in Example 3.
[0148] The cleaning machine in this embodiment can calculate the number of pulses in a preset time period in real time. When subjected to electromagnetic interference, it can determine whether it is necessary to compensate for the number of pulses collected in the current preset time period based on the first pulse state of the current preset time period and the second pulse state of the previous preset time period adjacent to the current preset time period. When compensation is required, the compensated number of pulses, that is, the target number of pulses, is obtained based on the calculated pulse compensation value, thereby reducing the impact of electromagnetic interference on the water flow pulse calculation, improving the accuracy of the water flow pulse calculation, and further improving the accuracy of water volume control.
[0149] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these are merely illustrative and that the scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, and such changes and modifications are intended to fall within the scope of the present invention.
Claims
1. A method for compensating water flow pulses, characterized in that: The compensation method includes: Obtain the first pulse state of the current preset time period; Obtaining the second pulse state of the previous preset time period; determining whether to compensate the number of pulses in the current preset time period according to the first pulse state and the second pulse state; If it is determined to compensate for the number of pulses in the current preset time period, a pulse compensation value is calculated based on the pulse data of the previous preset time period; Calculating a target pulse number based on the pulse compensation value and the number of pulses in the current preset time period; If the pulse state of the current preset time period is normal and the pulse state of the previous preset time period is abnormal, the pulse data includes: the length of the preset time period and minimum time interval , the minimum time interval is the minimum time interval among the time intervals between adjacent pulses in the previous preset time period; The calculation of the pulse compensation value based on the pulse data of the previous preset time period includes: calculating the pulse compensation value according to the following formula : If the pulse state of the current preset time period is normal and the pulse state of the previous preset time period is abnormal, the pulse data includes: the time interval t' between the end time of the previous preset time period and the last pulse in the previous preset time period and the last adjacent time period in the previous preset time period. ; The calculation of the pulse compensation value based on the pulse data of the previous preset time period includes: calculating the pulse compensation value according to the following formula : 。 2. The water flow pulse compensation method according to claim 1, characterized in that: The step of determining whether to compensate for the number of pulses in the current preset time period according to the first pulse state and the second pulse state includes: If the first pulse state is different from the second pulse state, it is determined to compensate the number of pulses in the current preset time period.
3. The water flow pulse compensation method according to claim 1, characterized in that: The step of calculating the target pulse number according to the pulse compensation value and the pulse number of the current preset time period includes: If the first pulse state is a normal state and the second pulse state is an abnormal state, the difference between the pulse number and the pulse compensation value is the target pulse number for the current preset time period; If the first pulse state is an abnormal state and the second pulse state is a normal state, the sum of the pulse number and the pulse compensation value is the target pulse number for the current preset time period.
4. The water flow pulse compensation method according to any one of claims 1 to 3, characterized in that: The step of determining whether to compensate for the number of pulses in the current preset time period according to the first pulse state and the second pulse state includes: If the pulse state of the current preset time period is the same as the pulse state of the previous preset time period, determining not to compensate the number of pulses in the current preset time period; The compensation method further comprises: If the pulse state of the current preset time period is the same as the pulse state of the previous preset time period: when the pulse state of the current preset time period is normal, the number of pulses collected in the current preset time period is used as the target pulse number; and / or when the pulse state of the current preset time period is abnormal, the minimum time interval between adjacent pulses in the current preset time period is obtained; The target number of pulses is calculated according to the duration of the preset time period and the minimum time interval of the current preset time period.
5. A method for detecting water output, characterized in that: The detection method comprises the following steps: Calculating the target pulse number for the current preset time period according to the water flow pulse compensation method according to any one of claims 1 to 4; Calculating the total pulse water volume according to the target pulse number; Calculate the total water output based on the total number of pulses and the nominal number of pulses per unit water volume; If the total water output is greater than or equal to the preset water output, it is determined that the water output is completed.
6. The method for detecting water output according to claim 5, wherein: After the step of calculating the total water output according to the total number of pulses and the nominal number of pulses per unit water volume, the following steps are further included: If the total water output is less than the preset water output: When the sum of the time of all time periods is greater than or equal to the preset time, it is determined that the water discharge is completed; When the sum of the times of all time periods is less than the preset time, the next time period is used as the current preset time period, and the step of calculating the target number of pulses for the current preset time period according to the water flow pulse compensation method as described in any one of claims 1 to 4 is returned until the total water output is greater than or equal to the preset water output or the sum of the times of all time periods is greater than or equal to the preset time, and it is determined that the water output is completed.
7. A device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the water flow pulse compensation method described in any one of claims 1 to 4 or the water output detection method described in claim 5 or 6 is implemented.
8. A cleaning machine, characterized in that: The cleaning machine includes a water flow detector, which is arranged at the water inlet of the cleaning machine and is used to collect the first pulse number. The cleaning machine also includes the device as claimed in claim 7.