Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###############################################################################################################################################################################
- # PID
- ###############################################################################################################################################################################
- [gcode_macro PID_Hotend]
- gcode:
- G90
- G28
- PID_CALIBRATE HEATER=extruder TARGET={params.TEMP|default(195)}
- M107
- SAVE_CONFIG
- [gcode_macro PID_Bed]
- gcode:
- G90
- G28
- PID_CALIBRATE HEATER=heater_bed TARGET={params.TEMP|default(80)}
- M107
- SAVE_CONFIG
- ###############################################################################################################################################################################
- # Manual Leveling
- ###############################################################################################################################################################################
- [screws_tilt_adjust]
- # go move the printhead manually right above the screw and write down the coordinates (x, y) after screw1, screw2, ...
- screw1: 28, 28
- screw1_name: front_left
- screw2: 180, 28
- screw2_name: front_right
- screw3: 180, 198
- screw3_name: back_right
- screw4: 28, 198
- screw4_name: back_left
- speed: 120
- horizontal_move_z: 10
- screw_thread: CW-M4
- [gcode_macro MANUAL_LEVELING]
- gcode:
- {% set EXTRUDER_TEMP = params.EXTRUDER|default(140)|float %}
- {% set BED_TEMP = params.BED|default(60)|float %}
- G90
- # preheat extruder
- SET_HEATER_TEMPERATURE HEATER=extruder TARGET={EXTRUDER_TEMP}
- # set bed temperature
- SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={BED_TEMP}
- # wait for temperature
- TEMPERATURE_WAIT SENSOR=extruder MINIMUM={EXTRUDER_TEMP - 5} MAXIMUM={EXTRUDER_TEMP + 5}
- TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={BED_TEMP - 1} MAXIMUM={BED_TEMP + 1}
- # home and start leveling process
- G28
- SCREWS_TILT_CALCULATE
- [gcode_macro Z_OFFSET]
- gcode:
- {% set EXTRUDER_TEMP = params.EXTRUDER|default(140)|float %}
- {% set BED_TEMP = params.BED|default(60)|float %}
- G90
- # preheat extruder
- SET_HEATER_TEMPERATURE HEATER=extruder TARGET={EXTRUDER_TEMP}
- # set bed temperature
- SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={BED_TEMP}
- # wait for temperature
- TEMPERATURE_WAIT SENSOR=extruder MINIMUM={EXTRUDER_TEMP - 5} MAXIMUM={EXTRUDER_TEMP + 5}
- TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={BED_TEMP - 1} MAXIMUM={BED_TEMP + 1}
- G28
- PROBE_CALIBRATE
- [gcode_macro ACCURACY_PROBE]
- gcode:
- {% set BED_TEMP = params.BED|default(60)|float %}
- G90
- # set bed temperature
- SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={BED_TEMP}
- # wait for temperature
- TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={BED_TEMP - 1} MAXIMUM={BED_TEMP + 1}
- G28
- PROBE_ACCURACY
- ###############################################################################################################################################################################
- # Auto Leveling
- ###############################################################################################################################################################################
- [gcode_macro BED_LEVELING]
- gcode:
- {% set EXTRUDER_TEMP = params.EXTRUDER|default(140)|float %}
- {% set BED_TEMP = params.BED|default(60)|float %}
- {% set speed_limit = printer.configfile.settings.printer.max_velocity|float %}
- {% set accel_limit = printer.configfile.settings.printer.max_accel|float %}
- # set park positon for x, y and z
- {% set x_park = printer.toolhead.axis_maximum.x|float %}
- {% set y_park = (printer.toolhead.axis_maximum.y - printer.toolhead.axis_minimum.y) / 2|float %}
- {% set z_park = 100|float %}
- # heat extruder and bed
- M104 S{EXTRUDER_TEMP}
- M140 S{BED_TEMP}
- # wait for temperature
- M109 S{EXTRUDER_TEMP}
- M190 S{BED_TEMP}
- G90 # set absolute coordinates
- G28 # home
- SET_VELOCITY_LIMIT VELOCITY={speed_limit} ACCEL={accel_limit}
- BED_MESH_CLEAR
- BED_MESH_CALIBRATE PROFILE=default
- G1 X{x_park} Y{y_park} Z{z_park}
- SAVE_CONFIG
- [gcode_macro LOAD_MESH]
- description: Load the current mesh
- gcode:
- BED_MESH_PROFILE LOAD=default
- [gcode_macro CLEAR_MESH]
- description: Clear the current mesh
- gcode:
- BED_MESH_CLEAR
- ###############################################################################################################################################################################
- # START_PRINT and END_PRINT
- ###############################################################################################################################################################################
- [gcode_macro START_PRINT]
- gcode:
- {% set BED_TEMP = params.BED|default(60)|float %}
- {% set EXTRUDER_TEMP = params.EXTRUDER|default(230)|float %}
- {% set speed_limit = printer.configfile.settings.printer.max_velocity|float %}
- {% set accel_limit = printer.configfile.settings.printer.max_accel|float %}
- # clear current mesh
- BED_MESH_CLEAR
- # set limits to printer limits
- SET_VELOCITY_LIMIT VELOCITY={speed_limit} ACCEL={accel_limit}
- # preheat extruder
- SET_HEATER_TEMPERATURE HEATER=extruder TARGET={EXTRUDER_TEMP - 100}
- # set bed temperature
- SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={BED_TEMP}
- G90 # set absolute coordinates
- G28 # home all
- # wipe nozzle
- #WIPE_NOZZLE_BRUSH
- # wait for bed temperature
- TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={BED_TEMP - 1} MAXIMUM={BED_TEMP + 1}
- # home after heating
- G28
- # calibrate bed
- BED_MESH_CALIBRATE
- # home Z again
- G28 Z
- # clean nozzle
- #CLEAN_NOZZLE_BRUSH CLEANING_TEMP={EXTRUDER_TEMP}
- # move to starting position
- G1 X2 Y5 F6000 # priming line start point xy
- G1 Z0.5 F600 # priming line start point z
- # priming line in y-direction
- G1 Y100 E30 F300
- G92 E0 # extruder reset
- G1 Z1.0 F600 # raise z to travel to print-start-point
- SET_VELOCITY_LIMIT VELOCITY={speed_limit} ACCEL={accel_limit}
- [gcode_macro END_PRINT]
- gcode:
- # set park positon for x and y
- {% set x_park = printer.toolhead.axis_maximum.x|float %}
- {% set y_park = printer.toolhead.axis_maximum.y|float %}
- # calculate save lift position
- {% set max_z = printer.toolhead.axis_maximum.z|float %}
- {% set current_z = printer.toolhead.position.z|float %}
- {% if current_z < (max_z - 2.0) %}
- {% set z_safe = 2.0 %}
- {% else %}
- {% set z_safe = max_z - current_z %}
- {% endif %}
- # move z to safe position
- G91
- G1 Z{z_safe} F1200
- # move to parking position
- G90
- G1 X{x_park} Y{y_park} F6000
- M84 # turn off motors
- M107 # turn off fan
- M140 S0 # turn off bed heater
- M104 S0 # turn off extruder heater
Advertisement
Add Comment
Please, Sign In to add comment