Skip to content

Commit

Permalink
Add tools_calibrate (#446)
Browse files Browse the repository at this point in the history
* Add tools_calibrate

Sourced from https://github.com/viesturz/klipper-toolchanger and updated for versatility and ease of use

* Add tools_calibrate to the status reference
  • Loading branch information
kageurufu authored Dec 5, 2024
1 parent 119023e commit 6f587f5
Show file tree
Hide file tree
Showing 4 changed files with 561 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5662,6 +5662,52 @@ cs_pin:
# above parameters.
```

### ⚠️ [tools_calibrate]

Multi-toolhead nozzle offset calibration, using a 3-axis nozzle contact probe such as
[Zruncho3D's Nudge Probe](https://github.com/zruncho3d/nudge).

```
[tools_calibrate]
pin:
travel_speed: 20
# X and Y travel speed in mm/sec
spread: 5
#spread_x:
#spread_y:
# X and Y travel distance around the probe
#initial_spread:
#initial_spread_x:
#initial_spread_y:
# X and Y travel distance for the initial probe locating moves
lower_z: 1.0
# Distance to lower in Z for contact with the sides of the probe
speed: 2
# The speed (in mm/sec) to retract between probes
lift_speed: 4
# Z Lift speed after probing
final_lift_z: 6
# Z lift distance after calibration, must be greater than any
# height variance between tools
trigger_to_bottom_z: 0.25
# Offset from probe trigger to vertical motion bottoms out.
# decrease if the nozzle is too high, increase if too low.
#samples: 1
# The number of times to probe each point. The probed z-values will
# be averaged. The default is to probe 1 time.
#sample_retract_dist: 2.0
# The distance (in mm) to lift the toolhead between each sample (if
# sampling more than once). The default is 2mm.
#samples_result: average
# The calculation method when sampling more than once - either
# "median" or "average". The default is average.
#samples_tolerance: 0.100
# The maximum Z distance (in mm) that a sample may differ from other
# samples. If this tolerance is exceeded then either an error is
# reported or the attempt is restarted (see
# samples_tolerance_retries). The default is 0.100mm.
```

### [trad_rack]

Trad Rack multimaterial system support. See the following documents from the
Expand Down
27 changes: 27 additions & 0 deletions docs/G-Codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,33 @@ The velocity argument is not available on CoreXY. With no arguments, this
command responds with the movement direction with the most acceleration or
velocity.

### ⚠️ [tools_calibrate]

The following commands are available when the
[tools_calibrate config section](Config_Reference.md#tools_calibrate) is enabled.

#### TOOL_CALIBRATE_QUERY_PROBE
`TOOL_CALIBRATE_QUERY_PROBE`: Query the current calibration probe state.

#### TOOL_LOCATE_SENSOR
`TOOL_LOCATE_SENSOR`: Locate the sensor relative to the initial tool. The initial
tool is the 0 offset, which other tools are calibrated against.

Before running `TOOL_LOCATE_SENSOR`, position your primary toolhead centered over
the calibration probe.

#### TOOL_CALIBRATE_TOOL_OFFSET
`TOOL_CALIBRATE_TOOL_OFFSET`: After locating the sensor with your initial tool,
position each additional tool over the sensor and run `TOOL_CALIBRATE_TOOL_OFFSET`
to find their offsets.

#### TOOL_CALIBRATE_SAVE_TOOL_OFFSET
`TOOL_CALIBRATE_SAVE_TOOL_OFFSET MACRO=<macro_name> VARIABLE=<variable_name> [VALUE="({x:0.6f}, {y:0.6f}, {z:0.6f})"]`:
Save the last calibration result to a macro variable.

`TOOL_CALIBRATE_SAVE_TOOL_OFFSET SECTION= ATTRIBUTE= [VALUE="{x:0.6f}, {y:0.6f}, {z:0.6f}"]`:
Save the last calibration result to a field in your configuration. Calibration data saved this way will not take effect until after a `RESTART` of your printer.

### [trad_rack]

The following commands are available when the
Expand Down
9 changes: 9 additions & 0 deletions docs/Status_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,15 @@ on a cartesian, hybrid_corexy or hybrid_corexz robot
- `carriage_1`: The mode of the carriage 1. Possible values are:
"INACTIVE", "PRIMARY", "COPY", and "MIRROR".

## tools_calibrate

The following information is available in the
[tools_calibrate](Config_Reference.md#️-tools_calibrate) object:
- `sensor_location`: Once calibrated, the location of the sensor
- `last_result`: The last tool calibration result
- `calibration_probe_inactive`: Status of the calibration probe as of
the last `TOOL_CALIBRATE_QUERY_PROBE`

## trad_rack

The following informatin is available in the
Expand Down
Loading

0 comments on commit 6f587f5

Please sign in to comment.