<p>I'm building an automatic warehouse system using three NEMA 17 stepper motor. </p>

<p>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. </p>

<p>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?</p>

[{'answer_id': 3706, 'author': 'Mikhail Z', 'author_id': 3839, 'author_profile': 'https://3dprinting.stackexchange.com/users/3839', 'pm_score': 2, 'selected': True, 'text': '<p>[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.</p>\n\n<p><a href="https://github.com/MarlinFirmware/Marlin" rel="nofollow noreferrer">Marlin</a> is the most obvious example.</p>\n'}, {'answer_id': 3708, 'author': 'mbmcavoy', 'author_id': 5704, 'author_profile': 'https://3dprinting.stackexchange.com/users/5704', 'pm_score': 0, 'selected': False, 'text': '<p>A stepper motor is different from a typical electric motor. Instead of being "on" or "off", or running a some approximate variable speed, the controller sends a series of pulses to drive the motor one step at a time. This can be driven forward or backwards.</p>\n\n<p>Based on how the motor and machine is designed, the machine will move a tiny amount. If for example, one step moves , say 0.1mm. If you send 150 pulses in the forward direction, the machine will move 15.0mm If you then send another 8 pulses in the reverse direction, the machine will be 14.2mm from the starting point.</p>\n\n<p>To know the absolute position, you need to establish the starting point. Most printers have limit switches at their "home" position. To initialize the position, drive the motor until it hits the switch, and then set position as zero.</p>\n\n<p>Then count the pulses up and down as you send them, you will will keep track of the machine\'s position.</p>\n'}]
['https://3dprinting.stackexchange.com/questions/3702', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/6181/']