I have a motor attached to a spool, attached to a string. The string is attached to a rod that is able to move backwards and forwards freely but when the rod is pulled back too far it compresses a spring. I can pull the rod in by winding the spool and I know when to stop because of the IR sensor. The locking mechanism then locks the rod in place and holds the rod until I want it to be released. See diagram below.
The problem is I know how far to pull the rod back because of the IR sensor, but I don't know how far to release the rod. If I want the rod to fully extend, I could just put another IR sensor at the end and unwind the motor until the IR sensor at the end detects nothing, but the rod might hit something at a random point along its travel (I am making this actuator for this specific purpose, to hit something). So I don't know how far to unwind the motor, If I unwind the spool too much without the rod moving, there will be no tension on the string and the string might get knotted as it will bundle up and not get pulled tight. If I don't unwind the motor enough, there will be too much resistance on the rod and the rod will not fully extend as I want it too.
Is there a mechanism that lets me pull the rod in and then have the string disengage from the motor shaft so there's no friction so the rod can extend freely? I've looked into this and normally a clutch is used to engage and disengage from a motor, but this is the motor I'm working with and commercial clutches are for much larger motors. I've also found posts that try and do the same thing but they having provided any useful answers. If there's a way that I can detect the motion of the rod to tell when it has stopped, that would be useful too as I can unwind the motor until the rod stops moving. Hope it makes sense, thanks