# This file contains common pin mappings for the BIGTREETECH SKR V1.3 # board. To use this config, the firmware should be compiled for the # LPC1768. ############################################################################# ########### AM8-CONFIGURATION STARTS HERE ########### ############################################################################# [mcu] serial: /dev/serial/by-id/usb-Klipper_lpc1768_1E70000F801C3DAF883E975CC22000F5-if00 [printer] kinematics: cartesian max_velocity: 300 max_accel: 1000 max_z_velocity: 20 max_z_accel: 100 ##################################################################### # X/Y/Z Stepper Settings ##################################################################### [stepper_x] step_pin: P2.2 dir_pin: !P2.6 enable_pin: !P2.1 rotation_distance: 31.900 full_steps_per_rotation: 200 # 1.8 degree = 200, 0.9 degree = 400 microsteps: 16 endstop_pin: P1.29 # P1.28 for X-max position_endstop: -10 position_min: -10 position_max: 220 homing_speed: 35 second_homing_speed: 20 homing_retract_dist: 5 [tmc2209 stepper_x] uart_pin: P1.17 interpolate: True run_current: 0.450 hold_current: 0.200 sense_resistor: 0.110 stealthchop_threshold: 0 [stepper_y] step_pin: P0.19 dir_pin: P0.20 enable_pin: !P2.8 rotation_distance: 31.900 full_steps_per_rotation: 200 microsteps: 16 endstop_pin: !P1.27 # P1.26 for Y-max position_min: -19 position_endstop: -19 position_max: 220 homing_speed: 50 second_homing_speed: 25 homing_retract_dist: 5 [tmc2209 stepper_y] uart_pin: P1.15 interpolate: True run_current: 0.51064 hold_current: 0.300 sense_resistor: 0.110 stealthchop_threshold: 0 [stepper_z] step_pin: P0.22 dir_pin: !P2.11 enable_pin: !P0.21 #step_distance: .002470 rotation_distance: 7.904 full_steps_per_rotation: 200 microsteps: 16 #endstop_pin: P1.25 # P1.24 for Z-max #inverted endstop_pin: probe:z_virtual_endstop #position_endstop: 0 ## bu kaldırıldı sanırım position_max: 160 position_min: -5 homing_speed: 10.0 second_homing_speed: 3 homing_retract_dist: 3.0 ##################################################################### # Extruder Settings ##################################################################### [extruder] step_pin: P2.13 dir_pin: P0.11 enable_pin: !P2.12 heater_pin: P2.7 sensor_pin: P0.23 smooth_time: 3.0 rotation_distance: 3.7376 full_steps_per_rotation: 200 #gear_ratio: 50:17 #BMG Gear Ratio microsteps: 16 nozzle_diameter: 0.4 filament_diameter: 1.75 max_extrude_only_distance: 100 max_extrude_cross_section: 60.0 #sensor_type: EPCOS 100K B57560G104F sensor_type: ATC Semitec 104GT-2 control = pid pid_kp = 28.628 pid_ki = 1.577 pid_kd = 129.901 min_temp: 0 max_temp: 280 max_power: 1.0 ######### Try to keep pressure_advance below 1.0 ######### PA can be disabled by declaring a 0.0 value #pressure_advance: 0.13685 [verify_heater extruder] max_error: 600 check_gain_time: 40 hysteresis: 25 heating_gain: 2 ##################################################################### # Bed Heater ##################################################################### [heater_bed] heater_pin: P2.5 sensor_type: ATC Semitec 104GT-2 sensor_pin: P0.25 min_temp: 20 max_temp: 110 smooth_time: 3.0 control: pid pid_Kp=75.945 pid_Ki=1.285 pid_Kd=1122.092 [verify_heater heater_bed] max_error: 120 check_gain_time: 60 hysteresis: 10 heating_gain: 2 ##################################################################### # Fan Control ##################################################################### [fan] pin: P2.3 kick_start_time: 0.5 off_below: 0.10 [heater_fan my_nozzle_fan] pin: P2.4 heater: extruder heater_temp: 50.0 fan_speed: 0.4 max_power: 1.0 ##################################################################### # Homing and Adjustment Routines ##################################################################### [safe_z_home] home_xy_position: 110,110 # center of print bed speed: 30 z_hop: 6 z_hop_speed: 5 [bed_mesh] mesh_min: 30,15 mesh_max: 195,195 probe_count: 5,5 horizontal_move_z: 5 algorithm: bicubic ##FOLLOW THE FORUMULA FOR relative_reference_index, for example: ##[(5x5)-1] / 2 = 12 relative_reference_index: 12 [bltouch] sensor_pin: ^P1.24 # Z-max control_pin: P2.0 # Some BLTouch V3 and many clones apparently require this pin_up_touch_mode_reports_triggered: False pin_up_reports_not_triggered: False x_offset: 27 y_offset: 5 z_offset: 2.950 speed: 3.0 samples: 2 ##################################################################### # Other Settings ##################################################################### [force_move] enable_force_move: True # Set to true to enable FORCE_MOVE and SET_KINEMATIC_POSITION X=150 Y=150 Z=100 [idle_timeout] gcode: TURN_OFF_HEATERS M84 ; disable steppers timeout: 1800 ;30 min [skew_correction] # Pause/Resume Functionality [pause_resume] recover_velocity: 100 # This adds the 'respond' G-Code that you can use to send commands back to OctoPrint [respond] default_type: echo [force_move] enable_force_move: true # add virtual sd card [virtual_sdcard] path: ~/gcode_files [display_status] #[include /home/pi/custommenu.cfg] ##################################################################### # Display Routines # RepRapDiscount 128x64 Full Graphic Smart Controller ##################################################################### [display] lcd_type: st7920 cs_pin: P1.19 sclk_pin: P1.20 sid_pin: P1.18 encoder_pins: ^P3.26, ^P3.25 click_pin: ^!P0.28 #kill_pin: ^! [output_pin beeper] pin: P1.30 ##################################################################### ### MACROS ##################################################################### [gcode_macro DUMP_PARAMETERS] gcode: {% set parameters = namespace(output = '') %} {% for name1 in printer %} {% for name2 in printer[name1] %} {% set donotwant = ['configfile', 'bed_mesh'] %} {% if name1 is not in donotwant %} {% set param = "printer['%s'].%s = %s" % (name1, name2, printer[name1][name2]) %} {% set parameters.output = parameters.output + param + "\n" %} {% endif %} {% else %} {% set param = "printer['%s'] = %s" % (name1, printer[name1]) %} {% set parameters.output = parameters.output + param + "\n" %} {% endfor %} {% endfor %} { action_respond_info(parameters.output) } [gcode_macro TEMPADJUSTOFFSET] gcode: #ABS {% if printer.heater_bed.target >= 100 %} {% endif %} #PETG {% if printer.heater_bed.target > 65 and printer.heater_bed.target < 100 %} SET_GCODE_OFFSET Z=0 MOVE=1 SET_GCODE_OFFSET Z_ADJUST=0.05 MOVE=1 {% endif %} #PLA {% if printer.heater_bed.target <= 65 %} SET_GCODE_OFFSET Z=0 MOVE=1 SET_GCODE_OFFSET Z_ADJUST=0.1 MOVE=1 {% endif %} [gcode_macro isG28] gcode: {% if "x" not in printer.toolhead.homed_axes or "y" not in printer.toolhead.homed_axes or "z" not in printer.toolhead.homed_axes %} G28 {% endif %} [gcode_macro PRINT_START] gcode: PRINT_START_PRE {% set EXTRUDER = params.EXTRUDER|default(200)|int %} {% set BED = params.BED|default(60)|int %} {% if printer.heater_bed.temperature <= (params.BED|int - 20) %} M190 S{params.BED|int-20} {%endif %} M104 S{EXTRUDER} M190 S{BED} M109 S{EXTRUDER} #BED_MESH_CLEAR #bed_mesh_calibrate BED_MESH_PROFILE LOAD=default SET_SKEW XY=142.34,141.05,100.61 G1 Z5 F5000 G0 X110 Y110 Z10 F6000 M109 S{EXTRUDER} [gcode_macro PRINT_START_PRE] gcode: M104 S0 ;cancel set temp M107 ;turn cooling fans off G21 ;set units to mm G90 ;use absolute coordinates M83 ;use relative extrusion G92 E0.0 ;reset e count M220 S100 ;reset speed multiplier G28 [gcode_macro PRINT_END] # Use PRINT_END for the slicer ending script - PLEASE CUSTOMISE THE SCRIPT FOR YOUR SLICER OF CHOICE gcode: M400 ; wait for buffer to clear G92 E0 ; zero the extruder G1 E-4.0 F3600 ; retract filament G91 ; relative positioning G0 Z20 F3000 ; move nozzle up 25mm TURN_OFF_HEATERS M107 ; turn off fan G90 ; absolute positioning G0 X110 Y200 F3600 ; park nozzle at rear SET_SKEW CLEAR=1 M117 Finished! ; display message [gcode_macro NOZZLE_CLEAN] # Use for scrubbing the nozzle to keep it clean and ensure accurate z height gcode: {% set I = 5 %} G0 Z10 F3000 ;lift z 10mm {% if "z" not in printer.toolhead.homed_axes %} ; G28 Home if needed M117 Homing... G28 {% endif %} SAVE_GCODE_STATE NAME=cleaning ;save pre-run g-code state (relative/absolute, etc) G91 ;relative positioning G90 ;absolute positioning G0 X60 Y300 F3000 ;move to nozzle scrubber G0 Z9 F5000 ;lower z to brush height G91 ;relative positioning M117 Cleaning... # loop scrub move back/forth I amount of times {% for wipe in range(1,I|int,1) %} {% for distance in [50,-50] %} G0 X{distance} F10000 {% endfor %} {% endfor %} G0 Z10 F3000 ;lift z 10mm RESTORE_GCODE_STATE NAME=cleaning ;restore previous g-code state (relative/absolute, etc) M117 Ready... # Prime the nozzle [gcode_macro PRIME_LINE] gcode: SAVE_GCODE_STATE NAME=BEFORE_PRIME M117 Prime Line M83 {% if "z" not in printer.toolhead.homed_axes %} G28 ;Only G28 Home if needed {% endif %} G92 E0 ;Reset Extruder G1 Z5.0 F3000 ;Move Z Axis up G1 X5 Y30 Z0.24 F5000.0 ;Move to start position (5,30,.24) G1 X5 Y230.0 Z0.24 F1500.0 E20 ;Draw the first 200mm line G1 X5.5 Y230.0 Z0.24 F5000.0 ;Move to side a little G1 X5.5 Y30 Z0.24 F1500.0 E20 ;Draw the second line G92 E0 ;Reset Extruder G1 Z5.0 F3000 ;Move Z Axis up RESTORE_GCODE_STATE NAME=BEFORE_PRIME [gcode_macro PURGE_LINE] gcode: # Print Purge line G92 E0 ; zero the extruded G1 Z5 X0 Y0 F10000; Go home G1 Z0.2 X50 E10 F500 ; start purge line G1 X100 E20 F500 ; finish purge line G1 X120 Z5.0 F9000 ; Quick Wipe G92 E0 ; zero the extruded ######## Filament Change [gcode_macro M600] gcode: {% set X = 110 %} {% set Y = 0 %} {% set Z = 40 %} SAVE_GCODE_STATE NAME=ADVANCEDPAUSEUNLOAD PAUSE M83 ; set extruder to relative G1 E-10.0 F3600 ; retract filament G91 G1 Z{Z} F2400 G90 G1 X{X} Y{Y} F18000 UNLOAD_FILAMENT ; Unload the filament. {printer.gcode.action_respond_info("Ready to Load New Filament")} RESTORE_GCODE_STATE NAME=ADVANCEDPAUSEUNLOAD [gcode_macro UNLOAD_FILAMENT] gcode: # {% if printer[printer.toolhead.extruder].temperature > 180.0 %} {% set DISTANCE = 500 %} M400 SAVE_GCODE_STATE NAME=UNLOADFILAMENT M117 Unloading... M82 ;Absolute extrusion G92 E0 G1 E2 F3600 G1 E0 F3600 G1 E4 F3600 G1 E0 F3600 G1 E8 F3600 G1 E0 F3600 M83 ;Relative extrusion G1 E-25 F3600 G4 P3000 G1 E{DISTANCE|float * -1} F3000 M82 ; Absolute extrusion M400 M117 Done! UPDATE_DELAYED_GCODE ID=CLEAR_DISP DURATION=10 RESTORE_GCODE_STATE NAME=UNLOADFILAMENT # {% endif %} [gcode_macro LOAD_FILAMENT] # Extrusion lengths must be adjusted for your particular configuration before use gcode: # {% if printer[printer.toolhead.extruder].temperature > 180.0 %} SAVE_GCODE_STATE NAME=LOADFILAMENT M83 ; set extruder to relative G1 E45 F300 ; quickly load filament to down filament path G1 E20 F300 ; slower extrusion for hotend path G1 E20 F150 ; prime nozzle with filament G1 E10 F150 ; prime nozzle with a bit more filament RESTORE_GCODE_STATE NAME=LOADFILAMENT # {% endif %} [gcode_macro ABS60] gcode: M140 S60 ;set bed temperature and do not wait M109 S235 ;set print head temperature and wait [gcode_macro ABS80] gcode: M140 S80 ;set bed temperature and do not wait M109 S235 ;set print head temperature and wait [gcode_macro ABS100] gcode: M140 S100 ;set bed temperature and do not wait M109 S235 ;set print head temperature and wait [gcode_macro PLA60] gcode: M140 S60 ;set bed temperature and do not wait M109 S205 ;set print head temperature and wait [gcode_macro OFFSET] gcode: {% set D = 0.025 %} set_gcode_offset z_adjust={D} NULL_MOVE [gcode_macro BABY_UP] gcode: OFFSET D=0.025 [gcode_macro BABY_DOWN] gcode: OFFSET D=-0.025 [gcode_macro NULL_MOVE] gcode: G91 G1 Z0 Y0 X0 G90 [gcode_macro PAUSE] description: Pause the actual running print rename_existing: PAUSE_BASE # change this if you need more or less extrusion variable_extrude: 1.0 gcode: ##### read E from pause macro ##### {% set E = printer["gcode_macro PAUSE"].extrude|float %} ##### 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 - 5.0 %} {% set y_park = printer.toolhead.axis_maximum.y|float - 5.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 - 2.0) %} {% set z_safe = 2.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} ##### end of definitions ##### PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro RESUME] description: Resume the actual running print rename_existing: RESUME_BASE gcode: ##### read E from pause macro ##### {% set E = printer["gcode_macro PAUSE"].extrude|float %} #### 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' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro CANCEL_PRINT] rename_existing: BASE_CANCEL_PRINT gcode: #TURN_OFF_HEATERS CLEAR_PAUSE SDCARD_RESET_FILE BASE_CANCEL_PRINT [gcode_macro TEMPADJUSTPA] gcode: #ABS {% if printer.heater_bed.target >= 100 %} SET_PRESSURE_ADVANCE ADVANCE=0.05585 {% endif %} #PETG {% if printer.heater_bed.target > 65 and printer.heater_bed.target < 100 %} SET_PRESSURE_ADVANCE ADVANCE=0.0785 {% endif %} #PLA {% if printer.heater_bed.target <= 65 %} SET_PRESSURE_ADVANCE ADVANCE=0.0325 {% endif %} [gcode_macro BLRESET] gcode: BLTOUCH_DEBUG COMMAND=reset [gcode_macro BLUP] gcode: BLTOUCH_DEBUG COMMAND=pin_up [gcode_macro BLDOWN] gcode: BLTOUCH_DEBUG COMMAND=pin_down