Overview Demonstration
AI Dog Detection
Pinch Detection
Fail Safe Mechanism
In order to do this demonstration I had to temporarily disable the pinch detection by reflashing the ESP32 with a firmware that allowed setting the closing current limit very high.
Outside Bark Detector
Safety first!
These are 6 layers of safety that have been implemented.
- The Home Assistant server will not send the close door command if the Frigate NVR AI object detection system detects that there is a dog, cat, or person in the “pinch zone”
- The main motor controller self checks the current sensor each time the close command is received and if it detects an anomaly it aborts the closing operation
- If the closing current threshold is exceeded (pinch detection) the closing operation is aborted and the door fully opens
- If all the above fails the soft TPU compliant clevis that connects the actuator rod to the door panel will disconnect
- If all the above fails there is a TPU shear pin connecting the actuator to the top clevis that will disconnect.
- If all the above fails there is a PTC resettable fuse that will reset the motor controller. Upon bootup the motor controller firmware defaults to opening the door as soon as boot up is complete
Mechanical
The first decision is deciding where to put the door, either through a wall or retrofitting an existing opening. I bought this PetSafe Extreme Weather Sliding Glass Pet Door because I originally hoped to be able to teach my dog to use the flap, that didn’t work out. This insert is expensive however it is well made and conveniently the integrated steel track intended for inserting the rigid plastic security panel works perfectly for mounting an improved motorized panel.
The new panel started out as a sheet of HDPE 12” x 24”. HDPE is great because it has low friction which is required to slide freely in steel track. I used a table router to reduce the thickness of outside tabs of the sheet until the fit in the track snug (less air drafts) but not too snug that it couldn’t be easily moved by hand.
The linear actuator model is JQDML 16"/400mm Stroke DC 12V Linear Actuator 66lbs/300N Speed 1.77"/sec. This model was selected because it was geared for highest speed lowest force which is the preference for this application. Unfortunately, this actuator is only a two wire model with no feedback. Frustratingly it does have limit switches, they are just not exposed in a way that you can use them out of the box. I learned that what it does is pair the limit switches with diodes in this clever arrangement that automatically stops the current flow at either end until the polarity of the supply is reversed.
That arrangement was no good for me because I wanted to at least have retracted/extended (open/close) feedback from the limit switches. So I disassembled and rewired the actuator with new 5 wire jacketed cable (MTR1, MTR2, GND, LIMIT_UPPER, LIMIT_LOWER) with the intention of attaching the one side of the limit switches to GND and the other to side to GPIO’s with pull-up resistors. The disassembly and rewiring was not so easy and I might recommend externally mounted hall effect sensors instead.
The linear actuator comes with two steel clevis and 5mm shear pins. These are way too strong for this application. I drilled holes and attached the top clevis with rivets. I 3D printed a TPU shear pin because I found it dampened the motor vibration so that there was less noise.
I discarded the other steel clevis and instead designed a new compliant TPU one with a fail safe overload feature. Instead of the 5mm steel shear pin I drilled the hole actuator rod larger and then tapped it for M6 and then installed a socket head cap screw in each side.
The compliant TPU clevis is not enough on its own. The issue is that once it lets go the weight of the door panel...
Read more »