---
title: Milling un-even surfaces / Z-heigh compensation
slug: milling-un-even-surfaces-z-heigh-compensation
docTags: 
createdAt: 2025-02-24T12:12:39.985Z
---

# Milling un-even surfaces.

This compensation can compensate for slight unevenness in the material surface. It is intended for relatively small compensation with a smooth, natural behavior.

![](https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/IQ9U9EEMBPQowmXMOxVlr_image.png)



![](https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/c8G6BQ9BnwlF9UdxPQCHK_image.png "Allowed types of compensation")

The compensation is applied directly to the motion of the Z axis, therefore the acceleration profile is determined by the shape of the compensation.

In cases where the compensation is not continuous, position errors may occur depending on the driver type used, the quantity of the discontinuity, and the speed of the actuators used. In open-loop systems, this may result in lost steps, and in closed-loop systems, this may result in a position following error.

## Start Measurement

::Image[]{src="https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/nGIbg5xt2hK-ZsAMk32U5_z-height-comp-start-measurement.png" size="50" width="361" height="438" position="flex-start" showCaption="false"}

This button will pop up an interpreter dialog for the automatic measurement macro using a touch probe. It executes the `zhcmgrid` macro. We provide a default implementation for this in the default macro file, but this may be modified by the machine builder or user. These instructions assume the use of the unmodified macro.

![](https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/a9Tneol3JDsKWj9TNxKzu_z-height-comp-grid-measure-dialog.png)

- **nx** The number of points on the x-axis to be measured. This needs to be a whole number.
- **ny** The number of points on the y-axis to be measured. This needs to be a whole number (integer).
- **maxZ** The z height from where the measurements start. Ensure that this is higher than the highest point on the grid or the probe will collide with the material.
- **minZ** The lowest point that the probe operation will travel to. If a point is below this number on the z-axis, this point will not be measured, this is displayed to the user during and after the measurements.
- **gridSize** The distance between measurement points on each axis.
- **Feed** The feed rate at which the probe operation measures the point. The lateral movements occur at G0 speeds.

Pressing **Cancel** will not run the Z Height Calibration macro. Pressing **Submit** will perform the calibration. **Render** will render the movements of the macro in the job view. Executing the macro again after the render is complete will open the dialog again with the previously entered values. Adjustments can be made and the calibration can be started.

After the calibration is complete, the measurements will be loaded into the software, but it is not activated yet. This is done by either checking the **Z height compensation on** checkbox or by executing the `ZHC ON` command. Additionally, the compensation is saved to the installation directory as *zHeightCompTable.txt.*

## Save Measurement

::Image[]{src="https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/L-SzZzCKzeCUak0Km3ywJ_z-height-comp-save-measurement.png" size="50" width="361" height="438" position="flex-start" showCaption="false"}

This button saves the measurements to a file. A dialog opens where the location and name of the file can be selected.

## Load Measurement

::Image[]{src="https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/vVLlN8UX0JItTvbW_Pgfu_z-height-comp-load-measurement.png" size="50" width="361" height="438" position="flex-start" showCaption="false"}

This button will open a file dialog where the file containing the calibrations must be selected. This loads the file, but it does not activate the Z height compensation yet. This is done by either checking the **Z height compensation on** checkbox or by executing the `ZHC ON` command.

## Check Measurement

::Image[]{src="https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/8Pj5qBxPNDrwYO3oh4pQS_z-height-comp-check-measurement.png" size="50" width="361" height="438" position="flex-start" showCaption="false"}

This button checks the currently loaded compensation file for completeness. This executes the `ZHCcheck 20` command.

## Move To Start Position

::Image[]{src="https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/s-fr4XMZQuZDN98Q8ZxWY_z-height-comp-move-start-position.png" size="50" width="361" height="438" position="flex-start" showCaption="false"}

This button will move the machine to the first measurement point in the Z height compensation grid. It executes the `ZHCMOVETO 0 0` command.

## Z height compensation on

::Image[]{src="https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/JmIPTKhRPhKyegWyjQQrW_z-height-comp-on.png" size="50" width="361" height="438" position="flex-start" showCaption="false"}

Checking this checkbox will enable the Z height compensation, unchecking it will disable the Z height compensation.

## Show current compensation value in DRO

::Image[]{src="https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/wf_gUQNvmPqIG2RXpf18s_z-height-comp-show-in-dro.png" size="50" width="361" height="438" position="flex-start" showCaption="false"}

Checking this checkbox will show the compensation values in the DRO.

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/qzkrJgnwj8_3euZf8hLjY_z-height-comp-off-dro.png "Show current compensation on")
:::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/wP9peVc2bAVBPOh6IboCS/w6MHfYzlLIDRxllf2zLIx_z-height-comp-on-dro.png "Show current compensation off")
:::
::::

****
