AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

How-to

PLC pulse control of a servo motor: which instruction decides

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

Short answer

A relative pulse instruction moves a distance from the current position, an absolute instruction moves to a coordinate from the established origin, and a jog or variable-speed instruction runs a speed with no target: pick each move's instruction by what it references. No special PLC hardware configuration is needed until limit switches or the encoder Z-phase must reach the PLC as inputs; the drive's pulse input mode, electrical level and electronic gear come from its datasheet.

On this page
  1. What the move references decides the instruction
  2. No special PLC hardware configuration for pulse commands
  3. What to verify on the drive before the first pulse
  4. Worked example: operand values for a 120 mm index
  5. From choice to first move
  6. Questions asked

A PLC moves a pulse-commanded servo axis with three kinds of positioning instructions, and the move itself picks the right one: use the relative instruction when the cycle commands a distance from wherever the axis now sits, the absolute instruction when the machine holds an origin and positions are coordinates, and the jog or variable-speed instruction when there is a speed but no target. Writing the first pulse program takes no special PLC hardware configuration; position-control settings enter only when limit switches or the encoder Z-phase signal must reach the PLC as inputs. What does need checking is the drive side, because the drive's pulse input mode, electrical level and electronic gear decide whether the PLC's pulses move the motor at all.

What the move references decides the instruction #

Relative and absolute instructions both take a position value and a feed rate in pulses per second; jog and variable-speed instructions take only the feed rate. A negative distance, or a separate direction output depending on the PLC family, reverses the axis. In the common mnemonics the relative instruction is DRVI (DDRVI in its 32-bit form), the absolute instruction is DRVA (DDRVA), and the variable-speed instruction is PLSV, with jog forms such as DJOG in some PLC families. The operand layout and example rungs for DRVI, DRVA and PLSV are in the DRVI, DRVA and PLSV instruction walkthrough.

Instruction The position operand means Choose it when
Relative (DRVI / DDRVI) A distance in pulses from the current position The cycle indexes a fixed pitch: feed, cut, step, repeat. No origin needed.
Absolute (DRVA / DDRVA) A coordinate in pulses from the established origin The sequence names stations: part zero, tool change, home. Home before the first cycle.
Jog or variable speed (PLSV / DJOG) A feed rate only, no target Setup moves and manual handling.

The decision is mechanical: if the sequence can be written as distances, choose relative and skip homing entirely; if it names positions, choose absolute and home first; if a move has no target, jog it. Relative and absolute instructions share one pulse output and one coordinate system, so a program can mix them: one absolute move to the work start, then relative indexes for every cycle.

No special PLC hardware configuration for pulse commands #

A pulse instruction is program code, not an I/O setting: nothing in the PLC's hardware setup must be switched on before DDRVI, DDRVA or a jog instruction will emit pulses. Positioning instructions are vendor libraries called from the IEC 61131-3 languages, so they appear in the instruction list of the programming software, not in the I/O tree. The position-control area of the PLC's setup tool matters in one case only: when position-related signals will be defined to the PLC itself, such as limit switches wired to PLC inputs or the encoder Z-phase brought in for origin or mark detection.

In the usual pulse wiring those signals stay on the drive: its own digital inputs take the limit switches and its origin-return routine uses the Z-phase, so the PLC never sees them and has nothing to configure. The pulse and direction signals come from the transistor outputs named in the instruction's operands. And the PLC commands the drive, not the motor — why the drive sits between PLC and motor explains that chain.

What to verify on the drive before the first pulse #

The instruction choice does not prove the drive will accept the pulses; three drive-side facts decide, all documented in the drive's connection and parameter manuals. First, the pulse input mode: pulse-and-direction on one line pair, or two pulse lines for clockwise and counter-clockwise. Set the matching mode in the drive's parameters and wire to it. Second, the electrical level: pulse inputs take either differential line-driver or open-collector signals at a stated voltage, and the drive's input specification, not the PLC's output rating alone, tells you which it wants.

Third, the electronic gear: the drive parameters that set how many command pulses equal one motor revolution, and every PLC number divides by that scaling to become millimetres. The wiring diagram in the drive's connection manual shows the pulse, direction and enable terminals and warns that it is basic wiring only; your panel adds shielding, fusing and the rest. Before wiring, compare your pairing against what decides PLC servo drive pulse interface compatibility.

Worked example: operand values for a 120 mm index #

This is a calculated example, not a measured result, for these inputs: a 5 mm ballscrew coupled 1:1, the drive's electronic gear set so 10000 command pulses equal one motor revolution (an example setting; the drive's parameter list gives the real one), a feed of 40 mm/s, an index of 120 mm, and a PLC pulse output rated 100 kHz — your PLC's own output specification governs.

  • Pulses per millimetre: 10000 pulses/rev ÷ 5 mm/rev = 2000 pulses/mm.
  • Index distance: 120 mm × 2000 pulses/mm = 240000 pulses.
  • Feed rate: 40 mm/s × 2000 pulses/mm = 80000 pulses/s, that is 80 kHz — under the 100 kHz rating. Driving an axis to full speed from a 100 kHz output is the arithmetic in servo pulse rate required for 2500 rpm from a 100 kHz PLC output.
  • Move time: 120 mm ÷ 40 mm/s = 3 s.

The operands follow directly: relative takes a distance of 240000 pulses and a feed of 80000 pulses/s, with a negative distance reversing; absolute takes the same coordinate, 240000 pulses, once the origin sits at the start of the index with part zero; jog takes the feed value alone, 80000 pulses/s, held until the program writes zero or the operator lets go. Change the electronic gear and every one of those operands scales by the same factor.

From choice to first move #

  1. Write the cycle as moves and tag each one relative, absolute or jog from the table above: distances need no origin, positions need homing, targetless moves are jog.
  2. Compute pulses and feed rates as in the worked example, using your machine's lead or pulley ratio and the drive's actual electronic-gear setting.
  3. Set the drive's pulse input mode and electronic gear in its position-control parameters, and wire pulse, direction and enable exactly as its connection document shows, matching the input level to the PLC's output type.
  4. Leave the limit switches and the encoder Z-phase on the drive's digital inputs, and let the drive's origin-return routine set the origin; configure position-control parameters in the PLC only if those signals must reach the PLC as inputs.
  5. Clear the axis path and run one short relative move at a fraction of the final feed rate first. A wrong direction on the first energized move is the standard failure of a new pulse axis, so treat the first runs as if the axis will run backwards; your machine's risk assessment and guarding requirements govern.
  6. If the move runs the wrong way, flip the sign of the distance operand or the direction output's active level, whichever the PLC's instruction documentation defines, then raise the speed in steps and confirm the distance travelled on a scale — the counter proves the program, the scale proves the machine.

Questions asked

Can a relative move and an absolute move share one pulse output?

Yes. Both instructions drive the same output port and the same coordinate system, so a common pattern is one absolute move to the work start, then relative indexes for every cycle. The rule that matters is that two positioning instructions never run on one output at the same time: finish or stop the first before starting the second, as your PLC's instruction documentation requires.

My drive takes two pulse lines for clockwise and counter-clockwise. Does that change the instruction?

No. The instruction choice stays the same; only the drive's input mode and the wiring change. Set the drive's parameters to its two-line input mode and wire the lines it names in its connection manual, then the relative, absolute and jog instructions run unchanged. Check the drive's manual for whether its second input wants a pulse train or a direction level, because that detail belongs to the drive, not the PLC.

Do I need homing if every move in the program is relative?

Not for the moves themselves: a relative instruction needs no origin, it travels an amount from wherever the axis is. But the reference drifts, because each cycle adds its real distance and a slipped coupling or a bumped fixture shifts every position after it. If the process must re-find its reference, run the drive's origin-return routine periodically and add one absolute return move after it, or switch that part of the cycle to absolute.

What does the encoder Z-phase signal do in a pulse servo system?

It is the marker the encoder emits once per motor revolution, and the drive uses it to find and verify its origin during origin return. It normally stays wired to the drive. Move it to the PLC only when the program itself must catch it, for example to position against a mark or to build the machine's own coordinate system, and then configure it in the PLC's position-control parameters as an interrupt or origin input.

Keep reading

  • How-to

    Configuring a PLC pulse-output servo axis before PLS2 moves

    The drives are not plug and play: keep command scaling in one place, the drive's gearing or the PLC program, and stay under the 100 kHz pulse ceiling, which at 10,000 pulses per revolution caps the motor at 600 rpm. Prove direction, limits and homing first, then tune for the load.

    Servo and stepper motion

  • Comparison

    Lathe Electronic Gearing: PLC Pulse Output vs Divider

    Gear a lathe leadscrew to the spindle with a drive-side numerator/denominator divider for multi-pass threading: it holds the ratio exact per count and works in both rotation directions. The PLC path — measure spindle encoder frequency, output a scaled pulse frequency — is adequate for feed-per-rev crossfeed and single-pass threads, where a 1 Hz output quantum costs about 0.16% pitch error at the example's 317.5 Hz.

    Servo and stepper motion

  • Explainer

    Servo pulse rate required for 2500 rpm from a 100 kHz PLC output

    Hz and pulses per second are the same unit on a pulse train: 2500 rpm at 10,000 command pulses per revolution needs 416,667 Hz, past the 100 kHz output of a CP1H-Y20DT-D, which tops that scaling out at 600 rpm. Cut the effective scaling to 2400 pulses per revolution or less and the same output reaches 2500 rpm exactly.

    Servo and stepper motion