Guest User

Untitled

a guest
May 27th, 2024
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.86 KB | None | 0 0
  1. #370021001047323237363638# This file contains common pin mappings for the BigTreeTech Octopus X7
  2. # To use this config, the firmware should be compiled for the STM32F407 with a "32KiB bootloader"
  3.  
  4. # after running "make", copy the generated "klipper/out/klipper.bin" file to a
  5. # file named "firmware.bin" on an SD card and then restart the OctoPus with that SD card.
  6.  
  7. # See docs/Config_Reference.md for a description of parameters.
  8.  
  9. ## Formbot / Vivedino Troodon 2.0
  10. ## Firmware Version: 1.2
  11. ## Compiled By: YGK3D
  12. ## Release Date: 02/09/23
  13.  
  14. ## *** THINGS TO CHANGE/CHECK: ***
  15. ## MCU paths [mcu] section
  16. ## Thermistor types [extruder] and [heater_bed] sections - See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types
  17. ## Z Endstop Switch location [safe_z_home] section
  18. ## Homing end position [gcode_macro G32] section
  19. ## Z Endstop Switch offset for Z0 [stepper_z] section
  20. ## Probe points [quad_gantry_level] section
  21. ## Min & Max gantry corner postions [quad_gantry_level] section
  22. ## PID tune [extruder] and [heater_bed] sections
  23. ## Probe pin [probe] section
  24. ## Fine tune E steps [extruder] section
  25.  
  26. [include mainsail.cfg]
  27.  
  28. [mcu]
  29. ## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
  30. ##--------------------------------------------------------------------
  31. serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_3F001F001147313335343634-if00
  32. restart_method: command
  33. ##--------------------------------------------------------------------
  34.  
  35. [printer]
  36. kinematics: corexy
  37. max_velocity: 300
  38. max_accel: 3000 #Max 4000
  39. max_z_velocity: 15 #Max 15 for 12V TMC Drivers, can increase for 24V
  40. max_z_accel: 350
  41. square_corner_velocity: 5.0
  42.  
  43. #####################################################################
  44. # X/Y Stepper Settings
  45. #####################################################################
  46.  
  47. ## B Stepper - Left
  48. ## Connected to MOTOR_0
  49. ## Endstop connected to DIAG_0
  50. [stepper_x]
  51. step_pin: PA3
  52. dir_pin: PA4
  53. enable_pin: !PA1
  54. rotation_distance: 40
  55. microsteps: 32
  56. full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
  57. endstop_pin: PF2
  58. position_min: 0
  59. ##--------------------------------------------------------------------
  60.  
  61. ## Uncomment below for 250mm build
  62. #position_endstop: 250
  63. #position_max: 250
  64.  
  65. ## Uncomment for 300mm build
  66. #position_endstop: 300
  67. #position_max: 300
  68.  
  69. ## Uncomment for 350mm build
  70. position_endstop: 350
  71. position_max: 350
  72.  
  73. ##--------------------------------------------------------------------
  74. homing_speed: 50 #Max 100
  75. homing_retract_dist: 5
  76. homing_positive_dir: true
  77.  
  78. ## Make sure to update below for your relevant driver (2208 or 2209)
  79. [tmc2209 stepper_x]
  80. uart_pin: PA2
  81. interpolate: false
  82. run_current: 0.8
  83. sense_resistor: 0.110
  84. stealthchop_threshold: 0
  85.  
  86. ## A Stepper - Right
  87. ## Connected to MOTOR_1
  88. ## Endstop connected to DIAG_1
  89. [stepper_y]
  90. step_pin: PC2
  91. dir_pin: PC3
  92. enable_pin: !PC1
  93. rotation_distance: 40
  94. microsteps: 32
  95. full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
  96. endstop_pin: PC15
  97. position_min: 0
  98. ##--------------------------------------------------------------------
  99.  
  100. ## Uncomment for 250mm build
  101. #position_endstop: 250
  102. #position_max: 250
  103.  
  104. ## Uncomment for 300mm build
  105. #position_endstop: 300
  106. #position_max: 300
  107.  
  108. ## Uncomment for 350mm build
  109. position_endstop: 355
  110. position_max: 355
  111.  
  112. ##--------------------------------------------------------------------
  113. homing_speed: 50 #Max 100
  114. homing_retract_dist: 5
  115. homing_positive_dir: true
  116.  
  117. ## Make sure to update below for your relevant driver (2208 or 2209)
  118. [tmc2209 stepper_y]
  119. uart_pin: PC0
  120. interpolate: false
  121. run_current: 0.8
  122. sense_resistor: 0.110
  123. stealthchop_threshold: 0
  124.  
  125. #####################################################################
  126. # Z Stepper Settings
  127. #####################################################################
  128.  
  129. ## Z0 Stepper - Front Left
  130. ## Connected to MOTOR_4
  131. ## Endstop connected to DIAG_4
  132. [stepper_z]
  133. step_pin: PB10
  134. dir_pin: PB11
  135. enable_pin: !PE15
  136. rotation_distance: 40
  137. gear_ratio: 80:16
  138. microsteps: 32
  139. #endstop_pin: PF4
  140. endstop_pin:probe:z_virtual_endstop
  141. ## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0)
  142. ## (+) value = endstop above Z0, (-) value = endstop below
  143. ## Increasing position_endstop brings nozzle closer to the bed
  144. ## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config
  145. #position_endstop: 0
  146. ##--------------------------------------------------------------------
  147.  
  148. ## Uncomment below for 250mm build
  149. #position_max: 210
  150.  
  151. ## Uncomment below for 300mm build
  152. #position_max: 260
  153.  
  154. ## Uncomment below for 350mm build
  155. position_max: 310
  156.  
  157. ##--------------------------------------------------------------------
  158. position_min: -5
  159. homing_speed: 8
  160. second_homing_speed: 3
  161. homing_retract_dist: 3
  162.  
  163. ## Make sure to update below for your relevant driver (2208 or 2209)
  164. [tmc2209 stepper_z]
  165. uart_pin: PE14
  166. interpolate: false
  167. run_current: 0.8
  168. sense_resistor: 0.110
  169. stealthchop_threshold: 0
  170.  
  171. ## Z1 Stepper - Rear Left
  172. ## Connected to MOTOR_3
  173. [stepper_z1]
  174. step_pin: PE11
  175. dir_pin: !PE12
  176. enable_pin: !PE10
  177. rotation_distance: 40
  178. gear_ratio: 80:16
  179. microsteps: 32
  180.  
  181. ## Make sure to update below for your relevant driver (2208 or 2209)
  182. [tmc2209 stepper_z1]
  183. uart_pin: PE9
  184. interpolate: false
  185. run_current: 0.8
  186. sense_resistor: 0.110
  187. stealthchop_threshold: 0
  188.  
  189. ## Z2 Stepper - Rear Right
  190. ## Connected to MOTOR_6
  191. [stepper_z2]
  192. step_pin: PE7
  193. dir_pin: PE8
  194. enable_pin: !PG1
  195. rotation_distance: 40
  196. gear_ratio: 80:16
  197. microsteps: 32
  198.  
  199. ## Make sure to update below for your relevant driver (2208 or 2209)
  200. [tmc2209 stepper_z2]
  201. uart_pin: PG0
  202. interpolate: false
  203. run_current: 0.8
  204. sense_resistor: 0.110
  205. stealthchop_threshold: 0
  206.  
  207. ## Z3 Stepper - Front Right
  208. ## Connected to MOTOR_5
  209. [stepper_z3]
  210. step_pin: PF13
  211. dir_pin: !PF14
  212. enable_pin: !PF12
  213. rotation_distance: 40
  214. gear_ratio: 80:16
  215. microsteps: 32
  216.  
  217. ## Make sure to update below for your relevant driver (2208 or 2209)
  218. [tmc2209 stepper_z3]
  219. uart_pin: PF11
  220. interpolate: false
  221. run_current: 0.8
  222. sense_resistor: 0.110
  223. stealthchop_threshold: 0
  224.  
  225.  
  226. #####################################################################
  227. # Extruder
  228. #####################################################################
  229.  
  230. ## Connected to MOTOR_2
  231. ## Heater - HE0
  232. ## Thermistor - T0
  233. [extruder]
  234. step_pin: PB0
  235. dir_pin: PB1
  236. enable_pin: !PC5
  237. ## Update value below when you perform extruder calibration
  238. ## If you ask for 100mm of filament, but in reality it is 98mm:
  239. ## rotation_distance = <previous_rotation_distance> * <actual_extrude_distance> / 100
  240. ## 22.6789511 is a good starting point
  241. rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears
  242. ## Update Gear Ratio depending on your Extruder Type
  243. ## Use 50:10 for Stealthburner/Clockwork 2
  244. ## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio)
  245. ## Use 80:20 for M4, M3.1
  246. gear_ratio: 50:10 #BMG Gear Ratio
  247. microsteps: 32
  248. full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
  249. nozzle_diameter: 0.400
  250. filament_diameter: 1.75
  251. heater_pin: PB9
  252. ## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types.
  253. ## Use "Generic 3950" for NTC 100k 3950 thermistors
  254. sensor_type: PT1000
  255. sensor_pin: PF3
  256. min_temp: 0
  257. max_temp: 500
  258. max_power: 1.0
  259. min_extrude_temp: 170
  260. max_extrude_only_distance: 150
  261. control = pid
  262. pid_kp = 26.213
  263. pid_ki = 1.304
  264. pid_kd = 131.721
  265. ## Try to keep pressure_advance below 1.0
  266. #pressure_advance: 0.05
  267. ## Default is 0.040, leave stock
  268. #pressure_advance_smooth_time: 0.040
  269.  
  270. ## E0 on MOTOR_2
  271. ## Make sure to update below for your relevant driver (2208 or 2209)
  272. [tmc2209 extruder]
  273. uart_pin: PC4
  274. interpolate: false
  275. run_current: 0.5
  276. sense_resistor: 0.110
  277. stealthchop_threshold: 0
  278.  
  279.  
  280. #####################################################################
  281. # Bed Heater
  282. #####################################################################
  283.  
  284. ## SSR Pin - HE1
  285. ## Thermistor - TB
  286. [heater_bed]
  287. ## Uncomment the following line if using the default SSR wiring from the docs site
  288. #heater_pin: PA3
  289. ## Other wiring guides may use BED_OUT to control the SSR. Uncomment the following line for those cases
  290. heater_pin: PD12
  291. ## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types.
  292. ## Use "Generic 3950" for Keenovo heaters
  293. sensor_type: Generic 3950
  294. sensor_pin: PA0
  295. ## Adjust Max Power so your heater doesn't warp your bed. Rule of thumb is 0.4 watts / cm^2 .
  296. max_power: 0.6
  297. min_temp: 0
  298. max_temp: 120
  299. control: pid
  300. pid_kp: 58.437
  301. pid_ki: 2.347
  302. pid_kd: 363.769
  303.  
  304. #####################################################################
  305. # Probe
  306. #####################################################################
  307.  
  308. ## Inductive Probe
  309. ## This probe is not used for Z height, only Quad Gantry Leveling
  310. [probe]
  311.  
  312. #--------------------------------------------------------------------
  313.  
  314. ## Select the probe port by type:
  315. ## For the PROBE port. Will not work with Diode. May need pull-up resistor from signal to 24V.
  316. #pin: ~!PB7
  317. ## For the DIAG_7 port. NEEDS BAT85 DIODE! Change to !PG15 if probe is NO.
  318. #pin: PG15
  319. ## For Octopus Pro PROBE port; NPN and PNP proximity switch types can be set by jumper
  320. #pin: ~!PC5
  321.  
  322. pin: PF4
  323. #--------------------------------------------------------------------
  324.  
  325. x_offset: 0
  326. y_offset: 0
  327. #z_offset: 0
  328. speed: 10.0
  329. samples: 3
  330. samples_result: median
  331. sample_retract_dist: 3.0
  332. samples_tolerance: 0.006
  333. samples_tolerance_retries: 3
  334.  
  335.  
  336.  
  337. #[safe_z_home]
  338. #home_xy_position:170,170
  339. #speed:100
  340. #z_hop:1
  341.  
  342. #####################################################################
  343. # Fan Control
  344. #####################################################################
  345.  
  346. ## Print Cooling Fan - FAN0
  347. [fan]
  348. pin: PB7
  349. kick_start_time: 0.5
  350. ## Depending on your fan, you may need to increase this value
  351. ## if your fan will not start. Can change cycle_time (increase)
  352. ## if your fan is not able to slow down effectively
  353. off_below: 0.10
  354.  
  355.  
  356. ## Hotend Fan - FAN1
  357. [heater_fan hotend_fan]
  358. pin: PB8
  359. max_power: 1.0
  360. kick_start_time: 0.5
  361. heater: extruder
  362. heater_temp: 50.0
  363. ## If you are experiencing back flow, you can reduce fan_speed
  364. #fan_speed: 1.0
  365.  
  366. ## Controller fan - FAN2
  367. [controller_fan controller_fan]
  368. pin: PC6
  369. kick_start_time: 0.5
  370. heater: heater_bed
  371.  
  372. ## Exhaust fan - FAN3
  373. [heater_fan Chamber_fan]
  374. pin: PE5
  375. max_power: 0.7
  376. shutdown_speed: 0.0
  377. kick_start_time: 5.0
  378. heater: heater_bed
  379. heater_temp: 60
  380. fan_speed: 0.8
  381.  
  382. #####################################################################
  383. # LED Control
  384. #####################################################################
  385.  
  386. ## Chamber Lighting - HE2 Connector (Optional)
  387.  
  388. [output_pin case_light]
  389. pin: PE6
  390. pwm:false
  391. shutdown_value: 0
  392. value:1
  393.  
  394. #####################################################################
  395. # Homing and Gantry Adjustment Routines
  396. #####################################################################
  397.  
  398. [idle_timeout]
  399. timeout: 1800
  400.  
  401. [safe_z_home]
  402. ## XY Location of the Z Endstop Switch
  403. ## Update -10,-10 to the XY coordinates of your endstop pin
  404. ## (such as 157,305) after going through Z Endstop Pin
  405. ## Location Definition step.
  406. home_xy_position: 175,175
  407. speed:200
  408. z_hop:5
  409.  
  410.  
  411. ## Use QUAD_GANTRY_LEVEL to level a gantry.
  412. ## Min & Max gantry corners - measure from nozzle at MIN (0,0) and
  413. ## MAX (250, 250), (300,300), or (350,350) depending on your printer size
  414. ## to respective belt positions
  415. [quad_gantry_level]
  416.  
  417. #--------------------------------------------------------------------
  418. ## Gantry Corners for 250mm Build
  419. ## Uncomment for 250mm build
  420. #gantry_corners:
  421. # -60,-10
  422. # 310, 320
  423. ## Probe points
  424. #points:
  425. # 50,25
  426. # 50,175
  427. # 200,175
  428. # 200,25
  429.  
  430. ## Gantry Corners for 300mm Build
  431. ## Uncomment for 300mm build
  432. #gantry_corners:
  433. # -60,-10
  434. # 360,370
  435. ## Probe points
  436. #points:
  437. # 50,25
  438. # 50,225
  439. # 250,225
  440. # 250,25
  441.  
  442. ## Gantry Corners for 350mm Build
  443. ## Uncomment for 350mm build
  444. gantry_corners:
  445. -60,-10
  446. 410,420
  447. # Probe points
  448. points:
  449. 9,8
  450. 9,342
  451. 345,342
  452. 345,8
  453.  
  454. #--------------------------------------------------------------------
  455. speed: 200
  456. horizontal_move_z: 5
  457. retries: 5
  458. retry_tolerance: 0.0075
  459. max_adjust: 10
  460.  
  461. ##################################
  462. # Bed Mesh
  463. ##################################
  464.  
  465. [bed_mesh]
  466. speed: 150
  467. horizontal_move_z: 5
  468. mesh_min: 9, 8
  469. mesh_max: 345, 345
  470. probe_count: 8, 8
  471. mesh_pps: 3, 3
  472. algorithm: bicubic
  473. #bicubic_tension: 0.2
  474. move_check_distance: 5
  475. split_delta_z: .025
  476. fade_start: 1
  477. fade_end: 10
  478. fade_target: 0
  479.  
  480.  
  481. ########################################
  482. # EXP1 / EXP2 (display) pins
  483. ########################################
  484.  
  485. # [board_pins]
  486. # aliases:
  487. # # EXP1 header
  488. # EXP1_1=PG5, EXP1_2=PG4,
  489. # EXP1_3=PG3, EXP1_4=PG2,
  490. # EXP1_5=PD15, EXP1_6=PD14, # Slot in the socket on this side
  491. # EXP1_7=PD13, EXP1_8=PD11,
  492. # EXP1_9=<GND>, EXP1_10=<5V>,
  493.  
  494. # EXP2 header
  495. # EXP2_1=PB14, EXP2_2=PB13,
  496. # EXP2_3=PD10, EXP2_4=PB12,
  497. # EXP2_5=PD9, EXP2_6=PB15, # Slot in the socket on this side
  498. # EXP2_7=PD8, EXP2_8=<RST>,
  499. # EXP2_9=<GND>, EXP2_10=<5V>
  500.  
  501. #####################################################################
  502. # Displays
  503. #####################################################################
  504.  
  505. ## Uncomment the display that you have
  506. #--------------------------------------------------------------------
  507.  
  508.  
  509. ## RepRapDiscount 128x64 Full Graphic Smart Controller
  510. #[display]
  511. #lcd_type: st7920
  512. #cs_pin: EXP1_4
  513. #sclk_pin: EXP1_5
  514. #sid_pin: EXP1_3
  515. #menu_timeout: 40
  516. #encoder_pins: ^EXP2_5, ^EXP2_3
  517. #click_pin: ^!EXP1_2
  518.  
  519. #[output_pin beeper]
  520. #pin: EXP1_1
  521.  
  522. #--------------------------------------------------------------------
  523.  
  524.  
  525. ## mini12864 LCD Display
  526. # [display]
  527. # lcd_type: uc1701
  528. # cs_pin: EXP1_3
  529. # a0_pin: EXP1_4
  530. # rst_pin: EXP1_5
  531. # encoder_pins: ^EXP2_5, ^EXP2_3
  532. # click_pin: ^!EXP1_2
  533. # contrast: 63
  534. # spi_software_miso_pin: EXP2_1
  535. # spi_software_mosi_pin: EXP2_6
  536. # spi_software_sclk_pin: EXP2_2
  537.  
  538. ## To control Neopixel RGB in mini12864 display
  539. # [neopixel btt_mini12864]
  540. # vpin: EXP1_6
  541. # chain_count: 3
  542. # initial_RED: 0.1
  543. # initial_GREEN: 0.5
  544. # initial_BLUE: 0.0
  545. # color_order: RGB
  546.  
  547. ## Set RGB values on boot up for each Neopixel.
  548. ## Index 1 = display, Index 2 and 3 = Knob
  549. # [delayed_gcode setdisplayneopixel]
  550. # initial_duration: 1
  551. # gcode:
  552. # SET_LED LED=btt_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
  553. # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
  554. # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3
  555.  
  556. #--------------------------------------------------------------------
  557.  
  558. ## INPUT SHAPING
  559. # Comment all of the lines in the Displays section before uncommenting the [adxl45] and [resonance_tester] sections below.
  560. # After finding the optimal shaping functions and frequencies, re-comment the [adxl345] and [resonance_tester] sections
  561. # Finally, uncomment the [input_shaper] section and update it with the values you found
  562.  
  563. #[adxl345]
  564. #cs_pin: EXP2_4 #CS
  565. #spi_software_miso_pin: EXP2_1 #SCL PB14
  566. #spi_software_mosi_pin: EXP2_6 #SDA PB15
  567. #spi_software_sclk_pin: EXP2_2 #SDO PB13
  568.  
  569. #[resonance_tester]
  570. #accel_chip: adxl345
  571. #probe_points: 150,150,20 # whatever suits your fancy
  572.  
  573. #[input_shaper]
  574. #shaper_freq_x: 50 #Replace with the frequency you find using TEST_RESONANCES AXIS=X
  575. #shaper_type_x: mzv #Replace with the shaper you find using TEST_RESONANCES AXIS=X
  576. #shaper_freq_y: 50 #Replace with the frequency you find using TEST_RESONANCES AXIS=Y
  577. #shaper_type_y: 2hump_ei #Replace with the shaper you find using TEST_RESONANCES AXIS=X
  578.  
  579. #--------------------------------------------------------------------
  580.  
  581. [pause_resume]
  582. recover_velocity: 50.
  583. # When capture/restore is enabled, the speed at which to return to
  584. # the captured position (in mm/s). Default is 50.0 mm/s.
  585.  
  586. [respond]
  587. default_type: echo
  588. # Sets the default prefix of the "M118" and "RESPOND" output to one
  589. # of the following:
  590. # echo: "echo: " (This is the default)
  591. # command: "// "
  592. # error: "!! "
  593. #default_prefix: echo:
  594. # Directly sets the default prefix. If present, this value will
  595. # override the "default_type".
  596.  
  597. #####################################################################
  598. # Filament Runout Sensor
  599. #####################################################################
  600.  
  601. [filament_switch_sensor filament_sensor]
  602. pause_on_runout: True
  603. # When set to True, a PAUSE will execute immediately after a runout
  604. # is detected. Note that if pause_on_runout is False and the
  605. # runout_gcode is omitted then runout detection is disabled. Default
  606. # is True.
  607. runout_gcode:
  608. M600
  609. # A list of G-Code commands to execute after a filament runout is
  610. # detected. See docs/Command_Templates.md for G-Code format. If
  611. # pause_on_runout is set to True this G-Code will run after the
  612. # PAUSE is complete. The default is not to run any G-Code commands.
  613. #insert_gcode:
  614. # A list of G-Code commands to execute after a filament insert is
  615. # detected. See docs/Command_Templates.md for G-Code format. The
  616. # default is not to run any G-Code commands, which disables insert
  617. # detection.
  618. #event_delay: 3.0
  619. # The minimum amount of time in seconds to delay between events.
  620. # Events triggered during this time period will be silently
  621. # ignored. The default is 3 seconds.
  622. #pause_delay: 0.5
  623. # The amount of time to delay, in seconds, between the pause command
  624. # dispatch and execution of the runout_gcode. It may be useful to
  625. # increase this delay if OctoPrint exhibits strange pause behavior.
  626. # Default is 0.5 seconds.
  627. switch_pin: PC14
  628. # The pin on which the switch is connected. This parameter must be
  629. # provided
  630.  
  631. #####################################################################
  632. # Macros
  633. #####################################################################
  634. [gcode_macro G32]
  635. gcode:
  636. SAVE_GCODE_STATE NAME=STATE_G32
  637. G90
  638. G28
  639. M104 S150 T0
  640. M109 S150 T0
  641. NOZZLE_CLEAN
  642. QUAD_GANTRY_LEVEL
  643. NOZZLE_CLEAN
  644. G28
  645. ## Uncomment for for your size printer:
  646. #--------------------------------------------------------------------
  647. ## Uncomment for 250mm build
  648. #G0 X125 Y125 Z30 F3600
  649.  
  650. ## Uncomment for 300 build
  651. #G0 X150 Y150 Z30 F3600
  652.  
  653. ## Uncomment for 350mm build
  654. G0 X175 Y175 Z5 F3600
  655. #--------------------------------------------------------------------
  656. RESTORE_GCODE_STATE NAME=STATE_G32
  657.  
  658. ####################################
  659. # Mesh Bed Leveling
  660. ####################################
  661.  
  662. [gcode_macro mesh_leveling]
  663. gcode:
  664. G28 # Home All
  665. T0
  666. BED_MESH_CALIBRATE PROFILE=mesh1 METHOD=automatic # Start probing
  667.  
  668. [gcode_macro save_mesh]
  669. gcode:
  670. BED_MESH_PROFILE SAVE=mesh1
  671. SAVE_CONFIG
  672. ####################################
  673.  
  674. # Use PRINT_START for the slicer starting script - please customise for your slicer of choice
  675. [gcode_macro PRINT_START]
  676. gcode:
  677. G32 ; home all axes
  678. G90 ; absolute positioning
  679. G1 Z20 F3000 ; move nozzle away from bed
  680. NOZZLE_PRIME
  681.  
  682.  
  683. # Use PRINT_END for the slicer ending script - please customise for your slicer of choice
  684. [gcode_macro PRINT_END]
  685. gcode:
  686. # safe anti-stringing move coords
  687. {% set th = printer.toolhead %}
  688. {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
  689. {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
  690. {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
  691.  
  692. SAVE_GCODE_STATE NAME=STATE_PRINT_END
  693.  
  694. M400 ; wait for buffer to clear
  695. G92 E0 ; zero the extruder
  696. G1 E-5.0 F1800 ; retract filament
  697.  
  698. TURN_OFF_HEATERS
  699.  
  700. G90 ; absolute positioning
  701. G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing
  702. G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear
  703. M107 ; turn off fan
  704.  
  705. BED_MESH_CLEAR
  706. RESTORE_GCODE_STATE NAME=STATE_PRINT_END
  707.  
  708. #####
  709. # COLOR CHANGE
  710. #####
  711. [gcode_macro M600]
  712. description: Executes a color change by pausing the printer an unloading the filament.
  713. gcode:
  714. PAUSE
  715. UNLOAD_FILAMENT
  716. M117 Please load new filament and resume
  717. RESPOND MSG="Please load new filament and resume"
  718.  
  719. #####
  720. # FILAMENT MANAGEMENT
  721. #####
  722.  
  723. [gcode_macro UNLOAD_FILAMENT]
  724. description: Unloads the filament. Note: be careful with PETG, make sure you inspect the tip of your filament before reloading to avoid jams.
  725. gcode:
  726. SAVE_GCODE_STATE NAME=unload_state
  727. G91
  728. {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %}
  729. M117 Heating...
  730. # Heat up hotend to provided temp or 220 as default as that should work OK with most filaments.
  731. M104 S{params.TEMP|default(220, true)}
  732. TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)}
  733. {% endif %}
  734. M117 Unloading filament...
  735. # Extract filament to cold end area
  736. G0 E-5 F3600
  737. # Wait for three seconds
  738. G4 P3000
  739. # Push back the filament to smash any stringing
  740. G0 E5 F3600
  741. # Extract back fast in to the cold zone
  742. G0 E-15 F3600
  743. # Continue extraction slowly, allow the filament time to cool solid before it reaches the gears
  744. G0 E-130 F300
  745. M117 Filament unloaded!
  746. RESPOND MSG="Filament unloaded! Please inspect the tip of the filament before reloading."
  747. RESTORE_GCODE_STATE NAME=unload_state
  748.  
  749. [gcode_macro LOAD_FILAMENT]
  750. description: Loads new filament. Note: be careful with PETG, make sure you inspect the tip of your filament before loading to avoid jams.
  751. gcode:
  752. SAVE_GCODE_STATE NAME=load_state
  753. G91
  754. # Heat up hotend to provided temp or 220 as default as that should work OK with most filaments.
  755. {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %}
  756. M117 Heating...
  757. M104 S{params.TEMP|default(220, true)}
  758. TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)}
  759. {% endif %}
  760. M117 Loading filament...
  761. # Load the filament into the hotend area.
  762. G0 E100 F600
  763. # Wait a secod
  764. G4 P1000
  765. # Purge
  766. G0 E40 F100
  767. # Wait for purge to complete
  768. M400e
  769. M117 Filament loaded!
  770. RESPOND MSG="Filament loaded!"
  771. RESTORE_GCODE_STATE NAME=load_state
  772.  
  773. [gcode_macro NOZZLE_CLEAN]
  774. description: wipes nozzle on brush to clean it
  775. gcode:
  776. G90
  777. G1 X265 Y355 F6000
  778. G1 Z0.5 F3000
  779. G1 X305 Y355 F10000
  780. G1 X265 Y355 F10000
  781. G1 X305 Y355 F10000
  782. G1 X265 Y355 F10000
  783. G1 X305 Y355 F10000
  784. G1 X265 Y355 F10000
  785. G1 Z10 F6000
  786.  
  787. [gcode_macro NOZZLE_PRIME]
  788. description: prime the nozzle before printing
  789. gcode:
  790. G92 E0
  791. G1 E-3 F1800
  792. G1 X0 Y0 F10000
  793. G1 Z0.3 F500
  794. G92 E0
  795. G1 E3 F500
  796. G92 E0
  797. G1 E-0.30000 F3600
  798. G1 Z0.2500 F1000
  799. G1 X350 Y0 E50 F1000
  800. G92 E0
  801. G1 E-0.30000 F5400
  802. G1 Z10 F500
  803.  
  804. [gcode_macro PAUSE]
  805. description: Pause the actual running print
  806. rename_existing: PAUSE_BASE
  807. gcode:
  808. PAUSE_BASE
  809. _TOOLHEAD_PARK_PAUSE_CANCEL
  810.  
  811. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  812. description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
  813. variable_extrude: 1.0
  814. gcode:
  815. ##### set park positon for x and y #####
  816. # default is your max posion from your printer.cfg
  817. {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
  818. {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
  819. {% set z_park_delta = 10.0 %}
  820. ##### calculate save lift position #####
  821. {% set max_z = printer.toolhead.axis_maximum.z|float %}
  822. {% set act_z = printer.toolhead.position.z|float %}
  823. {% if act_z < (max_z - z_park_delta) %}
  824. {% set z_safe = z_park_delta %}
  825. {% else %}
  826. {% set z_safe = max_z - act_z %}
  827. {% endif %}
  828. ##### end of definitions #####
  829. {% if printer.extruder.can_extrude|lower == 'true' %}
  830. M83
  831. G1 E-{extrude} F2100
  832. {% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
  833. {% else %}
  834. {action_respond_info("Extruder not hot enough")}
  835. {% endif %}
  836. {% if "xyz" in printer.toolhead.homed_axes %}
  837. G91
  838. G1 Z{z_safe} F900
  839. G90
  840. G1 X{x_park} Y{y_park} F6000
  841. {% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
  842. {% else %}
  843. {action_respond_info("Printer not homed")}
  844. {% endif %}
  845.  
  846. [gcode_macro RESONANCES_TEST]
  847. gcode:
  848. SHAPER_CALIBRATE
  849.  
  850. #######################################
  851. # START_PRINT
  852. #######################################
  853.  
  854. [gcode_macro START_PRINT]
  855. gcode:
  856. G28 # Home the printer
  857. G92 E0 # Reset extruder
  858. G32
  859. #BED_MESH_CALIBRATE PROFILE=mesh1 METHOD=automatic
  860. BED_MESH_PROFILE LOAD=mesh1
  861.  
  862. # Move to wait position
  863. #G28 X
  864. G90
  865. G1 X175 Y175
  866.  
  867.  
  868. #######################################
  869. # END_PRINT
  870. #######################################
  871.  
  872. [gcode_macro END_PRINT]
  873. #variable_machine_depth: printer.configfile.settings.stepper_z.position_max
  874. gcode:
  875. ; layer end
  876. G91 ;relative positioning
  877. G1 E-5.00 F1000 ;retract 5mm of filament
  878. G1 Z+1.00 X+20.0 Y+20.0 F20000 ;short quick move to disengage from print
  879. G1 Z+10.00 F20000 ;move Z-Axis 10mm away from part
  880. G90 ;absolute positioning
  881. G28 X0 Y0 ; move gantry close to home
  882. G91 ; relative positioning
  883. G1 E-5.00 F500 ;retract additional filament to prevent oozing
  884. G90 ;absolute positioning
  885. M104 S0 ;turn off hotend
  886. M140 S0 ;turn off heatbed
  887. M106 S0 ; shut off blower
  888. M84 ;motors off
  889. #####################################################################
  890. # Calibrate Prope Offset
  891. ####################################################################
  892.  
  893. [gcode_macro Calibrate_Probe_Offset]
  894. gcode:
  895. PROBE_CALIBRATE
  896.  
  897. ####################################################################
  898.  
  899. #[mcu adxl]
  900. #serial: /dev/serial/by-id/usb-Klipper_rp2040_E6626005A7585734-if00
  901. ### 查询usb固件id是:ls -l /dev/serial/by-id/
  902. ### 把/dev/serial/by-id/usb-Klipper_rp2040_XXXXXXXXXXXXXXXXXXXXX替换查询到的id
  903.  
  904. #[adxl345]
  905. #cs_pin: adxl:gpio9
  906. #spi_software_sclk_pin: adxl:gpio10
  907. #spi_software_mosi_pin: adxl:gpio11
  908. #spi_software_miso_pin: adxl:gpio12
  909.  
  910. #[resonance_tester]
  911. #accel_chip: adxl345
  912. #probe_points:
  913. # 175, 175, 20
  914.  
  915. #*# <---------------------- SAVE_CONFIG ---------------------->
  916. #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
  917. #*#
  918. #*# [stepper_z]
  919. #*# position_endstop = 0.940
  920. #*#
  921. #*# [input_shaper]
  922. #*# shaper_type_x = mzv
  923. #*# shaper_freq_x = 61.6
  924. #*# shaper_type_y = mzv
  925. #*# shaper_freq_y = 37.8
  926. #*#
  927. #*# [probe]
  928. #*# z_offset = -1.500
  929. #*#
  930. #*# [bed_mesh mesh1]
  931. #*# version = 1
  932. #*# points =
  933. #*# 0.076250, 0.098750, 0.112500, 0.158750, 0.138750, 0.155000, 0.111250, 0.077500
  934. #*# 0.040000, 0.085000, 0.083750, 0.093750, 0.108750, 0.097500, 0.062500, 0.022500
  935. #*# -0.010000, 0.003750, 0.021250, 0.012500, 0.018750, 0.012500, -0.026250, -0.081250
  936. #*# 0.010000, -0.005000, -0.008750, 0.007500, 0.003750, 0.025000, -0.003750, -0.068750
  937. #*# -0.022500, -0.017500, 0.010000, 0.006250, 0.010000, -0.013750, -0.041250, -0.080000
  938. #*# -0.012500, -0.005000, 0.012500, 0.018750, 0.017500, 0.002500, -0.028750, -0.058750
  939. #*# 0.030000, 0.032500, 0.030000, 0.038750, 0.040000, 0.036250, 0.022500, 0.000000
  940. #*# 0.091250, 0.098750, 0.117500, 0.123750, 0.113750, 0.128750, 0.102500, 0.075000
  941. #*# x_count = 8
  942. #*# y_count = 8
  943. #*# mesh_x_pps = 3
  944. #*# mesh_y_pps = 3
  945. #*# algo = bicubic
  946. #*# tension = 0.2
  947. #*# min_x = 9.0
  948. #*# max_x = 345.0
  949. #*# min_y = 8.0
  950. #*# max_y = 344.98
  951. #*#
  952. #*# [bed_mesh default]
  953. #*# version = 1
  954. #*# points =
  955. #*# 0.081250, 0.108750, 0.120000, 0.153750, 0.152500, 0.142500, 0.130000, 0.078750
  956. #*# 0.046250, 0.068750, 0.092500, 0.106250, 0.108750, 0.091250, 0.068750, 0.023750
  957. #*# -0.015000, -0.001250, 0.013750, 0.017500, 0.030000, 0.012500, -0.012500, -0.071250
  958. #*# -0.017500, -0.010000, 0.003750, 0.016250, 0.020000, 0.017500, -0.012500, -0.071250
  959. #*# -0.032500, -0.023750, -0.003750, 0.005000, 0.003750, -0.010000, -0.026250, -0.077500
  960. #*# -0.025000, -0.017500, 0.005000, 0.015000, 0.018750, 0.005000, -0.016250, -0.063750
  961. #*# 0.007500, 0.026250, 0.040000, 0.057500, 0.058750, 0.055000, 0.035000, -0.015000
  962. #*# 0.091250, 0.108750, 0.142500, 0.156250, 0.170000, 0.163750, 0.131250, 0.086250
  963. #*# x_count = 8
  964. #*# y_count = 8
  965. #*# mesh_x_pps = 3
  966. #*# mesh_y_pps = 3
  967. #*# algo = bicubic
  968. #*# tension = 0.2
  969. #*# min_x = 9.0
  970. #*# max_x = 345.0
  971. #*# min_y = 8.0
  972. #*# max_y = 344.98
  973.  
Advertisement
Add Comment
Please, Sign In to add comment