A stepper motor is a motor that advances through a sequence of discrete electromagnetic positions.
Unlike the continuous rotation of a DC motor, a stepper motor allows you to command position increments through an excitation sequence.
- If you send it 1 pulse, it rotates one step (e.g. 1.8 degrees) and locks in place.
- If you send it 200 pulses, it makes one exact revolution and stops at the same point where it started.
It has no inertia, has very high holding torque, and is the king of 3D printers and CNC machines.
Comparison with DC motor
| Feature | DC Motor | Stepper Motor |
|---|---|---|
| Movement | Continuous and fast | Discrete (jerky steps) |
| Control | Difficult (overshoots) | Precise (open loop) |
| Speed | High (RPMs) | Low/Medium (loses torque at high speed) |
| Torque | Increases when stalled | Maximum when stationary (Holding Torque) |
| Use | Wheels, fans | 3D printers, CNC, robot arms |
Anatomy: teeth and magnets
Inside, a stepper doesn’t look like a normal motor.
- The Rotor: It is a permanent magnet with very fine “teeth” (like a gear).
- The Stator: It has several grouped coils around it.
The trick is that the teeth of the rotor and the stator are not perfectly aligned. They are slightly offset.
The movement cycle
We turn on Coil A. The rotor is magnetically attracted and aligns with it. Click! (First step).
We turn off A and turn on Coil B. Since it is offset, it forces the rotor to rotate a little to align with B. Click! (Second step).
By repeating this sequence (A, B, inverted A, inverted B…), we make the motor rotate.
Resolution: the 1.8 degrees
The industry standard is the 200 steps per revolution motor.
This means that without tricks, the minimum movement resolution is 1.8 degrees. If you want to move less than that, you need gears or “Microstepping” (we’ll see this later).
Types: bipolar vs unipolar (the cable war)
When choosing the driver, you must distinguish between two families:
Unipolar motors (5 or 6 wires)
These are the cheapest and simplest motors (e.g., the famous 28BYJ-48).
- They have a common center wire.
- They are easy to control (you just need to energize coils in order).
- Disadvantage: They have less torque because you only use half the coil at a time.
Bipolar motors (4 wires)
These are the powerful ones (NEMA 17, 3D printers).
- They have no common wire. You have two separate coils (Pair A and Pair B).
- To move them, you must constantly reverse the current polarity.
- Requirement: They necessarily require two H-Bridges to operate.
- Advantage: Much higher torque for the same size.
The NEMA standard (size matters)
You will often see “NEMA 17 Motor” or “NEMA 23”. Many people believe NEMA defines power. It does not. NEMA only defines the size of the front faceplate (where the mounting screws go).
- NEMA 17: The face measures 1.7 x 1.7 inches (42mm). Standard in 3D printers.
- NEMA 23: The face measures 2.3 inches (57mm). For small CNCs.
- NEMA 34: For industrial machinery.
You can have two NEMA 17 motors, where one has three times the torque of the other (depending on the body length and current it can handle). Always check the specifications in its datasheet.
The drivers: A4988, DRV8825, and TMC
You cannot connect a Stepper directly to an Arduino. You need an Intelligent Driver. These chips (like the A4988) do the heavy lifting:
- They have the H-Bridges inside.
- You only send them two digital signals: STEP (one pulse = one step) and DIR (HIGH=right, LOW=left).
- Current Control: They have a small screw (potentiometer) to limit the amperage. It is crucial to adjust it or you will burn the motor.
Microstepping: the phantom steps
What if 1.8 degrees is too coarse? Modern drivers can perform Microstepping (1/16, 1/32, 1/256…).
Instead of energizing coil A at 100% and coil B at 0% (full step), the driver sends sinusoidal waves:
- The driver regulates currents approximating a sinusoidal reference in both coils.
- The rotor seeks an intermediate magnetic equilibrium. Its actual position depends on the load, friction, and motor tolerances.
This turns a 200-step motor into one with 3200 virtual steps (at 1/16), making the movement extremely smooth and quiet.