Electronic lock, calibration method and device, equipment and medium
By combining Hall effect sensors and photoelectric sensors, an automatic calibration method is used to solve the problems of manual setting of door opening direction and insufficient real-time monitoring in smart door locks. This method achieves efficient and accurate door opening direction recognition and calibration without human intervention, and is suitable for various installation environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-03-13
AI Technical Summary
Existing smart door locks require manual setting of the opening direction during installation, which is complicated and labor-intensive. They also cannot monitor the lock body status in real time, resulting in low calibration accuracy and potential security risks.
By combining Hall effect sensors and photoelectric sensors, the door opening direction is automatically identified and calibrated through motor reversal, forward rotation, and current detection. The collaborative work of multiple sensors improves accuracy and reliability.
It achieves automated calibration without human intervention, improving the convenience, accuracy and reliability of calibration, reducing labor costs, adapting to different installation environments, and enhancing the versatility of electronic locks.
Smart Images

Figure 6BWJCOWNUMNGU0FO9ZOW250FV3GCBDRM0TJIV4E1 
Figure 6YX8A7IXPJ7NOGI74LDTFOBFZ4J49YX0Q12J0QKN 
Figure AISIRHXFHCPDZP2IYS7VS659JTQBYGRXGHMUBCLK
Abstract
Description
Technical Field
[0001] This invention belongs to the field of lock technology, specifically relating to an electronic lock, calibration method, device, equipment, and medium. Background Technology
[0002] Smart home systems integrate various home devices with internet technology, bringing users a convenient, comfortable, and secure living experience. Under this trend, smart door locks, as a crucial component of the home security system, are becoming increasingly important and are gradually becoming the preferred product for many families to ensure safety.
[0003] Compared to traditional locks, smart locks offer a variety of advanced features, such as fingerprint recognition, password unlocking, card unlocking, and remote control, greatly enhancing the convenience and security for users entering and leaving their homes. However, some problems still need to be addressed in existing smart lock technology.
[0004] Because doors can open to the left or right during actual installation and use, smart locks are typically designed to be compatible with both opening directions at the factory to meet broader market demands. However, this brings a series of problems. After the lock body is installed on the door, the uncertainty of the opening direction may prevent the bolt from extending or retracting in the correct direction. For example, with an incorrect opening direction setting, the bolt may not retract smoothly when opening the door or extend properly when closing, severely affecting the normal use of the lock and causing great inconvenience to the user.
[0005] Currently, existing calibration methods for smart lock opening direction calibration have significant shortcomings. Typically, professional personnel are required to manually set the lock's opening direction and perform manual calibration on-site. This process is not only complex and requires a high level of technical expertise from the personnel, but also consumes substantial manpower. For large residential communities or commercial locations with a large number of smart locks requiring calibration, manual calibration undoubtedly increases the time and difficulty of the calibration work, reducing efficiency.
[0006] Furthermore, existing calibration methods cannot monitor the lock body status in real time. During door lock use, various factors, such as door deformation and wear of internal lock parts, may alter the extension and retraction of the bolt, affecting the normal operation of the lock. However, due to the lack of real-time monitoring, users often fail to detect these problems promptly, only seeking repairs when the lock malfunctions and affects normal use. This not only poses security risks but also increases repair costs. Simultaneously, the inability to obtain real-time lock body status information makes it difficult to guarantee calibration accuracy, meaning that potential problems may still exist during lock use, failing to provide users with stable and reliable security.
[0007] As a result, existing smart door locks suffer from problems such as complex operation, high manpower consumption, inability to monitor the lock body status in real time, and difficulty in ensuring calibration accuracy in terms of door opening direction calibration. Summary of the Invention
[0008] The primary objective of this invention is to solve at least one of the above-mentioned problems by providing an electronic lock, calibration method, apparatus, device, and medium.
[0009] To achieve the various objectives of this invention, the following technical solution is adopted: To achieve one of the objectives of this invention, an electronic lock calibration method is provided, comprising the following steps: The system receives and responds to calibration commands, and controls the motor to reverse. The motor drives the transmission component to rotate, thereby driving the locking tongue linked with the transmission component to move. The transmission component is provided with Hall sensors and photoelectric sensors in sequence on its circumference, which are used to sense the magnet and multiple light-blocking plates set on the transmission component, respectively. If the current detection unit detects that the current acquired by the motor reaches the preset stall threshold, it controls the motor to stop, and determines the opening direction of the door where the electronic lock is located based on the high or low level signal of the received Hall sensor. The motor is controlled to rotate forward. When the current detected by the current detection unit reaches the stall threshold, the motor is controlled to stop. If the trigger count of the photoelectric sensor reaches the first threshold, the next step is initiated. The motor is controlled to reverse. When the current detected by the current detection unit reaches the stall threshold, the motor is controlled to stop. If the trigger count of the photoelectric sensor reaches the second threshold, the calibration is determined to be complete.
[0010] In one embodiment, a step parallel to the step of determining that calibration is complete is further included, the specific steps of which are as follows: Receives the level signal detected and acquired by the Hall sensor; If the signal level is the first level, the electronic lock is determined to be in the locked state; if the signal level is the second level, the electronic lock is determined to be in the unlocked state.
[0011] In one embodiment, the step of determining the unlocking direction of the electronic lock based on the high or low level signal detected by the Hall sensor further includes the following specific steps: If the level signal is at the first level, then the door is determined to be a right-opening door; if the level signal is at the second level, then the door is determined to be a left-opening door. Record and store the opening direction of the door.
[0012] In one embodiment, a step parallel to the step of proceeding to the next step if the trigger count of the photoelectric sensor reaches a first threshold is included, and the specific steps are as follows: If the trigger count of the photoelectric sensor reaches the first threshold and the jump count of the level signal of the Hall sensor reaches the third threshold, then proceed to the next step.
[0013] In one embodiment, a step parallel to the step of determining that calibration is complete if the trigger count of the photoelectric sensor reaches a second threshold is included, and the specific steps are as follows; If the trigger count of the photoelectric sensor reaches the second threshold and the jump count of the level signal of the Hall sensor reaches the fourth threshold, then the calibration is considered complete.
[0014] In one embodiment, the steps following controlling the motor to rotate forward further include the following steps: The first running time from the start of forward rotation to the stop of forward rotation is collected; After the acquisition motor stops rotating forward, it starts rotating in reverse until the second running time after calibration is completed; Based on the first running time and the second running time, a third running time is calculated to obtain the time required for the motor to drive the transmission component to rotate a predetermined angle.
[0015] To achieve one of the objectives of this invention, an electronic lock is provided, comprising a control unit, a motor, a transmission component, a bolt, a photoelectric sensor, and a Hall sensor. The motor is linked to the bolt via the transmission component. The transmission component is provided with a magnet and a plurality of light-blocking plates. The Hall sensor and the photoelectric sensor are arranged circumferentially along the transmission component and are respectively used to sense the magnet and the plurality of light-blocking plates. The control unit is used to perform the electronic lock calibration method as described in any of the preceding objectives.
[0016] To achieve one of the objectives of this invention, an electronic lock calibration device is provided, comprising: The receiving module receives and responds to calibration commands and controls the motor to reverse. The motor drives the transmission component to rotate, thereby driving the locking tongue linked with the transmission component to move. The transmission component is provided with Hall sensors and photoelectric sensors in sequence on its circumference, which are used to sense the magnet and multiple light-blocking plates set on the transmission component, respectively. The direction determination module controls the motor to stop if the current detection unit detects that the current acquired by the motor reaches a preset stall threshold, and determines the opening direction of the door where the electronic lock is located based on the high or low level signal detected by the Hall sensor. The intermediate module controls the motor to rotate forward. When the current detected by the current detection unit reaches the stall threshold, the motor is stopped. If the trigger count of the photoelectric sensor reaches the first threshold, the next step is initiated. The calibration module controls the motor to reverse. When the current detected by the current detection unit reaches the stall threshold, the motor is stopped. If the trigger count of the photoelectric sensor reaches the second threshold, the calibration is considered complete.
[0017] To suit one of the purposes of this invention, a computer device is provided, comprising a central processing unit and a memory, the central processing unit being configured to invoke and run a computer program stored in the memory to perform the steps of the method as described in any of the preceding purposes.
[0018] To suit one of the purposes of this invention, a computer-readable storage medium is provided, which stores, in the form of computer-readable instructions, a computer program implemented according to any one of the preceding purposes, which, when invoked by a computer, performs the steps included in the corresponding method.
[0019] Compared with existing technologies, the present invention has many advantages, including but not limited to: In existing electronic lock calibration technologies, users often need to manually set the door's opening direction. This process is not only cumbersome but also prone to errors due to user mistakes or inaccurate understanding of the direction setting. The electronic lock calibration method of this invention, upon receiving and responding to a calibration command, controls the motor to reverse and uses a Hall sensor positioned circumferentially on the transmission component to sense the magnetic signal. When the current detection unit detects that the current acquired by the motor reaches a preset stall threshold, it controls the motor to stop and automatically and accurately determines the door's opening direction based on the level signal detected by the Hall sensor. This process is fully automated, requiring no manual intervention, greatly improving ease of use, avoiding errors that may occur with manual settings, ensuring the accuracy of the opening direction recognition, and laying the foundation for subsequent precise calibration.
[0020] The electronic lock calibration method of this invention automatically controls the motor to rotate forward after determining the door opening direction. When the current reaches a stall threshold, the method stops and checks whether the trigger count of the photoelectric sensor has reached a first threshold. If it has, the method continues to control the motor to rotate in reverse, stopping again when the current reaches the stall threshold, and then checks whether the trigger count of the photoelectric sensor has reached a second threshold. If it has, the calibration is considered complete. The entire calibration process requires no manual operation of the motor or other complex procedures; it is entirely automated, significantly reducing labor costs. This method is particularly suitable for large-scale electronic lock installation and calibration scenarios, improving work efficiency.
[0021] This invention sequentially arranges Hall effect sensors and photoelectric sensors along the circumference of the transmission component, respectively for sensing a magnet and multiple light-blocking plates. The Hall effect sensor determines the door opening direction by sensing the magnet signal, while the photoelectric sensor assists in the calibration process by recording the number of triggers of the light-blocking plates. The collaborative work of multiple sensors allows the system to acquire information from different angles, mutually verifying and supplementing each other. For example, during motor rotation, the current detection unit detects current changes, and combined with the signals from the Hall effect sensor and photoelectric sensor, it can more accurately determine the motor's operating status and the position of the latch, thereby completing the calibration more accurately. This multi-sensor fusion approach effectively improves the accuracy and reliability of calibration, reduces calibration errors caused by single sensor failure or signal interference, and ensures that the electronic lock can operate stably and reliably in various environments.
[0022] Due to differences in door structure and installation environment across various locations, electronic locks may face various complex situations after installation. The electronic lock calibration method of this invention, through automatic door opening direction recognition and a fully automated calibration process, can adapt to different types and installation methods of doors. Regardless of whether the door opens to the left or right, or regardless of the installation position and angle, this method can automatically complete the calibration without requiring special settings or adjustments for different situations. This greatly enhances the versatility of electronic locks, allowing the same electronic lock to be widely used in various scenarios, reducing product development and production costs, and providing users with a more convenient user experience.
[0023] Therefore, the electronic lock calibration method of the present invention significantly improves the convenience, accuracy, reliability and versatility of electronic lock calibration through its advantages such as automatic identification of door opening direction, fully automatic calibration process, collaborative work of multiple sensors and adaptability to different installation environments, while reducing labor costs. It has high practical value and market promotion prospects. Attached Figure Description
[0024] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a schematic diagram of the structure of an electronic lock according to a typical embodiment of the present invention.
[0025] Figure 2 This is an exploded schematic diagram of an electronic lock according to a typical embodiment of the present invention.
[0026] Figure 3 This is a schematic diagram of the lock cylinder lever of an electronic lock according to a typical embodiment of the present invention.
[0027] Figure 4 This is a schematic diagram of the toothed disc of an electronic lock according to a typical embodiment of the present invention.
[0028] Figure 5 This is a schematic diagram of the first partial structure of the electronic lock according to a typical embodiment of the present invention.
[0029] Figure 6 This is a schematic diagram of the second partial structure of the electronic lock according to a typical embodiment of the present invention.
[0030] Figure 7 This is a partial cross-sectional schematic diagram of an electronic lock according to a typical embodiment of the present invention.
[0031] Figure 8 This is a planar schematic diagram of the assembly of the rotating shaft, linkage ring, photoelectric sensor, and Hall sensor in a typical embodiment of the present invention.
[0032] Figure 9 This is a plan view of the toothed disc of an electronic lock according to a typical embodiment of the present invention.
[0033] Figure 10 This is a schematic diagram of the transmission of an electronic lock according to a typical embodiment of the present invention.
[0034] Figure 11 This is a schematic flowchart of an electronic lock calibration method according to a typical embodiment of the present invention.
[0035] Figure 12 This is a flowchart illustrating a step parallel to the step of determining that calibration is complete, according to an embodiment of the present invention.
[0036] Figure 13 This is a flowchart illustrating the steps of determining the unlocking direction of the electronic lock based on the high or low level of the received Hall sensor signal, according to an embodiment of the present invention.
[0037] Figure 14 This is a flowchart illustrating the step of controlling the forward rotation of a motor according to an embodiment of the present invention.
[0038] Figure 15 This is a schematic diagram of the structure of an electronic lock calibration device according to a typical embodiment of the present invention. Detailed Implementation
[0039] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as limiting the present invention.
[0040] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or components, nor does it exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0041] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0042] This invention provides an electronic lock calibration method that automatically identifies the opening direction of a door and automatically calibrates the electronic lock based on the identification result. This method eliminates the need for manual intervention in setting the door's opening direction and manual calibration operations, thus significantly reducing labor costs.
[0043] To facilitate a clear and accurate explanation of the electronic lock calibration method of the present invention, the following will describe the electronic lock calibration method in detail with reference to specific application scenarios of electronic locks. It should be noted that this combination is for illustrative purposes only and does not constitute any limitation on the scope of the technical solution of the present invention.
[0044] The present invention provides an electronic lock 100, which is installed on a door body, the door body is installed on a door frame, and the door frame is provided with a lock tongue groove, which is provided corresponding to the electronic lock 100.
[0045] Combination Figure 1 and Figure 2The electronic lock 100 includes a control unit (not shown), a photoelectric sensor 114, a Hall sensor 141, a current detection unit (not shown), a motor 115, a transmission mechanism, and a bolt 160. The control unit is electrically connected to the photoelectric sensor 114, the Hall sensor 141, the current detection unit, and the motor 115. The motor 115, the transmission mechanism, and the bolt 160 are sequentially connected and driven. The motor 115, via the transmission mechanism, drives the bolt 160 to extend into the bolt groove to lock the electronic lock 100; alternatively, the motor 115, via the transmission mechanism, drives the bolt 160 to retract from the bolt groove to unlock the electronic lock 100. The control unit is used to control the operation of the motor 115.
[0046] Combination Figure 1 The transmission mechanism includes the lock cylinder puller 150, one end of which is connected to the lock cylinder 150 of the electronic lock 100. The lock cylinder puller 150 is connected to the bolt 160. The lock cylinder puller 150 drives the bolt 160 to move linearly along the extension direction of the bolt 160, so that the bolt 160 extends into or exits from the bolt groove, thereby realizing the locking or unlocking of the electronic lock 100.
[0047] The lock cylinder pull tab 150 is perpendicular to the lock tongue 160, and the lock cylinder pull tab 150 and the lock tongue 160 are fixedly connected. Figure 3 The lock cylinder lever 150 has a flat cylindrical structure, comprising an adjacent unlocking surface 151 and a locking surface 152. The unlocking surface 151 is perpendicular to the locking surface 152, and the width of the unlocking surface 151 is greater than the width of the locking surface 152. When the lock cylinder lever 150 is rotated so that the unlocking surface 151 faces the bolt groove, the bolt 160 retracts from the bolt groove, thus unlocking. When the lock cylinder lever 150 is rotated so that the locking surface 152 faces the bolt groove, the bolt 160 extends into the bolt groove, thus locking.
[0048] Combination Figure 2The transmission mechanism further includes a transmission component and a linkage block 113. The transmission component includes a rotating shaft 111, a gear disk 120, and the linkage block 113. The motor 115 drives the gear disk 120 to rotate. The rotating shaft 111 is connected to the lock cylinder pull plate 150. The linkage block 113 is disposed on the rotating shaft 111. The gear disk 120 has a gear hole, and the gear disk 120 is sleeved on the rotating shaft 111 through the gear hole. The gear hole is a circular hole, and the section of the rotating shaft 111 corresponding to the gear hole is a cylindrical structure, so that the gear hole sleeves on the rotating shaft 111, and the gear disk 120 cannot directly drive the rotating shaft 111 to rotate. Alternatively, the diameter of the gear hole is larger than the shaft diameter of the rotating shaft 111, so that there is no transmission fit between the gear hole and the rotating shaft 111, thus preventing the gear disk 120 from directly driving the rotating shaft 111 to rotate.
[0049] Combination Figure 4 The gear disk 120 is provided with a transmission block 122, which is arranged on the same rotation path as the linkage block 113 on the rotating shaft 111. When the motor 115 drives the gear disk 120 to rotate, the transmission block 122 on the gear disk 120 will move synchronously. Since the transmission block 122 and the linkage block 113 are arranged on the same rotation path, the transmission block 122 will abut against the linkage block 113 during rotation, so that the transmission block 122 will drive the rotating shaft 111 to rotate via the linkage block 113. The rotating shaft 111 will drive the lock cylinder pull plate 150 to rotate, and the lock cylinder pull plate 150 will drive the bolt 160 to move linearly, so that the bolt 160 extends into or retracts from the bolt groove, thereby locking or unlocking the electronic lock 100.
[0050] The gear disk 120 is provided with multiple light-blocking plates 130. The gear disk 120 will drive the light-blocking plates 130 to rotate synchronously. The photoelectric sensor 114 is disposed on the rotation path of the light-blocking plates 130. When the gear disk 120 drives the light-blocking plates 130 past the photoelectric sensor 114, the light-blocking plates 130 will block the light emitted by the photoelectric sensor 114, causing the photoelectric sensor 114 to generate a light-blocking signal. The photoelectric sensor 114 outputs the light-blocking signal to the control unit. Based on the light-blocking signal, the control unit obtains the rotation angle of the gear disk 120 and determines the working status of the electronic lock 100.
[0051] In this embodiment, the toothed disk 120 is provided with a plurality of light-blocking plates 130, which are evenly distributed in the circumferential direction of the toothed disk 120. For example, if the toothed disk 120 is provided with two light-blocking plates 130, the two light-blocking plates 130 are arranged at 180° between them; if the toothed disk 120 is provided with three light-blocking plates 130, the three light-blocking plates 130 are arranged sequentially along the circumferential direction of the toothed disk 120, and adjacent light-blocking plates 130 are arranged at 180° between them.
[0052] In this embodiment, the invention is described using the example of four light-blocking plates 130 on the gear disk 120, but this should not be construed as a limitation of the invention. Specifically, the four light-blocking plates 130 are arranged sequentially along the circumference of the gear disk 120, with adjacent light-blocking plates 130 positioned at 90° intervals. When the motor 115 drives the gear disk 120 to rotate, the gear disk 120 will drive the four light-blocking plates 130 to rotate synchronously. Assuming the angle at which the photoelectric sensor 114 is blocked by one of the light-blocking plates 130 is 0° when the gear disk 120 is not rotating; when the motor 115 drives the gear disk 120 to rotate, and the photoelectric sensor 114 is blocked by another light-blocking plate 130, the control unit receives the light-blocking signal output by the photoelectric sensor 114, and the control unit determines that the gear disk 120 has rotated 90°.
[0053] The control unit outputs a drive control signal to the motor 115 to control the forward and reverse rotation of the motor 115, thereby controlling the rotation direction of the gear 120. By controlling the rotation of the gear 120, the control unit controls the rotation of the lock cylinder lever 150, which in turn controls the insertion or withdrawal of the bolt 160 into the bolt groove, thus controlling the locking or unlocking of the electronic lock 100. Furthermore, the control unit monitors the rotation angle of the gear 120 using a photoelectric sensor 114 to prevent the rotation angle from being too large or too small, ensuring that the electronic lock 100 accurately locks or unlocks.
[0054] In this embodiment, combined with Figure 4The transmission block 122 extends along the circumference of the gear disk 120, such that its two end faces 1221 along the circumference are angled. One of these end faces 1221 can abut against the linkage block 113 on the rotating shaft 111, thereby driving the rotating shaft 111 to rotate via the linkage block 113. Specifically, when the control unit controls the motor 115 to rotate forward, one end face 1221 abuts against the linkage block 113; when the control unit controls the motor 115 to rotate in reverse, the other end face 1221 abuts against the linkage block 113, thereby improving the rotation efficiency of the gear disk 120. In this invention, it is recommended that the transmission block 122 be arranged across 180°, that is, the two end faces 1221 are arranged at 180°, so that when the motor 115 rotates forward or in reverse, the rotation angle of the transmission block 122 can be reduced, allowing for quick abutment against the linkage block 113.
[0055] In a typical embodiment of the present invention, combined with Figure 4 The gear disk 120 is provided with a travel groove 121, which extends along the circumferential direction of the gear disk 120. The travel groove 121 and the transmission block 122 extend along the same path, and are connected end-to-end to form a ring structure. Furthermore, the two end faces 1221 of the transmission block 122 constitute the two groove walls of the travel groove 121 in the circumferential direction. In this embodiment, the invention is described using the example of the transmission block 122 spanning 180° along the circumferential direction and the travel groove 121 also spanning 180° along the circumferential direction, but this should not be construed as a limitation of the invention.
[0056] Combination Figure 2 and Figure 6 The transmission mechanism is further provided with a linkage ring 118, which is sleeved on the rotating shaft 111 and fixedly disposed therebetween. A linkage block 113 is fixedly disposed on the linkage ring 118; in other words, the linkage block 113 is fixedly disposed on the rotating shaft 111 via the linkage ring 118. In this embodiment, it is recommended that the linkage ring 118 and the linkage block 113 be integrally formed, but this should not be construed as a limitation of the present invention.
[0057] Combination Figure 4 and Figure 6The gear disk 120 is provided with an annular groove 123, which is located inside the stroke groove 121, that is, the annular groove 123 is closer to the gear hole of the gear disk 120 than the stroke groove 121. The annular groove 123 is connected to the stroke groove 121. The linkage ring 118 is installed in the annular groove 123, and the linkage block 113 on the linkage ring 118 is inserted into the stroke groove 121 to limit the linkage block 113 through the stroke groove 121. The two end faces 1221 of the transmission block 122 can be selectively abutted against the linkage block 113.
[0058] When the gear disk 120 rotates, one end face 1221 of the transmission block 122 abuts against the linkage block 113. The gear disk 120 rotates further to drive the linkage block 113 to rotate through the corresponding end face 1221. The linkage block 113 then drives the rotating shaft 111 and the lock cylinder pull plate 150 to rotate in sequence, and then drives the lock tongue 160 to move linearly, so as to realize that the lock tongue 160 extends into or retracts from the lock tongue groove, thereby realizing the locking or unlocking of the electronic lock 100.
[0059] In a typical embodiment of the present invention, combined with Figure 2 , Figure 5 , Figure 6 and Figure 7 The Hall sensor 141 is equipped with a magnet 142 that works in conjunction with it. Specifically, the magnet 142 is fixedly mounted on the rotating shaft 111. When the rotating shaft 111 rotates, the magnet 142 rotates synchronously with the rotating shaft 111. The Hall sensor 141 is arranged on the rotation path of the magnet 142. Thus, when the magnet 142 rotates with the rotating shaft 111 to a preset position close to the Hall sensor 141, the Hall sensor 141 will sense the change in magnetic field and generate a corresponding Hall signal.
[0060] In this embodiment, the Hall signal is a level signal, and is further divided into a first Hall signal and a second Hall signal. The first Hall signal corresponds to a high level, and the second Hall signal corresponds to a low level; alternatively, the first Hall signal may correspond to a low level, and the second Hall signal to a high level.
[0061] In this embodiment, two magnets 142 are configured for the Hall sensor 141. These two magnets 142 are evenly arranged 180° apart along the circumferential direction of the rotating shaft 111. Simultaneously, the Hall sensor 141 and the photoelectric sensor 114 are spatially arranged at a 90° angle to optimize signal detection and processing efficiency. Since the rotating shaft 111 and the lock cylinder lever 150 are fixedly connected, they remain synchronized during rotation; that is, the rotation of the rotating shaft 111 directly drives the lock cylinder lever 150 to perform a corresponding rotational action.
[0062] When the control unit executes the unlocking command of the electronic lock 100, it sends a drive signal to the motor 115 to start the motor 115 and drive the gear 120 to rotate. During rotation, the gear 120 drives the rotating shaft 111 to rotate synchronously. As the rotating shaft 111 rotates, its preset unlocking surface 151 gradually adjusts to face the latch groove. In this position, the latch 160 smoothly exits the latch groove, thus completing the unlocking action of the electronic lock 100. Simultaneously, as the rotating shaft 111 rotates to the unlocking position, its preset locking surface 152 rotates to face the Hall sensor 141. At this time, the magnet 142, pre-arranged on the rotating shaft 111, moves away from the Hall sensor 141. The Hall sensor 141 does not detect any change in the magnetic field of the magnet 142, thereby generating a second Hall signal representing the unlocking state.
[0063] When the control unit executes the locking operation command of the electronic lock 100, the control unit sends a reverse drive signal to the motor 115. The motor 115 drives the bolt 160 to move through the gear plate 120, the rotating shaft 111, and the lock cylinder pull plate 150. When the locking surface 152 of the bolt 160 rotates to face the bolt groove, the bolt 160 extends into the bolt groove under the action of mechanical driving force, realizing the locking function of the electronic lock 100. At the same time, during the process of the rotating shaft 111 rotating to the locked position, one of the magnets 142 pre-arranged on the rotating shaft 111 approaches the Hall sensor 141. The Hall sensor 141 senses the change in the magnetic field of the magnet 142 and generates a first Hall signal representing the locked state.
[0064] Therefore, the control unit of the electronic lock 100 of the present invention can use the signal generated by the Hall sensor 141 to help determine the current locked or unlocked state of the electronic lock 100, providing reliable technical support for the intelligent control and state management of the electronic lock 100.
[0065] In a typical embodiment of the present invention, the current detection unit is electrically connected to the motor 115, and the current detection unit is configured to detect the magnitude of the operating current of the motor 115 in real time during operation.
[0066] When the control unit executes the unlocking command of the electronic lock 100, it sends a drive signal to the motor 115. Upon responding to the drive signal, the motor 115 sequentially drives the gear 120, the shaft 111, and the latch 160 to rotate, thus unlocking the electronic lock 100. When the electronic lock 100 is in the unlocked state, the latch 160 completely retracts from the latch groove, preventing the motor 115 from continuing to drive the gear 120, shaft 111, and latch 160 in the same direction of rotation, thereby causing the motor 115 to enter a stalled state. In the stalled state, the operating current of the motor 115 will abnormally increase; this operating current is defined as the stall current. The current detection unit continuously monitors the motor 115 current and outputs the detected current data, including the stall current, to the control unit in real time.
[0067] When the control unit executes the locking command of the electronic lock 100, it sends a reverse drive signal to the motor 115. Upon responding to the reverse drive signal, the motor 115 sequentially drives the gear 120, the shaft 111, and the latch 160 to rotate in the opposite direction. This mechanical transmission process achieves the locking function of the electronic lock 100. When the electronic lock 100 is in the locked state, the latch 160 extends into the latch groove until it reaches the mechanical limit position. At this time, the motor 115 cannot continue to drive the gear 120, the shaft 111, and the latch 160 to rotate in the same direction, thus causing the motor 115 to enter a stall state, and the motor 115's operating current becomes a stall current. The current detection unit continuously monitors the motor 115 current and outputs the detected current data, including this stall current, to the control unit in real time.
[0068] Therefore, the control unit of the electronic lock 100 of the present invention can use the current data fed back by the current detection unit to help determine the current locked or unlocked state of the electronic lock 100. The control unit can realize accurate monitoring and real-time management of the state of the electronic lock 100, providing a reliable technical guarantee for the intelligent control of the electronic lock 100.
[0069] In one embodiment, Figure 2The electronic lock 100 is also equipped with a circuit board 146, which is installed in the internal space of the housing 143. The photoelectric sensor 114 and the Hall sensor 141 are integrated and arranged on the circuit board 146, thereby realizing modular installation of sensor components and centralized signal processing.
[0070] In one embodiment, the definition of the rotation direction of the motor 115 is as follows: the forward rotation direction of the motor 115 can be defined as clockwise, and correspondingly, its reverse rotation direction is counterclockwise; alternatively, according to actual design requirements and control logic, the forward rotation direction of the motor 115 can also be defined as counterclockwise, and the reverse rotation direction as clockwise. The above definition of the rotation direction of the motor 115 can be flexibly selected and set according to specific application scenarios and control strategies.
[0071] In a typical embodiment of the present invention, the electronic lock calibration method is implemented based on the electronic lock 100 described above, wherein the control unit of the electronic lock 100 is responsible for executing the electronic lock calibration method, in conjunction with... Figures 8 to 11 The specific steps of the electronic lock calibration method are as follows: Step S1100: Receive and respond to calibration command, control motor to reverse, wherein the motor drives the transmission component to rotate, thereby driving the locking tongue linked with the transmission component to move. Hall sensors and photoelectric sensors are sequentially provided on the circumference of the transmission component, which are used to sense the magnet and multiple light-blocking plates set on the transmission component, respectively. The control unit has a multi-path command receiving function. Specifically, the control unit can receive calibration commands generated by the user through touching the control panel of the electronic lock 100; or, the control unit can also receive calibration commands output by external devices (such as smart terminals, remote control systems, etc.) through wired or wireless communication.
[0072] Once the control unit successfully receives the calibration command, it enters the preset calibration working state. In this state, the control unit sends a reverse drive signal to the motor 115, controlling the motor 115 to reverse. During the reverse rotation, the motor 115 sequentially drives the gear plate 120, the rotating shaft 111, and the locking tongue 160 to rotate synchronously, thereby initiating the calibration process of the electronic lock 100.
[0073] To clearly illustrate the technical solution of this invention, the following example demonstrates the specific implementation process of this invention by taking the electronic lock 100 immediately after installation on the door and the need for initial calibration. However, it should be clearly stated that this application scenario is merely illustrative and does not constitute any limitation on the scope of application of the technical solution of this invention.
[0074] Step S1200: If the current detection unit detects that the current acquired by the motor reaches the preset stall threshold, the motor is controlled to stop, and the opening direction of the door where the electronic lock is located is determined based on the high or low level signal detected by the Hall sensor. The control unit sends a continuous detection command to the current detection unit, driving the current detection unit to monitor the operating current of the motor 115 in real time and continuously. The current detection unit outputs the current data acquired at each moment to the control unit in the form of an electrical signal, ensuring the real-time performance and accuracy of the current data.
[0075] The control unit has a preset stall threshold, which is set based on the typical range of the operating current of the motor 115 when it is in a stall state.
[0076] After receiving current data from the current detection unit, the control unit accurately compares the real-time acquired current data with a preset stall threshold. If the comparison result shows that the current data at a certain moment is equal to or exceeds the stall threshold, the control unit determines that the motor 115 is currently in a stall state according to the preset control logic.
[0077] Once the motor 115 is determined to be in a stalled state, the control unit immediately sends a stop command to the motor 115, causing the motor 115 to stop rotating. This measure aims to effectively prevent the motor 115 from continuing to operate in a stalled state, preventing excessive wear and overheating of the internal mechanical structure of the motor 115 due to the inability of the motor 115's output shaft to rotate freely under mechanical limiting. At the same time, it avoids irreversible electrical damage to key components such as the motor 115 windings and drive circuit due to excessive current in the stalled state, thereby ensuring the service life and operational stability of the motor 115.
[0078] When the control unit detects that the motor 115 is in a stalled state, it simultaneously activates the electronic lock 100 state judgment logic. Based on the mechanical structure characteristics and working principle of the electronic lock 100, when the bolt 160 is completely disengaged from the bolt groove under the drive of the motor 115, causing the electronic lock 100 to reach the unlocked state, the motor 115 will enter a stalled state due to mechanical limitation; similarly, when the bolt 160 is fully inserted into the bolt groove under the reverse drive of the motor 115, causing the electronic lock 100 to reach the locked state, the motor 115 will also enter a stalled state due to mechanical limitation. Therefore, the control unit can use the stalled state of the motor 115 as a characteristic signal to help determine whether the electronic lock 100 is currently in an unlocked or locked state, providing a reliable basis for the intelligent control and state management of the electronic lock 100.
[0079] When the control unit determines that the motor 115 is in a stalled state based on the aforementioned current detection and comparison logic, it synchronously initiates the signal detection process of the Hall sensor 141. The Hall sensor 141 generates a Hall signal during operation. If the magnet 142 mounted on the shaft 111 enters the effective detection area of the Hall sensor 141 during rotation, the Hall sensor 141, based on the Hall effect principle, generates a first Hall signal corresponding to the magnetic field characteristics of the magnet 142. If the magnet 142 mounted on the shaft 111 does not enter the effective detection area of the Hall sensor 141 during rotation, the Hall sensor 141 generates a second Hall signal. The first Hall signal corresponds to a high level, and the second Hall signal corresponds to a low level, or vice versa.
[0080] The control unit determines the door opening direction based on the level state of the Hall signal. Specifically, there are two preset judgment logic modes: Firstly, when the control unit receives the first Hall signal, it determines, according to a preset correspondence, that the door where the electronic lock 100 is located is in the right-opening direction; when the control unit receives the second Hall signal, it determines that the door is in the left-opening direction.
[0081] Secondly, when the control unit receives the first Hall signal, it determines that the door is opening to the left; when it receives the second Hall signal, it determines that the door is opening to the right.
[0082] The two judgment modes mentioned above are preset and flexibly selected by the electronic lock 100 to meet the technical requirements for accurate judgment of the door opening direction in different application scenarios. Through the door opening direction judgment mechanism based on Hall signal level, the control unit can realize intelligent identification and precise management of the door opening direction of the electronic lock 100, providing important status information support for the automated control and security protection functions of the electronic lock 100.
[0083] Step S1300: Control the motor to rotate forward. When the current detected by the current detection unit reaches the stall threshold, control the motor to stop. If the trigger count of the photoelectric sensor reaches the first threshold, proceed to the next step. Once the control unit determines the opening direction of the door, it immediately sends a forward drive command to the motor 115, controlling the motor 115 to enter the forward rotation working mode. During the forward rotation of the motor 115, the gear plate 120, the rotating shaft 111, and the latch 160 are driven to rotate synchronously in sequence.
[0084] Meanwhile, the control unit continuously sends detection commands to the current detection unit, driving the current detection unit to monitor the operating current of the motor 115 in real time and continuously. The current detection unit outputs the current data acquired at each moment as an electrical signal to the control unit. The control unit compares the real-time received current data with a preset stall threshold. If the current data at a certain moment reaches or exceeds the stall threshold, the control unit immediately sends a stop command to the motor 115 according to a preset control strategy, causing the motor 115 to stop rotating, thus preventing damage to the motor 115 due to overload operation in a stalled state.
[0085] During the calibration process of the electronic lock 100, the control unit synchronously initiates the operation control of the photoelectric sensor 114, continuously driving the photoelectric sensor 114 to a stable working state. Multiple light-blocking plates 130 are fixedly disposed on the gear disk 120. During the rotation of the gear disk 120, these light-blocking plates 130 sequentially enter the light emission path of the photoelectric sensor 114, blocking the light emitted by the photoelectric sensor 114. When the light-blocking plates 130 block the light, the photoelectric sensor 114 generates a light-blocking signal based on the photoelectric effect principle and outputs this light-blocking signal to the control unit in the form of an electrical signal.
[0086] In this step S1300, the control unit automatically performs a trigger count once for each light-blocking signal received from the photoelectric sensor 114. That is, each time the light-blocking plate 130 blocks the light from the photoelectric sensor 114, the trigger count value increases by one unit.
[0087] The control unit has a preset first threshold. During the execution of step S1300, the control unit monitors the change in the trigger count in real time. If the trigger count reaches or exceeds the preset first threshold, the control unit determines that step S1300 has been completed and can automatically proceed to the subsequent calibration steps; otherwise, if the trigger count never reaches the first threshold, the control unit determines that the calibration operation has failed, automatically triggers the calibration process restart mechanism, and re-executes the calibration method of the electronic lock 100.
[0088] Once step S1300 is successfully completed, the control unit automatically clears the trigger count, resetting the trigger count value to its initial state. This provides an accurate counting reference for subsequent calibration steps, ensuring the accuracy and reliability of the entire calibration process.
[0089] To facilitate a clearer understanding of the technical solution of this invention, a specific embodiment is given below: In this embodiment, four light-blocking plates 130 are evenly distributed on the toothed disk 120, and the preset first threshold is set to 3. During the execution of calibration step S1300, as the toothed disk 120 rotates, the light-blocking plates 130 sequentially block the light from the photoelectric sensor 114, and count accordingly. When the triggered count value reaches or exceeds 3, the control unit determines that step S1300 has been completed and can proceed to the next calibration operation.
[0090] Step S1400: Control the motor to reverse. When the current detected by the current detection unit reaches the stall threshold, control to stop. If the trigger count of the photoelectric sensor reaches the second threshold, it is determined that the calibration is completed. After completing the aforementioned step S1300 and meeting the predetermined conditions, the control unit immediately sends a reverse drive command to the motor 115, controlling the motor 115 to operate in reverse. During the reverse rotation of the motor 115, the gear plate 120, the rotating shaft 111, and the locking tongue 160 are driven to move synchronously in sequence.
[0091] Meanwhile, the control unit continuously outputs detection commands to the current detection unit, driving the current detection unit to monitor the operating current of the motor 115 in real time and continuously during reverse operation. The current detection unit feeds back the current data detected at each moment to the control unit in the form of an electrical signal in real time. The control unit compares the real-time received current data with the preset stall threshold. Once the current data at a certain moment reaches or exceeds the stall threshold, the control unit immediately sends a stop command to the motor 115 according to the preset control strategy, causing the motor 115 to stop running, thereby effectively preventing the motor 115 from being damaged due to overload operation in the stall state.
[0092] In step S1400, when the control unit stops the motor 115, a trigger counting mechanism based on the signal from the photoelectric sensor 114 is simultaneously activated. Specifically, the control unit continuously receives light-blocking signals from the photoelectric sensor 114. These signals are generated because the light-blocking plate 130 on the gear disk 120 blocks the light emitted by the photoelectric sensor 114 during rotation. Each time a light-blocking signal is received, the control unit automatically performs a trigger count, increasing the trigger count by one unit.
[0093] The control unit also presets a second threshold. During the execution of step S1400, the control unit monitors the changes in the trigger count in real time. If the trigger count reaches or exceeds the preset second threshold, the control unit determines that the electronic lock 100 has completed the calibration operation according to the preset judgment logic and can enter the subsequent normal working mode or standby state; conversely, if the trigger count never reaches the second threshold, the control unit determines that the calibration operation has failed, automatically triggers the calibration process restart mechanism, and re-executes the electronic lock calibration method to ensure that the various performance indicators of the electronic lock 100 meet the design requirements.
[0094] To more clearly illustrate the technical solution of the present invention, a specific embodiment is given below: In this embodiment, the first threshold and the second threshold are set to equal values, for example, both are set to 3 (the specific values can be flexibly adjusted according to the actual situation). In step S1400, as the gear disk 120 rotates, the light-blocking plate 130 sequentially blocks the light from the photoelectric sensor 114, triggering a corresponding count. When the trigger count reaches or exceeds 3, the control unit determines that the electronic lock 100 has completed calibration; if the trigger count does not reach 3, the calibration method is re-executed.
[0095] Based on any embodiment of the electronic lock calibration method of the invention, a step parallel to the step of determining that calibration is complete is also included, combined with... Figure 12 The specific steps are as follows: Step S1410: Receive the level signal detected and acquired by the Hall sensor; During step S1400, when the control unit determines that the motor 115 is in a stalled state based on the preset current monitoring and comparison logic, it simultaneously initiates the signal reception and processing process of the Hall sensor 141. At this time, the Hall sensor 141 detects the magnet 142 set on the rotating shaft 111 in real time and generates a corresponding Hall signal, which is a level signal.
[0096] When the motor 115 is in a stalled state, the direction of rotation of the motor 115 determines the position of the latch 160. The level of the Hall signal can be used to accurately determine whether the motor 115 is in a locked or unlocked state.
[0097] When the motor 115 is stalled, there are two possible mechanical action scenarios: First, if the motor 115 stalls in the reverse direction, the motor 115 drives the latch 160 to move towards the latch groove through the mechanical transmission between the gear plate 120 and the rotating shaft 111, and finally makes the latch 160 fully extend into the latch groove, realizing the locking function of the electronic lock 100; Second, if the motor 115 stalls in the reverse direction, the motor 115 drives the latch 160 to move away from the latch groove through the same mechanical transmission path, making the latch 160 completely exit the latch groove, realizing the unlocking function of the electronic lock 100.
[0098] Based on the correspondence between the operation of the motor 115 and the position of the latch 160, the control unit can determine whether the electronic lock 100 is currently in a locked or unlocked state by comprehensively analyzing the stall state of the motor 115 and the level of the Hall signal output by the Hall sensor 141.
[0099] Step S1420: If the level signal is a first potential, then the electronic lock is determined to be in a locked state; if the level signal is a second potential, then the electronic lock is determined to be in an unlocked state. The electronic lock 100 has at least two magnets 142 on its rotating shaft 111 and is equipped with a Hall sensor 141. The Hall sensor 141 is based on the Hall effect principle and can detect changes in the surrounding magnetic field and output corresponding electrical signals.
[0100] When the electronic lock 100 is in the locked state, the motor 115 drives the transmission components such as the gear 120 and the rotating shaft 111 to rotate, causing one of the magnets 142 to approach the Hall sensor 141. At this time, the Hall sensor 141 generates a first Hall signal due to the magnetic field of the magnet 142. In this embodiment, the first Hall signal corresponds to a first level.
[0101] When the electronic lock 100 is in the unlocked state, the transmission components such as the motor 115, gear 120, and shaft 111 operate, causing both magnets 142 to move away from the Hall sensor 141. Under these conditions, the magnetic field environment of the Hall sensor 141 changes, thereby generating a second Hall signal, which corresponds to a second voltage level.
[0102] There are two possible combinations for setting the first and second levels: one is that the first level is high and the second level is low; the other is that the first level is low and the second level is high.
[0103] When the control unit controls the motor 115 to reverse, and detects that the motor 115 is in a stalled state, it receives the Hall signal sent by the Hall sensor 141 in real time. If the Hall signal received by the control unit is the first Hall signal, it determines that the electronic lock 100 is in a locked state according to a preset judgment logic; otherwise, if the Hall signal received by the control unit is the second Hall signal, it determines that the electronic lock 100 is in an unlocked state. By combining the stalled state of the motor 115 with the level of the Hall signal, this method can achieve accurate and reliable identification of the state of the electronic lock 100, providing strong technical support for the automated control of the electronic lock 100.
[0104] Based on any embodiment of the invented electronic lock calibration method, in the step of determining the opening direction of the door where the electronic lock is located based on the high or low level signal detected by the Hall sensor, combined with... Figure 13 It also includes the following specific steps: Step S1210: If the level signal is a first level, then the door is determined to be a right-opening door; if the level signal is a second level, then the door is determined to be a left-opening door. The control unit outputs a reverse drive command to the motor 115, controlling the motor 115 to reverse. The motor 115 sequentially drives the gear plate 120 and the rotating shaft 111 to move, driving the locking tongue 160 to perform corresponding movement operations, so as to realize the unlocking or locking action of the electronic lock 100.
[0105] Meanwhile, the control unit continuously monitors the operating status of the motor 115 in real time through the current detection unit. When the motor 115 can no longer rotate because the latch 160 reaches its limit position (e.g., the latch 160 is fully inserted into the latch groove to lock, or fully withdrawn from the latch groove to unlock), the operating current of the motor 115 will change significantly. By detecting abnormal changes in the current of the motor 115, the current detection unit enables the control unit to accurately determine that the electronic lock 100 is in a stalled state.
[0106] Meanwhile, the control unit detects the magnet 142 set on the rotating shaft 111 based on the Hall sensor 141 and outputs the corresponding Hall signal.
[0107] The first Hall signal corresponds to a first voltage level, and the second Hall signal corresponds to a second voltage level. When the control unit receives the first Hall signal, it determines that the electronic lock 100 is in a locked state according to a preset judgment logic.
[0108] The control unit also pre-stores setting information for the door opening direction. When the control unit determines that the electronic lock 100 is locked based on the first Hall signal, it further analyzes and judges the pre-stored door opening direction setting information. If the currently received Hall signal is the first Hall signal, and the electronic lock 100 is locked, the control unit, considering all the above conditions, finally confirms that the electronic lock 100 is locked and the corresponding door is in a right-opening state.
[0109] Alternatively, when the Hall signal received by the control unit is a second Hall signal, the electronic lock 100 is determined to be in an unlocked state.
[0110] The control unit also pre-stores setting information for the door opening direction. When the control unit determines that the electronic lock 100 is in the unlocked state based on the second Hall signal, it further analyzes and judges the information by combining it with the pre-stored door opening direction setting information. If the currently received Hall signal is the second Hall signal, and the electronic lock 100 is in the unlocked state, the control unit, considering all the above conditions, finally confirms that the electronic lock 100 is in the unlocked state and the corresponding door is in the left-opening state. Through this multi-dimensional and multi-condition comprehensive judgment mechanism, the accuracy and reliability of the electronic lock 100's state recognition and door opening direction judgment can be significantly improved, providing solid technical support for the intelligent control of the electronic lock 100.
[0111] Step S1220: Record and store the opening direction of the door; After the control unit completes the acquisition of the door opening direction, it executes the data storage process: on the one hand, it stores the acquired door opening direction information in a preset cache module to achieve fast access to the door opening direction information; on the other hand, it simultaneously writes the door opening direction information into the configuration information storage unit of the electronic lock, thereby constructing a complete and stable door opening direction data recording system, providing reliable data support for the subsequent call to the door opening direction information during the operation of the electronic lock, and ensuring that the electronic lock can accurately perform the corresponding operation according to the door opening direction.
[0112] Based on any embodiment of the electronic lock calibration method of the invention, a step parallel to the step of proceeding to the next step if the trigger count of the photoelectric sensor reaches a first threshold is also included, and the specific steps are as follows: Step S1310: If the trigger count of the photoelectric sensor reaches the first threshold and the jump count of the level signal of the Hall sensor reaches the third threshold, then proceed to the next step. The control unit sends a reverse command to the motor 115, driving the motor 115 to rotate in the opposite direction. During the reverse rotation of the motor 115, the working status of the motor 115 is continuously monitored until the motor 115 enters a stall state due to the mechanical components such as the locking tongue 160 reaching their limit positions. For ease of subsequent description and distinction, this stall state is defined as the reverse stall state.
[0113] When motor 115 is in a reverse stall state, the control unit immediately sends a forward rotation command to motor 115, causing motor 115 to start rotating in the forward direction. Similarly, during the forward rotation of motor 115, the status of motor 115 is continuously monitored until motor 115 enters a stall state again due to mechanical components such as locking tongue 160 reaching another extreme position. This stall state is defined as the forward stall state.
[0114] During the forward rotation of motor 115, the control unit simultaneously performs two data statistics tasks: one is to count the trigger count of photoelectric sensor 114, and the other is to count the jump count of the level signal of Hall sensor 141.
[0115] In this embodiment, four light-blocking plates 130 are specially configured for the photoelectric sensor 114, and these light-blocking plates 130 are evenly arranged on the gear disk 120. During the forward rotation of the motor 115, as the gear disk 120 rotates, the light-blocking plates 130 will sequentially block the light path of the photoelectric sensor 114, thereby triggering the photoelectric sensor 114 to generate a signal. During the forward rotation of the motor 115, the trigger count of the photoelectric sensor 114 should be at least greater than or equal to a preset first threshold. In this embodiment, it is recommended to set the first threshold to 3 times, but it should be noted that this value is only an example and should not be construed as a limitation of the present invention. In actual applications, it can be flexibly adjusted according to specific design requirements and operating conditions.
[0116] In this embodiment, the Hall sensor 141 is equipped with two magnets 142, which are symmetrically arranged on the rotating shaft 111. Based on the Hall effect principle, the Hall sensor 141 can detect changes in the surrounding magnetic field in real time. When the Hall sensor 141 does not detect a magnet 142, it generates a second Hall signal; when it detects a magnet 142, it generates a first Hall signal, and the level of the first Hall signal is different from that of the second Hall signal. This results in the Hall sensor 141 experiencing a level transition between not detecting a magnet 142 and detecting a magnet 142 during the forward rotation of the motor 115, and another level transition between detecting a magnet 142 and not detecting a magnet 142. In other words, two level transitions occur during the complete process of the Hall sensor 141 transitioning from not detecting a magnet 142 to detecting a magnet 142 and then back to not detecting a magnet 142.
[0117] The control unit receives the first Hall signal and the second Hall signal uploaded by the Hall sensor 141 in real time, enabling it to accurately determine the number of level transitions and generate a corresponding transition count. During the forward rotation of the motor 115, the transition count of the Hall sensor 141 should be at least greater than or equal to a preset third threshold. In this embodiment, it is recommended to set the third threshold to 2 times. However, this value is only an example and can be adjusted according to specific circumstances in actual applications. It should not be considered a limitation of the present invention.
[0118] The control unit verifies whether the motor 115 has smoothly transitioned from the reverse stall state to the forward stall state as expected by comprehensively analyzing the trigger count of the photoelectric sensor 114 and the jump count of the Hall sensor 141. After completing the above verification, the control unit immediately clears the trigger count of the photoelectric sensor 114 and the jump count of the Hall sensor 141 to prepare data for the smooth implementation of subsequent steps, ensuring the accuracy and reliability of the entire control process.
[0119] Based on any embodiment of the electronic lock calibration method of the invention, a step parallel to the step of determining that calibration is complete if the photoelectric sensor triggers a count is obtained is also included. The specific steps are as follows: Step S1430: If the trigger count of the photoelectric sensor reaches the second threshold and the jump count of the Hall sensor reaches the fourth threshold, then the calibration is determined to be complete. The control unit sends a forward rotation command to the motor 115, driving the motor 115 to begin rotating in the forward direction. During the forward rotation of the motor 115, the control unit continuously and in real time monitors the motor 115 through the current detection unit to determine whether the motor 115 has reached a forward rotation stall state. When the motor 115 can no longer rotate in the forward direction due to the movement of mechanical components such as the locking tongue 160 to the limit position, i.e., it enters the forward rotation stall state, the control unit immediately sends a reverse rotation command to the motor 115, causing the motor 115 to begin rotating in the reverse direction. Similarly, during the reverse rotation of the motor 115, the control unit continuously monitors the status of the motor 115 until the motor 115 enters the reverse rotation stall state due to the movement of mechanical components such as the locking tongue 160 to another limit position.
[0120] During the reverse rotation of motor 115, the control unit simultaneously performs statistical work on two key data points: the trigger count of photoelectric sensor 114 and the jump count of the level signal of Hall sensor 141.
[0121] During the reverse rotation of motor 115, as the gear disk 120 rotates, the light-blocking plate 130 sequentially blocks the light path of photoelectric sensor 114, thereby triggering photoelectric sensor 114 to generate a signal. During the reverse rotation of motor 115, the trigger count of photoelectric sensor 114 should be at least greater than or equal to a preset second threshold. In this embodiment, it is recommended to set the second threshold to 3 times. However, it should be clearly pointed out that this value is only an example. In actual applications, it can be flexibly adjusted according to specific design requirements, motor 115 performance, and operating conditions, and should not be construed as a limitation of the present invention.
[0122] During the reverse rotation of motor 115, the rotating shaft 111 rotates, synchronously rotating the magnet 142 mounted on the shaft 111. When the Hall sensor 141 does not detect the magnet 142, it generates a second Hall signal; when it detects the magnet 142, it generates a first Hall signal, and the level of the first Hall signal is different from that of the second Hall signal. During the reverse rotation of motor 115, as the rotating shaft 111 rotates, the Hall sensor 141 will experience a level transition between not detecting the magnet 142 and detecting the magnet 142, and another level transition will occur between detecting the magnet 142 and not detecting the magnet 142. The control unit can determine the number of level transitions and generate a corresponding transition count by receiving the first Hall signal and the second Hall signal uploaded by the Hall sensor 141 in real time. During the reverse rotation of motor 115, the transition count of Hall sensor 141 should be at least greater than or equal to a preset fourth threshold. In this embodiment, it is recommended to set the fourth threshold to 2 times. However, this value is only an example and can be adjusted according to specific circumstances in actual applications. It should not be regarded as a limitation of the present invention.
[0123] The control unit, by comprehensively analyzing the trigger count of the photoelectric sensor 114 and the jump count of the Hall sensor 141, can verify whether the motor 115 has smoothly transitioned from the forward stall state to the reverse stall state as expected. This verification process is crucial for assisting in determining whether the electronic lock 100 has completed calibration. Once the control unit completes the above calibration verification, it determines that the electronic lock 100 has been calibrated. It then immediately clears the trigger count of the photoelectric sensor 114 and the jump count of the Hall sensor 141 to prepare data for subsequent possible operations, ensuring the stability and reliability of the entire electronic lock 100 control system.
[0124] Based on any embodiment of the electronic lock calibration method of the invention, if the current detection unit detects that the current acquired by the motor reaches a preset stall threshold, controls the motor to stop, and determines the opening direction of the door where the electronic lock is located based on the high or low level signal detected by the Hall sensor, the specific steps are as follows: Step S1230: If no light-blocking signal is received from the photoelectric sensor during motor reversal, the calibration is determined to have failed. During the reverse operation of motor 115, when the gear disk 120 begins to rotate under the drive of motor 115, multiple light-blocking plates 130 disposed on the gear disk 120 will move synchronously. Since the photoelectric sensor 114 is installed at a position opposite to the gear disk 120, the light emitted by the photoelectric sensor 114 will be blocked during the movement of the light-blocking plates 130. When the light is blocked by the light-blocking plates 130, a light-blocking signal is immediately generated and uploaded to the control unit in real time in the form of an electrical signal.
[0125] During the reverse rotation of motor 115, the control unit continuously and in real time monitors and analyzes the signal uploaded by photoelectric sensor 114. If the control unit does not receive the light-blocking signal uploaded by photoelectric sensor 114, it indicates that there is a malfunction in the internal components of electronic lock 100. This malfunction may originate from several aspects, such as a malfunction in motor 115 itself, which prevents it from driving the gear disk 120 to rotate normally, thus preventing the light-blocking plate 130 from blocking the light from photoelectric sensor 114 as expected; or a malfunction in photoelectric sensor 114 itself, such as damage to the photoelectric conversion element or a break in the signal transmission line, which prevents it from generating and uploading the light-blocking signal normally.
[0126] When the control unit does not receive a light-blocking signal from the photoelectric sensor 114 during the reverse rotation of motor 115, it determines that the electronic lock 100 has failed calibration. This determination will provide an accurate basis for subsequent fault handling and maintenance operations, helping to quickly locate and resolve faults in the electronic lock 100, and ensuring the normal operation and safety of the electronic lock 100.
[0127] Based on any embodiment of the invented electronic lock calibration method, in the step after controlling the motor to rotate forward, combined with Figure 14 It also includes the following steps: Step S1510: Collect the first running time from the start of the motor's forward rotation to its stop. In step S1300, the control unit controls the motor 115 to rotate forward until it stops rotating forward. During this process, the running time of the motor 115 is collected and defined as the first running time.
[0128] In this specific configuration, four light-blocking plates 130 are evenly distributed on the gear disk 120, indicating that the included angle between any two adjacent light-blocking plates 130 is 90°. Before the motor 115 starts rotating forward, one light-blocking plate 130 is positioned within the light emission path of the photoelectric sensor 114. Thus, when the motor 115 starts rotating forward, the light-blocking plate 130 blocks the light emitted by the photoelectric sensor 114, causing the photoelectric sensor 114 to output a light-blocking signal, thereby increasing the trigger count by one bit. That is, at the instant the motor 115 starts rotating forward, the initial value of the trigger count is 1.
[0129] When motor 115 rotates forward, it drives gear 120 to rotate synchronously. As gear 120 rotates, each light-blocking plate 130 sequentially blocks the light emitted by photoelectric sensor 114. Each time the light is blocked, the trigger count increases by one bit. In step S1300, when the trigger count of photoelectric sensor 114 reaches a first threshold, the process proceeds to the next step S1400. For ease of explanation, a first threshold of 3 is used as an example here, but this example should not be construed as limiting the scope of protection of this invention.
[0130] Given that the initial trigger count is 1 when motor 115 starts rotating forward, when motor 115 drives the gear disk 120 to rotate, causing the trigger count to reach 3, it indicates that two light-blocking plates 130 subsequently block the light emitted by photoelectric sensor 114. Since the angle between two adjacent light-blocking plates 130 is 90°, it can be inferred that the gear disk 120 rotated 180°. Therefore, the first running time is the time taken for motor 115 to rotate 180°.
[0131] Step S1520: After the acquisition motor stops rotating forward, it starts rotating in reverse until the second running time after calibration is completed; In step S1400, the control unit controls the motor 115 to reverse until the reversal stops. During this period, the running time of the motor 115 is collected and defined as the second running time. This second running time is also the running time consumed by the motor 115 to complete the reversal to the calibration process in step S1400.
[0132] Before the motor 115 starts its reverse operation, the trigger count needs to be reset to zero. At this time, a light-blocking plate 130 is positioned within the light emission path of the photoelectric sensor 114. Thus, when the motor 115 starts its reverse operation, the light-blocking plate 130 blocks the light emitted by the photoelectric sensor 114, causing the photoelectric sensor 114 to output a light-blocking signal, thereby increasing the trigger count by one bit. That is, at the instant the motor 115 starts its reverse operation, the initial value of the trigger count is set to 1.
[0133] When motor 115 rotates forward, it drives gear 120 to rotate synchronously. As gear 120 rotates, each light-blocking plate 130 sequentially blocks the light emitted by photoelectric sensor 114. Each time a blockage occurs, the trigger count increases by one bit. In step S1400, when the trigger count of photoelectric sensor 114 reaches the second threshold, the control unit determines that the electronic lock 100 has completed the calibration operation and then controls the motor to stop running. For ease of explanation, a second threshold of 3 is used as an example here, but this example should not be construed as limiting the scope of protection of this invention.
[0134] Given that the initial trigger count is 1 when motor 115 starts reversing, when motor 115 drives the gear disk 120 to rotate, causing the trigger count to reach 3, it indicates that two light-blocking plates 130 subsequently block the light emitted by photoelectric sensor 114. Since the angle between two adjacent light-blocking plates 130 is 90°, it can be inferred that the gear disk 120 rotated 180°. Therefore, the second running time is the time taken for motor 115 to rotate 180°.
[0135] Step S1530: Calculate the third running time required for the motor to drive the rotating component to rotate a predetermined angle based on the first running time and the second running time; After acquiring the first running time and the second running time respectively, the control unit performs a calculation operation to determine the third running time required for the motor 115 to drive the gear 120 to rotate a predetermined angle. For example, it determines the third running time required for the motor 115 to drive the gear 120 to rotate 180°.
[0136] Specifically, taking the change of the operating state of an electronic lock as an example, when the motor 115 needs to drive the gear plate 120 to rotate 180° so that the electronic lock changes from the locked state to the locked reset state, the control unit can obtain the time taken for the electronic lock to run from the locked state to the locked reset state based on the first running time and the second running time obtained by the preset calculation method.
[0137] Similarly, the control unit can also calculate, based on the same calculation logic, the time required for the electronic lock to transition from the locked / reset state to the unlocked state, the time required to transition from the unlocked state to the unlock / reset state, and the time required to transition from the unlock / reset state to the locked state. After the calculation is completed, the control unit writes the calculated time data into the electronic lock's configuration information storage unit. This configuration allows for convenient and quick retrieval of these pre-calculated and stored time data during subsequent operation of the electronic lock, improving the accuracy and efficiency of the electronic lock's operation control.
[0138] This invention provides an electronic lock calibration device, combined with Figure 15 The electronic lock calibration device includes: The receiving module 600 receives and responds to the calibration command and controls the motor to reverse. The motor drives the transmission component to rotate, thereby driving the locking tongue linked with the transmission component to move. The transmission component is provided with a Hall sensor and a photoelectric sensor in sequence on its circumference, which are used to sense the magnet and multiple light-blocking plates set on the transmission component, respectively. The direction determination module 700, if the current detection unit detects that the current acquired by the motor reaches the preset stall threshold, controls the motor to stop, and determines the opening direction of the door where the electronic lock is located based on the high or low level signal detected by the Hall sensor. The intermediate module 800 controls the motor to rotate forward. When the current detected by the current detection unit reaches the stall threshold, the motor is stopped. If the trigger count of the photoelectric sensor reaches the first threshold, the next step is initiated. The calibration module 900 controls the motor to reverse. When the current detected by the current detection unit reaches the stall threshold, the motor is stopped. If the trigger count of the photoelectric sensor reaches the second threshold, the calibration is considered complete.
[0139] The present invention also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the electronic lock calibration method of any embodiment of the present invention.
[0140] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments of the present invention can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a computer-readable storage medium such as a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM).
[0141] In summary, the electronic lock calibration method of the present invention can automatically calibrate electronic locks without manual intervention, thereby improving the intelligence of electronic locks and reducing labor costs.
[0142] Those skilled in the art will understand that the steps, measures, and solutions in the various operations, methods, and processes discussed in this application can be alternated, modified, combined, or deleted. Furthermore, other steps, measures, and solutions in the various operations, methods, and processes discussed in this application can also be alternated, modified, rearranged, decomposed, combined, or deleted. Furthermore, steps, measures, and solutions in the prior art that are similar to those disclosed in this application can also be alternated, modified, rearranged, decomposed, combined, or deleted.
[0143] The above description is only a partial embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An electronic lock calibration method, characterized in that, Includes the following steps: The system receives and responds to calibration commands, and controls the motor to reverse. The motor drives the transmission component to rotate, thereby driving the locking tongue linked with the transmission component to move. The transmission component is provided with Hall sensors and photoelectric sensors in sequence on its circumference, which are used to sense the magnet and multiple light-blocking plates set on the transmission component, respectively. If the current detection unit detects that the current acquired by the motor reaches the preset stall threshold, it controls the motor to stop, and determines the opening direction of the door where the electronic lock is located based on the high or low level signal of the received Hall sensor. The motor is controlled to rotate forward. When the current detected by the current detection unit reaches the stall threshold, the motor is controlled to stop. If the trigger count of the photoelectric sensor reaches the first threshold, the next step is initiated. The motor is controlled to reverse. When the current detected by the current detection unit reaches the stall threshold, the motor is controlled to stop. If the trigger count of the photoelectric sensor reaches the second threshold, the calibration is determined to be complete.
2. The electronic lock calibration method as described in claim 1, characterized in that, It also includes steps parallel to the step of determining whether calibration is complete, as follows: Receives the level signal detected and acquired by the Hall sensor; If the signal level is the first level, the electronic lock is determined to be in the locked state; if the signal level is the second level, the electronic lock is determined to be in the unlocked state.
3. The electronic lock calibration method as described in claim 1, characterized in that, The step of determining the unlocking direction of the electronic lock based on the high or low level signal detected by the Hall sensor also includes the following specific steps: If the level signal is at the first level, then the door is determined to be a right-opening door; if the level signal is at the second level, then the door is determined to be a left-opening door. Record and store the opening direction of the door.
4. The electronic lock calibration method as described in claim 1, characterized in that, It also includes a step parallel to the step of proceeding to the next step if the trigger count of the photoelectric sensor reaches the first threshold, and the specific steps are as follows: If the trigger count of the photoelectric sensor reaches the first threshold and the jump count of the level signal of the Hall sensor reaches the third threshold, then proceed to the next step.
5. The electronic lock calibration method as described in claim 1, characterized in that, It also includes a step parallel to the step of determining that calibration is complete if the trigger count of the photoelectric sensor reaches the second threshold, and the specific steps are as follows; If the trigger count of the photoelectric sensor reaches the second threshold and the jump count of the level signal of the Hall sensor reaches the fourth threshold, then the calibration is considered complete.
6. The electronic lock calibration method as described in claim 1, characterized in that, The steps following controlling the motor to rotate forward also include the following: The first running time from the start of the motor's forward rotation to its stop is collected; After the acquisition motor stops rotating forward, it starts rotating in reverse until the second running time after calibration is completed; Based on the first running time and the second running time, a third running time is calculated to obtain the time required for the motor to drive the transmission component to rotate by a predetermined angle.
7. An electronic lock, characterized in that, The device includes a control unit, a motor, a transmission component, a latch, a photoelectric sensor, and a Hall sensor. The motor is linked to the latch via the transmission component. The transmission component is provided with a magnet and multiple light-blocking plates. The Hall sensor and the photoelectric sensor are arranged circumferentially along the transmission component and are respectively used to sense the magnet and the multiple light-blocking plates. The control unit is used to execute the electronic lock calibration method as described in any one of claims 1 to 6.
8. An electronic lock calibration device, characterized in that, include: The receiving module receives and responds to calibration commands and controls the motor to reverse. The motor drives the transmission component to rotate, thereby driving the locking tongue linked with the transmission component to move. The transmission component is provided with Hall sensors and photoelectric sensors in sequence on its circumference, which are used to sense the magnet and multiple light-blocking plates set on the transmission component, respectively. The direction determination module controls the motor to stop if the current detection unit detects that the current acquired by the motor reaches a preset stall threshold, and determines the opening direction of the door where the electronic lock is located based on the high or low level signal detected by the Hall sensor. The intermediate module controls the motor to rotate forward. When the current detected by the current detection unit reaches the stall threshold, the motor is stopped. If the trigger count of the photoelectric sensor reaches the first threshold, the next step is initiated. The calibration module controls the motor to reverse. When the current detected by the current detection unit reaches the stall threshold, the motor is stopped. If the trigger count of the photoelectric sensor reaches the second threshold, the calibration is considered complete.
9. A computer device comprising a central processing unit and a memory, characterized in that, The central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, It stores, in the form of computer-readable instructions, a computer program implemented according to any one of claims 1 to 6, which, when invoked by a computer, executes the steps included in the corresponding method.