The present invention relates to an electric lock, and more particularly to an electric lock capable of reducing development difficulty.
Generally, an electric lock has an input unit, a controller, a motor and a driving module. The controller of the electric lock of the prior art must control the overall operations of the electric lock. For example, the controller is configured to control the input unit to receive a user input according to a user interface program, verify the user input according to verification data, and control the motor to drive the driving module according to control parameters of the motor when verification of the user input is successful, in order to perform a locking/unlocking operation or a clutching operation. In a development process of the electric lock of the prior art, a developer must integrate the user interface program, the verification mechanism and the control parameters of the motor into a single controller. The user interface program, the verification mechanism and the control parameters of the motor cannot be developed separately in the electric lock of the prior art. Therefore, the development of the electric lock of the prior art is more difficult.
The present invention provides an electric lock and a control method thereof in order to solve the problems of the prior art.
The electric lock of the present invention comprises an input unit, a main controller electrically connected to the input unit, a driving module, a motor connected to the driving module and a motor controller independent of the main controller. The main controller comprises a processing unit configured to control the input unit to receive a user input. The motor controller stores control parameters of the motor. When the main controller receives the user input and determines that the motor controller is in a sleep mode, the main controller is configured to transmit a wake-up signal to the motor controller for waking up the motor controller. When the motor controller is woken up, the main controller is configured to transmit a control signal to the motor controller, and the motor controller is configured to control the motor to drive the driving module to drive a predetermined mechanism of the electric lock to move according to the control signal and the control parameters of the motor.
The control method of the electric lock of the present invention comprises providing an electric lock comprising an input unit, a main controller, a driving module, a motor and a motor controller, wherein the main controller comprises a processing unit, the motor controller is independent of the main controller and configured to store control parameters of the motor; the processing unit controlling the input unit to receive a user input; when the main controller receives the user input and determines that the motor controller is in a sleep mode, the main controller transmitting a wake-up signal to the motor controller for waking up the motor controller; and when the motor controller is woken up, the main controller transmitting a control signal to the motor controller, and the motor controller controlling the motor to drive the driving module to drive a predetermined mechanism of the electric lock to move according to the control signal and the control parameters of the motor.
In contrast to the prior art, the motor controller of the electric lock of the present invention is independent of the main controller. Therefore, the user interface program and the verification mechanism in the main controller and the control parameters of the motor in the motor controller can be developed separately, so as to reduce development difficulty of the electric lock. In addition, the motor controller of the electric lock of the present invention can enter the sleep mode when there is no predetermined operation required to be performed in order to reduce power consumption.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
The main controller 120 is electrically connected to the input unit 110. The main controller 120 comprises a user interface program 122, a processing unit 124 and a verification unit 126. The processing unit 124 is configured to control the input unit 110 to receive a user input according to the user interface program 122. For example, the processing unit 124 is configured to control the input unit 110 to receive a password, a fingerprint or a setting command according to the user interface program 122, and the processing unit 124 is further configured to perform a corresponding operation according to the password, the fingerprint or the setting command received by the input unit 110. When the input unit 110 receives a user input required to verified (such as a password or a fingerprint), the verification unit 126 is configured to compare the user input verification data (such as predetermined password or registered fingerprint data) pre-stored in the verification unit 126 to generate a comparison result. When the input unit 110 receives a user input comprising a setting command, the processing unit 124 is configured to perform a corresponding setting according to the user input, such as changing the verification data pre-stored in the verification unit 126 or resetting the electric lock 10.
The driving module 130 is configured to drive a predetermined mechanism of the electric lock 10 to move in order to perform a predetermined operation. For example, the predetermined mechanism can be a latch mechanism of the electric lock 10, and the driving module 130 is configured to drive the latch mechanism to move in order to perform a locking operation or an unlocking operation; or the predetermined mechanism can be a clutch mechanism of the electric lock 10, and the driving module 130 is configured to drive the clutch mechanism to move in order to perform the locking operation or the unlocking operation, but the present invention is not limited thereto. The motor 140 is connected to the driving module 130. When the motor 140 is rotated, the motor 140 is configured to drive the driving module 130 to move in order to perform the aforementioned operations.
The motor controller 150 is independent of the main controller 120. The motor controller 150 stores control parameters of the motor 140, such as motor forward and reverse running time, motor running compensation time, pulse width modulation (PWM) parameters and motor power supply voltage parameters, etc., but the present invention is limited thereto. The motor controller 150 is configured to control the motor 140 to rotate according to the control parameters of the motor 140 in order to further drive the driving module 130. In the first embodiment of the electric lock of the present invention, the motor controller 150 communicates with the main controller 120 through a wired connection. For example, the motor controller 150 is electrically connected to the main controller 120 through I2C, SPI, UART, USB, RS485, RS232, SDIO, etc. for communicating with the main controller 120, but the present invention is not limited thereto.
Please refer to
In addition, in the control method of the electric lock of the first embodiment of the present invention, the aforementioned steps need not be in the exact order shown. That is, the order of the steps can be changed and other steps can be inserted in between. For example, before step 210, the main controller 120 can enter a main sleep mode, and when the input unit 110 receives a user input (for example, a user presses a button or touches a touch panel), the input unit 110 can correspondingly generate a signal to wake up the main controller 120. On the other hand, the motor controller 150 can report to the main controller 120 that the predetermined operation is completed after controlling the motor 140 to drive the driving module 130 to complete the predetermined operation.
Furthermore, in other embodiments, when the processing unit 124 of the main controller 120 determines that the motor controller 150 is not in the sleep mode in step 240, the main controller 120 can directly transmits a control signal to the motor controller 150, that is, directly execute step 270.
Please refer to
Please refer to
In addition, in the control method of the electric lock of the second embodiment of the present invention, the aforementioned steps need not be in the exact order shown. That is, the order of the steps can be changed and other steps can be inserted in between. For example, before step 410, the main controller 120 can enter a main sleep mode, and when the input unit 110 receives a user input (for example, a user presses a button or touches a touch panel), the input unit 110 can correspondingly generate a signal to wake up the main controller 120. On the other hand, the motor controller 150 can report to the main controller 120 that the predetermined operation is completed after controlling the motor 140 to drive the driving module 130 to complete the predetermined operation.
Moreover, the electric lock 10, 20 of the present invention can further comprises a sensing module 160 configured to sense a state of the driving module 130 (such as relative positions or relative angles between components) to generate a sensing signal. The motor controller 150 can more accurately determine whether the predetermined operation is completed according to the sensing signal of the sensing module 160. In the aforementioned steps 280 and 480, the motor controller 150 controls the motor 140 to drive the driving module 130 according to the control signal, the sensing signal and the control parameters of the motor in order to perform the predetermined operation.
Furthermore, the main controller 120 and the motor controller 150 can communicate with each other through encrypted/decrypted signals according to a predetermined encryption method. For example, the main controller 120 can encrypt the wake-up signal, the control signal, and/or the sleep command according to the predetermined encryption method, and the motor controller can encrypt the state signal according to the predetermined encryption method. The predetermined encryption method can be AES, RSA, ECC, DSA, DES, MD5, SHA, etc., but the present invention is not limited thereto.
In contrast to the prior art, the motor controller 150 of the electric lock of the present invention is independent of the main controller 120. Therefore, the user interface program and the verification mechanism in the main controller 120 and the control parameters of the motor in the motor controller 150 can be developed separately, so as to reduce development difficulty of the electric lock. The motor controller 150 only needs to decrypt and interpret the encrypted signal transmitted from the main controller 120 and further perform the corresponding predetermined operation. Therefore, the motor controller 150 can work with main controllers with different user interface programs, processing units and verification units, and the main controller can work with motor controllers storing different control parameters, so as to achieve greater benefits. In addition, the motor controller 150 of the electric lock of the present invention can enter the sleep mode when there is no predetermined operation required to be performed in order to reduce power consumption. Furthermore, the main controller 120 and the motor controller 150 can communicate with each other according to a predetermined encryption method, so as to increase security of the electronic lock.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
111146386 | Dec 2022 | TW | national |