Advertisement
rootiest

Flipmcfly.cfg

Feb 26th, 2023 (edited)
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.93 KB | None | 0 0
  1. ###fluidd set
  2. [virtual_sdcard]
  3. path: ~/gcode_files
  4.  
  5. [display_status]
  6.  
  7. [respond]
  8.  
  9. [exclude_object]
  10.  
  11. [pause_resume]
  12.  
  13. # --------------------------- Pause Print ----------------------------
  14. [gcode_macro PAUSE]
  15. description: Pause the actual running print
  16. rename_existing: PAUSE_BASE
  17. # change this if you need more or less extrusion
  18. variable_extrude: 1.0
  19. gcode:
  20.    ##### read E from pause macro #####
  21.     {% set E = printer["gcode_macro PAUSE"].extrude|float %}
  22.     ##### set park positon for x and y #####
  23.     # default is your max posion from your printer.cfg
  24.     {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  25.     {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  26.     ##### calculate save lift position #####
  27.     {% set max_z = printer.toolhead.axis_maximum.z|float %}
  28.     {% set act_z = printer.toolhead.position.z|float %}
  29.     {% if act_z < (max_z - 2.0) %}
  30.         {% set z_safe = 2.0 %}
  31.     {% else %}
  32.         {% set z_safe = max_z - act_z %}
  33.     {% endif %}
  34.     ##### end of definitions #####
  35.     PAUSE_BASE
  36.     G91
  37.     {% if printer.extruder.can_extrude|lower == 'true' %}
  38.         G1 E-{E} F2100
  39.     {% else %}
  40.         {action_respond_info("Extruder not hot enough")}
  41.     {% endif %}
  42.     {% if "xyz" in printer.toolhead.homed_axes %}
  43.         G1 Z{z_safe} F900
  44.         G90
  45.         G1 X{x_park} Y{y_park} F6000
  46.     {% else %}
  47.         {action_respond_info("Printer not homed")}
  48.     {% endif %}
  49. # --------------------------------------------------------------------
  50.  
  51. # --------------------------- Resume Print ---------------------------
  52. [gcode_macro RESUME]
  53. description: Resume the actual running print
  54. rename_existing: RESUME_BASE
  55. gcode:
  56.    ##### read E from pause macro #####
  57.     {% set E = printer["gcode_macro PAUSE"].extrude|float %}
  58.     #### get VELOCITY parameter if specified ####
  59.     {% if 'VELOCITY' in params|upper %}
  60.         {% set get_params = ('VELOCITY=' + params.VELOCITY)  %}
  61.     {%else %}
  62.         {% set get_params = "" %}
  63.     {% endif %}
  64.     ##### end of definitions #####
  65.     {% if printer.extruder.can_extrude|lower == 'true' %}
  66.         G91
  67.         G1 E{E} F2100
  68.     {% else %}
  69.         {action_respond_info("Extruder not hot enough")}
  70.     {% endif %}
  71.     RESUME_BASE {get_params}
  72. # --------------------------------------------------------------------
  73.  
  74. # --------------------------- Cancel Print ---------------------------
  75. [gcode_macro CANCEL_PRINT]
  76. description: Cancel the actual running print
  77. rename_existing: CANCEL_PRINT_BASE
  78. gcode:
  79.    TURN_OFF_HEATERS
  80.     {% if "xyz" in printer.toolhead.homed_axes %}
  81.         G91
  82.         G1 Z4.5 F300
  83.         G90
  84.     {% else %}
  85.         {action_respond_info("Printer not homed")}
  86.     {% endif %}
  87.         G28 X Y
  88.     {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  89.         G1 Y{y_park} F2000
  90.         M84
  91.     CANCEL_PRINT_BASE
  92. # --------------------------------------------------------------------
  93.  
  94. # --------------------------- Start Print ----------------------------
  95. [gcode_macro START_PRINT]
  96. gcode:
  97.    # Get pre-heat temperature parameters
  98.     {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
  99.     {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
  100.     # Start bed heating
  101.     M140 S{BED_TEMP}
  102.     # Use absolute coordinates
  103.     G90
  104.     # Reset the G-Code Z offset (adjust Z offset if needed)
  105.     SET_GCODE_OFFSET Z=0.0
  106.     # Home the printer
  107.     G28
  108.     # Move the nozzle near the bed
  109.     G1 Z5 F3000
  110.     # Move the nozzle very close to the bed
  111.     G1 Z0.15 F300
  112.     # Reset Extruder
  113.     G92 E0
  114.     # Move Z Axis up
  115.     G1 Z2.0 F3000
  116.     # Move to start position
  117.     G1 X2.1 Y20 Z0.28 F5000.0
  118.     # Wait for bed to reach temperature
  119.     M190 S{BED_TEMP}
  120.     # Set and wait for nozzle to reach temperature
  121.     M109 S{EXTRUDER_TEMP}
  122.     # Draw the first line
  123.     G1 X2.1 Y200.0 Z0.28 F1500.0 E15
  124.     # Move to side a little
  125.     G1 X2.4 Y200.0 Z0.28 F5000.0
  126.     # Draw the second line
  127.     G1 X2.4 Y20 Z0.28 F1500.0 E30
  128.     # Reset Extruder
  129.     G92 E0
  130.     # Move Z Axis up
  131.     G1 Z2.0 F3000
  132.     # Print message on LCD
  133.     M117 By your command!
  134. # --------------------------------------------------------------------
  135.  
  136. # ---------------------------- End Print -----------------------------
  137. [gcode_macro END_PRINT]
  138. gcode:
  139.    #Get Printer built volume dimensions
  140.     {% set X_MAX = printer.toolhead.axis_maximum.x|default(100)|float %}
  141.     {% set Y_MAX = printer.toolhead.axis_maximum.y|default(100)|float %}
  142.     # Turn off bed, extruder, and fan
  143.     M140 S0
  144.     M104 S0
  145.     M106 S0
  146.     # Relative positionning
  147.     G91
  148.     # Retract and raise Z
  149.     G1 Z0.2 E-2 F2400
  150.     # Wipe out
  151.     G1 X5 Y5 F3000
  152.     # Raise Z more
  153.     G1 Z10
  154.     # Absolute positionning
  155.     G90
  156.     #Present print
  157.     G1 Z{printer.toolhead.position.z + 10} F600
  158.     G1 X{X_MAX} Y{Y_MAX} F6000
  159.     # Disable steppers
  160.     M84
  161. # --------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement