Klipper-Macros 项目使用教程

Klipper-Macros 项目使用教程

1. 项目的目录结构及介绍

Klipper-Macros 项目的目录结构如下:

klipper-macros/
├── globals.cfg
├── macros/
│   ├── _km_bed_mesh.cfg
│   ├── _km_calibration.cfg
│   ├── _km_chamber_fan.cfg
│   ├── _km_extruder_fan.cfg
│   ├── _km_filament_sensor.cfg
│   ├── _km_idle_timeout.cfg
│   ├── _km_leds.cfg
│   ├── _km_pause_resume.cfg
│   ├── _km_print_start_end.cfg
│   ├── _km_purge_on_toolchange.cfg
│   ├── _km_retraction.cfg
│   ├── _km_screw_tilt_modify.cfg
│   ├── _km_temperature_fan.cfg
│   ├── _km_tmc.cfg
│   ├── _km_z_calibration.cfg
│   └── _km_z_tilt.cfg
├── README.md
└── slicer_compat.cfg

目录结构介绍

  • globals.cfg: 包含所有可配置的全局变量。
  • macros/: 包含各种宏文件,每个文件对应不同的功能。
    • _km_bed_mesh.cfg: 床网宏。
    • _km_calibration.cfg: 校准宏。
    • _km_chamber_fan.cfg: 腔室风扇宏。
    • _km_extruder_fan.cfg: 挤出机风扇宏。
    • _km_filament_sensor.cfg: 耗材传感器宏。
    • _km_idle_timeout.cfg: 空闲超时宏。
    • _km_leds.cfg: LED 控制宏。
    • _km_pause_resume.cfg: 暂停和恢复宏。
    • _km_print_start_end.cfg: 打印开始和结束宏。
    • _km_purge_on_toolchange.cfg: 工具更换时的清洗宏。
    • _km_retraction.cfg: 回抽宏。
    • _km_screw_tilt_modify.cfg: 螺丝倾斜修正宏。
    • _km_temperature_fan.cfg: 温度风扇宏。
    • _km_tmc.cfg: TMC 驱动宏。
    • _km_z_calibration.cfg: Z 轴校准宏。
    • _km_z_tilt.cfg: Z 轴倾斜宏。
  • README.md: 项目说明文档。
  • slicer_compat.cfg: 切片器兼容性配置文件。

2. 项目的启动文件介绍

Klipper-Macros 项目没有特定的启动文件,但可以通过在 Klipper 配置文件中包含相应的宏文件来启用这些宏。通常,你需要在你的 Klipper 配置文件中添加以下内容:

[include globals.cfg]
[include macros/*.cfg]

3. 项目的配置文件介绍

globals.cfg

globals.cfg 文件包含所有可配置的全局变量,这些变量可以在你的 Klipper 配置文件中进行覆盖。例如:

[gcode_macro _km_options]
variable_bed_temp = 60
variable_extruder_temp = 200

slicer_compat.cfg

slicer_compat.cfg 文件用于确保切片器生成的 G-code 与 Klipper 兼容。通常,你不需要修改这个文件,除非你有特定的需求。

宏文件

每个宏文件都包含一组特定的 G-code 命令,用于实现特定的功能。例如,_km_print_start_end.cfg 文件包含打印开始和结束的宏命令。

通过在 Klipper 配置文件中包含这些宏文件,你可以轻松地启用和配置这些功能。

[include macros/_km_print_start_end.cfg]

通过这种方式,你可以根据需要启用和配置不同的宏功能。

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

# This file works for GuguBOT with MKS Monster8 V2.0 Only # 本配置适用于使用MKS Monster8 V2.0版本主板的GuguBOT [include misc/timelapse.cfg] [include Klicky-Probe/klicky-probe.cfg] [include Klicky-Probe/z_calibration.cfg] [include misc/Gugu_Macros.cfg] [exclude_object] [mcu] ## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2E0027001251333233363732-if00 #-------------------------------------------------------------------- ##-------------------------------------------------------------------- [printer] kinematics: corexy max_velocity: 500 max_accel: 20000 max_z_velocity: 15 max_z_accel: 300 square_corner_velocity: 5.0 ############################################# # AB电机设置 ############################################# #-------------------------------------------------------------------- # 供CoreXY AB电机方向测试时使用,日常使用请勿开启 ##------------------------------------------------------------------- #[force_move] #enable_force_move: True #[respond] ##------------------------------------------------------------------- ## B电机(右后) 接主板Y驱动(Drive1:Y) [stepper_x] step_pin:PE5 dir_pin:PE4 enable_pin:!PC15 microsteps:16 rotation_distance: 40 full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper endstop_pin:PA14 position_min: 0 position_endstop:300 position_max:300 homing_speed:60 second_homing_speed:10 homing_retract_speed:10 homing_retract_dist:5 homing_positive_dir:true [tmc2209 stepper_x] uart_pin: PE3 interpolate: True run_current: 1.19 hold_current: 0.6 sense_resistor: 0.110 stealthchop_threshold: 0 ## A电机(左后) 接主板X驱动(Drive0:X) [stepper_y] step_pin:PC14 dir_pin:PC13 enable_pin:!PC15 microsteps: 16 rotation_distance: 40 full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper endstop_pin:PA15 position_min: 0 position_endstop: 320 position_max: 320 homing_speed:60 second_homing_speed:10 homing_retract_speed:10 homing_retract_dist:5 homing_positive_dir:true [tmc2209 stepper_y] uart_pin: PE6 interpolate: True run_current: 1.19 hold_current: 0.6 sense_resistor: 0.110 stealthchop_threshold: 0 ############################################# # Z电机设置 ############################################# ## Z0电机(左前) 接主板Z驱动(Drive2:Z1) [stepper_z] step_pin:PE1 dir_pin:!PE0 enable_pin: !PE2 microsteps: 16 rotation_distance: 2 #与丝杠导程数一致 full_steps_per_rotation: 200 endstop_pin:PB13 ## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0) ## (+) value = endstop above Z0, (-) value = endstop below ## Increasing position_endstop brings nozzle closer to the bed ## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config position_endstop:0 position_max: 300 position_min: -3 homing_speed: 6 second_homing_speed: 3.0 homing_retract_dist: 3.0 [tmc2209 stepper_z] uart_pin: PB7 interpolate: True run_current: 0.8 hold_current: 0.5 stealthchop_threshold: 0 ## Z1电机(后) 接主板E1驱动(Drive4:E1) [stepper_z1] step_pin:PD6 dir_pin:!PD5 enable_pin:!PD7 microsteps:16 rotation_distance: 2 #与丝杠导程数一致 full_steps_per_rotation: 200 [tmc2209 stepper_z1] uart_pin: PD4 interpolate: True run_current: 0.8 hold_current: 0.5 stealthchop_threshold: 0 ## Z2电机(右前) 接主板E2驱动(Drive5:E2) [stepper_z2] step_pin:PD2 dir_pin:!PD1 enable_pin:!PD3 microsteps: 16 rotation_distance: 2 #与丝杠导程数一致 full_steps_per_rotation: 200 [tmc2209 stepper_z2] uart_pin: PD0 interpolate: True run_current: 0.8 hold_current: 0.5 stealthchop_threshold: 0 ############################################# # 挤出机设置 ############################################# ## 挤出机电机 接主板E0驱动(Drive3:E0) [extruder] step_pin:PB5 dir_pin:PB4 enable_pin:!PB6 microsteps:16 rotation_distance: 22.75 #需要精确校准 gear_ratio: 50:10 full_steps_per_rotation: 200 #400 for 0.9 degree nozzle_diameter: 0.400 #与喷嘴保持一致 filament_diameter: 1.750 max_extrude_cross_section: 6.0 max_extrude_only_distance: 100.0 min_temp: 0 max_temp: 280 heater_pin: PB1 sensor_type: NTC 100K MGB18-104F39050L32 sensor_pin: PC1 max_power: 1.0 control : pid #校准在控制台输入PID_CALIBRATE HEATER=extruder TARGET=200 pid_kp : 18.293 pid_ki : 0.960 pid_kd : 87.119 pressure_advance: 0.035 pressure_advance_smooth_time: 0.040 [tmc2209 extruder] uart_pin: PB3 interpolate: True run_current: 0.71 hold_current: 0.4 sense_resistor: 0.110 stealthchop_threshold: 0 ##################################################################### # Probe ##################################################################### [probe] pin: PB12 x_offset: -1 y_offset: 25 z_offset: 9.90 speed: 5 samples:3 samples_result: median sample_retract_dist: 2.0 samples_tolerance: 0.01 samples_tolerance_retries: 3 [bed_mesh] speed: 100 horizontal_move_z: 16 mesh_min: 25, 25 mesh_max: 275, 275 probe_count: 5, 5 zero_reference_position: 150, 150 algorithm: bicubic mesh_pps: 2,2 fade_start: 3 fade_end: 10 fade_target: 0 [z_tilt] # 下面两项配置务必使用换行分割并缩进。分别对应z,z1,z2,注意!确保顺序正确,否则会越调越歪! # 注意确保每个points到丝杆的距离相同。确保给的XY探针能正常碰到床并触发! z_positions: # Z轴丝杆所在坐标 -52,-23 163,375 346,-23 points: # 探测点喷嘴的坐标,注意不是探针坐标 10,5 164,260 286,5 speed: 100 #xy移动速度 horizontal_move_z: 16 #z轴高度 retries: 3 #尝试次数,不同点之间的高度差大于下方的retry_tolerance值时候会进行重试。 retry_tolerance: 0.01 #允许不同点的高度差 ######################################## # 热床 ######################################## [heater_bed] heater_pin: PB10 sensor_type: NTC 100K MGB18-104F39050L32 sensor_pin: PC0 max_power: 1.0 control = pid #校准在控制台输入PID_CALIBRATE HEATER=bed TARGET=50 pid_kp = 72.923 pid_ki = 0.634 pid_kd = 2097.460 min_temp: 0 max_temp: 80 ######################################## # 风扇 ######################################## #散热块风扇,接FAN0接口 #[heater_fan my_nozzle_fan] [heater_fan NozzleFan] pin: PA2 max_power: 1.0 shutdown_speed: 0 heater: extruder heater_temp: 60.0 fan_speed: 1.0 #冷却风扇,接FAN1接口 [fan] pin: PA1 max_power: 1.0 #限制最高转速 shutdown_speed: 0 #背部驱动散热风扇,接FAN2接口 [controller_fan TMC_controller_fan] pin: PA0 max_power: 0.7 shutdown_speed: 0 kick_start_time: 0.5 idle_timeout: 600 idle_speed: 0.4 stepper: stepper_x, stepper_y, stepper_z, stepper_z1, stepper_z2, extruder [temperature_sensor KlipperBox] sensor_type: temperature_host min_temp: 5 max_temp: 100 ##################################################################### # LED ##################################################################### #补光LED,白光,接HE2接口 [output_pin Light] pin: PA3 pwm: False #氛围LED,红蓝光,接HE1接口 [output_pin AmbientLight] pin: PB0 pwm: False value: 1.0 shutdown_value: 1.0 #[output_pin caselight ](Use PA9) ## Chamber Lighting - In 5V-RGB Position #pin: PA9 #pwm: true #shutdown_value: 0 #value:100 #cycle_time: 0.01 ######################################## # EXP1 / EXP2 (display) pins ######################################## [board_pins] aliases: # EXP1 header EXP1_10=<5V>, EXP1_9=<GND>, EXP1_8=PE7, EXP1_7=PE15, EXP1_6=PD8, EXP1_5=PD9, # Slot in the socket on the other side EXP1_4=PD10, EXP1_3=PE11, EXP1_2=PE10, EXP1_1=PB2, # EXP2 header EXP2_10=<5V>, EXP2_9=<GND>, EXP2_8=<RST>, EXP2_7=PB11, EXP2_6=PA7, EXP2_5=PE8, # Slot in the socket on the other side EXP2_4=PA4, EXP2_3=PE9, EXP2_2=PA5, EXP2_1=PA6 # See the sample-lcd.cfg file for definitions of common LCD displays. # Some alternate glyphs for use with 128x64 LCDs. These are used by # adding them to your printer.cfg. # See docs/Config_Reference.md for a description of parameters. ###################################################################### # MKS Mini 12864v3.0 (with neopixel backlight leds) ###################################################################### [display] lcd_type: uc1701 cs_pin: EXP1_3 a0_pin: EXP1_4 rst_pin: EXP1_5 contrast: 63 encoder_pins: ^EXP2_5, ^EXP2_3 click_pin: ^!EXP1_2 ## Some micro-controller boards may require an spi bus to be specified: #spi_bus: spi ## Alternatively, some micro-controller boards may work with software spi: spi_software_miso_pin: EXP2_1 spi_software_mosi_pin: EXP2_6 spi_software_sclk_pin: EXP2_2 [output_pin beeper] pin: EXP1_1 [neopixel fysetc_mini12864] pin: EXP1_6 chain_count: 3 color_order: RGB initial_RED: 0.0 initial_GREEN: 1.0 initial_BLUE: 0.76 ###################################################################### # ADXL345 共振测量 ###################################################################### [adxl345] cs_pin: PC9 spi_bus: spi3a [resonance_tester] accel_chip: adxl345 probe_points: 150, 150, 50 #测量时喷嘴所处的位置坐标 [input_shaper] shaper_freq_x: 85.2 shaper_freq_y: 65.6 shaper_type_x: ei shaper_type_y: ei ###################################################################### # gcode_macro ###################################################################### [gcode_macro CANCEL_PRINT] description: Cancel the actual running print rename_existing: CANCEL_PRINT_BASE gcode: TURN_OFF_HEATERS CANCEL_PRINT_BASE [virtual_sdcard] path: /home/pi/printer_data/gcodes #path: /home/klipper/printer_data/gcodes [pause_resume] [display_status] 这是目前我的klipper配置,下位机是mks monster8 v2 但是目前我下位机移动距离控制有点问题,全部归位都没有问题,但是我归位后移动距离,但是xy坐标值根本不变化,一直卡在归零后的坐标值。然后Z轴3个电机向下移动50mm,平台应该一起3个电机旋转下降,却只有一个电机向下移动,应该是z2动了其他俩个电机动都没动,z轴数值是有变化的
最新发布
07-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

龚格成

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值