jlas1 / Klicky-Probe

Microswitch probe with magnetic attachement, primarily aimed at CoreXY 3d printers
GNU General Public License v3.0
1.23k stars 279 forks source link

Remove integer truncation from various positions #209

Closed jagerman closed 1 month ago

jagerman commented 1 year ago

Fixes #159.

This replaces the |int truncation of position and motion handling in the klipper macros with |floats so that fractional positions work.

Without this my docking would usually fail because, with my optimal position being about half a mm away from an integer, I had frequent docking failures where the probe would hit the edge of the dock.

It also simplifies the code to do the conversion-to-float just once for each variable (which I see was also quite correctly advised in #159), rather than having many |ints scattered everywhere the variables are used.