AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Why a PLC digital output cannot make a stepper pulse train

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

Short answer

An ordinary PLC digital output switched by scan logic cannot produce a steady 2 kHz step pulse train: each pulse is just 500 microseconds wide at that rate, and scan-time jitter becomes pulse-timing error the driver counts as lost or extra steps. Feed the driver's step and direction inputs from a dedicated pulse-output channel, and set shaft speed from pulses per revolution.

On this page
  1. What the driver counts on its step input
  2. Why scan-timed outputs cannot hold the commanded rate
  3. The digital-output positioning feature switches speed stages, not steps
  4. Worked example: 2 kHz into a 200-step motor set to 8 microsteps
  5. The hardware that generates the pulse train instead
  6. The decision for each case
  7. Questions asked

No program block will rescue this one. An ordinary digital output on a PLC is written by the scan, so a square wave toggled from logic takes its edge spacing from the scan clock, not from hardware — and a stepper driver counts every edge it is sent. At the requested 2 kHz, the pulse period is 500 microseconds, split into 250 microseconds high and 250 microseconds low at a 50 percent duty cycle; scan-time jitter alone is larger than that half-cycle, so the driver receives missing and doubled counts and the axis lands short of position. The fix is hardware, not code: the step and direction inputs belong on a dedicated pulse train channel, and the shaft speed that follows comes from pulses per revolution. The timing arithmetic, the trap inside the built-in positioning feature, and the decision per case are set out below.

What the driver counts on its step input #

A driver built for pulse commands documents a small command set, and a Texas Instruments application report on intelligent stepper motor drivers states it plainly: a STEP pulse generates the steps or microsteps, a DIR signal defines the direction of rotation, and an ENABLE line determines whether the power stage is on. The word that matters is generates. The driver does not average the signal or smooth between edges; every counted transition is one step or one microstep of shaft motion, at the instant the edge arrives.

"Bipolar" in the question describes the motor, not the interface: two windings without a center tap, landing on the driver's power terminals. The command interface is whatever the driver's manual documents on its control inputs, and those pages give the three facts that decide whether a candidate output can legally drive it: accepted voltage levels, the polarity of the counted edge, and how long the direction input must sit stable before and after that edge. Read them before wiring anything.

Why scan-timed outputs cannot hold the commanded rate #

An ordinary digital output lives in the process image: the logic writes a state, and the operating system transfers that state to the physical point once per scan. Toggling in a cyclic block therefore spaces the edges by scan boundaries, and scan-to-scan variation lands directly in the pulse timing. The commanded rate needs edges closer together than the scan itself — as a rule of thumb a small controller scans in one to a few milliseconds, longer than the entire period the driver needs between pulses — so a toggled output cannot approach the commanded frequency even before jitter is counted. A timer instruction does not change this, because it executes inside the same scan; a different program block selects code, not pulse hardware; and interrupt-driven toggling is still software timing that every other task in the CPU can disturb.

The consequences are specific. An edge that arrives late can fall against the next one and be counted once; jitter can hand the driver a count the command never issued. The driver converts timing error into position error one-to-one, so the axis finishes short or long of target, and at speed the disturbed train can exceed the torque available and stall the motor outright. Vendor documentation draws the same line: the CLICK PLC help for its pulse output describes the Pulse Train Output mode, pulse with direction, as the output type that stepper or servo motor drives use for motion control — the vendor's own concession that this waveform belongs to a dedicated channel. What a discrete output can and cannot pass when it is the only option left is budgeted in the article on stepper pulse timing from a PLC discrete output module.

The digital-output positioning feature switches speed stages, not steps #

The controller in the question, the CPU313C, documents a positioning function with digital outputs — rapid and creep speed control — and the name makes it look like the answer. Its documented behavior is different in kind: the drive is controlled through four permanently assigned 24 V digital outputs that select direction and speed stages; the documented drives are multiple-speed and pole-switching motors switched through contactor combinations, or an asynchronous motor on a frequency converter with a fixed speed setting; and position feedback comes from a 24 V incremental encoder, with the target approached at rapid speed and slowed inside a defined distance. Nothing in that mechanism emits a counted pulse. It is a speed-stage selector for contactor-switched and fixed-speed converter drives, its encoder input counts feedback rather than commanding steps, and a stepper driver wired to it is wired to a switch, not a pulse source.

The same controller family documents hardware that does generate the edges: the FM 353 stepper positioning module, and a 1 STEP channel on distributed I/O. There the CPU program requests the motion and the positioning hardware produces the time-critical pulses — sequencing in the program, timing in silicon. That split is the whole answer to "which program block": the block lives wherever the pulse hardware does, and it drives that hardware instead of an output point.

Worked example: 2 kHz into a 200-step motor set to 8 microsteps #

The inputs:

  • Commanded step frequency: 2 kHz, the rate the driver is being asked to count (from the question).
  • Pulse shape: a square wave at 50 percent duty cycle — an assumption; a driver manual's documented minimum high and low times override it.
  • Motor: 200 full steps per revolution, the standard count for a 1.8° stepper.
  • Driver microstep setting: 8 microsteps per full step, an example switch position; read the real one from the driver's switches or parameters.

The rules, in words: the pulse period is one divided by the pulse frequency; the shaft speed is the pulse frequency divided by the number of pulses the driver needs for one revolution, converted to revolutions per minute.

The arithmetic:

  • Period: 1 ÷ 2000 Hz = 0.0005 s, and 0.0005 s × 1,000,000 µs/s = 500 µs. At 50 percent duty, each half-cycle is 500 µs ÷ 2 = 250 µs high and 250 µs low.
  • Pulses per revolution: 200 full steps per revolution × 8 microsteps per full step = 1600 pulses per revolution.
  • Shaft speed: 2000 pulses/s ÷ 1600 pulses/rev = 1.25 rev/s; 1.25 × 60 s/min = 75 rpm.

The result: the driver needs a 500 µs period with 250 µs half-cycles, and that rate at that microstep setting turns the shaft at 75 rpm.

The decision: a channel that must place edges 250 µs apart, continuously and without drift, is a hardware pulse generator's job — an output updated once per scan cannot place them at all. Put the axis on the pulse train output or positioning module, and treat 75 rpm as the speed to verify against the process; if the process needs more, reduce the microstep setting or raise the step frequency within the maximum input frequency documented in your driver's datasheet.

The hardware that generates the pulse train instead #

Three documented sources, in the order a repair usually reaches them:

  • The controller's own pulse train output, where the family provides one: a transistor output channel configured for pulse and direction and driven by motion or positioning instructions, not by cyclic logic. This is the vendor-documented channel for exactly this drive type.
  • A positioning module or distributed stepper channel — the FM 353 or a 1 STEP channel in the controller family above — for CPUs without an integrated pulse output. The program issues the target; the module makes the edges.
  • A separate motion controller, or a drive that takes position commands over the network, when the machine is being designed rather than repaired.

Whatever the source, one axis gets one channel: sharing an output between axes is the mistake the article on why three stepper axes need dedicated high-speed outputs documents. On the command wiring, match the levels and the reference the driver manual specifies — some pulse inputs are single-ended low-voltage logic, others take a higher voltage or want differential pairs — and hold the direction input stable around the counted edge. The motor's windings and their current stay entirely on the driver's side; isolate the motor supply before wiring that half, because the power terminals carry winding current regardless of the command state. Fitting the pulse command cable — levels, termination, direction timing — is its own task, and the guide on wiring a servo drive to a pulse train interface walks that interface end to end.

Then set the pulse-to-travel conversion — microsteps times any gearbox or screw ratio — so a commanded position means real travel. If the new channel is enabled, the wiring checks out and the shaft still stands still, run the checks in the article on a stepper pulse output that is enabled but the motor is not moving before changing any hardware.

The decision for each case #

  • You wanted a program block that makes the CPU's digital output emit the train: none exists, because a scan-updated output cannot place edges at the commanded rate — move the axis to a pulse train output or a positioning module and let the program request motion from there.
  • You were eyeing the controller's controlled positioning with digital outputs: leave it for its documented drives, the contactor-switched and fixed-speed converter motors; it has no counted pulse to give a stepper driver.
  • Your driver documents STEP, DIR and ENABLE inputs: feed STEP and DIR from the pulse channel at the documented levels and polarity, keep direction stable around the counted edge, and leave ENABLE as a logic-controlled line.
  • You need to state a shaft speed: divide the step rate by pulses per revolution — at the worked example's setting that is 75 rpm — and confirm the microstep switch before quoting it.
  • Pulses arrive and the shaft does not move: run the jumper-first checks before buying anything.

Questions asked

Can a faster CPU or a leaner program make a normal output hold the rate?

No. A normal output can change state at most twice per scan, so the scan time becomes the shortest half-cycle it can produce. A 1 ms scan tops a toggled square wave out at 500 Hz, far below the commanded rate, and scan-to-scan jitter moves whatever edges it does place. Only a hardware pulse channel puts edges on a clock instead of on the scan.

What shaft speed does the commanded step rate give my motor?

Divide the step rate by the pulses the driver needs for one revolution, then multiply by 60. The commanded rate in the worked example turns a 200 full-step motor at 600 rpm with microstepping off, and at 75 rpm with the driver set to 8 microsteps per full step, which is 1600 pulses per revolution. Read the driver's microstep switch before quoting a speed anywhere.

Can the axis start directly at the full step rate?

Not usually. A stepper's pull-in torque does not extend to its maximum rate, so a driver handed a command already at the final frequency can stall, hum and lose count from the first edges. Positioning channels avoid this with acceleration and deceleration ramps: the frequency climbs from a start rate the motor can follow and comes down the same way. Keep the ramp inside the pulse hardware, not in scan logic.

Do the motor's windings connect to the controller's output points?

No. The output point carries only the low-current command signal. The motor's two windings are fed winding current from the driver's own power supply through the driver's power terminals, at the level the driver's current setting establishes. Routing winding current through controller output points damages the output stage and gives the driver nothing it can use; command and power stay on separate sides of the driver.

Keep reading

  • Explainer

    Stepper pulse timing from a PLC discrete output module

    A PLC discrete output can index a stepper, but the scan sets the pace: one complete pulse per two scans, so a 10 ms scan delivers about 50 pulses per second and a full-step 90-degree move takes about 1.0 s. Count only what the scan can see, match the driver input polarity before wiring, and move to a dedicated pulse output when the move must be faster.

    Servo and stepper motion

  • 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

  • Comparison

    A step and direction servo drive versus an open-loop stepper

    A step and direction servo drive takes the same pulse train as an open-loop stepper drive but closes the position loop inside the drive on the motor's encoder counts, so lost steps become a following-error fault instead of silent drift. The deciding arithmetic is the pulse budget: steps per inch times feed gives the steps per second your controller must supply, and a high-count encoder can exhaust that budget before the motor runs out of torque.

    Servo and stepper motion