Advertisement
Guest User

Untitled

a guest
Aug 29th, 2023
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.42 KB | None | 0 0
  1. #
  2. # Klipper configuration file for Anycubic i3 MEGA S
  3. #
  4. # This config file contains settings of all printer pins (steppers, sensors) for Anycubic i3 mega S in the factory configuration
  5. # Klipper firmware should be compiled for the atmega2560
  6. #
  7. # Config file includes
  8. # - Original or 2208(2209) rotated by cabel drivers
  9. # - Mesh bed leveling: BLtouch (3DTouch sensor from Triangelab)
  10. # - Manual meshed bed leveling (commented out)
  11. # - 'virtual_sdcard' for fast printing without gaps
  12. # - Beeper through M300 gcode
  13. # - Pause/Resume through M600 for filament change
  14. #
  15. # Home position is determined by 3DTouch. Z limit switches are not used.
  16. #
  17. # The latest version of the config reference is also available online at:
  18. # https://www.klipper3d.org/Config_Reference.html
  19.  
  20.  
  21. [stepper_x]
  22. step_pin = ar54
  23. dir_pin = !ar55
  24. enable_pin = !ar38
  25. #step_distance = .0125
  26. microsteps: 16
  27. rotation_distance: 40
  28. endstop_pin = ^!ar3
  29. position_min = -5
  30. position_endstop = -5
  31. position_max = 210
  32. homing_speed = 30
  33. homing_retract_dist = 5
  34. second_homing_speed = 10
  35.  
  36.  
  37. [stepper_y]
  38. step_pin = ar60
  39. dir_pin = ar61
  40. enable_pin = !ar56
  41. #step_distance = .0125
  42. microsteps: 16
  43. rotation_distance: 40
  44. endstop_pin = ^!ar42
  45. position_endstop = 0
  46. position_max = 210
  47. homing_speed = 50
  48. homing_retract_dist = 5
  49. second_homing_speed = 10
  50.  
  51.  
  52. [stepper_z]
  53. step_pin = ar46
  54. dir_pin = ar48
  55. enable_pin = !ar62
  56. #step_distance = .0025
  57. microsteps: 16
  58. rotation_distance: 8
  59.  
  60. ## uncomment below for 3dtouch. comment for mannual mesh bed leveling
  61. #endstop_pin = probe:z_virtual_endstop
  62. ## comment 2 lines below for 3dtouch bed leveling and to disable Z limit switches
  63. endstop_pin = ^!ar18
  64. position_endstop = 0.0
  65.  
  66. position_max = 205
  67. homing_speed = 10
  68. homing_retract_dist = 5
  69. second_homing_speed = 3
  70.  
  71.  
  72. [stepper_z1]
  73. step_pin = ar36
  74. dir_pin = ar34
  75.  
  76.  
  77. ## comment below for 3dtouch bed leveling and to disable Z limit switches
  78. endstop_pin = ^!ar43
  79.  
  80. enable_pin = !ar30
  81. #step_distance = .0025
  82. microsteps: 16
  83. rotation_distance: 8
  84.  
  85.  
  86. [extruder]
  87. step_pin = ar26
  88. dir_pin = ar28
  89. enable_pin = !ar24
  90. control = pid
  91.  
  92. ## original extruder stepper motor
  93. #step_distance = .00247
  94. microsteps: 16
  95. rotation_distance: 7.495
  96. ## NEMA17 23mm stepper motor
  97. #step_distance = .00236
  98.  
  99. nozzle_diameter = 0.400
  100. filament_diameter = 1.750
  101. heater_pin = ar10
  102. sensor_type = ATC Semitec 104GT-2
  103. sensor_pin = analog13
  104. min_temp = 0
  105. max_temp = 285
  106. max_extrude_only_distance = 150.0
  107. smooth_time = 1
  108. min_extrude_temp = 180
  109. pressure_advance = 0.1
  110. max_extrude_cross_section = 150
  111.  
  112.  
  113. [heater_fan extruder_fan]
  114. pin = ar44
  115.  
  116. [heater_bed]
  117. heater_pin = ar8
  118. sensor_type = EPCOS 100K B57560G104F
  119. sensor_pin = analog14
  120. min_temp = 0
  121. max_temp = 110
  122. smooth_time = 1
  123. control = pid
  124.  
  125.  
  126. [fan]
  127. pin = ar9
  128.  
  129. [mcu]
  130. serial = /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
  131. #pin_map = arduino
  132.  
  133. [printer]
  134. kinematics = cartesian
  135. max_velocity = 300
  136. max_accel = 4000
  137. max_accel_to_decel = 1500
  138. max_z_velocity = 7
  139. max_z_accel = 190
  140. square_corner_velocity = 5
  141.  
  142.  
  143. ## do your own measurement
  144. ## https://www.klipper3d.org/Resonance_Compensation.html
  145. #[input_shaper]
  146. #shaper_type_x = 3hump_ei
  147. #shaper_freq_x = 73.0
  148. #shaper_type_y = 3hump_ei
  149. #shaper_freq_y = 60.0
  150.  
  151.  
  152. [heater_fan stepstick_fan]
  153. pin = ar7
  154.  
  155. #[bltouch]
  156. #sensor_pin = ^ar2
  157. #control_pin = ar11
  158.  
  159.  
  160. ## do your own measurement
  161. #x_offset = 20
  162. #y_offset = -14
  163. #z_offset = 1.17
  164.  
  165.  
  166. [safe_z_home]
  167. home_xy_position = 100,100
  168. speed = 150
  169. z_hop = 5
  170. z_hop_speed = 10
  171.  
  172.  
  173. ## bltouch mesh bed leveling
  174. #[bed_mesh]
  175. #speed = 200
  176. #horizontal_move_z = 5
  177. #mesh_min = 23,28
  178. #mesh_max = 190,190
  179. #probe_count = 4,4
  180. #fade_start = 1.0
  181. #fade_end = 10.0
  182. #algorithm = bicubic
  183.  
  184.  
  185. ## manual mesh bed leveling
  186. [bed_mesh]
  187. speed = 50
  188. horizontal_move_z = 5
  189. mesh_min = 30,30
  190. mesh_max = 180,180
  191. probe_count = 5,5
  192. fade_start = 1.0
  193. fade_end = 10.0
  194.  
  195.  
  196. # enable moving befor homing
  197. ## put in terminal:
  198. ## SET_KINEMATIC_POSITION X=100 Y=100 Z=100
  199. ## then move as usual
  200. [force_move]
  201. enable_force_move: True
  202.  
  203.  
  204. [virtual_sdcard]
  205. path: ~/.octoprint/uploads/
  206.  
  207.  
  208. [output_pin BEEPER_pin]
  209. pin: ar31
  210. pwm: True
  211. value: 0
  212. shutdown_value: 0
  213. cycle_time: 0.001
  214. scale: 1000
  215.  
  216.  
  217. [gcode_macro M300]
  218. #default_parameter_S: 1000
  219. #default_parameter_P: 100
  220. gcode:
  221. {% set S = params.S|default(1000) %}
  222. {% set P = params.P|default(100) %}
  223. SET_PIN PIN=BEEPER_pin VALUE={S}
  224. G4 P{P}
  225. SET_PIN PIN=BEEPER_pin VALUE=0
  226.  
  227.  
  228. [display_status]
  229.  
  230.  
  231. # change filament
  232. [pause_resume]
  233.  
  234.  
  235. [gcode_macro M600]
  236. #default_parameter_X: 50
  237. #default_parameter_Y: 0
  238. #default_parameter_Z: 10
  239. gcode:
  240. {% set X = params.X|default(50) %}
  241. {% set Y = params.Y|default(0) %}
  242. {% set Z = params.Z|default(10) %}
  243. SAVE_GCODE_STATE NAME=M600_state
  244. PAUSE
  245. G91
  246. G1 E-.8 F2700
  247. G1 Z{Z}
  248. G90
  249. G1 X{X} Y{Y} F3000
  250. G91
  251. G1 E-150 F1000
  252. M300 S299 P200
  253. M300 S299 P200
  254. M300 S299 P200
  255. M300 S299 P200
  256. M300 S299 P200
  257. RESTORE_GCODE_STATE NAME=M600_state
  258.  
  259. [gcode_macro PAUSE]
  260. rename_existing: BASE_PAUSE
  261. # change this if you need more or less extrusion
  262. variable_extrude: 1.0
  263. gcode:
  264. ##### read E from pause macro #####
  265. {% set E = printer["gcode_macro PAUSE"].extrude|float %}
  266. ##### set park positon for x and y #####
  267. # default is your max posion from your printer.cfg
  268. {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  269. {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  270. ##### calculate save lift position #####
  271. {% set max_z = printer.toolhead.axis_maximum.z|float %}
  272. {% set act_z = printer.toolhead.position.z|float %}
  273. {% if act_z < (max_z - 2.0) %}
  274. {% set z_safe = 2.0 %}
  275. {% else %}
  276. {% set z_safe = max_z - act_z %}
  277. {% endif %}
  278. ##### end of definitions #####
  279. SAVE_GCODE_STATE NAME=PAUSE_state
  280. BASE_PAUSE
  281. G91
  282. G1 E-{E} F2100
  283. G1 Z{z_safe} F900
  284. G90
  285. G1 X{x_park} Y{y_park} F6000
  286.  
  287.  
  288. [gcode_macro RESUME]
  289. rename_existing: BASE_RESUME
  290. gcode:
  291. ##### read E from pause macro #####
  292. {% set E = printer["gcode_macro PAUSE"].extrude|float %}
  293. ##### end of definitions #####
  294. G91
  295. G1 E{E} F2100
  296. RESTORE_GCODE_STATE NAME=PAUSE_state
  297. BASE_RESUME
  298.  
  299.  
  300. [gcode_macro CANCEL_PRINT]
  301. rename_existing: BASE_CANCEL_PRINT
  302. gcode:
  303. TURN_OFF_HEATERS
  304. CLEAR_PAUSE
  305. SDCARD_RESET_FILE
  306. BASE_CANCEL_PRINT
  307.  
  308. [gcode_macro START_PRINT]
  309. gcode:
  310. {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
  311. {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
  312. G21 #metric values
  313. G90 #absolute positioning
  314. M82 #set extruder to absolute mode
  315. M107 #start with the fan off
  316. M190 S{BED_TEMP} #preheat and wait for bed
  317. M109 S{EXTRUDER_TEMP} #preheat and wait for hotend
  318. M300 S1000 P500 #BEEP heating done
  319. G28 X0 Y10 Z0 #move X/Y to min endstops
  320. M420 S1 #Enable leveling
  321. M420 Z5.0 #Set leveling fading height to 5 mm
  322. G0 Z0.15 #lift nozzle a bit
  323. G0 Y10 #move 10mm in Y to prevent a crash with bed clips
  324. G92 E0 #zero the extruded length
  325. G1 X50 E50 F500 #Extrude 50mm of filament in a 5cm line.
  326. G92 E0 #zero the extruded length again
  327. G1 E-3 F500 #Retract a little
  328. G1 X120 F4000 #Quickly wipe away from the filament line
  329.  
  330. # Start bed heating
  331. #M140 S{BED_TEMP}
  332. # Use absolute coordinates
  333. #G90
  334. # Reset the G-Code Z offset (adjust Z offset if needed)
  335. #SET_GCODE_OFFSET Z=0.0
  336. # Home the printer
  337. #G28
  338. # Move the nozzle near the bed
  339. #G1 Z5 F3000
  340. # Move the nozzle very close to the bed
  341. #G1 Z0.15 F300
  342. # Wait for bed to reach temperature
  343. #M190 S{BED_TEMP}
  344. # Set and wait for nozzle to reach temperature
  345. #M109 S{EXTRUDER_TEMP}
  346.  
  347. [gcode_macro END_PRINT]
  348. gcode:
  349. M104 S0 #Extruder off
  350. M140 S0 #Heatbed off
  351. M107 #Fan off
  352. G91 #relative positioning
  353. G1 E-5 F300 #retract a little
  354. G1 Z+10 #lift print head
  355. G28 X0 Y0 #homing
  356. G1 Y180 F2000 #reset feedrate
  357. M84 #disable stepper motors
  358. G90 #absolute positioning
  359. M300 S440 P200 #Make Print Completed Tones
  360. M300 S660 P250 #beep
  361. M300 S880 P300 #beep
  362.  
  363. # Turn off bed, extruder, and fan
  364. #M140 S0
  365. #M104 S0
  366. #M106 S0
  367. # Move nozzle away from print while retracting
  368. #G91
  369. #G1 X-2 Y-2 E-3 F300
  370. # Raise nozzle by 10mm
  371. #G1 Z10 F3000
  372. #G90
  373. # Disable steppers
  374. #M84
  375.  
  376. ## for Measuring Resonances through Raspberry pi
  377. ## https://www.klipper3d.org/Measuring_Resonances.html
  378.  
  379. #[mcu rpi]
  380. #serial = /tmp/klipper_host_mcu
  381.  
  382. #[adxl345]
  383. #cs_pin: rpi:None
  384.  
  385. #[resonance_tester]
  386. #accel_chip: adxl345
  387. #probe_points:
  388. # 100,100,20 # an example
  389.  
  390. #*# <---------------------- SAVE_CONFIG ---------------------->
  391. #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
  392. #*#
  393. #*# [heater_bed]
  394. #*# pid_kp = 73.627
  395. #*# pid_ki = 3.272
  396. #*# pid_kd = 414.154
  397. #*# control = pid
  398. #*#
  399. #*# [bed_mesh default]
  400. #*# version = 1
  401. #*# points =
  402. #*# 0.082500, 0.032500, 0.005000, 0.030000
  403. #*# 0.072500, -0.007500, -0.002500, -0.012500
  404. #*# 0.077500, 0.027500, -0.007500, 0.017500
  405. #*# 0.077500, 0.030000, 0.002500, 0.007500
  406. #*# tension = 0.2
  407. #*# min_x = 23.0
  408. #*# algo = bicubic
  409. #*# y_count = 4
  410. #*# mesh_y_pps = 2
  411. #*# min_y = 28.0
  412. #*# x_count = 4
  413. #*# max_y = 190.0
  414. #*# mesh_x_pps = 2
  415. #*# max_x = 189.97
  416. #*#
  417. #*# [input_shaper]
  418. #*# shaper_type_x = 3hump_ei
  419. #*# shaper_freq_x = 73.0
  420. #*# shaper_type_y = 3hump_ei
  421. #*# shaper_freq_y = 60.0
  422. #*#
  423. #*# [extruder]
  424. #*# control = pid
  425. #*# pid_kp = 26.839
  426. #*# pid_ki = 1.612
  427. #*# pid_kd = 111.716
  428.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement