diff --git a/.moonraker.conf.bkp b/.moonraker.conf.bkp index 045fb2c..1b2a26a 100644 --- a/.moonraker.conf.bkp +++ b/.moonraker.conf.bkp @@ -52,7 +52,7 @@ install_script = tools/pkglist.sh type = git_repo origin = https://github.com/Frix-x/klippain-shaketune.git path = ~/klippain_shaketune -virtualenv = ~/klippain_shaketune-env +virtualenv = ~/klippy-env requirements = requirements.txt system_dependencies = system-dependencies.json primary_branch = main diff --git a/K-ShakeTune b/K-ShakeTune deleted file mode 120000 index d499f9b..0000000 --- a/K-ShakeTune +++ /dev/null @@ -1 +0,0 @@ -../../klippain_shaketune/K-ShakeTune \ No newline at end of file diff --git a/ShakeTune_results/belts/beltscomparison_20240701_155228.png b/ShakeTune_results/belts/beltscomparison_20240701_155228.png new file mode 100644 index 0000000..2e925d7 Binary files /dev/null and b/ShakeTune_results/belts/beltscomparison_20240701_155228.png differ diff --git a/ShakeTune_results/belts/beltscomparison_20240701_162227.png b/ShakeTune_results/belts/beltscomparison_20240701_162227.png new file mode 100644 index 0000000..6b46494 Binary files /dev/null and b/ShakeTune_results/belts/beltscomparison_20240701_162227.png differ diff --git a/ShakeTune_results/belts/beltscomparison_20240701_164800.png b/ShakeTune_results/belts/beltscomparison_20240701_164800.png new file mode 100644 index 0000000..1144768 Binary files /dev/null and b/ShakeTune_results/belts/beltscomparison_20240701_164800.png differ diff --git a/ShakeTune_results/input_shaper/inputshaper_20240625_220903_X.png b/ShakeTune_results/input_shaper/inputshaper_20240625_220903_X.png new file mode 100644 index 0000000..e9e3d75 Binary files /dev/null and b/ShakeTune_results/input_shaper/inputshaper_20240625_220903_X.png differ diff --git a/ShakeTune_results/input_shaper/inputshaper_20240625_220903_Y.png b/ShakeTune_results/input_shaper/inputshaper_20240625_220903_Y.png new file mode 100644 index 0000000..c352411 Binary files /dev/null and b/ShakeTune_results/input_shaper/inputshaper_20240625_220903_Y.png differ diff --git a/ShakeTune_results/vibrations/vibrationsprofile_20240625_221657.png b/ShakeTune_results/vibrations/vibrationsprofile_20240625_221657.png new file mode 100644 index 0000000..8efbcb2 Binary files /dev/null and b/ShakeTune_results/vibrations/vibrationsprofile_20240625_221657.png differ diff --git a/config-20240626-130349.zip b/config-20240626-130349.zip new file mode 100644 index 0000000..87a591e Binary files /dev/null and b/config-20240626-130349.zip differ diff --git a/moonraker.conf b/moonraker.conf index 9568a01..a4762cf 100644 --- a/moonraker.conf +++ b/moonraker.conf @@ -54,7 +54,7 @@ install_script: tools/pkglist.sh type: git_repo origin: https://github.com/Frix-x/klippain-shaketune.git path: ~/klippain_shaketune -virtualenv: ~/klippain_shaketune-env +virtualenv: ~/klippy-env requirements: requirements.txt system_dependencies: system-dependencies.json primary_branch: main diff --git a/printer-20240518_002441.cfg b/printer-20240518_002441.cfg new file mode 100644 index 0000000..657c884 --- /dev/null +++ b/printer-20240518_002441.cfg @@ -0,0 +1,822 @@ + +[include mainsail.cfg] +[display_status] +[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 500 +max_accel: 10000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 30 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 150 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 125 +horizontal_move_z: 10 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 125 +horizontal_move_z: 10 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 1 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 114.4 # center frequency for the X axis filter +shaper_type_x: ei # filter type for the X axis +shaper_freq_y: 59.2 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.031 # damping ratio for the X axis +damping_ratio_y: 0.039 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.100 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 16.677 +#*# pid_ki = 0.496 +#*# pid_kd = 140.084 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240518_003006.cfg b/printer-20240518_003006.cfg new file mode 100644 index 0000000..edff62a --- /dev/null +++ b/printer-20240518_003006.cfg @@ -0,0 +1,822 @@ + +[include mainsail.cfg] +[display_status] +[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 500 +max_accel: 10000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 114.4 # center frequency for the X axis filter +shaper_type_x: ei # filter type for the X axis +shaper_freq_y: 59.2 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.031 # damping ratio for the X axis +damping_ratio_y: 0.039 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.140 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 16.677 +#*# pid_ki = 0.496 +#*# pid_kd = 140.084 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240518_003016.cfg b/printer-20240518_003016.cfg new file mode 100644 index 0000000..28545ca --- /dev/null +++ b/printer-20240518_003016.cfg @@ -0,0 +1,822 @@ + +[include mainsail.cfg] +[display_status] +[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 500 +max_accel: 10000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 114.4 # center frequency for the X axis filter +shaper_type_x: ei # filter type for the X axis +shaper_freq_y: 59.2 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.031 # damping ratio for the X axis +damping_ratio_y: 0.039 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.340 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 16.677 +#*# pid_ki = 0.496 +#*# pid_kd = 140.084 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240518_103538.cfg b/printer-20240518_103538.cfg new file mode 100644 index 0000000..28545ca --- /dev/null +++ b/printer-20240518_103538.cfg @@ -0,0 +1,822 @@ + +[include mainsail.cfg] +[display_status] +[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 500 +max_accel: 10000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 114.4 # center frequency for the X axis filter +shaper_type_x: ei # filter type for the X axis +shaper_freq_y: 59.2 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.031 # damping ratio for the X axis +damping_ratio_y: 0.039 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.340 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 16.677 +#*# pid_ki = 0.496 +#*# pid_kd = 140.084 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240623_185847.cfg b/printer-20240623_185847.cfg new file mode 100644 index 0000000..8a5e1bc --- /dev/null +++ b/printer-20240623_185847.cfg @@ -0,0 +1,822 @@ + +[include mainsail.cfg] +[display_status] +[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 350 +max_accel: 4000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 114.4 # center frequency for the X axis filter +shaper_type_x: ei # filter type for the X axis +shaper_freq_y: 59.2 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.031 # damping ratio for the X axis +damping_ratio_y: 0.039 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.095 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 16.677 +#*# pid_ki = 0.496 +#*# pid_kd = 140.084 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240625_175343.cfg b/printer-20240625_175343.cfg new file mode 100644 index 0000000..387949d --- /dev/null +++ b/printer-20240625_175343.cfg @@ -0,0 +1,837 @@ + +[include mainsail.cfg] +[display_status] +#[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 350 +max_accel: 4000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 114.4 # center frequency for the X axis filter +shaper_type_x: ei # filter type for the X axis +shaper_freq_y: 59.2 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.031 # damping ratio for the X axis +damping_ratio_y: 0.039 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +[shaketune] +# result_folder: ~/printer_data/config/ShakeTune_results +# The folder where the results will be stored. It will be created if it doesn't exist. +# number_of_results_to_keep: 3 +# The number of results to keep in the result_folder. The oldest results will +# be automatically deleted after each runs. +# keep_raw_csv: False +# If True, the raw CSV files will be kept in the result_folder alongside the +# PNG graphs. If False, they will be deleted and only the graphs will be kept. +# show_macros_in_webui: True +# Mainsail and Fluidd doesn't create buttons for "system" macros that are not in the +# printer.cfg file. If you want to see the macros in the webui, set this to True. +# timeout: 300 +# The maximum time in seconds to let Shake&Tune process the CSV files and generate the graphs. + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.145 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 16.677 +#*# pid_ki = 0.496 +#*# pid_kd = 140.084 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240626_103125.cfg b/printer-20240626_103125.cfg new file mode 100644 index 0000000..eb728d4 --- /dev/null +++ b/printer-20240626_103125.cfg @@ -0,0 +1,837 @@ + +[include mainsail.cfg] +[display_status] +#[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 350 +max_accel: 4000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 116.8 # center frequency for the X axis filter +shaper_type_x: mzv # filter type for the X axis +shaper_freq_y: 56.6 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.061 # damping ratio for the X axis +damping_ratio_y: 0.038 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +[shaketune] +# result_folder: ~/printer_data/config/ShakeTune_results +# The folder where the results will be stored. It will be created if it doesn't exist. +# number_of_results_to_keep: 3 +# The number of results to keep in the result_folder. The oldest results will +# be automatically deleted after each runs. +# keep_raw_csv: False +# If True, the raw CSV files will be kept in the result_folder alongside the +# PNG graphs. If False, they will be deleted and only the graphs will be kept. +# show_macros_in_webui: True +# Mainsail and Fluidd doesn't create buttons for "system" macros that are not in the +# printer.cfg file. If you want to see the macros in the webui, set this to True. +# timeout: 300 +# The maximum time in seconds to let Shake&Tune process the CSV files and generate the graphs. + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.210 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 16.677 +#*# pid_ki = 0.496 +#*# pid_kd = 140.084 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240701_092751.cfg b/printer-20240701_092751.cfg new file mode 100644 index 0000000..16dde36 --- /dev/null +++ b/printer-20240701_092751.cfg @@ -0,0 +1,837 @@ + +[include mainsail.cfg] +[display_status] +#[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 350 +max_accel: 4000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 116.8 # center frequency for the X axis filter +shaper_type_x: mzv # filter type for the X axis +shaper_freq_y: 56.6 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.061 # damping ratio for the X axis +damping_ratio_y: 0.038 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +[shaketune] +# result_folder: ~/printer_data/config/ShakeTune_results +# The folder where the results will be stored. It will be created if it doesn't exist. +# number_of_results_to_keep: 3 +# The number of results to keep in the result_folder. The oldest results will +# be automatically deleted after each runs. +# keep_raw_csv: False +# If True, the raw CSV files will be kept in the result_folder alongside the +# PNG graphs. If False, they will be deleted and only the graphs will be kept. +# show_macros_in_webui: True +# Mainsail and Fluidd doesn't create buttons for "system" macros that are not in the +# printer.cfg file. If you want to see the macros in the webui, set this to True. +# timeout: 300 +# The maximum time in seconds to let Shake&Tune process the CSV files and generate the graphs. + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.160 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 16.677 +#*# pid_ki = 0.496 +#*# pid_kd = 140.084 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240701_093537.cfg b/printer-20240701_093537.cfg new file mode 100644 index 0000000..fdc727b --- /dev/null +++ b/printer-20240701_093537.cfg @@ -0,0 +1,837 @@ + +[include mainsail.cfg] +[display_status] +#[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 350 +max_accel: 4000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 116.8 # center frequency for the X axis filter +shaper_type_x: mzv # filter type for the X axis +shaper_freq_y: 56.6 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.061 # damping ratio for the X axis +damping_ratio_y: 0.038 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +[shaketune] +# result_folder: ~/printer_data/config/ShakeTune_results +# The folder where the results will be stored. It will be created if it doesn't exist. +# number_of_results_to_keep: 3 +# The number of results to keep in the result_folder. The oldest results will +# be automatically deleted after each runs. +# keep_raw_csv: False +# If True, the raw CSV files will be kept in the result_folder alongside the +# PNG graphs. If False, they will be deleted and only the graphs will be kept. +# show_macros_in_webui: True +# Mainsail and Fluidd doesn't create buttons for "system" macros that are not in the +# printer.cfg file. If you want to see the macros in the webui, set this to True. +# timeout: 300 +# The maximum time in seconds to let Shake&Tune process the CSV files and generate the graphs. + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 56.384 +#*# pid_ki = 2.320 +#*# pid_kd = 342.530 +#*# +#*# [bltouch] +#*# z_offset = 1.160 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 21.167 +#*# pid_ki = 0.771 +#*# pid_kd = 145.258 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer-20240701_153250.cfg b/printer-20240701_153250.cfg new file mode 100644 index 0000000..62dbf53 --- /dev/null +++ b/printer-20240701_153250.cfg @@ -0,0 +1,837 @@ + +[include mainsail.cfg] +[display_status] +#[include K-ShakeTune/*.cfg] + +### Github Backup ### + +[gcode_shell_command backup_cfg] + +command: /usr/bin/bash /home/pi/printer_data/config/autocommit.sh + +timeout: 30 + +verbose: True + + +[gcode_macro BACKUP_CFG] + +description: Backs up config directory GitHub + +gcode: + + RUN_SHELL_COMMAND CMD=backup_cfg + +# Enable arcs support +[gcode_arcs] +resolution: 1 + +### MCU ### + +[mcu] +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_33002C000F47313337303439-if00 +#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3C001E000F47323137363638-if00 +serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2C0032001850324239333220-if00 + +[mcu EBBCan] +#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 +canbus_uuid: 11ad927c6dea + +### Virtual SD Card ### + +[virtual_sdcard] +path: /home/pi/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +### Printer ### + +[printer] +kinematics: corexy +max_velocity: 350 +max_accel: 4000 +max_z_velocity: 100 +max_z_accel: 1200 + +### Steppers ### + +[stepper_x] +step_pin: PE9 +dir_pin: PF1 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: EBBCan: PB6 +position_endstop: 0 +position_max: 298 +homing_speed: 50 + +[stepper_y] +step_pin: PE11 +dir_pin: PE8 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test +endstop_pin: PE12 +position_endstop: 0 +position_max: 295 +homing_speed: 50 + +[stepper_z] +step_pin: PE13 +dir_pin: PC2 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 32 +endstop_pin: probe:z_virtual_endstop +position_min: -5 +position_max: 385 +homing_speed: 50 +second_homing_speed: 5 + +[stepper_z1] +step_pin: PE14 +dir_pin: PA0 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[stepper_z2] +step_pin: PD15 +dir_pin: PE7 +enable_pin: !PA3 +microsteps: 16 +rotation_distance: 32 +#endstop_pin: probe:z_virtual_endstop +#position_min: -5 +#position_max: 385 + +[extruder] +step_pin: EBBCan: PD0 +dir_pin: !EBBCan: PD1 +enable_pin: !EBBCan: PD2 +microsteps: 16 +rotation_distance: 3.43 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: EBBCan: PB13 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: EBBCan: PA3 +#control: pid +#pid_Kp: 14.747 +#pid_Ki: 0.660 +#pid_Kd: 82.402 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section: 250 +max_extrude_only_distance: 250 + + +### TMC2209 ### + +[tmc2209 stepper_x] +uart_pin: PC13 +#tx_pin: PE4 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_y] +uart_pin: PE3 +#tx_pin: PE2 +#uart_address: 0 +run_current: 1.100 +hold_current: 0.600 +stealthchop_threshold: 0 + +[tmc2209 stepper_z] +uart_pin: PE1 +#tx_pin: PE0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z1] +uart_pin: PD4 +#tx_pin: PD2 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 stepper_z2] +uart_pin: PD1 +#tx_pin: PD0 +#uart_address: 0 +run_current: 0.850 +hold_current: 0.600 +stealthchop_threshold: 99999 + +[tmc2209 extruder] +uart_pin: EBBCan: PA15 +run_current: 0.850 +stealthchop_threshold: 99999 + +### TMC Autotune ### + +[autotune_tmc stepper_x] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_y] +motor: zyltech-17hd48002h-22b + +[autotune_tmc stepper_z] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z1] +motor: zyltech-17hd48002h-22b +[autotune_tmc stepper_z2] +motor: zyltech-17hd48002h-22b + +[autotune_tmc extruder] +motor: dfh-14mcrn-1848 + +### Fan's ### + +[fan] +pin: EBBCan: PA0 + +[heater_fan hotend_fan] +pin: EBBCan: PA1 +heater: extruder +heater_temp: 50.0 + +### BLTouch ### + +[bltouch] +sensor_pin: ^EBBCan:PB8 +control_pin: EBBCan:PB9 +#z_offset: 2.600 +stow_on_each_sample: false +probe_with_touch_mode: true +x_offset: 0 +y_offset: -34 +speed: 10 +lift_speed: 10 +samples: 2 +#sample_retract_distance: 10 +samples_tolerance_retries: 4 + +### Filament Sensor ### + +[filament_switch_sensor switch_sensor] +switch_pin: EBBCan:PB4 +pause_on_runout: false +runout_gcode: PAUSE + +[filament_motion_sensor motion_sensor] +switch_pin: ^EBBCan:PB3 +detection_length: 3.0 +extruder: extruder +pause_on_runout: false +runout_gcode: PAUSE + +### Z Safe Home ### + +[safe_z_home] +home_xy_position: 150, 185 +speed: 200 +#z_hop: 10 +#z_hop_speed: 20 + +### Z Tilt ### + +[z_tilt] +z_positions: 0, 25 + 300, 25 + 150, 300 +points: 10, 50 + 280, 50 + 150, 295 +speed: 200 +horizontal_move_z: 6 +retries: 8 +retry_tolerance: 0.01 + +### Bed Mesh ### + +[bed_mesh] +speed: 200 +horizontal_move_z: 5 +mesh_min: 10, 40 +mesh_max: 295,260 +probe_count: 5, 5 +algorithm: bicubic +bicubic_tension: 0.2 +fade_start: 2 +fade_end: 10 +fade_target: 0 + +### Temp Sensors ### + +[temperature_sensor raspberry_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + +[temperature_sensor mcu_temp] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor EBB_Temperature] +sensor_type: temperature_mcu +sensor_mcu: EBBCan + +#[temperature_sensor Chamber_Top] +#sensor_pin: PF4 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +#[temperature_sensor Chamber_Bottom] +#sensor_pin: PF5 +#sensor_type: NTC 100K MGB18-104F39050L32 +#min_temp: 0 +#max_temp: 100 + +### Skew Correction ### + +[skew_correction] + + +### Bed Heater ### + +[heater_bed] +heater_pin: PB1 #PD12 Changed do to mosfet stuck on +sensor_type: ATC Semitec 104GT-2 +sensor_pin: PF3 +#control: pid +#pid_Kp: 68.213 +#pid_Ki: 0.745 +#pid_Kd: 1560.376 +min_temp: 0 +max_temp: 130 + +### Input Shaper ### + +[adxl345] +cs_pin: EBBCan: PB12 +spi_software_sclk_pin: EBBCan: PB10 +spi_software_mosi_pin: EBBCan: PB11 +spi_software_miso_pin: EBBCan: PB2 +axes_map: -x,-y,z + +[resonance_tester] +accel_chip: adxl345 +probe_points: + 150, 150, 375 + +[input_shaper] +shaper_freq_x: 116.8 # center frequency for the X axis filter +shaper_type_x: mzv # filter type for the X axis +shaper_freq_y: 56.6 # center frequency for the Y axis filter +shaper_type_y: mzv # filter type for the Y axis +damping_ratio_x: 0.061 # damping ratio for the X axis +damping_ratio_y: 0.038 # damping ratio for the Y axis + +### Neopixel LED's ### + +[neopixel neo] +pin: PC9 +chain_count: 107 +color_order: GRB +initial_RED: 0.5 +initial_GREEN: 0.5 +initial_BLUE: 0.5 + +#[neopixel hotend_rgb] +#pin: EBBCan:PD3 + +### Idle Timeout ### + +[idle_timeout] +timeout: 96000 + +### Macros ### + +#[gcode_macro FIRMWARE_RESTART] +#rename_existing: SAFE_RESTART +#gcode: +# G28 +# G0 Z375 F2000 +# SAVE_CONFIG + + +[pause_resume] +recover_velocity: 50. + +#Genereted with https://config.gab-3d.com/ +# +# https://config.gab-3d.com/share/81eb76bf-6ce8-4774-b45e-7d4849658a48 + +[delayed_gcode DISABLEFILAMENTSENSOR] +initial_duration: 1 +gcode: + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + +[gcode_macro PRINT_START] +gcode: + {% set BED = params.BED_TEMP|int %} + {% set EXTRUDER = params.EXTRUDER_TEMP|int %} + M140 S{BED} ;Set bed temperature and don't wait + M109 S{EXTRUDER} ;Set extruder temperature and wait + M190 S{BED} ;Set bed temperature and wait + G28 + Z_TILT_ADJUST + BED_MESH_CALIBRATE ADAPTIVE=1 + _ADAPTIVE_PURGE_V1E ;Adaptive Purge + G90 ;Set to absolute positioning + G92 E0 ;Reset extruder + SKEW_PROFILE LOAD=calilantern_skew_profile + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=1 + +[gcode_macro _ADAPTIVE_PURGE_V1] +description: A purge macro that adapts to be near your actual printed objects + +variable_adaptive_enable: True # Change to False if you'd like the purge to be in the same spot every print +variable_z_height: 0.3 # Height above the bed to purge +variable_tip_distance: 10 # Distance between filament tip and nozzle before purge (this will require some tuning) +variable_purge_amount: 30 # Amount of filament to purge +variable_flow_rate: 10 # Desired flow rate in mm3/s +variable_x_default: 5 # X location to purge, overwritten if adaptive is True +variable_y_default: 5 # Y location to purge, overwritten if adaptive is True +variable_size: 16 # Size of the logo +variable_distance_to_object_x: 7 # Distance in x to the print area +variable_distance_to_object_y: 7 # Distance in y to the print area + +gcode: + {% if adaptive_enable == True %} + {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} + {% set x_origin = (all_points | map(attribute=0) | min | default(x_default + distance_to_object_x + size)) - distance_to_object_x - size %} + {% set y_origin = (all_points | map(attribute=1) | min | default(y_default + distance_to_object_y + size)) - distance_to_object_y - size %} + {% set x_origin = ([x_origin, 0] | max) %} + {% set y_origin = ([y_origin, 0] | max) %} + + {% if x_origin < x_default %} + set x_origin = x_default | float + {% endif %} + + {% if y_origin < y_default %} + set y_origin = y_default | float + {% endif %} + + {% else %} + {% set x_origin = x_default | float %} + {% set y_origin = y_default | float %} + {% endif %} + + # Flow rate (mm3/s) = nozzle size(mm) x layer height(mm) x print speed(mm/s) + # Filament Radius = 1.75mm / 2 = 0.875 + # cross sectional area = pi * (0.875)^2 = 2.405 mm2 + + {% set purge_move_speed = 2.31 * size * flow_rate / (purge_amount * 2.405) %} + {% set prepurge_speed = flow_rate / 2.405 %} + {% set travel_speed = printer.toolhead.max_velocity %} + { action_respond_info( "x: " + x_origin|string + " y: " + y_origin|string + " purge_move_speed: " + purge_move_speed|string + " prepurge_speed: " + prepurge_speed|string ) } + + G92 E0 + G90 # Absolute positioning + G0 X{x_origin} Y{y_origin+size/2} F3000 # Move to purge position + G0 Z{z_height} F1500 # Move to purge Z height + G0 F3000 # Set travel speed + M83 # Relative extrusion mode + G1 X{x_origin+size*0.1883125} Y{y_origin+size*0.05125} + G1 E{tip_distance} F{prepurge_speed*60} # Move tip of filament to nozzle + + # Draw V1 logo outline + G1 F600 + G1 X{x_origin+size*0.1976875} Y{y_origin+size*0.0538125} E{purge_amount*0.00362396204033215} + G1 X{x_origin+size*0.2070625} Y{y_origin+size*0.056375} E{purge_amount*0.00348517200474496} + G1 X{x_origin+size*0.273} Y{y_origin+size*0.0889375} E{purge_amount*0.0253226571767497} + G1 X{x_origin+size*0.3568125} Y{y_origin+size*0.125125} E{purge_amount*0.0313760379596679} + G1 X{x_origin+size*0.442375} Y{y_origin+size*0.1563125} E{purge_amount*0.0312455516014235} + G1 X{x_origin+size*0.5295625} Y{y_origin+size*0.1825} E{purge_amount*0.0311731909845789} + G1 X{x_origin+size*0.5311875} Y{y_origin+size*0.1829375} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.6196875} Y{y_origin+size*0.2038125} E{purge_amount*0.0311376037959668} + G1 X{x_origin+size*0.7093125} Y{y_origin+size*0.219625} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.799875} Y{y_origin+size*0.2301875} E{purge_amount*0.0313368920521945} + G1 X{x_origin+size*0.8735625} Y{y_origin+size*0.2349375} E{purge_amount*0.0254270462633452} + G1 X{x_origin+size*0.8824375} Y{y_origin+size*0.237} E{purge_amount*0.00326809015421115} + G1 X{x_origin+size*0.8913125} Y{y_origin+size*0.2390625} E{purge_amount*0.00339739027283511} + G1 X{x_origin+size*0.8959375} Y{y_origin+size*0.2481875} E{purge_amount*0.00381494661921708} + G1 X{x_origin+size*0.9005} Y{y_origin+size*0.257375} E{purge_amount*0.00366548042704626} + G1 X{x_origin+size*0.951125} Y{y_origin+size*0.4463125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.9521875} Y{y_origin+size*0.4540625} E{purge_amount*0.00276156583629893} + G1 X{x_origin+size*0.9531875} Y{y_origin+size*0.46175} E{purge_amount*0.00282443653618031} + G1 X{x_origin+size*0.9528125} Y{y_origin+size*0.4654375} E{purge_amount*0.00138078291814947} + G1 X{x_origin+size*0.9458125} Y{y_origin+size*0.4720625} E{purge_amount*0.00359193357058126} + G1 X{x_origin+size*0.9388125} Y{y_origin+size*0.4786875} E{purge_amount*0.00342467378410439} + G1 X{x_origin+size*0.9145625} Y{y_origin+size*0.4951875} E{purge_amount*0.00993950177935943} + G1 X{x_origin+size*0.8395} Y{y_origin+size*0.547875} E{purge_amount*0.0316453143534994} + G1 X{x_origin+size*0.7680625} Y{y_origin+size*0.6045} E{purge_amount*0.0314733096085409} + G1 X{x_origin+size*0.700125} Y{y_origin+size*0.665125} E{purge_amount*0.0314483985765125} + G1 X{x_origin+size*0.6358125} Y{y_origin+size*0.7295} E{purge_amount*0.0314317912218268} + G1 X{x_origin+size*0.5755625} Y{y_origin+size*0.7971875} E{purge_amount*0.0312977461447212} + G1 X{x_origin+size*0.5465} Y{y_origin+size*0.8325625} E{purge_amount*0.0155836298932384} + G1 X{x_origin+size*0.492125} Y{y_origin+size*0.9056875} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.451125} Y{y_origin+size*0.967125} E{purge_amount*0.0254341637010676} + G1 X{x_origin+size*0.444625} Y{y_origin+size*0.9739375} E{purge_amount*0.00337959667852906} + G1 X{x_origin+size*0.4380625} Y{y_origin+size*0.98075} E{purge_amount*0.00353262158956109} + G1 X{x_origin+size*0.428125} Y{y_origin+size*0.98} E{purge_amount*0.00372123368920522} + G1 X{x_origin+size*0.41825} Y{y_origin+size*0.97925} E{purge_amount*0.00354211150652432} + G1 X{x_origin+size*0.22925} Y{y_origin+size*0.928625} E{purge_amount*0.0668837485172005} + G1 X{x_origin+size*0.2204375} Y{y_origin+size*0.924125} E{purge_amount*0.00351601423487545} + G1 X{x_origin+size*0.2115625} Y{y_origin+size*0.919625} E{purge_amount*0.00366903914590747} + G1 X{x_origin+size*0.2091875} Y{y_origin+size*0.910625} E{purge_amount*0.00343179122182681} + G1 X{x_origin+size*0.2068125} Y{y_origin+size*0.9016875} E{purge_amount*0.00329774614472123} + G1 X{x_origin+size*0.2020625} Y{y_origin+size*0.82825} E{purge_amount*0.0253404507710558} + G1 X{x_origin+size*0.1915} Y{y_origin+size*0.737625} E{purge_amount*0.0313582443653618} + G1 X{x_origin+size*0.17575} Y{y_origin+size*0.6479375} E{purge_amount*0.0312431791221827} + G1 X{x_origin+size*0.154875} Y{y_origin+size*0.5593125} E{purge_amount*0.0311791221826809} + G1 X{x_origin+size*0.1544375} Y{y_origin+size*0.5576875} E{purge_amount*0.000575326215895611} + G1 X{x_origin+size*0.12825} Y{y_origin+size*0.470625} E{purge_amount*0.0311328588374852} + G1 X{x_origin+size*0.0970625} Y{y_origin+size*0.385125} E{purge_amount*0.0312253855278766} + G1 X{x_origin+size*0.061} Y{y_origin+size*0.3014375} E{purge_amount*0.0313190984578885} + G1 X{x_origin+size*0.02825} Y{y_origin+size*0.2351875} E{purge_amount*0.0254483985765125} + G1 X{x_origin+size*0.025625} Y{y_origin+size*0.226125} E{purge_amount*0.00338671411625148} + G1 X{x_origin+size*0.023} Y{y_origin+size*0.2170625} E{purge_amount*0.00352313167259787} + G1 X{x_origin+size*0.028625} Y{y_origin+size*0.208875} E{purge_amount*0.00370937129300119} + G1 X{x_origin+size*0.03425} Y{y_origin+size*0.200625} E{purge_amount*0.003570581257414} + G1 X{x_origin+size*0.1725625} Y{y_origin+size*0.0623125} E{purge_amount*0.0668623962040332} + G1 X{x_origin+size*0.1804375} Y{y_origin+size*0.0568125} E{purge_amount*0.00343297746144721} + G1 X{x_origin+size*0.18375} Y{y_origin+size*0.0545} E{purge_amount*0.00150652431791222} + + + G92 E0 # Reset extruder distance + M82 # Absolute extrusion mode + G0 Z{z_height*2} # Z hop + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + + +[exclude_object] + + +[pause_resume] +recover_velocity: 300.0 + +#From mainsail macro +[gcode_macro PAUSE] +rename_existing: PAUSE_BASE +gcode: + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + +#From mainsail macro +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +gcode: + ##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro ##### + {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %} + #### get VELOCITY parameter if specified #### + {% if 'VELOCITY' in params|upper %} + {% set get_params = ('VELOCITY=' + params.VELOCITY) %} + {%else %} + {% set get_params = "" %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + RESUME_BASE {get_params} + {% if printer["gcode_macro status_printing"] != null %} + status_printing + {% endif %} + +#From mainsail macro + +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +variable_extrude: 1.0 +gcode: + ##### set park positon for x and y ##### + # default is your max posion from your printer.cfg + {% set x_park = printer.toolhead.axis_maximum.x|float / 2 %} + {% set y_park = printer.toolhead.axis_maximum.y %} + {% set z_park_delta = 2.0 %} + ##### calculate save lift position ##### + {% set max_z = printer.toolhead.axis_maximum.z|float %} + {% set act_z = printer.toolhead.position.z|float %} + {% if act_z < (max_z - z_park_delta) %} + {% set z_safe = z_park_delta %} + {% else %} + {% set z_safe = max_z - act_z %} + {% endif %} + ##### end of definitions ##### + {% if printer.extruder.can_extrude|lower == 'true' %} + M83 + G1 E-{extrude} F2100 + {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + {% if "xyz" in printer.toolhead.homed_axes %} + G91 + G1 Z{z_safe} F900 + G90 + G1 X{x_park} Y{y_park} F6000 + {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +[gcode_macro PRINT_END] +gcode: + TURN_OFF_HEATERS ;Turn off heaters + M106 S0 ;Part cooling fan speed + G1 E-.5 F120 ;Retract filament + _MOVE_AWAY ;Move away from print + G0 Z375 F3000 ;Move Up + PARK_CENTER_REAR ;Park central rear + SET_SKEW CLEAR=1 + SET_FILAMENT_SENSOR SENSOR=motion_sensor ENABLE=0 + + +[gcode_macro _MOVE_AWAY] +gcode: + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %} + + G90 ; absolute positioning + G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing + + +[gcode_macro PARK_CENTER_REAR] +gcode: + {% if printer["gcode_macro status_busy"] != null %} + status_busy + {% endif %} + {% set th = printer.toolhead %} + {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %} + {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %} + + G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 + {% if printer["gcode_macro status_ready"] != null %} + status_ready + {% endif %} + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|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(20)|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: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% 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} + + # Large pattern 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 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 patternbox + 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 %} + + # 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} + + # Re-home and get position again for comparison: + M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66 + G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value + CLEAR_PAUSE + SDCARD_RESET_FILE + PRINT_END + BASE_CANCEL_PRINT + +[gcode_macro FILAMENT_UNLOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E-75 F350 # Move the extruder reverse 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[gcode_macro FILAMENT_LOAD] +gcode: + M83 # Put the extruder into relative mode + G92 E0.0 # Reset the extruder so that it thinks it is at position zero + G1 E75 F350 # Move the extruder forward 75mm at a speed of 350mm/minute + G92 E0.0 # Reset the extruder again + M82 # Put the extruder back into absolute mode. + +[include moonraker_obico_macros.cfg] + +[shaketune] +# result_folder: ~/printer_data/config/ShakeTune_results +# The folder where the results will be stored. It will be created if it doesn't exist. +# number_of_results_to_keep: 3 +# The number of results to keep in the result_folder. The oldest results will +# be automatically deleted after each runs. +# keep_raw_csv: False +# If True, the raw CSV files will be kept in the result_folder alongside the +# PNG graphs. If False, they will be deleted and only the graphs will be kept. +# show_macros_in_webui: True +# Mainsail and Fluidd doesn't create buttons for "system" macros that are not in the +# printer.cfg file. If you want to see the macros in the webui, set this to True. +# timeout: 300 +# The maximum time in seconds to let Shake&Tune process the CSV files and generate the graphs. + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 50.353 +#*# pid_ki = 1.614 +#*# pid_kd = 392.755 +#*# +#*# [bltouch] +#*# z_offset = 1.160 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.103118, 0.168118, 0.163118 +#*# 0.033118, 0.083118, 0.108118 +#*# -0.041882, 0.028118, 0.043118 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 116.5 +#*# max_x = 173.5 +#*# min_y = 91.62 +#*# max_y = 198.38 +#*# +#*# [skew_correction default] +#*# xy_skew = -0.0012863213127576173 +#*# xz_skew = 0.0031993296215198845 +#*# yz_skew = -0.003485955136681875 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 21.167 +#*# pid_ki = 0.771 +#*# pid_kd = 145.258 +#*# +#*# [skew_correction CaliFlower] +#*# xy_skew = 0.002713711559176898 +#*# xz_skew = 0.0 +#*# yz_skew = 0.0 +#*# +#*# [skew_correction calilantern_skew_profile] +#*# xy_skew = 0.0021425483338177115 +#*# xz_skew = -0.0030264520017574143 +#*# yz_skew = -0.00012020989864341069 diff --git a/printer.cfg b/printer.cfg index 84b77ce..69b0a2e 100644 --- a/printer.cfg +++ b/printer.cfg @@ -1,7 +1,7 @@ [include mainsail.cfg] [display_status] -[include K-ShakeTune/*.cfg] +#[include K-ShakeTune/*.cfg] ### Github Backup ### @@ -47,8 +47,8 @@ on_error_gcode: CANCEL_PRINT [printer] kinematics: corexy -max_velocity: 500 -max_accel: 10000 +max_velocity: 350 +max_accel: 4000 max_z_velocity: 100 max_z_accel: 1200 @@ -58,7 +58,7 @@ max_z_accel: 1200 step_pin: PE9 dir_pin: PF1 enable_pin: !PF2 -microsteps: 16 +microsteps: 64 rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test endstop_pin: EBBCan: PB6 position_endstop: 0 @@ -69,7 +69,7 @@ homing_speed: 50 step_pin: PE11 dir_pin: PE8 enable_pin: !PD7 -microsteps: 16 +microsteps: 64 rotation_distance: 31.86 # Original 32, Changed to ~~31.85 (Average between X&Y from CaliFlower Test)~~ Changed to 31.86 after Calilantern Test endstop_pin: PE12 position_endstop: 0 @@ -85,7 +85,7 @@ rotation_distance: 32 endstop_pin: probe:z_virtual_endstop position_min: -5 position_max: 385 -homing_speed: 30 +homing_speed: 50 second_homing_speed: 5 [stepper_z1] @@ -135,46 +135,46 @@ max_extrude_only_distance: 250 uart_pin: PC13 #tx_pin: PE4 #uart_address: 0 -run_current: 1.100 -hold_current: 0.600 -stealthchop_threshold: 0 +run_current: 0.976 +#hold_current: 0.600 +stealthchop_threshold: 105 [tmc2209 stepper_y] uart_pin: PE3 #tx_pin: PE2 #uart_address: 0 -run_current: 1.100 -hold_current: 0.600 -stealthchop_threshold: 0 +run_current: 0.976 +#hold_current: 0.600 +stealthchop_threshold: 105 [tmc2209 stepper_z] uart_pin: PE1 #tx_pin: PE0 #uart_address: 0 run_current: 0.850 -hold_current: 0.600 -stealthchop_threshold: 99999 +#hold_current: 0.600 +stealthchop_threshold: 105 [tmc2209 stepper_z1] uart_pin: PD4 #tx_pin: PD2 #uart_address: 0 run_current: 0.850 -hold_current: 0.600 -stealthchop_threshold: 99999 +#hold_current: 0.600 +stealthchop_threshold: 105 [tmc2209 stepper_z2] uart_pin: PD1 #tx_pin: PD0 #uart_address: 0 run_current: 0.850 -hold_current: 0.600 -stealthchop_threshold: 99999 +#hold_current: 0.600 +stealthchop_threshold: 105 [tmc2209 extruder] uart_pin: EBBCan: PA15 run_current: 0.850 -stealthchop_threshold: 99999 +stealthchop_threshold: 0 ### TMC Autotune ### @@ -237,7 +237,7 @@ runout_gcode: PAUSE [safe_z_home] home_xy_position: 150, 185 -speed: 150 +speed: 200 #z_hop: 10 #z_hop_speed: 20 @@ -250,22 +250,22 @@ z_positions: 0, 25 points: 10, 50 280, 50 150, 295 -speed: 125 -horizontal_move_z: 10 +speed: 200 +horizontal_move_z: 6 retries: 8 retry_tolerance: 0.01 ### Bed Mesh ### [bed_mesh] -speed: 125 -horizontal_move_z: 10 +speed: 200 +horizontal_move_z: 5 mesh_min: 10, 40 mesh_max: 295,260 probe_count: 5, 5 algorithm: bicubic bicubic_tension: 0.2 -fade_start: 1 +fade_start: 2 fade_end: 10 fade_target: 0 @@ -330,12 +330,12 @@ probe_points: 150, 150, 375 [input_shaper] -shaper_freq_x: 114.4 # center frequency for the X axis filter -shaper_type_x: ei # filter type for the X axis -shaper_freq_y: 59.2 # center frequency for the Y axis filter +shaper_freq_x: 116.8 # center frequency for the X axis filter +shaper_type_x: mzv # filter type for the X axis +shaper_freq_y: 56.6 # center frequency for the Y axis filter shaper_type_y: mzv # filter type for the Y axis -damping_ratio_x: 0.031 # damping ratio for the X axis -damping_ratio_y: 0.039 # damping ratio for the Y axis +damping_ratio_x: 0.061 # damping ratio for the X axis +damping_ratio_y: 0.038 # damping ratio for the Y axis ### Neopixel LED's ### @@ -771,17 +771,32 @@ gcode: [include moonraker_obico_macros.cfg] +[shaketune] +# result_folder: ~/printer_data/config/ShakeTune_results +# The folder where the results will be stored. It will be created if it doesn't exist. +# number_of_results_to_keep: 3 +# The number of results to keep in the result_folder. The oldest results will +# be automatically deleted after each runs. +# keep_raw_csv: False +# If True, the raw CSV files will be kept in the result_folder alongside the +# PNG graphs. If False, they will be deleted and only the graphs will be kept. +# show_macros_in_webui: True +# Mainsail and Fluidd doesn't create buttons for "system" macros that are not in the +# printer.cfg file. If you want to see the macros in the webui, set this to True. +# timeout: 300 +# The maximum time in seconds to let Shake&Tune process the CSV files and generate the graphs. + #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*# #*# [heater_bed] #*# control = pid -#*# pid_kp = 56.384 -#*# pid_ki = 2.320 -#*# pid_kd = 342.530 +#*# pid_kp = 50.353 +#*# pid_ki = 1.614 +#*# pid_kd = 392.755 #*# #*# [bltouch] -#*# z_offset = 1.195 +#*# z_offset = 1.160 #*# #*# [bed_mesh default] #*# version = 1 @@ -807,9 +822,9 @@ gcode: #*# #*# [extruder] #*# control = pid -#*# pid_kp = 16.677 -#*# pid_ki = 0.496 -#*# pid_kd = 140.084 +#*# pid_kp = 21.167 +#*# pid_ki = 0.771 +#*# pid_kd = 145.258 #*# #*# [skew_correction CaliFlower] #*# xy_skew = 0.002713711559176898