With the increasing popularity of DIY projects such as quadcopters, CNC tables and 3D printers, many people are faced with the decision of which type of motor to use in their project. For applications that require precise control of the position of the motor, the common choices are DC motors with encoders, servo motors, and stepper motors.
First, let’s take a look at what the control system looks like on a stepping motor for sale without an encoder. Suppose you want the stepper to make one complete rotation. Your program knows your motor’s step angle is (for example) 1.8°, so it tells your controller to move 200 steps clockwise. The controller tells this to the driver chip, and the driver chip outputs the power signals that turn the motor. Next, suppose you want the motor to turn half a rotation counter-clockwise from it’s original starting location. Your program remembers the motor is 200 steps away from the starting position, so it tells the controller to move 300 steps counter-clockwise, and so on.
This is known as open-loop control. You have precise control over the position of the motor, but only under the assumption that the motor has physically done exactly what it’s been told to do. If the motor takes an extra step due to excessive inertia, if the motor stalls, or if you’re using a gearbox stepper motor that has significant backlash, your program’s assumption of the motor’s current state will be wrong.
Closed-loop Position Control with a DC Motor and Encoder