AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Absolute Encoder on a Speed-Controlled Drive With PLC Position Loop

Sensors, encoders and machine vision on the machine Published 7 min read By AutomateDirectUSA engineering team

Short answer

A servo drive can stay in pure speed control while the PLC closes the position loop from the encoder's cyclic absolute position word plus a zero-point correction offset. No drive-side positioner is needed. This article shows the signal path, the offset arithmetic with a worked example, and the loop limits you accept.

On this page
  1. What the drive actually does in speed mode
  2. How the absolute position reaches the PLC
  3. Setting machine zero with the correction offset
  4. Scaling to micrometers or micro-degrees
  5. Closing the position loop in the PLC
  6. Verifying the whole chain end to end
  7. Questions asked

Yes — the drive can stay in pure speed control and the PLC can close the position loop itself, using only the encoder's cyclic absolute position word and a zero-point correction offset. You give up the drive-side positioner entirely: no positioning setpoints, no traversing blocks. The drive's remaining jobs are to evaluate the absolute encoder and to follow the speed setpoint. This works whenever the telegram carries the encoder actual value to the controller and the PLC loop is fast enough for the axis. What follows is the signal path, the offset arithmetic, a worked scaling example, and the latency you must design around.

What the drive actually does in speed mode #

In speed mode the drive closes its current and speed loops and nothing else. The position controller on the drive is idle. The absolute encoder is still evaluated at power-up, so the drive knows where the shaft is without a homing run — the serial absolute interface reports the position at power-on, including the multi-turn revolution count. A serial absolute encoder reporting position and multi-turn count at power-up is exactly what makes this architecture possible; an incremental encoder would force you to reference every power cycle, which defeats the point.

One commissioning detail to verify in your drive's function manual: some drives document access to the encoder calibration and correction parameters as tied to the position-control function module. If those parameters are hidden in the expert parameter list, activate the module that exposes them — activating a function module does not oblige you to use its control loop. The telegram stays a speed-setpoint telegram, the positioner never receives a setpoint, and you still get the calibration, the retained value and the correction. Store the parameter set to non-volatile memory afterwards, or the activation and the offset vanish at the next power cycle.

How the absolute position reaches the PLC #

The path is the PROFIdrive telegram. Starting with standard telegram 3, the encoder position actual value is transmitted as a 32-bit value in the cyclic user data, in the words named Gx_XIST1 and Gx_XIST2, where x is the encoder number: XIST1 is the cyclic actual position used for motion, and XIST2 carries the absolute value. Pick a standard telegram that carries both words alongside the speed setpoint, and configure the same telegram number in the drive and in the controller's hardware configuration — a mismatch shifts the words and the PLC reads garbage that still looks plausible.

The 2048 figure often quoted for sine/cosine encoders is the number of sine/cosine periods per revolution; the drive interpolates within each period, so the effective increments per revolution are far higher than 2048 and come from the drive's encoder diagnostics, not from the period count. The multi-turn range likewise comes from the encoder data the drive reads. Take both from your drive's diagnostic display and the encoder datasheet, not from the nominal line count. Note that a change of one encoder mark is visible in bit 11 of the XIST1 actual value when the standard value 2048 is set — a useful check that the raw count is live before you trust the interpolated value.

Setting machine zero with the correction offset #

The correction is an offset applied between the raw encoder position and the position reported to the controller. It lets you assign machine zero without moving the encoder or running a homing search, and because the base value comes from the encoder itself, it survives power-off without a battery. The arithmetic is one subtraction, in encoder internal units:

correction = desired value at the reference point − raw absolute value at that point

Worked example: jog the axis to its mechanical reference stop and read the raw absolute value of 87,500,000 increments from the XIST2 word in the PLC. You want that stop to read 100,000 increments. The correction is 100,000 − 87,500,000 = −87,490,000 increments. Write that correction, store it to non-volatile memory, and power-cycle: the axis at the stop now reports 100,000 without any reference run. This is the same mechanism behind PLC-set encoder offsets and behind the classic case where an absolute-encoder home adjustment is lost after a power cycle — in both, the offset must be stored retentively or it does not survive.

If, after a power-up, the reported position is off by a whole number of revolutions, the encoder's multi-turn count rolled over: the axis moved farther between power-offs than the multi-turn range covers. Confirm the range against your axis travel before trusting the raw value across long shut-downs.

Scaling to micrometers or micro-degrees #

The drive reports increments. The PLC converts them. Take the effective increments per revolution from the drive's encoder diagnostics, multiply by the mechanical ratio, and use 32-bit integer or double-precision arithmetic — a 16-bit or single-precision intermediate loses resolution at large multi-turn values.

Worked example for a rotary axis: suppose the drive's diagnostics show 1,048,576 effective increments per revolution (2048 sine/cosine periods with 512-fold interpolation, an example figure — read the real one from your drive). Then each increment is 360,000,000 / 1,048,576 = 343.3 micro-degrees. A linear axis with a 10 mm lead screw resolves 10,000 µm / 1,048,576 = 9.5 nanometres per increment nominally — far finer than the encoder's real accuracy, so quote it as count resolution, never as positioning accuracy. Verify the conversion by moving the axis one known distance in both directions and checking the converted value changes by that distance.

Closing the position loop in the PLC #

When the PLC owns the position loop, the loop contains everything between the sample and the setpoint: the bus update time, the PLC cycle time and the drive's setpoint processing. The PLC sees position late relative to the drive's internal current-loop sampling, so the achievable loop gain is lower than a drive-side controller allows — lower loop bandwidth means slower transient response, and pushing gain to recover it buys overshoot and oscillation instead. Design with a modest proportional gain, a hard speed-setpoint limit, and a rate limiter so the speed controller never sees a stepped setpoint.

Example of the arithmetic: with a 1 ms bus cycle and a 10 ms PLC cycle, position can be roughly 11 ms old when the new setpoint is issued. For a rotary axis, compute the shortest-path error with modulo arithmetic over the revolution — a plain subtraction across the rollover point commands a full-revolution excursion. Command a small step unloaded first; a correct loop settles monotonically with the speed setpoint inside its limit.

Verifying the whole chain end to end #

Run these checks in a safe, unloaded state before production:

  • Rotate the shaft slowly by hand and watch the position word in the PLC: it must rise in one direction and fall in the other, with no jumps at standstill. Rising counts at standstill is a different fault — signal noise or a counting problem — not this architecture.
  • Power-cycle drive and PLC with the axis stationary: the first read must match the value before shutdown.
  • Power off, move the shaft by a known amount, power on: the new position must reflect the movement, proving the absolute value is evaluated from the encoder, not from a stored copy.
  • Run to the reference stop: the reported value must equal the corrected zero within the count resolution.
  • Pull the encoder cable in a safe state: the drive must raise an encoder fault and the PLC must stop the axis. Reconnect, acknowledge, and confirm the position is still correct without referencing.

The decision: if your axis needs absolute position across power cycles but not drive-side positioning performance, run the drive in speed mode, carry the absolute actual value in the telegram, apply one stored correction offset, and close the loop in the PLC with modest gain and rate-limited setpoints. If you need tight dynamic tracking, high loop bandwidth or camming and gearing, put the position loop back in the drive and send setpoints instead — the PLC-side loop will not match it.

One safety note: the PLC-loop architecture removes the drive's own positioning supervision. Keep the speed limit, the software limit switches and the stop reaction in the PLC, and treat them as part of the machine's risk assessment, not as substitutes for the guards and interlocks the applicable standard requires.

Questions asked

Do I need to activate the drive's position controller just to read the absolute position?

No. The absolute actual value travels in the cyclic telegram regardless of which loop owns the position. Some drives gate their encoder calibration and correction parameters behind the position-control function module in the commissioning tool; if those parameters are hidden, activate the module only to expose the parameters, leave the positioner unused, and keep sending a speed setpoint. Always confirm this access condition in the function manual for your firmware.

Why does my absolute position shift by a whole number of revolutions after a power cycle?

That points at the multi-turn range: the encoder's serial multi-turn count rolls over after a fixed number of revolutions, and if the mechanics can exceed that range between power-offs, the raw value wraps. Check the multi-turn range the drive reads from the encoder against your axis travel, and if the axis can exceed it, use a reference mark as a supervisor rather than trusting the raw value blindly.

How fast must the PLC loop run for this to work well?

The loop is only as good as the age of the position it sees. Add the bus update time, the PLC cycle time and the drive's setpoint processing delay; with a 1 ms bus cycle and a 10 ms PLC cycle, for example, position can be roughly 11 ms old at the moment the setpoint is issued. That caps achievable loop gain well below a drive-side controller, so start with modest proportional gain and rate-limited setpoints.

Where is the scaling from encoder increments to micrometers done best?

In the PLC. Convert with the effective increments per revolution, including fine-interpolation bits, and the mechanical ratio, using 32-bit integer or double-precision arithmetic so large multi-turn values do not lose resolution in a 16-bit or single-precision intermediate. Some drives offer scaling on the actual value, but verify in your firmware's manual that it applies to a speed-controlled axis before relying on it.

Keep reading

  • Troubleshooting

    Clearing an Absolute System Down Alarm on a Servo Drive

    An absolute system down alarm means the drive lost the absolute encoder's stored position because encoder power dropped entirely. Measure the backup battery first: the common serial-encoder interface trips at 3.1 V on a 3.6 V cell. Fix the battery, run the drive's absolute encoder clear, then re-establish machine position before automatic operation.

    Sensors, encoders and machine vision on the machine

  • Troubleshooting

    Why a servo drive connects but its absolute encoder reads nothing

    A working Python connection proves only that your computer talks to the drive. Position appears only when the clocked transaction completes: chip select wired for an SPI part, supply inside the datasheet range at the encoder pins, and the external buffer this pairing is reported to need. Then read the firmware's encoder object with its error count at zero.

    Sensors, encoders and machine vision on the machine

  • Explainer

    Are Servo Motor Absolute Encoders Really Battery-Backed

    Most servo motors sold as absolute use incremental feedback whose multi-turn count lives in battery-backed memory. The battery feeds a microamp retention circuit, not the operating draw, which is why the hold runs about two years powered down. Change the battery with the control powered so the count survives.

    Sensors, encoders and machine vision on the machine