Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###fluidd set
- [virtual_sdcard]
- path: ~/gcode_files
- [display_status]
- [respond]
- [exclude_object]
- [pause_resume]
- # --------------------------- Pause Print ----------------------------
- [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:
- ##### 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 %}
- # --------------------------------------------------------------------
- # --------------------------- Resume Print ---------------------------
- [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}
- # --------------------------------------------------------------------
- # --------------------------- Cancel Print ---------------------------
- [gcode_macro CANCEL_PRINT]
- description: Cancel the actual running print
- rename_existing: CANCEL_PRINT_BASE
- gcode:
- TURN_OFF_HEATERS
- {% if "xyz" in printer.toolhead.homed_axes %}
- G91
- G1 Z4.5 F300
- G90
- {% else %}
- {action_respond_info("Printer not homed")}
- {% endif %}
- G28 X Y
- {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
- G1 Y{y_park} F2000
- M84
- CANCEL_PRINT_BASE
- # --------------------------------------------------------------------
- # --------------------------- Start Print ----------------------------
- [gcode_macro START_PRINT]
- gcode:
- # Get pre-heat temperature parameters
- {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
- {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
- # Start bed heating
- M140 S{BED_TEMP}
- # Use absolute coordinates
- G90
- # Reset the G-Code Z offset (adjust Z offset if needed)
- SET_GCODE_OFFSET Z=0.0
- # Home the printer
- G28
- # Move the nozzle near the bed
- G1 Z5 F3000
- # Move the nozzle very close to the bed
- G1 Z0.15 F300
- # Reset Extruder
- G92 E0
- # Move Z Axis up
- G1 Z2.0 F3000
- # Move to start position
- G1 X2.1 Y20 Z0.28 F5000.0
- # Wait for bed to reach temperature
- M190 S{BED_TEMP}
- # Set and wait for nozzle to reach temperature
- M109 S{EXTRUDER_TEMP}
- # Draw the first line
- G1 X2.1 Y200.0 Z0.28 F1500.0 E15
- # Move to side a little
- G1 X2.4 Y200.0 Z0.28 F5000.0
- # Draw the second line
- G1 X2.4 Y20 Z0.28 F1500.0 E30
- # Reset Extruder
- G92 E0
- # Move Z Axis up
- G1 Z2.0 F3000
- # Print message on LCD
- M117 By your command!
- # --------------------------------------------------------------------
- # ---------------------------- End Print -----------------------------
- [gcode_macro END_PRINT]
- gcode:
- #Get Printer built volume dimensions
- {% set X_MAX = printer.toolhead.axis_maximum.x|default(100)|float %}
- {% set Y_MAX = printer.toolhead.axis_maximum.y|default(100)|float %}
- # Turn off bed, extruder, and fan
- M140 S0
- M104 S0
- M106 S0
- # Relative positionning
- G91
- # Retract and raise Z
- G1 Z0.2 E-2 F2400
- # Wipe out
- G1 X5 Y5 F3000
- # Raise Z more
- G1 Z10
- # Absolute positionning
- G90
- #Present print
- G1 Z{printer.toolhead.position.z + 10} F600
- G1 X{X_MAX} Y{Y_MAX} F6000
- # Disable steppers
- M84
- # --------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement