Advertisement
Guest User

printer.cfg

a guest
Jan 18th, 2022
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.90 KB | None | 0 0
  1. # This file contains pin mappings for the stock 2020 Creality Ender 3
  2. # V2. To use this config, during "make menuconfig" select the
  3. # STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
  4. # communication.
  5.  
  6. # If you prefer a direct serial connection, in "make menuconfig"
  7. # select "Enable extra low-level configuration options" and select
  8. # serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
  9. # cable used for the LCD module as follows:
  10. # 3: Tx, 4: Rx, 9: GND, 10: VCC
  11.  
  12. # Flash this firmware by copying "out/klipper.bin" to a SD card and
  13. # turning on the printer with the card inserted. The firmware
  14. # filename must end in ".bin" and must not match the last filename
  15. # that was flashed.
  16.  
  17. # See docs/Config_Reference.md for a description of parameters.
  18.  
  19. # ================================================================================
  20. [extruder]
  21. max_extrude_only_distance: 100.0
  22. step_pin: PB4
  23. dir_pin: PB3
  24. enable_pin: !PC3
  25. microsteps: 16
  26. rotation_distance: 32.256
  27. nozzle_diameter: 0.400
  28. filament_diameter: 1.750
  29. heater_pin: PA1
  30. sensor_type: EPCOS 100K B57560G104F
  31. sensor_pin: PC5
  32. control: pid
  33. # tuned for stock hardware with 200 degree Celsius target
  34. pid_Kp: 21.527
  35. pid_Ki: 1.063
  36. pid_Kd: 108.982
  37. min_temp: 0
  38. max_temp: 250
  39. pressure_advance: 1.0 ##17JAN2022 PETG
  40. #pressure_advance: 0.540 ##updated 16JAN2022
  41. #pressure_advance: 0.856 ##Updated 14JAN2022
  42. # ================================================================================
  43. [firmware_retraction]
  44. retract_length: 10
  45. retract_speed: 70
  46. #unretract_extra_length: 0
  47. #unretract_speed: 40
  48. # ================================================================================
  49. [heater_bed]
  50. heater_pin: PA2
  51. sensor_type: EPCOS 100K B57560G104F
  52. sensor_pin: PC4
  53. control: pid
  54. # tuned for stock hardware with 50 degree Celsius target
  55. pid_Kp: 54.027
  56. pid_Ki: 0.770
  57. pid_Kd: 948.182
  58. min_temp: 0
  59. max_temp: 130
  60. # ================================================================================
  61. [fan]
  62. pin: PA0
  63. # ================================================================================
  64. [mcu]
  65. serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
  66. restart_method: command
  67. # ================================================================================
  68. [printer]
  69. kinematics: cartesian
  70. max_velocity: 200
  71. max_accel: 1500
  72. max_z_velocity: 5
  73. max_z_accel: 100
  74. # ================================================================================
  75. #[display]
  76. #lcd_type: st7920
  77. #cs_pin: EXP1_7
  78. #sclk_pin: EXP1_6
  79. #sid_pin: EXP1_8
  80. #encoder_pins: ^EXP1_5, ^EXP1_3
  81. #click_pin: ^!EXP1_2
  82. #[output_pin beeper]
  83. #pin: EXP1_1
  84. # ================================================================================
  85. # Stepper Definitions
  86. # ================================================================================
  87. [stepper_x]
  88. step_pin: PC2
  89. dir_pin: PB9
  90. enable_pin: !PC3
  91. microsteps: 16
  92. rotation_distance: 40
  93. endstop_pin: ^PA5
  94. position_endstop: 0
  95. position_max: 250
  96. homing_speed: 25
  97. # ================================================================================
  98. [stepper_y]
  99. step_pin: PB8
  100. dir_pin: PB7
  101. enable_pin: !PC3
  102. microsteps: 16
  103. rotation_distance: 40
  104. endstop_pin: ^PA6
  105. position_endstop: 0
  106. position_max: 250
  107. homing_speed: 25
  108. # ================================================================================
  109. [stepper_z]
  110. step_pin: PB6
  111. dir_pin: !PB5
  112. enable_pin: !PC3
  113. microsteps: 16
  114. rotation_distance: 8
  115. endstop_pin: probe:z_virtual_endstop
  116. position_max: 250
  117. position_min: -5
  118.  
  119. # ================================================================================
  120. # BLTouch Definition
  121. # ================================================================================
  122. [bltouch]
  123. sensor_pin: ^PB1
  124. control_pin: PB0
  125. x_offset: -44
  126. y_offset: -9
  127. z_offset:1.249
  128. speed: 5.0
  129. sample_retract_dist: 8.0
  130. samples: 2
  131. # ================================================================================
  132. [safe_z_home]
  133. home_xy_position: 117.5,117.5 # Change coordinates to the center of your print bed
  134. speed: 25
  135. z_hop: 10 # Move up 10mm
  136. z_hop_speed: 5
  137. # ================================================================================
  138. [bed_mesh]
  139. speed: 120
  140. horizontal_move_z: 5
  141. mesh_min: 15,15
  142. mesh_max: 206,206
  143. probe_count: 3,3
  144. algorithm: bicubic
  145. fade_start: 1
  146. fade_end: 10
  147. fade_target: 0
  148. # ================================================================================
  149. [screws_tilt_adjust]
  150. screw1: 70.5,37.5
  151. screw1_name: front left screw
  152. screw2: 240,37.5
  153. screw2_name: front right screw
  154. screw3: 240,207.5
  155. screw3_name: rear right screw
  156. screw4: 70.5,207.5
  157. screw4_name: rear left screw
  158. horizontal_move_z: 10
  159. speed: 50
  160. screw_thread: CW-M4
  161. # ================================================================================
  162. [virtual_sdcard]
  163. path: ~/gcode_files
  164. # ================================================================================
  165. [display_status]
  166. # ================================================================================
  167. [respond]
  168. default_type: command
  169. [pause_resume] recover_velocity: 50
  170. # ================================================================================
  171. [gcode_macro PAUSE]
  172. description: Pause the actual running print
  173. rename_existing: PAUSE_BASE
  174. # change this if you need more or less extrusion
  175. variable_extrude: 1.0
  176. gcode:
  177. ##### read E from pause macro #####
  178. {% set E = printer["gcode_macro PAUSE"].extrude|float %}
  179. ##### set park positon for x and y #####
  180. # default is your max posion from your printer.cfg
  181. {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  182. {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  183. ##### calculate save lift position #####
  184. {% set max_z = printer.toolhead.axis_maximum.z|float %}
  185. {% set act_z = printer.toolhead.position.z|float %}
  186. {% if act_z < (max_z - 2.0) %}
  187. {% set z_safe = 2.0 %}
  188. {% else %}
  189. {% set z_safe = max_z - act_z %}
  190. {% endif %}
  191. ##### end of definitions #####
  192. PAUSE_BASE
  193. G91
  194. {% if printer.extruder.can_extrude|lower == 'true' %}
  195. G1 E-{E} F2100
  196. {% else %}
  197. {action_respond_info("Extruder not hot enough")}
  198. {% endif %}
  199. {% if "xyz" in printer.toolhead.homed_axes %}
  200. G1 Z{z_safe} F900
  201. G90
  202. G1 X{x_park} Y{y_park} F6000
  203. {% else %}
  204. {action_respond_info("Printer not homed")}
  205. {% endif %}
  206. # ================================================================================
  207. [gcode_macro RESUME]
  208. description: Resume the actual running print
  209. rename_existing: RESUME_BASE
  210. gcode:
  211. ##### read E from pause macro #####
  212. {% set E = printer["gcode_macro PAUSE"].extrude|float %}
  213. #### get VELOCITY parameter if specified ####
  214. {% if 'VELOCITY' in params|upper %}
  215. {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
  216. {%else %}
  217. {% set get_params = "" %}
  218. {% endif %}
  219. ##### end of definitions #####
  220. {% if printer.extruder.can_extrude|lower == 'true' %}
  221. G91
  222. G1 E{E} F2100
  223. {% else %}
  224. {action_respond_info("Extruder not hot enough")}
  225. {% endif %}
  226. RESUME_BASE {get_params}
  227. # ================================================================================
  228. [gcode_macro CANCEL_PRINT]
  229. description: Cancel the actual running print
  230. rename_existing: CANCEL_PRINT_BASE
  231. gcode:
  232. TURN_OFF_HEATERS
  233. CANCEL_PRINT_BASE
  234. # ================================================================================
  235. [gcode_macro G29]
  236. gcode:
  237. BED_MESH_CALIBRATE PROFILE=ender3
  238. BED_MESH_PROFILE LOAD=ender3
  239. SET_GCODE_OFFSET Z=-0.08
  240. # ================================================================================
  241. [gcode_macro START_PRINT]
  242. gcode:
  243. {% set BED_TEMP = params.BED_TEMP|default(60) %}
  244. {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(200) %}
  245. # Set and wait for bed to reach temperature
  246. M190 S{BED_TEMP}
  247. # Pre-heat extruder to 160
  248. M104 S160
  249. # Set GCODE offset
  250. SET_GCODE_OFFSET Z=0
  251. #auto bed leveling create mesh
  252. G29
  253. # Move Z up
  254. G1 Z10.0 F3000
  255. # Reset extruder
  256. G92 E0
  257. # Set extruder temperature
  258. M104 S{EXTRUDER_TEMP}
  259. # Move Z axis up a little to prevent scratching heat bed
  260. G1 Z2.0 F3000
  261. # Move to start position
  262. G1 X0.1 Y20 Z5.0 F5000.0
  263. # Wait for Extruder temperature
  264. M109 S{EXTRUDER_TEMP}
  265. # Move to start for purge line
  266. G1 X0.1 Y20 Z0.3 F5000.0
  267. # Draw 1st line
  268. G1 X0.1 Y150.0 Z0.3 F1500.0 E15
  269. # Move to side a little
  270. G1 X0.4 Y150.0 Z0.3 F5000.0
  271. # Draw 2nd line
  272. G1 X0.4 Y20 Z0.3 F1500.0 E30
  273. # Reset extruder
  274. G92 E0
  275. # Move Z up a little
  276. G1 Z5.0 F3000
  277. # ================================================================================
  278. [gcode_macro END_PRINT]
  279. gcode:
  280. G91
  281. # Retract a bit
  282. G1 E-2 F2700
  283. G1 E-2 Z0.2 F2400
  284. G1 X5 Y5 F3000
  285. # Turn off bed, extruder, and fan
  286. M140 S0
  287. M104 S0
  288. M106 S0
  289. # Raise nozzle by 10mm
  290. G1 Z10 F3000
  291. G90
  292. # Deliver print
  293. G1 X0 Y220
  294. # Disable steppers
  295. M84 X Y E
  296. # Clear bed mesh
  297. BED_MESH_CLEAR
  298. # Turn off gcode offset
  299. SET_GCODE_OFFSET Z=0
  300. # ================================================================================
  301. [gcode_arcs]
  302. resolution: 1.0
  303. # An arc will be split into segments. Each segment's length will
  304. # equal the resolution in mm set above. Lower values will produce a
  305. # finer arc, but also more work for your machine. Arcs smaller than
  306. # the configured value will become straight lines. The default is
  307. # 1mm.
  308.  
  309. #*# <---------------------- SAVE_CONFIG ---------------------->
  310. #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
  311. #*#
  312. #*# [bltouch]
  313. #*#
  314. #*# [bed_mesh ender3]
  315. #*# version = 1
  316. #*# points =
  317. #*# -0.016250, -0.063750, -0.095000
  318. #*# -0.023750, 0.011250, 0.087500
  319. #*# -0.110000, -0.038750, 0.005000
  320. #*# tension = 0.2
  321. #*# mesh_x_pps = 2
  322. #*# algo = bicubic
  323. #*# min_x = 15.0
  324. #*# min_y = 15.0
  325. #*# y_count = 3
  326. #*# mesh_y_pps = 2
  327. #*# x_count = 3
  328. #*# max_x = 206.0
  329. #*# max_y = 206.0
  330.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement