AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Gearing cannot switch servo feedback between two encoders

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

Short answer

A gear command makes one axis's commanded position follow another axis's position by a ratio and offset; it never routes a second encoder's counts into a servo axis's feedback input. Relay-switching quadrature lines corrupts the two-channel state sequence and adds or drops counts even at a standstill. Switch feedback only through a documented selection at a stopped, offset-reconciled transition, or close the loop on feedback that never uncouples and use the load encoders as masters.

On this page
  1. What a gear command actually does
  2. Why relay-switched quadrature lines glitch
  3. Following the outgoing encoder is not closing the loop on it
  4. What a legal feedback switch requires
  5. What one relay transfer costs a 1000-line quadrature encoder
  6. The decision for each case
  7. Questions asked

Gearing will not get you there, and the relays are the reason the current machine is flaky. A gear command sets one relationship: a slave axis's commanded position becomes the master's position times a ratio plus an offset. It never routes a second encoder's counts into a servo axis's feedback input, so no ratio, no offset and no second tuning set can make one encoder input close another channel's loop.

Relay-switching quadrature lines fails for a separate physical reason: the two channels must arrive as an unbroken sequence of states, and a contact transfer breaks that sequence, adding or losing counts even with the machine standing still. You have three workable answers, one for each requirement: gear to the coupled encoder while the loop stays closed on feedback that never uncouples, assign the outgoing encoder as the axis feedback only if the controller documents that, or switch feedback through a documented selection at a stopped, offset-reconciled transition.

What a gear command actually does #

Electronic gearing ties two axes together on the command side. The slave axis's commanded position is continuously set to the master's position multiplied by a gear ratio plus an offset, and the master can be another servo axis or an external encoder configured as a master position source. The definition contains the whole answer: gearing changes what the slave is told to do, not what the slave measures. The slave's servo loop still compares its commanded position against the feedback configured on its own axis and drives the output until the two agree. Which device provides that measurement is fixed by wiring and axis configuration — that is the question of where the position loop closes decides your servo conversion, and closing a loop on a load-mounted encoder rather than a motor-mounted one carries its own requirements, listed in what an external encoder position loop needs to close.

Your machine then removes the option quietly: during outgoing operation the incoming encoder is uncoupled from the load. An uncoupled encoder reports its own idle shaft, so its counts no longer represent the material or the rollers, and a gear relationship built on them tracks nothing. No motion command routes the second channel's encoder into the first channel's loop either, because a gear command writes commanded positions; it does not re-wire feedback.

Why relay-switched quadrature lines glitch #

A quadrature encoder reports motion through two channels whose pulses run 90 degrees apart. The receiver derives movement from their frequency and relative phase and counts the four possible combinations of the two channels in strict order, one count per step. A relay transfer between two encoder sets attacks that sequence three ways:

  • Break-before-make contacts open a line mid-sequence, a state is skipped, and a count is lost.
  • Make-before-break contacts and contact bounce create transitions that never happened mechanically, so phantom counts appear.
  • A transfer slow enough that the axis sees no edges at all reads as loss of feedback, and many servo controllers trip a fault right there.

None of this depends on the machine moving: the corruption happens in the measurement itself. That is why the machine stays flaky even though the swap is timed to the punch stop, with the material standing still. The stop removes the speed mismatch between the two measurements; it does not remove contact glitches, and it does not make the two counts agree. For the same material datum the two encoders can report different positions, so the instant of the switch also injects a position step into a live loop.

Following the outgoing encoder is not closing the loop on it #

Separate the two jobs hiding in the original plan. Following means the axis's commanded position tracks the encoder that is currently coupled to the material, and gearing answers it. Feedback selection means the measurement the servo loop trusts comes from an encoder that is physically reporting the load, and axis configuration and wiring answer it — no motion command does.

If outgoing operation only needs the rollers to stay synchronized while the outgoing encoder measures the material, the clean architecture is: configure the outgoing encoder as a master axis, gear the driven axis's commanded position to it, and give the driven axis feedback that never uncouples — an encoder on the motor or on the common roller shaft. That is the arrangement described in using a servo motor encoder as external machine feedback, and both load encoders then work as master references, the role gearing actually supports.

If the requirement is genuinely that the servo loop close on the outgoing encoder, the test is a documentation test: the motion controller must document that physical encoder input as an assignable feedback for the axis. Two encoder inputs on one card do not imply cross-channel feedback routing; the channel numbers are not a switch. If the assignment is not supported, gearing is not a substitute — change the architecture instead.

If one axis must truly change feedback sources with the mode, the only legitimate path is the feedback-selection capability the controller or drive documents for that purpose: a feature that swaps whole feedback inputs under program control, with a defined effect on position. Whether multiple feedback devices are supported on one axis, and what a documented switch does to the position registers, is stated in the motion controller's axis-configuration documentation. That document, not the gear command set, is the one that answers your question.

The conditions around the switch are the same everywhere: machine stopped, axis disabled or motion inhibited through the transfer, the position offset between the two measurements computed and applied first so the commanded position at the instant of transfer matches what the new feedback reports, then re-enable under the machine's own restart rules. Copying a live count from one encoder into the other axis, or resetting position as a shortcut, is acceptable only as the controller's documented procedure for that axis configuration.

Keep personnel clear and the mechanism blocked through the handoff: if the offset is wrong, the loop converts the difference into a real move at re-enable, and that re-enable deserves the same treatment as any restart under the machine's risk assessment and lockout practice.

What one relay transfer costs a 1000-line quadrature encoder #

Inputs, and where each comes from:

  • 1000 lines per revolution: an example encoder resolution — take the real value from your encoder's datasheet.
  • 4 counts per line cycle: how quadrature decoding works; one full cycle of the two channels contains four states, and the receiver counts each one.
  • 360 degrees per shaft revolution: definition.

Rule in words: the receiver must see the four channel states in order, and every skipped, repeated or scrambled state changes the count by one, so the phantom angle equals the number of corrupted states times the angle per count.

Arithmetic:

  • Counts per revolution: 1000 lines x 4 counts per line = 4000 counts.
  • Angle per count: 360 degrees / 4000 counts = 0.09 degrees per count.
  • Minimum error per transfer: 1 corrupted state = 0.09 degrees of phantom rotation with the shaft not turning.
  • Bounce spanning two full line cycles: 2 x 4 = 8 counts, and 8 x 0.09 = 0.72 degrees.

Result: one relay transfer writes between 0.09 and 0.72 degrees of false shaft rotation into the axis position, at a standstill. This is a calculated example for those inputs, not a measured result.

Decision: the error floor is one count, and one count is already a false position the loop believes, so relays are disqualified for quadrature switching at any speed, including zero. The corrupted count is the loop's only picture of the machine; no tuning set repairs it and no gear ratio cancels it.

The decision for each case #

  • Follow the material through the machine: configure the coupled encoder as a master axis, gear the driven axis to it, and close the driven axis's loop on feedback that never uncouples — motor or common roller shaft. Switch gear relationships in the program, never in the encoder wiring.
  • Close the loop on the outgoing encoder: only if the motion controller documents that input as assignable axis feedback. If it does not, move the always-present feedback to the motor or the common shaft and demote both load encoders to master references.
  • Switch feedback per mode: documented feedback-selection method only, machine stopped, axis disabled, position offset applied before re-enable. Never a relay in quadrature lines, not even at the punch stop.

Questions asked

Can the feedback switch happen while the axis is disabled instead of merely stopped?

Stopped and disabled belong together. Stopping removes the speed mismatch between the two measurements; disabling removes the servo's ability to turn a feedback jump into motion. Keep the axis inhibited through the transfer, apply the position offset so the commanded and measured values agree at the instant of the swap, then re-enable under the machine's restart rules. Swapping feedback on an enabled axis makes the loop chase the difference as if it were real error.

Why not simply overwrite the axis position with the outgoing encoder's count at the transfer?

Because the two counts are not the same number even for the same material. The encoders can disagree on datum, direction sign and scaling, so a raw overwrite injects that whole difference as a position step and discards the material datum the machine was tracking. Compute the offset once at the stop and apply it, so the commanded position stays continuous while the measurement source changes.

Do separate tuning gains for each operating mode fix a flaky switch?

No. Gains shape how the loop responds to error once the architecture is right; they cannot change which encoder closes the loop or restore a count sequence broken during a contact transfer. Separate tuning sets earn their keep when the same feedback sees genuinely different loads in the two modes, for example different material stiffness. Fix the feedback architecture first, then tune each mode on its own numbers.

Can I configure both encoders as master axes and gear to whichever one is coupled?

Yes, for following. Configure the incoming and outgoing encoders as two master axes, gear the driven axis's commanded position to the coupled one, and change the gear relationship in the program when the mode changes. That solves material tracking only: the driven axis still closes its servo loop on its own configured feedback, which must be a device that stays coupled to the load in both modes.

Keep reading

  • Comparison

    Brushless servo motor: encoder or resolver choice

    Choose between a resolver and an encoder on the complete motor-drive-feedback system: a 12-bit resolver-to-digital conversion yields 4,096 absolute positions per revolution (0.0879 degrees) and rotor angle at power-up, while an incremental encoder quantizes more finely but needs Hall sensors or a phasing move before commutation. Decide on power-up position, quantization, vibration and the drive's command interface — not the biggest pulse count.

    Servo and stepper motion

  • Troubleshooting

    CNC Turret Servo Drive Alarm: Clamp Input or Encoder Battery

    Prove the turret clamp switch input before anything else; if it is present, the alarm belongs to the turret servo drive. An undocumented drive code can still be a discharged encoder battery: one documented drive showed an unknown code in one machine and the documented battery code in an identical machine. Replace the battery, match the displayed tool number to the physical station, then complete the drive's zero-point setting before running.

    Servo and stepper motion

  • Explainer

    Third party servo motor compatibility: the two checks

    Whether an OEM servo drive can run another maker's motor comes down to two documented facts: the drive documentation lists that exact feedback interface as supported, and its custom motor workflow accepts the motor maker's full data. A shared cable style and a feedback family label prove neither; asynchronous motors are the routine case, synchronous ones add commutation and tuning work.

    Servo and stepper motion