AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Running a Stepper Motor From Discrete Logic Gates

Servo and stepper motion Published 7 min read By AutomateDirectUSA engineering team

Short answer

Yes, a stepper runs from plain logic: a clocked counter and decoder select the winding excitation while a separate power stage supplies and limits the current. Start with the two-phase-on full-step sequence of four states, set the power stage to the motor's rated winding current, and let winding inductance set the usable step rate.

On this page
  1. Can a stepper motor run from logic gates without a controller IC?
  2. Which excitation sequence should the logic generate first?
  3. How does the power stage set the winding current?
  4. What supply voltage should the power stage use?
  5. What step rate can the logic-driven motor actually follow?
  6. How do you build and commission the sequencer safely?
  7. Which faults separate a sequencing error from a torque problem?
  8. Questions asked

A stepper motor runs from plain logic gates with no PC and no controller IC, as long as you keep one division of labor clear: the logic chooses which winding conducts and when, and a separate power stage supplies and limits the winding current. Logic outputs carry switching signals, never motor current. The build breaks into a clock, a two-bit state counter, a decode into bridge commands, and a protected power stage set to the motor's rated current. Start with two-phase-on full stepping, not microstepping, because full stepping is pure on/off logic while microstepping needs analog current references. The rest of this page gives the sequence table, the current-limit decision, the supply-voltage rule and the arithmetic that predicts your usable step rate.

Can a stepper motor run from logic gates without a controller IC? #

Yes. A clocked counter with a decoder can fully replace the sequencing part of a dedicated controller, provided a separate power stage supplies and regulates winding current; the gates only generate step timing and excitation state. Removing the controller IC removes none of the three functions a stepper drive performs: timing, winding selection and current switching. Your circuit takes over the first two; a bridge-type power stage with a current limit takes over the third. Anyone who has already driven a stepper from a PLC's own outputs has met the same division, since a PLC driving an H-bridge needs a phase sequence table before anything moves; the gate circuit here is that table in hardware.

Which excitation sequence should the logic generate first? #

Start with the two-phase-on full-step sequence: four ordered states per electrical cycle, both windings energized in every state, which gives the motor's full holding torque using nothing but on/off signals. On a two-phase bipolar motor the four states differ only in the commanded current direction of each winding:

State (forward order) Winding A current Winding B current
1 positive positive
2 negative positive
3 negative negative
4 positive negative

Clock the counter forward and the motor steps one way; count backward and it reverses. The signs describe commanded current direction, not logic voltage levels or pin assignments; your decoder maps them to whatever bridge inputs your power stage uses. This is the same excitation pattern described in the guide to configuring two-phase full-step excitation, and it is the right first build because it proves winding identification, current control and motion before anything finer is attempted. Half-stepping adds four one-phase-on states for eight states per cycle; microstepping is a different animal, because it needs graded analog current levels rather than a longer digital table.

How does the power stage set the winding current? #

Set the power stage's current limit to the motor's rated winding current from its datasheet and let the stage regulate to that value; each winding of a bipolar motor needs a full bridge because the current must reverse. Heating follows current even at a standstill: copper loss per winding is P = I² × R, with I in amperes and R in ohms, so a motor holding position at rated current dissipates its full rated loss with the shaft still. Two windings on means two of those losses at once. The power stage must also give inductive current somewhere to go at each switching edge; without a flyback path the stored magnetic energy appears as a damaging voltage spike across the switches. Use a stage with the recirculation diodes or synchronous path built in, or design it deliberately.

What supply voltage should the power stage use? #

Use a chopper-type stage with a supply about four to five times the motor's resistive rated voltage, where rated voltage equals rated current times winding resistance; this ratio is a widely used rule of thumb, not a standard, and the stage's own voltage rating is the hard ceiling. A higher supply drives current into the inductance faster without raising the steady current, because the chopper interrupts once the limit is reached. This is the same reasoning behind why a stepper's chopper drive supply voltage is set well above the nameplate voltage; the current limit, not the supply, sets the winding current. A plain resistive supply at rated voltage works only at low step rates, as the arithmetic in the next section shows.

What step rate can the logic-driven motor actually follow? #

Winding inductance sets the ceiling: current rises exponentially with time constant τ = L / R, and the next step must wait until enough current has built, so roughly three time constants per step bounds a resistively driven motor. Worked example, calculated for these inputs and not a measured result: take a 1.8-degree motor (200 steps per revolution) with R = 1.8 Ω and L = 3 mH per winding, rated 2.0 A, so a resistive rated voltage of 3.6 V. Then τ = 3 mH / 1.8 Ω = 1.67 ms. Driven at only 3.6 V, the current reaches 95 percent after 3τ = 5.0 ms, capping the step rate near 200 steps/s before load and back-EMF cut it further. Now drive the same winding from a 15 V chopper supply, about 4.2 times rated, inside the rule of thumb: i(t) = (V/R)(1 − e^(−t/τ)) = 8.33 A × (1 − e^(−t/τ)), and 2.0 A is reached when (1 − e^(−t/τ)) = 0.24, that is t ≈ 0.27τ ≈ 0.46 ms. Current rise alone then allows roughly 2000 steps/s. The decision: commission at 200 steps/s, add an acceleration ramp on the clock, and find the real limit under load by test, because the stall boundary is set by the motor's torque curve and your load, the same effect behind why a stepper motor stalls above a certain step rate. At standstill the two energized windings dissipate 2.0² × 1.8 = 7.2 W each, 14.4 W total, which is exactly the motor's rated heating; nothing is saved by holding still.

How do you build and commission the sequencer safely? #

Bring the circuit up in a fixed order: verify the logic with motor power off, then enable the power stage at a low step rate with the mechanism restrained. That order keeps a decode error from becoming unexpected motion. Work through these steps:

  1. Identify the windings with an ohmmeter and the motor's connection diagram; lead count alone does not establish the topology.
  2. Build clock, two-bit counter and decode; add a reset that forces the counter into state 1 so power-up always starts from a defined excitation.
  3. Debounce any manual step input; one button press must advance exactly one state, not several bounces' worth.
  4. Generate non-overlapping leg signals, or dead time, so no bridge leg can conduct through both switches at once.
  5. Hold the power stage disabled until the logic supply is stable, using the stage's documented enable behavior.
  6. With motor power off, verify all four decoded states, forward and reverse, and the reset on a scope or logic analyzer.
  7. Set the current limit from the driver documentation, power the stage, and step at 200 steps/s with the load safely restrained; ramp from there.

One safety note: a stepper that steps correctly on the bench can lurch the instant real current flows, so restraint and the disable line come before the first powered step, and stored energy in the supply capacitors outlives the power switch.

Which faults separate a sequencing error from a torque problem? #

Measure the decoded states and the winding current together: correct states with weak current point at timing or supply, while wrong states or bridge overlap point at the logic or power stage. A motor that buzzes without turning usually has right current in the wrong order, so re-check the decode against the four-state table first; that check costs nothing. A motor that turns but loses position as speed rises has a current-rise problem: slow the clock, confirm the current waveform reaches the limit between steps, then raise the chopper supply within the stage's rating. Heat with no motion and correct states is simply rated copper loss; reduce holding current after positioning if the mechanics allow it, since holding torque falls with current but the loss falls with its square.

Questions asked

Can a unipolar motor with a center-tapped winding use the same four-state sequence?

Yes, with a different power stage. Each half winding has its own switch to the tap, so no bridge and no current reversal are needed; the decoder still walks through the same four ordered excitation states. Verify the half-winding resistance and current against the motor's connection diagram before setting the current limit.

Can the logic do half-stepping by adding states?

Yes. Insert a one-phase-on state between each two-phase-on state, giving eight states per electrical cycle and half the step angle of full stepping. The one-phase-on states produce less holding torque than the two-phase-on states, so torque ripple appears at low speed. It is still pure on/off logic; only the decode table changes.

Why not microstep from logic gates?

Microstepping commands graded current levels, not just direction. Each state needs an analog reference for each winding and a power stage that regulates to it, which means digital-to-analog conversion and a chopper current loop. That is an analog design problem, not a longer digital sequence, so it does not fit a gates-only build.

Can one logic output feed both switches on one side of the bridge?

No. The upper and lower switch of each bridge leg need separate, non-overlapping control; if both conduct at once they short the supply through the leg. Generate the leg signals in the decoder with dead time between them, or use a power stage with built-in shoot-through protection, and confirm the timing on a scope before connecting the motor.

Keep reading

  • Explainer

    What a Stepper Driver Control Connector Needs From a PC

    A PC can drive a stepper driver's control inputs only when the step and direction signals meet the driver's documented input voltage and current, and the current-select inputs are grounded or pulled high to match the motor's rated current before power-up. Buffer the PC outputs whenever their levels or drive current are uncertain.

    Servo and stepper motion

  • Explainer

    Why a PLC driving an H-bridge needs a phase sequence table

    The L298 only switches winding current; it has no translator, so the PLC must produce the four full-step or eight half-step states itself. The design lives or dies on a written next-state table that reads CLK, DIR and MODE and advances exactly one state per clock edge, held in persistent memory and owned by one routine.

    Servo and stepper motion

  • Explainer

    Why a 12-15 V supply caps stepper motor speed

    On a 12-15 V supply a stepper motor's top speed is capped by current rise time: when the step period drops below the winding's L/R time constant, current never reaches rated and torque collapses. The fix is a constant-current driver on a higher supply voltage and a low-inductance winding; more rotor poles buy resolution, not speed. Worked example: 1,000 rpm on a 4 mH, 3 ohm winding needs about 57 V.

    Servo and stepper motion