How-to
Why a stepper driver needs PTO not PWM from an S7-1200
Short answer
A stepper driver's PULSE input counts edges, so PWM, which only varies duty cycle at a fixed count, cannot command a position move. Configure a PTO positioning axis on the S7-1200, scale the pulse count to travel and the frequency to speed, and stay under the driver's documented input frequency rating.

On this page
A stepper driver's PULSE input counts edges: each edge advances the motor by one commanded increment, so travel is pulse count and speed is pulse frequency. PWM does neither. It holds a fixed cycle while varying duty cycle, so it can change the average voltage a load sees but cannot tell the driver how far to move. For position control from an S7-1200, configure a pulse train output as a hardware positioning axis and drive it with the Motion Control instruction blocks. Keep the commanded frequency below the driver's documented input rating, and add a series resistor only when that driver's input circuit documents one.
Why PWM cannot command a position move #
PWM on the S7-1200 is a pulse-width modulator: you set a cycle time and a duty cycle, and the output holds that ratio for as long as the function is enabled. Nothing in the function counts edges. If you feed a PWM signal to a step input, the driver sees a continuous stream of edges at a fixed frequency and turns the motor continuously. Changing the duty cycle changes the pulse width, which most step inputs ignore; changing the cycle time changes speed but still defines no travel.
PTO is the opposite trade. The pulse train output fixes the pulse shape and varies two things the driver cares about: how many pulses it emits, and how fast. That maps directly onto what a step input expects. A pulse on output A with a direction level on output B, or a clock-up/clock-down pair, is a standard command interface for a stepper driver. This is the same distinction behind why a timer-driven stepper pulse train delivers the wrong step count: article:why-a-timer-driven-stepper-pulse-train-delivers-the-wrong-step-count covers what happens when the pulse source cannot guarantee the count.
What the driver input actually specifies #
The driver in question states a PULSE input frequency up to 200 kHz. Read that as a ceiling, not a target or a guarantee. It says the input electronics accept edges up to that rate; it does not say your CPU output can generate that rate, and it does not say your application needs it. Three separate limits decide the usable command frequency:
- the pulse-output capability of the exact CPU or signal board you installed;
- the driver's 200 kHz input rating;
- the electrical interface between them, including any current-limiting components.
Your operating frequency is set by the lowest of these, and then further by what the mechanics can follow. A clean pulse stream at the terminals does not prove the rotor follows every increment at speed.
Sizing the pulse frequency for 8 microsteps at 300 rpm #
Worked example, with inputs chosen to match a common full-step-200 motor at a driver subdivision of 8:
- Pulse count for one motor revolution: 200 full steps multiplied by the 8-step subdivision equals 1,600 pulses per revolution. Take both numbers from the motor datasheet and the driver's configured resolution, not from assumptions; the live article on setting a stepper drive to 200 steps per revolution walks through that setting.
- Commanded motor speed: 300 rpm, a typical positioning speed for a small axis.
The rule in words: pulses per second equals pulses per revolution multiplied by revolutions per second.
Arithmetic:
- 300 rpm divided by 60 equals 5 rev/s.
- 1,600 pulses/rev multiplied by 5 rev/s equals 8,000 Hz.
Result: the PTO must emit 8,000 pulses per second at top speed. That sits far below the driver's 200 kHz input rating, so the input is not the limiting factor for this axis; the CPU's pulse-output specification still needs checking for the exact hardware you have.
Decision: the same formula moves both ways. If you raise the subdivision to 16, the required frequency doubles to 16,000 Hz; if you gear the motor down 2:1 for the same linear speed, the required frequency doubles again. Compute the worst case for your settings and confirm every limit in the chain before committing the axis configuration. For the scaling side, the pulse-to-travel conversion in the axis configuration must use the same effective resolution the driver uses.
Configuring the axis, step by step #
-
Identify the installed hardware. Record the exact CPU and any output signal board, then confirm in the hardware documentation that the assigned channel supports high-speed pulse output. A relay output or an ordinary cyclic program output cannot generate a step train.
-
Add the pulse generator in the device configuration. Assign the eligible outputs and select the command format that matches the driver: pulse A with direction B, or clock up A with clock down B. The outputs assigned to the pulse function are reserved and unavailable for ordinary logic.
-
Create the positioning axis technology object and attach it to that pulse generator. The S7-1200 G2 note matters here: on that family, the axis drive interface may not offer PTO as a selectable option, which is exactly the situation described in article:why-the-s7-1200-g2-axis-technology-object-offers-no-pto-drive. Confirm on your hardware revision before planning the project.
-
Enter the mechanics and drive parameters: the pulse count for one motor revolution from the driver's resolution, the mechanical scaling from pulses to load travel including any gearing, and the direction convention. The Siemens documentation for the drive configuration describes the direction output convention, with one level defined as the positive direction of rotation; verify which level your wiring assigns before the first move.
-
Program the motion sequence with the Motion Control instruction blocks: Power for enable, the move instructions for positioning, Reset for faults, and a controlled stop path. Motion starts only from a ready axis, and completion or error status should gate the next command.
-
Commission at low speed. Execute a short move with conservative acceleration inside a clear travel envelope, and check that measured travel matches the commanded distance before raising speed.
Wiring the driver input: resistor or direct #
Read the driver's input circuit documentation before connecting anything. It states the input voltage range, the input current, the polarity and the minimum pulse timing. Direct connection is correct when the PLC output's high and low levels land inside that documented range. A series resistor is correct only when the documented input circuit requires external current limiting, as some optocoupler inputs do; that case and its sizing are covered in article:why-a-sourcing-plc-output-needs-a-resistor-at-a-stepper-drive-input, and the 24 V-to-5 V mismatch case in article:why-a-24-v-pto-needs-more-than-a-resistor-into-a-5-v-stepper-driver. For a documented current-driven input, first sizing is the supply voltage minus the input forward voltage and the output drop, divided by the required input current, in ohms; then check the resistor's dissipation while conducting against both the input requirements and the PLC output rating.
Commissioning checks at the driver terminals #
Measure at the driver terminals, not only at the PLC output. An oscilloscope shows the pulse amplitude, active polarity, pulse width and any distortion a multimeter hides.
- Stationary command: with the axis enabled and no move requested, expect no step edges. Edges while idle mean a configuration or wiring fault.
- Constant-speed move: the measured frequency should match the value your scaling formula predicts for that commanded speed.
- Travel check: a commanded move of a known distance must land on the same physical distance every time. If travel is consistently wrong by a fixed ratio, the axis pulse scaling and the driver resolution disagree.
If pulses arrive and the driver still refuses to step, the input interface and the driver enable state are the next places to look; article:why-an-ethercat-csp-stepper-axis-enables-but-does-not-move covers the enable-but-no-motion case from the drive side.
One safety note: commission the first moves with the travel envelope clear of hands and tooling, and keep the machine's own risk assessment and guarding requirements in force throughout. This article is a configuration guide, not a safety validation.
Questions asked
Can I use a PWM output as a step pulse if I keep the duty cycle at 50 percent?
You get a steady square wave, but the S7-1200 PWM function gives you no way to stop the wave after an exact number of edges. Position control needs a counted pulse stream, so the driver would turn forever or until you kill the output crudely, with no position feedback. Use the pulse train output of a configured axis instead.
Does the 200 kHz input rating mean I should run the axis near 200 kHz?
No. The rating is a ceiling on what the input accepts, not a target. Your operating frequency comes from the pulse count the driver needs for one revolution and the speed the application wants, worked out with the frequency formula in this article. Size the axis so the worst-case commanded frequency sits comfortably below the rating.
Do I always need a series resistor between the PLC output and the driver input?
Only when the driver's own wiring documentation calls for external current limiting at the input. Read the input circuit diagram first: it gives the input voltage range and current, and from that you decide between direct connection and a resistor sized so the input current lands inside that documented range.
What decides how many pulses the driver needs per revolution?
The driver's configured step resolution. At full-step it is the motor's native count, and microstepping multiplies that count by the selected subdivision. Set the PLC axis scaling to the same effective pulse count, otherwise the controller's position calculation and the physical travel will disagree.


