Search "leadscrew". Turn a threaded rod with a stepper motor, or DC motor + encoder, and it will control the position of a "nut" on the rod. You can literally use a length of studding (threaded metal rod) and a nut (as in nut and bolt) for a light-duty system. For something more serious you might u...