Sub topic 5
Microstepping: smoother motion and its limits
Assume you know basic Arduino programming, voltage and current, simple wiring diagrams, and how a step/direction driver works. This chapter focuses on how microstepping changes step timing and motor behavior.
What microstepping does
A stepper driver normally energizes the two motor coils in a few fixed patterns. In full-step mode, a common hybrid motor moves 1.8° for each step. This gives:
- 360° / 1.8° = 200 full steps per revolution
Microstepping divides each full step into smaller commanded positions. For example, 1/8 microstepping commands eight positions during one full step. The driver changes the coil currents gradually, often using approximate sine and cosine values.
The motor wiring does not change. The driver creates the current pattern internally. You select the microstep setting with configuration pins, jumpers, or switches.
| Setting | Pulses per motor revolution for a 1.8° motor |
|---|---|
| Full step | 200 |
| 1/2 step | 400 |
| 1/8 step | 1,600 |
| 1/16 step | 3,200 |
Use this formula:
pulses per revolution = full steps per revolution × microstep factor
A 1.8° motor at 1/16 microstepping needs:
200 × 16 = 3,200 pulses per revolution
At 60 RPM, the required pulse rate is:
3,200 × 60 / 60 = 3,200 pulses per second
The interval between pulses is approximately 313 microseconds.
const int STEP_PIN = 3;
const int DIR_PIN = 4;
const unsigned long STEP_INTERVAL_US = 313;
void setup() {
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
digitalWrite(DIR_PIN, HIGH);
}
void loop() {
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(2); // minimum high time for many drivers
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(STEP_INTERVAL_US - 2);
}The driver may require a minimum pulse width and setup time. Check its datasheet before choosing the delay.
Benefits and limits
Microstepping usually makes motion smoother and quieter. It can reduce vibration near mechanical resonances and make low-speed movement look less jerky. It also reduces the size of each commanded position, which helps when a mechanism needs fine movement.
Microsteps are not guaranteed to have equal mechanical accuracy. Between full-step positions, the motor has less restoring torque. Friction, load, manufacturing tolerances, and driver accuracy can move the shaft away from its ideal microstep position. Treat microstepping as a smooth-motion technique, not as a direct increase in absolute accuracy.
Higher settings also require more STEP pulses. The Arduino, driver, and motion library must generate those pulses reliably. Microstepping does not remove the motor's torque-versus-speed limit. At high speed, the motor can still stall or miss steps.
Choosing a setting
Start with full-step or 1/2-step mode while testing wiring and direction. Select 1/8 or 1/16 when smoother motion or lower noise matters. Use the highest setting only when the controller can maintain the required pulse rate and the application benefits from it.
Exercise
A 200-step-per-revolution motor uses 1/8 microstepping. How many pulses are needed for one revolution, and what pulse rate is needed at 30 RPM?
Show answer
It needs 200 × 8 = 1,600 pulses per revolution. At 30 RPM, the rate is 1,600 × 30 / 60 = 800 pulses per second.