A stepper motor is a brushless DC electric motor that divides a full rotation into a precise number of equal steps. Unlike standard DC motors that spin continuously when voltage is applied, a stepper motor moves in discrete increments—most commonly 1.8 degrees per step, yielding 200 steps per revolution. By energizing internal electromagnetic coils in a specific sequence, the motor's toothed rotor locks into exact angular positions. This allows for open-loop positional control without the need for optical encoders, making them the backbone of 3D printers, CNC routers, and automated camera sliders.
If you are asking 'stepper motor what is' because you need to select one for an Arduino or ESP32 motion project, the answer extends beyond basic definitions. You need to understand torque curves, driver matching, and thermal limits. Below is a practical guide to sizing, wiring, and driving stepper motors in maker and prototyping environments.
Stepper vs. Servo vs. DC: Which Motor Fits Your Load Profile?
Choosing the wrong motor type is the most common reason embedded motion projects fail. Steppers and servos are not interchangeable; they excel in completely different operating regimes. Use the comparison matrix below to match your load profile to the correct actuator.
| Motor Type | Torque Curve Profile | Control & Feedback Needs | Typical Cost (USD) | Best Fit Load Profile |
|---|---|---|---|---|
| Bipolar Stepper | High holding torque at 0 RPM; torque drops sharply above 1,000 RPM. | Open-loop pulse/direction. No encoder required. Needs a dedicated chopper driver. | $12 - $45 | Low-to-medium speed, high precision, high holding force (e.g., 3D printer extruders, Z-axis lifts). |
| AC Servo | Constant torque across a wide RPM range; high peak torque for acceleration. | Closed-loop. Requires an integrated encoder and a complex servo drive. Tuning required. | $150 - $400+ | High speed, high dynamic acceleration, heavy industrial loads (e.g., CNC spindle axes, robotic arms). |
| Brushed DC | Linear torque drop as speed increases. Zero holding torque at 0 RPM without power. | Simple voltage/H-bridge control. Needs a gearbox and encoder for precise positioning. | $5 - $20 | Continuous rotation, high speed, low precision (e.g., conveyor belts, RC car wheels). |
Sizing Rule of Thumb and Worked Load Example
Never size a stepper motor by matching the exact calculated load torque to the motor's datasheet holding torque. Steppers lose torque as speed increases, and unexpected friction spikes will cause missed steps.
The Sizing Rule of Thumb: Select a motor whose rated holding torque is 2 to 3 times (a 50% to 30% load factor) the maximum required load torque at your target operating speed.
Worked Example: CNC Router Z-Axis Lift
Suppose you are designing a Z-axis for a desktop CNC router using a NEMA 17 stepper motor and a TR8x2 lead screw (2mm pitch, 0.9 efficiency). The moving gantry mass is 5 kg.
- Calculate Linear Force: F = m × g = 5 kg × 9.81 m/s² = 49.05 N.
- Calculate Required Torque: Torque = (Force × Pitch) / (2 × π × Efficiency).
Torque = (49.05 × 0.002) / (2 × 3.1416 × 0.9) = 0.0173 Nm. - Account for Inertia and Friction: Add a 20% margin for rail friction and rotor acceleration. Required dynamic torque ≈ 0.021 Nm.
- Apply the Safety Factor (x2.5): 0.021 Nm × 2.5 = 0.052 Nm minimum rated holding torque.
A standard NEMA 17 motor like the StepperOnline 17HS4401 provides 0.45 Nm of holding torque. This is well above the 0.052 Nm requirement, ensuring the motor will not stall during rapid Z-hops. Upgrading to a NEMA 23 (1.2 Nm) would be overkill, wasting electrical power and generating excess heat without improving performance. For detailed torque curve analysis across RPM ranges, refer to manufacturer resources like the StepperOnline torque tutorial.
Wiring, Terminals, and Driver Demands
Modern maker projects almost exclusively use bipolar stepper motors (4-wire or 6-wire configured as 4-wire). Unipolar motors (5-wire/6-wire with center taps) are largely obsolete due to their lower torque output and inefficient winding utilization.
Identifying Coil Pairs (Terminal ID)
Stepper motor wires are rarely color-coded to a universal standard. To identify the two internal coils (Coil A and Coil B), use a multimeter set to resistance (Ohms):
- Probe wires in pairs. Two wires that show a low resistance (typically 1.5Ω to 10Ω) belong to the same coil.
- Wires that read 'OL' (open loop) or infinite resistance belong to different coils.
- Connect Coil A to the driver's A1/A2 terminals and Coil B to B1/B2. If the motor spins backward in your firmware, simply swap the two wires of Coil A (or Coil B, but not both).
Driver Selection and ESP32 Pinout
The driver translates low-voltage logic pulses into high-current coil energization. Here is how the common maker drivers compare:
| Driver IC | Max Current (A) | Stepping Mode | Acoustic Noise | Best Use Case |
|---|---|---|---|---|
| A4988 | 2.0A (with cooling) | Up to 1/16 | Loud (audible whine) | Budget prototypes, basic Arduino learning kits. |
| DRV8825 | 2.5A (with cooling) | Up to 1/32 | Moderate | Standard 3D printer axes, higher torque needs. |
| TMC2209 | 2.0A RMS | Up to 1/256 (interpolated) | Silent (StealthChop) | Premium 3D printers, camera sliders, UART tuning. |
For silent operation and advanced features like sensorless homing (StallGuard), the Trinamic TMC2209 is the current industry standard. Below is a standard wiring map for connecting a TMC2209 breakout board to an ESP32 DevKit v1:
| TMC2209 Pin | ESP32 GPIO | Function |
|---|---|---|
| STEP | GPIO 26 | Step pulse signal |
| DIR | GPIO 27 | Direction logic (HIGH/LOW) |
| EN | GPIO 14 | Enable (LOW to activate driver) |
| TX / RX | GPIO 16 / 17 | UART for runtime current/tuning config |
| DIAG | GPIO 34 | StallGuard interrupt for sensorless homing |
| VMOT | 12V - 24V PSU | Motor power supply (do not use USB 5V) |
Failure Signatures: Hum, Overheat, and Stall
When a stepper system fails, it rarely breaks silently. The physical symptoms tell you exactly what is wrong with your firmware or electrical setup.
- The 'Hum but No Move' Signature: The motor vibrates loudly but the shaft does not turn. Cause: Your step pulse frequency (acceleration) is too high for the rotor's inertia to catch, or the driver's current limit (VREF) is set too low to overcome static friction. Fix: Lower the acceleration value in your firmware (e.g., in Marlin or AccelStepper) and verify the driver's RMS current matches the motor's rated phase current.
- The 'Mid-Band Stall' Signature: The motor runs smoothly at low speeds, but violently stalls or reverses direction when it hits a specific RPM (usually between 400 and 800 RPM). Cause: Mid-band resonance, exacerbated by insufficient drive voltage. Fix: Increase your VMOT power supply voltage (e.g., jump from 12V to 24V). Higher voltage forces current into the inductive coils faster, flattening the torque curve at higher speeds.
- The 'Overheat at Idle' Signature: The motor is too hot to touch even when the machine is stationary. Cause: The driver is supplying 100% of the RMS running current while the motor is holding position. Fix: Implement a 'hold current reduction' feature. If using a TMC2209, configure the
IHOLDregister via UART to drop the current to 20% when the motor is stationary.
Frequently Asked Questions
What is a stepper motor used for in 3D printers and CNCs?
In 3D printers and CNC machines, stepper motors are used to translate digital coordinates into exact physical movements. Because they operate in an open-loop system and hold their position rigidly when energized, they are ideal for driving timing belts (X/Y axes) and lead screws (Z axis/extruders). They provide the high low-speed torque required to push filament through a hotend or plunge an endmill into aluminum without requiring expensive feedback encoders.
What is the difference between a stepper motor and a servo motor?
The primary difference lies in feedback and torque delivery. A stepper motor moves in fixed increments and assumes it has reached the target position (open-loop); it delivers maximum torque at zero RPM but loses torque rapidly as speed increases. A servo motor uses a closed-loop encoder to constantly verify its position and correct errors on the fly; it maintains consistent torque at high RPMs and can deliver massive peak torque for rapid acceleration, but requires significantly more complex and expensive drive electronics.
What is microstepping and does it increase torque?
Microstepping is a driver technique that proportionally limits the current between two adjacent coils to place the rotor in intermediate positions (e.g., dividing a 1.8° step into 16 smaller 0.1125° steps). Microstepping drastically reduces acoustic noise and mechanical resonance, resulting in smoother motion. However, it does not increase torque. In fact, the incremental torque per microstep decreases as the microstep resolution increases. It is used for smoothness and precision, not for lifting heavier loads.
What is the maximum speed a stepper motor can run?
While a stepper motor can physically spin at 2,000 to 3,000 RPM under no load, its usable torque drops to near zero at those speeds due to the inductance of the coils preventing current from building up fast enough. In practical, loaded applications like 3D printing or CNC routing, the maximum effective speed is usually between 600 and 1,200 RPM. To push a stepper motor to higher usable speeds, you must increase the driver supply voltage (VMOT) to overcome the coil inductance, as detailed in Adafruit's comprehensive stepper motor guide.






