AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Why an A/D card cannot control a stepper motor directly

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

Short answer

No. An A/D card measures signals and cannot supply winding current or place step edges in time. A stepper needs a hardware-timed pulse train into a stepper drive, from a counter/timer output, a PLC pulse output, a motion board or an integrated drive, with Windows software only supervising.

On this page
  1. Can an A/D card drive a stepper motor on its own?
  2. What does a stepper drive need at its pulse input?
  3. How many pulses per second does your speed need?
  4. Why can't Windows software time the pulses?
  5. What on a DAQ device can actually generate the pulse train?
  6. Which controller should supply the pulses for your machine?
  7. How do you verify the pulses before trusting the axis?
  8. Questions asked

An A/D card in a Windows PC cannot control a stepper motor, whichever measurement package sits on top of it. Analog inputs measure; they do not move anything, and the card's digital lines are no better unless hardware times them. A stepper moves when a stepper drive receives a hardware-timed train of step pulses with a direction level, and the winding current comes from that drive's power stage. What follows gives the drive's input requirements, the frequency arithmetic, the reason software-timed edges fail, and the controller architecture to commit to for each case.

Can an A/D card drive a stepper motor on its own? #

No. An A/D card turns voltages into numbers: it has no power stage for the windings and no way of its own to place step edges in time. A stepper moves only when a drive receives a hardware-timed pulse train with a direction level.

Two capabilities are missing, and no wiring trick supplies either. The first is current. A stepper winding needs amps switched between phases and regulated against the winding inductance, which is a power stage, and that stage lives in the drive. A logic output on an acquisition card switches milliamps at logic levels: connected to a winding it would sag, overheat or fail, and it regulates nothing.

The second is command generation. An analog input channel produces numbers in memory. A digital output toggled from your program produces edges, but not a pulse train, because the spacing of those edges is at the operating system's mercy, and the spacing is all the drive cares about. Selecting another analog channel, toggling bits faster, or raising the drive's current setting each act on a different part of the chain, and none of them creates a legal step command.

What does a stepper drive need at its pulse input? #

A step-and-direction drive needs step pulses, a direction level and, on most drives, an enable, and every pulse must last at least the drive's documented minimum: 1 µs on an A4988, 7.5 µs on a DM320T. Those two numbers come from a driver datasheet and a drive manual; your drive's own documentation gives yours.

Pulse count commands displacement, pulse frequency commands speed, and the direction level picks the sense of rotation. The drive turns every received edge into one microstep of its rotating field: it cannot invent edges that never arrived, and it cannot flag an edge too narrow for its input stage, because that edge is simply missed.

Pulse width is only half the timing. The drive's timing diagram also gives a direction setup time, how long the direction level must be stable before the step edge, and a hold time after it; violating either produces steps in the wrong direction, which is worse than a stall. Budget the period as at least twice the minimum pulse width, which caps the input frequency at one over twice that minimum.

Electrically the inputs are usually optocoupled, fed at 5 V or 24 V, sinking or sourcing, and each channel draws a current your output must supply. The commons, resistor networks and isolation arrangements are covered in what a stepper driver control connector needs from a PC, and they apply whatever generates the pulses.

How many pulses per second does your speed need? #

At a configured resolution of 3200 pulses per revolution, 300 rpm asks for 16,000 pulses per second, from the relation frequency equals speed in revolutions per second times resolution in pulses per revolution.

Use the drive's configured resolution, its microstep setting or electronic gearing, not the motor's full-step count, and convert load speed to motor speed through the transmission ratio first. Turning a mechanical move into pulse counts is the same arithmetic as how to calculate step and direction servo pulses per unit.

Worked example, calculated for these inputs and not a measurement. The motor has a 1.8° full step, which is 200 full steps per revolution (360 ÷ 1.8). The drive is set to 16 microsteps, so the configured resolution is 200 × 16 = 3200 pulses per revolution. The command is 300 rpm, which is 300 ÷ 60 = 5 rev/s, so the required frequency is 5 rev/s × 3200 pulses/rev = 16,000 pulses/s.

The period is 1 ÷ 16,000 s = 62.5 µs, and at 50 % duty that is 31.25 µs high and 31.25 µs low. Each half-period clears that drive's 7.5 µs minimum by more than four times, so this speed is legal at the input. The timing ceiling for the same drive is 1 ÷ (2 × 7.5 µs) ≈ 66.7 kHz, which at this resolution is about 20.8 rev/s or 1250 rpm: the motor's torque will cap you before the input timing does.

The generator has a ceiling of its own as well. A closed-loop stepper kernel, for example, stops following commands above 200 kHz, as why a closed loop stepper will not move above 200 kHz explains; check both ends before promising a speed.

Why can't Windows software time the pulses? #

Because Windows is not a real-time operating system: its scheduler can preempt a software loop for milliseconds with no bound you can analyze, and at 16,000 pulses per second a single 1 ms stall swallows 16 edges, 1.8° of silent position loss.

The arithmetic behind that loss: sixteen lost edges at sixteen microsteps per full step is one full step, gone, with nothing reported anywhere. A stall is at least visible; a short count is not.

The jitter does not all come from the scheduler. Hardware effects, bus arbitration, cache behavior, pipeline timing, perturb execution even under real-time operating systems, and desktop Windows adds unbounded software effects on top: other processes, drivers, housekeeping. A loop that toggles a line produces edges whose spacing wanders, and a scope on that line shows the period dance. Bunched edges ask the rotor for an instant speed change it cannot follow, so the motor stalls; dropped edges shift the position silently, because an open-loop step command is a count, and a count that comes up short is a position that is wrong.

The fix is a hardware timing source: a timing loop locked to hardware holds its period no matter what the operating system is doing, while a loop locked to the OS clock does not. So commit to the division of labor. Windows and your measurement software stay supervisory, handling start and stop, setpoints, logging and display, and the edges belong to silicon.

What on a DAQ device can actually generate the pulse train? #

Only its counter/timer hardware, configured for pulse-train output: a counter driven by an onboard timebase sets the frequency in hardware and a second counter can count the edges, so the train holds even while the PC is busy.

Judge the card by four things, in this order:

  • Output mode. The counter must support hardware pulse-train generation, with frequency and count loaded into registers. A counter that only measures incoming edges never drives a line, and a digital output with no timer behind it is the software-toggling case again.
  • Range and resolution. The timebase must reach your frequency with headroom and divide down finely enough at creep speeds.
  • Driver exposure. The installed driver and your measurement package must actually expose that mode: set a frequency, load a count, start, stop. The driver's function list decides, not the silkscreen or the family name on the box.
  • Counter budget. Generating a train and counting it can consume two counters per axis, so a card with two counters is out of channels at one or two axes.

One limitation to accept: a counter holds a frequency, it does not shape a trajectory. Acceleration means stepping the frequency setpoint from software, which is fine for slow point-to-point moves and coarse for fast ones. When the ramp itself must be precise, use an architecture that generates it in hardware or firmware.

Which controller should supply the pulses for your machine? #

Give the job to whatever already owns hardware timing: use the card's counter output if the driver exposes pulse-train generation, otherwise a PLC's transistor pulse outputs, a motion board for coordinated axes, or an integrated stepper drive when one axis should simply take move commands.

Your case What generates the pulses What the PC does
Card exposes a hardware pulse-train output, one or two slow axes The card's counter/timer Loads frequency and count, supervises, logs
No pulse-capable output, and the machine already has a PLC The PLC's transistor pulse outputs Sends supervisory commands over the network
One or two axes, simple moves, minimal integration An integrated stepper drive with built-in positioning Sends move commands to the drive's own interface
Coordinated axes, blends, precise ramps A motion board running its own trajectory generator Downloads profiles and monitors status

The PLC route is the workhorse on machines that already own a controller, and running a stepper conveyor from a PLC pulse output shows the pattern end to end. The integrated drive is the answer when the alternative is building motion into an acquisition package: its firmware does the ramps and the pulse timing internally, and the PC only sends positions and speeds, so verify the command interface and that your software can talk to it before selecting hardware. The motion board earns its place only when axes must coordinate; one stepper opening a gate does not need one.

How do you verify the pulses before trusting the axis? #

Put a scope on the drive's step input and command a known count: at 3200 pulses per revolution, 8000 pulses must turn the shaft exactly 2.5 revolutions, and any shortfall shows before the machine depends on it.

  1. Scope the step and direction lines at the drive's terminals, not at the card. Measure pulse width, period and the direction level around the step edge, and compare each against the drive's manual.
  2. Command the known count at low speed with the mechanism free, and measure the travel against the expected revolutions with a mark and a dial indicator.
  3. Raise the speed in steps, watching for stall, and let the motor and drive reach temperature before the final pass; extra current is not a fix for missing or mistimed edges.
  4. Keep motor power wiring away from the command lines, with commons arranged per both devices' documentation.
  5. Trust the terminals, not the screen: a frequency on the display proves the software computed a number, not that edges arrived.

Before the axis moves real load, limits and stopping must come from the machine's risk assessment under ISO 12100, with the safety-related functions designed to ISO 13849-1; a software stop command and an enable line are not a safety function.

Questions asked

Can I command the drive with the card's analog output instead?

Only if the drive accepts an analog command, and a step-and-direction drive does not: its input expects digital edges, so a 0 to 10 V or ±10 V level produces no motion at all. An analog output is the right path for an analog-command servo drive or a proportional valve, where voltage maps to speed or pressure. Match the command type to the drive's input stage before buying hardware.

The axis loses position only at high speed. Is the pulse width the problem?

It is the first suspect. Scope the step input at the drive terminals at the failing speed: if the high or low time sits at the drive's documented minimum, the input stage begins missing edges, and every missed edge is a lost microstep with no fault reported. Fix it by lowering the configured resolution or the top speed, which lengthens each pulse, or by choosing a drive rated for a higher input frequency.

Do I need an encoder on the motor for step-and-direction control?

No. An open-loop step-and-direction system runs on commanded count: the pulses you send are the position you assume. Add an encoder when the machine must detect lost steps, prove a move, or close the loop, and then the controller needs an encoder input and its own tuning. Verification with a scope and a dial indicator covers the commissioning case without one.

Can a small microcontroller generate the pulses instead of a counter card?

Yes, and for one or two axes it is often the cheapest clean architecture. A timer peripheral in the microcontroller produces the pulse train in hardware while the PC sends only target positions and speeds over a serial or USB link. Verify the timer's top frequency and resolution against your required pulse rate, and keep the same pulse-width and direction checks at the drive input.

Keep reading

  • How-to

    How to Run a Stepper Conveyor From a PLC Pulse Output

    A PLC runs a stepper conveyor by sending a hardware pulse-train output to a step-and-direction driver, never by switching the windings itself. Compute the rate from f = v × S × M × G / C — for 0.30 m/s of belt on a 50 mm roller, a 200-step motor at 8 microsteps and 2:1 reduction, that is 6.1 kHz — then confirm the PTO and the driver both accept it and commission with acceleration ramps.

    Servo and stepper motion

  • Troubleshooting

    Stepper Motor Running Slow With a Gearbox: Pulse Rate First

    Measure the step-pulse frequency at the drive input before changing the supply or any hardware: motor rev/min = pulse frequency in Hz × 60 ÷ pulses per motor revolution, and a 10:1 gearbox then divides that by ten. A slow output usually means the command rate or the pulses-per-revolution scaling is wrong, not the motor.

    Servo and stepper motion

  • How-to

    Driving Step and Direction Inputs From a Controller Velocity Output

    A step drive counts edges, so the velocity number must become a timed train: pulses per second equal steps per degree times degrees per second, the demand's sign drives the direction pin, and the drive's documented minimum pulse width and maximum input frequency decide whether the generator can deliver it. Command travel as target minus start position, never by integrating velocity.

    Servo and stepper motion