kreso-t / cncjs-kt-ext

Auto-leveling extension for CNCjs
74 stars 38 forks source link

Detect and fix drift in Z work coordinate offset #36

Closed joelkoz closed 3 years ago

joelkoz commented 3 years ago

I found on my machine that when probing a large set of points, the coordinate offset from machine to work coordinates for the Z axis would drift, sometimes by as much as 1/2 a mm (probably due to a missed step at some point). This causes all subsequent probe depths to be wrong, which in turn corrupts the entire auto level calculation.

This PR constantly monitors the offset and updates internally so probe calculations are correct. I also added a small change to add an extra mm to the probe depth to compensate for changes in the working height.