commit f89b1a86c93e1797635170494c2ad1bad9134e70 Author: Kyle Brown Date: Sun May 14 19:57:58 2023 -0700 Tri-zero diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..773da40 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +printer-*.cfg +.theme +*.bkp diff --git a/basic_macros.cfg b/basic_macros.cfg new file mode 100644 index 0000000..d2006b6 --- /dev/null +++ b/basic_macros.cfg @@ -0,0 +1,168 @@ +[gcode_macro PRINT_START] +# Use PRINT_START for the slicer starting script - please customize for your slicer of choice +gcode: +# Parameters + {% set bedTemp = params.BED|int %} + {% set hotendTemp = params.HOTEND|int %} + {% set Z = 200 %} + + M104 S{hotendTemp|float*0.8} ; set extruder pre warm temp + M140 S{bedTemp} ; set bed temp to warm while starting up + G28 ; home after setting temps + #G1 Z20 F3000 ; move nozzle away from bed + G90 ; absolute positioning + M117 Waiting for temperatures... + TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={bedTemp} MAXIMUM={bedTemp+1} ; Wait for bed temp (within 1 degree) + BED_MESH_CALIBRATE + G1 X0 Y0 Z0.2 F20000 ; park nozzle on bed to prevent ooze + M109 S{hotendTemp} ; Set extruder to printing temperature + PURGE + +[gcode_macro PARK] +gcode: + G91 ; relative positioning + + # Get Boundaries + {% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %} + {% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %} + {% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %} + + # Check end position to determine safe direction to move + {% if printer.toolhead.position.x < (max_x - 20) %} + {% set x_safe = 20.0 %} + {% else %} + {% set x_safe = -20.0 %} + {% endif %} + + {% if printer.toolhead.position.y < (max_y - 20) %} + {% set y_safe = 20.0 %} + {% else %} + {% set y_safe = -20.0 %} + {% endif %} + + {% if printer.toolhead.position.z < (max_z - 2) %} + {% set z_safe = 2.0 %} + {% else %} + {% set z_safe = max_z - printer.toolhead.position.z %} + {% endif %} + + G0 Z{z_safe} F3600 ; move nozzle up + G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing + G90 ; absolute positioning + G0 X60 Y{max_y} F3600 ; park nozzle at rear + +[gcode_macro PRINT_END] +# Use PRINT_END for the slicer ending script - please customize for your slicer of choice +gcode: + M400 ; wait for buffer to clear + G92 E0 ; zero the extruder + G1 E-4.0 F3600 ; retract filament + PARK + SET_IDLE_TIMEOUT TIMEOUT=1800 ; restore idle timeout + TURN_OFF_HEATERS + BED_MESH_CLEAR + M107 ; turn off fan + +[gcode_macro LOAD_FILAMENT] +gcode: + {% if printer.extruder.can_extrude|lower != 'true' %} # checing for minimum extrusion temperature + # check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185) + M104 S235 T0 # set temperature and wait, 235 deg C is a good value for most of filament types. + {% endif %} + M117 Filament loading! + M118 Filament loading! + M82 #set extruder to absolute mode + G92 E0 + G4 P2000 # wait for two seconds + # check for extruder ready - hotend temperature is high enough, extrude 50mm then check temperature again. To avoid cold extrusion when filament load was started with hot hotend but temperature set to 0 + {% if printer.extruder.can_extrude|lower != 'true' %} # checing for minimum extrusion temperature + # check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185) + M118 Hotend heating! + M109 S235 T0 # set temperature and wait, 235 deg C is a good value for most of filament types. + {% endif %} + G1 E200 F300 # extrude 200mm + M400 + M117 Filament load complete! + M118 Filament load complete! + +[gcode_macro UNLOAD_FILAMENT] +gcode: + M118 Filament unloading! + M117 Filament unloading! + M82 #set extruder to absolute mode + G92 E0 + {% if printer.extruder.can_extrude|lower != 'true' %} # checing for minimum extrusion temperature + # check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185) + M118 Hotend heating! + M109 S235 T0 # set temperature and wait + {% endif %} + G1 E10 F{5*60} # extrude a little to soften tip + G0 E-5 F{60*60} # extract filament to cold end + G0 E-70 F{5*60} # continue extraction slow allow filament to be cooled enough before reaches the gears + M400 + M118 Filament unload complete! + M117 Filament unload complete! + +[gcode_macro PURGE] +gcode: + G92 E0 + M117 Purging Nozzle... + G1 X1.5 Y1 Z0.2 + G1 E10 F{10*60} ; Prepurge in place before line + G1 X1.5 Y100 E15 F{10*60} + G1 X2 Y100 F{10*60} + G1 X2 Y50 E10 F{10*60} + G92 E0 + M117 Printing... + +[gcode_macro PID_HOTEND] +gcode: + PID_CALIBRATE HEATER=extruder TARGET=260 + +[gcode_macro PID_BED] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=110 + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + TURN_OFF_HEATERS + CLEAR_PAUSE + SDCARD_RESET_FILE + BASE_CANCEL_PRINT + BED_MESH_CLEAR + SET_IDLE_TIMEOUT TIMEOUT=600 # restore idle timeout + +[gcode_macro PAUSE] +rename_existing: BASE_PAUSE +gcode: + #Edit this# + #{% set bound = params.BOUND|default(5)|int %} + #{% set X = printer.toolhead.axis_minimum.x + bound %} + #{% set Y = printer.toolhead.axis_maximum.y - bound %} + #{% set Z = bound %} + ########### + SAVE_GCODE_STATE NAME=PAUSE_state + G1 E-1.7 F2100 + PARK + BASE_PAUSE + #G91 + #G1 Z{Z} + #G90 + #G1 X{X} Y{Y} F6000 + #G91 + +[gcode_macro RESUME] +rename_existing: BASE_RESUME +gcode: + G91 + G1 E1.7 F2100 + G91 + RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 + BASE_RESUME + +[gcode_macro CALIBRATE_PROBE] +gcode: + G90 + G0 X72.4 Y38.6 + PROBE_CALIBRATE diff --git a/calibration_macros.cfg b/calibration_macros.cfg new file mode 100644 index 0000000..4e021f5 --- /dev/null +++ b/calibration_macros.cfg @@ -0,0 +1,131 @@ +[gcode_macro TEST_RESONNANCES_X] +gcode: + TEST_RESONANCES AXIS=X + + +[gcode_macro TEST_RESONNANCES_Y] +gcode: + TEST_RESONANCES AXIS=Y + + +[gcode_macro FLOW_CALIBRATION] +gcode: + M221 S{params.FLOW} + SET_PRESSURE_ADVANCE ADVANCE={params.PRESSURE_ADVANCE} + +[gcode_macro TEST_Z_DOWN] +gcode: + {% set amount = params.amount|default(1)|int %} + TESTZ Z=-{amount} + +[gcode_macro TEST_Z_UP] +gcode: + {% set amount = params.amount|default(1)|int %} + TESTZ Z=+{amount} + +[gcode_macro TEST_Z_BISECT_UP] +gcode: + TESTZ Z=+ + +[gcode_macro TEST_Z_BISECT_DOWN] +gcode: + TESTZ Z=- + +[gcode_macro PID_HOTEND] +gcode: + PID_CALIBRATE HEATER=extruder TARGET=260 + +[gcode_macro PID_BED] +gcode: + PID_CALIBRATE HEATER=heater_bed TARGET=100 + +[gcode_macro TEST_SPEED] +gcode: + # Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(1)|int %} + # Acceleration + {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} + # Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions) + {% set bound = params.BOUND|default(30)|int %} + # Size for small pattern box + {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} + + # Large pattern + # Max positions, inset by BOUND + {% set x_min = printer.toolhead.axis_minimum.x + bound %} + {% set x_max = printer.toolhead.axis_maximum.x - bound %} + {% set y_min = printer.toolhead.axis_minimum.y + bound %} + {% set y_max = printer.toolhead.axis_maximum.y - bound %} + + # Small pattern at center + # Find X/Y center point + {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} + {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} + + # Set small pattern box around center point + {% set x_center_min = x_center - (smallpatternsize/2) %} + {% set x_center_max = x_center + (smallpatternsize/2) %} + {% set y_center_min = y_center - (smallpatternsize/2) %} + {% set y_center_max = y_center + (smallpatternsize/2) %} + + # Save current gcode state (absolute/relative, etc) + SAVE_GCODE_STATE NAME=TEST_SPEED + + # Output parameters to g-code terminal + { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } + + # Home and get position for comparison later: + G28 + + # Absolute positioning + G90 + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel} + + + # Go to starting position + G0 X{x_min} Y{y_min} Z{10} F{speed*60} + + {% for i in range(iterations) %} + # Large pattern + # Diagonals + G0 X{x_min} Y{y_min} F{speed*60} + G0 X{x_max} Y{y_max} F{speed*60} + G0 X{x_min} Y{y_min} F{speed*60} + G0 X{x_max} Y{y_min} F{speed*60} + G0 X{x_min} Y{y_max} F{speed*60} + G0 X{x_max} Y{y_min} F{speed*60} + + # Box + G0 X{x_min} Y{y_min} F{speed*60} + G0 X{x_min} Y{y_max} F{speed*60} + G0 X{x_max} Y{y_max} F{speed*60} + G0 X{x_max} Y{y_min} F{speed*60} + + # Small pattern + # Small diagonals + G0 X{x_center_min} Y{y_center_min} F{speed*60} + G0 X{x_center_max} Y{y_center_max} F{speed*60} + G0 X{x_center_min} Y{y_center_min} F{speed*60} + G0 X{x_center_max} Y{y_center_min} F{speed*60} + G0 X{x_center_min} Y{y_center_max} F{speed*60} + G0 X{x_center_max} Y{y_center_min} F{speed*60} + + # Small box + {% for i in range(10) %} + G0 X{x_center_min} Y{y_center_min} F{speed*60} + G0 X{x_center_min} Y{y_center_max} F{speed*60} + G0 X{x_center_max} Y{y_center_max} F{speed*60} + G0 X{x_center_max} Y{y_center_min} F{speed*60} + {% endfor %} + {% endfor %} + + # Restore max speed/accel/accel_to_decel to their configured values + SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel} + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED diff --git a/mainsail.cfg b/mainsail.cfg new file mode 100644 index 0000000..714732e --- /dev/null +++ b/mainsail.cfg @@ -0,0 +1,6 @@ +[virtual_sdcard] +path: /home/pi/gcode_files + +[pause_resume] + +[display_status] diff --git a/menu.cfg b/menu.cfg new file mode 100644 index 0000000..5061138 --- /dev/null +++ b/menu.cfg @@ -0,0 +1,41 @@ +[menu __main __octoprint] +type: list +name: Pause Resume + +[menu __main __prepare] +type: list +name: Prepare + +[menu __main __prepare __bed_leveling] +type: list +name: Level Corners + +[menu __main __prepare __bed_leveling __preheat] +type: command +name: Preheat all +gcode: M140 S50 M104 S200 + +[menu __main __prepare __bed_leveling __home] +type: command +name: Home All +gcode: G28 + +[menu __main __prepare __bed_leveling __start] +type: command +name: Start +gcode: BED_SCREWS_ADJUST + +[menu __main __prepare __bed_leveling __accept] +type: command +name: Accept +gcode: accept + +[menu __main __prepare __bed_leveling __adjust] +type: command +name: Adjusted +gcode: adjusted + +[menu __main __prepare __bed_leveling __abort_screws] +type: command +name: Abort +gcode: abort diff --git a/moonraker.conf b/moonraker.conf new file mode 100644 index 0000000..46dad8c --- /dev/null +++ b/moonraker.conf @@ -0,0 +1,47 @@ +[server] +host: 0.0.0.0 +port: 7125 + +[file_manager] +enable_object_processing: True + +[timelapse] + +[authorization] +cors_domains: + https://my.mainsail.xyz + http://my.mainsail.xyz + http://*.local + http://*.lan + http://*.home + http://*.far +trusted_clients: + 10.0.0.0/8 + 127.0.0.0/8 + 169.254.0.0/16 + 172.16.0.0/12 + 192.168.0.0/16 + 192.168.25.0/24 + FE80::/10 + ::1/128 + +# enables partial support of Octoprint API +[octoprint_compat] + +# enables moonraker to track and store print history. +[history] + +# this enables moonraker's update manager +[update_manager] + +[update_manager mainsail] +type: web +repo: meteyou/mainsail +path: ~/mainsail + +[update_manager timelapse] +type: git_repo +primary_branch: main +path: ~/moonraker-timelapse +origin: https://github.com/mainsail-crew/moonraker-timelapse.git + diff --git a/printer.cfg b/printer.cfg new file mode 100644 index 0000000..2fa28fd --- /dev/null +++ b/printer.cfg @@ -0,0 +1,255 @@ +# This file contains common pin mappings for the BIGTREETECH SKR mini +# E3 v3.0. To use this config, the firmware should be compiled for the +# STM32G0B1 with a "8KiB bootloader" and USB communication. + +# The "make flash" command does not work on the SKR mini E3. Instead, +# after running "make", copy the generated "out/klipper.bin" file to a +# file named "firmware.bin" on an SD card and then restart the SKR +# mini E3 with that SD card. + +## *** THINGS TO CHANGE/CHECK: *** +## Fine tune E steps [extruder] section + +[include mainsail.cfg] +[include timelapse.cfg] +[include sensorless.cfg] +[include basic_macros.cfg] +[include calibration_macros.cfg] +[include tri_zero.cfg] +#[include screen.cfg] + + +[display_status] +[exclude_object] +[respond] + +[virtual_sdcard] +path: ~/sdcard + +[firmware_retraction] +retract_length: 0.4 +retract_speed: 100 +unretract_speed: 100 + + +[mcu] +serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_32002C000750414235363020-if00 + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 20000 +max_accel_to_decel: 20000 +max_z_velocity: 15 +max_z_accel: 45 +square_corner_velocity: 8 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor pi] +sensor_type: temperature_host +min_temp: 0 +max_temp: 100 + +[temperature_sensor chamber] +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PA2 +min_temp: 0 +max_temp: 100 + +##################################################################### +# X/Y Stepper Settings +##################################################################### + +[stepper_x] +step_pin: PB13 +dir_pin: PB12 +enable_pin: !PB14 +rotation_distance: 40 +microsteps: 32 +full_steps_per_rotation: 200 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_endstop: 0 +position_max: 120 +homing_speed: 50 +homing_retract_dist: 0 + +[tmc2209 stepper_x] +uart_pin: PC11 +tx_pin: PC10 +uart_address: 0 +interpolate: False +run_current: 0.9 +sense_resistor: 0.110 +stealthchop_threshold: 0 +driver_SGTHRS: 90 # 255 is most sensitive value, 0 is least sensitive +diag_pin: ^PC0 + +[stepper_y] +step_pin: PB10 +dir_pin: PB2 +enable_pin: !PB11 +rotation_distance: 40 +microsteps: 32 +full_steps_per_rotation: 200 +endstop_pin: tmc2209_stepper_y:virtual_endstop +position_endstop: 116 +position_max: 116 +homing_speed: 50 +homing_retract_dist: 0 + +[tmc2209 stepper_y] +uart_pin: PC11 +tx_pin: PC10 +uart_address: 2 +interpolate: False +run_current: 0.9 +sense_resistor: 0.110 +stealthchop_threshold: 0 +driver_SGTHRS: 100 # 255 is most sensitive value, 0 is least sensitive +diag_pin: ^PC1 + +##################################################################### +# Z Stepper Settings +##################################################################### + +#[stepper_z] +#step_pin: PB0 +#dir_pin: !PC5 +#enable_pin: !PB1 +#rotation_distance: 8 +#microsteps: 32 +#endstop_pin: probe:z_virtual_endstop +#position_max: 120 +#position_min: -15 +#homing_speed: 10 +#second_homing_speed: 3.0 +#homing_retract_dist: 8.0 + +#[tmc2209 stepper_z] +#uart_pin: PC11 +#tx_pin: PC10 +#uart_address: 1 +#interpolate: False +#run_current: 0.3 +#sense_resistor: 0.110 +#stealthchop_threshold: 999999 + +##################################################################### +# Extruder +##################################################################### + +[extruder] +step_pin: PB3 +dir_pin: PB4 +enable_pin: !PD1 +full_steps_per_rotation: 200 +rotation_distance: 22.23 +gear_ratio: 50:10 +microsteps: 32 +nozzle_diameter: 0.5 +filament_diameter: 1.750 +heater_pin: PC8 +sensor_type: Generic 3950 +sensor_pin: PA0 +control = pid +pid_kp = 27.030 +pid_ki = 1.540 +pid_kd = 118.596 +min_temp: 0 +max_temp: 320 +min_extrude_temp: 200 +max_extrude_only_distance: 300 +max_extrude_cross_section: 300 + +[tmc2209 extruder] +uart_pin: PC11 +tx_pin: PC10 +uart_address: 3 +interpolate: False +run_current: 0.4 +sense_resistor: 0.110 +stealthchop_threshold: 0 + +##################################################################### +# Bed Heater +##################################################################### + +[heater_bed] +heater_pin: PC9 +sensor_type: Generic 3950 +sensor_pin: PC4 +smooth_time: 3.0 +min_temp: 0 +max_temp: 120 +control: pid +pid_kp: 59.958 +pid_ki: 2.042 +pid_kd: 393.064 + +##################################################################### +# Fan Control +##################################################################### + +[heater_fan hotend_fan] +# PS-ON +pin: PC13 +shutdown_speed: 0 +kick_start_time: 0.1 +heater: extruder +heater_temp: 50.0 +max_power: 0.35 # Running 24v into 12v fan. Don't blow it up please! + +[fan] +# Neopixel +pin: PA8 # neopixel port +max_power: 1.0 +kick_start_time: 1 +off_below: 0.13 +cycle_time: 0.010 + + +##################################################################### +# Homing and Gantry Adjustment Routines +##################################################################### + +[idle_timeout] +timeout: 600 + +[bed_screws] +screw1: 55,9 +screw1_name: front screw +screw2: 9,108 +screw2_name: back left +screw3: 108,108 +screw3_name: back right + +[dockable_probe] +pin: ^PC2 +z_offset: 0.1 +sample_retract_dist: 4.0 +samples: 3 +dock_position: 0, 115.5, 10 +approach_position: 24, 115.5 +detach_position: 0, 24 +check_open_attach: True +dock_fixed_z: True +attach_speed: 15 +detach_speed: 15 +travel_speed: 50 +post_attach_gcode: + G0 X24 Y115.5 + +x_offset: -17.4 +y_offset: 17 +z_offset: 9.515 + +[bed_mesh] +speed: 120 +horizontal_move_z: 12 +mesh_min: 5, 17 +mesh_max: 97, 97 +probe_count: 6 diff --git a/screen.cfg b/screen.cfg new file mode 100644 index 0000000..0936537 --- /dev/null +++ b/screen.cfg @@ -0,0 +1,96 @@ +[include menu.cfg] + +[mcu menu] +serial: /dev/serial/by-id/usb-Klipper_stm32f042x6_300021001943534D34383120-if00 +restart_method: command + +[display] +lcd_type: uc1701 +kill_pin: menu:PF0 +spi_bus: spi1 +cs_pin: menu:PA4 +a0_pin: menu:PA2 +rst_pin: menu:PA3 +contrast: 63 +encoder_pins: ^menu:PA0, ^menu:PA1 +click_pin: ^!menu:PB1 + +[output_pin BEEPER_pin] +pin: menu:PF1 +pwm: True +value: 0 +shutdown_value: 0 +cycle_time: 0.001 +scale: 1000 + +[gcode_macro M300] +gcode: SET_PIN PIN=BEEPER_pin VALUE={1000} + G4 P{100} + SET_PIN PIN=BEEPER_pin VALUE=0 + + +[neopixel fysetc_mini12864] +# To control Neopixel RGB in mini12864 display +pin: menu:PA13 +chain_count: 3 +color_order: RGB +initial_RED: 0 +initial_GREEN: 0 +initial_BLUE: 0.4 + +[delayed_gcode set_displaytemp_timer] +initial_duration: 1 +gcode: + SET_LED_TEMPERATURES + UPDATE_DELAYED_GCODE ID=set_displaytemp_timer DURATION=5 + +[gcode_macro SET_LED_TEMPERATURES] +gcode: + # Make display red if any heater is above 50C + {% if printer.extruder.temperature >= 50 or printer.heater_bed.temperature >= 50 %} + SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.00 BLUE=0.00 INDEX=1 SYNC=0 + {% else %} + SET_LED LED=fysetc_mini12864 RED=0.00 GREEN=0.60 BLUE=0.60 INDEX=1 SYNC=0 + {% endif %} + + {% if printer.extruder.temperature >= 180 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.50 BLUE=0.00 INDEX=2 SYNC=0 + {% elif printer.extruder.temperature >= 160 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.40 BLUE=0.00 INDEX=2 SYNC=0 + {% elif printer.extruder.temperature >= 140 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.30 BLUE=0.00 INDEX=2 SYNC=0 + {% elif printer.extruder.temperature >= 120 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.20 BLUE=0.00 INDEX=2 SYNC=0 + {% elif printer.extruder.temperature >= 100 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.10 BLUE=0.00 INDEX=2 SYNC=0 + {% elif printer.extruder.temperature >= 80 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.00 BLUE=0.00 INDEX=2 SYNC=0 + {% elif printer.extruder.temperature >= 60 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.00 BLUE=0.33 INDEX=2 SYNC=0 + {% elif printer.extruder.temperature >= 50 %} + SET_LED LED=fysetc_mini12864 RED=0.33 GREEN=0.00 BLUE=0.66 INDEX=2 SYNC=0 + {% else %} + SET_LED LED=fysetc_mini12864 RED=0.00 GREEN=0.00 BLUE=0.00 INDEX=2 SYNC=0 + {% endif %} + + {% if printer.heater_bed.temperature >= 100 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.50 BLUE=0.00 INDEX=3 SYNC=0 + {% elif printer.heater_bed.temperature >= 90 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.40 BLUE=0.00 INDEX=3 SYNC=0 + {% elif printer.heater_bed.temperature >= 80 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.30 BLUE=0.00 INDEX=3 SYNC=0 + {% elif printer.heater_bed.temperature >= 70 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.20 BLUE=0.00 INDEX=3 SYNC=0 + {% elif printer.heater_bed.temperature >= 60 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.10 BLUE=0.00 INDEX=3 SYNC=0 + {% elif printer.heater_bed.temperature >= 50 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.00 BLUE=0.00 INDEX=3 SYNC=0 + {% elif printer.heater_bed.temperature >= 40 %} + SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.00 BLUE=0.33 INDEX=3 SYNC=0 + {% else %} + SET_LED LED=fysetc_mini12864 RED=0.00 GREEN=0.00 BLUE=0.00 INDEX=3 SYNC=0 + {% endif %} + +[menu __main __octoprint] +type: disabled + diff --git a/sensorless.cfg b/sensorless.cfg new file mode 100644 index 0000000..500a3f3 --- /dev/null +++ b/sensorless.cfg @@ -0,0 +1,79 @@ +[gcode_macro SENSORLESS_HOME_X] +gcode: + {% set HOME_CUR = 0.700 %} + {% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %} + {% set RUN_CUR = driver_config.run_current %} + # Set current for sensorless homing + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR} + # Pause to ensure driver stall flag is clear + G4 P2000 + # Home + G28 X0 + # Move away + G91 + G1 X24 F{400*60} # dodge probe + # Set current during print + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR} + G90 + +[gcode_macro SENSORLESS_HOME_Y] +gcode: + {% set HOME_CUR = 0.700 %} + {% set driver_config = printer.configfile.settings['tmc2209 stepper_y'] %} + {% set RUN_CUR = driver_config.run_current %} + # Set current for sensorless homing + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR} + # Pause to ensure driver stall flag is clear + G4 P2000 + # Home + G28 Y0 + # Move away + G91 + G1 Y-5 F{400*60} + # Set current during print + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR} + SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR} + G90 + +[gcode_macro HOME] +gcode: + G90 + # Home X + SENSORLESS_HOME_X + # Home Y + SENSORLESS_HOME_Y + # Home Z + G28 Z0 + #G1 Z{printer.toolhead.axis_minimum.z + 10} F1200 + +[homing_override] +axes: xyz +set_position_z: -1.8 + +gcode: + # Parameters + #{% set Z = 10 %} + + #G90 + #G1 Z{Z} # Z lift + + {% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %} + + {% if home_all or 'X' in params %} + SENSORLESS_HOME_X + {% endif %} + + {% if home_all or 'Y' in params %} + SENSORLESS_HOME_Y + {% endif %} + + + {% if home_all or 'Z' in params %} + SET_GCODE_OFFSET Z=0.0 # Reset offset before homing Z + G28 Z0 + G91 + {% endif %} + G90 diff --git a/timelapse.cfg b/timelapse.cfg new file mode 120000 index 0000000..982e949 --- /dev/null +++ b/timelapse.cfg @@ -0,0 +1 @@ +/home/pi/moonraker-timelapse/klipper_macro/timelapse.cfg \ No newline at end of file diff --git a/tri_zero.cfg b/tri_zero.cfg new file mode 100644 index 0000000..1204a32 --- /dev/null +++ b/tri_zero.cfg @@ -0,0 +1,78 @@ +[mcu skrPico] +serial: /dev/serial/by-id/usb-Klipper_rp2040_455035712893EF38-if00 + +[stepper_z] +step_pin: skrPico:gpio14 +dir_pin: !skrPico:gpio13 # Remove the ! before gpio28 if motor direction is inverted. +enable_pin: !skrPico:gpio15 +microsteps: 64 +rotation_distance: 80 +endstop_pin: probe:z_virtual_endstop +position_max: 110 +position_min: -3 +homing_speed: 10 +second_homing_speed: 3 +homing_retract_dist: 8 + +[tmc2209 stepper_z] +uart_pin: skrPico:gpio9 +tx_pin: skrPico:gpio8 +uart_address: 1 +interpolate: False +run_current: 0.8 +sense_resistor: 0.110 +stealthchop_threshold: 0 # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle + + +[stepper_z1] +step_pin: skrPico:gpio6 +## Refer to https://docs.vorondesign.com/build/startup/#v0 +dir_pin: skrPico:gpio5 # Check motor direction in link above. If inverted, add a ! before gpio5 +enable_pin: !skrPico:gpio7 +microsteps: 64 +rotation_distance: 40 + +[tmc2209 stepper_z1] +uart_pin: skrPico:gpio9 +tx_pin: skrPico:gpio8 +uart_address: 2 +interpolate: False +run_current: 0.8 +sense_resistor: 0.110 +stealthchop_threshold: 0 # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle + +##################################################################### +# Z Stepper Settings +##################################################################### + + +[stepper_z2] +step_pin: skrPico:gpio11 +## Refer to https://docs.vorondesign.com/build/startup/#v0 +dir_pin: skrPico:gpio10 # Check motor direction in link above. If inverted, add a ! before gpio10 +enable_pin: !skrPico:gpio12 +microsteps: 64 +rotation_distance: 40 + +[tmc2209 stepper_z2] +uart_pin: skrPico:gpio9 +tx_pin: skrPico:gpio8 +uart_address: 0 +interpolate: False +run_current: 0.8 +sense_resistor: 0.110 +stealthchop_threshold: 0 # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle + +[z_tilt] +z_positions: + -50, 0 + 60, 140 + 170, 0 +points: + 25, 0 + 80, 75 + 108, 0 +speed: 200 +horizontal_move_z: 15 +retries: 5 +retry_tolerance: 0.0075 diff --git a/webcam.txt b/webcam.txt new file mode 100644 index 0000000..e8bd44c --- /dev/null +++ b/webcam.txt @@ -0,0 +1,79 @@ +### Windows users: To edit this file use Notepad++, VSCode, Atom or SublimeText. +### Do not use Notepad or WordPad. + +### MacOSX users: If you use Textedit to edit this file make sure to use +### "plain text format" and "disable smart quotes" in "Textedit > Preferences" + +### Configure which camera to use +# +# Available options are: +# - auto: tries first usb webcam, if that's not available tries raspi cam +# - usb: only tries usb webcam +# - raspi: only tries raspi cam +# +# Defaults to auto +# +#camera="auto" + +### Additional options to supply to MJPG Streamer for the USB camera +# +# See https://faq.octoprint.org/mjpg-streamer-config for available options +# +# Defaults to a resolution of 640x480 px and a framerate of 10 fps +# +#camera_usb_options="-r 640x480 -f 10" + +### Additional webcam devices known to cause problems with -f +# +# Apparently there a some devices out there that with the current +# mjpg_streamer release do not support the -f parameter (for specifying +# the capturing framerate) and will just refuse to output an image if it +# is supplied. +# +# The webcam daemon will detect those devices by their USB Vendor and Product +# ID and remove the -f parameter from the options provided to mjpg_streamer. +# +# By default, this is done for the following devices: +# Logitech C170 (046d:082b) +# GEMBIRD (1908:2310) +# Genius F100 (0458:708c) +# Cubeternet GL-UPC822 UVC WebCam (1e4e:0102) +# +# Using the following option it is possible to add additional devices. If +# your webcam happens to show above symptoms, try determining your cam's +# vendor and product id via lsusb, activating the line below by removing # and +# adding it, e.g. for two broken cameras "aabb:ccdd" and "aabb:eeff" +# +# additional_brokenfps_usb_devices=("aabb:ccdd" "aabb:eeff") +# +# +#additional_brokenfps_usb_devices=() + +### Additional options to supply to MJPG Streamer for the RasPi Cam +# +# See https://faq.octoprint.org/mjpg-streamer-config for available options +# +# Defaults to 10fps +# +#camera_raspi_options="-fps 10" + +### Configuration of camera HTTP output +# +# Usually you should NOT need to change this at all! Only touch if you +# know what you are doing and what the parameters mean. +# +# Below settings are used in the mjpg-streamer call like this: +# +# -o "output_http.so -w $camera_http_webroot $camera_http_options" +# +# Current working directory is the mjpg-streamer base directory. +# +#camera_http_webroot="./www-mainsail" +#camera_http_options="-n" + +### EXPERIMENTAL +# Support for different streamer types. +# +# Available options: +# mjpeg [default] - stable MJPG-streamer +#camera_streamer=mjpeg