Skip to content

Instantly share code, notes, and snippets.

@heiso
Last active September 9, 2024 16:48
Show Gist options
  • Save heiso/e59e95374754d122468f092871d68b73 to your computer and use it in GitHub Desktop.
Save heiso/e59e95374754d122468f092871d68b73 to your computer and use it in GitHub Desktop.
Klipper printer config - Artillery Genius (MKS gen L)
[include mainsail.cfg]
[gcode_macro _CLIENT_VARIABLE]
variable_use_custom_pos : False ; use custom park coordinates for x,y [True/False]
variable_custom_park_x : 0.0 ; custom x position; value must be within your defined min and max of X
variable_custom_park_y : 0.0 ; custom y position; value must be within your defined min and max of Y
variable_custom_park_dz : 2.0 ; custom dz value; the value in mm to lift the nozzle when move to park position
variable_retract : 1.0 ; the value to retract while PAUSE
variable_cancel_retract : 5.0 ; the value to retract while CANCEL_PRINT
variable_speed_retract : 35.0 ; retract speed in mm/s
variable_unretract : 1.0 ; the value to unretract while RESUME
variable_speed_unretract : 35.0 ; unretract speed in mm/s
variable_speed_hop : 15.0 ; z move speed in mm/s
variable_speed_move : 100.0 ; move speed in mm/s
variable_park_at_cancel : False ; allow to move the toolhead to park while execute CANCEL_PRINT [True/False]
variable_park_at_cancel_x : None ; different park position during CANCEL_PRINT [None/Position as Float]; park_at_cancel must be True
variable_park_at_cancel_y : None ; different park position during CANCEL_PRINT [None/Position as Float]; park_at_cancel must be True
# !!! Caution [firmware_retraction] must be defined in the printer.cfg if you set use_fw_retract: True !!!
variable_use_fw_retract : False ; use fw_retraction instead of the manual version [True/False]
gcode:
[stepper_x]
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
microsteps: 16
rotation_distance: 39.80
endstop_pin: ^!ar3
position_endstop: 0
position_min: 0
position_max: 220
homing_speed: 40.0
[stepper_y]
step_pin: ar60
dir_pin: ar61
enable_pin: !ar56
microsteps: 16
rotation_distance: 39.88
endstop_pin: ^!ar14
position_endstop: 0
position_min: 0
position_max: 220
homing_speed: 40
homing_positive_dir: false
[stepper_z]
step_pin: ar46
dir_pin: !ar48
enable_pin: !ar62
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_min: -3
position_max: 250
homing_speed: 30
second_homing_speed: 1
[stepper_z1]
step_pin: ar36
dir_pin: !ar34
enable_pin: !ar30
microsteps: 16
rotation_distance: 8
[extruder]
step_pin: ar26
dir_pin: ar28
enable_pin: !ar24
microsteps: 16
rotation_distance: 7.49
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
min_extrude_temp: 180
min_temp: 5
max_temp: 300
max_extrude_only_distance: 500
max_extrude_cross_section: 2.0
pressure_advance: 0.070
[heater_bed]
heater_pin: ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog14
min_temp: 5
max_temp: 150
smooth_time: 10
#control = pid
#pid_kp = 34.18
#pid_ki = 3.21
#pid_kd = 242.65
[fan]
pin: ar9
kick_start_time: 0.500
[heater_fan my_nozzle_fan]
pin:ar7
heater: extruder
heater_temp: 50.0
fan_speed: 1.0
[mcu]
#make sure this reflects your serial port you found when flashing klipper
#serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
serial: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-port0
[printer]
kinematics: cartesian
max_velocity: 200
max_accel: 3000
max_z_velocity: 50
max_z_accel: 100
square_corner_velocity: 5
[bed_screws]
screw1: 45,45
screw1_name: front left
screw2: 185,45
screw2_name: front right
screw3: 185,185
screw3_name: back right
screw4: 45,185
screw4_name: back left
speed: 100.0
[bltouch]
sensor_pin: ar19
control_pin: ar11
x_offset:29
y_offset:-35
speed:10
samples:1
samples_result:average
set_output_mode: 5V
probe_with_touch_mode: true
stow_on_each_sample: false
[safe_z_home]
home_xy_position: 82,143
speed: 100
z_hop: 20
z_hop_speed: 20
[bed_mesh]
speed: 800
mesh_min: 29,5
mesh_max: 215,185
probe_count: 8,8
mesh_pps: 2,2
algorithm: bicubic
bicubic_tension: 0.2
move_check_distance: 3.0
split_delta_z: .010
fade_start: 1.0
fade_end: 5.0
[screws_tilt_adjust]
screw1: 17,78
screw1_name: front left
screw2: 157,78
screw2_name: front right
screw3: 17,218
screw3_name: back left
screw4: 157,218
screw4_name: back right
speed: 100.0
screw_thread: CW-M5
[skew_correction]
#uncomment the following lines to use Z_TILT_ADJUST and uncomment G34 Macro to use G34
#[z_tilt]
#z_positions:
# 10,155
# 270,155
#
#points:
# 10,155
# 270,155
#speed: 100
#horizontal_move_z: 10
[gcode_macro G29]
gcode:
BED_MESH_CLEAR
G28
BED_MESH_CALIBRATE
BED_MESH_PROFILE SAVE=x1
#[gcode_macro G34]
#gcode:
# G28
# Z_TILT_ADJUST
[gcode_macro G35]
gcode:
G28
SCREWS_TILT_CALCULATE
[gcode_macro START_PRINT]
gcode:
{% set bed_temp = params.BED_TEMP|default(60)|float %}
{% set extruder_temp = params.EXTRUDER_TEMP|default(210)|float %}
#SET_GCODE_OFFSET Z=-0.080
#SET_GCODE_OFFSET Z=+0.090
#SET_GCODE_OFFSET Z=+0.010
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={bed_temp}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={bed_temp - 1}
# Home the printer
G29
# Use absolute coordinates
G90
# Wait for hotend temp
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={extruder_temp}
G1 X0 Y0 Z30 F3000
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={extruder_temp} MAXIMUM={extruder_temp + 2}
# Move the nozzle near the bed
G1 X0 Y0 Z5 F3000
# Move the nozzle very close to the bed
G1 Z0.15 F300
G92 E0 ;Reset Extruder
G1 X20 Y5 Z0.3 F5000.0
G1 Z0.3 F1000
G1 X50 Y5 F1500.0 E5
G1 X50 Y5.3 Z0.3 F5000.0
G1 X5.3 Y5.3 Z0.3 F1500.0 E10
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
G92 E0
SKEW_PROFILE LOAD=CaliFlower
[gcode_macro END_PRINT]
gcode:
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Move nozzle away from print while retracting
G91
G1 Z20 X10 Y10 E-3 F3000
G90
G1 Y200 F6000
# Disable steppers
M84
SET_SKEW CLEAR=1
[pause_resume]
recover_velocity: 50.
#[filament_switch_sensor my_sensor]
#Move filament runout sensor from TFT to X+ endstop pin. Umcomment all but this line if you want to use this
#pause_on_runout: False
#runout_gcode: PAUSE
#insert_gcode: RESUME
#switch_pin: ar2
# Arduino aliases for atmega2560/1280 (Arduino mega) boards
[board_pins arduino-mega]
aliases:
ar0=PE0, ar1=PE1, ar2=PE4, ar3=PE5, ar4=PG5,
ar5=PE3, ar6=PH3, ar7=PH4, ar8=PH5, ar9=PH6,
ar10=PB4, ar11=PB5, ar12=PB6, ar13=PB7, ar14=PJ1,
ar15=PJ0, ar16=PH1, ar17=PH0, ar18=PD3, ar19=PD2,
ar20=PD1, ar21=PD0, ar22=PA0, ar23=PA1, ar24=PA2,
ar25=PA3, ar26=PA4, ar27=PA5, ar28=PA6, ar29=PA7,
ar30=PC7, ar31=PC6, ar32=PC5, ar33=PC4, ar34=PC3,
ar35=PC2, ar36=PC1, ar37=PC0, ar38=PD7, ar39=PG2,
ar40=PG1, ar41=PG0, ar42=PL7, ar43=PL6, ar44=PL5,
ar45=PL4, ar46=PL3, ar47=PL2, ar48=PL1, ar49=PL0,
ar50=PB3, ar51=PB2, ar52=PB1, ar53=PB0, ar54=PF0,
ar55=PF1, ar56=PF2, ar57=PF3, ar58=PF4, ar59=PF5,
ar60=PF6, ar61=PF7, ar62=PK0, ar63=PK1, ar64=PK2,
ar65=PK3, ar66=PK4, ar67=PK5, ar68=PK6, ar69=PK7,
analog0=PF0, analog1=PF1, analog2=PF2, analog3=PF3, analog4=PF4,
analog5=PF5, analog6=PF6, analog7=PF7, analog8=PK0, analog9=PK1,
analog10=PK2, analog11=PK3, analog12=PK4, analog13=PK5, analog14=PK6,
analog15=PK7,
# Marlin adds these additional aliases
ml70=PG4, ml71=PG3, ml72=PJ2, ml73=PJ3, ml74=PJ7,
ml75=PJ4, ml76=PJ5, ml77=PJ6, ml78=PE2, ml79=PE6,
ml80=PE7, ml81=PD4, ml82=PD5, ml83=PD6, ml84=PH2,
ml85=PH7
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 21.758
#*# pid_ki = 1.099
#*# pid_kd = 107.700
#*#
#*# [bltouch]
#*# z_offset = 2.525
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.032500, -0.065000, -0.055000, -0.072500, -0.072500, -0.057500, -0.090000, -0.095000
#*# 0.057500, 0.017500, 0.022500, 0.007500, -0.007500, 0.005000, -0.020000, -0.025000
#*# 0.135000, 0.085000, 0.087500, 0.057500, 0.057500, 0.077500, 0.045000, 0.035000
#*# 0.102500, 0.050000, 0.055000, 0.025000, 0.027500, 0.047500, 0.020000, 0.017500
#*# 0.092500, 0.035000, 0.040000, 0.017500, 0.010000, 0.022500, -0.017500, -0.012500
#*# 0.082500, 0.035000, 0.040000, 0.027500, 0.020000, 0.045000, 0.017500, 0.027500
#*# 0.075000, 0.030000, 0.032500, 0.007500, -0.005000, 0.015000, -0.015000, -0.015000
#*# 0.085000, 0.045000, 0.042500, 0.015000, 0.000000, -0.002500, -0.025000, -0.035000
#*# x_count = 8
#*# y_count = 8
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 29.0
#*# max_x = 214.99
#*# min_y = 5.0
#*# max_y = 184.97
#*#
#*# [bed_mesh x1]
#*# version = 1
#*# points =
#*# -0.032500, -0.065000, -0.055000, -0.072500, -0.072500, -0.057500, -0.090000, -0.095000
#*# 0.057500, 0.017500, 0.022500, 0.007500, -0.007500, 0.005000, -0.020000, -0.025000
#*# 0.135000, 0.085000, 0.087500, 0.057500, 0.057500, 0.077500, 0.045000, 0.035000
#*# 0.102500, 0.050000, 0.055000, 0.025000, 0.027500, 0.047500, 0.020000, 0.017500
#*# 0.092500, 0.035000, 0.040000, 0.017500, 0.010000, 0.022500, -0.017500, -0.012500
#*# 0.082500, 0.035000, 0.040000, 0.027500, 0.020000, 0.045000, 0.017500, 0.027500
#*# 0.075000, 0.030000, 0.032500, 0.007500, -0.005000, 0.015000, -0.015000, -0.015000
#*# 0.085000, 0.045000, 0.042500, 0.015000, 0.000000, -0.002500, -0.025000, -0.035000
#*# x_count = 8
#*# y_count = 8
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 29.0
#*# max_x = 214.99
#*# min_y = 5.0
#*# max_y = 184.97
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 44.037
#*# pid_ki = 0.459
#*# pid_kd = 1056.877
#*#
#*# [skew_correction CaliFlower]
#*# xy_skew = -0.005421733961664335
#*# xz_skew = 0.0
#*# yz_skew = 0.0
@heiso
Copy link
Author

heiso commented Dec 31, 2023

Hello, i think at this point the best thing would be to understand how the printer.cfg is working. Try following the klipper documentation from the start and build your own printer.cfg.

@fies4
Copy link

fies4 commented Dec 31, 2023

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment