Advertisement
Guest User

Klipper printercfg

a guest
Jul 18th, 2023
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 14.35 KB | None | 0 0
  1. # This file contains common pin mappings for the BIGTREETECH SKR mini
  2. # E3 v3.0. To use this config, the firmware should be compiled for the
  3. # STM32G0B1 with a "8KiB bootloader" and USB communication/USART.
  4.  
  5. # The "make flash" command does not work on the SKR mini E3. Instead,
  6. # after running "make", copy the generated "out/klipper.bin" file to a
  7. # file named "firmware.bin" on an SD card and then restart the SKR
  8. # mini E3 with that SD card.
  9.  
  10. # See docs/Config_Reference.md for a description of parameters.
  11. # OFF
  12. #[include GET_PROBE_LIMITS.cfg]
  13. #[include neopixel.cfg]
  14. #[include ledcontrol.cfg]
  15.  
  16. #[include led_progress.cfg]
  17.  
  18. # ON
  19. [include mainsail.cfg]
  20. [include timelapse.cfg]
  21. [include simple-stealthburner_leds.cfg]
  22. [include smart-m600.cfg]
  23. #[include RESTART_KLIPPERSCREEN.cfg]
  24. #[include pico.cfg]
  25. [include PID_TUNE.cfg]
  26. #[include shell_command.cfg]
  27.  
  28.  
  29. [bltouch]
  30. sensor_pin: ^PC14
  31. control_pin: PA1
  32. x_offset: -41.5                  # Change to fit your printer
  33. y_offset:  6.5                 # Change to fit your printer
  34. #z_offset: 0.0              # Change to fit your printer
  35. probe_with_touch_mode: True
  36. stow_on_each_sample: False   # Keep the probe extended between points
  37. samples: 2                   # Probe each point at least twice
  38. samples_tolerance: 0.0125    # If those measurements aren't this close then
  39. samples_tolerance_retries: 3 # Re-probe this many times and use the average
  40.  
  41. [safe_z_home]
  42. #When set to True, the X and Y axes are reset to their
  43. #previous positions after Z axis homing.
  44. move_to_previous: True
  45. home_xy_position: 157, 104 # Change coordinates to the center of your print bed
  46. speed: 200
  47. z_hop: 10                 # Move up 10mm
  48. z_hop_speed: 5
  49.  
  50. [bed_mesh]
  51. speed: 300
  52. fade_start: 0.010
  53. fade_end: 10
  54. fade_target: 0
  55. horizontal_move_z: 5
  56. mesh_min: 5, 5
  57. mesh_max: 197.5, 210
  58. probe_count: 5, 5
  59. #mesh_pps: 2, 2
  60. algorithm: bicubic
  61. #bicubic_tension: .2
  62. #relative_reference_index: 69, 112
  63.  
  64. [stepper_x]
  65. step_pin: PB13
  66. dir_pin: !PB12
  67. enable_pin: !PB14
  68. microsteps: 16
  69. rotation_distance: 40
  70. endstop_pin: ^PC0
  71. position_min: -5
  72. position_endstop: -5
  73. position_max: 239
  74. homing_speed: 150
  75.  
  76. [tmc2209 stepper_x]
  77. uart_pin: PC11
  78. tx_pin: PC10
  79. uart_address: 0
  80. run_current: 0.650
  81. hold_current: 0.580
  82. stealthchop_threshold: 999999
  83.  
  84. [stepper_y]
  85. step_pin: PB10
  86. dir_pin: !PB2
  87. enable_pin: !PB11
  88. microsteps: 16
  89. rotation_distance: 40
  90. endstop_pin: ^PC1
  91. position_min: -16
  92. position_endstop: -16
  93. position_max: 226
  94. homing_speed: 150
  95.  
  96. [tmc2209 stepper_y]
  97. uart_pin: PC11
  98. tx_pin: PC10
  99. uart_address: 2
  100. run_current: 0.620
  101. hold_current: 0.580
  102. stealthchop_threshold: 999999
  103.  
  104. [stepper_z]
  105. step_pin: PB0
  106. dir_pin: PC5
  107. enable_pin: !PB1
  108. microsteps: 16
  109. rotation_distance: 8
  110. # endstop_pin: ^PC2
  111. # position_endstop: 0.0
  112. endstop_pin: probe:z_virtual_endstop
  113. position_max: 258
  114. position_min: -2
  115.  
  116. [tmc2209 stepper_z]
  117. uart_pin: PC11
  118. tx_pin: PC10
  119. uart_address: 1
  120. run_current: 0.600
  121. hold_current: 0.590
  122. stealthchop_threshold: 999999
  123.  
  124. [extruder]
  125. step_pin: PB3
  126. dir_pin: !PB4
  127. enable_pin: !PD1
  128. microsteps: 16
  129. rotation_distance: 4.553
  130. full_steps_per_rotation: 200
  131. nozzle_diameter: 0.400
  132. filament_diameter: 1.750
  133. heater_pin: PC8
  134. sensor_type: EPCOS 100K B57560G104F
  135. sensor_pin: PA0
  136. #control: pid
  137. #pid_Kp: 21.527
  138. #pid_Ki: 1.063
  139. #pid_Kd: 108.982
  140. min_temp: 00
  141. max_temp: 300
  142. pressure_advance: 0.060
  143.  
  144. [tmc2209 extruder]
  145. uart_pin: PC11
  146. tx_pin: PC10
  147. uart_address: 3
  148. run_current: 0.480
  149. hold_current: 0.400
  150. stealthchop_threshold: 999999
  151.  
  152. [heater_bed]
  153. heater_pin: PC9
  154. sensor_type: ATC Semitec 104GT-2
  155. sensor_pin: PC4
  156. #control: pid
  157. #pid_Kp: 54.027
  158. #pid_Ki: 0.770
  159. #pid_Kd: 948.182
  160. min_temp: 0
  161. max_temp: 130
  162.  
  163. [controller_fan controller_fan]
  164. pin: PB15
  165. fan_speed: 1.0
  166. idle_speed: 0.5
  167. idle_timeout: 180
  168. heater: extruder
  169.  
  170. [heater_fan nozzle_cooling_fan]
  171. heater: extruder
  172. pin: PC7
  173. heater_temp: 50.0
  174. fan_speed: 1.0
  175.  
  176. [fan]
  177. pin: PC6
  178.  
  179. [mcu]
  180. serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_15003F000B50414733303120-if00
  181. baud: 250000
  182. # serial: /dev/ttyAMA0
  183. # restart_method: command
  184.  
  185. [printer]
  186. kinematics: cartesian
  187. max_velocity: 1000
  188. max_accel: 3500
  189. max_z_velocity: 5
  190. max_z_accel: 1000
  191.  
  192. [input_shaper]
  193. #shaper_freq_x: 56.2
  194. #shaper_type_x: ei
  195. #shaper_freq_y: 40.4
  196. #shaper_type_y: mzv
  197. #shaper_freq_x: 11.39  # frequency for the X mark of the test model
  198. #shaper_freq_y: 21.11  # frequency for the Y mark of the test model
  199.  
  200.  
  201. [bed_screws]
  202. screw1: 71, 20
  203. screw2: 239, 20
  204. screw3: 239, 189
  205. screw4: 71, 189
  206.  
  207. [screws_tilt_adjust]
  208. screw1: 71, 20
  209. screw1_name: front_left
  210. screw2: 239, 20
  211. screw2_name: front_right
  212. screw3: 239, 189
  213. screw3_name: back_right
  214. screw4: 71, 189
  215. screw4_name: back_left
  216. speed:250
  217. horizontal_move_z: 5
  218. screw_thread: CW-M4
  219. # Additional bed leveling screws. At least two screws must be
  220. # defined.
  221.  
  222. [filament_switch_sensor SB]
  223. switch_pin:PC15
  224. pause_on_runout: True
  225. runout_gcode:
  226. insert_gcode:
  227. event_delay: 3.0
  228. pause_delay: 0.5
  229.  
  230.  
  231.  
  232.  
  233. [board_pins]
  234. aliases:
  235.     # EXP1 header
  236.     EXP1_1=PB5,  EXP1_3=PA9,   EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
  237.     EXP1_2=PA15, EXP1_4=<RST>, EXP1_6=PB9,  EXP1_8=PD6, EXP1_10=<5V>
  238.  
  239.  
  240. ######################################################################
  241. #  BigTreeTech TFT TouchScreen emulated 12864 mode
  242. ######################################################################
  243.  
  244. [display]
  245. lcd_type: emulated_st7920
  246. spi_software_miso_pin: PD8 # status led, Virtual MISO
  247. spi_software_mosi_pin: PD6
  248. spi_software_sclk_pin: PB9
  249. en_pin: PB8
  250. encoder_pins: ^PA10, ^PA9
  251. click_pin: ^!PA15
  252.  
  253. [output_pin beeper]
  254. pin: PB5
  255.  
  256. ######################################################################
  257. #  MACROS  
  258. ######################################################################
  259.  
  260. ### Print Start
  261. [gcode_macro START_PRINT]
  262.   variable_bed_temp:  100
  263. variable_extruder_temp: 250
  264. gcode:
  265.     # Turn on filament sensor
  266.     ENABLEFILAMENTSENSOR
  267.     # Start bed heating
  268.     M140 S{bed_temp}
  269.     # Use absolute coordinates
  270.     G90
  271.     # Reset the G-Code Z offset (adjust Z offset if needed)
  272.     #SET_GCODE_OFFSET Z=0.0
  273.     # Home the printer
  274.     G28
  275.     # Move the nozzle near the bed
  276.     G1 Z5 F3000
  277.     # Move the nozzle very close to the bed
  278.     G1 Z0.15 F300
  279.     # Wait for bed to reach temperature
  280.     M190 S{bed_temp}
  281.     # Set and wait for nozzle to reach temperature
  282.     M109 S{extruder_temp}
  283.     # Load bed Mesh
  284.     BED_MESH_PROFILE LOAD=default
  285.     # Reset Extruder
  286.     G92 E0
  287.     # Move Z Axis up
  288.     G1 Z2.0 F3000
  289.     # Move to start position
  290.     G1 X2.1 Y20 Z0.28 F5000.0
  291.     # Draw the first line
  292.     G1 X2.1 Y200.0 Z0.22 F1000.0 E10
  293.     # Move to side a little
  294.     G1 X2.4 Y200.0 Z0.22 F5000.0
  295.     # Draw the second line
  296.     G1 X2.4 Y20 Z0.22 F1000.0 E20
  297.     # Reset Extruder
  298.     G92 E0
  299.     # Move Z Axis up
  300.     G1 Z0.5 F3000
  301.     # Print message on LCD
  302.     M117 By your command!
  303.  
  304. ###Print End
  305. [gcode_macro END_PRINT]
  306. variable_machine_depth: 220
  307. gcode:
  308.     # Turn off bed, extruder, and fan
  309.     M140 S0
  310.     M104 S0
  311.     M106 S0
  312.     # Relative positionning
  313.     G91
  314.     # Retract and raise Z
  315.     G1 Z0.2 E-2 F2400
  316.     # Wipe out
  317.     G1 X5 Y5 F3000
  318.     # Raise Z more
  319.     G1 Z10
  320.     # Absolute positionning
  321.     G90
  322.     # Present print
  323.     G1 X0 Y220
  324.     # Turn off filament sensor
  325.     DISABLEFILAMENTSENSOR
  326.     # Disable steppers
  327.     M84
  328.     # Print message on LCD
  329.     M117 That's All Folks
  330.  
  331. ###Bed Mesh
  332. [gcode_macro G29]
  333. gcode:
  334.    G28
  335.    BED_MESH_CALIBRATE
  336.    G0 X0 Y0 Z10 F6000
  337.    BED_MESH_PROFILE save=default
  338.  
  339.  
  340. ###Cancel Print
  341. [gcode_macro CANCEL_PRINT]
  342. description: Cancel the actual running print
  343. rename_existing: CANCEL_PRINT_BASE
  344. variable_park: True
  345. gcode:
  346.  ## Move head and retract only if not already in the pause state and park set to true
  347.  {% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
  348.    _TOOLHEAD_PARK_PAUSE_CANCEL
  349.  {% endif %}
  350.  TURN_OFF_HEATERS
  351.  CANCEL_PRINT_BASE
  352.  
  353. [gcode_macro PAUSE]
  354. description: Pause the actual running print
  355. rename_existing: PAUSE_BASE
  356. gcode:
  357.  PAUSE_BASE
  358.  _TOOLHEAD_PARK_PAUSE_CANCEL
  359.  
  360. [gcode_macro RESUME]
  361. description: Resume the actual running print
  362. rename_existing: RESUME_BASE
  363. gcode:
  364.  ##### read extrude from  _TOOLHEAD_PARK_PAUSE_CANCEL  macro #####
  365.  {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
  366.  #### get VELOCITY parameter if specified ####
  367.  {% if 'VELOCITY' in params|upper %}
  368.    {% set get_params = ('VELOCITY=' + params.VELOCITY)  %}
  369.  {%else %}
  370.    {% set get_params = "" %}
  371.  {% endif %}
  372.  ##### end of definitions #####
  373.  {% if printer.extruder.can_extrude|lower == 'true' %}
  374.    M83
  375.    G1 E{extrude} F2100
  376.    {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  377.  {% else %}
  378.    {action_respond_info("Extruder not hot enough")}
  379.  {% endif %}  
  380.  RESUME_BASE {get_params}
  381.  
  382. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  383. description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
  384. variable_extrude: 1.0
  385. gcode:
  386.  ##### set park positon for x and y #####
  387.  # default is your max posion from your printer.cfg
  388.  {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  389.  {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  390.  {% set z_park_delta = 2.0 %}
  391.  ##### calculate save lift position #####
  392.  {% set max_z = printer.toolhead.axis_maximum.z|float %}
  393.  {% set act_z = printer.toolhead.position.z|float %}
  394.  {% if act_z < (max_z - z_park_delta) %}
  395.    {% set z_safe = z_park_delta %}
  396.  {% else %}
  397.    {% set z_safe = max_z - act_z %}
  398.  {% endif %}
  399.  ##### end of definitions #####
  400.  {% if printer.extruder.can_extrude|lower == 'true' %}
  401.    M83
  402.    G1 E-{extrude} F2100
  403.    {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  404.  {% else %}
  405.    {action_respond_info("Extruder not hot enough")}
  406.  {% endif %}
  407.  {% if "xyz" in printer.toolhead.homed_axes %}
  408.    G91
  409.    G1 Z{z_safe} F900
  410.    G90
  411.    G1 X{x_park} Y{y_park} F6000
  412.    {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
  413.  {% else %}
  414.    {action_respond_info("Printer not homed")}
  415.  {% endif %}
  416.  
  417.  
  418. [gcode_macro Center]
  419. gcode:
  420.    G28
  421.    G0 X157 Y104 Z10 F6000
  422.    PROBE_CALIBRATE
  423.  
  424. #[gcode_macro FILAMENT_LOAD]
  425. #gcode:
  426. # M83                   # Put the extruder into relative mode
  427. #G92 E0.0              # Reset the extruder so that it thinks it is at position zero
  428. #G1 E120 F350          # Move the extruder forward 120mm at a speed of 350mm/minute
  429. # G92 E0.0              # Reset the extruder again
  430. # M82                   # Put the extruder back into absolute mode.
  431.  
  432. #[gcode_macro FILAMENT_UNLOAD]
  433. #gcode:
  434. # M83                   # Put the extruder into relative mode
  435. # G92 E0.0              # Reset the extruder so that it thinks it is at position zero
  436. # G1 E-120 F350          # Move the extruder forward 120mm at a speed of 350mm/minute
  437. # G92 E0.0              # Reset the extruder again
  438. # M82                   # Put the extruder back into absolute mode.
  439.  
  440. [gcode_macro M600]
  441. gcode:
  442.    {% set X = params.X|default(50)|float %}
  443.    {% set Y = params.Y|default(0)|float %}
  444.    {% set Z = params.Z|default(10)|float %}
  445.    SAVE_GCODE_STATE NAME=M600_state
  446.    PAUSE
  447.    G91
  448.    G1 E-.8 F2700
  449.    G1 Z{Z}
  450.    G90
  451.    G1 X{X} Y{Y} F3000
  452.    G91
  453.    G1 E-50 F1000
  454.    RESTORE_GCODE_STATE NAME=M600_state
  455.  
  456. #*# <---------------------- SAVE_CONFIG ---------------------->
  457. #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
  458. #*#
  459. #*# [bltouch]
  460. #*# z_offset = 0.454
  461. #*#
  462. #*# [extruder]
  463. #*# control = pid
  464. #*# pid_kp = 26.754
  465. #*# pid_ki = 1.784
  466. #*# pid_kd = 100.327
  467. #*#
  468. #*# [heater_bed]
  469. #*# control = pid
  470. #*# pid_kp = 73.399
  471. #*# pid_ki = 1.520
  472. #*# pid_kd = 886.296
  473. #*#
  474. #*# [bed_mesh gold mesh]
  475. #*# version = 1
  476. #*# points =
  477. #*#     -0.055000, 0.101250, 0.043750, 0.077500, 0.060000
  478. #*#     -0.063750, 0.112500, 0.015000, 0.077500, 0.045000
  479. #*#     -0.078750, 0.075000, 0.025000, 0.046250, 0.045000
  480. #*#     -0.032500, 0.096250, 0.027500, 0.102500, 0.068750
  481. #*#     0.077500, 0.152500, 0.038750, 0.123750, 0.100000
  482. #*# x_count = 5
  483. #*# y_count = 5
  484. #*# mesh_x_pps = 2
  485. #*# mesh_y_pps = 2
  486. #*# algo = bicubic
  487. #*# tension = 0.2
  488. #*# min_x = 15.0
  489. #*# max_x = 185.0
  490. #*# min_y = 15.0
  491. #*# max_y = 212.47
  492. #*#
  493. #*# [bed_mesh gld/blk flex ]
  494. #*# version = 1
  495. #*# points =
  496. #*#     0.035000, 0.156250, 0.041250, 0.030000, -0.022500
  497. #*#     0.022500, 0.160000, 0.020000, 0.010000, -0.030000
  498. #*#     0.005000, 0.105000, -0.016250, 0.008750, -0.037500
  499. #*#     0.057500, 0.147500, 0.027500, 0.045000, -0.005000
  500. #*#     0.152500, 0.197500, 0.068750, 0.063750, 0.038750
  501. #*# x_count = 5
  502. #*# y_count = 5
  503. #*# mesh_x_pps = 2
  504. #*# mesh_y_pps = 2
  505. #*# algo = bicubic
  506. #*# tension = 0.2
  507. #*# min_x = 15.0
  508. #*# max_x = 185.0
  509. #*# min_y = 15.0
  510. #*# max_y = 212.47
  511. #*#
  512. #*# [bed_mesh default22]
  513. #*# version = 1
  514. #*# points =
  515. #*#     0.047500, 0.178750, 0.075000, 0.080000, -0.030000
  516. #*#     0.080000, 0.173750, 0.056250, 0.037500, -0.027500
  517. #*#     0.047500, 0.117500, 0.008750, 0.061250, -0.036250
  518. #*#     0.060000, 0.157500, 0.056250, 0.038750, -0.010000
  519. #*#     0.162500, 0.232500, 0.063750, 0.086250, 0.027500
  520. #*# x_count = 5
  521. #*# y_count = 5
  522. #*# mesh_x_pps = 2
  523. #*# mesh_y_pps = 2
  524. #*# algo = bicubic
  525. #*# tension = 0.2
  526. #*# min_x = 15.0
  527. #*# max_x = 185.0
  528. #*# min_y = 15.0
  529. #*# max_y = 212.47
  530. #*#
  531. #*# [bed_mesh default]
  532. #*# version = 1
  533. #*# points =
  534. #*#       -0.081250, 0.022500, 0.027500, -0.038750, -0.110000
  535. #*#       0.023750, 0.016250, 0.028750, -0.002500, -0.057500
  536. #*#       -0.028750, -0.023750, -0.008750, 0.023750, -0.031250
  537. #*#       -0.017500, 0.025000, 0.015000, -0.013750, -0.060000
  538. #*#       -0.136250, -0.046250, -0.036250, -0.032500, -0.032500
  539. #*# x_count = 5
  540. #*# y_count = 5
  541. #*# mesh_x_pps = 2
  542. #*# mesh_y_pps = 2
  543. #*# algo = bicubic
  544. #*# tension = 0.2
  545. #*# min_x = 5.0
  546. #*# max_x = 197.47
  547. #*# min_y = 5.0
  548. #*# max_y = 210.0
  549. #*#
  550. #*# [bed_mesh test]
  551. #*# version = 1
  552. #*# points =
  553. #*#     0.188750, 0.156250, 0.100000, 0.111250, 0.095000
  554. #*#     0.330000, 0.160000, 0.107500, 0.157500, 0.066250
  555. #*#     0.307500, 0.148750, 0.046250, 0.100000, 0.007500
  556. #*#     0.177500, 0.141250, 0.050000, 0.116250, 0.020000
  557. #*#     0.265000, 0.172500, 0.067500, 0.146250, 0.138750
  558. #*# x_count = 5
  559. #*# y_count = 5
  560. #*# mesh_x_pps = 2
  561. #*# mesh_y_pps = 2
  562. #*# algo = bicubic
  563. #*# tension = 0.2
  564. #*# min_x = 15.0
  565. #*# max_x = 185.0
  566. #*# min_y = 15.0
  567. #*# max_y = 212.47
  568. #*#
  569. #*# [input_shaper]
  570. #*# shaper_type_y = mzv
  571. #*# shaper_freq_y = 38.0
  572. #*# shaper_type_x = mzv
  573. #*# shaper_freq_x = 57.0
  574.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement