The setup
Consider a cylinder inside another cylinder (placed with their symmetry axis horizontal).
The inner cylinder is about Ø100 mm in diameter and a centimeter or two in lenght/thickness. On the perimeter there is a thread. This cylinder is fixed in rotational motion, and cannot rotate.
The outer cylinder is much longer. It has a thread on the inside through half of its' lenght or so and this thread fits with the inner cylinder thread.
The question
Now, when rotating the outer cylinder, the inner cylinder will move back and forth (the inner cannot rotate but can move translationally).
My issue is that the outer cylinder might rotate many revolutions (it follows a bicycle wheel), and therefor at some point the inner cylinder will move out of the thread of the outer cylinder.
Is there a mechanical and smart method to let such a cylinder leave and reenter the thread of the outer cylinder? E.g. the outer cylinder would rotate in one direction untill the inner cylinder leaves the thread. Then when the outer cylinder is reversed in rotational direction, I want the inner cylinder to reenter the thread and start moving the opposite way.