Yes you could ground the motor casing and connect the bearing to an endstop input.