Advertisement
Guest User

Voron 2.4 Config

a guest
Jul 8th, 2024
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.91 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. ## Hotend heater pin [extruder] section
  16. ## Z Endstop Switch location [safe_z_home] section
  17. ## Homing end position [gcode_macro G32] section
  18. ## Z Endstop Switch offset for Z0 [stepper_z] section
  19. ## Stepper Z1 enable pin [stepper_z1] 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. [mcu]
  27. ## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
  28. ##--------------------------------------------------------------------
  29. serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_09003E001750535556323420-if00
  30. restart_method: command
  31. ##--------------------------------------------------------------------
  32.  
  33. [printer]
  34. kinematics: corexy
  35. max_velocity: 300
  36. max_accel: 3000 #Max 4000
  37. max_z_velocity: 15 #Max 15 for 12V TMC Drivers, can increase for 24V
  38. max_z_accel: 350
  39. square_corner_velocity: 5.0
  40.  
  41. #####################################################################
  42. # X/Y Stepper Settings
  43. #####################################################################
  44.  
  45. ## B Stepper - Left
  46. ## Connected to MOTOR_0
  47. ## Endstop connected to DIAG_0
  48. [stepper_x]
  49. step_pin: PF13
  50. dir_pin: !PF12
  51. enable_pin: !PF14
  52. rotation_distance: 40
  53. microsteps: 32
  54. full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
  55. endstop_pin: PG6
  56. position_min: 0
  57. ##--------------------------------------------------------------------
  58.  
  59. ## Uncomment below for 250mm build
  60. #position_endstop: 250
  61. #position_max: 250
  62.  
  63. ## Uncomment for 300mm build
  64. position_endstop: 300
  65. position_max: 300
  66.  
  67. ## Uncomment for 350mm build
  68. #position_endstop: 350
  69. #position_max: 350
  70.  
  71. ##--------------------------------------------------------------------
  72. homing_speed: 25 #Max 100
  73. homing_retract_dist: 5
  74. homing_positive_dir: true
  75.  
  76. ## Make sure to update below for your relevant driver (2208 or 2209)
  77. [tmc2209 stepper_x]
  78. uart_pin: PC4
  79. interpolate: false
  80. run_current: 0.8
  81. sense_resistor: 0.110
  82. stealthchop_threshold: 0
  83.  
  84. ## A Stepper - Right
  85. ## Connected to MOTOR_1
  86. ## Endstop connected to DIAG_1
  87. [stepper_y]
  88. step_pin: PG0
  89. dir_pin: !PG1
  90. enable_pin: !PF15
  91. rotation_distance: 40
  92. microsteps: 32
  93. full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
  94. endstop_pin: PG9
  95. position_min: 0
  96. ##--------------------------------------------------------------------
  97.  
  98. ## Uncomment for 300mm build
  99. position_endstop: 300
  100. position_max: 300
  101.  
  102. ##--------------------------------------------------------------------
  103. homing_speed: 25 #Max 100
  104. homing_retract_dist: 5
  105. homing_positive_dir: true
  106.  
  107. ## Make sure to update below for your relevant driver (2208 or 2209)
  108. [tmc2209 stepper_y]
  109. uart_pin: PD11
  110. interpolate: false
  111. run_current: 0.8
  112. sense_resistor: 0.110
  113. stealthchop_threshold: 0
  114.  
  115. #####################################################################
  116. # Z Stepper Settings
  117. #####################################################################
  118.  
  119. ## Z0 Stepper - Front Left
  120. ## Connected to MOTOR_2
  121. ## Endstop connected to DIAG_2
  122. [stepper_z]
  123. step_pin: PF11
  124. dir_pin: PG3
  125. enable_pin: !PG5
  126. rotation_distance: 40
  127. gear_ratio: 80:16
  128. microsteps: 32
  129. endstop_pin: probe:z_virtual_endstop
  130. #endstop_pin: PG10
  131. ## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0)
  132. ## (+) value = endstop above Z0, (-) value = endstop below
  133. ## Increasing position_endstop brings nozzle closer to the bed
  134. ## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config
  135. #position_endstop: -0.5
  136. ##--------------------------------------------------------------------
  137.  
  138. ## Uncomment below for 300mm build
  139. position_max: 260
  140.  
  141.  
  142. ##--------------------------------------------------------------------
  143. position_min: -5
  144. homing_speed: 8
  145. second_homing_speed: 3
  146. homing_retract_dist: 3
  147.  
  148. ## Make sure to update below for your relevant driver (2208 or 2209)
  149. [tmc2209 stepper_z]
  150. uart_pin: PC6
  151. interpolate: false
  152. run_current: 0.8
  153. sense_resistor: 0.110
  154. stealthchop_threshold: 0
  155.  
  156. ## Z1 Stepper - Rear Left
  157. ## Connected to MOTOR_3
  158. [stepper_z1]
  159. step_pin: PG4
  160. dir_pin: !PC1
  161. ## Octopus 1.0 & 1.1. Octopus PRO 1.0
  162. enable_pin: !PA0
  163. ## Octopus PRO 1.1
  164. #enable_pin: !PA2
  165. rotation_distance: 40
  166. gear_ratio: 80:16
  167. microsteps: 32
  168.  
  169. ## Make sure to update below for your relevant driver (2208 or 2209)
  170. [tmc2209 stepper_z1]
  171. uart_pin: PC7
  172. interpolate: false
  173. run_current: 0.8
  174. sense_resistor: 0.110
  175. stealthchop_threshold: 0
  176.  
  177. ## Z2 Stepper - Rear Right
  178. ## Connected to MOTOR_4
  179. [stepper_z2]
  180. step_pin: PF9
  181. dir_pin: PF10
  182. enable_pin: !PG2
  183. rotation_distance: 40
  184. gear_ratio: 80:16
  185. microsteps: 32
  186.  
  187. ## Make sure to update below for your relevant driver (2208 or 2209)
  188. [tmc2209 stepper_z2]
  189. uart_pin: PF2
  190. interpolate: false
  191. run_current: 0.8
  192. sense_resistor: 0.110
  193. stealthchop_threshold: 0
  194.  
  195. ## Z3 Stepper - Front Right
  196. ## Connected to MOTOR_5
  197. [stepper_z3]
  198. step_pin: PC13
  199. dir_pin: !PF0
  200. enable_pin: !PF1
  201. rotation_distance: 40
  202. gear_ratio: 80:16
  203. microsteps: 32
  204.  
  205. ## Make sure to update below for your relevant driver (2208 or 2209)
  206. [tmc2209 stepper_z3]
  207. uart_pin: PE4
  208. interpolate: false
  209. run_current: 0.8
  210. sense_resistor: 0.110
  211. stealthchop_threshold: 0
  212.  
  213.  
  214. #####################################################################
  215. # Extruder
  216. #####################################################################
  217.  
  218. ## Connected to MOTOR_6
  219. ## Heater - HE0
  220. ## Thermistor - T0
  221. [extruder]
  222. step_pin: PE2
  223. dir_pin: !PE3
  224. enable_pin: !PD4
  225. ## Update value below when you perform extruder calibration
  226. ## If you ask for 100mm of filament, but in reality it is 98mm:
  227. ## rotation_distance = <previous_rotation_distance> * <actual_extrude_distance> / 100
  228. ## 22.6789511 is a good starting point
  229. rotation_distance: 22.8603827 #Bondtech 5mm Drive Gears
  230. ## Update Gear Ratio depending on your Extruder Type
  231. ## Use 50:10 for Stealthburner/Clockwork 2
  232. ## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio)
  233. ## Use 80:20 for M4, M3.1
  234. gear_ratio: 50:10
  235. microsteps: 32
  236. full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
  237. nozzle_diameter: 0.400
  238. filament_diameter: 1.75
  239. ## Octopus 1.0 & 1.1. Octopus PRO 1.0
  240. heater_pin: PB10
  241. ## Octopus PRO 1.1
  242. #heater_pin: PA0
  243. ## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types.
  244. ## Use "Generic 3950" for NTC 100k 3950 thermistors
  245. sensor_type: PT1000
  246. sensor_pin: PF4
  247. min_temp: 10
  248. max_temp: 270
  249. max_power: 1.0
  250. min_extrude_temp: 170
  251. #control = pid
  252. #pid_kp = 26.213
  253. #pid_ki = 1.304
  254. #pid_kd = 131.721
  255. ## Try to keep pressure_advance below 1.0
  256. pressure_advance: 0.05
  257. ## Default is 0.040, leave stock
  258. pressure_advance_smooth_time: 0.040
  259.  
  260. ## E0 on MOTOR6
  261. ## Make sure to update below for your relevant driver (2208 or 2209)
  262. [tmc2209 extruder]
  263. uart_pin: PE1
  264. interpolate: false
  265. run_current: 0.5
  266. sense_resistor: 0.110
  267. stealthchop_threshold: 0
  268.  
  269.  
  270. #####################################################################
  271. # Bed Heater
  272. #####################################################################
  273.  
  274. ## SSR Pin - HE1
  275. ## Thermistor - TB
  276. [heater_bed]
  277. ## Uncomment the following line if using the default SSR wiring from the docs site
  278. heater_pin: PA3
  279. ## Other wiring guides may use BED_OUT to control the SSR. Uncomment the following line for those cases
  280. #heater_pin: PA1
  281. ## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types.
  282. ## Use "Generic 3950" for Keenovo heaters
  283. sensor_type: Generic 3950
  284. sensor_pin: PF3
  285. ## Adjust max_power so it doesn't exceed the SSR rating. The Omron G3NA-210B-DC5 SSR is rated at 4 amps without a heatsink.
  286. ## The formula is "4 / (Wattage_of_bed_heater / Mains_voltage) = max_power"
  287. ## If max_power is greater than 1.0, use 1.0
  288. max_power: 0.6
  289. min_temp: 0
  290. max_temp: 120
  291. #control: pid
  292. #pid_kp: 58.437
  293. #pid_ki: 2.347
  294. #pid_kd: 363.769
  295.  
  296. #####################################################################
  297. # Probe
  298. #####################################################################
  299.  
  300. ## Inductive Probe
  301. ## This probe is not used for Z height, only Quad Gantry Leveling
  302. [probe]
  303.  
  304. #--------------------------------------------------------------------
  305.  
  306. ## Select the probe port by type:
  307. ## For the PROBE port. Will not work with Diode. May need pull-up resistor from signal to 24V.
  308. pin: ~PG15
  309. ## For the DIAG_7 port. NEEDS BAT85 DIODE! Change to !PG15 if probe is NO.
  310. #pin: PG15
  311. ## For Octopus Pro PROBE port; NPN and PNP proximity switch types can be set by jumper
  312. #pin: ~!PC5
  313.  
  314. #--------------------------------------------------------------------
  315.  
  316. x_offset: 0
  317. y_offset: 0
  318. z_offset: 0
  319. speed: 8.0
  320. samples: 3
  321. samples_result: median
  322. sample_retract_dist: 6.0
  323. samples_tolerance: 0.006
  324. samples_tolerance_retries: 3
  325.  
  326. activate_gcode:
  327. {% set PROBE_TEMP = 150 %}
  328. {% set MAX_TEMP = PROBE_TEMP + 5 %}
  329. {% set ACTUAL_TEMP = printer.extruder.temperature %}
  330. {% set TARGET_TEMP = printer.extruder.target %}
  331.  
  332. {% if TARGET_TEMP > PROBE_TEMP %}
  333. { action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) }
  334. M109 S{ PROBE_TEMP }
  335. {% else %}
  336. # Temperature target is already low enough, but nozzle may still be too hot.
  337. {% if ACTUAL_TEMP > MAX_TEMP %}
  338. { action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) }
  339. TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP }
  340. {% endif %}
  341. {% endif %}
  342.  
  343. #####################################################################
  344. # Fan Control
  345. #####################################################################
  346.  
  347. ## Print Cooling Fan - FAN0
  348. [fan]
  349. pin: PA8
  350. kick_start_time: 0.8
  351. ## Depending on your fan, you may need to increase this value
  352. ## if your fan will not start. Can change cycle_time (increase)
  353. ## if your fan is not able to slow down effectively
  354. off_below: 0.10
  355.  
  356.  
  357. ## Hotend Fan - FAN1
  358. [heater_fan hotend_fan]
  359. pin: PE5
  360. max_power: 1.0
  361. kick_start_time: 0.5
  362. heater: extruder
  363. heater_temp: 50.0
  364. ## If you are experiencing back flow, you can reduce fan_speed
  365. #fan_speed: 1.0
  366.  
  367. ## Controller fan - FAN2
  368. #[controller_fan controller_fan]
  369. #pin: PA8
  370. #kick_start_time: 0.5
  371. #heater: heater_bed
  372.  
  373. ## Exhaust fan - FAN3
  374. [heater_fan exhaust_fan]
  375. pin: PD12
  376. max_power: 1.0
  377. shutdown_speed: 0.0
  378. kick_start_time: 5.0
  379. heater: heater_bed
  380. heater_temp: 60
  381. fan_speed: 1.0
  382.  
  383. [heater_fan electronics]
  384. pin: PD13
  385. max_power: 0.4
  386. shutdown_speed: 0.0
  387. kick_start_time: 5.0
  388. heater: heater_bed
  389. heater_temp: 1
  390. fan_speed: 1.0
  391.  
  392.  
  393. #####################################################################
  394. # LED Control
  395. #####################################################################
  396.  
  397. ## Chamber Lighting - HE2 Connector (Optional)
  398. #[output_pin caselight]
  399. ##Octopus 1.0 & 1.1, Octopus PRO 1.0
  400. #pin: PB10
  401. ##Octopus PRO 1.1
  402. #pin: PB0
  403. #pwm:true
  404. #shutdown_value: 0
  405. #value:1
  406. #cycle_time: 0.01
  407.  
  408. #####################################################################
  409. # Homing and Gantry Adjustment Routines
  410. #####################################################################
  411.  
  412. [idle_timeout]
  413. timeout: 1800
  414.  
  415. [safe_z_home]
  416. ## XY Location of the Z Endstop Switch
  417. ## Update -10,-10 to the XY coordinates of your endstop pin
  418. ## (such as 157,305) after going through Z Endstop Pin
  419. ## Location Definition step.
  420. home_xy_position:150,150
  421. speed:100
  422. z_hop:10
  423.  
  424.  
  425. ## Use QUAD_GANTRY_LEVEL to level a gantry.
  426. ## Min & Max gantry corners - measure from nozzle at MIN (0,0) and
  427. ## MAX (250, 250), (300,300), or (350,350) depending on your printer size
  428. ## to respective belt positions
  429. [quad_gantry_level]
  430.  
  431. ## Gantry Corners for 300mm Build
  432. ## Uncomment for 300mm build
  433. gantry_corners:
  434. -60,-10
  435. 360,370
  436. ## Probe points
  437. points:
  438. 50,25
  439. 50,225
  440. 250,225
  441. 250,25
  442.  
  443.  
  444. #--------------------------------------------------------------------
  445. speed: 100
  446. horizontal_move_z: 10
  447. retries: 5
  448. retry_tolerance: 0.0075
  449. max_adjust: 10
  450.  
  451. ########################################
  452. # EXP1 / EXP2 (display) pins
  453. ########################################
  454.  
  455. [board_pins]
  456. aliases:
  457. # EXP1 header
  458. EXP1_1=PE8, EXP1_2=PE7,
  459. EXP1_3=PE9, EXP1_4=PE10,
  460. EXP1_5=PE12, EXP1_6=PE13, # Slot in the socket on this side
  461. EXP1_7=PE14, EXP1_8=PE15,
  462. EXP1_9=<GND>, EXP1_10=<5V>,
  463.  
  464. # EXP2 header
  465. EXP2_1=PA6, EXP2_2=PA5,
  466. EXP2_3=PB1, EXP2_4=PA4,
  467. EXP2_5=PB2, EXP2_6=PA7, # Slot in the socket on this side
  468. EXP2_7=PC15, EXP2_8=<RST>,
  469. EXP2_9=<GND>, EXP2_10=<5V>
  470.  
  471. #####################################################################
  472. # Displays
  473. #####################################################################
  474.  
  475. ## Uncomment the display that you have
  476. #--------------------------------------------------------------------
  477.  
  478.  
  479. ## RepRapDiscount 128x64 Full Graphic Smart Controller
  480. #[display]
  481. #lcd_type: st7920
  482. #cs_pin: EXP1_4
  483. #sclk_pin: EXP1_5
  484. #sid_pin: EXP1_3
  485. #menu_timeout: 40
  486. #encoder_pins: ^EXP2_5, ^EXP2_3
  487. #click_pin: ^!EXP1_2
  488.  
  489. #[output_pin beeper]
  490. #pin: EXP1_1
  491.  
  492. #--------------------------------------------------------------------
  493.  
  494.  
  495. ## mini12864 LCD Display
  496. [display]
  497. lcd_type: uc1701
  498. cs_pin: EXP1_3
  499. a0_pin: EXP1_4
  500. rst_pin: EXP1_5
  501. encoder_pins: ^EXP2_5, ^EXP2_3
  502. click_pin: ^!EXP1_2
  503. contrast: 63
  504. spi_software_miso_pin: EXP2_1
  505. spi_software_mosi_pin: EXP2_6
  506. spi_software_sclk_pin: EXP2_2
  507.  
  508. ## To control Neopixel RGB in mini12864 display
  509. [neopixel btt_mini12864]
  510. pin: EXP1_6
  511. chain_count: 3
  512. initial_RED: 0.5
  513. initial_GREEN: 0.0
  514. initial_BLUE: 0.0
  515. color_order: RGB
  516.  
  517. ## Set RGB values on boot up for each Neopixel.
  518. ## Index 1 = display, Index 2 and 3 = Knob
  519. #[delayed_gcode setdisplayneopixel]
  520. #initial_duration: 1
  521. #gcode:
  522. # SET_LED LED=btt_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
  523. # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
  524. # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3
  525.  
  526. #--------------------------------------------------------------------
  527.  
  528.  
  529. #####################################################################
  530. # Macros
  531. #####################################################################
  532.  
  533. [gcode_macro CANCEL_PRINT]
  534. description: Cancel the actual running print
  535. rename_existing: CANCEL_PRINT_BASE
  536. gcode:
  537. TURN_OFF_HEATERS
  538. CANCEL_PRINT_BASE
  539.  
  540. [gcode_macro PARK]
  541. gcode:
  542. {% set th = printer.toolhead %}
  543. G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y//2} Z30
  544.  
  545. [gcode_macro G32]
  546. gcode:
  547. SAVE_GCODE_STATE NAME=STATE_G32
  548. G90
  549. G28
  550. QUAD_GANTRY_LEVEL
  551. G28
  552. PARK
  553. RESTORE_GCODE_STATE NAME=STATE_G32
  554.  
  555. [gcode_macro PRINT_START]
  556. gcode:
  557. BED_MESH_CLEAR
  558. G28
  559. QUAD_GANTRY_LEVEL
  560. G28 X Y
  561. CLEAN_NOZZLE
  562. G28 Z
  563. BED_MESH_CALIBRATE
  564.  
  565.  
  566. [gcode_macro PRINT_END]
  567. # Use PRINT_END for the slicer ending script - please customise for your slicer of choice
  568. gcode:
  569. # safe anti-stringing move coords
  570. {% set th = printer.toolhead %}
  571. {% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
  572. {% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
  573. {% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
  574.  
  575. SAVE_GCODE_STATE NAME=STATE_PRINT_END
  576.  
  577. M400 ; wait for buffer to clear
  578. G92 E0 ; zero the extruder
  579. G1 E-5.0 F1800 ; retract filament
  580.  
  581. TURN_OFF_HEATERS
  582.  
  583. G90 ; absolute positioning
  584. G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing
  585. G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear
  586. M107 ; turn off fan
  587.  
  588. BED_MESH_CLEAR
  589.  
  590. # The purpose of the SAVE_GCODE_STATE/RESTORE_GCODE_STATE
  591. # command pair is to restore the printer's coordinate system
  592. # and speed settings since the commands above change them.
  593. # However, to prevent any accidental, unintentional toolhead
  594. # moves when restoring the state, explicitly set MOVE=0.
  595. RESTORE_GCODE_STATE NAME=STATE_PRINT_END MOVE=0
  596.  
  597. [gcode_macro CLEAN_NOZZLE]
  598. variable_start_x: 265
  599. variable_start_y: 300
  600. variable_start_z: 6
  601. variable_wipe_dist: -35
  602. variable_wipe_qty: 5
  603. variable_wipe_spd: 150
  604.  
  605. gcode:
  606. {% if "xyz" not in printer.toolhead.homed_axes %}
  607. G28
  608. {% endif %}
  609.  
  610. G90 ; absolute positioning
  611. ## Move nozzle to start position
  612. G1 X{start_x} Y{start_y} Z{start_z} F{wipe_spd * 60}
  613.  
  614. ## Wipe nozzle
  615. {% for wipes in range(1, (wipe_qty + 1)) %}
  616. G1 X{start_x + wipe_dist} F{wipe_spd * 60}
  617. G1 X{start_x} F{wipe_spd * 60}
  618. {% endfor %}
  619.  
  620. [gcode_macro TEST_SPEED]
  621. # Home, get position, throw around toolhead, home again.
  622. # If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured.
  623. # We only measure to a full step to accomodate for endstop variance.
  624. # Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10
  625.  
  626. description: Test for max speed and acceleration parameters for the printer. Procedure: Home -> ReadPositionFromMCU -> MovesToolhead@Vel&Accel -> Home -> ReadPositionfromMCU
  627.  
  628. gcode:
  629. # Speed
  630. {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %}
  631. # Iterations
  632. {% set iterations = params.ITERATIONS|default(5)|int %}
  633. # Acceleration
  634. {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %}
  635. # Minimum Cruise Ratio
  636. {% set min_cruise_ratio = params.MIN_CRUISE_RATIO|default(0)|float %} # Possible location in printer object stack: printer.configfile.settings.printer.minimum_cruise_ratio
  637. # Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions)
  638. {% set bound = params.BOUND|default(20)|int %}
  639. # Size for small pattern box
  640. {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %}
  641.  
  642. # Large pattern
  643. # Max positions, inset by BOUND
  644. {% set x_min = printer.toolhead.axis_minimum.x + bound %}
  645. {% set x_max = printer.toolhead.axis_maximum.x - bound %}
  646. {% set y_min = printer.toolhead.axis_minimum.y + bound %}
  647. {% set y_max = printer.toolhead.axis_maximum.y - bound %}
  648.  
  649. # Small pattern at center
  650. # Find X/Y center point
  651. {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %}
  652. {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %}
  653.  
  654. # Set small pattern box around center point
  655. {% set x_center_min = x_center - (smallpatternsize/2) %}
  656. {% set x_center_max = x_center + (smallpatternsize/2) %}
  657. {% set y_center_min = y_center - (smallpatternsize/2) %}
  658. {% set y_center_max = y_center + (smallpatternsize/2) %}
  659.  
  660. # Save current gcode state (absolute/relative, etc)
  661. SAVE_GCODE_STATE NAME=TEST_SPEED
  662.  
  663. # Output parameters to g-code terminal
  664. { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) }
  665.  
  666. # Home and get position for comparison later:
  667. M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
  668. G28
  669. # QGL if not already QGLd (only if QGL section exists in config)
  670. {% if printer.configfile.settings.quad_gantry_level %}
  671. {% if printer.quad_gantry_level.applied == False %}
  672. QUAD_GANTRY_LEVEL
  673. G28 Z
  674. {% endif %}
  675. {% endif %}
  676. # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24)
  677. G90
  678. G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60}
  679. M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
  680. G28 X Y
  681. G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
  682. G4 P1000
  683. GET_POSITION
  684.  
  685. # Go to starting position
  686. G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60}
  687.  
  688. # Set new limits
  689. # SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} # DEPRECATED | Due to deprecation of accel_to_decel parameter in Klipper
  690. SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} MIN_CRUISE_RATIO={minCruiseRatio}
  691.  
  692. {% for i in range(iterations) %}
  693. # Large pattern diagonals
  694. G0 X{x_min} Y{y_min} F{speed*60}
  695. G0 X{x_max} Y{y_max} F{speed*60}
  696. G0 X{x_min} Y{y_min} F{speed*60}
  697. G0 X{x_max} Y{y_min} F{speed*60}
  698. G0 X{x_min} Y{y_max} F{speed*60}
  699. G0 X{x_max} Y{y_min} F{speed*60}
  700.  
  701. # Large pattern box
  702. G0 X{x_min} Y{y_min} F{speed*60}
  703. G0 X{x_min} Y{y_max} F{speed*60}
  704. G0 X{x_max} Y{y_max} F{speed*60}
  705. G0 X{x_max} Y{y_min} F{speed*60}
  706.  
  707. # Small pattern diagonals
  708. G0 X{x_center_min} Y{y_center_min} F{speed*60}
  709. G0 X{x_center_max} Y{y_center_max} F{speed*60}
  710. G0 X{x_center_min} Y{y_center_min} F{speed*60}
  711. G0 X{x_center_max} Y{y_center_min} F{speed*60}
  712. G0 X{x_center_min} Y{y_center_max} F{speed*60}
  713. G0 X{x_center_max} Y{y_center_min} F{speed*60}
  714.  
  715. # Small patternbox
  716. G0 X{x_center_min} Y{y_center_min} F{speed*60}
  717. G0 X{x_center_min} Y{y_center_max} F{speed*60}
  718. G0 X{x_center_max} Y{y_center_max} F{speed*60}
  719. G0 X{x_center_max} Y{y_center_min} F{speed*60}
  720. {% endfor %}
  721.  
  722. # Restore max speed/accel/accel_to_decel to their configured values
  723. #SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel} # DEPRECATED | Depercating of accel_to_decel param in klipper
  724. SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} MIN_CRUISE_RATIO={printer.configfile.settings.printer.minimum_cruise_ratio}
  725.  
  726. # Re-home and get position again for comparison:
  727. M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
  728. G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12
  729. # Go to XY home positions (in case your homing override leaves it elsewhere)
  730. G90
  731. G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
  732. G4 P1000
  733. GET_POSITION
  734.  
  735. # Restore previous gcode state (absolute/relative, etc)
  736. RESTORE_GCODE_STATE NAME=TEST_SPEED
  737.  
  738. [bed_mesh]
  739. speed: 300
  740. horizontal_move_z: 10
  741. mesh_min: 40, 40
  742. mesh_max: 260,260
  743. zero_reference_position: 150,150
  744. fade_start: 0.6
  745. fade_end: 10.0
  746. probe_count: 5,5 # Values should be odd, so one point is directly at bed center
  747. algorithm: bicubic
  748.  
  749.  
  750. #####################################################################
  751. # Everything Else
  752. #####################################################################
  753. [virtual_sdcard]
  754. path: /home/blkkrow/printer_data/gcodes
  755.  
  756. [pause_resume]
  757.  
  758. #*# <---------------------- SAVE_CONFIG ---------------------->
  759. #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
  760. #*#
  761. #*# [heater_bed]
  762. #*# control = pid
  763. #*# pid_kp = 35.753
  764. #*# pid_ki = 1.216
  765. #*# pid_kd = 262.784
  766. #*#
  767. #*# [extruder]
  768. #*# control = pid
  769. #*# pid_kp = 25.080
  770. #*# pid_ki = 1.548
  771. #*# pid_kd = 101.572
  772.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement