diff --git a/macros.cfg b/macros.cfg new file mode 100644 index 0000000..68e9fd0 --- /dev/null +++ b/macros.cfg @@ -0,0 +1,451 @@ +# 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. + +##### +# CONFIGURATION VARIABLES +##### + +[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_preheat_extruder: True +variable_calibrate_bed_mesh: True +variable_nozzle_priming: "primeblob" +variable_start_print_park_in: "back" +variable_start_print_park_z_height: 50 +variable_end_print_park_in: "back" +variable_pause_print_park_in: "back" +variable_macro_travel_speed: 150 +gcode: + ECHO_RATOS_VARS + +##### +# GENERAL MACROS +##### + +[gcode_macro MAYBE_HOME] +description: Only home unhomed axis +gcode: + {% 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 %} + +[gcode_macro PAUSE] +description: Pauses the printer +rename_existing: PAUSE_BASE +variable_extrude: 1.5 +gcode: + SAVE_GCODE_STATE NAME=PAUSE_state + # Define park positions + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + {% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %} + # Calculate safe Z position + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + PAUSE_BASE + G91 + # Retract + {% if printer.extruder.can_extrude|lower == 'true' %} + G1 E-{E} F2100 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + # Move to park position + {% if "xyz" in printer.toolhead.homed_axes %} + G1 Z{z_safe} F900 + _PARK LOCATION={printer["gcode_macro RatOS"].pause_print_park_in} X={printer["gcode_macro RatOS"].pause_print_park_x} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro RESUME] +description: Resumes the print if the printer is paused. +rename_existing: RESUME_BASE +gcode: + {% set E = printer["gcode_macro PAUSE"].extrude|float %} + # Prime + {% if printer.extruder.can_extrude|lower == 'true' %} + G91 + G1 E{E} F2100 + G90 + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 + RESUME_BASE + +[gcode_macro CANCEL_PRINT] +description: Cancels the printer +rename_existing: CANCEL_PRINT_BASE +gcode: + END_PRINT + TURN_OFF_HEATERS + CLEAR_PAUSE + #SDCARD_RESET_FILE + CANCEL_PRINT_BASE + +[gcode_macro PRIME_LINE] +description: Prints a primeline, used internally, if configured, as part of the START_PRINT macro. +gcode: + SAVE_GCODE_STATE NAME=prime_line_state + {% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %} + # Absolute positioning + G90 + # Absolute extrusion + M82 + M117 Priming nozzle with prime line.. + RESPOND MSG="Priming nozzle with prime line.." + # Lift 5 mm + G1 Z5 F3000 + # Move to prime area + G1 X{printer.toolhead.axis_minimum.x + 5} Y{printer.toolhead.axis_minimum.y + 10} F{speed} + # Get ready to prime + G1 Z0.3 F3000 + # Reset extrusion distance + G92 E0 + # Prime nozzle + G1 Y{printer.toolhead.axis_minimum.y + 80} E16 F1200 + # Wipe + G1 Y{printer.toolhead.axis_minimum.y + 100} F{speed} + RESTORE_GCODE_STATE NAME=prime_line_state + +[gcode_macro PRIME_BLOB] +description: Prints a primeblob, used internally, if configured, as part of the START_PRINT macro. Slower than PRIME_LINE but much more effective. +gcode: + SAVE_GCODE_STATE NAME=prime_blob_state + M117 Priming nozzle with prime blob.. + RESPOND MSG="Priming nozzle with prime blob.." + {% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %} + # Absolute positioning + G90 + # Relative extrusion + M83 + # Lift 5 mm + G1 Z5 F3000 + # move to blob position + G1 X{printer.toolhead.axis_minimum.x + 5} Y{printer.toolhead.axis_minimum.y + 10} Z0.5 F{speed} + # Extrude a blob + G1 F60 E20 + # 40% fan + M106 S102 + # Move the extruder up by 5mm while extruding, breaks away from blob + G1 Z5 F100 E5 + # Move to wipe position, but keep extruding so the wipe is attached to blob + G1 F200 Y{printer.toolhead.axis_minimum.y + 25} E1 + # Go down diagonally while extruding + # Broken down in z moves under 2mm as a workaround for a tuning tower test. + # The tuning tower command thinks a new print has been started when z moves over 2mm and aborts. + G1 F200 Y{printer.toolhead.axis_minimum.y + 30} Z3.8 E0.5 + G1 F200 Y{printer.toolhead.axis_minimum.y + 35} Z2.6 E0.5 + G1 F200 Y{printer.toolhead.axis_minimum.y + 40} Z1.4 E0.5 + G1 F200 Y{printer.toolhead.axis_minimum.y + 45} Z0.2 E0.5 + # 0% fan + M106 S0 + # small wipe line + G1 F200 Y{printer.toolhead.axis_minimum.y +50} Z0.2 E0.6 + # Break away wipe + G1 F{speed} Y{printer.toolhead.axis_minimum.y + 100} + RESTORE_GCODE_STATE NAME=prime_blob_state + + +[gcode_macro _PARK] +gcode: + {% set speed = printer["gcode_macro RatOS"].macro_travel_speed|float * 60 %} + # Get X position + {% if params.X != '' %} + {% if params.X|float >= printer.toolhead.axis_minimum.x + 5 and params.X|float <= printer.toolhead.axis_maximum.x - 5 %} + {% set safe_x = params.X|float %} + {% else %} + {action_respond_info('The requested X co-ordinate is outside the defined axis bounds - using defaults')} + {% set safe_x = printer.toolhead.axis_maximum.x / 2 %} + {% endif %} + {% else %} + {% set safe_x = printer.toolhead.axis_maximum.x / 2 %} + {% endif %} + # Get Y position + {% if params.LOCATION|default('back')|lower == 'back' %} + {% set y = printer.toolhead.axis_maximum.y - 5 %} + {% elif params.LOCATION|lower == 'front' %} + {% set y = printer.toolhead.axis_minimum.y + 5 %} + {% elif params.LOCATION|lower == 'center' %} + {% set y = printer.toolhead.axis_maximum.y / 2 %} + {% endif %} + # Absolute positioning + G90 + # Park + G0 X{safe_x} Y{y} F{speed} + +##### +# COLOR CHANGE +##### +[gcode_macro M600] +description: Executes a color change by pausing the printer an unloading the filament. +gcode: + PAUSE + UNLOAD_FILAMENT + M117 Please load new filament and resume + RESPOND MSG="Please load new filament and resume" + +##### +# 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 %} + M117 Unloading filament... + # 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-130 F300 + 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' %} + M117 Heating... + M104 S{params.TEMP|default(220, true)} + TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)} + {% endif %} + M117 Loading filament... + # Load the filament into the hotend area. + G0 E100 F600 + # Wait a secod + G4 P1000 + # Purge + G0 E40 F100 + # Wait for purge to complete + M400e + 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: + SET_KINEMATIC_POSITION X={printer.toolhead.axis_maximum.x / 2} Y={printer.toolhead.axis_maximum.y / 2} Z={printer.toolhead.axis_maximum.z / 2} + +##### +# 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 + SAVE_GCODE_STATE NAME=start_print_state + # Metric values + G21 + # Absolute positioning + G90 + # Set extruder to absolute mode + M82 + # Home if needed + MAYBE_HOME + 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 customizable "AFTER_HEATING_BED" macro. + _START_PRINT_AFTER_HEATING_BED + # Run the customizable "BED_MESH" macro + _START_PRINT_BED_MESH + # Start heating extruder + M104 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) } + # Run the customizable "PARK" macro + _START_PRINT_PARK + # Wait for extruder to heat up + M109 S{params.EXTRUDER_TEMP|default(printer.extruder.target, true) } + # 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 _START_PRINT_AFTER_HEATING_BED] +gcode: + {% if printer["gcode_macro RatOS"].preheat_extruder|lower == 'true' %} + M117 Pre-heating extruder... + RESPOND MSG="Pre-heating extruder..." + # Wait for extruder to reach 150 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 S150 + TEMPERATURE_WAIT SENSOR=extruder MINIMUM=150 + {% endif %} + +[gcode_macro _START_PRINT_BED_MESH] +gcode: + {% if printer["gcode_macro RatOS"].calibrate_bed_mesh|lower == 'true' %} + BED_MESH_CALIBRATE PROFILE=ratos + {% endif %} + BED_MESH_PROFILE LOAD=ratos + +[gcode_macro _START_PRINT_PARK] +gcode: + {% set z = printer["gcode_macro RatOS"].start_print_park_z_height|float %} + _PARK LOCATION={printer["gcode_macro RatOS"].start_print_park_in} X={printer["gcode_macro RatOS"].start_print_park_x} + G0 Z{z} F6000 + +[gcode_macro _START_PRINT_AFTER_HEATING_EXTRUDER] +gcode: + {% 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 printer["gcode_macro RatOS"].skew_profile is defined %} + SKEW_PROFILE LOAD={printer["gcode_macro RatOS"].skew_profile} + {% endif %} + +##### +# 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 + _END_PRINT_BEFORE_HEATERS_OFF + TURN_OFF_HEATERS + _END_PRINT_AFTER_HEATERS_OFF + _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 + M117 Done :) + RESPOND MSG="Done :)" + 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 _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 %} + {% if act_z < (max_z - 2.0) %} + {% set z_safe = 2.0 %} + {% 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 + +[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} diff --git a/printer.cfg b/printer.cfg index f5507e8..1f8f294 100644 --- a/printer.cfg +++ b/printer.cfg @@ -13,12 +13,114 @@ ### CONTROL BOARD ### Pick the board you have installed and wired in your printer. ############################################################################################################# -[include config/boards/btt-octopus-11/config.cfg] +# not all aliases are set yet, but diag pins my be usefull in future (i.e detecting skipped steps on extruder) +[board_pins octopus_11_tmc2209] +aliases: +# steppers + x_step_pin=PF13, x_dir_pin=PF12, x_enable_pin=PF14, x_uart_pin=PC4, x_diag_pin=PG6, x_endstop_pin=PG6, + y_step_pin=PG0, y_dir_pin=PG1, y_enable_pin=PF15, y_uart_pin=PD11, y_diag_pin=PG9, y_endstop_pin=PG9, + z0_step_pin=PC13, z0_dir_pin=PF0, z0_enable_pin=PF1, z0_uart_pin=PE4, z0_diag_pin=null, + z1_step_pin=PE2, z1_dir_pin=PE3, z1_enable_pin=PD4, z1_uart_pin=PE1, z1_diag_pin=null, + z2_step_pin=PE6, z2_dir_pin=PA14, z2_enable_pin=PE0, z2_uart_pin=PD3, z2_diag_pin=null, + e_step_pin=PF11, e_dir_pin=PG3, e_enable_pin=PG5, e_uart_pin=PC6, e_diag_pin=null, e_heater_pin=PA2, e_sensor_pin=PF4, +# accel + adxl345_cs_pin=PA15, +# auto leveling + bltouch_sensor_pin=PB7, bltouch_control_pin=PB6, + probe_pin=PB7, +# fans + fan_part_cooling_pin=PA8, + fan_toolhead_cooling_pin=PE5, + fan_controller_board_pin=PD12, +# Bed heater + heater_bed_heating_pin=PA1, + heater_bed_sensor_pin=PF3, + +## Expansion ports + # EXP1 header + EXP1_1=PE8, EXP1_3=PE9, EXP1_5=PE12, EXP1_7=PE14, EXP1_9=, + EXP1_2=PE7, EXP1_4=PE10, EXP1_6=PE13, EXP1_8=PE15, EXP1_10=<5V>, + # EXP2 header + EXP2_1=PA6, EXP2_3=PB1, EXP2_5=PB2, EXP2_7=PC15, EXP2_9=, + EXP2_2=PA5, EXP2_4=PA4, EXP2_6=PA7, EXP2_8=, EXP2_10=PC5, + # Pins EXP2_1, EXP2_6, EXP2_2 are also MISO, MOSI, SCK of bus "spi2" + +[mcu] +baud: 250000 +serial: /dev/btt-octopus-11 + +[temperature_sensor Octopus] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[adxl345] +spi_bus: spi3 +cs_pin: adxl345_cs_pin ############################################################################################################# ### BASE SETUP ############################################################################################################# -[include config/printers/v-core-3/v-core-3.cfg] +[idle_timeout] +gcode: + {% if printer.webhooks.state|lower == 'ready' %} + {% if printer.pause_resume.is_paused|lower == 'false' %} + M117 Idle timeout reached + TURN_OFF_HEATERS + M84 + {% endif %} + {% endif %} +# 2 hour timeout +timeout: 7200 + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host + +[skew_correction] + +[input_shaper] + +[virtual_sdcard] +path: ~/gcode_files + +[display_status] + +[pause_resume] + +[force_move] +enable_force_move: True + +[respond] + +[heater_bed] +heater_pin: heater_bed_heating_pin +sensor_pin: heater_bed_sensor_pin +sensor_type: Generic 3950 +min_temp: 0 +max_temp: 120 +pwm_cycle_time: 0.02 # 50hz for european AC, to avoid flickering lights. + +[fan] +pin: fan_part_cooling_pin +shutdown_speed: 1.0 + +[heater_fan toolhead_cooling_fan] +pin: fan_toolhead_cooling_pin +fan_speed: 1 + +[controller_fan controller_fan] +pin: fan_controller_board_pin + +# These are only safeguards for first time users +# Modify printer.cfg to tune acceleration. +[printer] +kinematics: corexy +max_velocity: 300 +max_accel: 1500 +max_accel_to_decel: 750 +max_z_velocity: 15 +max_z_accel: 20 + [printer] max_velocity: 150 max_accel: 500 @@ -31,29 +133,203 @@ max_z_accel: 20 ### STEPPER MOTORS, DRIVERS & SPEED LIMITS ### Pick the drivers and stepper motors you're using. See the RatOS documentation for custom combinations. ############################################################################################################# -[include config/printers/v-core-3/steppers.cfg] +[stepper_x] +step_pin: x_step_pin +dir_pin: x_dir_pin +enable_pin: !x_enable_pin +rotation_distance: 40 +microsteps: 64 +homing_speed: 50 +homing_retract_dist: 0 + +[stepper_y] +step_pin: y_step_pin +dir_pin: y_dir_pin +enable_pin: !y_enable_pin +rotation_distance: 40 +microsteps: 64 +homing_speed: 50 +homing_retract_dist: 0 + +[stepper_z] +endstop_pin: probe:z_virtual_endstop +step_pin: z0_step_pin +dir_pin: z0_dir_pin +enable_pin: !z0_enable_pin +rotation_distance: 4 +microsteps: 64 +position_min: -5 # Needed for z-offset calibration and tilt_adjust. +homing_speed: 10 + +[stepper_z1] +step_pin: z1_step_pin +dir_pin: z1_dir_pin +enable_pin: !z1_enable_pin +rotation_distance: 4 +microsteps: 64 + +[stepper_z2] +step_pin: z2_step_pin +dir_pin: z2_dir_pin +enable_pin: !z2_enable_pin +rotation_distance: 4 +microsteps: 64 + +[extruder] +step_pin: e_step_pin +dir_pin: !e_dir_pin +enable_pin: !e_enable_pin +microsteps: 64 # UNCOOLED TMC 2209 + LDO-42STH48-2504AC -[include config/printers/v-core-3/speed-limits-basic.cfg] +[bed_mesh] +speed: 200 + +[z_tilt] +speed: 200 + +[printer] +max_velocity: 200 +max_accel: 1500 +max_accel_to_decel: 750 +max_z_velocity: 15 +max_z_accel: 30 +square_corner_velocity: 5 + +# Backwards compatibility + +[tmc2209 stepper_x] +uart_pin: x_uart_pin +run_current: 1.1 +stealthchop_threshold: 1 + +[tmc2209 stepper_y] +uart_pin: y_uart_pin +run_current: 1.1 +stealthchop_threshold: 1 + +[tmc2209 extruder] +uart_pin: e_uart_pin +run_current: 0.5 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: z0_uart_pin +run_current: 1.0 +stealthchop_threshold: 1 + +[tmc2209 stepper_z1] +uart_pin: z1_uart_pin +run_current: 1.1 +stealthchop_threshold: 1 + +[tmc2209 stepper_z2] +uart_pin: z2_uart_pin +run_current: 1.0 +stealthchop_threshold: 1 -[include config/printers/v-core-3/tmc2209.cfg] +[tmc2209 stepper_x] +uart_pin: x_uart_pin +run_current: 1.1 +stealthchop_threshold: 1 -[include config/steppers/ldo/42sth48-2504ac/2209/24v-1.1a-*.cfg] +[tmc2209 stepper_y] +uart_pin: y_uart_pin +run_current: 1.1 +stealthchop_threshold: 1 +[tmc2209 extruder] +uart_pin: e_uart_pin +run_current: 0.5 +stealthchop_threshold: 0 +[tmc2209 stepper_z] +uart_pin: z0_uart_pin +run_current: 1.0 +stealthchop_threshold: 1 + +[tmc2209 stepper_z1] +uart_pin: z1_uart_pin +run_current: 1.1 +stealthchop_threshold: 1 + +[tmc2209 stepper_z2] +uart_pin: z2_uart_pin +run_current: 1.0 +stealthchop_threshold: 1 + +[tmc2209 stepper_x] +uart_pin: x_uart_pin +run_current: 1.1 +driver_TBL: 1 +driver_TOFF: 3 +driver_HEND: 0 +driver_HSTRT: 0 + +[tmc2209 stepper_y] +uart_pin: y_uart_pin +run_current: 1.1 +driver_TBL: 1 +driver_TOFF: 3 +driver_HEND: 0 +driver_HSTRT: 0 + +[tmc2209 stepper_z] +uart_pin: z0_uart_pin +run_current: 1.1 +driver_TBL: 1 +driver_TOFF: 3 +driver_HEND: 0 +driver_HSTRT: 0 + +[tmc2209 stepper_z1] +uart_pin: z1_uart_pin +run_current: 1.1 +driver_TBL: 1 +driver_TOFF: 3 +driver_HEND: 0 +driver_HSTRT: 0 + +[tmc2209 stepper_z2] +uart_pin: z2_uart_pin +run_current: 1.1 +driver_TBL: 1 +driver_TOFF: 3 +driver_HEND: 0 +driver_HSTRT: 0 ############################################################################################################# ### HOMING ### Pick your probe and endstops ############################################################################################################# # BL Touch -[include config/z-probe/bltouch.cfg] +[bltouch] +sensor_pin: ^bltouch_sensor_pin +control_pin: bltouch_control_pin +speed: 7 +pin_move_time: 0.675 +sample_retract_dist: 10 +pin_up_reports_not_triggered: True +pin_up_touch_mode_reports_triggered: True +x_offset: -28 +y_offset: -13 # Physical endstops -[include config/printers/v-core-3/physical-endstops.cfg] +[stepper_x] +endstop_pin: x_endstop_pin +homing_retract_dist: 5.0 +[stepper_y] +endstop_pin: y_endstop_pin +homing_positive_dir: true +homing_retract_dist: 5.0 + +[safe_z_home] +home_xy_position: 150,150 +speed: 135 +z_hop: 12 ############################################################################################################# @@ -61,7 +337,41 @@ max_z_accel: 20 ### Pick your printer size ############################################################################################################# -[include config/printers/v-core-3/500.cfg] + +[stepper_x] +position_max: 500 + +[stepper_y] +position_max: 500 + +[stepper_z] +position_max: 500 + +[bed_mesh] +horizontal_move_z: 5 +mesh_min: 20,20 +mesh_max:465,460 +probe_count: 7,7 +fade_start: 1.0 +fade_end: 10.0 +mesh_pps: 2,2 +algorithm: bicubic +bicubic_tension: .2 + +[z_tilt] +z_positions: + 0,0 + 250,500 + 500,0 + +points: + 60,60 + 285,470 + 460,60 + +horizontal_move_z: 12 +retries: 10 +retry_tolerance: 0.02 ############################################################################################################# @@ -98,9 +408,27 @@ retract_length: 0.5 ############################################################################################################# ### MACROS ############################################################################################################# -[include config/macros.cfg] -[include config/shell-macros.cfg] -[include config/printers/v-core-3/macros.cfg] +[include macros.cfg] +[include shell-macros.cfg] + +# Print macros. Call these from your slicer (custom g-code). +# You can copy these to printer.cfg and modify them to your liking, or just use them as is. +# Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers +[gcode_macro _START_PRINT_AFTER_HEATING_BED] +gcode: + {% if printer["gcode_macro RatOS"].preheat_extruder|lower == 'true' %} + M117 Pre-heating extruder... + # Wait for extruder to reach 150 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 S150 + TEMPERATURE_WAIT SENSOR=extruder MINIMUM=150 + {% endif %} + M117 Adjusting for tilt... + # Adjust bed tilt + Z_TILT_ADJUST + M117 Rehoming after tilt adjustment... + # Home again as Z will have changed after tilt adjustment and bed heating. + G28 Z ############################################################################################################# @@ -111,12 +439,12 @@ retract_length: 0.5 # Use absolute extrusion mode # Set to True to use relative extrusion mode variable_relative_extrusion: False -# Wait for extruder to reach 150 so an inductive probe (if present) is at a predictable temp. +# Wait for extruder to reach 150 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. # Set to False to disable variable_preheat_extruder: True # Calibrate the bed mesh in the START_PRINT macro. -# Set to false to skip BED_MESH_CALIBRATE, it will still load the BED_MESH +# Set to false to skip BED_MESH_CALIBRATE, it will still load the BED_MESH # with the name "ratos", be sure to save your bed_mesh profile with that name. # or override the _START_PRINT_BED_MESH macro to implement your own mesh handling logic. variable_calibrate_bed_mesh: True @@ -128,7 +456,7 @@ variable_nozzle_priming: "false" variable_start_print_park_in: "back" # Height to park it when waiting for extruder to heat. variable_start_print_park_z_height: 50 -# Skew profile to load before starting the print +# Skew profile to load before starting the print # uncomment this to use your calibrated skew correction profile. #variable_skew_profile: "my_skew_profile" # Park in the back after the print has ended or was cancelled. @@ -249,7 +577,7 @@ bicubic_tension: .2 ### Enable/disable input shaper calibration ############################################################################################################# # Uncomment this next line if you have an ADXL345 connected to your control board -#[include config/printers/v-core-3/input-shaper.cfg] +#[include config/printers/v-core-3/input-shaper.cfg] # ADXL345 resonance testing configuration #[resonance_tester] diff --git a/shell-macros.cfg b/shell-macros.cfg new file mode 100644 index 0000000..005368e --- /dev/null +++ b/shell-macros.cfg @@ -0,0 +1,60 @@ +[gcode_shell_command generate_shaper_graph_x] +command: /home/pi/klipper_config/config/scripts/generate-shaper-graph-x.sh +timeout: 60. +verbose: True + +[gcode_shell_command generate_shaper_graph_y] +command: /home/pi/klipper_config/config/scripts/generate-shaper-graph-y.sh +timeout: 60. +verbose: True + +[gcode_shell_command compile_binaries] +command: /home/pi/klipper_config/config/scripts/compile-binaries.sh +timeout: 600. + +[gcode_shell_command change_hostname] +command: /home/pi/klipper_config/config/scripts/change-hostname.sh +timeout: 10. + +[gcode_macro GENERATE_SHAPER_GRAPHS] +description: Genarates input shaper resonances graphs for analysis. Uses the AXIS parameter for if you only want to do one axis at a time, (eg. GENERATE_SHAPER_GRAPHS AXIS=X) +gcode: + {% if params.AXIS is defined %} + {% if params.AXIS|lower == 'x' %} + MAYBE_HOME + TEST_RESONANCES AXIS=X + RUN_SHELL_COMMAND CMD=generate_shaper_graph_x + RESPOND MSG="Input shaper graph generated for the X axis. You'll find it in the input_shaper folder in the machine tab!" + {% elif params.AXIS|lower == 'y' %} + MAYBE_HOME + TEST_RESONANCES AXIS=Y + RUN_SHELL_COMMAND CMD=generate_shaper_graph_y + RESPOND MSG="Input shaper graph generated for the Y axis. You'll find it in the input_shaper folder in the machine tab!" + {% else %} + {action_raise_error("Unknown axis specified. Expected X or Y.")} + {% endif %} + {% else %} + MAYBE_HOME + TEST_RESONANCES AXIS=X + TEST_RESONANCES AXIS=Y + RUN_SHELL_COMMAND CMD=generate_shaper_graph_x + RUN_SHELL_COMMAND CMD=generate_shaper_graph_y + RESPOND MSG="Input shaper graphs generated for X and Y. You'll find them in the input_shaper folder in the machine tab!" + {% endif %} + +[gcode_macro COMPILE_FIRMWARE] +description: Compiles firmware with currently installed klipper version for all supported RatOS boards. Note: this may take up to 10 minutes. +gcode: + RESPOND MSG="Compiling binaries.. This can take up to 10 minutes. Please do not turn off your Raspberry Pi!" + RUN_SHELL_COMMAND CMD=compile_binaries + RESPOND MSG="Firmware binaries compiled successfully! You can find them in the firmware_binaries folder in the machine tab!" + +[gcode_macro CHANGE_HOSTNAME] +description: Change the hostname of your Raspberry Pi. +gcode: + {% if params.HOSTNAME is not defined %} + RESPOND MSG='You have to specify a new hostname with the HOSTNAME parameter. Ex: CHANGE_HOSTNAME HOSTNAME="MY_NEW_HOSTNAME"' + RESPOND MSG="Please note: RFCs mandate that a hostname's labels may contain only the ASCII letters 'a' through 'z' (case-insensitive), the digits '0' through '9', and the hyphen. Hostname labels cannot begin or end with a hyphen. No other symbols, punctuation characters, or blank spaces are permitted." + {% else %} + RUN_SHELL_COMMAND CMD=change_hostname PARAMS={params.HOSTNAME} + {% endif %}