Sub topic 4
Full-step, half-step, and wave drive
This chapter assumes you know the earlier material: a bipolar stepper has two coils (A and B), and energizing them in sequence turns the rotor. It also assumes basic Arduino programming and Ohm's law. Here you will see exactly which coil patterns exist, how they differ in torque, resolution, and heat, and how to generate them in code.
Three ways to walk around the same cycle
A bipolar motor coil can be driven in the positive direction, driven in the negative direction, or switched off. Write these as +, -, and 0. One electrical cycle moves the rotor through four full-step positions. The three drive modes differ in which coils are on at each moment.
- Wave drive (one-phase-on) energizes one coil at a time: A+, B+, A-, B-.
- Full-step drive (two-phase-on) keeps both coils energized: A+B+, A-B+, A-B-, A+B-.
- Half-step drive alternates between the two: A+, A+B+, B+, A-B+, A-, A-B-, B-, A+B-.
Wave and full-step each use four states per cycle. The rotor settles at different angles in each, offset by half a full step. Half-step uses both sets of states, so it has eight states per cycle and twice the positions.
The diagram shows a useful fact. Stepping through the eight-entry table by 2 gives wave drive or full-step drive, depending on whether you start at an even or odd index. Stepping by 1 gives half-step. One table covers all three modes.
Comparing the modes
| Property | Wave drive | Full-step | Half-step |
|---|---|---|---|
| Steps per revolution (1.8° motor) | 200 | 200 | 400 |
| Coils energized | 1 | 2 | 1, then 2, alternating |
| Relative torque, same per-coil current | 1.0 | about 1.41 | alternates 1.0 and 1.41 |
| Coil power dissipation | 1× | 2× | 1× and 2× alternating |
| Mid-speed vibration | worst | high | lower |
Why two coils give 1.41 times the torque
Each energized coil pulls the rotor toward its own pole direction. In full-step, the two coil directions are 90° apart electrically. Their forces add as vectors, so the result is √2 times one coil's pull, about 1.41. The resultant points halfway between the two coil axes, which is why full-step and wave positions are offset by half a step.
The datasheet's holding torque is normally measured with both phases on at rated current, which is full-step. In wave drive at the same current, expect about 70% of that figure.
The cost of the extra torque
Both coils carry current, so a full-step motor dissipates about twice the coil heat of wave drive. Wave drive therefore saves little power relative to what it costs in torque. It is mainly useful for teaching, for simple unipolar circuits, and for low-power holding.
Half-step and uneven torque
Half-step doubles the resolution, but torque alternates between 1.0 on single-coil steps and 1.41 on two-coil steps. That is roughly a 30% ripple. It shows up as slightly uneven motion and can cause missed steps near the torque limit. Proper drivers fix this by raising the current on single-coil steps by 1.41, which is a first step toward microstepping. Four on/off Arduino pins cannot do this. Treat the loaded torque of plain half-step as that of its weaker steps.
Generating the sequences in code
This sketch drives a bipolar motor through two H-bridges, such as an L298N or similar. Each coil uses two input pins. A+ means pin 1 high and pin 2 low, A- means the reverse, and 0 means both low. Never connect Arduino pins directly to a motor coil. The pins cannot supply the current.
const int A_PLUS = 8; // coil A input 1
const int A_MINUS = 9; // coil A input 2
const int B_PLUS = 10; // coil B input 1
const int B_MINUS = 11; // coil B input 2
// Half-step table: {coil A, coil B}, each +1, -1, or 0.
// Even indices are wave states, odd indices are full-step states.
const int8_t TABLE[8][2] = {
{ 1, 0}, { 1, 1}, { 0, 1}, {-1, 1},
{-1, 0}, {-1, -1}, { 0, -1}, { 1, -1}
};
int tableIndex = 0;
void setCoil(int plusPin, int minusPin, int level) {
digitalWrite(plusPin, level > 0 ? HIGH : LOW);
digitalWrite(minusPin, level < 0 ? HIGH : LOW);
}
void applyState(int index) {
setCoil(A_PLUS, A_MINUS, TABLE[index][0]);
setCoil(B_PLUS, B_MINUS, TABLE[index][1]);
}
// stride 2 + even start = wave, stride 2 + odd start = full-step,
// stride 1 = half-step. A negative steps value reverses direction.
void runSteps(int startIndex, int stride, long steps, unsigned long intervalUs) {
tableIndex = startIndex;
int dir = steps >= 0 ? 1 : -1;
long count = steps >= 0 ? steps : -steps;
for (long i = 0; i < count; i++) {
applyState(tableIndex);
delayMicroseconds(intervalUs);
tableIndex = (tableIndex + dir * stride + 8) % 8;
}
}
void setup() {
pinMode(A_PLUS, OUTPUT);
pinMode(A_MINUS, OUTPUT);
pinMode(B_PLUS, OUTPUT);
pinMode(B_MINUS, OUTPUT);
}
void loop() {
// Each call is one revolution of a 200-step motor at 60 RPM.
runSteps(0, 2, 200, 5000); // wave drive
delay(500);
runSteps(1, 2, 200, 5000); // full-step
delay(500);
runSteps(0, 1, 400, 2500); // half-step: twice the steps, half the interval
delay(500);
}The half-step call needs 400 steps and half the interval to cover one revolution in the same time. This follows from the step-rate relation covered in the speed-and-timing chapter.
Common errors
- Jitter instead of rotation. The coil order is wrong. If the sequence energizes A, then B, then A again, the rotor reverses. Check that your table follows the order shown above. A coil swapped within a pair (A+ and A- reversed) also reverses direction.
- Coil pairs mixed up. If one wire of coil A is connected to a wire of coil B, the motor vibrates and does not turn. Measure resistance between wires to find the real pairs.
- Motor gets hot while idle. The last state stays energized after the move. Full-step holds two coils on. Either accept the heat for holding torque, or set all four pins low when you don't need to hold position.
- Position error after switching modes. The three modes park the rotor at different angles. Switching from wave to full-step shifts the rotor by half a step, and switching to half-step may shift it by a quarter. Home the axis again if absolute position matters.
- Wrong step count. Half-step needs 400 steps per revolution for a 1.8° motor. Using 200 gives half a turn.
Exercise
A 1.8° motor is rated 1.5 A per coil with a holding torque of 0.4 N·m (two phases on). You run it in wave drive at 1.5 A per coil. Roughly what holding torque do you get, and how many steps does one revolution take?
Show answer
Wave drive energizes one coil, so torque is about 1/1.41 of the two-coil value, which is about 0.28 N·m. One revolution still takes 200 steps, because wave drive has the same step count as full-step.
Exercise
In the sketch above, you call runSteps(1, 2, 200, 5000) and the motor turns the wrong way. Name two changes that reverse it without rewiring.
Show answer
Pass -200 as the step count, which reverses the table direction. Alternatively, swap the entries for coil B (or coil A) in the table, or swap the pin numbers for one coil.