From a3f74629b549793ffc024bfe22984b7f54cb005b Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 12 Feb 2024 11:44:18 +0700 Subject: [PATCH] update config --- ender3-s1.cfg => printer.cfg | 122 ++++++++++++++++------------------- 1 file changed, 56 insertions(+), 66 deletions(-) rename ender3-s1.cfg => printer.cfg (50%) diff --git a/ender3-s1.cfg b/printer.cfg similarity index 50% rename from ender3-s1.cfg rename to printer.cfg index 263bef5..656dd44 100644 --- a/ender3-s1.cfg +++ b/printer.cfg @@ -1,5 +1,14 @@ # Ender 3 S1 Config, Satit Chula Specific +[printer] +kinematics: cartesian +max_velocity: 500 +max_accel: 3000 +max_accel_to_decel: 3000 +max_z_velocity: 5 +square_corner_velocity: 5.0 +max_z_accel: 100 + [stepper_x] step_pin: PC2 dir_pin: PB9 @@ -95,14 +104,7 @@ pin: PA0 serial: /dev/ttyEnder restart_method: command -[printer] -kinematics: cartesian -max_velocity: 500 -max_accel: 3000 -max_accel_to_decel: 3000 -max_z_velocity: 5 -square_corner_velocity: 5.0 -max_z_accel: 100 + [bltouch] sensor_pin: ^PC14 @@ -143,6 +145,7 @@ path: /home/octoprint/.octoprint/uploads [display_status] [pause_resume] +recover_velocity: 100 [gcode_macro G29] description: Mesh Bed Leveling @@ -151,66 +154,53 @@ gcode: BED_MESH_CALIBRATE G0 X0Y0Z5 -[gcode_macro PAUSE] -description: Pause the actual running print -rename_existing: PAUSE_BASE -# change this if you need more or less extrusion -variable_extrude: 1.0 +[gcode_macro PARK_NOZZLE_REAR] +description: Park the nozzle at the rear of the bed gcode: - ##### read E from pause macro ##### - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - ##### set park positon for x and y ##### - # default is your max posion from your printer.cfg - {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} - {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} - ##### calculate save lift position ##### - {% set max_z = printer.toolhead.axis_maximum.z|float %} - {% set act_z = printer.toolhead.position.z|float %} - {% if act_z < (max_z - 2.0) %} - {% set z_safe = 2.0 %} - {% else %} - {% set z_safe = max_z - act_z %} - {% endif %} - ##### end of definitions ##### - PAUSE_BASE - G91 - {% if printer.extruder.can_extrude|lower == 'true' %} - G1 E-{E} F2100 - {% else %} - {action_respond_info("Extruder not hot enough")} - {% endif %} - {% if "xyz" in printer.toolhead.homed_axes %} - G1 Z{z_safe} F900 - G90 - G1 X{x_park} Y{y_park} F6000 - {% else %} - {action_respond_info("Printer not homed")} - {% endif %} - -[gcode_macro RESUME] -description: Resume the actual running print -rename_existing: RESUME_BASE -gcode: - ##### read E from pause macro ##### - {% set E = printer["gcode_macro PAUSE"].extrude|float %} - #### get VELOCITY parameter if specified #### - {% if 'VELOCITY' in params|upper %} - {% set get_params = ('VELOCITY=' + params.VELOCITY) %} - {%else %} - {% set get_params = "" %} - {% endif %} - ##### end of definitions ##### - {% if printer.extruder.can_extrude|lower == 'true' %} - G91 - G1 E{E} F2100 - {% else %} - {action_respond_info("Extruder not hot enough")} - {% endif %} - RESUME_BASE {get_params} + G90 ; absolute positioning + G0 X0 Y200 F6000 ; move to the rear of the bed [gcode_macro CANCEL_PRINT] description: Cancel the actual running print -rename_existing: CANCEL_PRINT_BASE +rename_existing: BASE_CANCEL_PRINT gcode: - TURN_OFF_HEATERS - CANCEL_PRINT_BASE \ No newline at end of file + M220 S100 ; reset speed factor override percentage to default (100%) + M221 S100 ; reset extrusion factor override percentage to default (100%) + {% if printer.extruder.temperature > 170 %} ; if extruder is hot, retract filament + G1 E-3.0 F3600 ; retract filament by 3mm + {% endif %} + {% if printer.toolhead.homed_axis == "xyz" %} ; if XYZ is homed, we can move the nozzle + G91 ; relative positioning + G1 Z+5 F3600 ; move nozzle up 5mm + G90 ; absolute positioning + PARK_NOZZLE_REAR ; park nozzle + {% endif %} + CLEAR_PAUSE + BASE_CANCEL_PRINT + +[gcode_macro PRINT_START] +description: Prepare extruder and bed for printing +gcode: + G28 ; home all axes + M83 ; relative extrusion + M104 S{ params.EXTRUDER | float } ; set extruder temp + M190 S{ params.BED | float } ; wait for bed to reach temperture + M109 S{ params.EXTRUDER | float } ; wait for extruder to reach tempert ure + BED_MESH_CALIBRATE ; calibrate bed mesh + PARK_NOZZLE_REAR ; park nozzle + +[gcode_macro PRINT_END] +description: Turn off extruder and bed after printing +gcode: + M400 ; wait for moves to finish + G91 ; relative positioning + M83 ; relative extrusion + G1 E-5.0 F2000 ; retract filament + M400 ; wait for moves to finish + G0 Z5 F2000 ; move nozzle to remove stringing + M400 ; wait for moves to finish + G90 ; absolute positioning + TURN_OFF_HEATERS ; turn off heaters + M107 ; turn off fan + PARK_NOZZLE_REAR ; park nozzle + M84 ; disable motors