Cookie,
I set one of these up on the Celestine ro-ro model.
My sincere apologises to Dave M for the use of a chocolate block, I have assumed the submissive posture and expect your reprimand, I have since changed my ways.
I used micro switches and a two way switcher from Electronize to cut the motor power when the travel had reached the required distance. This was a wormed shaft and the end point was not critical to the nearest millimetre.

This is the unit in position, and here's the wiring diagram (which I writ so it's not using correct symbols) but you should be able to follow the circuit through. Note there are no diodes, which I'm told ought to be installed to stop sparking and to ensure that the current flows only in the desired direction. My unit used a 3V motor, so voltage is stepped down from 6V, and after 4 years it still works.

The unit wiring is on the right of the diagram, labelled at its lower right corner as "ramp control". The switcher enables the motor direction to be reversed, by swapping the polarity.
Hope it gives you some ideas.
Kim.
Edited By Kimosubby Shipyards on 25/07/2014 09:40:48
Edited By Kimosubby Shipyards on 25/07/2014 09:42:55
Edited By Kimosubby Shipyards on 25/07/2014 09:43:35