Skip to content
ohmplay. Electronics
laboratory

Home / Tools / Stepper motor

Experiment 010 / Robotics and control

Stepper motor

Step through a bipolar motor’s sequence and connect step count, angle, command rate and speed.

Workbench / Explicit model ● In your browser
01 / Adjust the model
steps
steps/s
Try an example

02 / Coils and mechanical position

Phase A +I
Phase B +I
Net commands 0
Angle per command 1.8°
Mechanical rotation 0°
Ideal speed 30 rpm

Two phases are energized. Each forward command changes the row and ideally moves the shaft by 1.8°.

The animation shows at most five commands per second. The numeric speed uses your full command rate. Mechanical motion is not simulated in real time.

Full sequence · the arrow marks the active row
Active Row Phase A Phase B
→ 1 +I +I
2 −I +I
3 −I −I
4 +I −I

Use it in your classroom

Share this exercise with its current values. The link contains only numbers and model options; do not add names or email addresses.

The code includes a text link to the full explanation outside the frame. Animation starts paused. Adjust the iframe height if your platform needs it.

200 steps are not 200 revolutions

An ideal motor with 200 full steps per revolution moves 1.8° per command. At 100 commands per second it turns at 100/200 = 0.5 revolutions per second, or 30 rpm.

Switching to half-stepping gives 400 commands per revolution, or 0.9° per command. At the same 100 commands/s, speed falls to 15 rpm. Reaching 30 rpm would require 200 commands/s. The electrical table has eight rows, but that does not mean the motor completes a mechanical revolution in eight commands.

A repeating electrical sequence

Resolution = N in full-step mode; 2N in half-step mode
Angle per command = 360° / resolution
Accumulated rotation = net commands × angle per command
rpm = direction × command rate × 60 / resolution

Full-step mode energizes two phases: (+I,+I), (−I,+I), (−I,−I), (+I,−I). Half-stepping interleaves single-phase states to make eight combinations. The sign indicates current direction in a coil; zero means no current. I is a reference magnitude, not a current in amperes selected by this tool.

The left arrow shows the electrical field angle, calculated using atan2(B,A). The right indicator shows mechanical displacement from the initial state. These are different quantities: a 200-full-step motor goes through fifty electrical cycles per mechanical revolution.

Coil states, not a power driver

The model is an ideal two-phase bipolar motor. N must be a multiple of four from 4 to 4000 so sequences close over one revolution. No missed steps are assumed. Load, acceleration, coil current rise, resonance, microstepping and thermal limiting are not modeled.

This half-step sequence alternates one and two active phases at the same current magnitude I; it does not compensate for the change in field magnitude. A real circuit needs a suitable power driver. Do not drive motor coils directly from a board’s pins using these sequences.

Changing N or the step mode resets the counter. Changing direction preserves position and reverses subsequent commands. “Previous step” undoes a command relative to the selected direction. Animation starts paused and pauses when the tab is hidden.

Common mistakes

  • Treating one electrical table row as a fixed fraction of a mechanical revolution.
  • Doubling resolution and expecting the same rpm at the same command rate.
  • Interpreting +I and −I as pin voltages.
  • Assuming the model guarantees a real motor will never miss steps.

Try it yourself

How many half-step commands turn a 200-step motor through 90°?

400 × 90/360 = 100 commands, each corresponding to 0.9°.

If you move back one command from the initial full-step state, which row appears?

The fourth row: (+I, −I). Relative displacement is −1.8° with N = 200.

Excitation-mode reference: bipolar motors, Monolithic Power Systems. This page’s examples and calculations are original.