How a Stepper Motor Steps
Inside a typical NEMA 17 bipolar stepper motor are two coils (phases) wound around iron stator poles. The rotor is a permanent magnet with 50 teeth on each pole face. By alternating which coils are energized — and in which polarity — the driver creates a rotating magnetic field that the permanent magnet rotor locks onto and follows.
A standard 1.8° step motor completes 200 full steps per revolution. The sequence of coil energization for a full-step drive is:
| Step | Coil A | Coil B |
|---|---|---|
| 1 | + | 0 |
| 2 | 0 | + |
| 3 | − | 0 |
| 4 | 0 | − |
Fig 1: Stepper motor coil sequence — stepping through the 4-step excitation cycle
Microstepping: Smooth & Silent Motion
Instead of fully energizing one coil at a time, microstepping drives both coils simultaneously with sinusoidal current waveforms. The rotor is attracted to intermediate positions between full steps, producing:
Arduino + A4988: Control Code
// Arduino NEMA 17 stepper motor with A4988 driver
// A4988 MS1=HIGH, MS2=HIGH, MS3=HIGH → 1/16 microstepping
#include <AccelStepper.h>
#define STEP_PIN 3
#define DIR_PIN 4
#define ENABLE_PIN 8
// Mode: DRIVER = step/dir interface
AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);
void setup() {
pinMode(ENABLE_PIN, OUTPUT);
digitalWrite(ENABLE_PIN, LOW); // Enable driver (active LOW)
stepper.setMaxSpeed(1000); // microsteps/sec
stepper.setAcceleration(500); // microsteps/sec²
stepper.moveTo(3200); // 1 full revolution at 1/16 step
}
void loop() {
stepper.run(); // Call frequently - non-blocking
if (stepper.distanceToGo() == 0) {
stepper.moveTo(-stepper.currentPosition()); // Reverse
}
}NEMA Frame Sizes Compared
| Frame | Face Size | Typical Torque | Best For |
|---|---|---|---|
| NEMA 11 | 28.2 × 28.2mm | 0.1 – 0.5 Nm | Light camera sliders, plotters |
| NEMA 17 | 42.3 × 42.3mm | 0.4 – 0.9 Nm | 3D printers, CNC hobby machines |
| NEMA 23 | 57.2 × 57.2mm | 1.0 – 3.0 Nm | CNC routers, laser cutters |
| NEMA 34 | 86.4 × 86.4mm | 4.0 – 12.0 Nm | Industrial CNC, large format printers |
Frequently Asked Questions
How does a stepper motor work?
A stepper motor energizes coils in sequence, creating a rotating magnetic field that the permanent magnet rotor locks onto and follows step by step. Each 1.8° step equals one full electrical cycle through the coil sequence.
What is microstepping in stepper motors?
Microstepping drives both coils simultaneously with sinusoidal currents, positioning the rotor at intermediate angles between full steps. This produces smoother, quieter motion and more resolution — up to 1/256 microstepping with TMC2209 drivers.
What is the difference between bipolar and unipolar stepper motors?
Bipolar motors have 4 wires and require H-bridge drivers to reverse coil current. They deliver higher torque. Unipolar motors have 5-6 wires with center taps, needing simpler drive circuits but producing lower torque.
What is holding torque in a stepper motor?
Holding torque is the maximum resistive torque when coils are energized and the shaft is stationary. Stepper torque drops significantly with speed — high torque designs operate best at low-to-medium RPM.
How do I connect a stepper motor to Arduino with A4988?
Connect STEP to a digital pin, DIR to a digital pin, ENABLE to GND. Supply VMOT (8-35V) and VDD (5V). Connect motor coils to 1A/1B and 2A/2B. Set MS1/MS2/MS3 for microstepping. Use AccelStepper library.
📚 References & Sources
Related Resources
How H-Bridges Work
The H-bridge circuit that drives bipolar stepper motor coils.
Servo Motor Principle
Compare steppers with closed-loop servo feedback systems.
How PID Controllers Work
Add closed-loop feedback to turn a stepper into a servo-like system.
What Is PWM
Understand the current control pulses used in stepper microstepping.

