From 2aac65183e145a67830d423145581757d59fa662 Mon Sep 17 00:00:00 2001 From: ruipeng <1041589370@qq.com> Date: Mon, 4 Nov 2024 17:54:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E7=BD=91?= =?UTF-8?q?=E5=BA=8A=E8=B0=83=E5=B9=B3=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/CreatBot_D1000/base.cfg | 153 +++++++++++++++++++++++++++++- config/CreatBot_D600Pro2/base.cfg | 153 +++++++++++++++++++++++++++++- config/CreatBot_F430NX/base.cfg | 153 +++++++++++++++++++++++++++++- 3 files changed, 456 insertions(+), 3 deletions(-) diff --git a/config/CreatBot_D1000/base.cfg b/config/CreatBot_D1000/base.cfg index b530e4895..280854dba 100644 --- a/config/CreatBot_D1000/base.cfg +++ b/config/CreatBot_D1000/base.cfg @@ -418,7 +418,7 @@ gcode: M141 S{CHAMBER_TEMP} {% endif %} G28 - #BED_MESH_CALIBRATE + _START_PRINT_BED_MESH {% if BED_TEMP != 0 %} M190 S{BED_TEMP} {% endif %} @@ -834,3 +834,154 @@ gcode: gcode: RESPOND TYPE=command MSG="action:prompt_end" _CLEAR_LAST_FILE + +######################################## +# Adaptive mesh +######################################## + +[gcode_macro Adaptive_Mesh] +description: This macro contains all adjustable settings for KAMP +variable_verbose_enable: True # Set to True to enable KAMP information output when running. This is useful for debugging. +variable_mesh_margin: 5 # Expands the mesh size in millimeters if desired. Leave at 0 to disable. +variable_fuzz_amount: 0 # Slightly randomizes mesh points to spread out wear from nozzle-based probes. Leave at 0 to disable. + +gcode: # Gcode section left intentionally blank. Do not disturb. +# Noting + +[gcode_macro _START_PRINT_BED_MESH] +gcode: + {% set idex_mode = False %} + {% set profiles = printer["bed_mesh"].profiles %} + {% set svv = printer.save_variables.variables %} + {% set adaptive_mesh = svv.adaptive_meshing|default(false)|lower %} + {% if printer["dual_carriage"] is defined %} + {% set current_idex_mode = printer["dual_carriage"].carriage_1|lower %} + {% if current_idex_mode == "copy" or idex_mode == "mirror" %} + {% set idex_mode = True %} + {% endif %} + {% endif %} + + {% if adaptive_mesh|lower == 'true' %} + {% if printer.exclude_object.objects != [] %} + {% if idex_mode %} + BED_MESH_CLEAR + {% else %} + BED_MESH_CALIBRATE PROFILE=adaptive + {% endif %} + {% else %} + {% if idex_mode %} + BED_MESH_CLEAR + {% else %} + {% if 'default' in profiles %} + BED_MESH_PROFILE LOAD=default + {% else %} + BED_MESH_CALIBRATE PROFILE=default + BED_MESH_PROFILE SAVE=default + {% endif %} + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro BED_MESH_CALIBRATE] +rename_existing: _BED_MESH_CALIBRATE +gcode: + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} # Gather all object points + {% set bed_mesh_min = printer.configfile.settings.bed_mesh.mesh_min %} # Get bed mesh min from printer.cfg + {% set bed_mesh_max = printer.configfile.settings.bed_mesh.mesh_max %} # Get bed mesh max from printer.cfg + {% set probe_count = printer.configfile.settings.bed_mesh.probe_count %} # Get probe count from printer.cfg + {% set kamp_settings = printer["gcode_macro Adaptive_Mesh"] %} # Pull variables from _KAMP_Settings + {% set verbose_enable = kamp_settings.verbose_enable | abs %} # Pull verbose setting from _KAMP_Settings + {% set mesh_margin = kamp_settings.mesh_margin | float %} # Pull mesh margin setting from _KAMP_Settings + {% set fuzz_amount = kamp_settings.fuzz_amount | float %} # Pull fuzz amount setting from _KAMP_Settings + {% set default_profile = params.PROFILE %} # get default mesh profile + {% set probe_count = probe_count if probe_count|length > 1 else probe_count * 2 %} # If probe count is only a single number, convert it to 2. E.g. probe_count:7 = 7,7 + {% set max_probe_point_distance_x = ( bed_mesh_max[0] - bed_mesh_min[0] ) / (probe_count[0] - 1) %} # Determine max probe point distance + {% set max_probe_point_distance_y = ( bed_mesh_max[1] - bed_mesh_min[1] ) / (probe_count[1] - 1) %} # Determine max probe point distance + {% set x_min = all_points | map(attribute=0) | min | default(bed_mesh_min[0]) %} # Set x_min from smallest object x point + {% set y_min = all_points | map(attribute=1) | min | default(bed_mesh_min[1]) %} # Set y_min from smallest object y point + {% set x_max = all_points | map(attribute=0) | max | default(bed_mesh_max[0]) %} # Set x_max from largest object x point + {% set y_max = all_points | map(attribute=1) | max | default(bed_mesh_max[1]) %} # Set y_max from largest object y point + + {% set fuzz_range = range((0) | int, (fuzz_amount * 100) | int + 1) %} # Set fuzz_range between 0 and fuzz_amount + {% set adapted_x_min = x_min - mesh_margin - (fuzz_range | random / 100.0) %} # Adapt x_min to margin and fuzz constraints + {% set adapted_y_min = y_min - mesh_margin - (fuzz_range | random / 100.0) %} # Adapt y_min to margin and fuzz constraints + {% set adapted_x_max = x_max + mesh_margin + (fuzz_range | random / 100.0) %} # Adapt x_max to margin and fuzz constraints + {% set adapted_y_max = y_max + mesh_margin + (fuzz_range | random / 100.0) %} # Adapt y_max to margin and fuzz constraints + + {% set adapted_x_min = [adapted_x_min , bed_mesh_min[0]] | max %} # Compare adjustments to defaults and choose max + {% set adapted_y_min = [adapted_y_min , bed_mesh_min[1]] | max %} # Compare adjustments to defaults and choose max + {% set adapted_x_max = [adapted_x_max , bed_mesh_max[0]] | min %} # Compare adjustments to defaults and choose min + {% set adapted_y_max = [adapted_y_max , bed_mesh_max[1]] | min %} # Compare adjustments to defaults and choose min + + {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up + {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up + + {% if (([points_x, points_y]|max) > 6) %} # + {% set algorithm = "bicubic" %} # + {% set min_points = 4 %} # + {% else %} # Calculate if algorithm should be bicubic or lagrange + {% set algorithm = "lagrange" %} # + {% set min_points = 3 %} # + {% endif %} # + + {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm + {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm + {% set points_x = [points_x , probe_count[0]]|min %} + {% set points_y = [points_y , probe_count[1]]|min %} + + {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations + {% if printer.exclude_object.objects != [] %} + + { action_respond_info( "Algorithm: {}.".format( + (algorithm), + )) } + + { action_respond_info("Default probe count: {},{}.".format( + (probe_count[0]), + (probe_count[1]), + )) } + + { action_respond_info("Adapted probe count: {},{}.".format( + (points_x), + (points_y), + )) } + + {action_respond_info("Default mesh bounds: {}, {}.".format( + (bed_mesh_min[0],bed_mesh_min[1]), + (bed_mesh_max[0],bed_mesh_max[1]), + )) } + + {% if mesh_margin > 0 %} + {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( + (mesh_margin), + (mesh_margin), + )) } + {% else %} + {action_respond_info("Mesh margin is 0, margin not increased.")} + {% endif %} + + {% if fuzz_amount > 0 %} + {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( + (fuzz_amount), + )) } + {% else %} + {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} + {% endif %} + + { action_respond_info("Adapted mesh bounds: {}, {}.".format( + (adapted_x_min, adapted_y_min), + (adapted_x_max, adapted_y_max), + )) } + + {action_respond_info("KAMP adjustments successful. Happy KAMPing!")} + + {% else %} + + {action_respond_info("No objects detected! Check your gcode and make sure that EXCLUDE_OBJECT_DEFINE is happening before BED_MESH_CALIBRATE is called. Defaulting to regular meshing.")} + G4 P5000 # Wait 5 seconds to make error more visible + {% endif %} + + {% endif %} + + _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose + BED_MESH_PROFILE LOAD={default_profile} \ No newline at end of file diff --git a/config/CreatBot_D600Pro2/base.cfg b/config/CreatBot_D600Pro2/base.cfg index ea144caf2..e3e9b5f69 100644 --- a/config/CreatBot_D600Pro2/base.cfg +++ b/config/CreatBot_D600Pro2/base.cfg @@ -418,7 +418,7 @@ gcode: M141 S{CHAMBER_TEMP} {% endif %} G28 - #BED_MESH_CALIBRATE + _START_PRINT_BED_MESH {% if BED_TEMP != 0 %} M190 S{BED_TEMP} {% endif %} @@ -827,3 +827,154 @@ gcode: gcode: RESPOND TYPE=command MSG="action:prompt_end" _CLEAR_LAST_FILE + +######################################## +# Adaptive mesh +######################################## + +[gcode_macro Adaptive_Mesh] +description: This macro contains all adjustable settings for KAMP +variable_verbose_enable: True # Set to True to enable KAMP information output when running. This is useful for debugging. +variable_mesh_margin: 5 # Expands the mesh size in millimeters if desired. Leave at 0 to disable. +variable_fuzz_amount: 0 # Slightly randomizes mesh points to spread out wear from nozzle-based probes. Leave at 0 to disable. + +gcode: # Gcode section left intentionally blank. Do not disturb. +# Noting + +[gcode_macro _START_PRINT_BED_MESH] +gcode: + {% set idex_mode = False %} + {% set profiles = printer["bed_mesh"].profiles %} + {% set svv = printer.save_variables.variables %} + {% set adaptive_mesh = svv.adaptive_meshing|default(false)|lower %} + {% if printer["dual_carriage"] is defined %} + {% set current_idex_mode = printer["dual_carriage"].carriage_1|lower %} + {% if current_idex_mode == "copy" or idex_mode == "mirror" %} + {% set idex_mode = True %} + {% endif %} + {% endif %} + + {% if adaptive_mesh|lower == 'true' %} + {% if printer.exclude_object.objects != [] %} + {% if idex_mode %} + BED_MESH_CLEAR + {% else %} + BED_MESH_CALIBRATE PROFILE=adaptive + {% endif %} + {% else %} + {% if idex_mode %} + BED_MESH_CLEAR + {% else %} + {% if 'default' in profiles %} + BED_MESH_PROFILE LOAD=default + {% else %} + BED_MESH_CALIBRATE PROFILE=default + BED_MESH_PROFILE SAVE=default + {% endif %} + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro BED_MESH_CALIBRATE] +rename_existing: _BED_MESH_CALIBRATE +gcode: + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} # Gather all object points + {% set bed_mesh_min = printer.configfile.settings.bed_mesh.mesh_min %} # Get bed mesh min from printer.cfg + {% set bed_mesh_max = printer.configfile.settings.bed_mesh.mesh_max %} # Get bed mesh max from printer.cfg + {% set probe_count = printer.configfile.settings.bed_mesh.probe_count %} # Get probe count from printer.cfg + {% set kamp_settings = printer["gcode_macro Adaptive_Mesh"] %} # Pull variables from _KAMP_Settings + {% set verbose_enable = kamp_settings.verbose_enable | abs %} # Pull verbose setting from _KAMP_Settings + {% set mesh_margin = kamp_settings.mesh_margin | float %} # Pull mesh margin setting from _KAMP_Settings + {% set fuzz_amount = kamp_settings.fuzz_amount | float %} # Pull fuzz amount setting from _KAMP_Settings + {% set default_profile = params.PROFILE %} # get default mesh profile + {% set probe_count = probe_count if probe_count|length > 1 else probe_count * 2 %} # If probe count is only a single number, convert it to 2. E.g. probe_count:7 = 7,7 + {% set max_probe_point_distance_x = ( bed_mesh_max[0] - bed_mesh_min[0] ) / (probe_count[0] - 1) %} # Determine max probe point distance + {% set max_probe_point_distance_y = ( bed_mesh_max[1] - bed_mesh_min[1] ) / (probe_count[1] - 1) %} # Determine max probe point distance + {% set x_min = all_points | map(attribute=0) | min | default(bed_mesh_min[0]) %} # Set x_min from smallest object x point + {% set y_min = all_points | map(attribute=1) | min | default(bed_mesh_min[1]) %} # Set y_min from smallest object y point + {% set x_max = all_points | map(attribute=0) | max | default(bed_mesh_max[0]) %} # Set x_max from largest object x point + {% set y_max = all_points | map(attribute=1) | max | default(bed_mesh_max[1]) %} # Set y_max from largest object y point + + {% set fuzz_range = range((0) | int, (fuzz_amount * 100) | int + 1) %} # Set fuzz_range between 0 and fuzz_amount + {% set adapted_x_min = x_min - mesh_margin - (fuzz_range | random / 100.0) %} # Adapt x_min to margin and fuzz constraints + {% set adapted_y_min = y_min - mesh_margin - (fuzz_range | random / 100.0) %} # Adapt y_min to margin and fuzz constraints + {% set adapted_x_max = x_max + mesh_margin + (fuzz_range | random / 100.0) %} # Adapt x_max to margin and fuzz constraints + {% set adapted_y_max = y_max + mesh_margin + (fuzz_range | random / 100.0) %} # Adapt y_max to margin and fuzz constraints + + {% set adapted_x_min = [adapted_x_min , bed_mesh_min[0]] | max %} # Compare adjustments to defaults and choose max + {% set adapted_y_min = [adapted_y_min , bed_mesh_min[1]] | max %} # Compare adjustments to defaults and choose max + {% set adapted_x_max = [adapted_x_max , bed_mesh_max[0]] | min %} # Compare adjustments to defaults and choose min + {% set adapted_y_max = [adapted_y_max , bed_mesh_max[1]] | min %} # Compare adjustments to defaults and choose min + + {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up + {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up + + {% if (([points_x, points_y]|max) > 6) %} # + {% set algorithm = "bicubic" %} # + {% set min_points = 4 %} # + {% else %} # Calculate if algorithm should be bicubic or lagrange + {% set algorithm = "lagrange" %} # + {% set min_points = 3 %} # + {% endif %} # + + {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm + {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm + {% set points_x = [points_x , probe_count[0]]|min %} + {% set points_y = [points_y , probe_count[1]]|min %} + + {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations + {% if printer.exclude_object.objects != [] %} + + { action_respond_info( "Algorithm: {}.".format( + (algorithm), + )) } + + { action_respond_info("Default probe count: {},{}.".format( + (probe_count[0]), + (probe_count[1]), + )) } + + { action_respond_info("Adapted probe count: {},{}.".format( + (points_x), + (points_y), + )) } + + {action_respond_info("Default mesh bounds: {}, {}.".format( + (bed_mesh_min[0],bed_mesh_min[1]), + (bed_mesh_max[0],bed_mesh_max[1]), + )) } + + {% if mesh_margin > 0 %} + {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( + (mesh_margin), + (mesh_margin), + )) } + {% else %} + {action_respond_info("Mesh margin is 0, margin not increased.")} + {% endif %} + + {% if fuzz_amount > 0 %} + {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( + (fuzz_amount), + )) } + {% else %} + {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} + {% endif %} + + { action_respond_info("Adapted mesh bounds: {}, {}.".format( + (adapted_x_min, adapted_y_min), + (adapted_x_max, adapted_y_max), + )) } + + {action_respond_info("KAMP adjustments successful. Happy KAMPing!")} + + {% else %} + + {action_respond_info("No objects detected! Check your gcode and make sure that EXCLUDE_OBJECT_DEFINE is happening before BED_MESH_CALIBRATE is called. Defaulting to regular meshing.")} + G4 P5000 # Wait 5 seconds to make error more visible + {% endif %} + + {% endif %} + + _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose + BED_MESH_PROFILE LOAD={default_profile} \ No newline at end of file diff --git a/config/CreatBot_F430NX/base.cfg b/config/CreatBot_F430NX/base.cfg index 2929ccc90..fec89fdd4 100644 --- a/config/CreatBot_F430NX/base.cfg +++ b/config/CreatBot_F430NX/base.cfg @@ -542,7 +542,7 @@ gcode: M141 S{CHAMBER_TEMP} {% endif %} G28 - # BED_MESH_CALIBRATE + _START_PRINT_BED_MESH {% if BED_TEMP != 0 %} M190 S{BED_TEMP} {% endif %} @@ -995,3 +995,154 @@ gcode: gcode: RESPOND TYPE=command MSG="action:prompt_end" _CLEAR_LAST_FILE + +######################################## +# Adaptive mesh +######################################## + +[gcode_macro Adaptive_Mesh] +description: This macro contains all adjustable settings for KAMP +variable_verbose_enable: True # Set to True to enable KAMP information output when running. This is useful for debugging. +variable_mesh_margin: 5 # Expands the mesh size in millimeters if desired. Leave at 0 to disable. +variable_fuzz_amount: 0 # Slightly randomizes mesh points to spread out wear from nozzle-based probes. Leave at 0 to disable. + +gcode: # Gcode section left intentionally blank. Do not disturb. +# Noting + +[gcode_macro _START_PRINT_BED_MESH] +gcode: + {% set idex_mode = False %} + {% set profiles = printer["bed_mesh"].profiles %} + {% set svv = printer.save_variables.variables %} + {% set adaptive_mesh = svv.adaptive_meshing|default(false)|lower %} + {% if printer["dual_carriage"] is defined %} + {% set current_idex_mode = printer["dual_carriage"].carriage_1|lower %} + {% if current_idex_mode == "copy" or idex_mode == "mirror" %} + {% set idex_mode = True %} + {% endif %} + {% endif %} + + {% if adaptive_mesh|lower == 'true' %} + {% if printer.exclude_object.objects != [] %} + {% if idex_mode %} + BED_MESH_CLEAR + {% else %} + BED_MESH_CALIBRATE PROFILE=adaptive + {% endif %} + {% else %} + {% if idex_mode %} + BED_MESH_CLEAR + {% else %} + {% if 'default' in profiles %} + BED_MESH_PROFILE LOAD=default + {% else %} + BED_MESH_CALIBRATE PROFILE=default + BED_MESH_PROFILE SAVE=default + {% endif %} + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro BED_MESH_CALIBRATE] +rename_existing: _BED_MESH_CALIBRATE +gcode: + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} # Gather all object points + {% set bed_mesh_min = printer.configfile.settings.bed_mesh.mesh_min %} # Get bed mesh min from printer.cfg + {% set bed_mesh_max = printer.configfile.settings.bed_mesh.mesh_max %} # Get bed mesh max from printer.cfg + {% set probe_count = printer.configfile.settings.bed_mesh.probe_count %} # Get probe count from printer.cfg + {% set kamp_settings = printer["gcode_macro Adaptive_Mesh"] %} # Pull variables from _KAMP_Settings + {% set verbose_enable = kamp_settings.verbose_enable | abs %} # Pull verbose setting from _KAMP_Settings + {% set mesh_margin = kamp_settings.mesh_margin | float %} # Pull mesh margin setting from _KAMP_Settings + {% set fuzz_amount = kamp_settings.fuzz_amount | float %} # Pull fuzz amount setting from _KAMP_Settings + {% set default_profile = params.PROFILE %} # get default mesh profile + {% set probe_count = probe_count if probe_count|length > 1 else probe_count * 2 %} # If probe count is only a single number, convert it to 2. E.g. probe_count:7 = 7,7 + {% set max_probe_point_distance_x = ( bed_mesh_max[0] - bed_mesh_min[0] ) / (probe_count[0] - 1) %} # Determine max probe point distance + {% set max_probe_point_distance_y = ( bed_mesh_max[1] - bed_mesh_min[1] ) / (probe_count[1] - 1) %} # Determine max probe point distance + {% set x_min = all_points | map(attribute=0) | min | default(bed_mesh_min[0]) %} # Set x_min from smallest object x point + {% set y_min = all_points | map(attribute=1) | min | default(bed_mesh_min[1]) %} # Set y_min from smallest object y point + {% set x_max = all_points | map(attribute=0) | max | default(bed_mesh_max[0]) %} # Set x_max from largest object x point + {% set y_max = all_points | map(attribute=1) | max | default(bed_mesh_max[1]) %} # Set y_max from largest object y point + + {% set fuzz_range = range((0) | int, (fuzz_amount * 100) | int + 1) %} # Set fuzz_range between 0 and fuzz_amount + {% set adapted_x_min = x_min - mesh_margin - (fuzz_range | random / 100.0) %} # Adapt x_min to margin and fuzz constraints + {% set adapted_y_min = y_min - mesh_margin - (fuzz_range | random / 100.0) %} # Adapt y_min to margin and fuzz constraints + {% set adapted_x_max = x_max + mesh_margin + (fuzz_range | random / 100.0) %} # Adapt x_max to margin and fuzz constraints + {% set adapted_y_max = y_max + mesh_margin + (fuzz_range | random / 100.0) %} # Adapt y_max to margin and fuzz constraints + + {% set adapted_x_min = [adapted_x_min , bed_mesh_min[0]] | max %} # Compare adjustments to defaults and choose max + {% set adapted_y_min = [adapted_y_min , bed_mesh_min[1]] | max %} # Compare adjustments to defaults and choose max + {% set adapted_x_max = [adapted_x_max , bed_mesh_max[0]] | min %} # Compare adjustments to defaults and choose min + {% set adapted_y_max = [adapted_y_max , bed_mesh_max[1]] | min %} # Compare adjustments to defaults and choose min + + {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up + {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up + + {% if (([points_x, points_y]|max) > 6) %} # + {% set algorithm = "bicubic" %} # + {% set min_points = 4 %} # + {% else %} # Calculate if algorithm should be bicubic or lagrange + {% set algorithm = "lagrange" %} # + {% set min_points = 3 %} # + {% endif %} # + + {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm + {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm + {% set points_x = [points_x , probe_count[0]]|min %} + {% set points_y = [points_y , probe_count[1]]|min %} + + {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations + {% if printer.exclude_object.objects != [] %} + + { action_respond_info( "Algorithm: {}.".format( + (algorithm), + )) } + + { action_respond_info("Default probe count: {},{}.".format( + (probe_count[0]), + (probe_count[1]), + )) } + + { action_respond_info("Adapted probe count: {},{}.".format( + (points_x), + (points_y), + )) } + + {action_respond_info("Default mesh bounds: {}, {}.".format( + (bed_mesh_min[0],bed_mesh_min[1]), + (bed_mesh_max[0],bed_mesh_max[1]), + )) } + + {% if mesh_margin > 0 %} + {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( + (mesh_margin), + (mesh_margin), + )) } + {% else %} + {action_respond_info("Mesh margin is 0, margin not increased.")} + {% endif %} + + {% if fuzz_amount > 0 %} + {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( + (fuzz_amount), + )) } + {% else %} + {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} + {% endif %} + + { action_respond_info("Adapted mesh bounds: {}, {}.".format( + (adapted_x_min, adapted_y_min), + (adapted_x_max, adapted_y_max), + )) } + + {action_respond_info("KAMP adjustments successful. Happy KAMPing!")} + + {% else %} + + {action_respond_info("No objects detected! Check your gcode and make sure that EXCLUDE_OBJECT_DEFINE is happening before BED_MESH_CALIBRATE is called. Defaulting to regular meshing.")} + G4 P5000 # Wait 5 seconds to make error more visible + {% endif %} + + {% endif %} + + _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose + BED_MESH_PROFILE LOAD={default_profile} \ No newline at end of file From ada778ae697cbff29595230e13d81d2a0e6ea909 Mon Sep 17 00:00:00 2001 From: zkk <1007518571@qq.com> Date: Thu, 7 Nov 2024 15:24:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E7=A7=BB=E8=BD=B4=E7=9A=84=E5=AE=8F=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/CreatBot_D1000/base.cfg | 4 ++-- config/CreatBot_D600Pro2/base.cfg | 4 ++-- config/CreatBot_F430NX/base.cfg | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/config/CreatBot_D1000/base.cfg b/config/CreatBot_D1000/base.cfg index 280854dba..ec286573c 100644 --- a/config/CreatBot_D1000/base.cfg +++ b/config/CreatBot_D1000/base.cfg @@ -352,11 +352,11 @@ speed:100 z_hop:5 z_hop_speed: 10 -[gcode_macro ENABLE_FORCE_MOVE] +[gcode_macro ENABLE_MOTOR] gcode: SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=1 SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=1 - SET_KINEMATIC_POSITION X=500 Y=500 Z=500 + SET_KINEMATIC_POSITION X=500 Y=500 Z=0 [gcode_macro T0] gcode: diff --git a/config/CreatBot_D600Pro2/base.cfg b/config/CreatBot_D600Pro2/base.cfg index e3e9b5f69..ce7ae564c 100644 --- a/config/CreatBot_D600Pro2/base.cfg +++ b/config/CreatBot_D600Pro2/base.cfg @@ -352,11 +352,11 @@ speed:100 z_hop:5 z_hop_speed: 10 -[gcode_macro ENABLE_FORCE_MOVE] +[gcode_macro ENABLE_MOTOR] gcode: SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=1 SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=1 - SET_KINEMATIC_POSITION X=300 Y=300 Z=300 + SET_KINEMATIC_POSITION X=300 Y=300 Z=0 [gcode_macro T0] gcode: diff --git a/config/CreatBot_F430NX/base.cfg b/config/CreatBot_F430NX/base.cfg index fec89fdd4..07829f52f 100644 --- a/config/CreatBot_F430NX/base.cfg +++ b/config/CreatBot_F430NX/base.cfg @@ -414,9 +414,11 @@ home_xy_position:200,150 speed:150 z_hop:5 -[gcode_macro ENABLE_FORCE_MOVE] +[gcode_macro ENABLE_MOTOR] gcode: - SET_KINEMATIC_POSITION X=200 Y=150 Z=150 + SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=1 + SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=1 + SET_KINEMATIC_POSITION X=200 Y=150 Z=0 [gcode_macro _RESTORE_DEFAULT_EXTRUDER] gcode: @@ -620,10 +622,6 @@ gcode: {% set dual_z_offset=params.S|default(0)|float %} SAVE_VARIABLE VARIABLE=dual_z_offset VALUE={dual_z_offset} -[gcode_macro ENABLE_FORCE_MOVE] -gcode: - SET_KINEMATIC_POSITION X=200 Y=150 Z=150 - [gcode_macro LOAD_FILAMENT] variable_load_distance: 90 variable_purge_distance: 20 From b9770c3385cda43e28dffcff41227b6653504997 Mon Sep 17 00:00:00 2001 From: zkk <1007518571@qq.com> Date: Thu, 7 Nov 2024 15:26:43 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=80=E7=82=B9=E6=A0=BC=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/CreatBot_D1000/base.cfg | 80 ++++++++++++++--------------- config/CreatBot_D600Pro2/base.cfg | 80 ++++++++++++++--------------- config/CreatBot_F430NX/base.cfg | 84 +++++++++++++++---------------- 3 files changed, 122 insertions(+), 122 deletions(-) diff --git a/config/CreatBot_D1000/base.cfg b/config/CreatBot_D1000/base.cfg index ec286573c..233a41ce2 100644 --- a/config/CreatBot_D1000/base.cfg +++ b/config/CreatBot_D1000/base.cfg @@ -836,7 +836,7 @@ gcode: _CLEAR_LAST_FILE ######################################## -# Adaptive mesh +# Adaptive mesh ######################################## [gcode_macro Adaptive_Mesh] @@ -916,13 +916,13 @@ gcode: {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up - {% if (([points_x, points_y]|max) > 6) %} # - {% set algorithm = "bicubic" %} # - {% set min_points = 4 %} # + {% if (([points_x, points_y]|max) > 6) %} # + {% set algorithm = "bicubic" %} # + {% set min_points = 4 %} # {% else %} # Calculate if algorithm should be bicubic or lagrange - {% set algorithm = "lagrange" %} # - {% set min_points = 3 %} # - {% endif %} # + {% set algorithm = "lagrange" %} # + {% set min_points = 3 %} # + {% endif %} # {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm @@ -932,45 +932,45 @@ gcode: {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations {% if printer.exclude_object.objects != [] %} - { action_respond_info( "Algorithm: {}.".format( - (algorithm), + { action_respond_info( "Algorithm: {}.".format( + (algorithm), )) } - { action_respond_info("Default probe count: {},{}.".format( - (probe_count[0]), - (probe_count[1]), + { action_respond_info("Default probe count: {},{}.".format( + (probe_count[0]), + (probe_count[1]), )) } - { action_respond_info("Adapted probe count: {},{}.".format( - (points_x), - (points_y), - )) } - - {action_respond_info("Default mesh bounds: {}, {}.".format( - (bed_mesh_min[0],bed_mesh_min[1]), - (bed_mesh_max[0],bed_mesh_max[1]), + { action_respond_info("Adapted probe count: {},{}.".format( + (points_x), + (points_y), )) } - {% if mesh_margin > 0 %} - {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( - (mesh_margin), - (mesh_margin), - )) } - {% else %} - {action_respond_info("Mesh margin is 0, margin not increased.")} - {% endif %} + {action_respond_info("Default mesh bounds: {}, {}.".format( + (bed_mesh_min[0],bed_mesh_min[1]), + (bed_mesh_max[0],bed_mesh_max[1]), + )) } - {% if fuzz_amount > 0 %} - {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( - (fuzz_amount), - )) } - {% else %} - {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} - {% endif %} + {% if mesh_margin > 0 %} + {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( + (mesh_margin), + (mesh_margin), + )) } + {% else %} + {action_respond_info("Mesh margin is 0, margin not increased.")} + {% endif %} - { action_respond_info("Adapted mesh bounds: {}, {}.".format( - (adapted_x_min, adapted_y_min), - (adapted_x_max, adapted_y_max), + {% if fuzz_amount > 0 %} + {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( + (fuzz_amount), + )) } + {% else %} + {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} + {% endif %} + + { action_respond_info("Adapted mesh bounds: {}, {}.".format( + (adapted_x_min, adapted_y_min), + (adapted_x_max, adapted_y_max), )) } {action_respond_info("KAMP adjustments successful. Happy KAMPing!")} @@ -982,6 +982,6 @@ gcode: {% endif %} {% endif %} - + _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose - BED_MESH_PROFILE LOAD={default_profile} \ No newline at end of file + BED_MESH_PROFILE LOAD={default_profile} diff --git a/config/CreatBot_D600Pro2/base.cfg b/config/CreatBot_D600Pro2/base.cfg index ce7ae564c..50f2df50c 100644 --- a/config/CreatBot_D600Pro2/base.cfg +++ b/config/CreatBot_D600Pro2/base.cfg @@ -829,7 +829,7 @@ gcode: _CLEAR_LAST_FILE ######################################## -# Adaptive mesh +# Adaptive mesh ######################################## [gcode_macro Adaptive_Mesh] @@ -909,13 +909,13 @@ gcode: {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up - {% if (([points_x, points_y]|max) > 6) %} # - {% set algorithm = "bicubic" %} # - {% set min_points = 4 %} # + {% if (([points_x, points_y]|max) > 6) %} # + {% set algorithm = "bicubic" %} # + {% set min_points = 4 %} # {% else %} # Calculate if algorithm should be bicubic or lagrange - {% set algorithm = "lagrange" %} # - {% set min_points = 3 %} # - {% endif %} # + {% set algorithm = "lagrange" %} # + {% set min_points = 3 %} # + {% endif %} # {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm @@ -925,45 +925,45 @@ gcode: {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations {% if printer.exclude_object.objects != [] %} - { action_respond_info( "Algorithm: {}.".format( - (algorithm), + { action_respond_info( "Algorithm: {}.".format( + (algorithm), )) } - { action_respond_info("Default probe count: {},{}.".format( - (probe_count[0]), - (probe_count[1]), + { action_respond_info("Default probe count: {},{}.".format( + (probe_count[0]), + (probe_count[1]), )) } - { action_respond_info("Adapted probe count: {},{}.".format( - (points_x), - (points_y), - )) } - - {action_respond_info("Default mesh bounds: {}, {}.".format( - (bed_mesh_min[0],bed_mesh_min[1]), - (bed_mesh_max[0],bed_mesh_max[1]), + { action_respond_info("Adapted probe count: {},{}.".format( + (points_x), + (points_y), )) } - {% if mesh_margin > 0 %} - {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( - (mesh_margin), - (mesh_margin), - )) } - {% else %} - {action_respond_info("Mesh margin is 0, margin not increased.")} - {% endif %} + {action_respond_info("Default mesh bounds: {}, {}.".format( + (bed_mesh_min[0],bed_mesh_min[1]), + (bed_mesh_max[0],bed_mesh_max[1]), + )) } - {% if fuzz_amount > 0 %} - {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( - (fuzz_amount), - )) } - {% else %} - {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} - {% endif %} + {% if mesh_margin > 0 %} + {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( + (mesh_margin), + (mesh_margin), + )) } + {% else %} + {action_respond_info("Mesh margin is 0, margin not increased.")} + {% endif %} - { action_respond_info("Adapted mesh bounds: {}, {}.".format( - (adapted_x_min, adapted_y_min), - (adapted_x_max, adapted_y_max), + {% if fuzz_amount > 0 %} + {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( + (fuzz_amount), + )) } + {% else %} + {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} + {% endif %} + + { action_respond_info("Adapted mesh bounds: {}, {}.".format( + (adapted_x_min, adapted_y_min), + (adapted_x_max, adapted_y_max), )) } {action_respond_info("KAMP adjustments successful. Happy KAMPing!")} @@ -975,6 +975,6 @@ gcode: {% endif %} {% endif %} - + _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose - BED_MESH_PROFILE LOAD={default_profile} \ No newline at end of file + BED_MESH_PROFILE LOAD={default_profile} diff --git a/config/CreatBot_F430NX/base.cfg b/config/CreatBot_F430NX/base.cfg index 07829f52f..e2d24abef 100644 --- a/config/CreatBot_F430NX/base.cfg +++ b/config/CreatBot_F430NX/base.cfg @@ -775,7 +775,7 @@ gcode: {% if printer["dual_carriage"] is defined %} {% set current_idex_mode = printer["dual_carriage"].carriage_1|lower %} {% if current_idex_mode == 'copy' or current_idex_mode == 'mirror' %} - SAVE_DUAL_CARRIAGE_STATE + SAVE_DUAL_CARRIAGE_STATE SYNC_EXTRUDER_MOTION EXTRUDER=extruder1 MOTION_QUEUE=extruder1 SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=resume_dual VALUE=True {% endif %} @@ -837,7 +837,7 @@ gcode: SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=resume_dual VALUE=False {% endif %} {% endif %} - + _FILAMENT_UPDATE #### Printer comming from timeout idle state #### {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} @@ -995,7 +995,7 @@ gcode: _CLEAR_LAST_FILE ######################################## -# Adaptive mesh +# Adaptive mesh ######################################## [gcode_macro Adaptive_Mesh] @@ -1075,13 +1075,13 @@ gcode: {% set points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up {% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up - {% if (([points_x, points_y]|max) > 6) %} # - {% set algorithm = "bicubic" %} # - {% set min_points = 4 %} # + {% if (([points_x, points_y]|max) > 6) %} # + {% set algorithm = "bicubic" %} # + {% set min_points = 4 %} # {% else %} # Calculate if algorithm should be bicubic or lagrange - {% set algorithm = "lagrange" %} # - {% set min_points = 3 %} # - {% endif %} # + {% set algorithm = "lagrange" %} # + {% set min_points = 3 %} # + {% endif %} # {% set points_x = [points_x , min_points]|max %} # Set probe_count's x points to fit the calculated algorithm {% set points_y = [points_y , min_points]|max %} # Set probe_count's y points to fit the calculated algorithm @@ -1091,45 +1091,45 @@ gcode: {% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations {% if printer.exclude_object.objects != [] %} - { action_respond_info( "Algorithm: {}.".format( - (algorithm), + { action_respond_info( "Algorithm: {}.".format( + (algorithm), )) } - { action_respond_info("Default probe count: {},{}.".format( - (probe_count[0]), - (probe_count[1]), + { action_respond_info("Default probe count: {},{}.".format( + (probe_count[0]), + (probe_count[1]), )) } - { action_respond_info("Adapted probe count: {},{}.".format( - (points_x), - (points_y), - )) } - - {action_respond_info("Default mesh bounds: {}, {}.".format( - (bed_mesh_min[0],bed_mesh_min[1]), - (bed_mesh_max[0],bed_mesh_max[1]), + { action_respond_info("Adapted probe count: {},{}.".format( + (points_x), + (points_y), )) } - {% if mesh_margin > 0 %} - {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( - (mesh_margin), - (mesh_margin), - )) } - {% else %} - {action_respond_info("Mesh margin is 0, margin not increased.")} - {% endif %} + {action_respond_info("Default mesh bounds: {}, {}.".format( + (bed_mesh_min[0],bed_mesh_min[1]), + (bed_mesh_max[0],bed_mesh_max[1]), + )) } - {% if fuzz_amount > 0 %} - {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( - (fuzz_amount), - )) } - {% else %} - {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} - {% endif %} + {% if mesh_margin > 0 %} + {action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format( + (mesh_margin), + (mesh_margin), + )) } + {% else %} + {action_respond_info("Mesh margin is 0, margin not increased.")} + {% endif %} - { action_respond_info("Adapted mesh bounds: {}, {}.".format( - (adapted_x_min, adapted_y_min), - (adapted_x_max, adapted_y_max), + {% if fuzz_amount > 0 %} + {action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format( + (fuzz_amount), + )) } + {% else %} + {action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")} + {% endif %} + + { action_respond_info("Adapted mesh bounds: {}, {}.".format( + (adapted_x_min, adapted_y_min), + (adapted_x_max, adapted_y_max), )) } {action_respond_info("KAMP adjustments successful. Happy KAMPing!")} @@ -1141,6 +1141,6 @@ gcode: {% endif %} {% endif %} - + _BED_MESH_CALIBRATE PROFILE={default_profile} mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y} # End of verbose - BED_MESH_PROFILE LOAD={default_profile} \ No newline at end of file + BED_MESH_PROFILE LOAD={default_profile} From d62caaee2511dfa17e738d3d374ad8de13e26675 Mon Sep 17 00:00:00 2001 From: zkk <1007518571@qq.com> Date: Thu, 7 Nov 2024 15:57:11 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=AD=E7=94=B5?= =?UTF-8?q?=E7=BB=AD=E6=89=93=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/CreatBot_D1000/base.cfg | 3 ++- config/CreatBot_D600Pro2/base.cfg | 3 ++- config/CreatBot_F430NX/base.cfg | 3 ++- scripts/clear_plr.sh | 0 scripts/plr.sh | 0 5 files changed, 6 insertions(+), 3 deletions(-) mode change 100644 => 100755 scripts/clear_plr.sh mode change 100644 => 100755 scripts/plr.sh diff --git a/config/CreatBot_D1000/base.cfg b/config/CreatBot_D1000/base.cfg index 233a41ce2..add0fc052 100644 --- a/config/CreatBot_D1000/base.cfg +++ b/config/CreatBot_D1000/base.cfg @@ -788,7 +788,8 @@ gcode: initial_duration: 3.5 gcode: {% set was_interrupted = printer.save_variables.variables.was_interrupted | string %} - {% if was_interrupted == "True"%} + {% set enable_recovery = printer.save_variables.variables.power_loss_recovery | default(Ture) | string %} + {% if enable_recovery != "False" and was_interrupted == "True" %} RESPOND TYPE=command MSG="action:prompt_begin " RESPOND TYPE=command MSG="action:prompt_text The last print job was not completed continue printing?" RESPOND TYPE=command MSG="action:prompt_footer_button Continue|_RESUME_INTERRUPTED" diff --git a/config/CreatBot_D600Pro2/base.cfg b/config/CreatBot_D600Pro2/base.cfg index 50f2df50c..42d1da0d9 100644 --- a/config/CreatBot_D600Pro2/base.cfg +++ b/config/CreatBot_D600Pro2/base.cfg @@ -781,7 +781,8 @@ gcode: initial_duration: 3.5 gcode: {% set was_interrupted = printer.save_variables.variables.was_interrupted | string %} - {% if was_interrupted == "True"%} + {% set enable_recovery = printer.save_variables.variables.power_loss_recovery | default(Ture) | string %} + {% if enable_recovery != "False" and was_interrupted == "True" %} RESPOND TYPE=command MSG="action:prompt_begin " RESPOND TYPE=command MSG="action:prompt_text The last print job was not completed continue printing?" RESPOND TYPE=command MSG="action:prompt_footer_button Continue|_RESUME_INTERRUPTED" diff --git a/config/CreatBot_F430NX/base.cfg b/config/CreatBot_F430NX/base.cfg index e2d24abef..408febe26 100644 --- a/config/CreatBot_F430NX/base.cfg +++ b/config/CreatBot_F430NX/base.cfg @@ -947,7 +947,8 @@ gcode: initial_duration: 3.5 gcode: {% set was_interrupted = printer.save_variables.variables.was_interrupted | string %} - {% if was_interrupted == "True"%} + {% set enable_recovery = printer.save_variables.variables.power_loss_recovery | default(Ture) | string %} + {% if enable_recovery != "False" and was_interrupted == "True" %} RESPOND TYPE=command MSG="action:prompt_begin " RESPOND TYPE=command MSG="action:prompt_text The last print job was not completed continue printing?" RESPOND TYPE=command MSG="action:prompt_footer_button Continue|_RESUME_INTERRUPTED" diff --git a/scripts/clear_plr.sh b/scripts/clear_plr.sh old mode 100644 new mode 100755 diff --git a/scripts/plr.sh b/scripts/plr.sh old mode 100644 new mode 100755 From d0443135bcfca1e87a8deda4c9cc69a5084968b0 Mon Sep 17 00:00:00 2001 From: zkk <1007518571@qq.com> Date: Sat, 9 Nov 2024 14:57:13 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96D600Pro=20D1000=E5=8D=B8?= =?UTF-8?q?=E8=BD=BD=E8=80=97=E6=9D=90=E5=8D=A1=E4=BD=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BB=A5=E5=8F=8AF430NX=E7=9A=84=E7=83=AD=E9=A3=8E=E6=B8=A9?= =?UTF-8?q?=E5=BA=A6=E8=BF=87=E4=BD=8E=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/CreatBot_D1000/base.cfg | 11 +++++++---- config/CreatBot_D600Pro2/base.cfg | 11 +++++++---- config/CreatBot_F430NX/base.cfg | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/config/CreatBot_D1000/base.cfg b/config/CreatBot_D1000/base.cfg index add0fc052..cad5bc0eb 100644 --- a/config/CreatBot_D1000/base.cfg +++ b/config/CreatBot_D1000/base.cfg @@ -453,7 +453,7 @@ variable_load_distance: 120 variable_purge_distance: 25 gcode: {% set speed = params.SPEED|default(200) %} - {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 20 %} + {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 10 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 @@ -462,15 +462,18 @@ gcode: RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] -variable_unload_distance: 140 -variable_purge_distance: 25 +variable_unload_distance: 50 +variable_advance_unload_distance: 80 +variable_purge_distance: 10 gcode: {% set speed = params.SPEED|default(200) %} - {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 20 %} + {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 10 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} # purge + G1 E-{advance_unload_distance} F{max_velocity} + G1 E-{4} F60 G1 E-{unload_distance} F{max_velocity} # fast-unload RESTORE_GCODE_STATE NAME=unload_state diff --git a/config/CreatBot_D600Pro2/base.cfg b/config/CreatBot_D600Pro2/base.cfg index 42d1da0d9..1f852c76e 100644 --- a/config/CreatBot_D600Pro2/base.cfg +++ b/config/CreatBot_D600Pro2/base.cfg @@ -453,7 +453,7 @@ variable_load_distance: 120 variable_purge_distance: 25 gcode: {% set speed = params.SPEED|default(200) %} - {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 20 %} + {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 10 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 @@ -462,15 +462,18 @@ gcode: RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] -variable_unload_distance: 140 -variable_purge_distance: 25 +variable_unload_distance: 50 +variable_advance_unload_distance: 80 +variable_purge_distance: 10 gcode: {% set speed = params.SPEED|default(200) %} - {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 20 %} + {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 10 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} # purge + G1 E-{advance_unload_distance} F{max_velocity} + G1 E-{4} F60 G1 E-{unload_distance} F{max_velocity} # fast-unload RESTORE_GCODE_STATE NAME=unload_state diff --git a/config/CreatBot_F430NX/base.cfg b/config/CreatBot_F430NX/base.cfg index 408febe26..5e0e4ef44 100644 --- a/config/CreatBot_F430NX/base.cfg +++ b/config/CreatBot_F430NX/base.cfg @@ -179,7 +179,7 @@ max_power: 1.0 sensor_type: Generic 3950 sensor_pin: PC3 min_temp: 0 -max_temp: 70 +max_temp: 80 # control: pid # pid_kp: 30.68 # pid_ki: 0.21