AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Stepper control from a PLC without onboard pulse outputs

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

Short answer

A CPU with no onboard outputs has no terminal that can make a hardware-timed step pulse, so you add a pulse source: a pulse-train technology module bound to an axis technology object, a compact CPU with high-speed outputs, a PROFINET stepper drive, or software-toggled outputs for very low rates only. Direction is a held level, set before the first pulse and stable across the driver's setup time.

On this page
  1. Why the CPU alone cannot emit a step pulse
  2. The four pulse sources
  3. The software-pulsing ceiling
  4. Worked example: 600 rpm on a 200-step motor at 256 microsteps
  5. Direction is a held level
  6. Wiring the driver inputs
  7. Prove the axis before you trust it
  8. The decision for each case
  9. Questions asked

You cannot generate a hardware-timed step pulse from a CPU that has no onboard outputs, so the question is never whether to add a pulse source, only which one. For a standard S7-1513 working with a CW5045 step and direction driver, that means one of four routes: a pulse-train technology module in the rack, a compact CPU with high-speed outputs, a PROFINET stepper drive, or a standard output module toggled from the program at very low step rates. Direction is the simpler half: it is a held level, set before the first pulse, not a signal you generate.

Why the CPU alone cannot emit a step pulse #

A step and direction driver advances one increment per pulse edge, and a stepper axis needs those edges evenly spaced, from a few hertz up into the hundreds of kilohertz, with acceleration ramps on top. Evenly spaced edges come from hardware, not from the program scan. In the S7-1500 family, the axis technology objects TO_SpeedAxis and TO_PositioningAxis generate the motion profiles, but each object has to be bound to a physical pulse channel in the hardware configuration; the S7-1500 Motion Control function manual describes the control of the pulse output channels through exactly these technology objects. A standard S7-1513 offers no pulse channel, so there is nothing to bind the object to, and removing the expansion card from the project removes the technology object with it. Confirm it in the device view in TIA Portal: no channel on this CPU offers pulse-generator or PTO options.

The four pulse sources #

Each route commits you to something different:

  • A pulse-output technology module. A module such as the TM PTO 4 (6ES7553-1AA00-0AB0) generates the pulse train in hardware; its manual covers the wiring, diagnostics and specifications, and presents Pulse Train Output as a simple, universal interface between controller and drive that many stepper and servo drives accept. Bind a positioning or speed technology object to one of its channels and you get ramps, step counting and positioning. This module is the expansion card you wanted to avoid, and no software trick replaces it.
  • A compact CPU with onboard high-speed outputs. Some compact CPUs in the family integrate high-speed inputs and outputs on the CPU chassis. Whether your exact CPU has them, how many pulse channels it offers and its maximum frequency are stated in that CPU's manual against the order number on the nameplate; the standard 1513 has none.
  • A PROFINET stepper drive. The drive generates its own pulse train internally and takes motion commands over the network, so no output hardware is added. The CW5045 is a pulse-input driver, so this route means replacing it with a network-capable stepper drive.
  • A standard digital output module, toggled from the program. No pulse hardware, software timing only, with the ceiling described next. Even this route adds a module, because the CPU has no outputs of its own to toggle.

That list answers the hope of avoiding added hardware directly: with this CPU, the only way to add nothing is to change the drive to a network type. Software alone is not a fifth option.

The software-pulsing ceiling #

Each pulse needs two state changes, one scan to switch the output on and a later scan to switch it off, so a program-toggled output tops out near f_max = 1 / (2 × T_scan), with the scan cycle in seconds and the result in hertz. Scan-time jitter spreads the edge spacing, the output module adds its own update time, and relay outputs are unusable. With scan cycles in the millisecond range, the ceiling lands somewhere in the tens to a few hundred hertz, and it is unsteady there. That suits a manual jog or a slow indexing move and nothing else; the full reasons are in why a PLC digital output cannot make a stepper pulse train.

Worked example: 600 rpm on a 200-step motor at 256 microsteps #

This is a calculated example, not a measured result. The numbers are the typical case used in a microstepping tutorial published in Analog Dialogue; substitute your own motor and driver setting the same way.

Inputs:

  • Motor: 200 full steps per revolution, the common 1.8° two-phase stepper (360° / 200 = 1.8°).
  • Driver microstep setting: 256 microsteps per full step, set by the driver's switches or parameter.
  • Target shaft speed: 10 revolutions per second, which is 600 rpm.

Rule in words: the pulse frequency equals the steps per revolution times the microstep setting times the revolutions per second.

Arithmetic:

  • Steps per revolution: 200 × 256 = 51,200 microsteps per revolution.
  • Frequency: 51,200 × 10 rev/s = 512,000 pulses per second, so 512 kHz, the same figure the tutorial gives for this case.

Cross-check against the scan: software toggling would need a scan cycle of 1 / (2 × 512,000 Hz), about 1 µs, and no PLC program scan runs anywhere near that.

Decision: above a few hundred hertz, software toggling is out, so this speed needs a hardware PTO source, the technology module or a compact CPU rated for it, and a driver whose maximum input frequency is at least 512 kHz. That maximum is a CW5045 manual value and is not stated here; if it falls short, cut the microstep setting or the speed, because the frequency scales linearly with both.

Direction is a held level #

Direction is a level, not a pulse. The sequencing rule: set the direction bit first, hold it stable for at least the driver's direction setup time, then start pulsing, and leave it stable until the train has stopped. The setup time itself is a CW5045 manual value and is not published here, so do not guess it; honor it structurally by writing the direction output one scan or one timer interval before the pulses are enabled, which hands the driver a margin equal to that interval. On a technology-object axis the object sequences direction and pulses for you. Never change direction while pulses are running: the rotor cannot reverse instantly, and the result is lost steps and a position offset.

Wiring the driver inputs #

Step and direction drivers take optocoupled inputs, and three values from the driver manual decide the wiring: the input voltage range and current per channel, whether the inputs are common anode or common cathode, and the minimum pulse width. Standard S7-1500 transistor output modules source 24 V DC, which pairs directly with common-cathode inputs; a common-anode driver needs sinking outputs or an interposing circuit, wired as its manual shows. If the driver has an enable input, give it its own output so the program can disable the stage between moves.

Prove the electrical side before the mechanical one: force the output on and off from a watch table with motor power off, and read the voltage at the driver terminals; the on-state reading must sit inside the driver's stated input range. Run the pulse line in shielded cable kept away from motor phase cables, because edges narrowed below the driver's minimum pulse width, or noise picked up along the run, arrive as lost or extra steps. Land the driver supply separately from the PLC logic supply and share 0 V only where the driver manual requires it.

Prove the axis before you trust it #

One safety note before any of this: forcing outputs and first moves happen with the mechanism unloaded or the coupling slack, because a powered step and direction stage runs whatever the pulses tell it, and an axis that moves at drive power-up before the software loads is its own failure mode, covered in why a stepper axis runs at drive power-up before software loads.

Then work up in stages:

  • Motor power off: force the direction output on and off from a watch table; the driver's input indicator or a meter on the terminal follows every change.
  • Low speed, counted pulses: mark shaft and housing, command a known pulse count at a low frequency, and confirm the shaft turns exactly that count divided by the steps per revolution; command the same count in reverse and the marks realign.
  • At speed: raise the frequency through the ramp and measure the train at the driver terminal with an oscilloscope or frequency counter; measured frequency equals commanded frequency, and pulse width stays above the driver minimum.
  • Endurance: run a hundred forward-and-reverse cycles and compare the marks; any accumulated offset means lost steps, so fix the ramp or the driver current, not the position count. If nothing moves at all, check the driver's enable input and jumpers before touching the program, as described in stepper pulse output enabled but motor not moving: jumper first.

The decision for each case #

  • The 1513 stays and the axis must position at working speed: add the pulse-output technology module, bind a positioning technology object to its channel, and set the axis up before the first move as shown in configuring a PLC pulse-output servo axis before PLS2 moves. This is the expansion card you hoped to avoid; no software substitutes for it.
  • The 1513 stays and the moves are slow manual jogs only: a basic transistor output module toggled from the program is enough inside the scan ceiling, with direction written a cycle ahead of the pulses.
  • The CPU is not bought yet: pick a compact CPU with onboard high-speed outputs and verify its pulse channels and maximum frequency in that CPU's manual against the frequency your mechanics actually need.
  • The pulse wiring is the problem you want gone: replace the pulse-input driver with a PROFINET stepper drive and command motion over the network.

In every case direction is handled the same way: a stable level ahead of the first pulse, held until after the last.

Questions asked

Can the CPU's PWM function generate the step pulses?

Only if the CPU actually has a PWM channel, and a standard 1513 has none. Where one exists it produces a steady square wave at a set frequency, which can drive a fixed-speed test or a crude speed control with direction on separate outputs, but it cannot ramp, count steps or position, and an axis technology object does not bind to it. Fixed-speed motion from PWM is a workaround; positioning needs a pulse-train output channel.

Should I wire the driver for step and direction or CW/CCW?

Step and direction uses one pulse output plus one direction output; CW/CCW uses two pulse outputs, one per rotation sense, and no direction line. Choose step and direction when the pulse source gives you one pulse channel and a spare standard output, which is the usual technology-module arrangement, and set the driver's switch or parameter to the mode you actually wired. CW/CCW earns its keep only where the direction setup time is hard to honor, since each input steps in one sense only.

How do I tell common anode from common cathode inputs in the driver manual?

Look at the wiring diagram for the common terminal of the signal inputs. If the optocoupler cathodes share a 0 V common, the inputs are common cathode and the controller must source current into them, which matches 24 V DC sourcing transistor outputs. If the anodes share a positive common, the controller must sink current, so sourcing outputs need an interposing circuit. Some drivers accept either arrangement depending on where the common lands.

Should the driver's alarm output go back to the PLC?

Yes. Wire the driver's alarm or error output to a PLC digital input and stop the pulse command the moment it asserts; otherwise the controller keeps counting steps a faulted driver never executes, and the position is wrong from that point on. The driver manual states the electrical type of that output, and that decides whether it drives the input directly or through an interposing device.

Keep reading

  • Explainer

    Why a PLC digital output cannot make a stepper pulse train

    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.

    Servo and stepper motion

  • 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