mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 06:27:26 -06:00
Update PurgeLinesAndUnload.py
This change adds a setting for "minimum Z height" for the "nail down the string" moves. Update PurgeLinesAndUnload.py Bug fix. The prime blob code didn't account for the retraction at the end. This adds an 'unretract' to compensate.
This commit is contained in:
parent
36b5a40563
commit
253d11f84d
1 changed files with 40 additions and 4 deletions
|
@ -163,11 +163,21 @@ class PurgeLinesAndUnload(Script):
|
|||
"move_to_start":
|
||||
{
|
||||
"label": "Circle around to layer start ⚠️",
|
||||
"description": "Depending on where the 'Layer Start X' and 'Layer Start Y' are for the print, the opening travel move can pass across the print area and leave a string there. This option will generate an orthogonal path that moves the nozzle around the edges of the build plate and then comes in to the Start Point. || ⚠️ || The nozzle will drop to Z0.0 and touch the build plate at each stop in order to 'nail down the string' so it doesn't follow in a straight line.",
|
||||
"description": "Depending on where the 'Layer Start X' and 'Layer Start Y' are for the print, the opening travel move can pass across the print area and leave a string there. This option will generate an orthogonal path that moves the nozzle around the edges of the build plate and then comes in to the Start Point. || ⚠️ || The nozzle can drop to Z0.0 and touch the build plate at each stop in order to 'nail down the string'. The nozzle always raises after the touch-down. It will not drag on the bed.",
|
||||
"type": "bool",
|
||||
"default_value": false,
|
||||
"enabled": true
|
||||
},
|
||||
"move_to_start_min_z":
|
||||
{
|
||||
"label": " Minimum Z height ⚠️",
|
||||
"description": "When moving to the start position, the nozzle can touch down on the build plate at each stop (Z = 0.0). That will stick the string to the build plate at each direction change so it doesn't pull across the print area. Some printers may not respond well to Z=0.0. You may set a minimum Z height here (min is 0.0 and max is 0.50). The string must stick or it defeats the purpose of moving around the periphery.",
|
||||
"type": "float",
|
||||
"default_value": 0.0,
|
||||
"minimum_value": 0.0,
|
||||
"maximum_value": 0.5,
|
||||
"enabled": "move_to_start"
|
||||
},
|
||||
"adjust_starting_e":
|
||||
{
|
||||
"label": "Adjust Starting E location",
|
||||
|
@ -254,7 +264,9 @@ class PurgeLinesAndUnload(Script):
|
|||
self.prime_blob_distance = self.getSettingValueByKey("prime_blob_distance")
|
||||
else:
|
||||
self.prime_blob_distance = 0
|
||||
|
||||
# Set the minimum Z to stick the string to the build plate when Move to Start is selected.
|
||||
self.touchdown_z = self.getSettingValueByKey("move_to_start_min_z")
|
||||
|
||||
# Mapping settings to corresponding methods
|
||||
procedures = {
|
||||
"add_purge_lines": self._add_purge_lines,
|
||||
|
@ -385,7 +397,7 @@ class PurgeLinesAndUnload(Script):
|
|||
def add_move(axis: str, position: float) -> None:
|
||||
moves.append(
|
||||
f"G0 F{self.speed_travel} {axis}{position} ; Start move\n"
|
||||
f"G0 F600 Z0 ; Nail down the string\n"
|
||||
f"G0 F600 Z{self.touchdown_z} ; Nail down the string\n"
|
||||
f"G0 F600 Z2 ; Move up\n"
|
||||
)
|
||||
|
||||
|
@ -494,6 +506,9 @@ class PurgeLinesAndUnload(Script):
|
|||
# Travel to the purge start
|
||||
purge_str += f"G0 F{self.speed_travel} X{self.machine_left + self.border_distance} Y{self.machine_front + 10} ; Move to start\n"
|
||||
purge_str += f"G0 F600 Z0.3 ; Move down\n"
|
||||
if self.prime_blob_enable:
|
||||
purge_str += f"G1 F{self.retract_speed} E{self.retract_dist} ; Unretract\n"
|
||||
purge_str += "G92 E0 ; Reset extruder\n"
|
||||
# Purge two lines
|
||||
purge_str += f"G1 F{self.print_speed} X{self.machine_left + self.border_distance} Y{y_stop} E{purge_volume} ; First line\n"
|
||||
purge_str += f"G0 X{self.machine_left + 3 + self.border_distance} Y{y_stop} ; Move over\n"
|
||||
|
@ -513,6 +528,9 @@ class PurgeLinesAndUnload(Script):
|
|||
# Travel to the purge start
|
||||
purge_str += f"G0 F{self.speed_travel} X{self.machine_right - self.border_distance} ; Move\nG0 Y{self.machine_back - 10} ; Move\n"
|
||||
purge_str += f"G0 F600 Z0.3 ; Move down\n"
|
||||
if self.prime_blob_enable:
|
||||
purge_str += f"G1 F{self.retract_speed} E{self.retract_dist} ; Unretract\n"
|
||||
purge_str += "G92 E0 ; Reset extruder\n"
|
||||
# Purge two lines
|
||||
purge_str += f"G1 F{self.print_speed} X{self.machine_right - self.border_distance} Y{y_stop} E{purge_volume} ; First line\n"
|
||||
purge_str += f"G0 X{self.machine_right - 3 - self.border_distance} Y{y_stop} ; Move over\n"
|
||||
|
@ -533,6 +551,9 @@ class PurgeLinesAndUnload(Script):
|
|||
# Travel to the purge start
|
||||
purge_str += f"G0 F{self.speed_travel} X{self.machine_left + 10} Y{self.machine_front + self.border_distance} ; Move to start\n"
|
||||
purge_str += f"G0 F600 Z0.3 ; Move down\n"
|
||||
if self.prime_blob_enable:
|
||||
purge_str += f"G1 F{self.retract_speed} E{self.retract_dist} ; Unretract\n"
|
||||
purge_str += "G92 E0 ; Reset extruder\n"
|
||||
# Purge two lines
|
||||
purge_str += f"G1 F{self.print_speed} X{x_stop} Y{self.machine_front + self.border_distance} E{purge_volume} ; First line\n"
|
||||
purge_str += f"G0 X{x_stop} Y{self.machine_front + 3 + self.border_distance} ; Move over\n"
|
||||
|
@ -554,6 +575,9 @@ class PurgeLinesAndUnload(Script):
|
|||
purge_str += f"G0 F{self.speed_travel} Y{self.machine_back - self.border_distance} ; Ortho Move to back\n"
|
||||
purge_str += f"G0 X{self.machine_right - 10} ; Ortho move to start\n"
|
||||
purge_str += f"G0 F600 Z0.3 ; Move down\n"
|
||||
if self.prime_blob_enable:
|
||||
purge_str += f"G1 F{self.retract_speed} E{self.retract_dist} ; Unretract\n"
|
||||
purge_str += "G92 E0 ; Reset extruder\n"
|
||||
# Purge two lines
|
||||
purge_str += f"G1 F{self.print_speed} X{x_stop} Y{self.machine_back - self.border_distance} E{purge_volume} ; First line\n"
|
||||
purge_str += f"G0 X{x_stop} Y{self.machine_back - 3 - self.border_distance} ; Move over\n"
|
||||
|
@ -575,6 +599,9 @@ class PurgeLinesAndUnload(Script):
|
|||
# Travel to the purge start
|
||||
purge_str += f"G0 F{self.speed_travel} X{self.machine_left + self.border_distance} Y{self.machine_front + 10} ; Move to start\n"
|
||||
purge_str += f"G0 F600 Z0.3 ; Move down\n"
|
||||
if self.prime_blob_enable:
|
||||
purge_str += f"G1 F{self.retract_speed} E{self.retract_dist} ; Unretract\n"
|
||||
purge_str += "G92 E0 ; Reset extruder\n"
|
||||
# Purge two lines
|
||||
purge_str += f"G1 F{self.print_speed} X{self.machine_left + self.border_distance} Y{y_stop} E{purge_volume} ; First line\n"
|
||||
purge_str += f"G0 X{self.machine_left + 3 + self.border_distance} Y{y_stop} ; Move over\n"
|
||||
|
@ -594,6 +621,9 @@ class PurgeLinesAndUnload(Script):
|
|||
# Travel to the purge start
|
||||
purge_str += f"G0 F{self.speed_travel} X{self.machine_right - self.border_distance} Z2 ; Move\nG0 Y{self.machine_back - 10} Z2 ; Move to start\n"
|
||||
purge_str += f"G0 F600 Z0.3 ; Move down\n"
|
||||
if self.prime_blob_enable:
|
||||
purge_str += f"G1 F{self.retract_speed} E{self.retract_dist} ; Unretract\n"
|
||||
purge_str += "G92 E0 ; Reset extruder\n"
|
||||
# Purge two lines
|
||||
purge_str += f"G1 F{self.print_speed} X{self.machine_right - self.border_distance} Y{y_stop} E{purge_volume} ; First line\n"
|
||||
purge_str += f"G0 X{self.machine_right - 3 - self.border_distance} Y{y_stop} ; Move over\n"
|
||||
|
@ -613,6 +643,9 @@ class PurgeLinesAndUnload(Script):
|
|||
# Travel to the purge start
|
||||
purge_str += f"G0 F{self.speed_travel} X{self.machine_left + 10} Z2 ; Move\nG0 Y{self.machine_front + self.border_distance} Z2 ; Move to start\n"
|
||||
purge_str += f"G0 F600 Z0.3 ; Move down\n"
|
||||
if self.prime_blob_enable:
|
||||
purge_str += f"G1 F{self.retract_speed} E{self.retract_dist} ; Unretract\n"
|
||||
purge_str += "G92 E0 ; Reset extruder\n"
|
||||
# Purge two lines
|
||||
purge_str += f"G1 F{self.print_speed} X{x_stop} Y{self.machine_front + self.border_distance} E{purge_volume} ; First line\n"
|
||||
purge_str += f"G0 X{x_stop} Y{self.machine_front + 3 + self.border_distance} ; Move over\n"
|
||||
|
@ -633,6 +666,9 @@ class PurgeLinesAndUnload(Script):
|
|||
purge_str += f"G0 F{self.speed_travel} Y{self.machine_back - self.border_distance} Z2; Ortho Move to back\n"
|
||||
purge_str += f"G0 X{self.machine_right - 10} Z2 ; Ortho Move to start\n"
|
||||
purge_str += f"G0 F600 Z0.3 ; Move down\n"
|
||||
if self.prime_blob_enable:
|
||||
purge_str += f"G1 F{self.retract_speed} E{self.retract_dist} ; Unretract\n"
|
||||
purge_str += "G92 E0 ; Reset extruder\n"
|
||||
# Purge two lines
|
||||
purge_str += f"G1 F{self.print_speed} X{x_stop} Y{self.machine_back - self.border_distance} E{purge_volume} ; First line\n"
|
||||
purge_str += f"G0 X{x_stop} Y{self.machine_back - 3 - self.border_distance} ; Move over\n"
|
||||
|
@ -945,7 +981,7 @@ class PurgeLinesAndUnload(Script):
|
|||
blob_string = "G0 F1200 Z20 ; Move up\n"
|
||||
blob_string += f"G0 F{self.speed_travel} X{blob_x} Y{blob_y} ; Move to blob location\n"
|
||||
blob_string += f"G1 F{speed_blob} E{self.prime_blob_distance} ; Blob\n"
|
||||
blob_string += f"G1 F{self.retract_speed} E-{self.retract_dist} ; Retract\n"
|
||||
blob_string += f"G1 F{self.retract_speed} E{self.prime_blob_distance - self.retract_dist} ; Retract\n"
|
||||
blob_string += "G92 E0 ; Reset extruder\n"
|
||||
blob_string += "M300 P500 S600 ; Beep\n"
|
||||
blob_string += "G4 S2 ; Wait\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue