My scanner, arduino & pi

For info this is how I use the encoder system.

This is a true 600ppr optical encoder with AB & Z outputs from Bourns, available on ebay for around £20. Rated for several thousand rpm so should last forever. Wide operating voltage, open collector output.

Sprocket drive stepper uses 9600 steps for 1 revolution.
Sprocket wheel has 12 sprockets so needs 800 steps per frame.
Taking an image every 800 steps does not work as there is no guarantee of hitting the reference pulse each time.
Wait for ref pulse, take image.
Send 800 pulses, take image
repeat 11 times
Wait for reference pulse, take image.

If the number of steps between image 11 and the next reference pulse is not 800 it will only be a few out and not make any real difference. The whole sequence is reset every full revolution and provides a well registered image.

My sprocket system would benefit from being much closer to the film gate but had to start somewhere.