Many smart locks use additional mechanical or electrical components to determine whether a deadboltis open or closed. It might be simple switches, or hall sensors with magnets, or an encoder. The design in this project doesn’t require any such additional components. The motor driver turns off the motor when deadbolt reaches open or closed state by motor current sensing.
Many smart locks use four AA batteries for power supply. In this case, the power supply voltage decreases from 6.5 V (charged batteries, 1.63 V each) to 3.6 V (discharged batteries, 0.9 V each) and the motor rotates with different speeds at 6 V and 3.6 V. Also, higher voltage might burn out the motor.
In this project, voltage regulation is used. The motor is controlled by PWM. When batteries are fully charged, the PWM duty cycle is approximately 50%, and increases while battery is discharging, so the regulated voltage stays unchanged.
Below we described steps needed to understand how the solution has been programmed to design the smart lock motor driver. However, if you just want to get the result of programming, download GreenPAK Designer 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.
This typical Application circuit requires only one external component – a current sense resistor.
The design has one input for driver control and another one for fault monitor:
PIN#2 – a Button for close/open the smart lock deadbolt.
PIN#14 – Error output. When the closing time is less than 1 Second (can’t close smart lock), this output goes HIGH.
The general block diagram is shown in Figure 4.
The smart lock is opened by a falling edge on PIN2 and is closed by a rising edge.
During the first 150ms, an internal circuit ignores the CCMP0 signal because during this time the starting current of motor is higher than at normal operation. After that, during normal operation, if motor current increases to 290 mA, the motor turns off.
A rising edge at PIN2 turns on the motor. The PWM duty cycle is changing depending on the power supply voltage. For example, at 6V the duty cycle value is at 50%. When batteries discharge to 3.6 V, the PWM duty cycle increases to approximately 83%. This behavior provides a constant level of the motor supply voltage at 3 V (regulated value), see Figure 6.
In addition, this design permits changing deadbolt direction during the opening or closing process. This can be useful in the case when the user changes his mind and wants to open the door after pressing the close button, see Figure 7.
The Error Output can be used to detect an event when the door can’t be closed. In our case the closing time is equal to 1 second and can be changed in a wide range.
When the closing time is less than 1 second, the Error Output goes HIGH. It will be reset after the next falling edge at PIN2.
Two parameters need to be measured to adjust the timings and control the circuit used in our design: motor starting time and motor current consumption.
Motor starting time is approximately 100 ms.
There is a lot of noise and our circuit will provide filtration where needed. The maximum value of the motor current consumption is 310 mA at 3 V power supply. RMS current is approximately 208 mA.
Voltage regulation is done by using PWM and Diff.Amp&Integrator blocks. Diff.Amp&Integrator Vref has an internal divide by 4:
Vref = Vdesired*Gain = 3 V * 0.25 = 0.75 V
where:
Vdesired – desired constant voltage for motor power supply;
Gain – internal Diff.Amp&Integrator gain is constant - 0.25.
Then the closest value from Vreg list is 0.768 V.
The Diff.Amp&Integrator outputs are connected to PWM block to increase and decrease the duty cycle depending on the measured voltage. When batteries are fully charged, the PWM duty cycle is 50% and more than 80% when batteries are discharged.
The overcurrent detection starts after delay (selected by DLY1) because when the motor is starting up, there is a current spike, see Figure 9. After that, the motor automatically turns off when the voltage drop across resistor R1 is higher than CCMP0 Vref value. DLY3 block is used to filter spikes and noise caused by the motor running.
CCMP0 Vref value is defined by the next equation:
Vref = Ipeak* Rsense * Gain = 0.3 A * 0.11 Ohm * 8 = 0.264 V
where:
Ipeak – peak motor current at normal operation, see Figure 10;
Rsense – sense resistor value;
Gain – current CMP gain, can be selected by register 8 or 4.
The closest value is 256 mV and 288 mV. Selected value is 256 mV to speed-up motor stall detection and decrease battery discharging.
An error means that the smart lock can’t close the deadbolt because it is stopped by some obstacle and the door cannot close completely. In this case, the time between motor turn on and automatically turn off will be shorter than in normal operation. An Error Out can detect this situation. It will be HIGH when the closing time is shorter than the selected value in DLY2.
The project describes how to configure the SLG47105 IC to control a Brushed DC motor. Embedded into the SLG47105, a “Differential Amplifier with Integrator and Comparator” macrocell is used for Motor Voltage Regulation. It is used to drive a motor with nominal voltage lower than the power supply voltage. Also, “Current Comparator” macrocell is used to automatically turn off the motor when a current threshold is reached.
The motor control logic can be customized for specific user requirements. Also, this design can be used with a higher-powered motor with nominal current up to 2 A. In this case, HV GPOs should be connected in parallel according to the Datasheet.
Comments