Updates and fixes

update /macros folder

Update *bltouch.cfg

Fix Z and Y pins

Fix Y direction

Update MKSRN-Sv1.3 pins

Clean obsolete comments
This commit is contained in:
oducceu
2021-10-13 15:07:13 +03:00
parent 5935bfa7f1
commit 31ac02031d
14 changed files with 452 additions and 79 deletions

View File

@@ -0,0 +1,111 @@
################################################################################
# Board: MKS Robin Nano v1.1 (Flying Bear Reborn 2.0) / MKS Robin Nano v1.3 / MKS Robin Nano-S v1.3
# Printer: Flying Bear Ghost 4S / Ghost 5 / Reborn
# G-code Macros by ODUCCEU
################################################################################
# WARNING! DO NOT EDIT THIS FILE!
# To override settings from this file, you can copy and paste the relevant
# sections into your printer.cfg and change it there.
################################################################################
# Filament Change ##############################################################
[gcode_macro FILAMENT_CHANGE]
# Unloads filament, waites 5 minutes for manual filament switch and loads again
gcode:
SAVE_GCODE_STATE NAME=FILAMENT_CHANGE_STATE
{% set timer = params.T|default(300)|float %}
{% set unload = params.U|default(100)|float %}
{% set load = params.L|default(100)|float %}
{% if printer.pause_resume.is_paused %}
M118 Already paused
{% else %}
{% if printer.toolhead.homed_axes != "xyz" %}
M118 Homing
G28 # home if not homed
{% else %}
M118 Pausing print
PAUSE
{% endif %}
{% endif %}
M118 Changing filament...
SET_IDLE_TIMEOUT TIMEOUT=7200
FILAMENT_UNLOAD U={unload}
COUNTDOWN TIME={timer} MSG="Change filament! Time left: "
FILAMENT_LOAD L={load}
RESTORE_GCODE_STATE NAME=FILAMENT_CHANGE_STATE
[gcode_macro FILAMENT_LOAD]
gcode:
{% set load = params.L|default(100)|float * 0.5 %}
{% set extruder_temp = params.T|default(220)|float %}
SAVE_GCODE_STATE NAME=FILAMENT_LOAD_STATE
LOW_TEMP_CHECK T={extruder_temp}
M118 Loading filament...
M83 # relative extrusion
G0 E{load} F600 # load the filament into the hotend area
G4 P1000 # wait 1 second
G1 E50 F100 # purge
M400 # wait until all moves are completed
M118 Filament loaded!
BEEP
RESTORE_GCODE_STATE NAME=FILAMENT_LOAD_STATE
[gcode_macro FILAMENT_UNLOAD]
gcode:
{% set unload = params.U|default(100)|float %}
{% set extruder_temp = params.T|default(220)|float %}
SAVE_GCODE_STATE NAME=FILAMENT_UNLOAD_STATE
LOW_TEMP_CHECK T={extruder_temp}
M118 Unloading filament
M83 # relative extrusion
G0 E-5 F3600 # extract filament to the coldend zone
G4 P3000 # wait for 3 seconds
G0 E5 F3600 # push back the filament to smash any stringing
G0 E-15 F3600 # extract back fast to the coldend zone
G0 E-{unload} F300 # extract a lot
M400 # wait until all moves are completed
M118 Filament unloaded!
BEEP
RESTORE_GCODE_STATE NAME=FILAMENT_UNLOAD_STATE
[gcode_macro LOW_TEMP_CHECK]
gcode:
{% set extruder_temp = params.T|default(220)|float %}
{% if printer.extruder.target > extruder_temp %} # check for a setpoint for extruder
{% set extruder_temp = printer.extruder.target %}
{% endif %}
{% if printer.extruder.temperature < extruder_temp %} # heat to the target temp
M118 Heating to {extruder_temp}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={extruder_temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={extruder_temp}
{% endif %}
[gcode_macro COUNTDOWN]
gcode:
{% set timer = params.TIME|default(10)|int %}
{% set message = params.MSG|default("Time: ") %}
# countdown
{% if timer > 60 %}
{% for s in range(timer, 60, -10) %}
M118 {message} {s}s
G4 P10000 # wait 10 seconds
{% endfor %}
{% set timer = 60 %}
{% endif %}
{% if timer > 10 %}
{% for s in range(timer, 10, -5) %}
M118 {message} {s}s
G4 P5000 # wait 5 seconds
{% endfor %}
{% set timer = 10 %}
{% endif %}
{% if timer > 0 %}
{% for s in range(timer, 0, -1) %}
M118 {message} {s}s
G4 P1000 # wait 1 second
{% endfor %}
{% endif %}
BEEP
################################################################################

View File

@@ -3,6 +3,18 @@
# Printer: Flying Bear Ghost 4S / Ghost 5 / Reborn
# G-code Macros by ODUCCEU
################################################################################
# WARNING! DO NOT EDIT THIS FILE!
# To override settings from this file, you can copy and paste the relevant
# sections into your printer.cfg and change it there.
################################################################################
# Documentation
# https://www.klipper3d.org/G-Codes.html
# https://www.klipper3d.org/Command_Templates.html
################################################################################
# Included macros
################################################################################
[include print_management.cfg]
[include prime_line.cfg]

View File

@@ -0,0 +1,123 @@
################################################################################
# Board: MKS Robin Nano v1.1 (Flying Bear Reborn 2.0) / MKS Robin Nano v1.3 / MKS Robin Nano-S v1.3
# Printer: Flying Bear Ghost 4S / Ghost 5 / Reborn
# G-code Macros by ODUCCEU
################################################################################
# WARNING! DO NOT EDIT THIS FILE!
# To override settings from this file, you can copy and paste the relevant
# sections into your printer.cfg and change it there.
################################################################################
# Marlin Compatibility #########################################################
[gcode_macro G27]
gcode:
PARK
[gcode_macro M125]
gcode:
PARK
[gcode_macro M76] # Marlin Compatibility
gcode:
PAUSE
[gcode_macro M601] # Marlin Compatibility
gcode:
PAUSE
[gcode_macro M300] # Marlin Compatibility
gcode:
BEEP
[gcode_macro M600] # Marlin Compatibility
gcode:
FILAMENT_CHANGE
[gcode_macro M701] # Marlin Compatibility
gcode:
FILAMENT_LOAD
[gcode_macro M702] # Marlin Compatibility
gcode:
FILAMENT_UNLOAD
[gcode_macro M92]
gcode:
{% set extruder_steps = params.E|default(0.0025)|float %}
SET_EXTRUDER_STEP_DISTANCE DISTANCE={extruder_steps}
[gcode_macro M204] # Set Acceleration
# Klipper accepts M204 S<value> OR M204 P<value> T<value> where both P and T must be specified
# PrusaSliser sends M204 P<value> without T and Klipper shows an error
# This macro makes M204 command more versatile
rename_existing: M204.1
gcode:
{% set factor = params.F|default(0.5)|float %}
{% if 'S' in params %}
SET_VELOCITY_LIMIT ACCEL={S} ACCEL_TO_DECEL={ S|float * factor }
{% else %}
{% if 'P' in params %}
{% if 'T' in params %}
{% if P|int < T|int %}
SET_VELOCITY_LIMIT ACCEL={P} ACCEL_TO_DECEL={ P|float * factor }
{% else %}
SET_VELOCITY_LIMIT ACCEL={T} ACCEL_TO_DECEL={ T|float * factor }
{% endif %}
{% else %}
SET_VELOCITY_LIMIT ACCEL={P} ACCEL_TO_DECEL={ P|float * factor }
{% endif %}
{% elif 'T' in params %}
SET_VELOCITY_LIMIT ACCEL={T} ACCEL_TO_DECEL={ T|float * factor }
{% endif %}
{% endif %}
[gcode_macro M205] # Set Junction deviation or Jerk
gcode:
{% if 'J' in params %}
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={J}
{% elif 'X' in params %}
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={X}
{% elif 'Y' in params %}
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={Y}
{% endif %}
[gcode_macro M207] # Set Firmware Retraction
gcode:
{% set length = params.S|default(0.5)|float %}
{% set speed = params.F|default(25)|float %}
SET_RETRACTION RETRACT_LENGTH={length} RETRACT_SPEED={speed}
[gcode_macro M303] # PID Autotune
gcode:
{% if 'E' in params %}
{% set heater = params.E|default(0)|int %}
{% set temp = params.T|default(0)|float %}
{% if heater == 0 %} # extruder
{% if temp >= printer.configfile.settings.extruder.min_extrude_temp|float %}
{% if temp <= printer.configfile.settings.extruder.max_temp|float %}
PID_CALIBRATE HEATER=extruder TARGET={T}
{% endif %}
{% endif %}
{% elif heater == -1 %} # bed
{% if temp <= printer.configfile.settings.heater_bed.max_temp|float %}
PID_CALIBRATE HEATER=heater_bed TARGET={T}
{% endif %}
{% endif %}
{% endif %}
[gcode_macro M486] # Label Objects
# M486 has no realization in Klipper yet
# This empty macro stops M486-error terminal messages
gcode:
# Do nothing
[gcode_macro M500] # Save Settings
gcode:
SAVE_CONFIG
[gcode_macro M900] # Set Pressure Advance
gcode:
{% if 'K' in params %}
SET_PRESSURE_ADVANCE ADVANCE={ params.K|float }
{% endif %}

View File

@@ -0,0 +1,45 @@
################################################################################
# Board: MKS Robin Nano v1.1 (Flying Bear Reborn 2.0) / MKS Robin Nano v1.3 / MKS Robin Nano-S v1.3
# Printer: Flying Bear Ghost 4S / Ghost 5 / Reborn
# G-code Macros by ODUCCEU
################################################################################
# WARNING! DO NOT EDIT THIS FILE!
# To override settings from this file, you can copy and paste the relevant
# sections into your printer.cfg and change it there.
################################################################################
# Wipe the nozzle ##############################################################
[gcode_macro PRIME_LINE]
gcode:
{% set feedrate = params.F|default(10)|float * 60 %}
{% set length = 100.0 %}
{% set width = printer.configfile.settings.extruder.nozzle_diameter|float * 1.1 %}
{% set height = ( (width / 0.04)|int - (width / 0.04 / 4)|int )|float * 0.04 %}
{% set extrude = 2 * length * width * height / 2.4 %}
{% if 'Y' in params %}
{% set x_start = 1.0 %}
{% set y_start = (printer.toolhead.axis_maximum.y|float - 100) / 2 %}
{% else %}
{% set x_start = (printer.toolhead.axis_maximum.x|float - 100) / 2 %}
{% set y_start = 1.0 %}
{% endif %}
SAVE_GCODE_STATE NAME=PRIME_LINE_STATE
SET_IDLE_TIMEOUT TIMEOUT=7200
G0 Z0 F600
G0 Y1 F12000 # cut the crap
G0 Z10 F600
G0 X{x_start} Y{y_start} F6000 # move to start position
G0 Z{height} F600
G91 # relative positioning
{% if 'Y' in params %}
G1 Y100 E{extrude} F{feedrate} # prime
G1 Y-100 F12000 # wipe
{% else %}
G1 X100 E{extrude} F{feedrate} # prime
G1 X-100 F12000 # wipe
{% endif %}
G0 Z10 F600
RESTORE_GCODE_STATE NAME=PRIME_LINE_STATE
################################################################################

View File

@@ -3,14 +3,18 @@
# Printer: Flying Bear Ghost 4S / Ghost 5 / Reborn
# G-code Macros by ODUCCEU
################################################################################
# WARNING! DO NOT EDIT THIS FILE!
# To override settings from this file, you can copy and paste the relevant
# sections into your printer.cfg and change it there.
################################################################################
# Print Job Management #########################################################
[gcode_macro START_PRINT]
## PrusaSliser:
## PrusaSliser/SuperSlicer:
# M190 S0
# M109 S0
# START_PRINT EXTRUDER_TEMP={first_layer_temperature[0]} BED_TEMP={first_layer_bed_temperature}
# START_PRINT EXTRUDER_TEMP={first_layer_temperature[0]} BED_TEMP={first_layer_bed_temperature[0]}
## Cura:
# M190 S0
# M109 S0
@@ -30,17 +34,15 @@ gcode:
M220 S100 # reset feedrate
M221 S100 # reset flowrate
G90 # absolute positioning
M82 # relative extrusion mode
M83 # relative extrusion mode
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={bed_temp} # set bed temp
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={bed_temp_preheat} # wait until bed is partially heated
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={extruder_temp} # set extruder temp
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={bed_temp} # wait for bed temp
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={extruder_temp} # wait for extruder temp
G28 # home
G0 Z10 F1500 # raise Z
G92 E0 # reset extruder
G1 E{E} F1500 # prime
G92 E0 # reset extruder
G0 Z10 F600 # raise Z
G1 E{E} F2100 # prime
[gcode_macro END_PRINT]
gcode:
@@ -48,15 +50,14 @@ gcode:
TURN_OFF_HEATERS
M107 # turn off fan
G91 # relative positioning
G1 E-{E} F1500 # retract
G0 X1 Y1 F5000 # wipe
G0 Z2 F1500 # raise Z
G1 E-{E} F2100 # retract
G0 X1 Y1 F6000 # wipe
G0 Z2 F600 # raise Z
G90 # absolute positioning
PARK Z=30
M84 # turn off all motors
BEEP P=200 S=250
# NORMAL_SPEED # reset stepper current
# SAVE_IF_SET # SAVE_CONFIG
SAVE_UPDATES
[gcode_macro PARK]
gcode:
@@ -78,8 +79,8 @@ gcode:
SAVE_GCODE_STATE NAME=PARK_STATE
{% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} # home if not homed
G90 # absolute positioning
G0 Z{z_park} F1500
G0 X{x_park} Y{y_park} F5000
G0 Z{z_park} F600
G0 X{x_park} Y{y_park} F6000
RESTORE_GCODE_STATE name=PARK_STATE
[gcode_macro PAUSE]
@@ -113,7 +114,7 @@ gcode:
G1 E{E} F2100
G90
{% else %}
{action_respond_info("Extruder is not hot enough")}
{action_respond_info("Extruder is not hot enough")}
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSE_STATE MOVE=1
BASE_RESUME {get_params}
@@ -129,7 +130,7 @@ gcode:
{% if printer.extruder.can_extrude|lower == 'true' %}
G91 # relative positioning
G1 E-{E} F2100 # retract
G0 Z2 F1500 # raise Z
G0 Z2 F600 # raise Z
G90 # absolute positioning
{% else %}
{action_respond_info("Extruder is not hot enough")}
@@ -138,6 +139,16 @@ gcode:
BASE_CANCEL_PRINT
PARK Z=30
M84 # turn off all motors
# NORMAL_SPEED # reset stepper current
# Save to Config ##########################################################
[gcode_macro SAVE_UPDATES]
description: Run SAVE_CONFIG if there are updates that it may persist to disk
gcode:
{% if printer.configfile.save_config_pending %}
M118 Saving and restarting now
G4 P2000 # wait 2 seconds
SAVE_CONFIG
{% endif %}
################################################################################