diff --git a/KlipperScreen.conf b/KlipperScreen.conf index 5b2468d..1ae65a9 100644 --- a/KlipperScreen.conf +++ b/KlipperScreen.conf @@ -33,4 +33,5 @@ #~# [graph Printer] #~# extruder = False #~# heater_bed = False +#~# temperature_sensor manta = False #~# diff --git a/config/cooling.cfg b/config/cooling.cfg index 9e7e931..9d82684 100644 --- a/config/cooling.cfg +++ b/config/cooling.cfg @@ -36,6 +36,10 @@ {% set baseFanSpeed = [0.6, baseFanSpeed]|max %} {% endif %} + {% if printer['extruder'].target != 0 or printer['heater_bed'].target != 0 %} + {% set baseFanSpeed = [0.2, baseFanSpeed]|max %} + {% endif %} + {% set baseFanSpeed = [[baseFanSpeed, 1]|min, 0]|max %} # fix the value somewhere between zero and one SET_FAN_SPEED FAN=base_1 SPEED={baseFanSpeed} SET_FAN_SPEED FAN=base_2 SPEED={baseFanSpeed} diff --git a/config/eddy.cfg b/config/eddy.cfg index 717435c..25e6039 100644 --- a/config/eddy.cfg +++ b/config/eddy.cfg @@ -80,19 +80,14 @@ # Uncomment this if you are using Eddy as the probe AND the homing endstop AND would like to use the beta z-offset control -#[save_variables] -#filename: ~/printer_data/config/variables.cfg - - -# Uncomment this if you are using Eddy as the probe AND the homing endstop AND would like to use the beta z-offset control -#[delayed_gcode RESTORE_PROBE_OFFSET] -#initial_duration: 1. -#gcode: -# {% set svv = printer.save_variables.variables %} -# {% if not printer["gcode_macro SET_GCODE_OFFSET"].restored %} -# SET_GCODE_VARIABLE MACRO=SET_GCODE_OFFSET VARIABLE=runtime_offset VALUE={ svv.nvm_offset|default(0) } -# SET_GCODE_VARIABLE MACRO=SET_GCODE_OFFSET VARIABLE=restored VALUE=True -# {% endif %} +[delayed_gcode RESTORE_PROBE_OFFSET] +initial_duration: 1. +gcode: + {% set svv = printer.save_variables.variables %} + {% if not printer["gcode_macro SET_GCODE_OFFSET"].restored %} + SET_GCODE_VARIABLE MACRO=SET_GCODE_OFFSET VARIABLE=runtime_offset VALUE={ svv.nvm_offset|default(0) } + SET_GCODE_VARIABLE MACRO=SET_GCODE_OFFSET VARIABLE=restored VALUE=True + {% endif %} # Uncomment this if you are using Eddy as the probe AND the homing endstop [gcode_macro SET_Z_FROM_PROBE] @@ -104,10 +99,10 @@ # Uncomment this if you are using Eddy as the probe AND the homing endstop AND would like to use the beta z-offset control -#[gcode_macro Z_OFFSET_APPLY_PROBE] -#rename_existing: Z_OFFSET_APPLY_PROBE_ORIG -#gcode: -# SAVE_VARIABLE VARIABLE=nvm_offset VALUE={ printer["gcode_macro SET_GCODE_OFFSET"].runtime_offset } +[gcode_macro Z_OFFSET_APPLY_PROBE] +rename_existing: Z_OFFSET_APPLY_PROBE_ORIG +gcode: + SAVE_VARIABLE VARIABLE=nvm_offset VALUE={ printer["gcode_macro SET_GCODE_OFFSET"].runtime_offset } diff --git a/config/filament_sensors.cfg b/config/filament_sensors.cfg index aeb2afc..d5c02dc 100644 --- a/config/filament_sensors.cfg +++ b/config/filament_sensors.cfg @@ -75,7 +75,11 @@ {% endif %} # run the loop to retract until the switch is no longer pressed - M83 # relative extruder moves + CLEAN_NOZZLE + # mini purge to ensure filament remains connected + _CLIENT_LINEAR_MOVE E=10 F={60*20} + _CLIENT_LINEAR_MOVE E=-30 F={60*30} + UPDATE_DELAYED_GCODE ID=LOOP_UNPRIME_FILAMENT DURATION=0.15 # retract filament until the button is no longer pressed {% endif %} @@ -149,21 +153,14 @@ SET_GCODE_VARIABLE MACRO=END_LOAD_FILAMENT VARIABLE=prime VALUE={prime} {% if not filament_state in ['unloaded'] %} - # check if there is a valid value for the currently loaded filament. if not, prompt the user for it. - {% if not svv.filament_extruder in printer.filaments.presets|map(attribute='name',default='yeet') %} - # if there isn't a set loaded filament, run QUERY_FILAMENT - QUERY_FILAMENT RETURN_MACRO=LOAD_FILAMENT - - {% else %} - # forward the filament name to the next macro - SET_GCODE_VARIABLE MACRO=END_LOAD_FILAMENT VARIABLE=name VALUE="'{params.NAME}'" - # we could set it here, but it avoids weird states if the macro fails for some reason. - - SET_FILAMENT_LOAD_STATE STATE="processing" - M83 # relative extruder moves - # load filament into extruder gear - UPDATE_DELAYED_GCODE ID=LOOP_LOAD_FILAMENT DURATION=0.15 - {% endif %} + # forward the filament name to the next macro + SET_GCODE_VARIABLE MACRO=END_LOAD_FILAMENT VARIABLE=name VALUE="'{params.NAME}'" + # we could set it here, but it avoids weird states if the macro fails for some reason. + + SET_FILAMENT_LOAD_STATE STATE="processing" + M83 # relative extruder moves + # load filament into extruder gear + UPDATE_DELAYED_GCODE ID=LOOP_LOAD_FILAMENT DURATION=0.15 {% else %} {action_respond_info("unable to load filament. Current filament state: %s " %(svv.filament_load_state))} {% endif %} @@ -184,9 +181,17 @@ variable_prime = False variable_name = None gcode: + {% set svv = printer.save_variables.variables %} M82 # absolute extruder moves # set loaded filament SET_FILAMENT_LOAD_STATE STATE="loaded" + + # check if there is a valid value for the currently loaded filament. if not, prompt the user for it. + {% if not svv.filament_extruder in printer.filaments.presets|map(attribute='name',default='yeet') %} + # if there isn't a set loaded filament, extrude a bit then run QUERY_FILAMENT + G0 E4 F{20*60} + QUERY_FILAMENT RETURN_MACRO=LOAD_FILAMENT + {% endif %} {% if prime %} PRIME_FILAMENT @@ -198,18 +203,42 @@ gcode: {% set svv = printer.save_variables.variables %} - {% if svv.filament_load_state in ['unloaded', 'loaded'] %} + {% if svv.filament_load_state in ['unloaded', 'loaded', 'primed'] %} # check if there is a valid value for the currently loaded filament. if not, prompt the user for it. {% if not svv.filament_extruder in printer.filaments.presets|map(attribute='name',default='yeet') %} # if there isn't a set loaded filament, run QUERY_FILAMENT QUERY_FILAMENT RETURN_MACRO=PRIME_FILAMENT + {% elif svv.filament_load_state in ['unloaded'] %} LOAD_FILAMENT PRIME=True - {% elif svv.filament_load_state in ['loaded'] %} - # perform filament priming.... + {% elif svv.filament_load_state in ['loaded', 'primed'] %} + # ensure that the filament in the hotend is the same as the filament in the extruder + {% if svv.filament_extruder == svv.filament_hotend %} + # wait for temperature to be set + SET_HOTEND_TO_FILAMENT WAIT=True + # move to purge bucket + # z hop slightly + _CLIENT_LINEAR_MOVE Z=5 F={60*30} + # move to correct xy position + _CLIENT_LINEAR_MOVE Y=258 X=230 F={60*500} ABSOLUTE=1 + # z down + _CLIENT_LINEAR_MOVE Z=-1.5 F={60*30} ABSOLUTE=1 + + {% if svv.filament_load_state in ['loaded'] %} + _CLIENT_LINEAR_MOVE E=25 F={60*20} + {% endif %} + _CLIENT_LINEAR_MOVE E=10 F={60*10} + _CLIENT_LINEAR_MOVE E=-2 F={60*10} + + CLEAN_NOZZLE + + SET_FILAMENT_LOAD_STATE STATE=primed + {% else %} + {action_respond_info("unable to prime filament. Filament in hotend doesn't match current filament")} + {% endif %} {% endif %} {% else %} - {action_respond_info("unable to prime filament. Current filament state: %s " %(svv.filament_load_state))} + {action_respond_info("unable to prime filament. Current filament state: %s " % (svv.filament_load_state))} {% endif %} [gcode_macro PURGE_FILAMENT] @@ -222,50 +251,84 @@ {% elif svv.filament_load_state in ["loaded", "primed"] %} # if the filament is loaded or primed, then continue - ##SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend, - ## svv.filament_extruder])|map(attribute="extruder",default='None')|max|string)} MODE=auto; set extruder temp - #set extruder temp to max of the filament temperatures in the hotend or extruder to purge correctly - # todo - # move to / extend purge bucket - ; TODO + SET_HOTEND_TO_FILAMENT WAIT=True POSITION=both + # move to purge bucket + + # z hop slightly + _CLIENT_LINEAR_MOVE Z=5 F={60*30} + # move to correct xy position + _CLIENT_LINEAR_MOVE Y=258 X=230 F={60*500} ABSOLUTE=1 + # z down + _CLIENT_LINEAR_MOVE Z=-1.5 F={60*30} ABSOLUTE=1 + + _CLIENT_LINEAR_MOVE E=25 F={60*20} + _CLIENT_LINEAR_MOVE E=50 F={60*10} + _CLIENT_LINEAR_MOVE E=-2 F={60*10} + + CLEAN_NOZZLE + + SET_FILAMENT_LOAD_STATE STATE=primed + SET_HOTEND_FILAMENT NAME=svv.filament_extruder + SET_FILAMENT_LOAD_STATE STATE=primed {% else %} {action_respond_info("unable to purge filament. Current filament state: %s " %(svv.filament_load_state))} {% endif %} [gcode_macro CLEAN_NOZZLE] +# for now assumes no print on the bed gcode: + # z hop slightly + _CLIENT_LINEAR_MOVE Z=5 F={60*30} + # move to correct xy position + _CLIENT_LINEAR_MOVE Y=258 X=230 F={60*500} ABSOLUTE=1 + # z down + _CLIENT_LINEAR_MOVE Z=-1.5 F={60*30} ABSOLUTE=1 + # wipe a few times + {% for x in range(2) %} + _CLIENT_LINEAR_MOVE X=-55 F={60*700} + _CLIENT_LINEAR_MOVE X=55 F={60*700} + {% endfor %} + + # set z up again + _CLIENT_LINEAR_MOVE Z=10 F={60*30} ABSOLUTE=1 + [gcode_button bowden_sensor] pin: PF2 press_gcode: {% set svv = printer.save_variables.variables %} { action_respond_info("bowden_load") } #DEBUG - SET_FILAMENT_SENSOR SENSOR=bowden_encoder_sensor ENABLE=0 + # TODO - USER LOAD FILAMENT. Setup some sort of response? Maybe wake printer from sleep mode and turn on lights? # can't switch back frgom near runout as the extruder can't grab further filament release_gcode: {% set svv = printer.save_variables.variables %} - {% if svv.filament_load_state == 'loaded_ready'%} + {% if svv.filament_load_state in ['primed', 'loaded'] %} {action_raise_error("Warning: bowden sensor released, nearing filament runout")} # disable the encoder sensor - SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 # TODO IMPLEMENT MORE WARNINGS. {% elif svv.filament_load_state != 'unloaded' %} {action_raise_error("Warning: bowden sensor released during nonsensical filament state.")} {% endif %} - [filament_motion_sensor bowden_encoder_sensor] detection_length: 10 extruder: extruder switch_pin: ^PF3 -pause_on_runout: True +pause_on_runout: False insert_gcode: runout_gcode: - + # if the printer is both printing, and the bowden sensor is pressed, then pause print. + {% if (printer["gcode_button bowden_sensor"].state == "PRESSED") and + printer['print_stats'].state == "printing" %} + PAUSE + {% endif %} + # check if the bowden sensor is pressed + + [gcode_button extruder_entry] pin: printHead:PB7 press_gcode: diff --git a/config/macros.cfg b/config/macros.cfg index b9e76dd..fecfe69 100644 --- a/config/macros.cfg +++ b/config/macros.cfg @@ -24,6 +24,7 @@ {% if svv.extruder_state == 'hot' %} {% if svv.extruder_temperature - extruder_leeway_temp <= printer.extruder.temperature %} { action_respond_info("re-enabling extruder after printer shutoff") } + SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.extruder_temperature} MODE=override {% else %} { action_respond_info("extruder was enabled before last shutoff. State updated to cold.") } SAVE_VARIABLE VARIABLE=extruder_state VALUE='"cold"' @@ -37,6 +38,7 @@ {% if svv.bed_temperature - bed_leeway_temp <= printer.heater_bed.temperature %} { action_respond_info("re-enabling bed after printer shutoff") } + SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={svv.bed_temperature} MODE=override {% else %} { action_respond_info("bed was enabled before last shutoff. State updated to cold.") } SAVE_VARIABLE VARIABLE=bed_state VALUE='"cold"' @@ -69,7 +71,7 @@ # loaded {% elif entry_sense and exit_sense and bowden_sense %} - {% if svv.filament_load_state != "loaded" %} + {% if svv.filament_load_state not in ["loaded", "primed"] %} { action_respond_info("Current filament state does not match filament state on last boot. Was " ~ (svv.filament_load_state|string) ~ "") } {% endif %} SET_FILAMENT_LOAD_STATE STATE="loaded" @@ -144,15 +146,15 @@ gcode: {% set svv = printer.save_variables.variables %} # check the state of the loaded filament - {% if svv.filament_state in ["loaded", "primed"] and svv.filament_runout_state != "runout" %} + {% if svv.filament_load_state in ["loaded", "primed"] and svv.filament_runout_state != "runout" %} # if in auto, set bed and extruder to loaded filament parameters. {% if svv.heater_mode == "auto" %} - #SET_BED_TO_FILAMENT - #SET_HOTEND_TO_FILAMENT POSITION=both + SET_BED_TO_FILAMENT + SET_HOTEND_TO_FILAMENT POSITION=both # if in slicer or manual mode, quickly sanity check the set temperatures: {% else %} - {% if printer['extruder'].target != 0 %} + {% if printer['extruder'].target <= 0 %} {action_raise_error("Extruder temperature is set to at or below zero")} {% endif %} {% endif %} @@ -160,9 +162,6 @@ # check calibration CALIBRATE SKIP_MESH=True - # enable the encoder filament sensor - SET_FILAMENT_SENSOR SENSOR=bowden_encoder_sensor ENABLE=1 - {% if svv.filament_extruder == svv.filament_hotend %} PRIME_FILAMENT {% else %} @@ -173,11 +172,18 @@ {action_raise_error("Error, filament in runout state")} {% else %} - {action_raise_error("Error, filament not loaded. Filament is %s" %(svv.filament_state))} + {action_raise_error("Error, filament not loaded. Filament is %s" % (svv.filament_state))} {% endif %} # final enable of heaters and wait for temperature to be reached SET_HEATERS_TO_FILAMENT_AND_WAIT + + CALIBRATE + + CLEAN_NOZZLE + + # enable the encoder filament sensor + SET_FILAMENT_SENSOR SENSOR=bowden_encoder_sensor ENABLE=1 [gcode_macro stop_print] @@ -205,6 +211,8 @@ rename_existing: PAUSE_MAINSAIL gcode: # Parameters + {% set svv = printer.save_variables.variables %} + {% set z = params.Z|default(10)|int %} ; z hop amount #{% set idle_timeout = client.idle_timeout|default({60*5}) %} {% set idle_timeout = 60*5 %} @@ -219,14 +227,16 @@ SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=btemp VALUE={printer['heater_bed'].target} SAVE_GCODE_STATE NAME=PAUSE - + PAUSE_MAINSAIL # set a new idle_timeout value SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} # {client.user_pause_macro|default("")} - - # reduce temperature of extruder by 10c to reduce oozing - SET_HEATER_TEMPERATURE HEATER=extruder TARGET={printer['extruder'].target - 10} MODE=auto + + # reduce temperature of extruder by 10c to reduce oozing if extruder is enabled + {% if svv.extruder_state == 'hot' %} + SET_HEATER_TEMPERATURE HEATER=extruder TARGET={printer['extruder'].target - 10} MODE=auto + {% endif %} {% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max G91 ; relative positioning @@ -288,6 +298,7 @@ G1 Z{zhop * -1} F900 ; lower Z back down without priming (just in case we are testing the macro with cold hotend) {% endif %} RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60 ; restore position + RESUME_MAINSAIL {% endif %} [gcode_macro CANCEL_PRINT] @@ -297,7 +308,7 @@ SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value CLEAR_PAUSE - PRINT_END + CANCEL_PRINT_MAINSAIL # reduce temperature of extruder by 10c to reduce oozing SET_HEATER_TEMPERATURE HEATER=extruder TARGET={printer['extruder'].target - 10} MODE=auto @@ -320,6 +331,8 @@ [gcode_macro SET_HEATERS_TO_FILAMENT_AND_WAIT] description: gcode: + {% set svv = printer.save_variables.variables %} + SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "equalto", svv.filament_hotend)|map(attribute="extruder",default='None')|first|string} MODE=auto SET_HEATER_TEMPERATURE_AND_WAIT HEATER=heater_bed TARGET={svv.filaments|selectattr("name", "equalto", svv.filament_hotend)|map(attribute="bed",default='None')|first|string} MODE=auto SET_HEATER_TEMPERATURE_AND_WAIT HEATER=extruder TARGET={svv.filaments|selectattr("name", "equalto", svv.filament_hotend)|map(attribute="extruder",default='None')|first|string} MODE=auto @@ -327,25 +340,40 @@ [gcode_macro SET_HOTEND_TO_FILAMENT] description: sets the temperature of the hotend to the temperature required by the stored filament gcode: + {% set wait = params.WAIT|default(False) %} ; z hop amount + {% set svv = printer.save_variables.variables %} + {% set position = params.POSITION|default('extruder')|string|lower %} - {% if position == 'extruder' %} - SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_extruder])|map(attribute="extruder",default='None')|max|string} MODE=auto - {% elif position == 'hotend' %} - SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend])|map(attribute="extruder",default='None')|max|string} MODE=auto - {% elif position == 'both' %} - SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend, svv.filament_extruder])|map(attribute="extruder",default='None')|max|string} MODE=auto + {% if wait %} + {% if position == 'extruder' %} + SET_HEATER_TEMPERATURE_AND_WAIT HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_extruder])|map(attribute="extruder",default='None')|max|string} MODE=auto + {% elif position == 'hotend' %} + SET_HEATER_TEMPERATURE_AND_WAIT HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend])|map(attribute="extruder",default='None')|max|string} MODE=auto + {% elif position == 'both' %} + SET_HEATER_TEMPERATURE_AND_WAIT HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend, svv.filament_extruder])|map(attribute="extruder",default='None')|max|string} MODE=auto + {% endif %} + {% else %} + {% if position == 'extruder' %} + SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_extruder])|map(attribute="extruder",default='None')|max|string} MODE=auto + {% elif position == 'hotend' %} + SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend])|map(attribute="extruder",default='None')|max|string} MODE=auto + {% elif position == 'both' %} + SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend, svv.filament_extruder])|map(attribute="extruder",default='None')|max|string} MODE=auto + {% endif %} {% endif %} [gcode_macro SET_BED_TO_FILAMENT] description: sets the temperature of the bed to the temperature required by the stored filament gcode: + {% set svv = printer.save_variables.variables %} + {% set position = params.POSITION|default('extruder')|string|lower %} {% if position == 'extruder' %} - SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_extruder])|map(attribute="bed",default='None')|max|string} MODE=auto + SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={svv.filaments|selectattr("name", "in", [svv.filament_extruder])|map(attribute="bed",default='None')|max|string} MODE=auto {% elif position == 'hotend' %} - SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend])|map(attribute="bed",default='None')|max|string} MODE=auto + SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend])|map(attribute="bed",default='None')|max|string} MODE=auto {% elif position == 'both' %} - SET_HEATER_TEMPERATURE HEATER=extruder TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend, svv.filament_extruder])|map(attribute="bed",default='None')|max|string} MODE=auto + SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={svv.filaments|selectattr("name", "in", [svv.filament_hotend, svv.filament_extruder])|map(attribute="bed",default='None')|max|string} MODE=auto {% endif %} ## MISC MACROS diff --git a/config/overrides.cfg b/config/overrides.cfg index c6c85f3..c10e71f 100644 --- a/config/overrides.cfg +++ b/config/overrides.cfg @@ -3,24 +3,23 @@ [exclude_object] -# [idle_timeout] -# gcode: -# ACTION_RESPON -# SAVE_VARIABLE VARIABLE=heater_state VALUE='"Cold"' -# TURN_OFF_HEATERS -# UPDATE_DELAYED_GCODE ID=FULL_IDLE DURATION=3600 -# timeout: 600 -# # Idle time (in seconds) to wait before running the above G-Code -# # commands. The default is 600 seconds. +[idle_timeout] +gcode: + + TURN_OFF_HEATERS + UPDATE_DELAYED_GCODE ID=FULL_IDLE DURATION=3600 +timeout: 600 +# Idle time (in seconds) to wait before running the above G-Code +# commands. The default is 600 seconds. -# [delayed_gcode FULL_IDLE] -# gcode: -# {% if printer.idle_timeout.state == "Idle" %} -# TURN_OFF_HEATERS -# M84 -# SAVE_VARIABLE VARIABLE=heater_state VALUE='"Cold"' -# SET_GCODE_VARIABLE MACRO=VARIABLES VARIABLE=calibrate VALUE='"none"' -# {% endif %} +[delayed_gcode FULL_IDLE] +gcode: + {% if printer.idle_timeout.state == "Idle" %} + TURN_OFF_HEATERS + M84 + SAVE_VARIABLE VARIABLE=heater_state VALUE='"Cold"' + SET_GCODE_VARIABLE MACRO=VARIABLES VARIABLE=calibrate VALUE='"none"' + {% endif %} # replace homing [gcode_macro G28] diff --git a/printer.cfg b/printer.cfg index cf27d64..0c20472 100644 --- a/printer.cfg +++ b/printer.cfg @@ -37,18 +37,19 @@ ## <---------------------- Motors ----------------------> -# Motor8 +# Motor6 # A motor [tmc2209 stepper_y] -uart_pin: PC6 -diag_pin: -run_current: 2 -#stealthchop_threshold: 999999 +uart_pin: PG10 +diag_pin: PC15 +run_current: 1.6 +driver_SGTHRS: 255 + [stepper_y] # A Stepper -step_pin: PC7 -dir_pin: PC8 -enable_pin: !PD2 +step_pin: PG9 +dir_pin: PD7 +enable_pin: !PG11 microsteps: 16 rotation_distance: 40 # 80 steps per mm - 1.8 deg - 1/16 microstepping @@ -59,16 +60,23 @@ homing_speed: 100 homing_retract_dist: 5 -# Motor7 +# [gcode_button stepper_y] +# pin: tmc2209_stepper_y:virtual_endstop +# press_gcode: +# {action_respond_info ("stepper_y reports steps lost")} + +# Motor5 # B motor [tmc2209 stepper_x] -uart_pin: PD5 -run_current: 2 -#stealthchop_threshold: 999999 +uart_pin: PG14 +diag_pin: PF0 +run_current: 1.6 +driver_SGTHRS: 255 + [stepper_x] -step_pin: PD4 -dir_pin: PD3 -enable_pin: !PD6 +step_pin: PG13 +dir_pin: PG12 +enable_pin: !PG15 microsteps: 16 rotation_distance: 40 # 80 steps per mm - 1.8 deg - 1/16 microstepping @@ -79,6 +87,11 @@ homing_speed: 100 homing_retract_dist: 5 +# [gcode_button stepper_x] +# pin: tmc2209_stepper_x:virtual_endstop +# press_gcode: +# {action_respond_info ("stepper_x reports steps lost")} + ## <---------------------- Z STEPPERS ----------------------> [gcode_macro SET_Z_PARAMS] @@ -173,8 +186,7 @@ enable_pin: !printHead:PD2 microsteps: 16 -rotation_distance: 8.964 -# 555 steps per mm - 1.8 deg - 1/16 microstepping (Mobius2) +rotation_distance: 4.644 nozzle_diameter: 0.400 filament_diameter: 1.750 max_extrude_cross_section: 99 @@ -183,18 +195,17 @@ heater_pin: printHead:PB13 # D10 on mcu_xye max_power: 1.0 -sensor_type: PT1000 -#sensor_pin: printHead:PA3 -sensor_pin: PB0 +sensor_type: ATC Semitec 104NT-4-R025H42G +sensor_pin: printHead:PA3 smooth_time: 3.0 -control: pid -pid_Kp: 17.819 -pid_Ki: 0.935 -pid_Kd: 84.861 -min_extrude_temp: -10 -min_temp: -40 -max_temp: 320 +#control: pid +#pid_Kp: 17.819 +#pid_Ki: 0.935 +#pid_Kd: 84.861 +min_extrude_temp: 10 +min_temp: 10 +max_temp: 350 pressure_advance: 0.03 [heater_bed] @@ -204,13 +215,13 @@ sensor_pin: PB1 smooth_time: 3.0 -max_power: 0.75 -control: pid -pid_Kp: 47.690 -pid_Ki: 1.556 -pid_Kd: 365.338 -min_temp: -100 -max_temp: 130 +max_power: 1 +#control: pid +#pid_Kp: 47.690 +#pid_Ki: 1.556 +#pid_Kd: 365.338 +min_temp: 10 +max_temp: 150 [adxl345] cs_pin: printHead:PB12 @@ -284,10 +295,10 @@ # auto-calibration (with 'SHAPER_CALIBRATE' command). By default no # maximum smoothing is specified. Refer to Measuring_Resonances guide # for more details on using this feature. -move_speed: 100 +move_speed: 50 # The speed (in mm/s) to move the toolhead to and between test points # during the calibration. The default is 50. -min_freq: 160 +min_freq: 5 # Minimum frequency to test for resonances. The default is 5 Hz. max_freq: 200 # Maximum frequency to test for resonances. The default is 133.33 Hz. @@ -299,7 +310,7 @@ # the printer. However, lower values make measurements of # high-frequency resonances less precise. The default value is 75 # (mm/sec). -hz_per_sec: 2 +hz_per_sec: 1 # Determines the speed of the test. When testing all frequencies in # range [min_freq, max_freq], each second the frequency increases by # hz_per_sec. Small values make the test slow, and the large values @@ -312,36 +323,36 @@ # disables slow sweeping moves. Avoid setting it to a too small # non-zero value in order to not poison the measurements. # The default is 1.2 sec which is a good all-round choice. -# [input_shaper] -# shaper_freq_x: 47 -# # A frequency (in Hz) of the input shaper for X axis. This is -# # usually a resonance frequency of X axis that the input shaper -# # should suppress. For more complex shapers, like 2- and 3-hump EI -# # input shapers, this parameter can be set from different -# # considerations. The default value is 0, which disables input -# # shaping for X axis. -# shaper_freq_y: 51.8 -# # A frequency (in Hz) of the input shaper for Y axis. This is -# # usually a resonance frequency of Y axis that the input shaper -# # should suppress. For more complex shapers, like 2- and 3-hump EI -# # input shapers, this parameter can be set from different -# # considerations. The default value is 0, which disables input -# # shaping for Y axis. -# shaper_type: ei -# # A type of the input shaper to use for both X and Y axes. Supported -# # shapers are zv, mzv, zvd, ei, 2hump_ei, and 3hump_ei. The default -# # is mzv input shaper. -# #shaper_type_x: -# #shaper_type_y: -# # If shaper_type is not set, these two parameters can be used to -# # configure different input shapers for X and Y axes. The same -# # values are supported as for shaper_type parameter. -# #damping_ratio_x: 0.1 -# #damping_ratio_y: 0.1 -# # Damping ratios of vibrations of X and Y axes used by input shapers -# # to improve vibration suppression. Default value is 0.1 which is a -# # good all-round value for most printers. In most circumstances this -# # parameter requires no tuning and should not be changed. +[input_shaper] +shaper_freq_x: 67.2 +# A frequency (in Hz) of the input shaper for X axis. This is +# usually a resonance frequency of X axis that the input shaper +# should suppress. For more complex shapers, like 2- and 3-hump EI +# input shapers, this parameter can be set from different +# considerations. The default value is 0, which disables input +# shaping for X axis. +shaper_freq_y: 50.4 +# A frequency (in Hz) of the input shaper for Y axis. This is +# usually a resonance frequency of Y axis that the input shaper +# should suppress. For more complex shapers, like 2- and 3-hump EI +# input shapers, this parameter can be set from different +# considerations. The default value is 0, which disables input +# shaping for Y axis. +shaper_type: mzv +# A type of the input shaper to use for both X and Y axes. Supported +# shapers are zv, mzv, zvd, ei, 2hump_ei, and 3hump_ei. The default +# is mzv input shaper. +#shaper_type_x: +#shaper_type_y: +# If shaper_type is not set, these two parameters can be used to +# configure different input shapers for X and Y axes. The same +# values are supported as for shaper_type parameter. +#damping_ratio_x: 0.1 +#damping_ratio_y: 0.1 +# Damping ratios of vibrations of X and Y axes used by input shapers +# to improve vibration suppression. Default value is 0.1 which is a +# good all-round value for most printers. In most circumstances this +# parameter requires no tuning and should not be changed. #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. @@ -349,43 +360,43 @@ #*# [probe_eddy_current btt_eddy] #*# reg_drive_current = 15 #*# calibrate = -#*# 0.050000:3255467.111,0.090000:3254656.814,0.130000:3253788.008, -#*# 0.170000:3252990.251,0.210000:3252128.782,0.250000:3251356.895, -#*# 0.290000:3250508.063,0.330000:3249757.454,0.370000:3248887.928, -#*# 0.410000:3248135.471,0.450000:3247342.440,0.490000:3246606.470, -#*# 0.530000:3245821.355,0.570000:3245111.913,0.610000:3244344.145, -#*# 0.650000:3243649.260,0.690000:3242897.605,0.730000:3242229.037, -#*# 0.770000:3241471.787,0.810000:3240807.107,0.850000:3240093.794, -#*# 0.890000:3239469.697,0.930000:3238746.314,0.970000:3238134.699, -#*# 1.010000:3237447.197,1.050000:3236852.176,1.090000:3236180.000, -#*# 1.130000:3235583.458,1.170000:3234964.113,1.210000:3234377.235, -#*# 1.250000:3233763.043,1.290000:3233187.214,1.330000:3232594.823, -#*# 1.370000:3232051.830,1.410000:3231445.633,1.450000:3230954.755, -#*# 1.490000:3230393.180,1.530000:3229876.514,1.570000:3229326.537, -#*# 1.610000:3228821.007,1.650000:3228294.514,1.690000:3227849.153, -#*# 1.730000:3227302.108,1.770000:3226857.668,1.810000:3226337.031, -#*# 1.850000:3225893.968,1.890000:3225433.311,1.930000:3224969.831, -#*# 1.970000:3224508.982,2.010000:3224116.310,2.050000:3223676.950, -#*# 2.090000:3223240.900,2.130000:3222819.040,2.170000:3222414.028, -#*# 2.210000:3222026.540,2.250000:3221631.561,2.290000:3221220.395, -#*# 2.330000:3220878.385,2.370000:3220500.836,2.410000:3220133.289, -#*# 2.450000:3219712.852,2.490000:3219384.426,2.530000:3219020.614, -#*# 2.570000:3218700.648,2.610000:3218328.645,2.650000:3218005.363, -#*# 2.690000:3217675.452,2.730000:3217356.936,2.770000:3217022.363, -#*# 2.810000:3216715.926,2.850000:3216411.896,2.890000:3216124.629, -#*# 2.930000:3215806.315,2.970000:3215517.625,3.010000:3215223.021, -#*# 3.050000:3214948.252,3.090000:3214666.294,3.130000:3214412.867, -#*# 3.170000:3214128.343,3.210000:3213859.368,3.250000:3213586.975, -#*# 3.290000:3213343.926,3.330000:3213117.185,3.370000:3212836.145, -#*# 3.410000:3212602.835,3.450000:3212373.308,3.490000:3212102.939, -#*# 3.530000:3211895.758,3.570000:3211654.635,3.610000:3211432.972, -#*# 3.650000:3211201.284,3.690000:3210989.952,3.730000:3210775.334, -#*# 3.770000:3210556.110,3.810000:3210360.495,3.850000:3210160.520, -#*# 3.890000:3209951.581,3.930000:3209748.502,3.970000:3209535.904, -#*# 4.010000:3209340.125,4.050000:3209153.735 +#*# 0.050000:3254840.950,0.090000:3254038.247,0.130000:3253184.005, +#*# 0.170000:3252355.401,0.210000:3251503.546,0.250000:3250639.388, +#*# 0.290000:3249851.346,0.330000:3249025.785,0.370000:3248238.400, +#*# 0.410000:3247411.413,0.450000:3246660.458,0.490000:3245913.457, +#*# 0.530000:3245110.676,0.570000:3244364.628,0.610000:3243645.827, +#*# 0.650000:3242903.698,0.690000:3242174.651,0.730000:3241445.326, +#*# 0.770000:3240729.701,0.810000:3240035.623,0.850000:3239363.358, +#*# 0.890000:3238647.103,0.930000:3238003.069,0.970000:3237315.659, +#*# 1.010000:3236687.632,1.050000:3236011.661,1.090000:3235376.959, +#*# 1.130000:3234755.870,1.170000:3234154.855,1.210000:3233519.906, +#*# 1.250000:3232913.198,1.290000:3232330.803,1.330000:3231753.779, +#*# 1.370000:3231167.235,1.410000:3230605.143,1.450000:3230029.933, +#*# 1.490000:3229521.827,1.530000:3228961.641,1.570000:3228445.910, +#*# 1.610000:3227893.857,1.650000:3227396.802,1.690000:3226856.513, +#*# 1.730000:3226393.601,1.770000:3225918.199,1.810000:3225438.664, +#*# 1.850000:3224948.550,1.890000:3224475.487,1.930000:3224019.298, +#*# 1.970000:3223564.196,2.010000:3223141.342,2.050000:3222704.656, +#*# 2.090000:3222236.810,2.130000:3221837.792,2.170000:3221454.804, +#*# 2.210000:3221034.143,2.250000:3220625.848,2.290000:3220239.739, +#*# 2.330000:3219841.161,2.370000:3219455.689,2.410000:3219085.904, +#*# 2.450000:3218742.889,2.490000:3218354.527,2.530000:3218022.797, +#*# 2.570000:3217652.881,2.610000:3217319.394,2.650000:3216962.677, +#*# 2.690000:3216642.925,2.730000:3216302.130,2.770000:3215984.868, +#*# 2.810000:3215673.145,2.850000:3215376.179,2.890000:3215055.630, +#*# 2.930000:3214770.110,2.970000:3214462.507,3.010000:3214205.486, +#*# 3.050000:3213889.934,3.090000:3213601.833,3.130000:3213320.754, +#*# 3.170000:3213065.155,3.210000:3212768.131,3.250000:3212538.956, +#*# 3.290000:3212261.986,3.330000:3212017.981,3.370000:3211760.096, +#*# 3.410000:3211519.768,3.450000:3211266.290,3.490000:3211039.665, +#*# 3.530000:3210784.911,3.570000:3210564.365,3.610000:3210310.151, +#*# 3.650000:3210119.879,3.690000:3209885.936,3.730000:3209680.667, +#*# 3.770000:3209449.736,3.810000:3209260.451,3.850000:3209028.158, +#*# 3.890000:3208839.791,3.930000:3208634.539,3.970000:3208450.930, +#*# 4.010000:3208275.037,4.050000:3208066.648 #*# #*# [temperature_probe btt_eddy] -#*# calibration_temp = 34.741757 +#*# calibration_temp = 37.563538 #*# drift_calibration = #*# 3272333.682265, -526.989413, 2.607138 #*# 3258251.109151, -387.159505, 1.632471 @@ -423,3 +434,15 @@ #*# max_x = 238.86 #*# min_y = 22.0 #*# max_y = 238.92 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 35.130 +#*# pid_ki = 3.496 +#*# pid_kd = 88.264 +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 55.009 +#*# pid_ki = 1.890 +#*# pid_kd = 400.192