####################################################################################
# 3D MELLOW / #
####################################################################################
## Fly-C8 Documentation URL: http://mellow.klipper.cn/#/board/fly_fly_C8/
## Fly-C8 Schematic URL: https://cdn.mellow.klipper.cn/SCH-PDF/FLY-C8.pdf
## 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 Discussion Group: 786561979
#####################################################################
# Notes #
#####################################################################
##***Items to modify/check:***
## MCU path [mcu]
## Printer movement range xyz position
## Thermistor type [extruder] and [heater_bed]
## Z-axis endstop stop position [safe_z_home]
## Z-axis endstop offset position [stepper_z]
## PID tuning [extruder] and [heater_bed]
## Fine-tune extruder motor step value [extruder]
#####################################################################
# File Inclusion #
#####################################################################
#[include fluidd.cfg] # Include FLUIDD configuration file.
#[include mainsail.cfg] # Include MAINSAIL configuration file.
# Determine which file to use as needed.
#####################################################################
# Mainboard Configuration #
#####################################################################
[mcu] # FLY mainboard ID
serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_XXXXXXXXXXXXXXXXXXXXX
### To query USB firmware ID: ls /dev/serial/by-id/
### Replace /dev/serial/by-id/usb-Klipper_stm32f407xx_XXXXXXXXXXXXXXXXXXXXX with the queried ID.
#canbus_uuid: e51d5c71a901
### To query CAN firmware ID: ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
### Replace serial with canbus_uuid: followed by the queried ID for CAN.
[mcu host] # FlyOS automatically generates Linux MCU, define to use.
serial: /tmp/klipper_host_mcu
#####################################################################
# Printer and Acceleration #
#####################################################################
[printer] # Printer settings
kinematics: corexy
max_velocity: 300 # Maximum printer speed
max_accel: 3000 # Maximum acceleration
max_z_velocity: 15 # Maximum Z-axis speed
max_z_accel: 100 # Maximum Z-axis acceleration
square_corner_velocity: 5.0 # Square corner velocity
#####################################################################
# Temperature Monitoring #
#####################################################################
[temperature_sensor Fly-C8] # FLY mainboard temperature
sensor_type: temperature_mcu MCU
#--------------------------------------------------------------------
[temperature_sensor FLY-π] # Host temperature
sensor_type: temperature_host
#--------------------------------------------------------------------
[temperature_sensor BOX] # Internal box temperature
sensor_type: ATC Semitec 104GT-2 # Sensor model
sensor_pin: PC3 # Signal pin
#####################################################################
# Bed Mesh Calibration #
#####################################################################
[bed_mesh]
speed: 50 # Calibration speed
horizontal_move_z: 5 # Z-axis lift height before moving to the next point
mesh_min: 30,30 # Minimum calibration point coordinates
mesh_max: 270, 270 # Maximum calibration point coordinates
probe_count: 4,4 # Sampling points
mesh_pps: 2,2 # Supplemental sampling points
algorithm: bicubic
bicubic_tension: 0.2 # Algorithm interpolation
#####################################################################
# ADXL345 Configuration #
#####################################################################
[adxl345]
cs_pin: host:None
spi_bus: spidev1.0
#--------------------------------------------------------------------
[resonance_tester]
accel_chip: adxl345 # Acceleration chip name
probe_points: 150, 150, 20 # Resonance test coordinates
min_freq: 5 # Minimum resonance test frequency
max_freq: 130 # Maximum resonance test frequency
accel_per_hz: 75 # Acceleration per Hz
hz_per_sec: 1 # Test speed
#####################################################################
# X/Y Stepper Motor Settings #
#####################################################################
# z1 z2
# B__________A
#
#
#
#
# Z0 12864 Z3
#####################################################################
# X-Axis Stepper Motor #
#####################################################################
## DRIVER0 motor position
[stepper_x]
step_pin: PE5 # X-axis motor pulse pin
dir_pin: PA8 # X-axis motor direction pin
enable_pin: !PA15 # X-axis motor enable pin
rotation_distance: 40 # Pulley circumference in mm
microsteps: 16 # Motor microstep setting
full_steps_per_rotation: 200 # Pulses per full rotation
endstop_pin: PD9 # Endstop pin
#endstop_pin: tmc5160_stepper_x:virtual_endstop
### Add "!" to reverse state if using normally closed, to prevent crashes in case of disconnection.
position_min: 0 # Minimum soft limit
position_endstop: 300 # Maximum soft limit
position_max: 300 # Maximum mechanical limit
homing_speed: 50 # Homing speed
homing_retract_dist: 5 # Retract distance after first endstop trigger
#--------------------------------------------------------------------
## Ensure correct driver model configuration
[tmc2209 stepper_x]
uart_pin: PC9 # Communication port pin
interpolate: False # Enable 256 microstep interpolation
run_current: 0.8 # Motor run current
sense_resistor: 0.110 # Do not modify the driver sense resistor
stealthchop_threshold: 0 # StealthChop threshold
#--------------------------------------------------------------------
#[tmc5160 stepper_x]
#cs_pin: PC9 # SPI chip select pin
#spi_bus: spi3 # SPI communication bus
#run_current: 1.0 # Motor run current
#interpolate: False # Enable 256 microstep interpolation
#sense_resistor: 0.075 # Do not modify the driver sense resistor
#stealthchop_threshold: 0 # StealthChop threshold
#####################################################################
# Y-Axis Stepper Motor #
#####################################################################
## DRIVER1 motor position
[stepper_y]
step_pin: PE4
dir_pin: PC11
enable_pin: !PC12
rotation_distance: 40
microsteps: 16 # Motor microstep setting
full_steps_per_rotation: 200 # Pulses per full rotation
endstop_pin: !PD8 # Endstop pin
#endstop_pin: tmc5160_stepper_y:virtual_endstop
### Add "!" to reverse state if using normally closed, to prevent crashes in case of disconnection.
position_min: 0
position_endstop: 300
position_max: 300
homing_speed: 50
homing_retract_dist: 5
#--------------------------------------------------------------------
## Ensure correct driver model configuration
[tmc2209 stepper_y]
uart_pin: PC10
interpolate: False # Enable 256 microstep interpolation
run_current: 0.8 # Motor run current
sense_resistor: 0.110 # Do not modify the driver sense resistor
stealthchop_threshold: 0 # StealthChop threshold
#--------------------------------------------------------------------
#[tmc5160 stepper_y]
#cs_pin: PC10
#spi_bus: spi3 # SPI communication bus
#run_current: 1.0 # Motor run current
#interpolate: False # Enable 256 microstep interpolation
#sense_resistor: 0.075 # Do not modify the driver sense resistor
#stealthchop_threshold: 0 # StealthChop threshold
#####################################################################
# Z-Axis Stepper Motor #
#####################################################################
## DRIVER2 motor position
[stepper_z]
step_pin: PE3
dir_pin: !PD1
enable_pin: !PD2
rotation_distance: 40 # Pulley circumference in mm
gear_ratio: 80:16 # Gear ratio
microsteps: 32
endstop_pin: PD11 # Endstop pin
position_max: 290 # Maximum soft limit
position_endstop: -0.5
position_min: -5 # Minimum 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 # Pulses per full rotation
rotation_distance: 22.52245 # Pulley circumference in mm
# Calibration formula: rotation_distance = <old_rotation_distance> * <actual_extruded_length> / <requested_extruded_length>
gear_ratio: 50:10 # Gear ratio
nozzle_diameter: 0.400 # Nozzle diameter
filament_diameter: 1.750 # Filament diameter
heater_pin: PD14 # Heater control pin
sensor_type: Generic 3950 # Sensor model
sensor_pin: PC2 # Sensor pin
max_power: 1.0 # Maximum heater power
min_temp: -235 # Minimum extruder temperature
max_temp: 350 # Maximum extruder temperature
min_extrude_temp: 150 # Minimum extrusion temperature
pressure_advance: 0.04 # Pressure advance parameter
pressure_advance_smooth_time:0.040 # Smoothing time
# PID calibration command: "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 # Heated bed interface
sensor_type: Generic 3950 # Heated bed sensor type
sensor_pin: PC5 # Heated bed sensor interface
max_power: 1.0 # Heated bed power
min_temp: -235 # Minimum heated bed temperature
max_temp: 120 # Maximum heated bed temperature
# Heated bed PID calibration command: "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 modify
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 # Associated device: extruder
heater_temp: 50 # Fan starts when extruder reaches this temperature
fan_speed: 1.0
#--------------------------------------------------------------------
[heater_fan Heated Bed Fan] # Electronics enclosure fan
pin: PA2
max_power: 1.0
shutdown_speed: 0.0
kick_start_time: 5.0
heater: heater_bed # Associated device: heated bed
heater_temp: 50 # Fan starts when heated bed reaches this temperature
fan_speed: 1.0
#---------------------------------------------------------------
[fan_generic Heated 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
#--------------------------------------------------------------------
[temperature_fan Core Fan] # Host cooling fan
pin: host:gpiochip1/gpio3 # Host fan pin
max_power: 1.0
sensor_type: temperature_host
control:watermark # Control method
target_temp: 48 # Fan starts at this temperature
min_temp: 0 # Minimum temperature, error if below this
max_temp: 90 # Maximum temperature, error if above this
off_below: 0.10
kick_start_time: 0.50
max_speed: 0.8 # Maximum speed, 80% of full power
min_speed: 0.3 # Minimum speed, 30% of full power
#####################################################################
# Idle Timeout for Heated Bed #
#####################################################################
[idle_timeout]
timeout: 1800 # Turn off heated bed after 30 minutes of inactivity
#####################################################################
# Leveling Sensor #
#####################################################################
# Default PL08N probe should not be lower than nozzle height, used only for leveling.
# If your PL08N is NO , add "!" to reverse the pin state.
[probe]
pin: ^PD10 # Limit switch pin, recommended to use normally closed and add "!" to reverse state. Located at io-2.
x_offset: 0 # X-axis offset of sensor relative to nozzle
y_offset: 25.0 # Y-axis offset of sensor relative to nozzle
z_offset: 0 # Z-axis offset of sensor relative to nozzle
speed: 10.0 # Leveling speed
samples: 3 # Number of samples
samples_result: median
sample_retract_dist: 4.0 # Retract distance during leveling
samples_tolerance: 0.007 # Sampling tolerance
samples_tolerance_retries: 3 # Retry attempts if tolerance is exceeded
#--------------------------------------------------------------------
#[bltouch]
#sensor_pin: ^PC0 # Signal interface
#control_pin: PE6 # Servo control
#x_offset: 0 # X-axis offset of sensor relative to nozzle
#y_offset: 25.0 # Y-axis offset of sensor relative to nozzle
#z_offset: 0 # Z-axis offset of sensor relative to nozzle
#####################################################################
# Homing #
#####################################################################
[safe_z_home] # Z-axis limit coordinates
home_xy_position:206,300 # Z-axis limit position definition
speed:100 # Homing speed
z_hop:10 # Z-axis lift height before homing
#--------------------------------------------------------------------
#[homing_override]
#axes: z
#set_position_z: 0
#gcode:
# G90
# G0 Z15 F600
# G28 X Y
# ## Update X0 and Y0 with your values
# ## Z-axis limit position definition
# 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 # Initial Z-axis height
retry_tolerance: 0.0075 # Sampling tolerance
retries: 5 # Retry attempts if tolerance is exceeded
max_adjust: 10 # Maximum adjustment range
#####################################################################
# LED Configuration
#####################################################################
[neopixel sb_leds]
pin: PD15 # Signal pin
chain_count: 3 # Number of LEDs
color_order: GRBW
initial_RED: 0.4 # Red brightness
initial_GREEN: 0.8 # Green brightness
initial_BLUE: 1 # Blue brightness
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 # Display driver type
cs_pin: EXP1_3 # Chip select pin for display
a0_pin: EXP1_4 # Data pin for display
rst_pin: EXP1_5 # Reset pin for display
contrast: 63 # Contrast level
encoder_pins: ^EXP2_5, ^!EXP2_3 # Rotary encoder pins
click_pin: ^!EXP1_2 # Rotary encoder click pin
# --------------------------------------------------------------------
#### For FLY Mini12864
[neopixel fly_mini12864]
pin: EXP1_6 # Backlight control pin for display
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 G-code Macros
#####################################################################
[gcode_macro PRINT_START] # Macro for actions before starting a print
gcode:
G92 E0 # Reset extruder
BED_MESH_CLEAR # Clear bed mesh
G28 # Home all axes
clean_nozzle # Clean nozzle
QUAD_GANTRY_LEVEL # Perform gantry leveling
G28 # Home all axes again
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 bed mesh based on print area
BED_MESH_PROFILE LOAD=default # Load bed mesh
#--------------------------------------------------------------------
[gcode_macro PRINT_huaxian]
gcode:
G1 Z5 F3000
G92 E0
G90 # Set absolute positioning
G0 X5 Y1 F6000 # Move to x5 y1 at 100mm/s
G0 Z0.4 # Move Z-axis to height 0.4
G91 # Set relative positioning
G1 X100 E20 F1200
G1 Y1 # Move Y-axis 1mm
G1 X-100 E20 F1200
G0 z5 # Raise Z-axis by 5mm
G92 E0
G90 # Set absolute positioning
#--------------------------------------------------------------------
[gcode_macro PRINT_END] # Macro for actions after finishing a print
gcode:
M400 # Wait for buffer to clear
G92 E0 # Reset extruder
G1 E-10.0 F3600 # Retract filament
G91 # Set 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 by 2mm
G90 # Set absolute positioning
G0 X150 Y280 F3600 # Move nozzle to rear
BED_MESH_CLEAR # Clear bed mesh