z_thermal_adjust: Add Z thermal adjuster module (#4157)

Use a frame-coupled temperature probe to compensate for thermal
expansion in real-time.

Signed-off by: Robert Pazdzior <robertp@norbital.com>
This commit is contained in:
alchemyEngine 2022-09-25 18:39:14 +02:00 committed by GitHub
parent 51da02b7f8
commit 34870d3e2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 253 additions and 0 deletions

View file

@ -1205,6 +1205,45 @@ the nature of skew correction these lengths are set via gcode. See
[skew_correction]
```
### [z_thermal_adjust]
Temperature-dependant toolhead Z position adjustment. Compensate for vertical
toolhead movement caused by thermal expansion of the printer's frame in
real-time using a temperature sensor (typically coupled to a vertical section
of frame).
See also: [extended g-code commands](G-Codes.md#z_thermal_adjust).
```
[z_thermal_adjust]
#temp_coeff:
# The temperature coefficient of expansion, in mm/degC. For example, a
# temp_coeff of 0.01 mm/degC will move the Z axis downwards by 0.01 mm for
# every degree Celsius that the temperature sensor increases. Defaults to
# 0.0 mm/degC, which applies no adjustment.
#smooth_time:
# Smoothing window applied to the temperature sensor, in seconds. Can reduce
# motor noise from excessive small corrections in response to sensor noise.
# The default is 2.0 seconds.
#z_adjust_off_above:
# Disables adjustments above this Z height [mm]. The last computed correction
# will remain applied until the toolhead moves below the specified Z height
# again. The default is 99999999.0 mm (always on).
#max_z_adjustment:
# Maximum absolute adjustment that can be applied to the Z axis [mm]. The
# default is 99999999.0 mm (unlimited).
#sensor_type:
#sensor_pin:
#min_temp:
#max_temp:
# Temperature sensor configuration.
# See the "extruder" section for the definition of the above
# parameters.
#gcode_id:
# See the "heater_generic" section for the definition of this
# parameter.
```
## Customized homing
### [safe_z_home]

View file

@ -1281,6 +1281,24 @@ print.
#### SDCARD_RESET_FILE
`SDCARD_RESET_FILE`: Unload file and clear SD state.
### [z_thermal_adjust]
The following commands are available when the
[z_thermal_adjust config section](Config_Reference.md#z_thermal_adjust)
is enabled.
#### SET_Z_THERMAL_ADJUST
`SET_Z_THERMAL_ADJUST [ENABLE=<0:1>] [TEMP_COEFF=<value>] [REF_TEMP=<value>]`:
Enable or disable the Z thermal adjustment with `ENABLE`. Disabling does not
remove any adjustment already applied, but will freeze the current adjustment
value - this prevents potentially unsafe downward Z movement. Re-enabling can
potentially cause upward tool movement as the adjustment is updated and applied.
`TEMP_COEFF` allows run-time tuning of the adjustment temperature coefficient
(i.e. the `TEMP_COEFF` config parameter). `TEMP_COEFF` values are not saved to
the config. `REF_TEMP` manually overrides the reference temperature typically
set during homing (for use in e.g. non-standard homing routines) - will be reset
automatically upon homing.
### [z_tilt]
The following commands are available when the

View file

@ -484,6 +484,19 @@ object is always available):
- `state_message`: A human readable string giving additional context
on the current Klipper state.
## z_thermal_adjust
The following information is available in the `z_thermal_adjust` object (this
object is available if [z_thermal_adjust](Config_Reference.md#z_thermal_adjust)
is defined).
- `enabled`: Returns True if adjustment is enabled.
- `temperature`: Current (smoothed) temperature of the defined sensor. [degC]
- `measured_min_temp`: Minimum measured temperature. [degC]
- `measured_max_temp`: Maximum measured temperature. [degC]
- `current_z_adjust`: Last computed Z adjustment [mm].
- `z_adjust_ref_temperature`: Current reference temperature used for calculation
of Z `current_z_adjust` [degC].
## z_tilt
The following information is available in the `z_tilt` object (this