# Operation mode of distance control

Distance control is integrated after interpolation and superimposes the programmed motion. Distance control acts independently of the current state of the interpolator, i.e. it is active even when it is waiting for acknowledgements (e.g. M functions).

Distance control determines the actual absolute position of the workpiece surface with the aid of the axis motor encoder and an additional encoder sensor. The two encoders are coupled to one another, i.e. the values of the two encoders always act in opposite directions when the axes move.

The axis-specific feed override and feedhold act on distance control (see [HLI//Control commands of an axis]). When override is 0 or when the axis-specific feedhold is set, the current value of distance control is frozen.

Sensing the workpiece surface

## Notice

The encoder position of the motor and the sensor position must act in opposite directions when the Z axis is lifted or lowered.

For example, if the Z axis is lifted and the encoder value of the motor increases, the encoder value of the sensor must be reduced. If required, the parameter P-AXIS-00230 can be used to invert the motion direction of the sensor.

## Additional information

- Specifying the workpiece surface (SET_POS, surface)
- Specifying the distance (SET_DIST, distance)