# This file contains common configurations and pin mappings for the Prusa # Mini+, which uses the Prusa Buddy board. # To use this config, the firmware should be compiled for the STM32F407. When # running "make menuconfig", enable "extra low-level configuration setup", # select the "128KiB + 512 byte offset" bootloader, and USB communication. # Connect the printer to your Raspberry Pi using the printer's micro-USB port. # If you prefer to remove Prusa's stock bootloader entirely, select the # "No bootloader" option. # When flashing for the first time, you will need to break the "appendix" # on the Buddy board, then put the device into DFU mode by moving the jumper # on the 3-pin header (older boards) or shorting the 2-pin header (newer boards) # and resetting, and finally use "make flash" to install Klipper. Once Klipper is # installed, you no longer need the jumper - just use "make flash" which will # automatically put the device into DFU mode. # Note that if you were previously running Prusa firmware, you must fully # power cycle the board after flashing. Otherwise, Klipper will be unable to # communicate with the TMC2209s due to the abrupt change in the baud rate, # and will show this error: "Unable to read tmc uart register IFCNT". # See docs/Config_Reference.md for a description of parameters. ## gcode macros # custom slicer START_PRINT and END_PRINT macros [gcode_macro START_PRINT] description: start printing gcode: {% set BED_TEMP = params.BED_TEMP|default(60)|float %} {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} M140 S{BED_TEMP} # start bed heating M104 S{EXTRUDER_TEMP} # start extruder heating G90 # use absolute coordinates G92 E0 # reset extruder # SET_GCODE_OFFSET Z=0.0 # reset the G-Code Z offset (adjust Z offset if needed) G28 # home the printer G1 Z5 F3000 # move the nozzle near the bed G1 Z0.15 F300 # move the nozzle very close to the bed M190 S{BED_TEMP} # wait for bed temperature M109 S{EXTRUDER_TEMP} # set and wait for nozzle temperature # clean nozzle G0 Z5 F300 # move Z to travel height G0 X40 Y0 F5000 # move to start position G0 Z0.2 F1500 # lower Z G0 X150 Y0 Z0.2 E15 # draw line G0 X150 Y0.4 Z0.2 # move to the side little G0 X30 Y0.4 Z0.2 E30 # draw line G0 Z5 F300 # move Z to travel height [gcode_macro END_PRINT] description: end printing gcode: M140 S0 # Turn off bed M104 S0 # Turn off extruder M106 S0 # Turn off fan G91 # Use relativ coordinates G1 X-2 Y-2 E-3 F300 # Move nozzle away from print while retracting G1 Z10 F3000 # Raise nozzle by 10mm G90 # Use absolute coordinates M84 # Disable steppers [gcode_macro PAUSE] description: Pause the actual running print rename_existing: PAUSE_BASE gcode: ## set defaults {% set x = params.X|default(160) %} {% set y = params.Y|default(20) %} {% set z = params.Z|default(10)|float %} {% set e = params.E|default(1) %} ## calculate save lift position {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% set lift_z = z|abs %} {% if act_z < (max_z - lift_z) %} {% set z_safe = lift_z %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} 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} G90 G1 X{x} Y{y} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro RESUME] description: Resume the actual running print rename_existing: RESUME_BASE gcode: ## set defaults {% set e = params.E|default(1) %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E{e} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro CANCEL_PRINT] description: Cancel the actual running print rename_existing: CANCEL_PRINT_BASE gcode: TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro UNLOAD] description: unload filament gcode: {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} M104 S{EXTRUDER_TEMP} # heat extruder G91 # relative coordinates G0 E-370 F3000 # unload G90 # absolute coordinates [gcode_macro LOAD] description: load filament gcode: {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} M117 heating extruder to {EXTRUDER_TEMP} M104 S{EXTRUDER_TEMP} # heat extruder M109 S{EXTRUDER_TEMP} # wait for extruder temperature G91 # relative coordinates G0 E350 F3000 # load almost to nozzle G0 E30 F300 # slowly purge G90 # absolute coordinates [gcode_macro M600] description: Change filament gcode: SAVE_GCODE_STATE NAME=M600_state PAUSE UNLOAD M117 change filament RESTORE_GCODE_STATE NAME=M600_state ## Remove unused gcodes [gcode_macro G29] description: Bed Leveling gcode: G4 [gcode_macro M201] description: Set Print Max Acceleration gcode: G4 [gcode_macro M203] description: Set Max Feedrate gcode: G4 [gcode_macro M205] description: Set Advanced Settings gcode: G4 [gcode_macro M900] description: Linear Advance Factor gcode: G4 ## general configuration [pause_resume] [display_status] [virtual_sdcard] path: ~/gcode_files [stepper_x] step_pin: PD1 dir_pin: PD0 enable_pin: !PD3 microsteps: 16 rotation_distance: 32 # 200 * 16 / 100 endstop_pin: tmc2209_stepper_x:virtual_endstop position_endstop: 180.4 position_min: -2 position_max: 180.4 homing_speed: 50 homing_retract_dist: 0 [stepper_y] step_pin: PD13 dir_pin: PD12 enable_pin: !PD14 microsteps: 16 rotation_distance: 32 # 200 * 16 / 100 endstop_pin: tmc2209_stepper_y:virtual_endstop position_endstop: -3 position_min: -3 position_max: 180 homing_speed: 50 homing_retract_dist: 0 [stepper_z] step_pin: PD4 dir_pin: !PD15 enable_pin: !PD2 microsteps: 16 rotation_distance: 4 endstop_pin: probe:z_virtual_endstop position_min: -3 position_max: 185 [extruder] step_pin: PD9 dir_pin: !PD8 enable_pin: !PD10 microsteps: 16 rotation_distance: 26.2564 # (200 * 16 * 48/18) / 325 gear_ratio: 48:18 nozzle_diameter: 0.400 filament_diameter: 1.750 heater_pin: PB1 sensor_type: ATC Semitec 104GT-2 sensor_pin: PC0 #control: pid # Prusa's firmware defaults. #pid_Kp: 7 #pid_Ki: 0.5 #pid_Kd: 45 min_temp: 10 max_temp: 305 max_extrude_only_distance: 800.0 [tmc2209 stepper_x] uart_pin: PD5 uart_address: 1 diag_pin: ^PE2 driver_SGTHRS: 130 run_current: 0.35 sense_resistor: 0.22 stealthchop_threshold: 999999 [tmc2209 stepper_y] uart_pin: PD5 uart_address: 3 diag_pin: ^PE1 driver_SGTHRS: 130 run_current: 0.35 sense_resistor: 0.22 stealthchop_threshold: 999999 [tmc2209 stepper_z] uart_pin: PD5 uart_address: 0 diag_pin: ^PE3 driver_SGTHRS: 100 run_current: 0.35 sense_resistor: 0.22 stealthchop_threshold: 999999 [tmc2209 extruder] uart_pin: PD5 uart_address: 2 diag_pin: ^PA15 driver_SGTHRS: 100 run_current: 0.4 sense_resistor: 0.22 [heater_bed] heater_pin: PB0 sensor_type: EPCOS 100K B57560G104F sensor_pin: PA4 #control: pid # Prusa's firmware defaults. #pid_Kp: 120 #pid_Ki: 1.5 #pid_Kd: 600 min_temp: 10 max_temp: 110 # Hotend fan. # The stock firmware uses control ranges of PWM 0-50%, RPM 1000-8000. # Change fan_speed below to match your preference. Measured speeds: # fan_speed 0.5: 50% PWM = 4000RPM (Prusa stock default speed) # fan_speed 1.0: 100% PWM = 8000RPM (safe but loud) [heater_fan hotend_fan] pin: PE9 tachometer_pin: PE14 fan_speed: 0.5 # Part cooling fan. # The stock firmware uses control ranges of PWM 10-50%, RPM 500-5000. # To match stock firmware, set the Klipper fan speed to 50%. This speed # can be safely increased to 100% for better part cooling. Measured speeds: # 50% PWM = 2500RPM (Prusa stock default speed) # 100% PWM = 5000RPM (better cooling, still quiet) [fan] pin: PE11 tachometer_pin: PE10 # The SuperPINDA has built-in temperature compensation and no thermistor output, # so no compensation table is needed here. [probe] pin: PA8 x_offset: -29 y_offset: -3 #z_offset: 0 # set this to your Live Z Offset, but negated (invert the sign) speed: 6.0 [safe_z_home] home_xy_position: 160,20 z_hop: 4 [bed_mesh] speed: 100 horizontal_move_z: 5 mesh_min: 10,10 mesh_max: 141,167 probe_count: 4,4 [filament_switch_sensor filament_sensor] switch_pin: ^PB4 pause_on_runout: True event_delay: 3.0 pause_delay: 0.5 runout_gcode: M117 filament removed insert_gcode: M117 filament inserted G4 P3000 {% for i in range(10) %} M117 loading in {10-i} G4 P1000 {% endfor %} M117 loading now load [mcu] serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2B0024001547393432343038-if00 restart_method: command [printer] kinematics: cartesian # Prusa firmware defaults. max_velocity: 180 max_accel: 1250 max_z_velocity: 12 max_z_accel: 400 [display] lcd_type: st7789v spi_bus: spi2a rst_pin: PC8 cs_pin: PC9 rs_pin: PD11 encoder_pins: ^PE13, ^PE15 click_pin: ^!PE12 #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*# #*# [extruder] #*# control = pid #*# pid_kp = 21.307 #*# pid_ki = 0.911 #*# pid_kd = 124.644 #*# #*# [heater_bed] #*# control = pid #*# pid_kp = 57.528 #*# pid_ki = 1.059 #*# pid_kd = 780.942 #*# #*# [probe] #*# z_offset = 1.480 #*# #*# [bed_mesh default] #*# version = 1 #*# points = #*# -0.080000, -0.012500, 0.085000, 0.021250 #*# -0.110000, -0.061250, -0.072500, -0.017500 #*# -0.026250, -0.112500, -0.081250, -0.017500 #*# -0.123750, -0.120000, -0.072500, -0.072500 #*# tension = 0.2 #*# min_x = 10.0 #*# algo = lagrange #*# y_count = 4 #*# mesh_y_pps = 2 #*# min_y = 10.0 #*# x_count = 4 #*# max_y = 166.99 #*# mesh_x_pps = 2 #*# max_x = 140.98