Arduino 3D printer sketch I'm building an automatic warehouse system using three NEMA 17 stepper motor. 

My problem is to move the motors with precision, since I do not have any kind of encoder on the motor and so I cannot know the position of the axes. I thought that the system could be similar to a 3D printer, since neither 3d printers have encoder on the motor. 

Where can I find a sketch for Arduino of a 3D printer, to understand how they work? How do they move with such precision without any kind of sensor?
[For now] most of the open source 3d printer firmware written for Arduino-based hardware. This means you can just download the source and look through the relevant pieces of code.

Marlin is the most obvious example.