Skip to content

Instantly share code, notes, and snippets.

@zhaobenx
Created December 18, 2022 10:50
Show Gist options
  • Save zhaobenx/95792227d73f93ce8d26e5ec6e0e63c3 to your computer and use it in GitHub Desktop.
Save zhaobenx/95792227d73f93ce8d26e5ec6e0e63c3 to your computer and use it in GitHub Desktop.
KP3s pro Klipper configuration | 启庞 KP3s pro 的 klipper 配置文件
# This file contains common pin mappings for MKS Robin Nano (v1.2.004)
# boards. To use this config, the firmware should be compiled for the
# STM32F103. When running "make menuconfig", enable "extra low-level
# configuration setup", select the 28KiB bootloader, disable "USB for
# communication", and select USART3 for the "Serial Port".
# Note that the "make flash" command does not work with MKS Robin
# boards. After running "make", run the following command:
# ./scripts/update_mks_robin.py out/klipper.bin out/Robin_nano.bin
# Copy the file out/Robin_nano.bin to an SD card and then restart the
# printer with that SD card.
# See the example.cfg file for a description of available parameters.
[virtual_sdcard]
path: /home/pi/printer_data/gcodes
[stepper_x]
step_pin: PE3
dir_pin: !PE2
enable_pin: !PE4
rotation_distance: 40
microsteps: 32
endstop_pin: ^!PA15
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PE0
dir_pin: PB9
enable_pin: !PE1
rotation_distance: 40
full_steps_per_rotation: 200
microsteps: 32
endstop_pin: ^!PA12
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PB5
dir_pin: !PB4
enable_pin: !PB8
rotation_distance: 8
full_steps_per_rotation: 200
microsteps: 32
endstop_pin: probe:z_virtual_endstop #defines the Z endstop as the BLtouch
position_min: -2 #lets us go lower to adjust the Z offset
position_max: 190
homing_speed: 10
homing_retract_dist: 3.0
[probe]
pin: ^!PA11
x_offset: -40
y_offset: 0
z_offset: 0
speed: 20
[bed_mesh]
speed: 150
horizontal_move_z: 5
mesh_min: 30,30
mesh_max: 170,175
probe_count: 3,3 #performs a 3x3 bed leveling test
[extruder]
step_pin: PD6
dir_pin: !PD3
enable_pin: !PB3
rotation_distance: 7.711
full_steps_per_rotation: 200
microsteps: 32
max_extrude_only_distance: 150.0
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC3
sensor_type: ATC Semitec 104GT-2
sensor_pin: PC1
control: pid
pid_Kp: 14.669
pid_Ki: 0.572
pid_Kd: 94.068
min_temp: 0
max_temp: 250
pressure_advance: 0.08
[input_shaper]
shaper_freq_x: 33.5
shaper_freq_y: 42.1
shaper_type: mzv
[heater_fan my_nozzle_fan]
pin: PB0
heater: extruder
heater_temp: 50.0
fan_speed: 1.0
[heater_bed]
heater_pin: PA0
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC0
control: pid
pid_Kp: 325.10
pid_Ki: 63.35
pid_Kd: 417.10
min_temp: 0
max_temp: 130
[fan]
pin: PB1
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
[printer]
kinematics: cartesian
max_velocity: 250
max_accel: 3000
max_accel_to_decel: 3000
max_z_velocity: 25
max_z_accel: 100
[static_digital_output display_reset]
pins: !PC6, !PD13
[pause_resume]
recover_velocity: 50
[gcode_arcs]
resolution: 0.1
[display_status]
[pause_resume]
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
##### set defaults #####
{% set x = params.X|default(10) %} #edit to your park position
{% set y = params.Y|default(170) %} #edit to your park position
{% set z = params.Z|default(20)|float %} #edit to your park position
{% set e = params.E|default(1) %} #edit to your retract length
##### calculate safe lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set lift_z = z|abs %}
{% if act_z < (max_z - lift_z) %}
{% set z_safe = lift_z %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{e} F300
G1 Z{z_safe}
G90
G1 X{x} Y{y} F4000
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
##### set defaults #####
{% set e = params.E|default(1) %} #edit to your retract length
G91
G1 E{e} F300
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
# [gcode_macro CAL1 ]
# gcode:
# G91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment