Stepper motor, NEMA 17
Two coils, 200 steps a turn, and lost steps if you ask it to go faster than it can.
- 4 pins
- 6 settings
- In 9 projects
- In 5 lessons
The Stepper motor, NEMA 17 in brief
What it is, and every setting the properties panel gives it.
The NEMA 17 is the square 3D printer stepper, a 17HS4401-style bipolar motor with four wires and two coils: A1 and A2 (black and green) and B1 and B2 (red and blue), with no common. It cannot run from board pins or a ULN2003; it needs two H bridges, usually an A4988, DRV8825 or TMC2209 on 12 V, and the board only sends STEP and DIR from any pins on an Uno, or from an ESP32 with the driver’s logic on 3.3 V. Mokxi models each coil as a 1.5 ohm winding rated 1.7 A, reads the two coil currents and turns the rotor’s 50 teeth to the field they point: 200 full steps a turn, 1.8 degrees each. The rotor follows at most 1000 full steps a second (300 rpm); a field that runs further ahead makes it slip four steps at a time, the lost step a printer shows as shifted layers. Under 5 percent of the rated current the shaft is free. The classic mistake is one wire from each coil on the same bridge; a coil reads about 1.5 ohms on a meter. Inductance, back EMF, torque, load and resonance are not modeled.
- Family
- Outputs
- Pins
- 4
- model
- custom (or 17HS4023 pancake, NEMA 14 35x28, NEMA 14 35x36, NEMA 23 57x56, NEMA 23 57x76)
- resistance
- 1.5
- ohms per coil, 1.5.
- current
- 1.7
- the rated current, 1.7 A.
- steps
- 200
- full steps per turn, 200.
- max_steps
- 1000
- the fastest full-step rate the rotor follows, 1000 a second (300 rpm).
- angle
- 0
- where the shaft starts.
4 pins
Named as the editor names them, so a wire lands where you expect it.
How to use a NEMA 17 stepper with an Arduino
A NEMA 17 never goes on board pins. Its four wires are two coils, A1 and A2 (black and green) and B1 and B2 (red and blue), and they go to a driver’s two bridges: here a TMC2209 on 12 V, M1A and M1B to coil A, M2A and M2B to coil B. The Uno only sends STEP on pin 2, DIR on pin 3 and an active-low EN on pin 4, and a knob on A0 sets the speed.
The driver is at 1/8 step, so one turn of the 200-step motor is 1600 pulses. AccelStepper’s DRIVER mode pulses STEP and DIR, and the sketch eases every speed change, because a field that runs more than 1000 full steps a second ahead of the rotor leaves it behind and it slips four steps at a time. Leave the knob in the middle for two seconds and the outputs turn off: under 5 percent of its rated current the shaft holds nothing.
If a motor buzzes and does not turn, one wire from each coil has gone to the same bridge. Find the pairs with a meter: a coil reads about 1.5 ohms, two wires from different coils read open.
The motor does not care which board sends the pulses. On an ESP32 put the driver’s logic supply (VIO on a TMC2209, VDD on an A4988) on 3.3 V and keep the motor on its own 12 V.
What is true about the Stepper motor, NEMA 17, here
In its help article’s own words: what the simulation gets right, and where it stops.
Modeled
Each coil is a resistor, so the motor loads its driver as the real one does. The current in each coil is read off the volts across it, the two currents point a magnetic field, and the rotor's 50 teeth line up with it: one turn of the field is four full steps, 7.2 degrees of shaft. So full step, wave drive, half step and any microstep a driver produces all come out of one rule, and a full step is 1.8 degrees.
The rotor goes the short way around to the field. A field that jumps exactly half a turn pulls it both ways at once and it stays put. Under 5 percent of the rated current the field holds nothing and the shaft stays wherever it was left, which is what disabling the driver is for.
Lost steps. The rotor turns at most max_steps full steps a second. A field that
runs ahead faster than that leaves it behind, and once it is more than half a turn
of the field behind, the short way is backwards: it slips four whole steps and ends
up somewhere the sketch does not think it is. That is what a printer that moves too
fast without acceleration does to its layers.
Not modeled
Inductance and back EMF, which together are what really make a stepper's torque fall off with speed: here the ceiling is flat and does not depend on the supply. Torque and load: nothing is hung on the shaft, so a motor at 10 percent of its current holds as well as one at 100. Resonance, and the small error a real rotor has between full steps. The rotor moves at its top rate or not at all, with no acceleration of its own. The 1000 steps a second is a typical unloaded start-stop rate on a 12 V driver, not a datasheet figure, because every datasheet draws that curve for a different supply.
From NEMA 17 stepper motor, in full.
See the Stepper motor, NEMA 17 in a project
9 built-in projects use it. Each opens in the editor, already wired.
Where it turns up in a lesson
5 lessons place it in their own circuits.
The boards it is shown on
Each of these 2 boards has a built-in project with the Stepper motor, NEMA 17 in it.
Arduino libraries for the Stepper motor, NEMA 17
Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.
The rest of the bench
Every one of these is drawn and simulated the same way.
Wire up the Stepper motor, NEMA 17
Open the editor and push it into the breadboard. It is free, and it runs on your own machine.