Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

probe: implement use_probe_xy_offsets #500

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ radius:
#horizontal_move_z: 5
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5.
#use_probe_xy_offsets: False
# If True, apply the `[probe]` XY offsets to the probed positions. The
# default is False.
```

### Deltesian Kinematics
Expand Down Expand Up @@ -1270,6 +1273,9 @@ Visual Examples:
#bed_mesh_default:
# Optionally provide the name of a profile you would like loaded on init.
# By default, no profile is loaded.
#use_probe_xy_offsets: True
# If True, apply the `[probe]` XY offsets to the probed positions. The
# default is True.
```

### [bed_tilt]
Expand Down Expand Up @@ -1307,6 +1313,9 @@ information.
#horizontal_move_z: 5
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5.
#use_probe_xy_offsets: False
# If True, apply the `[probe]` XY offsets to the probed positions. The
# default is False.
```

### [bed_screws]
Expand Down Expand Up @@ -1394,6 +1403,9 @@ information.
# Default value is CW-M3 which most printers use. A clockwise
# rotation of the knob decreases the gap between the nozzle and the
# bed. Conversely, a counter-clockwise rotation increases the gap.
#use_probe_xy_offsets: False
# If True, apply the `[probe]` XY offsets to the probed positions. The
# default is False.
```

### [z_tilt]
Expand Down Expand Up @@ -1447,7 +1459,9 @@ extended [G-Code command](G-Codes.md#z_tilt) becomes available.
#increasing_threshold: 0.0000001
# Sets the threshold that probe points can increase before z_tilt aborts.
# To disable the validation, set this parameter to a high value.

#use_probe_xy_offsets: False
# If True, apply the `[probe]` XY offsets to the probed positions. The
# default is False.
```

#### [z_tilt_ng]
Expand Down Expand Up @@ -1487,6 +1501,8 @@ commands become available, enhancing bed leveling accuracy and calibration effic
# See [z_tilt]
#increasing_threshold: 0.0000001
# See [z_tilt]
#use_probe_xy_offsets: False
# See [z_tilt]
#extra_points:
# A list in the same format as "points" above. This list contains
# additional points to be probed during the two calibration commands
Expand Down Expand Up @@ -1576,6 +1592,9 @@ Where x is the 0, 0 point on the bed
#increasing_threshold: 0.0000001
# Sets the threshold that probe points can increase before qgl aborts.
# To disable the validation, set this parameter to a high value.
#use_probe_xy_offsets: False
# If True, apply the `[probe]` XY offsets to the probed positions. The
# default is False.
```

### [skew_correction]
Expand Down
1 change: 1 addition & 0 deletions docs/Danger_Features.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- [`[z_tilt/quad_gantry_level] increasing_threshold`](./Config_Reference.md#z_tilt) allows you to customize the allowed variation when probing multiple times
- [`[z_tilt/quad_gantry_level] adaptive_horizontal_move_z`](./Config_Reference.md#z_tilt) adaptively decrease horizontal_move_z based on resulting error - z_tilt and QGL faster and safer!
- [`[safe_z_home] home_y_before_x`](./Config_Reference.md#safe_z_home) let you home Y before X.
- [`[z_tilt/quad_gantry_level/etc] use_probe_xy_offsets`](./Config_Reference.md#z_tilt) let you decide if the `[probe] XY offsets should be applied to probe positions.

## Heaters, Fans, and PID changes

Expand Down
6 changes: 4 additions & 2 deletions klippy/extras/bed_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,12 @@ def __init__(self, config, bedmesh):
self._generate_points(config.error)
self._profile_name = "default"
self.probe_helper = probe.ProbePointsHelper(
config, self.probe_finalize, self._get_adjusted_points()
config,
self.probe_finalize,
self._get_adjusted_points(),
use_offsets=True,
)
self.probe_helper.minimum_points(3)
self.probe_helper.use_xy_offsets(True)
self.gcode = self.printer.lookup_object("gcode")
self.gcode.register_command(
"BED_MESH_CALIBRATE",
Expand Down
6 changes: 5 additions & 1 deletion klippy/extras/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ def __init__(
finalize_callback,
default_points=None,
option_name="points",
use_offsets=False,
):
self.printer = config.get_printer()
self.finalize_callback = finalize_callback
Expand All @@ -501,7 +502,10 @@ def __init__(
"min_horizontal_move_z", 1.0
)
self.speed = config.getfloat("speed", 50.0, above=0.0)
self.use_offsets = False
self.use_offsets = config.getboolean(
"use_probe_xy_offsets", use_offsets
)

# Internal probing state
self.lift_speed = self.speed
self.probe_offsets = (0.0, 0.0, 0.0)
Expand Down
1 change: 1 addition & 0 deletions test/klippy/z_tilt_ng.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ extra_points:
50,195
195,195
increasing_threshold: 0.001
use_probe_xy_offsets: True

[extruder]
step_pin: PA4
Expand Down
Loading