Guest User

Untitled

a guest
Jan 14th, 2025
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.60 KB | None | 0 0
  1. # This file contains common pin mappings for the BIGTREETECH SKR mini
  2. # E3 v2.0. To use this config, the firmware should be compiled for the
  3. # STM32F103 with a "28KiB bootloader" and USB communication. Also,
  4. # select "Enable extra low-level configuration options" and configure
  5. # "GPIO pins to set at micro-controller startup" to "!PA14".
  6.  
  7. # The "make flash" command does not work on the SKR mini E3. Instead,
  8. # after running "make", copy the generated "out/klipper.bin" file to a
  9. # file named "firmware.bin" on an SD card and then restart the SKR
  10. # mini E3 with that SD card.
  11.  
  12. # See docs/Config_Reference.md for a description of parameters.
  13.  
  14. [stepper_x]
  15. step_pin: PB13
  16. dir_pin: !PB12
  17. enable_pin: !PB14
  18. microsteps: 16
  19. rotation_distance: 40
  20. endstop_pin: ^PC0
  21. position_endstop: 350
  22. position_max: 350
  23. homing_speed: 100
  24.  
  25. [tmc2209 stepper_x]
  26. uart_pin: PC11
  27. tx_pin: PC10
  28. uart_address: 0
  29. run_current: 0.580
  30. hold_current: 0.500
  31. stealthchop_threshold: 250
  32.  
  33. [stepper_y]
  34. step_pin: PB10
  35. dir_pin: !PB2
  36. enable_pin: !PB11
  37. microsteps: 16
  38. rotation_distance: 40
  39. endstop_pin: ^PC1
  40. position_endstop: 350
  41. position_max: 350
  42. homing_speed: 100
  43.  
  44. [tmc2209 stepper_y]
  45. uart_pin: PC11
  46. tx_pin: PC10
  47. uart_address: 2
  48. run_current: 0.580
  49. hold_current: 0.500
  50. stealthchop_threshold: 250
  51.  
  52. [stepper_z]
  53. step_pin: PB0
  54. dir_pin: !PC5
  55. enable_pin: !PB1
  56. microsteps: 16
  57. rotation_distance: 4
  58. endstop_pin: probe:z_virtual_endstop
  59. position_max: 410
  60. position_min: -4
  61. homing_speed: 10.0
  62.  
  63.  
  64. [tmc2209 stepper_z]
  65. uart_pin: PC11
  66. tx_pin: PC10
  67. uart_address: 1
  68. run_current: 0.580
  69. hold_current: 0.500
  70. stealthchop_threshold: 5
  71.  
  72. [bltouch]
  73. sensor_pin: ^PC2
  74. control_pin: PA1
  75. x_offset: -47.5
  76. y_offset: -10
  77. #z_offset: 2.70
  78. speed: 2.0
  79. samples: 2
  80. sample_retract_dist: 4.0
  81. probe_with_touch_mode: True
  82.  
  83.  
  84. [safe_z_home]
  85. home_xy_position: 180, 180
  86. speed: 100
  87. z_hop: 10
  88. z_hop_speed: 5
  89.  
  90. [bed_mesh]
  91. speed: 100
  92. horizontal_move_z: 8
  93. mesh_min: 50, 10
  94. mesh_max: 275, 300
  95. probe_count: 4,4
  96.  
  97. [extruder]
  98. step_pin: PB3
  99. dir_pin: !PB4
  100. enable_pin: !PD2
  101. microsteps: 16
  102. #rotation_distance: 21.775
  103. rotation_distance: 7.62125
  104. nozzle_diameter: 0.400
  105. filament_diameter: 1.750
  106. heater_pin: PC8
  107. sensor_type: EPCOS 100K B57560G104F
  108. ;sensor_type: ATC Semitec 104NT-4-R025H42G
  109. sensor_pin: PA0
  110. #control: pid
  111. ;pid_Kp: 22.2
  112. #pid_Kp: 21.527
  113. ;pid_Ki: 1.08
  114. #pid_Ki: 1.063
  115. ;pid_Kd: 114
  116. #pid_Kd: 108.982
  117. min_temp: 0
  118. max_temp: 300
  119. max_extrude_only_distance: 101
  120.  
  121. [tmc2209 extruder]
  122. uart_pin: PC11
  123. tx_pin: PC10
  124. uart_address: 3
  125. run_current: 0.650
  126. hold_current: 0.500
  127. stealthchop_threshold: 5
  128.  
  129. [heater_bed]
  130. heater_pin: PC9
  131. sensor_type: ATC Semitec 104GT-2
  132. sensor_pin: PC3
  133. #control: pid
  134. #pid_Kp: 690.34
  135. #pid_Ki: 111.47
  136. #pid_Kd: 1068.83
  137. min_temp: 0
  138. max_temp: 130
  139.  
  140. [heater_fan nozzle_cooling_fan]
  141. pin: PC7
  142.  
  143. [fan]
  144. pin: PC6
  145.  
  146. [mcu]
  147. serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_39FFD8054246303721681857-if00
  148. ;serial: /dev/ttyACM0
  149. baud: 250000
  150. #[filament_switch_sensor filament_sensor]
  151. #switch_pin: PC15
  152.  
  153. [filament_switch_sensor switch_sensor]
  154. switch_pin: PC15 # as shown in Figure 2, switch sensor IO is PA0
  155. pause_on_runout: True
  156. runout_gcode:
  157. M117 Filament switch runout
  158. insert_gcode:
  159. M117 Filament switch inserted
  160.  
  161. [filament_motion_sensor encoder_sensor]
  162. switch_pin: PC12 # as shown in Figure 2, motion sensor IO is PC2
  163. detection_length: 2.88 # accuracy of motion sensor 2.88mm
  164. extruder: extruder
  165. pause_on_runout: True
  166. runout_gcode:
  167. M117 Filament encoder runout
  168. insert_gcode:
  169. M117 Filament encoder inserted
  170.  
  171. [printer]
  172. kinematics: cartesian
  173. max_velocity: 300
  174. max_accel: 3000
  175. max_z_velocity: 5
  176. max_z_accel: 100
  177.  
  178. [virtual_sdcard]
  179. path: ~/printer_data/gcodes
  180.  
  181. [display_status]
  182.  
  183. [pause_resume]
  184.  
  185. [gcode_macro START_PRINT]
  186. gcode:
  187. {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
  188. {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
  189. # Start bed heating (but don't wait for it)
  190. M140 S{BED_TEMP}
  191. # Use absolute coordinates
  192. G90
  193. # Reset the G-Code Z offset (adjust Z offset if needed)
  194. SET_GCODE_OFFSET Z=0.0
  195. # Home the printer
  196. G28
  197. # Move the nozzle near the bed
  198. G1 Z5 F3000
  199. # Move the nozzle very close to the bed
  200. G1 Z0.15 F300
  201. # Wait for bed to reach temperature
  202. M190 S{BED_TEMP}
  203. # Set and wait for nozzle to reach temperature
  204. M109 S{EXTRUDER_TEMP}
  205. # Calibrate Bed Mesh
  206. #BED_MESH_CALIBRATE
  207. # Load Bed Mesh
  208. BED_MESH_PROFILE LOAD="default"
  209. # Turn Lights On
  210. POWER_ON_LIGHTS
  211. # Prime Nozzle
  212. PRIME_LINE
  213.  
  214. [gcode_macro PRIME_LINE]
  215. gcode:
  216. G92 E0 ;Reset Extruder
  217. G1 Z2.0 F3000 ;Move Z Axis up
  218. G1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position
  219. G1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line
  220. G1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little
  221. G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line
  222. G92 E0 ;Reset Extruder
  223. G1 Z2.0 F3000 ;Move Z Axis up
  224. G1 E-1 F300 ; retract a little bit
  225.  
  226. [gcode_macro END_PRINT]
  227. gcode:
  228. G91 ;Relative positioning
  229. G1 E-2 F2700 ;Retract a bit
  230. G1 E-2 Z0.2 F2400 ;Retract and raise Z
  231. G1 X5 Y5 F3000 ;Wipe out
  232.  
  233. # Turn off bed, extruder, and fan
  234. M140 S0
  235. M104 S0
  236. M106 S0
  237. # Move nozzle away from print while retracting
  238. G91
  239. G1 X-2 Y-2 E-3 F300
  240. # Raise nozzle by 10mm
  241. G1 Z10 F3000
  242. G90
  243. # Disable steppers
  244. M84
  245.  
  246. [gcode_macro POWER_ON_PRINTER]
  247. gcode:
  248. {action_call_remote_method(
  249. "set_device_power", device="printer_plug", state="on", force=True
  250. )}
  251.  
  252. [gcode_macro POWER_OFF_PRINTER]
  253. gcode:
  254. {action_call_remote_method(
  255. "set_device_power", device="printer_plug", state="off", force=True
  256. )}
  257.  
  258. [gcode_macro POWER_ON_LIGHTS]
  259. gcode:
  260. {action_call_remote_method(
  261. "set_device_power", device="lights_plug", state="on", force=True
  262. )}
  263.  
  264. [gcode_macro POWER_OFF_LIGHTS]
  265. gcode:
  266. {action_call_remote_method(
  267. "set_device_power", device="lights_plug", state="off", force=True
  268. )}
  269. [gcode_macro PAUSE]
  270. rename_existing: BASE_PAUSE
  271. gcode:
  272. # Parameters
  273. {% set z = params.Z|default(10)|int %} ; z hop amount
  274.  
  275. {% if printer['pause_resume'].is_paused|int == 0 %}
  276. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro
  277. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro
  278.  
  279. SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 ; disable filament sensor
  280. SET_FILAMENT_SENSOR SENSOR=switch_sensor ENABLE=0 ; disable filament sensor
  281. SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume
  282. BASE_PAUSE ; pause print
  283. {% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max
  284. G91 ; relative positioning
  285. G1 Z{z} F900 ; raise Z up by z hop amount
  286. {% else %}
  287. { action_respond_info("Pause zhop exceeds maximum Z height.") } ; if z max is exceeded, show message and set zhop value for resume to 0
  288. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
  289. {% endif %}
  290. G90 ; absolute positioning
  291. G1 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_minimum.y+5} F6000 ; park toolhead at front center
  292. SAVE_GCODE_STATE NAME=PAUSEPARK ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error)
  293. M104 S0 ; turn off hotend
  294. SET_IDLE_TIMEOUT TIMEOUT=43200 ; set timeout to 12 hours
  295. {% endif %}
  296.  
  297. [gcode_macro RESUME]
  298. rename_existing: BASE_RESUME
  299. variable_zhop: 0
  300. variable_etemp: 0
  301. gcode:
  302. # Parameters
  303. {% set e = params.E|default(2.5)|int %} ; hotend prime amount (in mm)
  304.  
  305. {% if printer['pause_resume'].is_paused|int == 1 %}
  306. SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1 ; enable filament sensor
  307. SET_FILAMENT_SENSOR SENSOR=switch_sensor ENABLE=1 ; enable filament sensor
  308. #INITIAL_RGB ; reset LCD color
  309. SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
  310. {% if etemp > 0 %}
  311. M109 S{etemp|int} ; wait for hotend to heat back up
  312. {% endif %}
  313. RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=100 ; go back to parked position in case toolhead was moved during pause (otherwise the return zhop can error)
  314. G91 ; relative positioning
  315. M83 ; relative extruder positioning
  316. {% if printer[printer.toolhead.extruder].temperature >= printer.configfile.settings.extruder.min_extrude_temp %}
  317. G1 Z{zhop * -1} E{e} F900 ; prime nozzle by E, lower Z back down
  318. {% else %}
  319. G1 Z{zhop * -1} F900 ; lower Z back down without priming (just in case we are testing the macro with cold hotend)
  320. {% endif %}
  321. RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60 ; restore position
  322. BASE_RESUME ; resume print
  323. {% endif %}
  324.  
  325.  
  326. [gcode_macro CANCEL_PRINT]
  327. rename_existing: BASE_CANCEL_PRINT
  328. gcode:
  329. SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
  330. CLEAR_PAUSE
  331. SDCARD_RESET_FILE
  332. PRINT_END
  333. BASE_CANCEL_PRINT
  334.  
  335. [gcode_macro M600]
  336. gcode:
  337. #LCDRGB R=0 G=1 B=0 ; Turn LCD green
  338. PAUSE ; Pause
  339.  
  340. [static_digital_output usb_pullup_enable]
  341. pins: !PA14
  342.  
  343. [board_pins]
  344. aliases:
  345. # EXP1 header
  346. EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
  347. EXP1_2=PA15, EXP1_4=<RST>, EXP1_6=PB9, EXP1_8=PB15, EXP1_10=<5V>
  348.  
  349. # See the sample-lcd.cfg file for definitions of common LCD displays.
  350. #
  351. [display]
  352. lcd_type: st7920
  353. cs_pin: EXP1_7
  354. sclk_pin: EXP1_6
  355. sid_pin: EXP1_8
  356. encoder_pins: ^EXP1_5, ^EXP1_3
  357. click_pin: ^!EXP1_2
  358.  
  359. [output_pin beeper]
  360. pin: EXP1_1
  361.  
  362. [screws_tilt_adjust]
  363. screw1: 30, 50
  364. screw1_name: front left screw
  365. screw2: 325, 50
  366. screw2_name: front right screw
  367. screw3: 325, 310
  368. screw3_name: rear right screw
  369. screw4: 30, 310
  370. screw4_name: rear left screw
  371. horizontal_move_z: 10.
  372. speed: 50.
  373. screw_thread: CW-M3
  374.  
  375. [delayed_gcode delayed_printer_off]
  376. initial_duration: 0.
  377. gcode:
  378. {% if printer.idle_timeout.state == "Idle" %}
  379. POWER_OFF_PRINTER
  380. {% endif %}
  381.  
  382. [idle_timeout]
  383. gcode:
  384. M84
  385. TURN_OFF_HEATERS
  386. UPDATE_DELAYED_GCODE ID=delayed_printer_off DURATION=60
Advertisement
Add Comment
Please, Sign In to add comment