####################################################################################
# 3D MELLOW /FLY-D8 PRO #
####################################################################################
## FLY-D8 PRO Documentation: https://mellow-next.klipper.cn/docs/category/fly-d8-h723
## FLY Official Taobao Store: https://shop126791347.taobao.com/shop/view_shop.htm?spm=a230r.1.14.4.1a4840a8hyvpPJ&user_number_id=2464680006
## For after-sales support, please contact Taobao customer service
## FLY After-sales Technical Support Group: 621032883
## FLY-RRF Firmware Group: 786561979
#####################################################################
# Notes #
#####################################################################
##***Items to Change/Check:***
## MCU Path [mcu]
## Printer movement range xyz position
## Thermistor type [extruder] and [heater_bed]
## Z endstop stop position [homing_override]
## Z endstop offset position [stepper_z]
## PID tuning [extruder] and [heater_bed]
## Extruder motor step tuning [extruder]
#####################################################################
# File Includes #
#####################################################################
#[include fluidd.cfg] # For FLUIDD.
#[include mainsail.cfg] # For MAINSAIL.
#Choose the file you need to use.
#####################################################################
# Mainboard Config #
#####################################################################
[mcu] # FLY board ID
serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_XXXXXXXXXXXXXXXXXXXXX
### Find USB firmware ID: ls -l /dev/serial/by-id/
### Replace /dev/serial/by-id/usb-Klipper_stm32f407xx_XXXXXXXXXXXXXXXXXXXXX with the ID you found.
#canbus_uuid: e51d5c71a901
### Find CAN firmware ID: ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
### For CAN ID, replace 'serial' with 'canbus_uuid:' and append the ID.
#####################################################################
# Printer and Acceleration #
#####################################################################
[printer] # Printer settings
kinematics: corexy
max_velocity: 300 # Max printer speed
max_accel: 3000 # Max acceleration
max_z_velocity: 15 # Max Z speed
max_z_accel: 100 # Max Z acceleration
square_corner_velocity: 5.0 # Square corner velocity, lower values help reduce inertia
#####################################################################
# Temperature Monitoring #
#####################################################################
[temperature_sensor Fly-D8] # FLY board temperature
sensor_type: temperature_mcu MCU
#--------------------------------------------------------------------
[temperature_sensor FLY-π] # Host temperature
sensor_type: temperature_host
#####################################################################
# Bed Mesh Calibration
#####################################################################
[bed_mesh]
speed: 50 # Calibration speed
horizontal_move_z: 5 # Z lift before moving to next point
mesh_min: 30,30 # Minimum calibration point
mesh_max: 270, 270 # Maximum calibration point
probe_count: 4,4 # Number of probe points
mesh_pps: 2,2 # Additional probe points
algorithm: bicubic
bicubic_tension: 0.2
#####################################################################
# X/Y Stepper Motor Settings #
#####################################################################
# z1 z2
# B__________A
#
#
#
# Z0 12864 Z3
#####################################################################
# X Stepper Motor #
#####################################################################
## DRIVER0 motor position
[stepper_x]
step_pin: PE5 # X step pin
dir_pin: PA8 # X direction pin
enable_pin: !PA15 # X enable pin
rotation_distance: 40 # Pulley circumference in mm
microsteps: 16 # Microstepping
full_steps_per_rotation: 200 # Steps per revolution
endstop_pin: PD9 # Endstop pin
#endstop_pin: tmc5160_stepper_x:virtual_endstop
### Add ! to reverse state if needed for safety
position_min: 0 # Min soft limit
position_endstop: 300 # Max soft limit
position_max: 300 # Max mechanical limit
homing_speed: 50 # Homing speed
homing_retract_dist: 5 # Retract distance after first trigger
#--------------------------------------------------------------------
## Ensure correct driver model
[tmc2209 stepper_x]
uart_pin: PC9 # UART pin
interpolate: False # 256 microstep interpolation
run_current: 0.8 # Motor current
sense_resistor: 0.110 # Do not change
stealthchop_threshold: 0 # StealthChop threshold
#--------------------------------------------------------------------
#[tmc5160 stepper_x]
#cs_pin: PC9
#spi_bus: spi1a
#run_current: 1.0
#interpolate: False
#sense_resistor: 0.075
#stealthchop_threshold: 0
#####################################################################
# Y Stepper Motor #
#####################################################################
## DRIVER1 motor position
[stepper_y]
step_pin: PE4
dir_pin: PC11
enable_pin: !PC12
rotation_distance: 40
microsteps: 16
full_steps_per_rotation: 200
endstop_pin: !PD8 # Endstop pin
#endstop_pin: tmc5160_stepper_y:virtual_endstop
position_min: 0
position_endstop: 300
position_max: 300
homing_speed: 50
homing_retract_dist: 5
#--------------------------------------------------------------------
## Ensure correct driver model
[tmc2209 stepper_y]
uart_pin: PC10
interpolate: False
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0
#--------------------------------------------------------------------
#[tmc5160 stepper_y]
#cs_pin: PC10
#spi_bus: spi1a
#run_current: 1.0
#interpolate: False
#sense_resistor: 0.075
#stealthchop_threshold: 0
#####################################################################
# Z Stepper Motors #
#####################################################################
## DRIVER2 motor position
[stepper_z]
step_pin: PE3
dir_pin: !PD1
enable_pin: !PD2
rotation_distance: 40
gear_ratio: 80:16
microsteps: 32
endstop_pin: !PD11
position_max: 290
position_endstop: -0.5
position_min: -5
homing_speed: 10
second_homing_speed: 3
homing_retract_dist: 3
#--------------------------------------------------------------------
[tmc2209 stepper_z]
uart_pin: PD0
interpolate: false
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0
##--------------------------------------------------------------------
## DRIVER4 motor position
[stepper_z1]
step_pin: PE2
dir_pin: PD4
enable_pin: !PD5
rotation_distance: 40
gear_ratio: 80:16
microsteps: 32
[tmc2209 stepper_z1]
uart_pin: PD3
interpolate: false
run_current: 1.0
sense_resistor: 0.110
stealthchop_threshold: 0
#--------------------------------------------------------------------
## DRIVER5 motor position
[stepper_z2]
step_pin: PE1
dir_pin: !PD7
enable_pin: !PB6
rotation_distance: 40
gear_ratio: 80:16
microsteps: 32
[tmc2209 stepper_z2]
uart_pin: PD6
interpolate: false
run_current: 1.0
sense_resistor: 0.110
stealthchop_threshold: 0
##--------------------------------------------------------------------
## DRIVER6 motor position
[stepper_z3]
step_pin: PE0
dir_pin: PC13
enable_pin: !PC14
rotation_distance: 40
gear_ratio: 80:16
microsteps: 32
[tmc2209 stepper_z3]
uart_pin: PB7
interpolate: False
run_current: 1.0
sense_resistor: 0.110
stealthchop_threshold: 0
#####################################################################
# Extruder Configuration
#####################################################################
## DRIVER7 motor position
[extruder]
step_pin:PE8
dir_pin:PE12
enable_pin: !PE11
microsteps: 16
full_steps_per_rotation: 200
rotation_distance: 22.52245
# Calibrate: rotation_distance = <old_rotation_distance> * <actual_extrude_length> / <requested_extrude_length>
gear_ratio: 50:10
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD12
sensor_type: Generic 3950
sensor_pin: PC5
max_power: 1.0
min_temp: -235
max_temp: 350
min_extrude_temp: 150
pressure_advance: 0.04
pressure_advance_smooth_time:0.040
# PID tune: "PID_CALIBRATE HEATER=extruder TARGET=245"
control = pid
pid_kp = 26.213
pid_ki = 1.304
pid_kd = 131.721
[tmc2209 extruder]
uart_pin:PC15
interpolate: False
run_current: 0.6
sense_resistor: 0.110
stealthchop_threshold: 0
#####################################################################
# Heated Bed Configuration
#####################################################################
[heater_bed]
heater_pin: PB1
sensor_type: Generic 3950
sensor_pin: PB0
max_power: 1.0
min_temp: -235
max_temp: 120
# PID tune: "PID_CALIBRATE HEATER=heater_bed TARGET=100"
control: pid
pid_kp: 58.437
pid_ki: 2.347
pid_kd: 363.769
#####################################################################
# Fan Configuration
#####################################################################
[fan] # Model cooling fan
pin:PA1
kick_start_time: 1.0
off_below: 0.10
hardware_pwm: true
max_power: 1.0
#--------------------------------------------------------------------
[heater_fan Throat_Cooling] # Throat cooling fan
pin:PA2
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50
fan_speed: 1.0
#--------------------------------------------------------------------
[heater_fan Bed_Fan] # Electronics bay fan
pin: PA3
max_power: 1.0
shutdown_speed: 0.0
kick_start_time: 5.0
heater: heater_bed
heater_temp: 50
fan_speed: 1.0
#---------------------------------------------------------------
[fan_generic Bed_Fan1]
pin:PC6
max_power: 1.0
# #--------------------------------------------------------------------
[fan_generic Side_Fan]
pin:PC7
max_power: 1.0
# #--------------------------------------------------------------------
[fan_generic Side_Fan1]
pin:PC8
max_power: 1.0
#####################################################################
# Idle Timeout for Heated Bed #
#####################################################################
[idle_timeout]
timeout: 1800 # Turn off heated bed after 30 minutes idle
#####################################################################
# Bed Leveling Probe #
#####################################################################
# Default PL08N probe should not be lower than nozzle, only for leveling.
# If your PL08N is NO , add ! to the pin.
[probe]
pin: ^PC0 # Endstop pin
x_offset: 0
y_offset: 25.0
z_offset: 0
speed: 10.0
samples: 3
samples_result: median
sample_retract_dist: 4.0
samples_tolerance: 0.007
samples_tolerance_retries: 3
#--------------------------------------------------------------------
#[bltouch]
#sensor_pin: ^PC0
#control_pin: PE6
#x_offset: 0
#y_offset: 25.0
#z_offset: 0
#####################################################################
# Homing #
#####################################################################
[safe_z_home]
home_xy_position:206,300
speed:100
z_hop:10
#--------------------------------------------------------------------
#[homing_override]
#axes: z
#set_position_z: 0
#gcode:
# G90
# G0 Z15 F600
# G28 X Y
# ## Update X0 and Y0 to your values
# ## Z endstop position
# G0 X185 Y250 F3600 #250mm
# G28 Z
# G0 Z10 F1800
#####################################################################
# 4Z Leveling
#####################################################################
[quad_gantry_level] # 300mm machine leveling parameters
#gantry_corners:
# -60,-10
# 310,320
#points: # 250mm machine leveling points
# 50,25
# 50,175
# 200,175
# 200,25
#--------------------------------------------------------------------
gantry_corners:
-60,-10
360,370
points:
50,25
50,225
250,225
250,25
#--------------------------------------------------------------------
#gantry_corners: # 350mm machine leveling points
# -60,-10
# 410,420
#points:
# 50,25
# 50,275
# 300,275
# 300,25
#--------------------------------------------------------------------
speed: 100
horizontal_move_z: 10
retry_tolerance: 0.0075
retries: 5
max_adjust: 10
#####################################################################
# LED Configuration
#####################################################################
[neopixel sb_leds]
pin: PD15
chain_count: 3
color_order: GRBW
initial_RED: 0.4
initial_GREEN: 0.8
initial_BLUE: 1
initial_WHITE: 0.0
#--------------------------------------------------------------------
[board_pins]
aliases:
EXP1_1=PB11, EXP1_3=PA14, EXP1_5=PB10, EXP1_7=PE14, EXP1_9=<GND>,
EXP1_2=PE7, EXP1_4=PA13, EXP1_6=PE15, EXP1_8=PA0 , EXP1_10=<5V>,
# EXP2 header
EXP2_1=PB14, EXP2_3=PA9, EXP2_5=PA10, EXP2_7=PE13, EXP2_9=<GND>,
EXP2_2=PB13, EXP2_4=PB12, EXP2_6=PB15, EXP2_8=<RST>, EXP2_10=<NC>,
#--------------------------------------------------------------------
[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
# --------------------------------------------------------------------
#### For FLY Mini12864
[neopixel fly_mini12864]
pin: EXP1_6
chain_count: 3
initial_RED: 0.5
initial_GREEN: 0.5
initial_BLUE: 0.5
color_order: RGB
#####################################################################
# Custom gcode Macros
#####################################################################
[gcode_macro PRINT_START]
gcode:
G92 E0 # Reset extruder
BED_MESH_CLEAR # Unload bed mesh
G28 # Home all axes
clean_nozzle # Clean nozzle
QUAD_GANTRY_LEVEL # Gantry leveling
G28 # Home all axes
G1 Z20 F3000 # Move nozzle away from bed
clean_nozzle
# BED_MESH_CALIBRATE PRINT_MIN={params.PRINT_MIN} PRINT_MAX={params.PRINT_MAX} FORCE_NEW_MESH=True
BED_MESH_PROFILE LOAD=default # Load bed mesh
#--------------------------------------------------------------------
[gcode_macro PRINT_huaxian]
gcode:
G1 Z5 F3000
G92 E0 # Reset extruder
G90 # Absolute positioning
G0 X5 Y1 F6000 # Move to x5 y1 at 100mm/s
G0 Z0.4
G91 # Relative positioning
G1 X100 E20 F1200 # Move x 100mm and extrude
G1 Y1
G1 X-100 E20 F1200 # Move x -100mm and extrude
G0 z5
G92 E0 # Reset extruder
G90 # Absolute positioning
#--------------------------------------------------------------------
[gcode_macro PRINT_END]
gcode:
M400 # Wait for buffer to clear
G92 E0 # Reset extruder
G1 E-10.0 F3600 # Retract filament
G91 # Relative positioning
G0 Z1.00 X20.0 Y20.0 F6000 # Move nozzle to remove stringing
TURN_OFF_HEATERS # Turn off heaters
M107 # Turn off fan
G1 Z2 F3000 # Move nozzle up 2mm
G90 # Absolute positioning
G0 X150 Y280 F3600 # Move nozzle to rear
BED_MESH_CLEAR # Unload bed mesh