Advertisement
stork13

Klipper_cfg

Dec 22nd, 2021
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.47 KB | None | 0 0
  1. mainsail.cfg
  2.  
  3. [virtual_sdcard]
  4. path: /home/pi/gcode_files
  5.  
  6. [pause_resume]
  7.  
  8. [display_status]
  9.  
  10. [gcode_macro CANCEL_PRINT]
  11. description: Cancel the actual running print
  12. rename_existing: CANCEL_PRINT_BASE
  13. gcode:
  14. TURN_OFF_HEATERS
  15. CANCEL_PRINT_BASE
  16.  
  17. [gcode_macro PAUSE]
  18. description: Pause the actual running print
  19. rename_existing: PAUSE_BASE
  20. # change this if you need more or less extrusion
  21. variable_extrude: 1.0
  22. gcode:
  23. ##### read E from pause macro #####
  24. {% set E = printer["gcode_macro PAUSE"].extrude|float %}
  25. ##### set park positon for x and y #####
  26. # default is your max posion from your printer.cfg
  27. {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  28. {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  29. ##### calculate save lift position #####
  30. {% set max_z = printer.toolhead.axis_maximum.z|float %}
  31. {% set act_z = printer.toolhead.position.z|float %}
  32. {% if act_z < (max_z - 2.0) %}
  33. {% set z_safe = 2.0 %}
  34. {% else %}
  35. {% set z_safe = max_z - act_z %}
  36. {% endif %}
  37. ##### end of definitions #####
  38. PAUSE_BASE
  39. G91
  40. {% if printer.extruder.can_extrude|lower == 'true' %}
  41. G1 E-{E} F2100
  42. {% else %}
  43. {action_respond_info("Extruder not hot enough")}
  44. {% endif %}
  45. {% if "xyz" in printer.toolhead.homed_axes %}
  46. G1 Z{z_safe} F900
  47. G90
  48. G1 X{x_park} Y{y_park} F6000
  49. {% else %}
  50. {action_respond_info("Printer not homed")}
  51. {% endif %}
  52.  
  53. [gcode_macro RESUME]
  54. description: Resume the actual running print
  55. rename_existing: RESUME_BASE
  56. gcode:
  57. ##### read E from pause macro #####
  58. {% set E = printer["gcode_macro PAUSE"].extrude|float %}
  59. #### get VELOCITY parameter if specified ####
  60. {% if 'VELOCITY' in params|upper %}
  61. {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
  62. {%else %}
  63. {% set get_params = "" %}
  64. {% endif %}
  65. ##### end of definitions #####
  66. {% if printer.extruder.can_extrude|lower == 'true' %}
  67. G91
  68. G1 E{E} F2100
  69. {% else %}
  70. {action_respond_info("Extruder not hot enough")}
  71. {% endif %}
  72. RESUME_BASE {get_params}
  73.  
  74. ___________________________________________________________________________
  75.  
  76. printer.cfg
  77.  
  78. # This file contains pin mappings for the stock 2020 Creality Ender 3
  79. # V2. To use this config, during "make menuconfig" select the
  80. # STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
  81. # communication.
  82.  
  83. # If you prefer a direct serial connection, in "make menuconfig"
  84. # select "Enable extra low-level configuration options" and select
  85. # serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
  86. # cable used for the LCD module as follows:
  87. # 3: Tx, 4: Rx, 9: GND, 10: VCC
  88.  
  89. # Flash this firmware by copying "out/klipper.bin" to a SD card and
  90. # turning on the printer with the card inserted. The firmware
  91. # filename must end in ".bin" and must not match the last filename
  92. # that was flashed.
  93.  
  94. # See docs/Config_Reference.md for a description of parameters.
  95.  
  96. [include mainsail.cfg]
  97.  
  98. [gcode_macro PAUSE]
  99. description: Pause the actual running print
  100. rename_existing: PAUSE_BASE
  101. gcode:
  102. ##### set defaults #####
  103. {% set x = params.X|default(230) %} #edit to your park position
  104. {% set y = params.Y|default(230) %} #edit to your park position
  105. {% set z = params.Z|default(10)|float %} #edit to your park position
  106. {% set e = params.E|default(1) %} #edit to your retract length
  107. ##### calculate save lift position #####
  108. {% set max_z = printer.toolhead.axis_maximum.z|float %}
  109. {% set act_z = printer.toolhead.position.z|float %}
  110. {% set lift_z = z|abs %}
  111. {% if act_z < (max_z - lift_z) %}
  112. {% set z_safe = lift_z %}
  113. {% else %}
  114. {% set z_safe = max_z - act_z %}
  115. {% endif %}
  116. ##### end of definitions #####
  117. PAUSE_BASE
  118. G91
  119. {% if printer.extruder.can_extrude|lower == 'true' %}
  120. G1 E-{e} F2100
  121. {% else %}
  122. {action_respond_info("Extruder not hot enough")}
  123. {% endif %}
  124. {% if "xyz" in printer.toolhead.homed_axes %}
  125. G1 Z{z_safe}
  126. G90
  127. G1 X{x} Y{y} F6000
  128. {% else %}
  129. {action_respond_info("Printer not homed")}
  130. {% endif %}
  131.  
  132. [gcode_macro RESUME]
  133. description: Resume the actual running print
  134. rename_existing: RESUME_BASE
  135. gcode:
  136. ##### set defaults #####
  137. {% set e = params.E|default(1) %} #edit to your retract length
  138. #### get VELOCITY parameter if specified ####
  139. {% if 'VELOCITY' in params|upper %}
  140. {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
  141. {%else %}
  142. {% set get_params = "" %}
  143. {% endif %}
  144. ##### end of definitions #####
  145. G91
  146. {% if printer.extruder.can_extrude|lower == 'true' %}
  147. G1 E{e} F2100
  148. {% else %}
  149. {action_respond_info("Extruder not hot enough")}
  150. {% endif %}
  151. RESUME_BASE {get_params}
  152.  
  153. [gcode_macro CANCEL_PRINT]
  154. description: Cancel the actual running print
  155. rename_existing: CANCEL_PRINT_BASE
  156. gcode:
  157. TURN_OFF_HEATERS
  158. CANCEL_PRINT_BASE
  159.  
  160. [stepper_x]
  161. step_pin: PC2
  162. dir_pin: PB9
  163. enable_pin: !PC3
  164. microsteps: 16
  165. rotation_distance: 40
  166. endstop_pin: ^PA5
  167. position_endstop: 0
  168. position_max: 235
  169. homing_speed: 50
  170. homing_retract_dist: 0
  171.  
  172. [stepper_y]
  173. step_pin: PB8
  174. dir_pin: PB7
  175. enable_pin: !PC3
  176. microsteps: 16
  177. rotation_distance: 40
  178. endstop_pin: ^PA6
  179. position_endstop: 0
  180. position_max: 235
  181. homing_speed: 50
  182. homing_retract_dist: 0
  183.  
  184. [stepper_z]
  185. step_pin: PB6
  186. dir_pin: !PB5
  187. enable_pin: !PC3
  188. microsteps: 16
  189. rotation_distance: 8
  190. endstop_pin: ^PA7
  191. position_endstop: 0.0
  192. position_max: 250
  193. #homing_retract_dist: 0
  194.  
  195. [extruder]
  196. max_extrude_only_distance: 100.0
  197. step_pin: PB4
  198. dir_pin: PB3
  199. enable_pin: !PC3
  200. microsteps: 16
  201. rotation_distance: 34.406
  202. nozzle_diameter: 0.400
  203. filament_diameter: 1.750
  204. heater_pin: PA1
  205. sensor_type: EPCOS 100K B57560G104F
  206. sensor_pin: PC5
  207. control: pid
  208. # tuned for stock hardware with 200 degree Celsius target
  209. pid_Kp: 21.527
  210. pid_Ki: 1.063
  211. pid_Kd: 108.982
  212. min_temp: 0
  213. max_temp: 250
  214.  
  215. [heater_bed]
  216. heater_pin: PA2
  217. sensor_type: EPCOS 100K B57560G104F
  218. sensor_pin: PC4
  219. control: pid
  220. # tuned for stock hardware with 50 degree Celsius target
  221. pid_Kp: 54.027
  222. pid_Ki: 0.770
  223. pid_Kd: 948.182
  224. min_temp: 0
  225. max_temp: 130
  226.  
  227. [fan]
  228. pin: PA0
  229.  
  230. [mcu]
  231. serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
  232. restart_method: command
  233.  
  234. [printer]
  235. kinematics: cartesian
  236. max_velocity: 300
  237. max_accel: 3000
  238. max_z_velocity: 5
  239. max_z_accel: 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement