Advertisement
rootiest

Untitled

Oct 12th, 2022
874
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 7.77 KB | None | 0 0
  1. # This file contains common pin mappings for the 2019 Creality
  2. # Ender 5. To use this config, the firmware should be compiled for the
  3. # AVR atmega1284p.
  4.  
  5. # Note, a number of Melzi boards are shipped with a bootloader that
  6. # requires the following command to flash the board:
  7. #  avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
  8. # If the above command does not work and "make flash" does not work
  9. # then one may need to flash a bootloader to the board - see the
  10. # Klipper docs/Bootloaders.md file for more information.
  11.  
  12. # See docs/Config_Reference.md for a description of parameters.
  13.  
  14. [stepper_x]
  15. step_pin: PD7
  16. dir_pin: !PC5
  17. enable_pin: !PD6
  18. microsteps: 16
  19. rotation_distance: 40
  20. endstop_pin: ^PC2
  21. position_endstop: 232
  22. position_max: 232
  23. homing_speed: 30
  24.  
  25. [stepper_y]
  26. step_pin: PC6
  27. dir_pin: !PC7
  28. enable_pin: !PD6
  29. microsteps: 16
  30. rotation_distance: 40
  31. endstop_pin: ^PC3
  32. position_endstop: 232
  33. position_max: 232
  34. homing_speed: 30
  35.  
  36. [stepper_z]
  37. step_pin: PB3
  38. dir_pin: !PB2
  39. enable_pin: !PA5
  40. microsteps: 16
  41. rotation_distance: 4 # Use 4 for Ender5 versions after late 2019
  42. endstop_pin: probe:z_virtual_endstop
  43. #position_endstop: 0.0
  44. position_max: 300
  45. position_min: -5
  46.  
  47. [bltouch]
  48. sensor_pin: ^PC4
  49. control_pin: PA4
  50. #z_offset: 0
  51. x_offset = -43.8 ##!! Measure and change for your own printer!!
  52. y_offset = -6   ##!! Measure and change for your own printer!!
  53. #y_offset = -15.7
  54.  
  55. [safe_z_home]
  56. home_xy_position: 118,121 # Change coordinates to the center of your print bed
  57. speed: 50
  58. z_hop: 10                 # Move up 10mm
  59. z_hop_speed: 5
  60.  
  61. [bed_screws]
  62. screw1: 34, 37
  63. screw2: 204, 37
  64. screw3: 204, 207
  65. screw4: 34, 207
  66.  
  67. [screws_tilt_adjust]
  68. screw1: 77, 43
  69. screw1_name: front left screw
  70. screw2: 229, 43
  71. screw2_name: front right screw
  72. screw3: 229, 213
  73. screw3_name: rear right screw
  74. screw4: 76, 213
  75. screw4_name: rear left screw
  76. horizontal_move_z: 10.
  77. speed: 50.
  78. screw_thread: CW-M3
  79.  
  80. [bed_mesh]
  81. speed: 120
  82. mesh_min: 12,10
  83. mesh_max: 188.2,226
  84. probe_count: 5,5
  85. horizontal_move_z: 7
  86.  
  87. [extruder]
  88. max_extrude_only_distance: 100.0
  89. step_pin: PB1
  90. dir_pin: !PB0
  91. enable_pin: !PD6
  92. microsteps: 16
  93. rotation_distance: 32.67251
  94. nozzle_diameter: 0.400
  95. filament_diameter: 1.750
  96. heater_pin: PD5
  97. sensor_type: EPCOS 100K B57560G104F
  98. sensor_pin: PA7
  99. #control: pid
  100. # tuned for stock hardware with 200 degree Celsius target
  101. #pid_Kp: 26.053
  102. #pid_Ki: 1.654
  103. #pid_Kd: 102.584
  104. min_temp: 0
  105. max_temp: 250
  106.  
  107. [heater_bed]
  108. heater_pin: PD4
  109. sensor_type: EPCOS 100K B57560G104F
  110. sensor_pin: PA6
  111. #control: pid
  112. # tuned for stock hardware with 50 degree Celsius target
  113. #pid_Kp: 74.389
  114. #pid_Ki: 1.698
  115. #pid_Kd: 814.564
  116. min_temp: 0
  117. max_temp: 130
  118.  
  119. [fan]
  120. pin: PB4
  121.  
  122. [mcu]
  123. serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
  124.  
  125. [printer]
  126. kinematics: cartesian
  127. max_velocity: 500
  128. max_accel: 2500
  129. max_z_velocity: 10
  130. max_z_accel: 100
  131.  
  132. [display]
  133. lcd_type: st7920
  134. cs_pin: PA3
  135. sclk_pin: PA1
  136. sid_pin: PC1
  137. encoder_pins: ^PD2, ^PD3
  138. click_pin: ^!PC0
  139.  
  140. [virtual_sdcard]
  141. path: ~/gcode_files
  142.  
  143. [display_status]
  144.  
  145. [pause_resume]
  146.  
  147. [respond]
  148.  
  149. [exclude_object]
  150.  
  151. # Edit the default() value for LENGTH
  152. # Edit the default() value for TARGET
  153. # to the amount of retraction required to unload the filament
  154. [gcode_macro UNLOAD_FILAMENT]
  155. gcode:
  156.  {% set LENGTH = params.LENGTH|default(80)|float %}
  157.   {% set TARGET = params.TARGET|default(240)|float %}
  158.  
  159.   {% set TEMP = printer.extruder.temperature|float %}
  160.   {% if TEMP|int < TARGET|int %}
  161.     M117 Heating nozzle...
  162.     M109 S{TARGET}
  163.   {% endif %}
  164.   ##################
  165.  
  166.   G91
  167.   G1 E5.0 F1200
  168.   G1 E3.0 F1600
  169.   G1 E-13.14 F7000
  170.   G1 E-{LENGTH} F3000
  171.   G90
  172.  
  173. [gcode_macro M600]
  174. gcode:
  175.  SET_IDLE_TIMEOUT TIMEOUT=7200
  176.   PAUSE
  177.   UNLOAD_FILAMENT
  178.  
  179. [gcode_macro PURGE_MACRO]
  180. gcode:
  181.  M117 PURGING..
  182.   G91
  183.   G1 E45.0 F250
  184.   G90
  185.  
  186. # # Edit the default() value for FAST
  187. # to the amount of extrusion required to bring the filament to
  188. # just before it starts coming out the hotend
  189.  
  190. # # Edit the default() value for SLOW
  191. # to the amount of extrusion required after it reaches the hotend
  192.  
  193. [gcode_macro LOAD_FILAMENT]
  194. gcode:
  195.  {% set SLOW = params.SLOW|default(60)|float %}
  196.   {% set FAST = params.FAST|default(80)|float %}
  197.   M117  LOADING...
  198.   G91
  199.   G1 E25.0 F1000
  200.   G1 E{FAST} F2500
  201.   G4 P900
  202.   G1 E{SLOW} F250
  203.   G90
  204.  
  205. [gcode_macro PAUSE]
  206. description: Pause the actual running print
  207. rename_existing: PAUSE_BASE
  208. gcode:
  209.  PAUSE_BASE
  210.   _TOOLHEAD_PARK_PAUSE_CANCEL
  211.  
  212. [gcode_macro RESUME]
  213. description: Resume the actual running print
  214. rename_existing: RESUME_BASE
  215. gcode:
  216.  ##### read extrude from  _TOOLHEAD_PARK_PAUSE_CANCEL  macro #####
  217.   {% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
  218.   #### get VELOCITY parameter if specified ####
  219.   {% if 'VELOCITY' in params|upper %}
  220.     {% set get_params = ('VELOCITY=' + params.VELOCITY)  %}
  221.   {%else %}
  222.     {% set get_params = "" %}
  223.   {% endif %}
  224.   ##### end of definitions #####
  225.   {% if printer.extruder.can_extrude|lower == 'true' %}
  226.     M83
  227.     G1 E{extrude} F2100
  228.     {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  229.   {% else %}
  230.     {action_respond_info("Extruder not hot enough")}
  231.   {% endif %}  
  232.   RESUME_BASE {get_params}
  233.  
  234. [gcode_macro CANCEL_PRINT]
  235. description: Cancel the actual running print
  236. rename_existing: CANCEL_PRINT_BASE
  237. variable_park: True
  238. gcode:
  239.  ## Move head and retract only if not already in the pause state and park set to true
  240.   {% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
  241.     _TOOLHEAD_PARK_PAUSE_CANCEL
  242.   {% endif %}
  243.   TURN_OFF_HEATERS
  244.   CANCEL_PRINT_BASE
  245.  
  246. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  247. description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
  248. variable_extrude: 1.0
  249. gcode:
  250.  ##### set park positon for x and y #####
  251.   # default is your max posion from your printer.cfg
  252.   {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  253.   {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  254.   {% set z_park_delta = 2.0 %}
  255.   ##### calculate save lift position #####
  256.   {% set max_z = printer.toolhead.axis_maximum.z|float %}
  257.   {% set act_z = printer.toolhead.position.z|float %}
  258.   {% if act_z < (max_z - z_park_delta) %}
  259.     {% set z_safe = z_park_delta %}
  260.   {% else %}
  261.     {% set z_safe = max_z - act_z %}
  262.   {% endif %}
  263.   ##### end of definitions #####
  264.   {% if printer.extruder.can_extrude|lower == 'true' %}
  265.     M83
  266.     G1 E-{extrude} F2100
  267.     {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  268.   {% else %}
  269.     {action_respond_info("Extruder not hot enough")}
  270.   {% endif %}
  271.   {% if "xyz" in printer.toolhead.homed_axes %}
  272.     G91
  273.     G1 Z{z_safe} F900
  274.     G90
  275.     G1 X{x_park} Y{y_park} F6000
  276.     {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
  277.   {% else %}
  278.     {action_respond_info("Printer not homed")}
  279.   {% endif %}
  280.  
  281. #*# <---------------------- SAVE_CONFIG ---------------------->
  282. #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
  283. #*#
  284. #*# [heater_bed]
  285. #*# control = pid
  286. #*# pid_kp = 72.864
  287. #*# pid_ki = 1.630
  288. #*# pid_kd = 814.255
  289. #*#
  290. #*# [bltouch]
  291. #*# z_offset = 2.200
  292. #*#
  293. #*# [bed_mesh default]
  294. #*# version = 1
  295. #*# points =
  296. #*#     -0.040000, -0.056250, -0.057500, -0.076250, -0.061250
  297. #*#     -0.082500, -0.087500, -0.061250, -0.106250, -0.076250
  298. #*#     -0.122500, -0.126250, -0.128750, -0.158750, -0.125000
  299. #*#     -0.153750, -0.147500, -0.155000, -0.180000, -0.153750
  300. #*#     -0.161250, -0.165000, -0.156250, -0.171250, -0.141250
  301. #*# tension = 0.2
  302. #*# min_x = 12.0
  303. #*# algo = lagrange
  304. #*# y_count = 5
  305. #*# mesh_y_pps = 2
  306. #*# min_y = 10.0
  307. #*# x_count = 5
  308. #*# max_y = 226.0
  309. #*# mesh_x_pps = 2
  310. #*# max_x = 188.2
  311. #*#
  312. #*# [extruder]
  313. #*# control = pid
  314. #*# pid_kp = 25.831
  315. #*# pid_ki = 1.580
  316. #*# pid_kd = 105.584
  317.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement