AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Troubleshooting

Why swapping motor leads fixes a servo position error

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

Short answer

When a servo axis takes off and trips on following error no matter the commanded direction, armature torque and encoder count are fighting each other — positive feedback. Fix it at the hardware: swap the two motor power leads at the drive. The software motor-direction setting only changes the machine's coordinate convention and cannot repair a reversed loop.

On this page
  1. Why does a servo axis trip a following error in both jog directions?
  2. Why does changing the motor direction in software do nothing?
  3. What makes torque direction and encoder count direction disagree?
  4. How do I confirm the encoder reports both directions before touching wires?
  5. How do I tell a polarity fault from a bad cable, motor, or drive channel?
  6. Which leads get swapped, and where?
  7. What proves the fix worked?
  8. Questions asked

If a servo axis spins the same way for both jog directions — or takes off the moment the drive enables — and then trips a following or position error, the position loop is signed backwards: torque pushes the encoder count away from the command instead of toward it. The fix is hardware, not configuration: exchange the two motor power conductors at the drive so torque direction and count direction pull the same way, and the loop becomes negative feedback again. The motor-direction setting in the control's configuration cannot do this job, because it only renames which physical direction the machine calls positive. Work the checks below in order — hand rotation first, cross-axis isolation second — so you swap leads once, deliberately, instead of guessing at a coin flip.

Why does a servo axis trip a following error in both jog directions? #

A fault that fires the same way for both jog directions almost always means the position loop is signed backwards: the drive's correction pushes the motor away from the command, so the following error grows until it crosses the drive's error limit and trips.

On the service screen the signature is unmistakable: the measured position register marches steadily one way while the command holds still or alternates, the shaft always breaks the same direction, and the error value drifts off in one sign without recovering. A following error that grows only mid-move under load, and not identically from rest in both directions, has a different cause set — that pattern is covered in troubleshooting a servo axis that faults mid move.

Work down this list from the cheapest check to the most involved, and let each confirming check clear a suspect before you touch a wire:

  • Loop sign reversed — counts arrive smoothly in both hand-rotation directions while the fault is identical for both jog directions; confirm with a controlled low-speed move, fix with the lead swap.
  • Encoder channel weak or dead — hand rotation gives no counts, one-direction counts, or jumps; confirm with the hand-rotation test plus a continuity check end to end.
  • Drive channel, configuration, or communications — the fault persists with a known-good motor and encoder on the channel; confirm with the cross-axis test below.
  • Fault tied to one machine position — it fires only when the axis reaches one spot along its travel, which points at the cable path, not loop sign.

Why the trip feels instantaneous — worked example, calculated for these inputs, not a measured result. Command a jog of 10 mm/s with a position-loop update period of 1 ms, both example inputs; take your drive's real update period and error limit from its documentation. Each update the command advances 10 mm/s × 0.001 s = 0.010 mm. With the sign reversed, torque drives the measured position away from the command, so the error grows by at least 0.010 mm + 0.010 mm = 0.020 mm every update — a divergence of 0.020 mm ÷ 0.001 s = 20 mm/s. Against an example position-error limit of 5 mm, the axis trips after about 5 mm ÷ 20 mm/s = 0.25 s. That quarter-second spin-and-trip is why an axis that faults before it ever reaches steady speed can still be a pure polarity fault.

Why does changing the motor direction in software do nothing? #

The software motor-direction setting only relabels which way the axis calls positive; it never changes the sign between drive output and encoder count, so a reversed hardware loop keeps growing the following error with the setting in either position.

That setting sits at the end of the chain, where the control decides which physical direction earns the positive sign in machine coordinates and on the DRO. The broken relationship sits earlier: command minus feedback, drive output, torque, encoder count, feedback. Flipping a display or command label leaves the torque-versus-count relationship untouched, so positive feedback stays positive. Gain changes cannot rescue it either — a bigger correction in the wrong direction faults faster, the same reason why gain changes cannot smooth a rough servo axis.

Drives do carry documented polarity settings, and it pays to read them with this distinction in mind. Delta's service FAQ, for example, documents setting the linear-encoder polarity parameter P1-74 to 1 to reverse the counted direction of an external linear scale — a convention fix for a scale that reads against travel. Nothing in that setting changes which way torque pushes. Input scaling and coordinate convention are software territory; torque-versus-count sign is hardware territory, and only a wire swap moves it.

What makes torque direction and encoder count direction disagree? #

A closed loop works only when a positive command produces torque that moves the encoder count toward the command; quadrature direction comes from which channel, A or B, leads the other, and torque direction comes from armature or phase polarity, so the two hardware facts have to agree.

Inside the control, a quadrature decoder turns the encoder's two square waves into a direction signal and a clock for a position counter; direction comes from which channel leads, never from the number of pulses. One binary choice lives on the encoder side, one on the torque side, and their relative sign is one more binary choice — a first-time hookup gets it wrong half the time, a genuine coin flip rather than a rule of thumb. Encoder manufacturers document the count direction their mounting produces for a given rotation sense; following that sheet at installation removes the flip before the first power-up.

When the relative sign is wrong, the control sees an error, applies corrective current, and that current moves the count further from the command, so it applies more — runaway until the fault logic trips. The fault can trip before the motor reaches any sustained speed, so a twitch-and-fault is as much a polarity signature as a continuous runaway. As a convention example, one control family's installation documentation expects the count to increase for counterclockwise shaft rotation viewed from the motor faceplate; take your own system's expected convention from its installation manual before testing anything.

How do I confirm the encoder reports both directions before touching wires? #

Disable power to the motor, turn the shaft by hand, and watch the position count: smooth counting in both rotation directions proves the encoder, its A and B channels, and the wiring to the control are all alive, which leaves loop sign as the prime suspect.

Run the test with the drive disabled so nothing can energize the motor; on a vertical axis, support the load and account for the brake first. Turn the shaft slowly and read the count on the service screen, then interpret what you see:

  • Counts both ways, smooth — the encoder path is healthy; polarity is the suspect.
  • One direction only — one channel is not arriving; check that channel's pair at both connectors.
  • No counts at all — supply voltage, common, or a broken conductor; with no feedback, polarity is meaningless until counts exist.
  • Counts that jump or lose increments — an intermittent connection or a true conductor crossed with its complement; inspect each differential pair as a pair.

A continuity check from the encoder connector to the control end, pin by pin, clears opens and pin-to-pin shorts, but it cannot prove under-power signal health or any polarity relationship. The path you just exercised is also the one whose complete failure stops homing with a feedback fault — why an encoder feedback fault stops servo homing covers that dead-path case.

How do I tell a polarity fault from a bad cable, motor, or drive channel? #

Move the suspect motor, its cables, and its encoder onto a known-good axis channel: a fault that travels with the assembly indicts the motor-side hardware, while a fault that stays on the original channel indicts the drive channel, its configuration, or its communication path.

Safety first, once: record every connector and lead position, remove drive power, and verify the bus has discharged by the drive manual's procedure before touching motor conductors. Then run the cross-axis test:

  1. Connect the suspect motor, motor cable, encoder, and encoder cable to a known-good channel, and configure the control to run that channel as its documentation describes.
  2. Command a small incremental move with a hand ready at the disconnect. If the fault follows the assembly onto the good channel, the motor-side hardware or its polarity relationship is at fault.
  3. Run the reciprocal test: connect the known-good motor and encoder to the suspect channel. A fault there indicts the channel's configuration, communications, or hardware.
  4. Keep each motor paired with its own encoder through both tests — crossing them builds a false feedback loop and invalidates the result.

A fault that travels with the assembly, combined with smooth bidirectional hand counts, is the polarity signature; go to the lead swap. A fault that fires only when the axis reaches one physical spot along its travel, rather than identically from anywhere, points at the cable path instead — the cable-carrier check in servo fault at one axis position: check the cable carrier walks that diagnosis.

Which leads get swapped, and where? #

Swap the two motor power conductors at the drive output terminals: the pair is a series circuit, so either end of it works, and one clean exchange reverses torque sign while leaving every feedback signal untouched.

On a brushed DC servo the two armature conductors run from drive to motor as a pair, and most carry no polarity markings at all; multi-lead motors rely on their own lettering schemes — how U V W X Y Z markings identify a two-speed motor's windings is one such scheme, worth knowing the next time you meet a motor with more than two leads. For the two-lead armature in front of you: label the pair before moving them, make the exchange once, and re-terminate with the shielding, strain relief, and insulation you found.

Two alternatives exist, and one is a trap. Exchanging the complete A and B channel pairs, true and complement wires together, also reverses the loop sign because it flips which channel leads — but it is more connector work and easier to get wrong, which is why the motor-lead swap is the usual choice. Exchanging a single true wire with its own complement is the trap: it corrupts one channel's differential polarity, producing counts that jump or sit still, and it fixes nothing.

What proves the fix worked? #

A correct swap shows a small, bounded following error that pulls toward zero for a move in either direction, both commanded directions producing opposite shaft rotations, and no fault; anything that still runs away means the loop sign was not the fault, so go back to the isolation test.

Restore the system and run the proof at low speed: one small incremental command each way, watching the following error on the service screen. With the sign corrected, the error rises briefly, peaks, and collapses to a small bounded value while the shaft turns the commanded way; reverse the command and the shaft reverses with it.

Only after the loop is stable in both directions should the software motor-direction setting be used, to make positive commands match the machine's coordinate convention — the job it was always meant to do. Keep the order in mind for next time: sign first, stiffness second, because how hard the loop may legitimately push for a given following error differs from axis to axis — that is the subject of why the KV factor varies from axis to axis. The decision, case by case:

  • Counts smooth both ways by hand, identical fault from both jog directions, fault follows the assembly onto a known-good channel: reversed loop polarity — swap the two motor power leads at the drive and retest at low speed.
  • Fault stays on the original channel with a known-good motor and encoder: the drive channel — its configuration, communications, or hardware.
  • No counts, or counts in one hand-rotation direction only: the encoder signal path — supply, pair wiring, connector, or channel health; fix that before polarity means anything.
  • Loop stable both ways but positive commands move the axis against machine convention: the hardware is right — set the software motor direction now, and it will hold.

Questions asked

Does the encoder index channel tell the control which way the motor is turning?

No. Direction comes only from whether the A channel leads or trails the B channel; the index output gives a single pulse once per shaft revolution and is used for homing and marker finding. A polarity fault with smooth counts in both hand-rotation directions has nothing to do with the index, so chasing that extra channel wastes time.

Can I verify A and B phase order with a multimeter instead of an oscilloscope?

Only partially. A meter confirms the encoder supply voltage, point-to-point continuity, and whether a channel sits at its high or low state while you inch the shaft between counts, and it catches a true wire crossed with its complement. It cannot show which channel leads the other, because phase timing is invisible to a meter. The count direction on the control's display while you turn the shaft by hand is the practical substitute.

Does the motor-lead swap fix apply to brushless AC servo motors too?

Not the same way. A brushless motor's torque direction comes from the drive commutating the phase leads against rotor-position feedback, so swapping two phase leads breaks that commutation relationship instead of cleanly reversing torque, and the usual result is a commutation fault or rough running. On brushless systems, use the drive maker's documented commutation test and phase-order or polarity settings rather than swapping power conductors.

Should I swap the encoder wiring instead of the motor leads?

You can reverse the loop sign by exchanging the complete A and B channel pairs, true and complement wires together, because that flips which channel leads. It is more connector work and easier to get wrong, so the motor-lead swap is the usual choice. Never reverse the encoder supply wires: that damages most encoders and changes nothing about direction.

Keep reading

  • Troubleshooting

    Servo Position Counts Up While the Motor Is Stationary

    Counts that rise while the motor shaft is held still are false feedback counts, not motion. Compare the controller's tell-position reading against the drive's rotor-position display: a drive value steady within 1 count while the controller climbs condemns the simulated-encoder path. Isolate the encoder output, cable, breakout and counting input by substitution, one part at a time, cheapest check first.

    Servo and stepper motion

  • Troubleshooting

    Troubleshooting a Servo Axis That Faults Mid Move

    An axis that runs a short distance under a held rapid and then stops has tripped the drive's following-error fault. When only the lightly loaded axis of an identical pair fails, and a clean reinstall of the control PC changes nothing, the cause is encoder noise coupled from the motor leads: separate the wiring, ground each shield at one end, and set a 3 µs step pulse before touching tuning.

    Servo and stepper motion

  • Explainer

    What an External Encoder Position Loop Needs to Close

    The axis reference an encoder block returns is a measurement, not a loop: an external encoder closes the servo position loop only where the drive or motion controller documents a secondary feedback assignment for the commanded axis. Verify direction, scaling, motion-block compatibility and encoder-loss faulting before you enable, and tune for the reversal transient the backlash now creates inside the loop.

    Servo and stepper motion