diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..29f42c9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "idf.pythonInstallPath": "C:\\Espressif\\tools\\idf-python\\3.11.2\\python.exe" +} \ No newline at end of file diff --git a/Macros/macros_variables.cfg b/Macros/macros_variables.cfg new file mode 100644 index 0000000..9f739d3 --- /dev/null +++ b/Macros/macros_variables.cfg @@ -0,0 +1,96 @@ +[gcode_macro ECHO_RATOS_VARS] +description: Echo RatOS variables to the console. +gcode: + {% for var, value in printer["gcode_macro RatOS"].items() %} + {action_respond_info(var ~ ": " ~ value)} + {% endfor %} + +[gcode_macro RatOS] +description: RatOS variable storage macro, will echo variables to the console when run. + +# Мониторинг вентилятора термобарьера, для использования раскоментить инклуд, вентилятор toolhead_cooling_fan +#[include Macros/Scripts/fan_monitoring.cfg.var] +variable_hotend_fan_min_speed: 5000 # скорость вентилятора ниже которой начинается ор +variable_hotend_fan_pause: False # остановка принтера и выключение хотенда при срабатывание + +# Переменные для выключения выключения (пока работает плохо) +variable_power_device: "printer" # наименование павердевайса +variable_poweroff_delay: 400 # время полного выключения принтера после выключения моторов +variable_idle_delay: 200 # время до отключения моторов + +# Z-tilt для использования раскоментить инклуд, и прописать переменную +#[include Macros/Scripts/ratrig_z-tilt.cfg.var] +variable_z_tilt_enabled: False + + +# Картографер, адаптивный бедмеш, выключение стола при меше +variable_calibrate_bed_mesh: True # строим ли карту стола +variable_adaptive_mesh: True # используем адаптивный +variable_high_power_bed: False # выключение нагрева стола при меше/таче - рекомендуется на мощных столах +variable_touch_cart_enabled: True # тач картографера + +variable_awd_sync_enabled: True # awd синхронизация перед началом печати, если не засинхрено + +variable_tgbot_enabled: True # Оповещения ботом о всем +variable_beep_enabled: False # наличие пищалки в принтере +variable_orbiter_sensor_cheat: True # отключение во время печати, сенсор - Orbiter_Sensor +variable_filament_encoder_enabled: False # старое, требует переосмысления + +variable_disable_steppers_after_print: False # после печати/отмены оставляет степперы включеными, кроме экструдера + +# Настройка загрузки/выгрузки филамента +variable_filament_unload_length: 130 +variable_filament_unload_speed: 5 +variable_filament_load_length: 100 +variable_filament_load_speed: 10 +variable_filament_load_second_length: 50 +variable_filament_load_second_speed: 5 +variable_filament_retract_after_print: 2 # второй ретракт после печати, первый 1мм. + +# Прехит экструдера перед печатью +variable_preheat_extruder: True +variable_preheat_extruder_temp: 150 + +# прайминг пластика, и где расположен +variable_nozzle_priming: "primeblob" +variable_nozzle_prime_start_x: "max" # min, max or number +variable_nozzle_prime_start_y: "min" # min, max or number +variable_nozzle_prime_direction: "auto" # auto, forwards, backwards +variable_nozzle_prime_bridge_fan: 102 # 255/х *100 - скорость венлитятора + +# Места парковки, и скорости +variable_start_print_park_in: "back" +variable_start_print_park_z_height: 50 +variable_end_print_park_in: "back" +variable_end_print_park_x: 380 +variable_pause_print_park_in: "front" +variable_pause_print_park_x: 20 +variable_macro_travel_speed: 150 +variable_macro_z_speed: 15 +variable_end_print_park_z_hop: 20 + + +variable_start_print_heat_chamber_bed_temp: 115 #надо бы попробовать + +variable_probe_for_priming_result: None +variable_adaptive_prime_offset_threshold: -1.0 + +variable_relative_extrusion: False #? +variable_force_absolute_position: False # хуета какая-то + +### переменные которые не используются в макросах, видимо для крысиных модулей +# Possible values: 'sensorless' or 'endstops'. +variable_homing: "endstops" +variable_sensorless_x_current: 0.6 +variable_sensorless_y_current: 0.9 +# Possible Values: 'middle' or an absolute x coordinate +variable_safe_home_x: "middle" +# Possible Values: 'middle' or an absolute y coordinate +variable_safe_home_y: "middle" +variable_stowable_probe_stop_on_error: False #? +variable_driver_type_x: "tmc5160" +variable_driver_type_y: "tmc5160" + + +gcode: + ECHO_RATOS_VARS diff --git a/Scripts/motor_sync.cfg b/Macros/motor_sync.cfg similarity index 100% rename from Scripts/motor_sync.cfg rename to Macros/motor_sync.cfg diff --git a/Scripts/aux_fan.cfg b/Scripts/aux_fan.cfg new file mode 100644 index 0000000..fb953bb --- /dev/null +++ b/Scripts/aux_fan.cfg @@ -0,0 +1,57 @@ +[gcode_macro M106] +rename_existing: G106 +gcode: + {% if params.P is defined %} + {% if params.P|int == 2 %} + {% if params.S is defined %} + {% if params.S|int == 255 %} + {% set realspeed = 1 %} + {% else %} + {% if params.S|int == 0 %} + {% set realspeed = 0 %} + {% else %} + {% set realspeed = params.S|float/255 %} + {% endif %} + {% endif %} + {% else %} + {% set realspeed = 1 %} + {% endif %} + + SET_FAN_SPEED FAN=Aux_Fan SPEED={realspeed} + {% endif %} + {% if params.P|int == 1 %} + {% if params.S is defined %} + {% if params.S|int == 255 %} + {% set realspeed = 1 %} + {% else %} + {% if params.S|int == 0 %} + {% set realspeed = 0 %} + {% else %} + {% set realspeed = params.S|float/255 %} + {% endif %} + {% endif %} + {% else %} + {% set realspeed = 1 %} + {% endif %} + + SET_FAN_SPEED FAN=Exhaust_fan SPEED={realspeed} + {% endif %} + {% else %} + {% if params.S is defined %} + G106 S{params.S} + {% else %} + G106 S255 + {% endif %} + {% endif %} + +[gcode_macro M107] +rename_existing: G107 +gcode: + {% if params.P is defined %} + {% if params.P|int == 2 %} + SET_FAN_SPEED FAN=Aux_Fan SPEED=0 + {% endif %} + {% else %} + SET_FAN_SPEED FAN=Aux_Fan SPEED=0 + G107 + {% endif %} \ No newline at end of file diff --git a/Scripts/clear_timelapse.cfg b/Scripts/clear_timelapse.cfg new file mode 100644 index 0000000..944421d --- /dev/null +++ b/Scripts/clear_timelapse.cfg @@ -0,0 +1,13 @@ +[gcode_shell_command clear_tg_timelapse] +command: sh ../Macros/clear_timelapse.sh +timeout: 30. +verbose: True + +[gcode_macro CLEAR_TG_TIMELAPSE] +gcode: + {% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %} + RUN_SHELL_COMMAND CMD=clear_tg_timelapse + RESPOND MSG="Done :)" + {% else %} + RESPOND MSG="Не-не-не, принтер печатает" + {% endif %} diff --git a/Scripts/fan_monitor.cfg b/Scripts/fan_monitor.cfg.var similarity index 84% rename from Scripts/fan_monitor.cfg rename to Scripts/fan_monitor.cfg.var index 8e988ef..1627a0b 100644 --- a/Scripts/fan_monitor.cfg +++ b/Scripts/fan_monitor.cfg.var @@ -14,7 +14,7 @@ gcode: [gcode_macro HOTEND_FAN_CHECK] variable_he_stop_count: 0 gcode: - {% set min_rpm = 2500|float %} + {% set min_rpm = printer["gcode_macro RatOS"].hotend_fan_min_speed|float %} {% set max_consecutive_stops = 3 %} {% set rpm = printer['heater_fan toolhead_cooling_fan'].rpm|float %} {% set he_target = printer[printer.toolhead.extruder].target|float %} @@ -44,11 +44,18 @@ gcode: {% if printer['pause_resume'].is_paused|int == 0 %} M117 !!FAN STOPPAGE!! {% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %} - RESPOND PREFIX=tgnotify MSG="Вентилятор термобарьера сдох. PAUSING..." + RESPOND PREFIX=tgnotify MSG="Вентилятор термобарьера сдох." {% endif %} M118 FAN STOPPAGE DETECTED. PAUSING... - #PAUSE + {% if printer["gcode_macro RatOS"].hotend_fan_pause|lower == 'true' %} + PAUSE + SET_HEATER_TEMPERATURE HEATER=extruder TARGET=0 + {% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %} + RESPOND PREFIX=tgnotify MSG="Принтер на паузе, нагрев экструдера выключен." + {% endif %} + + {% endif %} # Turn off the hotend. # !! Don't forget to turn your hotend back on before resume. !! # -- If using this guide's pause/resume macros (in useful_macros.html), the hotend will automatically reheat on resume diff --git a/Scripts/filament.cfg b/Scripts/filament.cfg new file mode 100644 index 0000000..49df9eb --- /dev/null +++ b/Scripts/filament.cfg @@ -0,0 +1,65 @@ +##### +# FILAMENT MANAGEMENT +##### + +[gcode_macro UNLOAD_FILAMENT] +description: Unloads the filament. Note: be careful with PETG, make sure you inspect the tip of your filament before reloading to avoid jams. +gcode: + SAVE_GCODE_STATE NAME=unload_state + G91 + {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %} + M117 Heating... + # Heat up hotend to provided temp or 220 as default as that should work OK with most filaments. + M104 S{params.TEMP|default(220, true)} + TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)} + {% endif %} + {% set unload_speed = printer["gcode_macro RatOS"].filament_unload_speed|float * 60 %} + {% set unload_length = printer["gcode_macro RatOS"].filament_unload_length|float %} + M117 Unloading filament... + # Extrude a bit + G0 E10 F300 + # Extract filament to cold end area + G0 E-3 F3600 + # Wait for three seconds + G4 P3000 + # Push back the filament to smash any stringing + G0 E3 F3600 + # Extract back fast in to the cold zone + G0 E-10 F3600 + G4 P1000 + # Continue extraction slowly, allow the filament time to cool solid before it reaches the gears + G0 E-{unload_length} F{unload_speed} + M117 Filament unloaded! + RESPOND MSG="Filament unloaded! Please inspect the tip of the filament before reloading." + RESTORE_GCODE_STATE NAME=unload_state + +[gcode_macro LOAD_FILAMENT] +description: Loads new filament. Note: be careful with PETG, make sure you inspect the tip of your filament before loading to avoid jams. +gcode: + SAVE_GCODE_STATE NAME=load_state + G91 + # Heat up hotend to provided temp or 220 as default as that should work OK with most filaments. + {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %} + FORCE_MOVE STEPPER=extruder DISTANCE=15 VELOCITY=10 ACCEL=1000 + M117 Heating... + M104 S{params.TEMP|default(230, true)} + TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(230, true)} + {% endif %} + {% set load_speed = printer["gcode_macro RatOS"].filament_load_speed|float * 60 %} + {% set load_length = printer["gcode_macro RatOS"].filament_load_length|float %} + {% set load_second_speed = printer["gcode_macro RatOS"].filament_load_second_speed|float * 60 %} + {% set load_second_length = printer["gcode_macro RatOS"].filament_load_second_length|float %} + + M117 Loading filament... + # Load the filament into the hotend area. + G0 E{load_length} F{load_speed} + # Wait a secod + G4 P1000 + # Purge + G0 E{load_second_length} F{load_second_speed} + #G0 E40 F100 + # Wait for purge to complete + M400 + M117 Filament loaded! + RESPOND MSG="Filament loaded!" + RESTORE_GCODE_STATE NAME=load_state diff --git a/Scripts/homing.cfg b/Scripts/homing.cfg new file mode 100644 index 0000000..1a17259 --- /dev/null +++ b/Scripts/homing.cfg @@ -0,0 +1,65 @@ +### Homing + +[gcode_macro SET_CENTER_KINEMATIC_POSITION] +description: FOR DEBUGGING PURPOSES ONLY. Sets the internal printer kinematic state to the center of all axes regardless of actual physical position. +gcode: + RESPOND MSG="WARNING: ONLY USE SET_CENTER_KINEMATIC_POSITION FOR DEBUGGING PURPOSES. YOU'RE OVERRIDING THE INTERNAL POSITIONING STATE OF THE PRINTER. PROCEED WITH CAUTION AND DO A PROPER G28 WHEN DONE." + SET_GCODE_VARIABLE MACRO=MAYBE_HOME VARIABLE=is_kinematic_position_overriden VALUE=True + SET_KINEMATIC_POSITION X={printer.toolhead.axis_maximum.x / 2} Y={printer.toolhead.axis_maximum.y / 2} Z={printer.toolhead.axis_maximum.z / 2} + +[gcode_macro MAYBE_HOME] +description: Only home unhomed axis +variable_is_kinematic_position_overriden: False +gcode: + {% if printer["gcode_macro MAYBE_HOME"].is_kinematic_position_overriden|lower == 'true' %} + RESPOND MSG="SET_CENTER_KINEMATIC_POSITION has been abused. Homing all axes. Please refrain from using SET_CENTER_KINEMATIC_POSITION outside of debugging purposes." + G28 + SET_GCODE_VARIABLE MACRO=MAYBE_HOME VARIABLE=is_kinematic_position_overriden VALUE=False + {% else %} + {% set axes = '' %} + {% set isHomed = true %} + {% set axesToHome = '' %} + {% if params.X is defined %} + {% set axes = axes ~ 'X ' %} + {% if 'x' not in printer.toolhead.homed_axes %} + {% set isHomed = false %} + {% set axesToHome = axesToHome ~ 'X ' %} + {% endif %} + {% endif %} + {% if params.Y is defined %} + {% set axes = axes ~ 'Y ' %} + {% if 'y' not in printer.toolhead.homed_axes %} + {% set isHomed = false %} + {% set axesToHome = axesToHome ~ 'Y ' %} + {% endif %} + {% endif %} + {% if params.Z is defined %} + {% set axes = axes ~ 'Z ' %} + {% if 'z' not in printer.toolhead.homed_axes %} + {% set isHomed = false %} + {% set axesToHome = axesToHome ~ 'Z ' %} + {% endif %} + {% endif %} + {% if params.X is not defined and params.Y is not defined and params.Z is not defined %} + {% set axes = '' %} + {% if 'x' not in printer.toolhead.homed_axes %} + {% set isHomed = false %} + {% set axesToHome = axesToHome ~ 'X ' %} + {% endif %} + {% if 'y' not in printer.toolhead.homed_axes %} + {% set isHomed = false %} + {% set axesToHome = axesToHome ~ 'Y ' %} + {% endif %} + {% if 'z' not in printer.toolhead.homed_axes %} + {% set isHomed = false %} + {% set axesToHome = axesToHome ~ 'Z ' %} + {% endif %} + {% endif %} + {% if isHomed is false %} + M117 Homing {axesToHome} + RESPOND MSG="Homing {axesToHome}" + G28 {axesToHome} + {% else %} + RESPOND MSG="All requested axes already homed, skipping.." + {% endif %} + {% endif %} diff --git a/Scripts/macros.cfg b/Scripts/macros.cfg index 3fdcef0..71d43ac 100644 --- a/Scripts/macros.cfg +++ b/Scripts/macros.cfg @@ -38,6 +38,9 @@ gcode: {% if printer["gcode_macro RatOS"].beep_enabled|lower == 'true' %} beep {% endif %} + {% if printer["gcode_macro RatOS"].orbiter_sensor_cheat|lower == 'true' %} + SET_FILAMENT_SENSOR SENSOR=Orbiter_Sensor ENABLE=1 + {% endif %} [gcode_macro RESUME] @@ -53,6 +56,9 @@ gcode: {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} + {% if printer["gcode_macro RatOS"].orbiter_sensor_cheat|lower == 'true' %} + SET_FILAMENT_SENSOR SENSOR=Orbiter_Sensor ENABLE=0 + {% endif %} RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED={printer["gcode_macro RatOS"].macro_travel_speed|float} RESUME_BASE {% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %} @@ -63,16 +69,18 @@ gcode: description: Cancels the printer rename_existing: CANCEL_PRINT_BASE gcode: - END_PRINT + END_PRINT_ROUTINE TURN_OFF_HEATERS CLEAR_PAUSE #SDCARD_RESET_FILE - CANCEL_PRINT_BASE + CANCEL_PRINT_BASE + RESPOND MSG="Canceled o_O" {% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %} - RESPOND PREFIX=tgnotify MSG="Отмена печати" + RESPOND PREFIX=tgnotify MSG="Галя, у нас отмена!!" {% endif %} + [gcode_macro PRIME_LINE] description: Prints a primeline, used internally, if configured, as part of the START_PRINT macro. gcode: @@ -251,419 +259,6 @@ gcode: beep {% endif %} - -##### -# FILAMENT MANAGEMENT -##### - -[gcode_macro UNLOAD_FILAMENT] -description: Unloads the filament. Note: be careful with PETG, make sure you inspect the tip of your filament before reloading to avoid jams. -gcode: - SAVE_GCODE_STATE NAME=unload_state - G91 - {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %} - M117 Heating... - # Heat up hotend to provided temp or 220 as default as that should work OK with most filaments. - M104 S{params.TEMP|default(220, true)} - TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)} - {% endif %} - {% set unload_speed = printer["gcode_macro RatOS"].filament_unload_speed|float * 60 %} - {% set unload_length = printer["gcode_macro RatOS"].filament_unload_length|float %} - M117 Unloading filament... - # Extrude a bit - G0 E10 F300 - # Extract filament to cold end area - G0 E-5 F3600 - # Wait for three seconds - G4 P3000 - # Push back the filament to smash any stringing - G0 E5 F3600 - # Extract back fast in to the cold zone - G0 E-15 F3600 - # Continue extraction slowly, allow the filament time to cool solid before it reaches the gears - G0 E-{unload_length} F{unload_speed} - M117 Filament unloaded! - RESPOND MSG="Filament unloaded! Please inspect the tip of the filament before reloading." - RESTORE_GCODE_STATE NAME=unload_state - -[gcode_macro LOAD_FILAMENT] -description: Loads new filament. Note: be careful with PETG, make sure you inspect the tip of your filament before loading to avoid jams. -gcode: - SAVE_GCODE_STATE NAME=load_state - G91 - # Heat up hotend to provided temp or 220 as default as that should work OK with most filaments. - {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %} - FORCE_MOVE STEPPER=extruder DISTANCE=15 VELOCITY=10 ACCEL=1000 - M117 Heating... - M104 S{params.TEMP|default(230, true)} - TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(230, true)} - {% endif %} - {% set load_speed = printer["gcode_macro RatOS"].filament_load_speed|float * 60 %} - {% set load_length = printer["gcode_macro RatOS"].filament_load_length|float %} - {% set load_second_speed = printer["gcode_macro RatOS"].filament_load_second_speed|float * 60 %} - {% set load_second_length = printer["gcode_macro RatOS"].filament_load_second_length|float %} - - M117 Loading filament... - # Load the filament into the hotend area. - G0 E{load_length} F{load_speed} - # Wait a secod - G4 P1000 - # Purge - G0 E{load_second_length} F{load_second_speed} - #G0 E40 F100 - # Wait for purge to complete - M400 - M117 Filament loaded! - RESPOND MSG="Filament loaded!" - RESTORE_GCODE_STATE NAME=load_state - -[gcode_macro SET_CENTER_KINEMATIC_POSITION] -description: FOR DEBUGGING PURPOSES ONLY. Sets the internal printer kinematic state to the center of all axes regardless of actual physical position. -gcode: - RESPOND MSG="WARNING: ONLY USE SET_CENTER_KINEMATIC_POSITION FOR DEBUGGING PURPOSES. YOU'RE OVERRIDING THE INTERNAL POSITIONING STATE OF THE PRINTER. PROCEED WITH CAUTION AND DO A PROPER G28 WHEN DONE." - SET_GCODE_VARIABLE MACRO=MAYBE_HOME VARIABLE=is_kinematic_position_overriden VALUE=True - SET_KINEMATIC_POSITION X={printer.toolhead.axis_maximum.x / 2} Y={printer.toolhead.axis_maximum.y / 2} Z={printer.toolhead.axis_maximum.z / 2} - -[gcode_macro MAYBE_HOME] -description: Only home unhomed axis -variable_is_kinematic_position_overriden: False -gcode: - {% if printer["gcode_macro MAYBE_HOME"].is_kinematic_position_overriden|lower == 'true' %} - RESPOND MSG="SET_CENTER_KINEMATIC_POSITION has been abused. Homing all axes. Please refrain from using SET_CENTER_KINEMATIC_POSITION outside of debugging purposes." - G28 - SET_GCODE_VARIABLE MACRO=MAYBE_HOME VARIABLE=is_kinematic_position_overriden VALUE=False - {% else %} - {% set axes = '' %} - {% set isHomed = true %} - {% set axesToHome = '' %} - {% if params.X is defined %} - {% set axes = axes ~ 'X ' %} - {% if 'x' not in printer.toolhead.homed_axes %} - {% set isHomed = false %} - {% set axesToHome = axesToHome ~ 'X ' %} - {% endif %} - {% endif %} - {% if params.Y is defined %} - {% set axes = axes ~ 'Y ' %} - {% if 'y' not in printer.toolhead.homed_axes %} - {% set isHomed = false %} - {% set axesToHome = axesToHome ~ 'Y ' %} - {% endif %} - {% endif %} - {% if params.Z is defined %} - {% set axes = axes ~ 'Z ' %} - {% if 'z' not in printer.toolhead.homed_axes %} - {% set isHomed = false %} - {% set axesToHome = axesToHome ~ 'Z ' %} - {% endif %} - {% endif %} - {% if params.X is not defined and params.Y is not defined and params.Z is not defined %} - {% set axes = '' %} - {% if 'x' not in printer.toolhead.homed_axes %} - {% set isHomed = false %} - {% set axesToHome = axesToHome ~ 'X ' %} - {% endif %} - {% if 'y' not in printer.toolhead.homed_axes %} - {% set isHomed = false %} - {% set axesToHome = axesToHome ~ 'Y ' %} - {% endif %} - {% if 'z' not in printer.toolhead.homed_axes %} - {% set isHomed = false %} - {% set axesToHome = axesToHome ~ 'Z ' %} - {% endif %} - {% endif %} - {% if isHomed is false %} - M117 Homing {axesToHome} - RESPOND MSG="Homing {axesToHome}" - G28 {axesToHome} - {% else %} - RESPOND MSG="All requested axes already homed, skipping.." - {% endif %} - {% endif %} - - -##### -# START PRINT MACROS -# Call this from your slicer (custom g-code). -# Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers -##### - -[gcode_macro START_PRINT] -description: Start print procedure, use this in your Slicer. -gcode: - CLEAR_PAUSE - {% if printer["gcode_macro RatOS"].force_absolute_position|lower == 'true' %} - G90 - {% endif %} - SAVE_GCODE_STATE NAME=start_print_state - # Metric values - G21 - # Absolute positioning - G90 - # Set extruder to absolute mode - M82 - _USER_START_PRINT_BEFORE_HOMING - # Home if needed - MAYBE_HOME - {% if params.CHAMBER_TEMP is defined %} - _START_PRINT_HEAT_CHAMBER CHAMBER_TEMP={params.CHAMBER_TEMP} BED_TEMP={printer["gcode_macro RatOS"].start_print_heat_chamber_bed_temp} - _USER_START_PRINT_HEAT_CHAMBER CHAMBER_TEMP={params.CHAMBER_TEMP} BED_TEMP={printer["gcode_macro RatOS"].start_print_heat_chamber_bed_temp} - {% endif %} - {% if printer["gcode_macro RatOS"].awd_sync_enabled|lower == 'true' %} - M117 Motor sync... - RESPOND MSG="Motor sync..." - {% if not printer.motors_sync.applied %} - SYNC_MOTORS - {% endif %} - { endif %} - - M117 Heating bed... - RESPOND MSG="Heating bed..." - # Wait for bed to heat up - M190 S{params.BED_TEMP|default(printer.heater_bed.target, true) } - # Run the user created "AFTER_HEATING_BED" macro - _USER_START_PRINT_AFTER_HEATING_BED - # Run the customizable "AFTER_HEATING_BED" macro. - _START_PRINT_AFTER_HEATING_BED - # Run the user created "START_PRINT_BED_MESH" macro - _USER_START_PRINT_BED_MESH - # Run the customizable "BED_MESH" macro - _START_PRINT_BED_MESH X0={params.X0} X1={params.X1} Y0={params.Y0} Y1={params.Y1} - # Start heating extruder - M104 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) } - # Run the users "PARK" macro - _USER_START_PRINT_PARK - # Run the customizable "PARK" macro - _START_PRINT_PARK - # Wait for extruder to heat up - M117 Heating Extruder... - RESPOND MSG="Heating Extruder..." - M109 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) } - # Run the user created "AFTER_HEATING_EXTRUDER" macro. - _USER_START_PRINT_AFTER_HEATING_EXTRUDER - # Run the customizable "AFTER_HEATING_EXTRUDER" macro. - _START_PRINT_AFTER_HEATING_EXTRUDER - M117 Printing... - RESPOND MSG="Printing..." - RESTORE_GCODE_STATE NAME=start_print_state - # Set extrusion mode based on user configuration - {% if printer["gcode_macro RatOS"].relative_extrusion|lower == 'true' %} - M83 - {% else %} - M82 - {% endif %} - G92 E0 - -##### -# START PRINT MACRO HOOKS -# You can copy these to printer.cfg and modify them to your liking, or just use them as is. -#### - -[gcode_macro _USER_START_PRINT_BEFORE_HOMING] -gcode: - -[gcode_macro _START_PRINT_AFTER_HEATING_BED] -gcode: - {% if printer["gcode_macro RatOS"].preheat_extruder|lower == 'true' %} - {% set min_temp = printer["gcode_macro RatOS"].preheat_extruder_temp|float %} - {% set max_temp = printer["gcode_macro RatOS"].preheat_extruder_temp|float + 5 %} - M117 Pre-heating extruder... - RESPOND MSG="Pre-heating extruder..." - # Wait for extruder to reach a predefined preheat temp so an inductive probe (if present) is at a predictable temp. - # Also allows the bed heat to spread a little, and softens any plastic that might be stuck to the nozzle. - M104 S{min_temp} - TEMPERATURE_WAIT SENSOR=extruder MINIMUM={min_temp} MAXIMUM={max_temp} - {% endif %} - {% if printer["gcode_macro RatOS"].variable_z_tilt_enabled|lower == 'true' %} - {% set TARGET_TEMP = printer.heater_bed.target %} - {% if printer["gcode_macro RatOS"].variable_high_power_bed|lower == 'true' %} - M140 S0 - {% endif %} - M117 Adjusting Z tilt... - RESPOND MSG="Adjusting Z tilt..." - # Adjust bed tilt - SAVE_GCODE_STATE NAME=STATE_Z_TILT - BED_MESH_CLEAR - {% if not printer.z_tilt.applied %} - Z_TILT_ADJUST horizontal_move_z=10 retry_tolerance=1 - {% endif %} - Z_TILT_ADJUST horizontal_move_z=2 - RESTORE_GCODE_STATE NAME=STATE_Z_TILT - - M190 S{TARGET_TEMP} - - M117 Rehoming Z after Z tilt adjustment... - RESPOND MSG="Rehoming Z after Z tilt adjustment..." - # Home again as Z will have changed after tilt adjustment and bed heating. - G28 Z - {% endif %} - - -[gcode_macro _USER_START_PRINT_AFTER_HEATING_BED] -gcode: - -[gcode_macro _START_PRINT_BED_MESH] -gcode: - {% set default_profile = printer["gcode_macro RatOS"].bed_mesh_profile|default('ratos') %} - {% if printer["gcode_macro RatOS"].calibrate_bed_mesh|lower == 'true' %} - BED_MESH_CLEAR - {% set TARGET_TEMP = printer.heater_bed.target %} - {% if printer["gcode_macro RatOS"].variable_high_power_bed|lower == 'true' %} - M140 S0 - {% endif %} - {% if printer["gcode_macro RatOS"].adaptive_mesh|lower == 'true' %} - ADAPTIVE_BED_MESH FORCE_MESH=1 - {% else %} - BED_MESH_CALIBRATE PROFILE={default_profile} - BED_MESH_PROFILE LOAD={default_profile} - {% endif %} - {% if printer["gcode_macro RatOS"].touch_cart_enabled|lower == 'true' %} - CARTOGRAPHER_TOUCH ; Perform touch probe - {% endif %} - M190 S{TARGET_TEMP} - {% elif printer["gcode_macro RatOS"].bed_mesh_profile is defined %} - BED_MESH_CLEAR - BED_MESH_PROFILE LOAD={printer["gcode_macro RatOS"].bed_mesh_profile} - {% endif %} - -[gcode_macro _USER_START_PRINT_BED_MESH] -gcode: - -[gcode_macro _START_PRINT_PARK] -gcode: - {% set z = printer["gcode_macro RatOS"].start_print_park_z_height|float %} - {% set zSpeed = printer["gcode_macro RatOS"].macro_z_speed|float * 60 %} - _PARK LOCATION={printer["gcode_macro RatOS"].start_print_park_in} X={printer["gcode_macro RatOS"].start_print_park_x} - G0 Z{z} F{zSpeed} - -[gcode_macro _USER_START_PRINT_PARK] -gcode: - -[gcode_macro _START_PRINT_AFTER_HEATING_EXTRUDER] -gcode: - {% set has_offset = printer["gcode_macro RatOS"].probe_for_priming_result|float(9999.9) != 9999.9 %} - {% if has_offset %} - ADD_PRIME_PROBE_TO_OFFSET - {% endif %} - {% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeline' %} - PRIME_LINE - {% endif %} - {% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeblob' %} - PRIME_BLOB - {% endif %} - {% if has_offset %} - SUBTRACT_PRIME_PROBE_FROM_OFFSET - {% endif %} - {% if printer["gcode_macro RatOS"].skew_profile is defined %} - SKEW_PROFILE LOAD={printer["gcode_macro RatOS"].skew_profile} - {% endif %} - -[gcode_macro _USER_START_PRINT_AFTER_HEATING_EXTRUDER] -gcode: - -[gcode_macro _START_PRINT_HEAT_CHAMBER] -description: Uses the extruder sensor to wait for chamber temp. Override the _START_PRINT_HEAT_CHAMBER macro to implement heated chamber handling. -gcode: - {% if params.CHAMBER_TEMP is defined and params.BED_TEMP is defined and params.CHAMBER_TEMP|int > 0 %} - {% set z = printer["gcode_macro RatOS"].start_print_park_z_height|float %} - {% set zSpeed = printer["gcode_macro RatOS"].macro_z_speed|float * 60 %} - G0 Z{z} F{zSpeed} - M84 - M117 Heating chamber... - RESPOND MSG="Heating chamber..." - M140 S{params.BED_TEMP} - TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.CHAMBER_TEMP} - MAYBE_HOME - {% endif %} - -[gcode_macro _USER_START_PRINT_HEAT_CHAMBER] -description: Uses the extruder sensor to wait for chamber temp. Override the _START_PRINT_HEAT_CHAMBER macro to implement heated chamber handling. -gcode: - -##### -# END PRINT MACROS -# Call this from your slicer (custom g-code). -# Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers -##### - -# The end_print macro is also called from CANCEL_PRINT. -[gcode_macro END_PRINT] -description: End print procedure, use this in your Slicer. -gcode: - SAVE_GCODE_STATE NAME=end_print_state - _USER_END_PRINT_BEFORE_HEATERS_OFF - _END_PRINT_BEFORE_HEATERS_OFF - TURN_OFF_HEATERS - _USER_END_PRINT_AFTER_HEATERS_OFF - _END_PRINT_AFTER_HEATERS_OFF - _USER_END_PRINT_PARK - _END_PRINT_PARK - # Clear skew profile if any was loaded. - {% if printer["gcode_macro RatOS"].skew_profile is defined %} - SET_SKEW CLEAR=1 - {% endif %} - # Steppers off - M84 - # Part cooling fan off - M107 - # Clear bed mesh so that G28 doesn't fail. - BED_MESH_CLEAR - M117 Done :) - RESPOND MSG="Done :)" - RESTORE_GCODE_STATE NAME=end_print_state - {% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %} - RESPOND PREFIX=tgnotify MSG="Допечатато! =)" - {% endif %} - {% if printer["gcode_macro RatOS"].beep_enabled|lower == 'true' %} - beep - {% endif %} - - -##### -# END PRINT MACRO HOOKS -# You can copy these to printer.cfg and modify them to your liking, or just use them as is. -#### - -[gcode_macro _END_PRINT_BEFORE_HEATERS_OFF] -gcode: - RESPOND MSG="Cleaning up..." - - -[gcode_macro _USER_END_PRINT_BEFORE_HEATERS_OFF] -gcode: - -[gcode_macro _END_PRINT_AFTER_HEATERS_OFF] -gcode: - # Calculate safe Z position - {% set max_z = printer.toolhead.axis_maximum.z|float %} - {% set act_z = printer.toolhead.position.z|float %} - {% set z_hop = printer["gcode_macro RatOS"].end_print_park_z_hop|float %} - {% if act_z < (max_z - z_hop) %} - {% set z_safe = z_hop %} - {% else %} - {% set z_safe = max_z - act_z %} - {% endif %} - # Relative positioning - G91 - # Retract the filament a bit before lifting the nozzle. - G1 E-2 F3600 - # Move to safe Z position - G0 Z{z_safe} F3600 - # Retract filament even more - G1 E-2 F3600 - # Back to absolute positioning - G90 - -[gcode_macro _USER_END_PRINT_AFTER_HEATERS_OFF] -gcode: - -[gcode_macro _END_PRINT_PARK] -gcode: - _PARK LOCATION={printer["gcode_macro RatOS"].end_print_park_in} X={printer["gcode_macro RatOS"].end_print_park_x} - -[gcode_macro _USER_END_PRINT_PARK] -gcode: - ##### # MESH MACROS #### @@ -801,60 +396,16 @@ gcode: {% set T = params.T|default(80) %} PID_CALIBRATE HEATER=heater_bed TARGET={T} -[gcode_macro M106] -rename_existing: G106 + +[gcode_macro PSTATUS] gcode: - {% if params.P is defined %} - {% if params.P|int == 2 %} - {% if params.S is defined %} - {% if params.S|int == 255 %} - {% set realspeed = 1 %} - {% else %} - {% if params.S|int == 0 %} - {% set realspeed = 0 %} - {% else %} - {% set realspeed = params.S|float/255 %} - {% endif %} - {% endif %} - {% else %} - {% set realspeed = 1 %} - {% endif %} - - SET_FAN_SPEED FAN=Aux_Fan SPEED={realspeed} - {% endif %} - {% if params.P|int == 1 %} - {% if params.S is defined %} - {% if params.S|int == 255 %} - {% set realspeed = 1 %} - {% else %} - {% if params.S|int == 0 %} - {% set realspeed = 0 %} - {% else %} - {% set realspeed = params.S|float/255 %} - {% endif %} - {% endif %} - {% else %} - {% set realspeed = 1 %} - {% endif %} - - SET_FAN_SPEED FAN=Exhaust_fan SPEED={realspeed} - {% endif %} + {% if params.S3 %} + {% set info = printer[params.S1][params.S2][params.S3] %} + {% elif params.S2 %} + {% set info = printer[params.S1][params.S2] %} + {% elif params.S1 %} + {% set info = printer[params.S1] %} {% else %} - {% if params.S is defined %} - G106 S{params.S} - {% else %} - G106 S255 - {% endif %} + {% set info = printer.idle_timeout.state %} {% endif %} - -[gcode_macro M107] -rename_existing: G107 -gcode: - {% if params.P is defined %} - {% if params.P|int == 2 %} - SET_FAN_SPEED FAN=Aux_Fan SPEED=0 - {% endif %} - {% else %} - SET_FAN_SPEED FAN=Aux_Fan SPEED=0 - G107 - {% endif %} \ No newline at end of file + {action_respond_info(info|string)} diff --git a/Scripts/ratrig_z-tilt.cfg b/Scripts/ratrig_z-tilt.cfg.var similarity index 100% rename from Scripts/ratrig_z-tilt.cfg rename to Scripts/ratrig_z-tilt.cfg.var diff --git a/Scripts/start_stop.cfg b/Scripts/start_stop.cfg new file mode 100644 index 0000000..f68cd92 --- /dev/null +++ b/Scripts/start_stop.cfg @@ -0,0 +1,302 @@ +##### +# START PRINT MACROS +# Call this from your slicer (custom g-code). +# Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers +##### + +[gcode_macro START_PRINT] +description: Start print procedure, use this in your Slicer. +gcode: + CLEAR_PAUSE + {% if printer["gcode_macro RatOS"].force_absolute_position|lower == 'true' %} + G90 + {% endif %} + SAVE_GCODE_STATE NAME=start_print_state + # Metric values + G21 + # Absolute positioning + G90 + # Set extruder to absolute mode + M82 + _USER_START_PRINT_BEFORE_HOMING + # Home if needed + MAYBE_HOME + {% if params.CHAMBER_TEMP is defined %} + _START_PRINT_HEAT_CHAMBER CHAMBER_TEMP={params.CHAMBER_TEMP} BED_TEMP={printer["gcode_macro RatOS"].start_print_heat_chamber_bed_temp} + _USER_START_PRINT_HEAT_CHAMBER CHAMBER_TEMP={params.CHAMBER_TEMP} BED_TEMP={printer["gcode_macro RatOS"].start_print_heat_chamber_bed_temp} + {% endif %} + {% if printer["gcode_macro RatOS"].awd_sync_enabled|lower == 'true' %} + M117 Motor sync... + RESPOND MSG="Motor sync..." + {% if not printer.motors_sync.applied %} + SYNC_MOTORS + {% endif %} + { endif %} + + + + M117 Heating bed... + RESPOND MSG="Heating bed..." + # Wait for bed to heat up + M190 S{params.BED_TEMP|default(printer.heater_bed.target, true) } + # Run the user created "AFTER_HEATING_BED" macro + _USER_START_PRINT_AFTER_HEATING_BED + # Run the customizable "AFTER_HEATING_BED" macro. + _START_PRINT_AFTER_HEATING_BED + # Run the user created "START_PRINT_BED_MESH" macro + _USER_START_PRINT_BED_MESH + # Run the customizable "BED_MESH" macro + _START_PRINT_BED_MESH X0={params.X0} X1={params.X1} Y0={params.Y0} Y1={params.Y1} + # Start heating extruder + M104 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) } + # Run the users "PARK" macro + _USER_START_PRINT_PARK + # Run the customizable "PARK" macro + _START_PRINT_PARK + # Wait for extruder to heat up + M117 Heating Extruder... + RESPOND MSG="Heating Extruder..." + M109 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) } + # Run the user created "AFTER_HEATING_EXTRUDER" macro. + _USER_START_PRINT_AFTER_HEATING_EXTRUDER + # Run the customizable "AFTER_HEATING_EXTRUDER" macro. + _START_PRINT_AFTER_HEATING_EXTRUDER + M117 Printing... + RESPOND MSG="Printing..." + RESTORE_GCODE_STATE NAME=start_print_state + # Set extrusion mode based on user configuration + {% if printer["gcode_macro RatOS"].relative_extrusion|lower == 'true' %} + M83 + {% else %} + M82 + {% endif %} + G92 E0 + +##### +# START PRINT MACRO HOOKS +# You can copy these to printer.cfg and modify them to your liking, or just use them as is. +#### + +[gcode_macro _USER_START_PRINT_BEFORE_HOMING] +gcode: + {% if printer["gcode_macro RatOS"].orbiter_sensor_cheat|lower == 'true' %} + SET_FILAMENT_SENSOR SENSOR=Orbiter_Sensor ENABLE=0 + {% endif %} + +[gcode_macro _START_PRINT_AFTER_HEATING_BED] +gcode: + {% if printer["gcode_macro RatOS"].preheat_extruder|lower == 'true' %} + {% set min_temp = printer["gcode_macro RatOS"].preheat_extruder_temp|float %} + {% set max_temp = printer["gcode_macro RatOS"].preheat_extruder_temp|float + 5 %} + M117 Pre-heating extruder... + RESPOND MSG="Pre-heating extruder..." + # Wait for extruder to reach a predefined preheat temp so an inductive probe (if present) is at a predictable temp. + # Also allows the bed heat to spread a little, and softens any plastic that might be stuck to the nozzle. + M104 S{min_temp} + TEMPERATURE_WAIT SENSOR=extruder MINIMUM={min_temp} MAXIMUM={max_temp} + {% endif %} + {% if printer["gcode_macro RatOS"].variable_z_tilt_enabled|lower == 'true' %} + {% set TARGET_TEMP = printer.heater_bed.target %} + {% if printer["gcode_macro RatOS"].variable_high_power_bed|lower == 'true' %} + M140 S0 + {% endif %} + M117 Adjusting Z tilt... + RESPOND MSG="Adjusting Z tilt..." + # Adjust bed tilt + SAVE_GCODE_STATE NAME=STATE_Z_TILT + BED_MESH_CLEAR + {% if not printer.z_tilt.applied %} + Z_TILT_ADJUST horizontal_move_z=10 retry_tolerance=1 + {% endif %} + Z_TILT_ADJUST horizontal_move_z=2 + RESTORE_GCODE_STATE NAME=STATE_Z_TILT + + M190 S{TARGET_TEMP} + + M117 Rehoming Z after Z tilt adjustment... + RESPOND MSG="Rehoming Z after Z tilt adjustment..." + # Home again as Z will have changed after tilt adjustment and bed heating. + G28 Z + {% endif %} + + +[gcode_macro _USER_START_PRINT_AFTER_HEATING_BED] +gcode: + +[gcode_macro _START_PRINT_BED_MESH] +gcode: + {% set default_profile = printer["gcode_macro RatOS"].bed_mesh_profile|default('ratos') %} + {% if printer["gcode_macro RatOS"].calibrate_bed_mesh|lower == 'true' %} + BED_MESH_CLEAR + {% set TARGET_TEMP = printer.heater_bed.target %} + {% if printer["gcode_macro RatOS"].variable_high_power_bed|lower == 'true' %} + M140 S0 + {% endif %} + {% if printer["gcode_macro RatOS"].adaptive_mesh|lower == 'true' %} + ADAPTIVE_BED_MESH FORCE_MESH=1 + {% else %} + BED_MESH_CALIBRATE PROFILE={default_profile} + BED_MESH_PROFILE LOAD={default_profile} + {% endif %} + {% if printer["gcode_macro RatOS"].touch_cart_enabled|lower == 'true' %} + CARTOGRAPHER_TOUCH ; Perform touch probe + {% endif %} + M190 S{TARGET_TEMP} + {% elif printer["gcode_macro RatOS"].bed_mesh_profile is defined %} + BED_MESH_CLEAR + BED_MESH_PROFILE LOAD={printer["gcode_macro RatOS"].bed_mesh_profile} + {% endif %} + +[gcode_macro _USER_START_PRINT_BED_MESH] +gcode: + +[gcode_macro _START_PRINT_PARK] +gcode: + {% set z = printer["gcode_macro RatOS"].start_print_park_z_height|float %} + {% set zSpeed = printer["gcode_macro RatOS"].macro_z_speed|float * 60 %} + _PARK LOCATION={printer["gcode_macro RatOS"].start_print_park_in} X={printer["gcode_macro RatOS"].start_print_park_x} + G0 Z{z} F{zSpeed} + +[gcode_macro _USER_START_PRINT_PARK] +gcode: + +[gcode_macro _START_PRINT_AFTER_HEATING_EXTRUDER] +gcode: + {% set has_offset = printer["gcode_macro RatOS"].probe_for_priming_result|float(9999.9) != 9999.9 %} + {% if has_offset %} + ADD_PRIME_PROBE_TO_OFFSET + {% endif %} + {% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeline' %} + PRIME_LINE + {% endif %} + {% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeblob' %} + PRIME_BLOB + {% endif %} + {% if has_offset %} + SUBTRACT_PRIME_PROBE_FROM_OFFSET + {% endif %} + {% if printer["gcode_macro RatOS"].skew_profile is defined %} + SKEW_PROFILE LOAD={printer["gcode_macro RatOS"].skew_profile} + {% endif %} + +[gcode_macro _USER_START_PRINT_AFTER_HEATING_EXTRUDER] +gcode: + +[gcode_macro _START_PRINT_HEAT_CHAMBER] +description: Uses the extruder sensor to wait for chamber temp. Override the _START_PRINT_HEAT_CHAMBER macro to implement heated chamber handling. +gcode: + {% if params.CHAMBER_TEMP is defined and params.BED_TEMP is defined and params.CHAMBER_TEMP|int > 0 %} + {% set z = printer["gcode_macro RatOS"].start_print_park_z_height|float %} + {% set zSpeed = printer["gcode_macro RatOS"].macro_z_speed|float * 60 %} + G0 Z{z} F{zSpeed} + M84 + M117 Heating chamber... + RESPOND MSG="Heating chamber..." + M140 S{params.BED_TEMP} + TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.CHAMBER_TEMP} + MAYBE_HOME + {% endif %} + +[gcode_macro _USER_START_PRINT_HEAT_CHAMBER] +description: Uses the extruder sensor to wait for chamber temp. Override the _START_PRINT_HEAT_CHAMBER macro to implement heated chamber handling. +gcode: + +##### +# END PRINT MACROS +# Call this from your slicer (custom g-code). +# Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers +##### +# The end_print macro +[gcode_macro END_PRINT] +description: End print procedure, use this in your Slicer. +gcode: + END_PRINT_ROUTINE + M117 Done :) + RESPOND MSG="Done :)" + {% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %} + RESPOND PREFIX=tgnotify MSG="Допечатато! =)" + {% endif %} + {% if printer["gcode_macro RatOS"].beep_enabled|lower == 'true' %} + beep + {% endif %} + +[gcode_macro END_PRINT_ROUTINE] +description: End print routine procedure +gcode: + SAVE_GCODE_STATE NAME=end_print_state + _USER_END_PRINT_BEFORE_HEATERS_OFF + _END_PRINT_BEFORE_HEATERS_OFF + TURN_OFF_HEATERS + _USER_END_PRINT_AFTER_HEATERS_OFF + _END_PRINT_AFTER_HEATERS_OFF + _USER_END_PRINT_PARK + _END_PRINT_PARK + # Clear skew profile if any was loaded. + {% if printer["gcode_macro RatOS"].skew_profile is defined %} + SET_SKEW CLEAR=1 + {% endif %} + {% if printer["gcode_macro RatOS"].orbiter_sensor_cheat|lower == 'true' %} + SET_FILAMENT_SENSOR SENSOR=Orbiter_Sensor ENABLE=1 + {% endif %} + + # Steppers off + {% if printer["gcode_macro RatOS"].disable_steppers_after_print|lower == 'true' %} + M84 + {% else %} + SET_STEPPER_ENABLE STEPPER=extruder ENABLE=0 + {% endif %} + # Part cooling fan off + M107 + # Clear bed mesh so that G28 doesn't fail. + BED_MESH_CLEAR + RESTORE_GCODE_STATE NAME=end_print_state + + + +##### +# END PRINT MACRO HOOKS +# You can copy these to printer.cfg and modify them to your liking, or just use them as is. +#### + +[gcode_macro _END_PRINT_BEFORE_HEATERS_OFF] +gcode: + RESPOND MSG="Cleaning up..." + + +[gcode_macro _USER_END_PRINT_BEFORE_HEATERS_OFF] +gcode: + +[gcode_macro _END_PRINT_AFTER_HEATERS_OFF] +gcode: + # Calculate safe Z position + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% set z_hop = printer["gcode_macro RatOS"].end_print_park_z_hop|float %} + {% if act_z < (max_z - z_hop) %} + {% set z_safe = z_hop %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + # Relative positioning + G91 + # Retract the filament a bit before lifting the nozzle. + G1 E-1 F3600 + # Move to safe Z position + G0 Z{z_safe} F3600 + # Retract filament even more + G1 E-{printer["gcode_macro RatOS"].end_print_park_z_hop} F3600 + # Back to absolute positioning + G90 + +[gcode_macro _USER_END_PRINT_AFTER_HEATERS_OFF] +gcode: + {% if printer["gcode_macro RatOS"].orbiter_sensor_cheat|lower == 'true' %} + SET_FILAMENT_SENSOR SENSOR=Orbiter_Sensor ENABLE=1 + {% endif %} + +[gcode_macro _END_PRINT_PARK] +gcode: + _PARK LOCATION={printer["gcode_macro RatOS"].end_print_park_in} X={printer["gcode_macro RatOS"].end_print_park_x} + +[gcode_macro _USER_END_PRINT_PARK] +gcode: diff --git a/clear_timelapse.sh b/clear_timelapse.sh new file mode 100644 index 0000000..2aa7ab2 --- /dev/null +++ b/clear_timelapse.sh @@ -0,0 +1,4 @@ +#!/bin/sh +du -sh ~/moonraker-telegram-bot-timelapse/ | awk '{print "to be removed: " $1}' +rm -rf ~/moonraker-telegram-bot-timelapse/* +du -sh ~/moonraker-telegram-bot-timelapse/ | awk '{print "after remove: " $1}' \ No newline at end of file diff --git a/macros_variables.cfg b/macros_variables.cfg deleted file mode 100644 index ebb0b4b..0000000 --- a/macros_variables.cfg +++ /dev/null @@ -1,61 +0,0 @@ -[gcode_macro ECHO_RATOS_VARS] -description: Echo RatOS variables to the console. -gcode: - {% for var, value in printer["gcode_macro RatOS"].items() %} - {action_respond_info(var ~ ": " ~ value)} - {% endfor %} - -[gcode_macro RatOS] -description: RatOS variable storage macro, will echo variables to the console when run. -# Configuration Defaults -# This is only here to make the config backwards compatible. -# Configuration should exclusively happen in printer.cfg. -variable_relative_extrusion: False #? -variable_force_absolute_position: False # зачем оно ващпе -variable_preheat_extruder: True -variable_preheat_extruder_temp: 150 -variable_calibrate_bed_mesh: True -variable_adaptive_mesh: True -variable_nozzle_priming: "primeblob" -variable_nozzle_prime_start_x: "max" # min, max or number -variable_nozzle_prime_start_y: "min" # min, max or number -variable_nozzle_prime_direction: "auto" # auto, forwards, backwards -variable_nozzle_prime_bridge_fan: 102 # что это за попугаи -variable_filament_unload_length: 130 -variable_filament_unload_speed: 5 -variable_filament_load_length: 100 -variable_filament_load_speed: 10 -variable_filament_load_second_length: 100 -variable_filament_load_second_speed: 10 -variable_start_print_park_in: "back" -variable_start_print_park_z_height: 50 -variable_start_print_heat_chamber_bed_temp: 115 #надо бы попробовать -variable_end_print_park_in: "back" -variable_end_print_park_x: 380 -variable_pause_print_park_in: "front" -variable_pause_print_park_x: 20 -variable_macro_travel_speed: 150 -variable_macro_z_speed: 15 -variable_end_print_park_z_hop: 20 -# Possible values: 'sensorless' or 'endstops'. -variable_homing: "endstops" -variable_sensorless_x_current: 0.6 -variable_sensorless_y_current: 0.9 -# Possible Values: 'middle' or an absolute x coordinate -variable_safe_home_x: "middle" -# Possible Values: 'middle' or an absolute y coordinate -variable_safe_home_y: "middle" -variable_stowable_probe_stop_on_error: False #? -variable_driver_type_x: "tmc5160" -variable_driver_type_y: "tmc5160" -variable_high_power_bed: False -variable_z_tilt_enabled: False -variable_beep_enabled: False -variable_filament_encoder_enabled: False -variable_touch_cart_enabled: True -variable_awd_sync_enabled: True -variable_tgbot_enabled: True -variable_probe_for_priming_result: None -variable_adaptive_prime_offset_threshold: -1.0 -gcode: - ECHO_RATOS_VARS