How-to
Gantry Follower Encoder Scaling With Different Resolutions
Short answer
A gantry follower servos to the leader's numerical command, so both motors travel the same distance only when their motor units match. Set the follower position scale factor to the leader's multiplied by the ratio of the two counts for one unit of travel, and retune afterwards. Identical encoders with matched factors hide the change, and a virtual follower cannot test it at all.

On this page
A gantry follower gets no trajectory of its own: the controller hands the leader's numerical position command to both motors every servo cycle, and the follower servos to that number in its own motor units. The two carriages therefore travel the same physical distance only when one motor unit means the same distance on both motors. When the encoder resolutions differ, the fix is arithmetic rather than tuning: set the follower's position scale factor to the leader's factor multiplied by the ratio of the two counts figures for one unit of travel. On the Power PMAC family that element is Motor[x].PosSf, with Pos2Sf held at the same value, and the servo loop needs retuning afterwards. This article gives the formula, a worked example built on a decode change from x4 to x2, the setup and verification sequence for the machine, and the bench situations that make the scaling look ignored.
Why both motors must hold the same motor units #
The gantry leader/follower algorithm exists so the controller does not have to recompute a trajectory for each motor. It sends one numerical position command to every motor in the pair at every servo cycle and lets each motor's own loop reach that number in that motor's own units. Two consequences follow directly:
- With equal counts resolution and equal scale factors, one motor unit is the same distance on both motors, so identical commands produce identical travel.
- With unequal resolution and equal scale factors, the same command means different distances on the two sides. Each loop still reaches its commanded number, so nothing flags an error while the carriages drift apart in proportion to the resolution ratio.
The follower is just a flag on the motor: the follower carries the servo control setting ServoCtrl = 8 while the leader stays on its normal closed-loop setting, ServoCtrl = 1, on the same controller family. Controllers that couple the axes differently, such as syncing two axes as one gantry over EtherCAT as described in How Two Servo Axes Sync as One Gantry Axis Over EtherCAT, still hand both motors the same numbers, so the units argument applies to them unchanged.
The follower scale factor formula #
The position scale factor converts encoder counts into motor position: motor position equals the factor times the encoder count, as documented for Motor[x].PosSf in the Power PMAC user manual. For both motors to hold the same motor units over the same travel:
follower PosSf = leader PosSf × (leader counts ÷ follower counts)
with both counts taken for the same unit of machine travel — one millimetre or one inch, whichever the machine works in. Counts divided by counts is dimensionless, so the result is a plain multiplier on the leader's factor.
Each counts figure is three numbers multiplied together: the encoder's line count from its datasheet, the quadrature decode multiplier configured in the controller, and the mechanical transmission from the machine drawing (pulley teeth, screw lead, rack pitch). The transmission belongs in the number as much as the electronics do; the retrofit arithmetic for Servo Pulley Ratio and Travel per Revolution in a Retrofit shows how the mechanical side changes it. The decode multiplier is the term people forget: a quadrature decoder builds counts from the edges of the two encoder channels, four counts per line at x4 and two at x2, and the signal-level detail of how quadrature shaft encoder signals are decoded explains where those multiples come from.
A resolution mismatch is also exactly what appears when one side's feedback hardware changes: Fix Servo Travel Error After Swapping Resolver and Encoder works through the travel error that follows a resolver-and-encoder swap, and the same formula reasoning repairs it.
Worked example: one decode changed from x4 to x2 #
These are example inputs chosen to make the arithmetic checkable, not measurements from a production machine: a 2000-line encoder on each motor, a 5 mm screw on each axis, and the leader at decode x4.
- Leader, decode x4: 2000 lines × 4 = 8000 counts per revolution, and 8000 ÷ 5 mm = 1600 counts per mm.
- Follower, decode changed to x2: 2000 lines × 2 = 4000 counts per revolution, and 4000 ÷ 5 mm = 800 counts per mm.
- Ratio: 1600 ÷ 800 = 2, so follower PosSf = 1.0 × 2 = 2.0.
With the factor left at the leader's value the follower count is twice as coarse, so the same commanded number moves the follower twice as far — a 2:1 travel ratio with no fault raised. Setting the follower's PosSf to 2.0 and Pos2Sf to 2.0 makes one motor unit mean the same distance on both motors again, and measured travel returns to 1:1. The direction of the correction is the part to remember: the coarser count needs the larger factor.
Setting and verifying the follower scale factor #
Work with people clear of the gantry span: a scaling error in a rigid gantry drives the two carriages apart until something binds, so the first motion after any scaling change must be short, slow and observed.
- Confirm the modes. Read the follower's ServoCtrl = 8 and the leader's ServoCtrl = 1 back from the controller rather than trusting the last value written.
- Collect the inputs: the leader's PosSf, each encoder's line count from its datasheet, the decode multiplier from the controller's encoder configuration, and the transmission ratio from the machine drawing. Never take the counts figure from the nominal line count alone; the decode changes it.
- Compute the follower's PosSf from the formula, write it to the follower motor, and read it back to confirm the stored value. Set Pos2Sf to the same number so inner-loop and outer-loop scaling agree; matching Pos2Sf is not strictly required for tracking, but it removes one variable from the loop.
- Lower the follower's servo gains before any motion. Scale factor terms act as gains inside the servo loop, so doubling the factor doubles that contribution to loop gain. Start low and plan to retune.
- Command a short, slow leader move with the carriages uncoupled or unloaded as far as the machine allows, and confirm both motors move and neither drive faults.
- Measure physical travel on both sides with an independent indicator — dial indicator, linear scale or a marked reference — and confirm the follower's measured travel equals the leader's within the machine's tolerance. A 2:1 or 1:2 result means the ratio entered the formula inverted or a decode changed without its factor.
- Retune the follower at the new scaling, then repeat the move in the opposite direction and at production speed once the slow result is clean.
Proving the scaling on identical encoders #
A bench rig with two identical encoders and matched factors shows nothing: both motors already hold the same units, so the factor can look ignored. A virtual follower cannot test this setting at all, because with no encoder there are no counts to rescale and no physical travel to compare.
Create a real mismatch instead. On identical quadrature encoders, change the decode on one of them from the default x4 to x2 or x1, which changes the count size in hardware and gives the formula something real to correct:
- Set both motors' PosSf to 1.0 with the decodes equal, and confirm one-to-one following.
- Change the follower's decode to x2 and confirm the follower now travels twice the leader's distance before any correction.
- Set the follower's PosSf to 2.0 and Pos2Sf to match, and confirm travel returns to 1:1.
If the last step shows no effect, check three things in order: that the write reached the follower motor (read the value back), that the decode change actually took effect (jog a fixed distance and compare the counts reported), and that you are measuring physical travel with an indicator rather than a reported position you assume has rescaled.
Symptoms and confirming checks #
| Symptom | Likely cause | Confirming check |
|---|---|---|
| Follower travels a fixed multiple of the leader | The two counts figures differ while the factors are equal | Compare the counts each encoder gives for the same travel and apply the formula |
| Changing the factor appears to do nothing | Identical encoders with matched factors, or a virtual follower with no feedback | Create a decode mismatch on one encoder and test with real feedback |
| Follower unstable or sluggish after the change | Scale factors act as servo-loop gains | Retune after every PosSf or Pos2Sf change |
| Screen position disagrees with the machine | The display conversion omits PosSf | Compare the displayed position with an indicator through the full stroke |
| Reported position moved but the machine did not | A reported value was verified instead of physical travel | Measure with an independent indicator on both carriages |
Display scaling in engineering units #
An operator display that converts motor position into millimetres must apply the same PosSf the drive uses, or the screen and the machine disagree after every scaling change. Build the display conversion from the same inputs as the counts figure — line count, decode, transmission — plus the factor, and confirm the displayed position against an independent measurement over the full stroke after each change.
Questions asked
Must the follower's position scale factor equal the leader's?
No. Nothing requires the two factors to be equal; what must match is the motor unit that results. When the encoder resolutions differ, the follower's factor has to differ by the ratio of the two counts figures, so one motor unit represents the same travel on both motors. Identical encoders are the only case where equal factors happen to be correct.
Does the position scale factor still work on a motor set as a gantry follower?
Yes. A motor set as a gantry follower is still servoed to the leader's command in its own motor units, so its position scale factor stays active. The impression that it was ignored comes from testing with two identical encoders and matched factors, where nothing observable changes until a decode difference is created on one of them.
How do I make the follower travel a different distance than the leader?
Aim the same formula at a chosen ratio instead of equality. Compute the factor that would equalize the two motor units, then divide it by the intended ratio of follower travel to leader travel. With an equalizing factor of 2.0, a follower meant to go twice as far gets a factor of 1.0, which is exactly the mismatch the decode change produces on the bench. Confirm the chosen ratio against an independent measurement before running production.
