-
-
Notifications
You must be signed in to change notification settings - Fork 233
Probe points alternating order #882
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1144,9 +1144,6 @@ control: | |
| # not recommended to set this unless there is an electrical | ||
| # requirement to switch the heater faster than 10 times a second. | ||
| # The default is 0.100 seconds. | ||
| #lost_update_tolerance: 2 | ||
| # Maximum number of consecutive sensor lost samples that can be | ||
| # recovered from. | ||
| #min_extrude_temp: 170 | ||
| # The minimum temperature (in Celsius) at which extruder move | ||
| # commands may be issued. The default is 170 Celsius. | ||
|
|
@@ -1566,6 +1563,20 @@ extended [G-Code command](G-Codes.md#z_tilt) becomes available. | |
| #use_adjustments: False | ||
| # If set to true it uses the behaviour described by trails here: | ||
| # https://github.com/Trails5000/klipper/commit/47b5a91f96761961e693031fa514a0025a877117 | ||
| #alternate_probe_direction: False | ||
| # If True, alternate the physical probing direction between full | ||
| # probing passes/retries. The first pass uses the configured point | ||
| # order, and the next pass probes the same points in reverse order. | ||
| # The measured results are still returned in the configured logical | ||
| # point order, so the z_tilt calculations are unchanged. This can | ||
| # reduce repeated twisting of Bowden tubes, filament paths, umbilicals, | ||
| # and cable bundles on large-format machines. It also avoids the extra | ||
| # travel move from the last point back to the first point between retry | ||
| # passes. The default is False. | ||
| #start_reverse: False | ||
| # If True and alternate_probe_direction is enabled, start the first | ||
| # probing pass in reverse order. Subsequent retry passes will continue | ||
| # alternating direction. The default is False. | ||
| ``` | ||
|
|
||
| #### [z_tilt_ng] | ||
|
|
@@ -1710,6 +1721,20 @@ Where x is the 0, 0 point on the bed | |
| # By default, the first Z movement to reach `horizontal_move_z` uses `speed`. | ||
| # Set `enforce_lift_speed` to True to enforce the `lift_speed`. | ||
| # The default is False. | ||
| #alternate_probe_direction: False | ||
| # If True, alternate the physical probing direction between full | ||
| # probing passes/retries. The first pass uses the configured point | ||
| # order, and the next pass probes the same points in reverse order. | ||
| # The measured results are still returned in the configured logical | ||
| # point order, so the quad gantry leveling calculations are unchanged. | ||
| # This can reduce repeated twisting of Bowden tubes, filament paths, | ||
| # umbilicals, and cable bundles on large-format machines. It also | ||
| # avoids the extra travel move from the last point back to the first | ||
| # point between retry passes. The default is False. | ||
| #start_reverse: False | ||
| # If True and alternate_probe_direction is enabled, start the first | ||
| # probing pass in reverse order. Subsequent retry passes will continue | ||
| # alternating direction. The default is False. | ||
| ``` | ||
|
|
||
| ### [skew_correction] | ||
|
|
@@ -3319,7 +3344,6 @@ target temperature. | |
| #pid_Ki: | ||
| #pid_Kd: | ||
| #pwm_cycle_time: | ||
| #lost_update_tolerance: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra change, remove |
||
| #min_temp: | ||
| #max_temp: | ||
| # See the "extruder" section for the definition of the above | ||
|
|
@@ -3467,9 +3491,9 @@ sensor_type: BME280 | |
| # above parameters. | ||
| ``` | ||
|
|
||
| ### AHT10/AHT20/AHT21/AHT30 temperature sensor | ||
| ### AHT10/AHT20/AHT21 temperature sensor | ||
|
|
||
| AHT10/AHT20/AHT21/AHT30 two wire interface (I2C) environmental sensors. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra change, remove |
||
| AHT10/AHT20/AHT21 two wire interface (I2C) environmental sensors. | ||
| Note that these sensors are not intended for use with extruders and | ||
| heater beds, but rather for monitoring ambient temperature (C) and | ||
| relative humidity. See | ||
|
|
@@ -3478,8 +3502,7 @@ that may be used to report humidity in addition to temperature. | |
|
|
||
| ``` | ||
| sensor_type: AHT10 | ||
| # Must be "AHT1X" , "AHT2X", "AHT3X" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra change, remove |
||
| # Some AHT20 sensors can use "AHT1X" | ||
| # Also use AHT10 for AHT20 and AHT21 sensors. | ||
| #i2c_address: | ||
| # Default is 56 (0x38). Some AHT10 sensors give the option to use | ||
| # 57 (0x39) by moving a resistor. | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -44,6 +44,7 @@ | |||||
| - [`[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. | ||||||
| - [`[z_tilt/quad_gantry_level] alternate_probe_direction`](./Config_Reference.md#z_tilt) alternates probing direction between retry passes to reduce cable, Bowden tube, umbilical, and filament path twisting, while avoiding the extra travel move back to the first point. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## Heaters, Fans, and PID changes | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -674,19 +674,11 @@ def cmd_PROBE_ACCURACY(self, gcmd: GCodeCommand): | |
| for i in range(len(positions)): | ||
| deviation_sum += pow(positions[i][2] - avg_value, 2.0) | ||
| sigma = (deviation_sum / len(positions)) ** 0.5 | ||
| # calculate the average delta between successive probes | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra change, remove |
||
| delta_sum = 0 | ||
| for i in range(1, len(positions)): | ||
| delta_sum += abs(positions[i][2] - positions[i - 1][2]) | ||
| avg_delta = delta_sum / (len(positions) - 1) | ||
| # Show information | ||
| decimals = 6 | ||
| gcmd.respond_info( | ||
| f"probe accuracy results: maximum {max_value:.{decimals}f}, " | ||
| f"minimum {min_value:.{decimals}f}, range {range_value:.{decimals}f}, " | ||
| f"average {avg_value:.{decimals}f}, median {median:.{decimals}f}, " | ||
| f"standard deviation {sigma:.{decimals}f}, " | ||
| f"average delta {avg_delta:.{decimals}f}" | ||
| "probe accuracy results: maximum %.6f, minimum %.6f, range %.6f, " | ||
| "average %.6f, median %.6f, standard deviation %.6f" | ||
| % (max_value, min_value, range_value, avg_value, median, sigma) | ||
| ) | ||
|
|
||
| def probe_calibrate_finalize(self, kin_pos): | ||
|
|
@@ -869,6 +861,13 @@ def __init__( | |
| self.use_offsets = config.getboolean( | ||
| "use_probe_xy_offsets", use_offsets | ||
| ) | ||
| self.alternate_probe_direction = config.getboolean( | ||
| "alternate_probe_direction", False | ||
| ) | ||
| if self.alternate_probe_direction: | ||
| self.start_reverse = config.getboolean("start_reverse", False) | ||
| else: | ||
| self.start_reverse = False | ||
|
|
||
| self.enforce_lift_speed = config.getboolean("enforce_lift_speed", False) | ||
|
|
||
|
|
@@ -878,6 +877,7 @@ def __init__( | |
| self.lift_speed = self.speed | ||
| self.probe_offsets = (0.0, 0.0, 0.0) | ||
| self.results = [] | ||
| self._probe_pass_direction_reversed = False | ||
|
|
||
| def get_probe_points(self): | ||
| return self.probe_points | ||
|
|
@@ -900,6 +900,12 @@ def get_lift_speed(self, gcmd=None): | |
| return gcmd.get_float("LIFT_SPEED", self.lift_speed, above=0.0) | ||
| return self.lift_speed | ||
|
|
||
| def _store_probe_result(self, position): | ||
| if self._probe_pass_direction_reversed: | ||
| self.results.insert(0, position) | ||
| else: | ||
| self.results.append(position) | ||
|
|
||
| def _lift_toolhead(self): | ||
| toolhead = self.printer.lookup_object("toolhead") | ||
| # Lift toolhead | ||
|
|
@@ -914,7 +920,13 @@ def _lift_toolhead(self): | |
| toolhead.manual_move([None, None, z_pos], speed) | ||
|
|
||
| def _next_pos(self): | ||
| nextpos = list(self.probe_points[len(self.results)]) | ||
| result_count = len(self.results) | ||
| if self._probe_pass_direction_reversed: | ||
| point_index = len(self.probe_points) - result_count - 1 | ||
| else: | ||
| point_index = result_count | ||
|
|
||
| nextpos = list(self.probe_points[point_index]) | ||
| if self.use_offsets: | ||
| nextpos[0] -= self.probe_offsets[0] | ||
| nextpos[1] -= self.probe_offsets[1] | ||
|
|
@@ -944,6 +956,10 @@ def _move_next(self): | |
| self._lift_toolhead() | ||
| if finalize: | ||
| self.results = [] | ||
| if not done and self.alternate_probe_direction: | ||
| self._probe_pass_direction_reversed = ( | ||
| not self._probe_pass_direction_reversed | ||
| ) | ||
| if done: | ||
| return True | ||
| # Move to next XY probe point | ||
|
|
@@ -964,6 +980,7 @@ def start_probe(self, gcmd): | |
| method = "automatic" | ||
|
|
||
| self.results = [] | ||
| self._probe_pass_direction_reversed = self.start_reverse | ||
|
|
||
| def_move_z = self.default_horizontal_move_z | ||
| self.horizontal_move_z = gcmd.get_float("HORIZONTAL_MOVE_Z", def_move_z) | ||
|
|
@@ -998,7 +1015,7 @@ def start_probe(self, gcmd): | |
| break | ||
| pos = probe.run_probe(gcmd, self.retry_session) | ||
| logging.info(f"Probe pos:{pos}") | ||
| self.results.append(pos) | ||
| self._store_probe_result(pos) | ||
| probe.multi_probe_end() | ||
| self.retry_session.end() | ||
|
|
||
|
|
@@ -1013,7 +1030,7 @@ def _manual_probe_start(self): | |
| def _manual_probe_finalize(self, kin_pos): | ||
| if kin_pos is None: | ||
| return | ||
| self.results.append(kin_pos) | ||
| self._store_probe_result(kin_pos) | ||
| self._manual_probe_start() | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra change, remove