DIY Smart Lock Motor Driver With Battery Discharge Compensation
by GreenPAK™ in Circuits > Electronics
13 Views, 0 Favorites, 0 Comments
DIY Smart Lock Motor Driver With Battery Discharge Compensation
Most smart locks use batteries for their power supply, and the battery life is typically 6 months to 1 year. This time depends on the wireless technology used (Wi-Fi, Bluetooth, ZigBee), and how often the door is locked and unlocked. In many cases, the motor is powered by four AA batteries, and that is also used in this design example.
Smart lock manufacturers use varying mechanisms for detecting the completion of the deadbolt opening/closing: limit switches, accelerometer fixed on the shaft, hall sensor and magnets fixed on the gear, etc. All these require the associated external components along with the motor driver IC.
One of the deadbolt position detecting schemes is measuring the motor current and turning off the motor when the deadbolt locks while the motor current increases to a defined threshold, see Figure 1. This method doesn’t require special extra components. However, the threshold must be set relative to a specific supply voltage, usually fully charged batteries.
An improvement to the design is to measure the RMS current per motor and set different current levels to compensate for different battery voltages, see Figure 2. This Instructable describes how to configure the High Voltage GreenPAK™ IC for this design approach.
Below we described steps needed to understand how the solution has been programmed to create a smart lock motor driver. However, if you just want to get the result of programming, download GreenPAK software to view the already completed GreenPAK Design File. Plug the GreenPAK Development Kit to your computer and hit the program to design the solution.
Operation Principle
The behavior of the design can be divided into three sections, see Figure 3:
Motor stall checking: if the motor current is too high after 100 ms of starting the motor, the driver turns off the motor. Also, the motor current is measured at this time.
Current level setting: current CMP Vref is set depending on the motor current (set higher than measured value).
Overcurrent waiting: if the motor current becomes higher than the selected value during this time, then the motor will be turned off.
HV GreenPAK Design
RegFile for current CMP is used to measure motor current. There are 16 values, which are switched
from higher to lower, see Figure 5.
After 250 ms the Register File is switched by two values to set a new current level, as shown in Figure 6. When the motor current increases to this new current level, the motor will be turned off, see Figure 7.
For different power supply voltages and loads, the motor current will be different. For the higher motor current “motor off level” will become higher.
Application Circuit
PIN#2 Motor ON – rising edge turns on the motor.
PIN#3 Motor Direction – motor direction rotation: HIGH – forward rotation, LOW – reverse rotation.
VDD range: 2.3 V – 5.5 V.
VDD2 range: 3.6 V – 6.0 V.
Motor Test
Motor starting current is about 2 A at power supply 6.0 V, and after 200 mS decreases to the nominal value, which depends on the power supply voltage. See Figure 9 through Figure 12.
Design Operation Waveforms: Normal Operation
Design Operation Waveforms: Stalled Motor at the Start
Motor Stall Detection time is 100 ms. If the motor current is high during 100 ms after the start, the motor will be automatically turned off.
Conclusion
This Instructable describes one specific example for High Voltage GreenPAK, and how it can be customized for a particular motor and battery set. It is a very flexible and simple solution for motor control using configurable internal logic that supports designer preferences. The integration of the motor driver within GreenPAK means the entire circuit fits within a very small physical space.
The designer can tailor the circuitry for when the motor current or the power supply voltage is changing. GreenPAK also allows the design of constant current and constant voltage motor driver with embedded protection features like Overcurrent, Undervoltage, Overtemperature, etc.