Advertisement
Guest User

Untitled

a guest
May 21st, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.16 KB | None | 0 0
  1. # This file contains common pin mappings for the BigTreeTech Octopus V1.
  2. # To use this config, the firmware should be compiled for the STM32F446 with a "32KiB bootloader"
  3. # Enable "extra low-level configuration options" and select the "12MHz crystal" as clock reference
  4.  
  5. # after running "make", copy the generated "klipper/out/klipper.bin" file to a
  6. # file named "firmware.bin" on an SD card and then restart the OctoPus with that SD card.
  7.  
  8. # See docs/Config_Reference.md for a description of parameters.
  9.  
  10. ## Voron Design VORON2 250/300/350mm BigTreeTech OctoPus V1 TMC2209 UART config
  11.  
  12. ## *** THINGS TO CHANGE/CHECK: ***
  13. ## MCU paths [mcu] section
  14. ## Thermistor types [extruder] and [heater_bed] sections - See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types
  15. ## Z Endstop Switch location [safe_z_home] section
  16. ## Homing end position [gcode_macro G32] section
  17. ## Z Endstop Switch offset for Z0 [stepper_z] section
  18. ## Probe points [quad_gantry_level] section
  19. ## Min & Max gantry corner postions [quad_gantry_level] section
  20. ## PID tune [extruder] and [heater_bed] sections
  21. ## Probe pin [probe] section
  22. ## Fine tune E steps [extruder] section
  23. [force_move]
  24. enable_force_move: True
  25. [include mainsail.cfg]
  26. [include purge.cfg]
  27. [exclude_object]
  28. [virtual_sdcard]
  29. path: ~/printer_data/gcodes
  30. [display_status]
  31. [pause_resume]
  32. [mcu]
  33. ## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
  34. ##--------------------------------------------------------------------
  35. serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_300023001450535556323420-if00
  36. restart_method: command
  37. ##--------------------------------------------------------------------
  38.  
  39. [printer]
  40. kinematics: corexy
  41. max_velocity: 250
  42. max_accel: 3000 #Max 4000
  43. max_z_velocity: 15 #Max 15 for 12V TMC Drivers, can increase for 24V
  44. max_z_accel: 350
  45. square_corner_velocity: 5.0
  46.  
  47. #####################################################################
  48. # X/Y Stepper Settings
  49. #####################################################################
  50.  
  51. ## B Stepper - Left
  52. ## Connected to MOTOR_0
  53. ## Endstop connected to DIAG_0
  54. [stepper_x]
  55. step_pin: PF13
  56. dir_pin: PF12
  57. enable_pin: !PF14
  58. rotation_distance: 40
  59. microsteps: 32
  60. full_steps_per_rotation:400
  61. endstop_pin: tmc2209_stepper_x:virtual_endstop #X_STOP
  62. position_min: 0
  63. position_endstop: 350
  64. position_max: 350
  65. homing_speed: 40 #50
  66. homing_retract_dist: 0
  67. homing_positive_dir: true
  68. ##--------------------------------------------------------------------
  69.  
  70. ## Uncomment below for 250mm build
  71. #position_endstop: 250
  72. #position_max: 250
  73.  
  74. ## Uncomment for 300mm build
  75. #position_endstop: 300
  76. #position_max: 300
  77.  
  78. ## Uncomment for 350mm build
  79. position_endstop: 350
  80. position_max: 350
  81.  
  82. ##--------------------------------------------------------------------
  83. homing_speed: 25 #Max 100
  84. homing_retract_dist: 5
  85. homing_positive_dir: true
  86.  
  87. ## Make sure to update below for your relevant driver (2208 or 2209)
  88. [tmc2209 stepper_x]
  89. uart_pin: PC4
  90. interpolate: False
  91. run_current: 1
  92. sense_resistor: 0.110
  93. stealthchop_threshold: 0 #always on, 0 is off
  94. diag_pin: PG6 # use the same pin that was previously the endstop_pin!
  95. driver_SGTHRS: 87
  96.  
  97. ## A Stepper - Right
  98. ## Connected to MOTOR_1
  99. ## Endstop connected to DIAG_1
  100. [stepper_y]
  101. step_pin: PG0
  102. dir_pin: PG1
  103. enable_pin: !PF15
  104. rotation_distance: 40
  105. microsteps: 32
  106. full_steps_per_rotation:400
  107. endstop_pin: tmc2209_stepper_y:virtual_endstop #Y_STOP
  108. position_min: 0
  109. position_endstop: 350
  110. position_max: 350
  111. homing_speed: 40 #50
  112. homing_retract_dist: 0
  113. homing_positive_dir: true
  114. ##--------------------------------------------------------------------
  115.  
  116. ## Uncomment for 250mm build
  117. #position_endstop: 250
  118. #position_max: 250
  119.  
  120. ## Uncomment for 300mm build
  121. #position_endstop: 300
  122. #position_max: 300
  123.  
  124. ## Uncomment for 350mm build
  125. position_endstop: 350
  126. position_max: 365
  127.  
  128. ##--------------------------------------------------------------------
  129. homing_speed: 25 #Max 100
  130. homing_retract_dist: 5
  131. homing_positive_dir: true
  132.  
  133. ## Make sure to update below for your relevant driver (2208 or 2209)
  134. [tmc2209 stepper_y]
  135. uart_pin: PD11
  136. interpolate: False
  137. run_current: 1
  138. sense_resistor: 0.110
  139. stealthchop_threshold: 0
  140. diag_pin: PG9 # use the same pin that was previously the endstop_pin!
  141. driver_SGTHRS: 95 #255 is most sensitive value, 0 is least sensitive
  142.  
  143. #####################################################################
  144. # Z Stepper Settings
  145. #####################################################################
  146.  
  147. ## Z0 Stepper - Front Left
  148. ## Connected to MOTOR_2
  149. ## Endstop connected to DIAG_2
  150. [stepper_z]
  151. step_pin: PE6
  152. dir_pin: PA14
  153. enable_pin: !PE0
  154. rotation_distance: 40
  155. gear_ratio: 80:16
  156. microsteps: 32
  157. endstop_pin: probe:z_virtual_endstop
  158. ## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0)
  159. ## (+) value = endstop above Z0, (-) value = endstop below
  160. ## Increasing position_endstop brings nozzle closer to the bed
  161. ## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config
  162. #position_endstop: -0.5
  163. ##--------------------------------------------------------------------
  164.  
  165. ## Uncomment below for 250mm build
  166. #position_max: 210
  167.  
  168. ## Uncomment below for 300mm build
  169. #position_max: 260
  170.  
  171. ## Uncomment below for 350mm build
  172. position_max: 310
  173.  
  174. ##--------------------------------------------------------------------
  175. position_min: -5
  176. homing_speed: 8
  177. second_homing_speed: 3
  178. homing_retract_dist: 3
  179.  
  180. ## Make sure to update below for your relevant driver (2208 or 2209)
  181. [tmc2209 stepper_z]
  182. uart_pin: PD3
  183. interpolate: false
  184. run_current: 0.8
  185. sense_resistor: 0.110
  186. stealthchop_threshold: 0
  187.  
  188. ## Z1 Stepper - Rear Left
  189. ## Connected to MOTOR_3
  190. [stepper_z1]
  191. step_pin: PG4
  192. dir_pin: !PC1
  193. enable_pin: !PA0
  194. rotation_distance: 40
  195. gear_ratio: 80:16
  196. microsteps: 32
  197.  
  198. ## Make sure to update below for your relevant driver (2208 or 2209)
  199. [tmc2209 stepper_z1]
  200. uart_pin: PC7
  201. interpolate: false
  202. run_current: 0.8
  203. sense_resistor: 0.110
  204. stealthchop_threshold: 0
  205.  
  206. ## Z2 Stepper - Rear Right
  207. ## Connected to MOTOR_4
  208. [stepper_z2]
  209. step_pin: PF9
  210. dir_pin: PF10
  211. enable_pin: !PG2
  212. rotation_distance: 40
  213. gear_ratio: 80:16
  214. microsteps: 32
  215.  
  216. ## Make sure to update below for your relevant driver (2208 or 2209)
  217. [tmc2209 stepper_z2]
  218. uart_pin: PF2
  219. interpolate: false
  220. run_current: 0.8
  221. sense_resistor: 0.110
  222. stealthchop_threshold: 0
  223.  
  224. ## Z3 Stepper - Front Right
  225. ## Connected to MOTOR_5
  226. [stepper_z3]
  227. step_pin: PC13
  228. dir_pin: !PF0
  229. enable_pin: !PF1
  230. rotation_distance: 40
  231. gear_ratio: 80:16
  232. microsteps: 32
  233.  
  234. ## Make sure to update below for your relevant driver (2208 or 2209)
  235. [tmc2209 stepper_z3]
  236. uart_pin: PE4
  237. interpolate: false
  238. run_current: 0.8
  239. sense_resistor: 0.110
  240. stealthchop_threshold: 0
  241.  
  242.  
  243. #####################################################################
  244. # Extruder
  245. #####################################################################
  246.  
  247. ## Connected to MOTOR_6
  248. ## Heater - HE0
  249. ## Thermistor - T0
  250. [extruder]
  251. step_pin: gpio23
  252. dir_pin: gpio24
  253. enable_pin: gpio25
  254. ## Update value below when you perform extruder calibration
  255. ## If you ask for 100mm of filament, but in reality it is 98mm:
  256. ## rotation_distance = <previous_rotation_distance> * <actual_extrude_distance> / 100
  257. ## 22.6789511 is a good starting point
  258. rotation_distance: 22.6789511 #Bondtech 5mm Drive Gears
  259. ## Update Gear Ratio depending on your Extruder Type
  260. ## Use 50:10 for Stealthburner/Clockwork 2
  261. ## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio)
  262. ## Use 80:20 for M4, M3.1
  263. gear_ratio: 50:10 #BMG Gear Ratio
  264. microsteps: 32
  265. full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
  266. nozzle_diameter: 0.400
  267. filament_diameter: 1.75
  268. heater_pin: gpio9
  269. ## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types.
  270. ## Use "Generic 3950" for NTC 100k 3950 thermistors
  271. sensor_type: ATC Semitec 104NT-4-R025H42G
  272. sensor_pin: gpio29
  273. min_temp: 10
  274. max_temp: 270
  275. max_power: 1.0
  276. min_extrude_temp: 170
  277. #control = pid
  278. #pid_kp = 26.213
  279. #pid_ki = 1.304
  280. #pid_kd = 131.721
  281. ## Try to keep pressure_advance below 1.0
  282. #pressure_advance: 0.05
  283. ## Default is 0.040, leave stock
  284. #pressure_advance_smooth_time: 0.040
  285.  
  286. ## E0 on MOTOR6
  287. ## Make sure to update below for your relevant driver (2208 or 2209)
  288. [tmc2209 extruder]
  289. uart_pin: gpio0
  290. interpolate: false
  291. run_current: 0.5
  292. sense_resistor: 0.110
  293. stealthchop_threshold: 0
  294.  
  295.  
  296.  
  297.  
  298.  
  299. #####################################################################
  300. # Bed Heater
  301. #####################################################################
  302.  
  303.  
  304. ## SSR Pin - HE1
  305. ## Thermistor - TB
  306. [heater_bed]
  307. heater_pin: PA1
  308. ## Validate the following thermistor type to make sure it is correct
  309. ## Keenovo branded bed heaters should use Generic 3950
  310. ## LDO branded bed heaters will have the sensor type labelled on the heater
  311. ## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types.
  312. ## Use "Generic 3950" for Keenovo heaters
  313. sensor_type: ATC Semitec 104NT-4-R025H42G
  314. sensor_pin: PF3
  315. ## Adjust Max Power so your heater doesn't warp your bed. Rule of thumb is 0.4 watts / cm^2 .
  316. max_power: 0.9
  317. min_temp: 0
  318. max_temp: 120
  319. control: pid
  320. pid_kp: 58.437
  321. pid_ki: 2.347
  322. pid_kd: 363.769
  323.  
  324. #####################################################################
  325. # Probe
  326. #####################################################################
  327.  
  328. [beacon]
  329. serial: /dev/serial/by-id/usb-Beacon_Beacon_RevH_BF8C39D55154354D38202020FF0A392E-if00
  330. x_offset: 0 # update with offset from nozzle on your machine
  331. y_offset: 27.3 # update with offset from nozzle on your machine
  332. mesh_main_direction:x
  333. mesh_runs: 2
  334.  
  335.  
  336. [bed_mesh]
  337. mesh_min = 30, 30
  338. mesh_max = 270, 270
  339. speed = 900
  340. horizontal_move_z = 2
  341. probe_count = 6,6
  342. algorithm = bicubic
  343. ##[(7x7)-1] / 2 = 24
  344. ##[(5x5)-1] / 2 = 12
  345. ##[(9x9)-1] / 2 = 40
  346. #relative_reference_index: 40
  347. zero_reference_position: 150, 150
  348. #relative_reference_index: 15
  349. split_delta_z = 0.0125
  350. move_check_distance = 3
  351. mesh_pps = 4,4
  352. fade_start = 0
  353. fade_end = 2
  354. fade_target = 0
  355.  
  356.  
  357. #####################################################################
  358. # Fan Control
  359. #####################################################################
  360.  
  361. ## Print Cooling Fan - FAN0
  362. [fan]
  363. pin: gpio6
  364. kick_start_time: 0.5
  365. ## Depending on your fan, you may need to increase this value
  366. ## if your fan will not start. Can change cycle_time (increase)
  367. ## if your fan is not able to slow down effectively
  368. off_below: 0.10
  369.  
  370.  
  371. ## Hotend Fan - FAN1
  372. [heater_fan hotend_fan]
  373. pin: gpio5
  374. max_power: 1.0
  375. kick_start_time: 0.5
  376. heater: extruder
  377. heater_temp: 50.0
  378. ## If you are experiencing back flow, you can reduce fan_speed
  379. #fan_speed: 1.0
  380.  
  381. ## Controller fan - FAN2
  382. [controller_fan controller_fan]
  383. pin: PD12
  384. kick_start_time: 0.5
  385. heater: heater_bed
  386. fan_speed: 0.5
  387.  
  388. ## Exhaust fan - FAN3
  389. #[heater_fan exhaust_fan]
  390. #pin: PD13
  391. #max_power: 1.0
  392. #shutdown_speed: 0.0
  393. #kick_start_time: 5.0
  394. #heater: heater_bed
  395. #heater_temp: 60
  396. #fan_speed: 1.0
  397.  
  398. #####################################################################
  399. # LED Control
  400. #####################################################################
  401.  
  402. [output_pin caselight]
  403. ## Chamber Lighting - CNC_FAN5
  404. pin: PD15
  405. pwm:true
  406. shutdown_value: 0
  407. value:0
  408. cycle_time: 0.01
  409.  
  410. [neopixel headlight]
  411. ## Stealthburner lighting - RGB_LED
  412. pin: PB0
  413. chain_count: 3
  414. color_order: GRBW
  415. initial_RED: 0.0
  416. initial_GREEN: 0.0
  417. initial_BLUE: 0.0
  418. initial_WHITE: 0.0
  419.  
  420. #####################################################################
  421. # Additional Sensors
  422. #####################################################################
  423.  
  424.  
  425.  
  426. #####################################################################
  427. # Homing and Gantry Adjustment Routines
  428. #####################################################################
  429.  
  430. [idle_timeout]
  431. timeout: 1800
  432.  
  433. [safe_z_home]
  434. ## XY Location of the Z Endstop Switch
  435. ## Update -10,-10 to the XY coordinates of your endstop pin
  436. ## (such as 157,305) after going through Z Endstop Pin
  437. ## Location Definition step.
  438. home_xy_position:175,175
  439. speed:100
  440. z_hop:10
  441. z_hop_speed:10
  442.  
  443.  
  444. [resonance_tester]
  445. accel_chip: beacon
  446. probe_points: 90, 90, 20
  447.  
  448.  
  449. ## Use QUAD_GANTRY_LEVEL to level a gantry.
  450. ## Min & Max gantry corners - measure from nozzle at MIN (0,0) and
  451. ## MAX (250, 250), (300,300), or (350,350) depending on your printer size
  452. ## to respective belt positions
  453. [quad_gantry_level]
  454.  
  455. #--------------------------------------------------------------------
  456. ## Gantry Corners for 250mm Build
  457. ## Uncomment for 250mm build
  458. #gantry_corners:
  459. # -60,-10
  460. # 310, 320
  461. ## Probe points
  462. #points:
  463. # 50,25
  464. # 50,175
  465. # 200,175
  466. # 200,25
  467.  
  468. ## Gantry Corners for 300mm Build
  469. ## Uncomment for 300mm build
  470. #gantry_corners:
  471. # -60,-10
  472. # 360,370
  473. ## Probe points
  474. #points:
  475. # 50,25
  476. # 50,225
  477. # 250,225
  478. # 250,25
  479.  
  480. ## Gantry Corners for 350mm Build
  481. ## Uncomment for 350mm build
  482. gantry_corners:
  483. -60,-10
  484. 410,420
  485. ## Probe points
  486. points:
  487. 50,25
  488. 50,275
  489. 300,275
  490. 300,25
  491.  
  492. #--------------------------------------------------------------------
  493. speed: 100
  494. horizontal_move_z: 10
  495. retries: 5
  496. retry_tolerance: 0.0075
  497. max_adjust: 10
  498.  
  499. ########################################
  500. # EXP1 / EXP2 (display) pins
  501. ########################################
  502.  
  503. [board_pins]
  504. aliases:
  505. # EXP1 header
  506. EXP1_1=PE8, EXP1_2=PE7,
  507. EXP1_3=PE9, EXP1_4=PE10,
  508. EXP1_5=PE12, EXP1_6=PE13, # Slot in the socket on this side
  509. EXP1_7=PE14, EXP1_8=PE15,
  510. EXP1_9=<GND>, EXP1_10=<5V>,
  511.  
  512. # EXP2 header
  513. EXP2_1=PA6, EXP2_2=PA5,
  514. EXP2_3=PB1, EXP2_4=PA4,
  515. EXP2_5=PB2, EXP2_6=PA7, # Slot in the socket on this side
  516. EXP2_7=PC15, EXP2_8=<RST>,
  517. EXP2_9=<GND>, EXP2_10=<5V>
  518.  
  519. #####################################################################
  520. # Displays
  521. #####################################################################
  522.  
  523. [display]
  524. ## mini12864 LCD Display
  525. lcd_type: uc1701
  526. cs_pin: EXP1_3
  527. a0_pin: EXP1_4
  528. rst_pin: EXP1_5
  529. encoder_pins: ^EXP2_5, ^EXP2_3
  530. click_pin: ^!EXP1_2
  531. contrast: 63
  532. spi_software_miso_pin: EXP2_1
  533. spi_software_mosi_pin: EXP2_6
  534. spi_software_sclk_pin: EXP2_2
  535.  
  536. [neopixel btt_mini12864]
  537. ## To control Neopixel RGB in mini12864 display
  538. pin: EXP1_6
  539. chain_count: 3
  540. initial_RED: 0.1
  541. initial_GREEN: 0.5
  542. initial_BLUE: 0.0
  543. color_order: RGB
  544.  
  545. ### Set RGB values on boot up for each Neopixel.
  546. ### Index 1 = display, Index 2 and 3 = Knob
  547. [delayed_gcode setdisplayneopixel]
  548. initial_duration: 1
  549. gcode:
  550. SET_LED LED=btt_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
  551. # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
  552. # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3
  553.  
  554. #--------------------------------------------------------------------
  555.  
  556.  
  557. #####################################################################
  558. # Macros
  559. #####################################################################
  560.  
  561. [gcode_macro G32]
  562. gcode:
  563. SAVE_GCODE_STATE NAME=STATE_G32
  564. G90
  565. G28
  566. QUAD_GANTRY_LEVEL
  567. G28
  568. ## Uncomment for for your size printer:
  569. #--------------------------------------------------------------------
  570. ## Uncomment for 250mm build
  571. #G0 X125 Y125 Z30 F3600
  572.  
  573. ## Uncomment for 300 build
  574. #G0 X150 Y150 Z30 F3600
  575.  
  576. ## Uncomment for 350mm build
  577. G0 X175 Y175 Z30 F3600
  578. #--------------------------------------------------------------------
  579. RESTORE_GCODE_STATE NAME=STATE_G32
  580.  
  581.  
  582. # Use PRINT_START for the slicer starting script - please customise for your slicer of choice
  583. #####################################################################
  584. # print_start macro
  585. #####################################################################
  586.  
  587. ## *** THINGS TO UNCOMMENT: ***
  588. ## Bed mesh (2 lines at 2 locations)
  589. ## Z_TILT_ADJUST if your printer is a Trident
  590. ## Quad gantry level if your printer is a V2
  591. ## Nevermore - if you have one
  592.  
  593. [gcode_macro PRINT_START]
  594. gcode:
  595. # This part fetches data from your slicer. Such as bed temp, extruder temp, chamber temp and size of your printer.
  596. {% set target_bed = params.BED|int %}
  597. {% set target_extruder = params.EXTRUDER|int %}
  598. {% set target_chamber = params.CHAMBER|default("40")|int %}
  599. {% set x_wait = printer.toolhead.axis_maximum.x|float / 2 %}
  600. {% set y_wait = printer.toolhead.axis_maximum.y|float / 2 %}
  601.  
  602. # Homes the printer, sets absolute positioning and updates the Stealthburner leds.
  603. STATUS_HOMING # Sets SB-leds to homing-mode
  604. G28 # Full home (XYZ)
  605. G90 # Absolut position
  606.  
  607. ## Uncomment for bed mesh (1 of 2)
  608. BED_MESH_CLEAR # Clears old saved bed mesh (if any)
  609.  
  610. # Checks if the bed temp is higher than 90c - if so then trigger a heatsoak.
  611. {% if params.BED|int > 90 %}
  612. SET_DISPLAY_TEXT MSG="Bed: {target_bed}c" # Displays info
  613. STATUS_HEATING # Sets SB-leds to heating-mode
  614. M106 S255 # Turns on the PT-fan
  615.  
  616. ## Uncomment if you have a Nevermore.
  617. #SET_PIN PIN=nevermore VALUE=1 # Turns on the nevermore
  618.  
  619. G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
  620. M190 S{target_bed} # Sets the target temp for the bed
  621. SET_DISPLAY_TEXT MSG="Heatsoak: {target_chamber}c" # Displays info
  622. TEMPERATURE_WAIT SENSOR="temperature_sensor chamber_temp" MINIMUM={target_chamber} # Waits for chamber to reach desired temp
  623.  
  624. # If the bed temp is not over 90c, then it skips the heatsoak and just heats up to set temp with a 5min soak
  625. {% else %}
  626. SET_DISPLAY_TEXT MSG="Bed: {target_bed}c" # Displays info
  627. STATUS_HEATING # Sets SB-leds to heating-mode
  628. G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
  629. M190 S{target_bed} # Sets the target temp for the bed
  630. SET_DISPLAY_TEXT MSG="Soak for 5min" # Displays info
  631. G4 P300000 # Waits 5 min for the bedtemp to stabilize
  632. {% endif %}
  633.  
  634. # Heating nozzle to 150 degrees. This helps with getting a correct Z-home
  635. SET_DISPLAY_TEXT MSG="Hotend: 150c" # Displays info
  636. M109 S150 # Heats the nozzle to 150c
  637.  
  638. ## Uncomment for Trident (Z_TILT_ADJUST)
  639. #SET_DISPLAY_TEXT MSG="Z-tilt adjust" # Displays info
  640. #STATUS_LEVELING # Sets SB-leds to leveling-mode
  641. #Z_TILT_ADJUST # Levels the buildplate via z_tilt_adjust
  642. #G28 Z # Homes Z again after z_tilt_adjust
  643.  
  644. ## Uncomment for V2 (Quad gantry level AKA QGL)
  645. SET_DISPLAY_TEXT MSG="QGL" # Displays info
  646. STATUS_LEVELING # Sets SB-leds to leveling-mode
  647. quad_gantry_level # Levels the buildplate via QGL
  648. G28 Z # Homes Z again after QGL
  649.  
  650. ## Uncomment for Klicky auto-z
  651. #CALIBRATE_Z # Calibrates Z-offset with klicky
  652. #SET_DISPLAY_TEXT MSG="Z-offset" # Displays info
  653.  
  654. ## Uncomment for bed mesh (2 of 2)
  655. SET_DISPLAY_TEXT MSG="Bed mesh" # Displays info
  656. STATUS_MESHING # Sets SB-leds to bed mesh-mode
  657. bed_mesh_calibrate # Starts bed mesh
  658.  
  659. # Heats up the nozzle up to target via data from slicer
  660. SET_DISPLAY_TEXT MSG="Hotend: {target_extruder}c" # Displays info
  661. STATUS_HEATING # Sets SB-leds to heating-mode
  662. G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
  663. M107 # Turns off partcooling fan
  664. M109 S{target_extruder} # Heats the nozzle to printing temp
  665.  
  666. # Gets ready to print by doing a purge line and updating the SB-leds
  667. SET_DISPLAY_TEXT MSG="Printer goes brr" # Displays info
  668. STATUS_PRINTING # Sets SB-leds to printing-mode
  669. G0 X{x_wait - 50} Y4 F10000 # Moves to starting point
  670. G0 Z0.4 # Raises Z to 0.4
  671. G91 # Incremental positioning
  672. G1 X100 E20 F1000 # Purge line
  673. G90 # Absolut position
  674.  
  675. # Use PRINT_END for the slicer ending script - please customise for your slicer of choice
  676. [gcode_macro PRINT_END]
  677. gcode:
  678. # safe anti-stringing move coords
  679. {% set th = printer.toolhead %}
  680. {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
  681. {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
  682. {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
  683.  
  684. SAVE_GCODE_STATE NAME=STATE_PRINT_END
  685.  
  686. M400 ; wait for buffer to clear
  687. G92 E0 ; zero the extruder
  688. G1 E-5.0 F1800 ; retract filament
  689.  
  690. TURN_OFF_HEATERS
  691.  
  692. G90 ; absolute positioning
  693. G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing
  694. G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear
  695. M107 ; turn off fan
  696.  
  697. BED_MESH_CLEAR
  698. RESTORE_GCODE_STATE NAME=STATE_PRINT_END
  699.  
  700. #*# <---------------------- SAVE_CONFIG ---------------------->
  701. #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
  702. #*#
  703. #*# [extruder]
  704. #*# control = pid
  705. #*# pid_kp = 24.484
  706. #*# pid_ki = 2.148
  707. #*# pid_kd = 69.778
  708. #*#
  709. #*# [probe]
  710. #*# z_offset = -0.760
  711.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement