Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ================================================================================
- # GCode Macro: START_PRINT
- # Aggiungi START_PRINT nello script di avvio dello Slicer.
- # ================================================================================
- [gcode_macro START_PRINT]
- gcode:
- G28 ; Home di tutti gli assi
- BED_MESH_CALIBRATE ; Calibrazione del Bed
- G92 E0 ; Reset dell'estrusore
- G1 Z5.0 F3000 ; Muove l'asse Z un po' in alto per evitare di graffiare il Bed
- G1 X7.1 Y40 Z0.3 F5000.0 ; Spostamento alla posizione iniziale
- G1 X7.1 Y215.0 Z0.3 F1500.0 E15 ; Disegna la prima linea
- G1 X7.4 Y215.0 Z0.3 F5000.0 ; Spostamento laterale
- G1 X7.4 Y40 Z0.3 F1500.0 E30 ; Disegna la seconda linea
- G92 E0 ; Reset dell'estrusore
- G1 Z5.0 F3000 ; Muove l'asse Z un po' in alto per evitare di graffiare il Bed
- # ================================================================================
- # GCode Macro: END_PRINT
- # Aggiungi END_PRINT nello script di fine dello Slicer.
- # ================================================================================
- #[gcode_macro END_PRINT]
- #gcode:
- # G1 Y190 F1500; Sposta Y davanti
- # G10 ; Imposta l'offset? O ritrae?
- # G91 ; Posizionamento relativo
- #G1 Z+10 ; Muove Z in alto per non colpire nulla
- #G1 E-10 F300 ; Ritrae -10
- #G90 ; Posizionamento assoluto
- #G1 X10 Y220 F2000 ; Muove X10, Y220
- #M104 S0 ; Spegne l'estrusore (lo imposta a 0)
- #M140 S0 ; Spegne il Bed (lo imposta a 0)
- #M106 S0 ; Spegne le ventole di raffreddamento
- #M84 ; Disabilita gli stepper motors
- [gcode_macro END_PRINT]
- gcode:
- #Fix-up extruder
- RESPOND MSG="Print Finished"
- G91
- G1 E-.5 Z0.2 F2400
- G1 X5 Y5 F6000
- G1 Z10
- G90
- #Present print
- G1 Z{printer.toolhead.position.z + 10} F600
- G1 X0 Y220 F6000
- M106 S0
- M104 S0
- M140 S0
- #Disable Steppers
- M84 X Y E
- [gcode_macro BED_MESH_CALIBRATE]
- rename_existing: BASE_BED_MESH_CALIBRATE
- gcode:
- #before the original gcode
- BED_MESH_CLEAR
- QUAD_GANTRY_LEVEL
- G1 X125 Y125 Z5 F6000
- #the original gcode
- BASE_BED_MESH_CALIBRATE
- #after the original gcode
- [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
- description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
- variable_extrude: 1.0
- gcode:
- ##### 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 %}
- {% set z_park_delta = 2.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 - z_park_delta) %}
- {% set z_safe = z_park_delta %}
- {% else %}
- {% set z_safe = max_z - act_z %}
- {% endif %}
- ##### end of definitions #####
- {% if printer.extruder.can_extrude|lower == 'true' %}
- M83
- G1 E-{extrude} F2100
- {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- {% if "xyz" in printer.toolhead.homed_axes %}
- G91
- G1 Z{z_safe} F900
- G90
- G1 X{x_park} Y{y_park} F6000
- {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
- {% else %}
- {action_respond_info("Printer not homed")}
- {% endif %}
- [gcode_macro CANCEL_PRINT]
- description: Cancel the actual running print
- rename_existing: CANCEL_PRINT_BASE
- variable_park: True
- gcode:
- ## Move head and retract only if not already in the pause state and park set to true
- {% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
- _TOOLHEAD_PARK_PAUSE_CANCEL
- {% endif %}
- TURN_OFF_HEATERS
- CANCEL_PRINT_BASE
- [gcode_macro RESUME]
- description: Resume the actual running print
- rename_existing: RESUME_BASE
- gcode:
- ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro #####
- {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
- #### 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' %}
- M83
- G1 E{extrude} F2100
- {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
- {% else %}
- {action_respond_info("Extruder not hot enough")}
- {% endif %}
- RESUME_BASE {get_params}
- [gcode_macro PAUSE]
- description: Pause the actual running print
- rename_existing: PAUSE_BASE
- gcode:
- PAUSE_BASE
- _TOOLHEAD_PARK_PAUSE_CANCEL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement