I'm looking at a teardown of a Masterlock. The guts look like this
What's strange to me is the black, plastic pinion that appears to be smooth and a strangely shaped cam:
Here's the cam magnified:
The motor doesn't seem to be encoded in anyway to prevent stall and the PCB only has one microswitch, but it's for the spring-loaded, shuttle-like metal piece rather than the cam. So I wonder how the motor knows when to stop without stalling. There doesn't seem to be a current shunt on the PCB either.
My take is that the square groove of the cam (top facing) faces down in the housing. The round groove on the right of the square groove is where the plastic pinion contacts. That leaves the two not-so-visible grooves facing the mat (ie those facing away from the housing). Does anyone know how the cam is turned? The bottom groove of the cam appears round, so it could probably grip on the black plastic "pinion". But then, if cam shaft is the axis of rotation, that round face can't be the contact face with the pinion.
Does anyone know how how the shaft is rotated or how the motor is encoded such that it won't stall?
I'll also magnify the black plastic pinion here: