AutomateDirectUSAMotion LibraryShop the parts catalog

How-to

Aligning aantry at Startup With Absolute Encoders

Servo and stepper motion Published 7 min read

Short answer

No, homez1,2 references each axis to its own absolute feedback; it does not align the two motors to each other. Square the beam with a skew measurement, record the follower-minus-leader position offset, and at every power-up jog the follower by the computed correction with the leader held on J/ before running homez1,2, or reference the leader and initialize the follower coordinate from the stored offset instead.

On this page
  1. Why absolute feedback does not square the beam
  2. Square the beam and record the offset
  3. Apply the offset at power-up
  4. Worked example: squaring a gantry with a -2.475 mm stored offset
  5. What stops the sequence
  6. Staying square after startup
  7. Questions asked

homez1,2 references both motors to their own absolute feedback, and that is all it does: each axis gets a valid coordinate, but nothing tells the follower where the leader is. A dual-motor gantry needs one extra number, measured once, with the beam physically square: the position offset between the leader and the follower. Record it against an interferometer or skew-angle device, store it, and at every power-up compute the follower's correction and jog it there with the leader held on J/ before you run homez1,2. If the controller permits it, reference the leader and initialize the follower's coordinate from the stored offset instead of moving it. Both routes are below, with the arithmetic.

Why absolute feedback does not square the beam #

An absolute encoder's position data is referenced to its axis once, at initial commissioning; after that, a valid saved reference lets the drive close its position loop at power-up without recalibrating. That reference is per motor. The squareness of a gantry is a relationship between two motors, and neither encoder contains it. You supply it.

Equal counts are not evidence of a square beam. Encoder mounting, the motor-to-mechanism transmission and each axis's coordinate origin all differ from one side to the other, so a square beam usually reads as two different numbers. The reference is the measured geometry on the skew instrument, never numerical equality.

Keep two calibrations apart. The drive's encoder offset calibration fixes the phase between the encoder and the motor's rotor, a per-motor value the drive commutates against. The gantry alignment offset is between two axes. Recalibrating one says nothing about the other, and both must be right before coordinated motion. Whether your absolute encoders hold their reference through power cycles or depend on a battery is covered in are servo motor absolute encoders really battery-backed.

Square the beam and record the offset #

Do this once at commissioning, and again after any mechanical change on either side: a belt, coupling or encoder swapped on one side invalidates the recorded offset.

  1. Before moving either side on its own, find the gantry's permitted differential travel, the skew the beam and its drivetrain tolerate, from the machine's mechanical design. Every later decision is gated on this number.
  2. Moving one side of a coupled gantry alone twists the structure, so keep people clear of the beam while it is under power, and reposition it by hand only through the machine's approved de-energized procedure with the drives off.
  3. Put an interferometer or a skew-angle measuring device on the beam as the alignment reference. This is a machine-tool squareness test, and ISO 230-1 sets how such geometric tests run: machine at no load, quasi-static, with the instrument referenced to the machine. The acceptance tolerance comes from your design, not from the standard.
  4. Jog the two sides in small increments until the measured skew is inside the machine's tolerance, then leave the beam stationary.
  5. Read both absolute positions in the controller. Record the units, and confirm with a small permitted jog that both axis coordinates increase in the same physical direction; if one counts down while the other counts up, the sign rules below change for that axis.
  6. Compute the alignment offset, follower position minus leader position, both read at the aligned condition. Store it where the controller keeps persistent configuration, then verify once, by cycling power, that the value survives the startup sequence your machine actually runs.

Apply the offset at power-up #

Both sequences start the same way: read both absolute positions before commanding anything, check each axis's feedback status, and bring both readings into the same units and direction convention you used at commissioning. Raw feedback positions and coordinate-shifted positions are different frames, and every term of the calculation must come from one frame.

alignment offset = follower position at alignment - leader position at alignment
follower target = current leader position + alignment offset
follower correction = follower target - current follower position

These are commissioning calculations, not controller syntax, and the signs assume both coordinates increase in the same physical direction.

Move the follower, then reference #

  1. Compute the correction from the formulas above.
  2. Compare its magnitude with the permitted differential travel. Inside it, continue; outside it, stop and diagnose, as the table below sets out.
  3. Hold the leader stationary with J/, and watch its feedback while you work, because a leader that moves moves the follower's target with it. Confirm what J/ does to your motor in the installed controller's documentation before you rely on it.
  4. Jog the follower by the correction at a slow commissioning rate, watching both position readings and the skew instrument. Abort if the leader shifts, if the correction increases skew, or if either axis faults.
  5. With the beam square again, run homez1,2 to reference both motors, then check the post-reference positions before allowing coordinated travel.

A follower configured to move only through the gantry coupling will refuse an independent jog. That refusal is a configuration answer, not a fault: use the controller's documented commissioning mode for independent moves, or take the next route.

Reference the leader, then initialize the follower #

  1. Compute the correction as above and gate it against the permitted differential travel, even though you will not make the move.
  2. Reference the leader with HomeZ.
  3. Initialize the follower's position so its coordinate equals leader position plus alignment offset. Position fields written Motor[x].Pos in some controller families are notation for a motor's reported position; which field is writable, and in what units, is set by your controller's documentation.
  4. Apply the holding sequence to the leader and then the follower with the verified J/ behavior, and watch the follower's following error. A follower that pulls means its initialized coordinate and the active coupling disagree, and that disagreement is what you fix next.

Worked example: squaring a gantry with a -2.475 mm stored offset #

Inputs, all calculated-example values in the controller's user units rather than measurements from a machine:

  • Permitted differential travel: ±2.0 mm, from the machine's mechanical design.
  • Leader position with the beam square at commissioning: 412.350 mm, read from the controller's position display.
  • Follower position at that aligned condition: 409.875 mm, same source.
  • Leader position at power-up, before any move: 623.480 mm.
  • Follower position at power-up, before any move: 620.730 mm.
  • Both axes confirmed to increase in the same physical direction.

The rule in words: the alignment offset is the follower's reading minus the leader's at the aligned condition; the follower's target is the leader's current reading plus that offset; the correction is the target minus the follower's current reading.

  • 409.875 mm - 412.350 mm = -2.475 mm (alignment offset, stored)
  • 623.480 mm + (-2.475 mm) = 621.005 mm (follower target)
  • 621.005 mm - 620.730 mm = +0.275 mm (follower correction)

The follower sits 0.275 mm short of square. Decision: 0.275 mm is well inside the ±2.0 mm permitted differential travel, so hold the leader on J/, jog the follower +0.275 mm at commissioning speed, confirm square on the skew instrument, then run homez1,2. A computed correction beyond ±2.0 mm is refused: the beam cannot skew that far since the last power cycle without something being wrong with the feedback, the scaling, the stored offset or the hardware, and the machine gets that answer before it moves.

What stops the sequence #

Observation Check before any motion What it means
The two positions differ on a beam that measures square Stored offset and the two coordinate origins Correct: keep the measured relationship, do not force equal counts
The correction has the wrong sign, skew grows on the first move Direction convention and subtraction order Fix the convention before enabling the correction
The correction changes after referencing Which coordinate each step reads Recompute every term in one coordinate frame
The correction exceeds the permitted differential travel Feedback validity, scaling, stored offset, real skew Stop automatic alignment until the discrepancy is explained
The leader shifts during the follower jog The J/ target motor and axis faults Abort the jog and re-establish the hold

Staying square after startup #

Once both axes are referenced and the beam is square, coordinated motion holds it there. To the controller the gantry is two real axes with a defined leader-follower relationship, which is why counting real axes before selecting a gantry motion controller pays off before the next machine. Holding two servo axes locked together under load is separate from the startup problem and is covered in synchronizing two servo axes on one heavy lift. Re-measure the offset only after mechanical work on either side; until then the stored value stands, and the startup correction you compute is the running check that it still does.

Questions asked

Does homez1,2 square the two gantry motors with each other?

No. homez1,2 references each motor to its own absolute feedback, so afterwards both axes have valid coordinates, but the relationship between those coordinates comes only from the offset you measured with the beam physically square. Run it after the follower correction, or reference the leader and initialize the follower's coordinate from the stored offset instead.

Should both encoders read the same counts when the beam is square?

Not usually. Encoder mounting, the motor-to-mechanism transmission and each axis's coordinate origin differ from side to side, so a square beam normally reads two different numbers. The subtraction result is your reference: if it repeats across power cycles, the relationship is sound. Chasing equal counts will twist a mechanically square gantry out of alignment.

The follower refuses the jog command while the gantry coupling is active. What now?

A follower configured to move only through its leader will reject an independent jog, and that rejection is a configuration answer rather than a fault. Use the controller's documented commissioning mode that permits independent moves, or switch to the second route: reference the leader with HomeZ and initialize the follower's coordinate from the stored offset instead of physically moving it. Repeated jog commands will not get you there.

What happens to the stored offset if an encoder loses its absolute position?

The stored offset relates two coordinate systems that no longer mean what they did when you recorded it. Re-establish the encoder's own reference first: an absolute encoder that has lost its stored data reports zeroed or invalid position and the drive flags it. Then re-measure the alignment offset with the skew instrument before trusting any computed correction. The drive's commutation offset is a separate per-motor calibration and may also need redoing.

Keep reading

  • Troubleshooting

    Why a Servo Axis Runs Away During Tuning

    A servo that completes its commanded move, then throws itself into reverse at full speed while the velocity command has no effect, has a feedback fault: reversed encoder direction, or open, crossed or noisy encoder wiring. Uncouple the motors, verify feedback polarity and continuity with the drive disabled, then retune from default gains. Raising gains cannot fix positive feedback.

    Servo and stepper motion

  • Troubleshooting

    Fix Servo Travel Error After Swapping Resolver and Encoder

    Travel that does not match the position display after a resolver-to-encoder swap is a scaling fault: the drive or the technology axis is still converting counts with the other feedback's increments per revolution. Measure one commanded move and divide actual by displayed travel; a constant ratio equal to the resolution ratio names the encoder data. Fix both layers, re-home, then re-tune.

    Servo and stepper motion

  • Troubleshooting

    Fixing a grid align error after a servo motor rebuild

    The zero-return switch made, but the control finished its alignment move without seeing the encoder's marker pulse. Verify the encoder connector, cable and the Index Invert A and Index Invert B fields first; if those are right, loosen the motor coupling, rotate the motor 180 degrees on the ballscrew and re-home — the documented field fix that clears the alarm when the marker sits outside the alignment move.

    Servo and stepper motion

Reseat servo horns at the startup pose on a robot arm