####################################################################################
# 3D MELLOW /FLY-D8 #
####################################################################################
## FLY-D8 Documentation: https://mellow-next.klipper.cn/docs/ProductDoc/MainBoard/fly-d/fly-d8-f407/
## 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 service, 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 position [homing_override]
## Z endstop offset [stepper_z]
## PID tuning [extruder] and [heater_bed]
## Fine-tune extruder motor steps [extruder]
#####################################################################
# File Includes #
#####################################################################
#[include fluidd.cfg] # FLUIDD include file.
#[include mainsail.cfg] # MAINSDIL include file.
#Choose the file you need to use
#####################################################################
# Mainboard Configuration #
#####################################################################
[mcu] # FLY board ID
serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_XXXXXXXXXXXXXXXXXXXXX
### To 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
### To 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 to 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 # Min calibration point x, y
mesh_max: 270, 270 # Max calibration point x, y
probe_count: 4,4 # Sample points
mesh_pps: 2,2 # Additional sample 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, add ! to reverse
enable_pin: !PA15 # X enable pin, add ! or motor won't work
rotation_distance: 40 # Pulley circumference mm
microsteps: 16 # Microsteps, higher = better quality, more load
full_steps_per_rotation: 200 # Steps per revolution
endstop_pin: PD9 # Endstop pin, normally closed recommended
#endstop_pin: tmc5160_stepper_x:virtual_endstop
### Add ! to reverse state if needed, prevents crashes if wire breaks
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 run current
sense_resistor: 0.110 # Do not change
stealthchop_threshold: 0 # StealthChop threshold
#--------------------------------------------------------------------
#[tmc5160 stepper_x]
#cs_pin: PC9 # SPI CS pin
#spi_bus: spi3 # SPI bus
#run_current: 1.0 # Motor run current
#interpolate: False # 256 microstep interpolation
#sense_resistor: 0.075 # Do not change
#stealthchop_threshold: 0 # StealthChop threshold
#####################################################################
# Y Stepper Motor #
#####################################################################
## DRIVER1 motor position
[stepper_y]
step_pin: PE4
dir_pin: PC11
enable_pin: !PC12
rotation_distance: 40
microsteps: 16 # Microsteps, higher = better quality, more load
full_steps_per_rotation: 200 # Steps per revolution
endstop_pin: !PD8 # Endstop pin, normally closed + ! to reverse
#endstop_pin: tmc5160_stepper_y:virtual_endstop
### Add ! to reverse state if needed, prevents crashes if wire breaks
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 # 256 microstep interpolation
run_current: 0.8 # Motor run current
sense_resistor: 0.110 # Do not change
stealthchop_threshold: 0 # StealthChop threshold
#--------------------------------------------------------------------
#[tmc5160 stepper_y]
#cs_pin: PC10
#spi_bus: spi3 # SPI bus
#run_current: 1.0 # Motor run current
#interpolate: False # 256 microstep interpolation
#sense_resistor: 0.075 # Do not change
#stealthchop_threshold: 0 # StealthChop threshold
#####################################################################
# Z Stepper Motors #
#####################################################################
## DRIVER2 motor position
[stepper_z]
step_pin: PE3
dir_pin: !PD1
enable_pin: !PD2
rotation_distance: 40 # Pulley circumference mm
gear_ratio: 80:16 # Gear ratio
microsteps: 32
endstop_pin: !PD11 # Endstop pin
position_max: 290 # Max soft limit
position_endstop: -0.5
position_min: -5 # Min soft limit
homing_speed: 10 # Homing speed
second_homing_speed: 3 # Second homing speed
homing_retract_dist: 3 # Retract distance
#--------------------------------------------------------------------
[tmc2209 stepper_z]
uart_pin: PD0
interpolate: false
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0 # StealthChop threshold
##--------------------------------------------------------------------
## 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] # Extruder
step_pin:PE7
dir_pin:PE11
enable_pin: !PE10
microsteps: 16
full_steps_per_rotation: 200 # Steps per revolution
rotation_distance: 22.52245 # Pulley circumference mm
# Calibrate steps: rotation_distance = <old_rotation_distance> * <actual_extrude_length> / <requested_extrude_length>
gear_ratio: 50:10 # Gear ratio
nozzle_diameter: 0.400 # Nozzle diameter
filament_diameter: 1.750 # Filament diameter
heater_pin: PD12 # Heater pin
sensor_type: Generic 3950 # Sensor type
sensor_pin: PC4 # Sensor pin
max_power: 1.0 # Max heater PWM output
min_temp: -235 # Min extruder temp
max_temp: 350 # Max extruder temp
min_extrude_temp: 150 # Min extrude temp
pressure_advance: 0.04 # Pressure advance
pressure_advance_smooth_time:0.040 # Smooth time
# Nozzle 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 # StealthChop threshold
#####################################################################
# Heated Bed Configuration
#####################################################################
[heater_bed]
heater_pin: PB0 # Bed heater pin
sensor_type: Generic 3950 # Bed sensor type
sensor_pin: PC5 # Bed sensor pin
max_power: 1.0 # Bed power
min_temp: -235 # Min bed temp
max_temp: 120 # Max bed temp
# Bed 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:PA0
kick_start_time: 1.0 # Startup time
off_below: 0.10 # Do not change
hardware_pwm: true
max_power: 1.0
#--------------------------------------------------------------------
[heater_fan Throat Cooling] # Throat cooling fan
pin:PA1
max_power: 1.0
kick_start_time: 0.5 # Startup time
heater: extruder # Linked device: extruder
heater_temp: 50 # Fan turns on at this temp
fan_speed: 1.0
#--------------------------------------------------------------------
[heater_fan Bed Fan] # Electronics bay fan
pin: PA2
max_power: 1.0
shutdown_speed: 0.0
kick_start_time: 5.0
heater: heater_bed # Linked device: bed
heater_temp: 50 # Fan turns on at this temp
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 #
#####################################################################
[idle_timeout]
timeout: 1800 # Turn off 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 pin.
[probe]
pin: ^PC0 # Endstop pin, normally closed + ! to reverse, io-2
x_offset: 0 # X offset from nozzle
y_offset: 25.0 # Y offset from nozzle
z_offset: 0 # Z offset from nozzle
speed: 10.0 # Probing speed
samples: 3 # Number of samples
samples_result: median
sample_retract_dist: 4.0 # Probe retract distance
samples_tolerance: 0.007 # Sample tolerance
samples_tolerance_retries: 3 # Retries if out of tolerance
#--------------------------------------------------------------------
#[bltouch]
#sensor_pin: ^PC0 # Signal pin
#control_pin: PE6 # Servo control
#x_offset: 0 # X offset from nozzle
#y_offset: 25.0 # Y offset from nozzle
#z_offset: 0 # Z offset from nozzle
#####################################################################
# Homing #
#####################################################################
[safe_z_home] # Z endstop coordinates
home_xy_position:206,300 # Z endstop position
speed:100 # Homing speed
z_hop:10 # Z lift before homing
#--------------------------------------------------------------------
#[homing_override]
#axes: z
#set_position_z: 0
#gcode:
# G90
# G0 Z15 F600
# G28 X Y
# ## Z endstop XY position
# ## 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 # Leveling speed
horizontal_move_z: 10 # Z start height
retry_tolerance: 0.0075 # Sample tolerance
retries: 5 # Retries if out of tolerance
max_adjust: 10 # Max adjustment travel
#####################################################################
# LED Configuration
#####################################################################
[neopixel sb_leds]
pin: PD15 # Signal pin
chain_count: 3 # Number of LEDs
color_order: GRBW
initial_RED: 0.4 # Red
initial_GREEN: 0.8 # Green
initial_BLUE: 1 # Blue
initial_WHITE: 0.0
#--------------------------------------------------------------------
[board_pins]
aliases:
EXP1_1=PB10, EXP1_3=PA14, EXP1_5=PE15, EXP1_7=PE13, EXP1_9=<GND>,
EXP1_2=PB1, EXP1_4=PA13, EXP1_6=PE14, EXP1_8=PB11, EXP1_10=<5V>,
# EXP2 header
EXP2_1=PB14, EXP2_3=PA9, EXP2_5=PA10, EXP2_7=PE12, EXP2_9=<GND>,
EXP2_2=PB13, EXP2_4=PB12, EXP2_6=PB15, EXP2_8=<RST>, EXP2_10=<NC>,
#--------------------------------------------------------------------
[display]
lcd_type: uc1701 # LCD driver type
cs_pin: EXP1_3 # LCD CS pin
a0_pin: EXP1_4 # LCD A0 pin
rst_pin: EXP1_5 # LCD reset pin
contrast: 63 # Contrast
encoder_pins: ^EXP2_5, ^!EXP2_3 # Encoder pins
click_pin: ^!EXP1_2 # Encoder button pin
# --------------------------------------------------------------------
#### For FLY Mini12864
[neopixel fly_mini12864]
pin: EXP1_6 # LCD backlight pin
chain_count: 3
initial_RED: 0.5 # Red LED brightness
initial_GREEN: 0.5 # Green LED brightness
initial_BLUE: 0.5 # Blue LED brightness
color_order: RGB
#####################################################################
# Custom gcode Macros
#####################################################################
[gcode_macro PRINT_START] # Macro for print start, customize pre-print actions
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 # Probe mesh by print area
BED_MESH_PROFILE LOAD=default # Load bed mesh
#--------------------------------------------------------------------
[gcode_macro PRINT_huaxian]
gcode:
G1 Z5 F3000
G92 E0
G90 # Absolute coordinates
G0 X5 Y1 F6000 # Move to x5 y1 at 100mm/s
G0 Z0.4 # Move Z to 0.4
G91 # Relative coordinates
G1 X100 E20 F1200
G1 Y1 # Move Y 1mm
G1 X-100 E20 F1200
G0 z5 # Raise Z 5mm
G92 E0
G90 # Absolute coordinates
#--------------------------------------------------------------------
[gcode_macro PRINT_END] # Macro for print end, customize post-print actions
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 # Raise nozzle 2mm
G90 # Absolute positioning
G0 X150 Y280 F3600 # Move nozzle to rear
BED_MESH_CLEAR # Unload bed mesh