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

Firmware retraction: Fix and extend zhop feature #420

Merged
merged 4 commits into from
Dec 23, 2024
Merged
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
5 changes: 5 additions & 0 deletions docs/Config_Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ deprecated. It will be removed in the near future. Use
instead. The `printer[fan object].speed` status will be replaced by
`printer[fan object].value` and `printer[fan object].power`.

20241223: The `CLEAR_RETRACTION` command does not reset parameters to
default config values anymore, a [`RESET_RETRACTION`](./G-Codes.md#reset_retraction)
command was added to achieve this. Automatic resetting behavior on
events was removed.

20240430: The `adc_ignore_limits` parameter in the `[danger_options]`
config section has been renamed to `temp_ignore_limits` and it now
covers all possible temperature sensors.
Expand Down
7 changes: 6 additions & 1 deletion docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,12 @@ allowing per-filament settings and runtime tuning.
# The vertical height by which the nozzle is lifted from the print to
# prevent collisions with the print during travel moves when retracted.
# The minimum value is 0 mm, the default value is 0 mm, which disables
# zhop moves.
# zhop moves. The value will be reduced if the zhop move reaches
# maximum z.
#clear_zhop_on_z_moves: False
# If True, when a change in Z is sent while toolhead is retracted,
# z_hop is cancelled until next retraction. Otherwise,
# `z_hop_height` is applied as an offset to all movements.
```

### [gcode_arcs]
Expand Down
34 changes: 19 additions & 15 deletions docs/G-Codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,36 +633,40 @@ the filament unretract move to reduce blobbing at seams (the minimum value is
Z_HOP_HEIGHT determines the vertical height by which the nozzle is lifted from
the print to prevent collisions with the print during travel moves (the
minimum value is 0 mm, the standard value is 0 mm, which disables Z-Hop moves).
If a parameter is set when retracted, the new value will be taken into
account only after G11 or CLEAR_RETRACTION event.
SET_RETRACTION is commonly set as part of slicer per-filament configuration, as
different filaments require different parameter settings. The command can be
issued at runtime.

#### GET_RETRACTION
`GET_RETRACTION`: Queries the current parameters used by the firmware retraction
module as well as the retract state. RETRACT_LENGTH, RETRACT_SPEED,
UNRETRACT_EXTRA_LENGTH, UNRETRACT_SPEED, Z_HOP_HEIGHT and RETRACTED (True, if
retracted) are displayed on the terminal.
UNRETRACT_EXTRA_LENGTH, UNRETRACT_SPEED, Z_HOP_HEIGHT, RETRACT_STATE (True, if
retracted), ZHOP_STATE (True, if zhop offset currently applied) are displayed on
the terminal.

#### CLEAR_RETRACTION
`CLEAR_RETRACTION`: Clears the current retract state without extruder or
motion system movement. All flags related to the retract state are reset to
False and all changes to retraction parameters made via previous SET_RETRACTION
commands are reset to config values.
NOTE: The Module contains a lot of redundancy for safety to prevent undesired
behavior. When printing from virtual SD Card, the printer state is monitored and
retraction state is cleared if a print is started, canceled or finished or if a
virtual SD card file is reset. When printing via GCode streaming (e.g. using
OctoPrint), the retract state is cleared when the steppers are disabled (M84,
False.

NOTE: The zhop state is also reset to False when the steppers are disabled (M84,
typically part of end gcode and standard behavior of OctoPrint if a print is
canceled) or the printer is homed (G28, typically part of start gcode). Hence,
upon ending or canceling a print as well as starting a new print via GCode
streaming or virtual SD card, the printer should always be in unretracted state.
streaming or virtual SD card, the toolhead will not apply `z_hop_height` until
next G11 if filament is retracted.
Nevertheless, it is recommended to add `CLEAR_RETRACTION` to your start and end
gcode to make sure the retract state is reset before and after each print. If a
print is finished or canceled while retracted and the retract state is not
cleared, either via `CLEAR_RETRACTION` without filament or motion system
movement or G11, the nozzle will stay above the requested z coordinate by the
set z_hop_height.
gcode to make sure the retract state is reset before and after each print.

#### RESET_RETRACTION
`RESET_RETRACTION`: All changes to retraction parameters made via previous
SET_RETRACTION commands are reset to config values.

NOTE: It is recommended to add `RESET_RETRACTION` to your start and end gcode
(with a possible override in your filament start gcode to set filament-specific
overrides of firmware retraction defaults via `SET_RETRACTION`).

### [force_move]

Expand Down
1 change: 1 addition & 0 deletions docs/Status_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ The following information is available in the
config file if a `SET_RETRACTION` command altered them. Additional information
available is as follows.
- `retract_state`: Returns 'True' if filament is retracted.
- `zhop_state`: Returns 'True' if a zhop is currently applied.

## gcode

Expand Down
Loading
Loading