[go: up one dir, main page]

CN112815826B - Tap opening and closing angle detection method and device, tap and storage medium - Google Patents

Tap opening and closing angle detection method and device, tap and storage medium Download PDF

Info

Publication number
CN112815826B
CN112815826B CN201911126306.0A CN201911126306A CN112815826B CN 112815826 B CN112815826 B CN 112815826B CN 201911126306 A CN201911126306 A CN 201911126306A CN 112815826 B CN112815826 B CN 112815826B
Authority
CN
China
Prior art keywords
magnetic field
field sensor
opening
detection voltage
closing angle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911126306.0A
Other languages
Chinese (zh)
Other versions
CN112815826A (en
Inventor
何玉霞
魏中科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Midea Group Co Ltd
Wuhu Midea Kitchen and Bath Appliances Manufacturing Co Ltd
Original Assignee
Midea Group Co Ltd
Wuhu Midea Kitchen and Bath Appliances Manufacturing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Midea Group Co Ltd, Wuhu Midea Kitchen and Bath Appliances Manufacturing Co Ltd filed Critical Midea Group Co Ltd
Priority to CN201911126306.0A priority Critical patent/CN112815826B/en
Publication of CN112815826A publication Critical patent/CN112815826A/en
Application granted granted Critical
Publication of CN112815826B publication Critical patent/CN112815826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B7/00Measuring arrangements characterised by the use of electric or magnetic techniques
    • G01B7/30Measuring arrangements characterised by the use of electric or magnetic techniques for measuring angles or tapers; for testing the alignment of axes
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F16ENGINEERING ELEMENTS AND UNITS; GENERAL MEASURES FOR PRODUCING AND MAINTAINING EFFECTIVE FUNCTIONING OF MACHINES OR INSTALLATIONS; THERMAL INSULATION IN GENERAL
    • F16KVALVES; TAPS; COCKS; ACTUATING-FLOATS; DEVICES FOR VENTING OR AERATING
    • F16K37/00Special means in or on valves or other cut-off apparatus for indicating or recording operation thereof, or for enabling an alarm to be given
    • F16K37/0025Electrical or magnetic means
    • F16K37/0041Electrical or magnetic means for measuring valve parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Mechanical Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Transmission And Conversion Of Sensor Element Output (AREA)
  • Switches That Are Operated By Magnetic Or Electric Fields (AREA)
  • Measurement Of Length, Angles, Or The Like Using Electric Or Magnetic Means (AREA)

Abstract

The application provides a method and a device for detecting an opening and closing angle of a faucet, the faucet and a storage medium, wherein the method comprises the following steps: determining the value range of the detection voltage according to the detection voltage output by the magnetic field sensor; correcting the mapping relation between the opening and closing angle of the tap valve core and the detection voltage according to the value range; and determining the opening and closing angles corresponding to the detection voltages output by the magnetic field sensors according to the corrected mapping relation. The method can improve the accuracy of the calculation result of the opening and closing angle.

Description

Tap opening and closing angle detection method and device, tap and storage medium
Technical Field
The application relates to the technical field of faucets, in particular to a faucet opening and closing angle detection method and device, a faucet and a storage medium.
Background
At present, the opening and closing angle of the tap valve core can be detected through the relative movement of the magnetic field sensor and the magnet. When the magnet rotates, the opening and closing angle of the tap valve core and the output voltage of the magnetic field sensor have a linear relation.
However, if the above linear relationship is applied to calculate the opening and closing angle, the following condition is satisfied: the magnet cannot have larger error with the position of the magnetic field sensor after multiple rotations; the magnetizing intensity of the magnet is not only required to satisfy linearity, but also the magnetic induction intensity at both end points (N-pole and S-pole) of rotation is required to be within a certain error range.
However, in practical application, errors after multiple movements of the magnet and magnetizing errors of the magnet are unavoidable, so that the opening and closing angles are calculated by adopting the linear relationship, which results in poor accuracy of calculation results.
Disclosure of Invention
The present application aims to solve at least one of the technical problems in the related art to some extent.
The application provides a method and a device for detecting an opening and closing angle of a faucet, the faucet and a storage medium, so as to improve the accuracy of an opening and closing angle calculation result, and solve the technical problem of lower accuracy of the opening and closing angle calculation result in the prior art.
An embodiment of a first aspect of the present application provides a method for detecting an opening and closing angle of a faucet, including:
determining the value range of the detection voltage according to the detection voltage output by the magnetic field sensor;
correcting the mapping relation between the opening and closing angle of the tap valve core and the detection voltage according to the value range;
and determining the opening and closing angles corresponding to the detection voltages output by the magnetic field sensors according to the corrected mapping relation.
According to the detection method of the opening and closing angle of the tap, the value range of the detection voltage is determined according to the detection voltage output by the magnetic field sensor, the mapping relation between the opening and closing angle of the tap valve core and the detection voltage is corrected according to the value range, and finally the opening and closing angle corresponding to the detection voltage output by the magnetic field sensor is determined according to the corrected mapping relation. Therefore, the opening and closing angle of the faucet valve core is calculated through the corrected mapping relation, and the accuracy of the opening and closing angle calculation result can be improved.
An embodiment of a second aspect of the present application provides a device for detecting an opening/closing angle of a faucet, including:
the determining module is used for determining the value range of the detection voltage according to the detection voltage output by the magnetic field sensor;
The correction module is used for correcting the mapping relation between the opening and closing angle of the tap valve core and the detection voltage according to the value range;
And the detection module is used for determining the opening and closing angles corresponding to the detection voltages output by the magnetic field sensor according to the corrected mapping relation.
According to the detection device for the opening and closing angle of the faucet, the value range of the detection voltage is determined according to the detection voltage output by the magnetic field sensor, the mapping relation between the opening and closing angle of the faucet valve core and the detection voltage is corrected according to the value range, and finally the opening and closing angle corresponding to the detection voltage output by the magnetic field sensor is determined according to the corrected mapping relation. Therefore, the opening and closing angle of the faucet valve core is calculated through the corrected mapping relation, and the accuracy of the opening and closing angle calculation result can be improved.
An embodiment of a third aspect of the present application provides a faucet, comprising: the faucet comprises a faucet main body, a valve core and a control unit;
The valve core is provided with a magnet which rotates along with the rotation circumference of the valve core; the magnetic body is arc-shaped, the magnetic field intensity of each arc-shaped part is different, and the central angle of the arc-shaped part is larger than the maximum opening and closing angle of the valve core;
The faucet main body is provided with a magnetic field sensor, and the magnetic field sensor is used for outputting corresponding detection voltage according to the magnetic field intensity;
The control unit is connected with the magnetic field sensor; the control unit comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the detection method of the opening and closing angle of the faucet as provided by the embodiment of the first aspect of the application when executing the program.
An embodiment of a fourth aspect of the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for detecting a tap opening and closing angle as provided by an embodiment of the first aspect of the present application.
Additional aspects and advantages of the application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a schematic diagram of the relative positional relationship between a magnetic field sensor and a magnet in the prior art;
FIG. 2 is a schematic illustration of a first magnet;
FIG. 3 is a second schematic illustration of a magnet;
FIG. 4 is a schematic diagram of a magnet rotation process;
FIG. 5 is a diagram showing the magnitude relationship between the detected voltage and the magnetic induction;
FIG. 6 is a flow chart of a method for detecting an opening/closing angle of a faucet according to an embodiment of the present application;
FIG. 7 is a second schematic diagram of a magnet rotation process;
FIG. 8 is a flow chart of a method for detecting an opening/closing angle of a faucet according to a second embodiment of the present application;
FIG. 9 is a schematic diagram of a detecting device for opening and closing an angle of a faucet according to a third embodiment of the present application;
fig. 10 is a schematic structural diagram of a detecting device for opening and closing angles of a faucet according to a fourth embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present application and should not be construed as limiting the application.
At present, the opening and closing angle of the tap valve core can be detected through the relative movement between the magnetic field sensor and the arc-shaped magnet. The relative positional relationship between the magnetic field sensor and the magnet may be as shown in fig. 1, that is, the magnetic field sensor 11 may be close to the intrados or extrados of the magnet 12, and one of the magnet 12 and the magnetic field sensor 11 is kept fixed, and the other is relatively moved in the circumferential direction.
The arc-shaped magnet can be as shown in fig. 2 and 3, and in the intrados of the magnet, the magnetic field intensity changes from the S pole to the N pole: gradually and uniformly decreasing to 0Gs (middle position), gradually and uniformly increasing from 0Gs, and changing the magnetic field intensity from the N pole to the S pole on the extrados of the magnet to: gradually and uniformly decreasing to 0Gs (middle position), and gradually and uniformly increasing from 0 Gs. The magnetic induction intensity of the magnet linearly changes, the middle is 0Gs, the N extreme is-B, the S extreme is B, wherein the magnetic induction intensities-B are in the induction range of the magnetic field sensor, and if the induction range of the magnetic field sensor is-C, the requirements are satisfied: -C < -B, C > B.
Taking the example where the magnetic field sensor is located close to the outer arc of the magnet, when the magnetic field sensor is fixed and the magnet rotates circumferentially, assuming that the maximum rotation angle of the magnet is 90 ° (the central angle of the arc is 90 °), the initial relative position of the magnet and the magnetic field sensor is ① (0 °), i.e., the N-pole end of the magnet is aligned with the magnetic field sensor, and when the magnet rotates counterclockwise, passes through position ②, eventually reaches position ③ (90 °), i.e., the S-pole end of the magnet is aligned with the magnetic field sensor.
As an example, the magnet may be disposed on the valve core when the magnetic field sensor is near the extrados of the magnet, see fig. 4, with the N-pole end of the magnet aligned with the magnetic field sensor when the valve core of the faucet is rotated to a minimum open/close angle (e.g., 0 °), and with the S-pole end of the magnet aligned with the magnetic field sensor when the magnet is rotated circumferentially with the rotation of the valve core, such as the valve core of the faucet is rotated to a maximum open/close angle (e.g., 90 °). Thus, theoretically, the magnetic induction of the magnet at position ① is-B and the magnetic field sensor senses an output voltage of V0; the magnetic induction intensity of the magnet at the position ③ is B, the induction output voltage of the magnetic field sensor is V2, the rotation angle is 90 degrees, and the change of the magnetic induction intensity of the extrados is linear, so that the change of the output voltage of the magnetic field sensor is also linear (see fig. 5), and the linear relation between the opening and closing angle theta of the faucet valve core and the output voltage V of the magnetic field sensor can be correspondingly obtained as follows:
However, if the above linear relationship is applied to calculate the opening and closing angle, the following condition is satisfied: on the one hand, in terms of structure, the magnet cannot have larger error with the position of the magnetic field sensor after multiple rotations; on the other hand, the magnetizing intensity of the magnet needs to be not only linear, but also the magnetic induction intensity at two ends (positions ① and ③) of rotation needs to be within a certain error range, otherwise, the calculation of the opening and closing angle is affected.
However, in practical application, errors after multiple movements of the magnet and magnetizing errors of the magnet are unavoidable, so that the opening and closing angles are calculated by adopting the linear relationship, which results in poor accuracy of calculation results.
The application provides a tap opening and closing angle detection method mainly aiming at the technical problem of low accuracy of an opening and closing angle calculation result in the prior art.
According to the detection method of the opening and closing angle of the tap, the value range of the detection voltage is determined according to the detection voltage output by the magnetic field sensor, the mapping relation between the opening and closing angle of the tap valve core and the detection voltage is corrected according to the value range, and finally the opening and closing angle corresponding to the detection voltage output by the magnetic field sensor is determined according to the corrected mapping relation. Therefore, the opening and closing angle of the faucet valve core is calculated through the corrected mapping relation, and the accuracy of the opening and closing angle calculation result can be improved.
The following describes a method, a device, a tap and a storage medium for detecting a tap opening and closing angle according to an embodiment of the application with reference to the accompanying drawings.
Fig. 6 is a flowchart illustrating a method for detecting an opening/closing angle of a faucet according to an embodiment of the present application.
As shown in fig. 6, the method for detecting the opening and closing angle of the faucet may include the following steps:
step 101, determining the value range of the detection voltage according to the detection voltage output by the magnetic field sensor.
The magnetic field sensor may be a sensor capable of detecting the magnetic field intensity, for example, a linear hall element, or may be another sensor, which is not limited thereto. Specifically, the magnetic field sensor may output a corresponding detection voltage according to the magnetic field strength.
In the embodiment of the application, one of the magnetic field sensor and the magnet can be kept fixed, and the other can perform relative motion along the circumferential direction, for example, the magnetic field sensor can be kept motionless, the magnet can be rotated circumferentially, or the magnet can be kept motionless, and the magnetic field sensor can rotate circumferentially around the magnet, so that the application is not limited in this respect. The magnetic field sensor may be near the intrados of the magnet or the magnetic field sensor may be near the extrados of the magnet.
For convenience of description, the application uses the magnetic field sensor to keep motionless, the magnet moves circumferentially, for example, when the magnetic field sensor is kept motionless, the magnet can be arranged on the valve core, the magnet can rotate circumferentially along with the rotation of the valve core, when the magnet rotates, the magnetic field sensor can sense the change of the magnetic field, and the corresponding detection voltage is output according to the magnetic field intensity, so that the value range of the detection voltage can be determined according to the detection voltage output by the magnetic field sensor.
And 102, correcting the mapping relation between the opening and closing angle of the tap valve core and the detection voltage according to the value range.
It should be noted that, during the long-time rotation of the magnet, the position between the magnet and the magnetic field sensor may deviate, for example, when the magnetic field sensor approaches the extrados of the magnet, the relative position between the magnet and the magnetic field sensor may change from fig. 4 to fig. 7, and at this time, an angle error will occur between the magnet and the magnetic field sensor. In fig. 4, when the valve core of the faucet rotates to a minimum opening and closing angle (for example, 0 °), the N-pole end of the magnet is aligned with the magnetic field sensor, the magnetic induction intensity is-B, the detection voltage output by the magnetic field sensor is V0, when the valve core of the faucet rotates to a maximum opening and closing angle (for example, 90 °), the magnet rotates counterclockwise along with the rotation of the valve core, the S-pole end of the magnet is aligned with the magnetic field sensor, the magnetic induction intensity is B, and the detection voltage output by the magnetic field sensor is V2. However, when an angle error occurs between the magnet and the magnetic field sensor, the marking angle error is Δa, and when the valve element of the faucet rotates to the minimum opening/closing angle, the N-pole end of the magnet is not aligned with the magnetic field sensor, at this time, the detection voltage output by the magnetic field sensor is not V0, and when the valve element of the faucet rotates to the maximum opening/closing angle, the S-pole end of the magnet is not aligned with the magnetic field sensor, at this time, the detection voltage output by the magnetic field sensor is not V2, and if the corresponding opening/closing angle is calculated by using the mapping relation corresponding to the formula (1), the accuracy of the calculation result will be low.
Therefore, in the present application, in order to improve the accuracy of the calculation result of the opening and closing angle, the mapping relationship between the opening and closing angle of the faucet valve element and the detected voltage needs to be corrected, for example, the correction of the formula (1), for example, the correction of the slope parameter and the intercept parameter in the formula (1) may be performed.
As one possible implementation manner, an initial mapping relationship may be obtained, where the mapping relationship is a linear relationship, and includes a slope parameter and an intercept parameter; and then, correcting the slope parameter and the intercept parameter according to the difference between the maximum voltage and the minimum voltage in the value range to obtain a corrected mapping relation.
And step 103, determining an opening and closing angle corresponding to the detection voltage output by the magnetic field sensor according to the corrected mapping relation.
In the embodiment of the application, after the corrected mapping relation is obtained, the detection voltage value output by the magnetic field sensor can be brought into the mapping relation, and the opening and closing angle of the faucet valve core is calculated.
According to the detection method of the opening and closing angle of the tap, the value range of the detection voltage is determined according to the detection voltage output by the magnetic field sensor, the mapping relation between the opening and closing angle of the tap valve core and the detection voltage is corrected according to the value range, and finally the opening and closing angle corresponding to the detection voltage output by the magnetic field sensor is determined according to the corrected mapping relation. Therefore, the opening and closing angle of the faucet valve core is calculated through the corrected mapping relation, and the accuracy of the opening and closing angle calculation result can be improved.
It should be noted that, during the long-time rotation of the magnet, a deviation may occur in the positions between the magnet and the magnetic field sensor, for example, the relative position between the magnet and the magnetic field sensor changes from fig. 4 to fig. 7, and an angle error occurs between the magnet and the magnetic field sensor. If the central angle of the arc-shaped magnet is the same as the maximum opening and closing angle of the valve core, the magnetic field sensor may be out of the coupling range of the magnet after an angle error occurs. Therefore, in the application, in order to ensure that when the position between the magnet and the magnetic field sensor deviates in the long-time rotation process, the magnetic field sensor is still in the coupling range of the magnet, and the central angle of the arc shape of the magnet can be larger than the maximum opening and closing angle of the valve core. For example, when the maximum opening and closing angle of the valve core is 90 degrees, the central angle of the arc may be 95 degrees. When the valve core rotates to the minimum opening and closing angle, for example, 0 DEG, the magnetic induction intensity is in the range of-B+DeltaB to-B, and when the valve core rotates to the maximum opening and closing angle, for example, 90 DEG, the magnetic induction intensity is in the range of B-DeltaB to B. The delta B value meets the measurement precision of the angle and the rotation angle error.
For example, when the maximum opening and closing angle of the valve element is 90 °, the angle measurement accuracy is changed from 90/2B to 90/2 (B- Δb), and the accuracy is reduced. When the valve core rotates to 0 degree-delta A, the magnetic induction intensity is more than or equal to-B; when the valve core rotates to 90 degrees delta A, the magnetic induction intensity is less than or equal to B.
In order to clearly illustrate the above embodiment, another method for detecting a tap opening/closing angle is provided in this embodiment, and fig. 8 is a flow chart of a method for detecting a tap opening/closing angle provided in the second embodiment of the application.
As shown in fig. 8, the method for detecting the opening and closing angle of the faucet may include the following steps:
step 201, determining the value range of the detection voltage according to the detection voltage output by the magnetic field sensor.
The execution of step 201 may refer to the execution of step 101 in the above embodiment, which is not described herein.
Step 202, obtaining an initial mapping relation, wherein the mapping relation is a linear relation and comprises a slope parameter and an intercept parameter.
In the embodiment of the present application, the initial mapping relationship is a linear relationship and includes a slope parameter and an intercept parameter, for example, the slope parameter is marked as K, and the intercept parameter is marked as B, and the initial mapping relationship may be represented by the formula (2):
θ=K*V+b; (2)
where θ represents the opening/closing angle of the valve element, and V represents the detection voltage output from the magnetic field sensor.
It can be understood that, according to the formula (1), it can be deduced that the molecule in the slope parameter is the maximum opening and closing angle of the valve core, for example, 90 °, the molecule in the intercept parameter is the product of the maximum opening and closing angle of the valve core and the detection voltage induced by the magnetic field sensor when the valve core rotates to the minimum opening and closing angle, for example, when the minimum opening and closing angle is 0 °, the molecule in the intercept parameter is the product of the maximum opening and closing angle and the detection voltage V0 induced by the magnetic field sensor at the N-terminal of the magnet. Wherein the slope parameter and the intercept parameter are equal in denominator.
It should be appreciated that as the magnet rotates for a long period of time, the S-terminal of the magnet may not be aligned with the magnetic field sensor when the valve element of the faucet rotates to the maximum open/close angle, and the detection voltage output by the magnetic field sensor is not V2, and similarly, the N-terminal of the magnet may not be aligned with the magnetic field sensor when the valve element of the faucet rotates to the minimum open/close angle, and the detection voltage output by the magnetic field sensor is not V0, and therefore, the denominator of the slope parameter and the intercept parameter is not V2-V0. Therefore, the denominator of the slope parameter and the intercept parameter in the initial mapping relation needs to be redetermined.
As a possible implementation manner, in the initial mapping relationship, the denominator of the slope parameter and the intercept parameter is an initial difference value, and the initial difference value is a difference value between a first initial value and a second initial value, where the first initial value is a detection voltage output by the magnetic field sensor when the valve element of the faucet rotates to a maximum opening and closing angle (for example, 90 °) so that the first position of the magnet is aligned with the magnetic field sensor; the second initial value is the detection voltage output by the magnetic field sensor when the valve core of the faucet rotates to a minimum opening and closing angle (such as 0 DEG) so that the second position of the magnet is aligned with the magnetic field sensor; the first position and the second position have a set distance from the end of the magnet.
That is, as the magnet rotates for a long time, when the spool of the faucet rotates to a maximum opening and closing angle, the S-pole end of the magnet may not be aligned with the magnetic field sensor, at which time alignment of the magnetic field sensor with a first position of the magnet may occur, wherein the first position has a set distance from the S-pole end of the magnet, and similarly, when the spool of the faucet rotates to a minimum opening and closing angle, the N-pole end of the magnet may not be aligned with the magnetic field sensor, at which time alignment of the magnetic field sensor with a second position of the magnet may occur, wherein the second position has a set distance from the N-pole end of the magnet.
For example, if the first initial value is D1, the second initial value is D2, the initial difference is D, d=d1-D2, and the maximum opening and closing angle is θ1, the initial mapping relationship may be expressed by equation (3):
for example, when the maximum opening and closing angle of the valve core is 90 ° and the minimum opening and closing angle is 0 °, and the latest detection voltage is not detected when the system is initially powered on, the corresponding relationship between the default opening and closing angle and the detection voltage may be as shown in table 1:
Opening and closing angle Detecting voltage
D2=V0+△V01
90° D1=V2-△V21
TABLE 1
Wherein DeltaV 01 represents the difference between the detection voltage output by the magnetic field sensor and V0 when the valve core of the tap rotates to the minimum opening and closing angle in the case of possible maximum deviation; deltaV 21 shows the difference between the detection voltage output by the magnetic field sensor and V2 when the valve core of the faucet rotates to the maximum opening and closing angle under the condition that the maximum deviation possibly occurs.
Then equation (3) can be converted to equation (4):
Wherein the slope parameter is Intercept parameter is
And 203, correcting the slope parameter and the intercept parameter according to the difference between the maximum voltage and the minimum voltage in the value range, and obtaining the corrected mapping relation.
In the embodiment of the application, when the faucet normally operates, the magnetic field sensor can be used for detecting the detection voltage corresponding to different opening and closing angles of the valve core in real time, and the denominator of the slope parameter and the denominator of the intercept parameter are corrected according to the difference value between the maximum voltage and the minimum voltage in the value range of the detection voltage.
For example, when the detected voltage output by the magnetic field sensor is detected to be greater than the first initial value D1, for example, when the detected voltage is greater than V2- Δv 21 in table 1, the range from the second initial value D2 to the detected voltage may be regarded as a value range, that is, D1 in the formula (3) is replaced with the detected voltage output by the magnetic field sensor, and when the detected voltage output by the magnetic field sensor is detected to be less than the second initial value D2, for example, when the detected voltage is less than v0+ [ DELTA ] V 01 in table 1, the range from the detected voltage to the first initial value may be regarded as a value range, that is, D2 in the formula (3) is replaced with the detected voltage output by the magnetic field sensor, thereby obtaining the corrected map.
For example, the tag value range is [ Vmin, vmax ], then equation (3) can be converted to equation (5):
Wherein the slope parameter is Intercept parameter is
And 204, determining an opening and closing angle corresponding to the detection voltage output by the magnetic field sensor according to the corrected mapping relation.
In the embodiment of the application, the detection voltage output by the magnetic field sensor can be brought into the corrected mapping relation, and the corresponding opening and closing angle of the valve core is calculated, so that the related load control can be performed according to the calculated opening and closing angle.
As an example, taking a magnetic field sensor as a linear hall element for example, it is assumed that the maximum opening and closing angle of the spool is 90 ° and the minimum opening and closing angle is 0 °. In order to improve the accuracy of the calculation result of the opening and closing angle of the faucet valve core, the application can start from the design aspect of the magnet and the calculation process of the angle, and eliminate the error:
1. Design of magnet
The error to be avoided in the aspect of magnet design mainly lies in two ends (N-extreme and S-extreme, namely 0 DEG and 90 DEG), in order to ensure that when the magnet rotates for a long time and the positions of the magnet and the linear Hall element deviate, the magnetic field sensor is still in the coupling range of the magnet, the size of the magnet is larger than 90 DEG of rotation angle, namely the arc central angle of the magnet is larger than 90 DEG of maximum opening and closing angle of the valve core, when the valve core rotates to 0 DEG of minimum opening and closing angle, the magnetic induction intensity is in the range of minus B+DeltaB to minus B, and when the valve core rotates to 90 DEG of maximum opening and closing angle, the magnetic induction intensity is in the range of B-DeltaB to B. The delta B value meets the measurement precision of the angle and the rotation angle error.
2. Angle calculation process
Based on the design of the size of the magnet and the magnetic induction intensity, the error of the tap can be eliminated step by step through an algorithm in the rotating operation process, and the accurate measurement of the opening and closing angle is realized. The method comprises the following steps:
The first step:
when the system is powered on initially and the detection voltage output by the latest linear Hall element is not detected, the corresponding relation between the default opening and closing angle and the detection voltage is as follows:
Opening and closing angle Detecting voltage
V0+△V01
90° V2-△V21
According to the parameters, the mapping relation between the opening and closing angle and the detection voltage can be calculated as follows:
Satisfy a linear equation, wherein the slope parameter is Intercept parameter isDeltaV 01 shows that when the maximum deviation possibly occurs, the valve core of the faucet rotates to the minimum opening and closing angle of 0 DEG, and the difference value between the detection voltage output by the magnetic field sensor and V0; deltaV 21 shows the difference between the detection voltage output by the magnetic field sensor and V2 when the valve core of the tap rotates to 90 degrees of the maximum opening and closing angle in the case that the maximum deviation possibly occurs.
And a second step of:
the faucet normally operates, detection voltage values corresponding to different opening and closing angles are detected in real time, and when the detection voltage output by the magnetic field sensor is detected to be smaller than the voltage value of V0 delta V 01, the detection voltage is taken as the latest minimum voltage value Vmin; when the detected voltage output by the magnetic field sensor is detected to be larger than the voltage value of V2-DeltaV 21, the detected voltage is taken as the latest maximum voltage value Vmax.
At this time, the mapping relationship between the opening and closing angle and the detection voltage is:
Opening and closing angle Detecting voltage
Vmin
90° Vmax
According to the parameters, the mapping relation between the opening and closing angle and the detection voltage can be calculated as follows:
Satisfy a linear equation, wherein the slope parameter is Intercept parameter is
At this time, the latest opening and closing angle value after eliminating the error can be obtained according to the latest mapping relation.
And a third step of:
and carrying out relevant load control according to the latest opening and closing angle value.
According to the detection method of the opening and closing angle of the tap, the value range of the detection voltage is determined according to the detection voltage output by the magnetic field sensor, the mapping relation between the opening and closing angle of the tap valve core and the detection voltage is corrected according to the value range, and finally the opening and closing angle corresponding to the detection voltage output by the magnetic field sensor is determined according to the corrected mapping relation. Therefore, the opening and closing angle of the faucet valve core is calculated through the corrected mapping relation, and the accuracy of the opening and closing angle calculation result can be improved.
In order to realize the embodiment, the application further provides a detection device for the opening and closing angle of the faucet.
Fig. 9 is a schematic structural diagram of a detecting device for opening and closing angles of a faucet according to a third embodiment of the present application.
As shown in fig. 9, the detecting device for the opening and closing angle of the faucet includes: a determination module 110, a correction module 120, and a detection module 130.
The determining module 110 is configured to determine a value range of the detection voltage according to the detection voltage output by the magnetic field sensor.
The correction module 120 is configured to correct a mapping relationship between the opening and closing angle of the faucet valve element and the detection voltage according to the value range.
The detection module 130 is configured to determine an opening and closing angle corresponding to the detection voltage output by the magnetic field sensor according to the corrected mapping relationship.
Further, in one possible implementation manner of the embodiment of the present application, referring to fig. 10, on the basis of the embodiment shown in fig. 9, the detecting device for the opening and closing angle of the faucet may further include:
As one possible implementation, the correction module 120 includes:
The obtaining sub-module 121 is configured to obtain an initial mapping relationship, where the mapping relationship is a linear relationship and includes a slope parameter and an intercept parameter.
The correction sub-module 122 is configured to correct the slope parameter and the intercept parameter according to the difference between the maximum voltage and the minimum voltage in the value range, and obtain a corrected mapping relationship.
As a possible implementation, the correction submodule 122 is specifically configured to: and correcting the denominator of the slope parameter and the denominator of the intercept parameter according to the difference value.
As a possible implementation manner, in the initial mapping relationship, the denominators of the slope parameter and the intercept parameter are initial difference values, and the initial difference values are difference values between a first initial value and a second initial value; the first initial value is a detection voltage output by the magnetic field sensor when the valve core of the faucet rotates to the maximum opening and closing angle so that the first position of the magnet is aligned with the magnetic field sensor; the second initial value is the detection voltage output by the magnetic field sensor when the valve core of the faucet rotates to the minimum opening and closing angle to enable the second position of the magnet to be aligned with the magnetic field sensor; the first position and the second position have a set distance from the end of the magnet.
As a possible implementation manner, the determining module 110 is specifically configured to: if the detection voltage output by the magnetic field sensor is larger than the first initial value, taking the range from the second initial value to the detection voltage as a value range; and if the detection voltage output by the magnetic field sensor is smaller than the second initial value, taking the range from the detection voltage to the first initial value as a value range.
It should be noted that the foregoing explanation of the embodiment of the method for detecting the opening and closing angle of the faucet is also applicable to the device for detecting the opening and closing angle of the faucet in this embodiment, and the implementation principle is similar, and will not be repeated here.
According to the detection device for the opening and closing angle of the faucet, the value range of the detection voltage is determined according to the detection voltage output by the magnetic field sensor, the mapping relation between the opening and closing angle of the faucet valve core and the detection voltage is corrected according to the value range, and finally the opening and closing angle corresponding to the detection voltage output by the magnetic field sensor is determined according to the corrected mapping relation. Therefore, the opening and closing angle of the faucet valve core is calculated through the corrected mapping relation, and the accuracy of the opening and closing angle calculation result can be improved.
In order to achieve the above embodiments, the present application also proposes a faucet including: tap main part, case and control unit.
Wherein, the valve core is provided with a magnet which rotates along with the rotation circumference of the valve core; wherein, the magnet is arc, and the magnetic field intensity is different everywhere of arc, and the central angle of arc is greater than the biggest angle that opens and shuts of case.
The faucet body is provided with a magnetic field sensor, and the magnetic field sensor is used for outputting corresponding detection voltage according to the magnetic field intensity.
The control unit is connected with the magnetic field sensor; the control unit comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and when the processor executes the program, the method for detecting the opening and closing angle of the tap according to the embodiment of the application is realized.
In the embodiment of the application, the magnetic field sensor is kept motionless, and the magnet performs circumferential movement for example, when the magnetic field sensor is kept motionless, the magnet can be arranged on the valve core, the magnet can rotate circumferentially along with the rotation of the valve core, and when the magnet rotates, the magnetic field sensor can sense the change of the magnetic field, and corresponding detection voltage is output according to the strength of the magnetic field.
As a possible implementation, the magnetic field sensor is a linear hall element.
As another possible implementation, the magnetic field sensor is close to the intrados or extrados of the magnet.
It should be noted that the foregoing explanation of the embodiment of the method for detecting the opening and closing angle of the faucet is also applicable to the faucet of this embodiment, and the implementation principle is similar, and will not be repeated here.
In order to achieve the above-mentioned embodiments, the present application also proposes a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for detecting a tap opening and closing angle as proposed in the foregoing embodiments of the present application.
It should be noted that the foregoing explanation of the embodiment of the method for detecting the opening and closing angle of the faucet is also applicable to the computer readable storage medium of this embodiment, and the implementation principle is similar, and will not be repeated here.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order from that shown or discussed, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (7)

1. The method for detecting the opening and closing angles of the faucet is characterized by comprising the following steps of:
determining the value range of the detection voltage according to the detection voltage output by the magnetic field sensor;
correcting the mapping relation between the opening and closing angle of the tap valve core and the detection voltage according to the value range;
According to the corrected mapping relation, determining an opening and closing angle corresponding to the detection voltage output by the magnetic field sensor;
the correcting the mapping relation between the opening and closing angle of the tap valve core and the detection voltage according to the value range comprises the following steps:
Obtaining an initial mapping relation, wherein the mapping relation is a linear relation and comprises a slope parameter and an intercept parameter;
Correcting the slope parameter and the intercept parameter according to the difference value between the maximum voltage and the minimum voltage in the value range to obtain a corrected mapping relation;
and correcting the slope parameter and the intercept parameter according to the difference between the maximum voltage and the minimum voltage in the value range to obtain a corrected mapping relation, wherein the method comprises the following steps of:
correcting the denominator of the slope parameter and the denominator of the intercept parameter according to the difference value;
In the initial mapping relation, the denominator of the slope parameter and the intercept parameter is an initial difference value, and the initial difference value is a difference value between a first initial value and a second initial value;
the first initial value is a detection voltage output by the magnetic field sensor when the valve core of the faucet rotates to a maximum opening and closing angle so that the first position of the magnet is aligned with the magnetic field sensor; the second initial value is a detection voltage output by the magnetic field sensor when the valve core of the faucet rotates to a minimum opening and closing angle so that the second position of the magnet is aligned with the magnetic field sensor;
the first position and the second position have a set distance from the end of the magnet.
2. The method according to claim 1, wherein determining the range of values of the detected voltage according to the detected voltage output from the magnetic field sensor comprises:
if the detection voltage output by the magnetic field sensor is larger than the first initial value, taking the range from the second initial value to the detection voltage as the value range;
and if the detection voltage output by the magnetic field sensor is smaller than the second initial value, taking the range from the detection voltage to the first initial value as the value range.
3. The utility model provides a detection device of tap angle of opening and shutting which characterized in that includes:
the determining module is used for determining the value range of the detection voltage according to the detection voltage output by the magnetic field sensor;
The correction module is used for correcting the mapping relation between the opening and closing angle of the tap valve core and the detection voltage according to the value range;
The detection module is used for determining an opening and closing angle corresponding to the detection voltage output by the magnetic field sensor according to the corrected mapping relation;
the correction module is further configured to: obtaining an initial mapping relation, wherein the mapping relation is a linear relation and comprises a slope parameter and an intercept parameter;
Correcting the slope parameter and the intercept parameter according to the difference value between the maximum voltage and the minimum voltage in the value range to obtain a corrected mapping relation;
The correction module is further configured to: correcting the denominator of the slope parameter and the denominator of the intercept parameter according to the difference value;
In the initial mapping relation, the denominator of the slope parameter and the intercept parameter is an initial difference value, and the initial difference value is a difference value between a first initial value and a second initial value;
the first initial value is a detection voltage output by the magnetic field sensor when the valve core of the faucet rotates to a maximum opening and closing angle so that the first position of the magnet is aligned with the magnetic field sensor; the second initial value is a detection voltage output by the magnetic field sensor when the valve core of the faucet rotates to a minimum opening and closing angle so that the second position of the magnet is aligned with the magnetic field sensor;
the first position and the second position have a set distance from the end of the magnet.
4. A faucet is characterized by comprising a faucet main body, a valve core and a control unit;
The valve core is provided with a magnet which rotates along with the rotation circumference of the valve core; the magnetic body is arc-shaped, the magnetic field intensity of each arc-shaped part is different, and the central angle of the arc-shaped part is larger than the maximum opening and closing angle of the valve core;
The faucet main body is provided with a magnetic field sensor, and the magnetic field sensor is used for outputting corresponding detection voltage according to the magnetic field intensity;
The control unit is connected with the magnetic field sensor; the control unit comprises a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the detection method according to any one of claims 1-2 when executing the program.
5. The faucet of claim 4, wherein the magnetic field sensor is a linear hall element.
6. The faucet of claim 4, wherein the magnetic field sensor is proximate to an intrados or extrados of the magnet.
7. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the detection method according to any one of claims 1-2.
CN201911126306.0A 2019-11-18 2019-11-18 Tap opening and closing angle detection method and device, tap and storage medium Active CN112815826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911126306.0A CN112815826B (en) 2019-11-18 2019-11-18 Tap opening and closing angle detection method and device, tap and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911126306.0A CN112815826B (en) 2019-11-18 2019-11-18 Tap opening and closing angle detection method and device, tap and storage medium

Publications (2)

Publication Number Publication Date
CN112815826A CN112815826A (en) 2021-05-18
CN112815826B true CN112815826B (en) 2024-09-03

Family

ID=75852198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911126306.0A Active CN112815826B (en) 2019-11-18 2019-11-18 Tap opening and closing angle detection method and device, tap and storage medium

Country Status (1)

Country Link
CN (1) CN112815826B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114235013B (en) * 2021-11-17 2025-03-28 深圳市凯迪仕智能科技股份有限公司 Door lock calibration method, calibration device, door lock and computer storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103575210A (en) * 2012-08-06 2014-02-12 株式会社电装 Position detector
CN105978235A (en) * 2015-03-11 2016-09-28 株式会社电装 Rotational angle detecting device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE4221186C2 (en) * 1992-06-27 1994-07-28 Bosch Gmbh Robert Method for determining the reference and supply voltage in a computing device
US5644225A (en) * 1996-04-16 1997-07-01 Honeywell Inc. Method for calibrating an angular position sensor
US8947076B2 (en) * 2010-01-18 2015-02-03 Bourns, Inc. High resolution non-contacting multi-turn position sensor
JP2017156266A (en) * 2016-03-03 2017-09-07 日立金属株式会社 Rotation angle sensor and correction method therefor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103575210A (en) * 2012-08-06 2014-02-12 株式会社电装 Position detector
CN105978235A (en) * 2015-03-11 2016-09-28 株式会社电装 Rotational angle detecting device

Also Published As

Publication number Publication date
CN112815826A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
JP4335364B2 (en) Electric valve opening degree detection device and electric valve opening degree control device
US8587296B2 (en) Rotation angle detecting device
JP5333863B2 (en) Rotation angle detector
CN102859327B (en) Rotation angle detection device
US20150015245A1 (en) Multi-rotation encoder
US9970783B2 (en) Magnetic rotation angle sensor that corrects for magnetic pole misalignment
EP2477004A1 (en) Rotation angle detecting device
CN112815826B (en) Tap opening and closing angle detection method and device, tap and storage medium
JP5896912B2 (en) For example, a Hall effect-based rotation angle measurement system for manually operated accelerator rotation grips
JP7381707B2 (en) Detection device, method, system, calculation device, and calculation method
US20190390980A1 (en) Initialization method and initialization device
US7076395B2 (en) Angle detection apparatus and torque detection apparatus
US20010020832A1 (en) Apparatus for detecting rotational angle by employing two or more detection signals based on rotational angle and rotational direction of rotating member
WO2008107300A2 (en) Sensor arrangement and measuring method
KR20170087415A (en) Encoder
US10677171B2 (en) Angle detection mechanism and angle detection system
US11378419B2 (en) Angle sensor and method for operating an angle sensor
CN113661375B (en) Angle detecting device
JP6391843B2 (en) Actuator and adjustment method
US9322888B2 (en) Position detection apparatus and manufacturing method of the same
JP5708986B2 (en) Rotation angle detector
EP2187176B1 (en) Rotary velocity sensor and rotary position and velocity sensor
JP6395062B2 (en) Angle sensor correction device and angle sensor
US20250044124A1 (en) Multi-turn magnetic sensor mid-range reset
US20250044125A1 (en) Multi-turn magnetic sensing with rollover counting

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant