Skip to content

Instantly share code, notes, and snippets.

@pakrym
Last active April 6, 2024 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pakrym/5e07f045b206d696164ec6e27bdb9bfd to your computer and use it in GitHub Desktop.
Save pakrym/5e07f045b206d696164ec6e27bdb9bfd to your computer and use it in GitHub Desktop.
[include mainsail.cfg]
[fan]
pin: PF7
[heater_bed]
heater_pin: PF5
sensor_pin: PB1 # TB
sensor_type: ATC Semitec 104GT-2
control: pid
pid_Kp: 58.884
pid_Ki: 0.677
pid_Kd: 1280.735
min_temp: 0
max_temp: 130
# Hotend fan
[heater_fan extruder_fan]
heater: extruder
heater_temp: 50.0
pin: PF9
fan_speed: 1
[temperature_fan mcu_fan]
pin: PF6
sensor_type: temperature_mcu
target_temp: 40
control: watermark
min_temp: 10
max_temp: 90
max_speed: 0.5
[temperature_fan soc_fan]
pin: PF8
sensor_type: temperature_host
target_temp: 40
control: watermark
min_temp: 10
max_temp: 90
max_speed: 0.5
[probe]
pin: PF2
z_offset: 0.80
# Motor1
# 17HM15-0904S
# 0.9deg 0.9A
[stepper_x]
step_pin: PE6
dir_pin: PE5
enable_pin: !PC14
microsteps: 16
rotation_distance: 32
full_steps_per_rotation: 400
position_endstop: 0
position_max: 240
homing_speed: 50
endstop_pin: tmc2209_stepper_x:virtual_endstop
homing_retract_dist: 0
# Motor1
# 17HM15-0904S
# 0.9deg 0.9A
[tmc2209 stepper_x]
uart_pin: PC13
diag_pin: ^PF4
run_current: 0.51
stealthchop_threshold: 999999
driver_SGTHRS: 180
# Motor2
# 17HM19-2004S
# 0.9deg 2.0A
[stepper_y]
step_pin: PE2
dir_pin: !PE1
enable_pin: !PE4
microsteps: 16
rotation_distance: 40
full_steps_per_rotation: 400
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: 0
position_max: 210
homing_speed: 50
homing_retract_dist: 0
## Motor2
# 17HM19-2004S
# 0.9deg 2.0A
[tmc2209 stepper_y]
uart_pin: PE3
diag_pin: ^PF3
run_current: 1.13
stealthchop_threshold: 999999
driver_SGTHRS: 160
# MOONS C17HD40102-01N
# 1.8deg 1.02A
[stepper_z]
step_pin: PB4
dir_pin: PB3
enable_pin: !PB6
microsteps: 16
rotation_distance: 2
full_steps_per_rotation: 200
endstop_pin: probe:z_virtual_endstop
position_max: 200
position_min: 0
homing_speed: 8
second_homing_speed: 3
homing_retract_dist: 5
# MOONS C17HD40102-01N
# 1.8deg 1.02A
[tmc2209 stepper_z]
uart_pin: PB5
run_current: 0.58
stealthchop_threshold: 999999
# MOONS C17HD40102-01N
# 1.8deg 1.02A
[stepper_z1]
step_pin: PG13
dir_pin: PG12
enable_pin: !PG15
microsteps: 16
rotation_distance: 2
full_steps_per_rotation: 200
endstop_pin: probe:z_virtual_endstop
# MOONS C17HD40102-01N
# 1.8deg 1.02A
[tmc2209 stepper_z1]
uart_pin: PG14
run_current: 0.58
stealthchop_threshold: 999999
[z_tilt]
z_positions:
-35,125
290,125
points:
30,125
100,125
200,125
speed: 200
horizontal_move_z: 5
[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 35, 6
mesh_max: 200, 198
probe_count: 3, 3
# Motor6
# 42H25H-0704-002
# 1.8 deg 0.7A
[extruder]
step_pin: PG9
dir_pin: PD7
enable_pin: !PG11
microsteps: 16
rotation_distance: 14.953
full_steps_per_rotation: 200
nozzle_diameter: 0.4
filament_diameter: 1.75
heater_pin: PA0 # HE0
sensor_pin: PB0 # T0
sensor_type: Generic 3950
control: pid
pid_Kp: 23.742
pid_Ki: 1.552
pid_Kd: 90.812
min_temp: 0
max_temp: 250
pressure_advance: 0.051
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
# Start bed heating
M140 S{BED_TEMP}
# Start extruder heating
M104 S{EXTRUDER_TEMP}
# Home the printer
HOME
# Wait for bed to reach temperature
M190 S{BED_TEMP}
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
# Reset the G-Code Z offset (adjust Z offset if needed)
# SET_GCODE_OFFSET Z=0.0
Z_TILT_ADJUST
BED_MESH_CLEAR ; clears the mesh
BED_MESH_CALIBRATE ; Probe the bed and create a mesh
BED_MESH_PROFILE SAVE=start_print ; this will save the bed mesh data to the profile
BED_MESH_PROFILE LOAD=start_print ; load the default bed mesh profile
# Move the nozzle near the bed
G1 Z5 F3000
PURGE
[gcode_macro PURGE]
gcode:
G92 E0 ;Reset Extruder
G1 X20 Y5.1 Z0.25 F5000.0 ;Move to start position
G1 X200.0 Y5.1 Z0.25 F1500.0 E15 ;Draw the first line
G1 X200.0 Y5.4 Z0.25 F5000.0 ;Move to side a little
G1 X20 Y5.4 Z0.25 F1500.0 E30 ;Draw the second line
G92 E0 ;Reset Extruder
[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 X-2 Y-2 E-3 F300
# Raise nozzle by 10mm
G1 Z30 F3000
G90
# Disable steppers
M84
[gcode_macro HOME]
gcode:
# Use absolute coordinates
G90
# Home Y
G28 Y0
G1 Y10 F1200
# Home X
G4 P2000
G28 X0
G1 X10 F1200
# Home Z
G28 Z0
G1 Z10 F1200
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32h723xx_2C0015001551303531313638-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[board_pins]
aliases:
# EXP1 header
EXP1_1=PE7, EXP1_2=PG1,
EXP1_3=PG0, EXP1_4=PF15,
EXP1_5=PF14, EXP1_6=PF13, # Slot in the socket on this side
EXP1_7=PF12, EXP1_8=PF11,
EXP1_9=<GND>, EXP1_10=<5V>,
# EXP2 header
EXP2_1=PE13, EXP2_2=PE12,
EXP2_3=PE15, EXP2_4=PE11,
EXP2_5=PE10, EXP2_6=PE14, # Slot in the socket on this side
EXP2_7=PE8, EXP2_8=<RST>,
EXP2_9=<GND>, EXP2_10=<NC>
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.044352, 0.121852, -0.173148
#*# 0.028727, 0.098102, 0.026852
#*# -0.220023, -0.186898, -0.239398
#*# x_count = 3
#*# y_count = 3
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = lagrange
#*# tension = 0.2
#*# min_x = 35.0
#*# max_x = 200.0
#*# min_y = 6.0
#*# max_y = 198.0
#*#
#*# [bed_mesh start_print]
#*# version = 1
#*# points =
#*# 0.044352, 0.121852, -0.173148
#*# 0.028727, 0.098102, 0.026852
#*# -0.220023, -0.186898, -0.239398
#*# x_count = 3
#*# y_count = 3
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = lagrange
#*# tension = 0.2
#*# min_x = 35.0
#*# max_x = 200.0
#*# min_y = 6.0
#*# max_y = 198.0
#*#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment