[include fly_macros.cfg]
########################################
# Motherboard model
# Please modify it based on your motherboard model
# 请根据您的主板型号修改
########################################
#[include boards/FLY_GEMINI_V1.cfg]
#[include boards/FLY_GEMINI_V1.1.cfg]
[include boards/FLY_GEMINI_V3.cfg]
[include V0Display.cfg]
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f405xx_JKYZ-if00
[mcu host]
serial: /tmp/klipper_host_mcu
[virtual_sdcard]
path: ~/gcode_files
[printer]
kinematics: corexy
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
########################################
# Temp
########################################
[temperature_sensor FLY-Gemini]
sensor_type: temperature_host
[temperature_fan mcu_fan] #Electrical bin cooling fan
pin: FAN1
kick_start_time: 0.500
sensor_type: temperature_mcu
control: watermark
target_temp: 45.0
min_temp: 0
max_temp: 90
max_speed: 1.0
min_speed: 0.8
########################################
# Drives
########################################
[stepper_x]
## Refer to https://docs.vorondesign.com/build/startup/#v0
step_pin: X_STEP
dir_pin: !X_DIR
enable_pin: !X_EN
rotation_distance: 40
microsteps: 32
full_steps_per_rotation: 200 # Set to 400 for 0.9° degree stepper motor, 200 is for 1.8° stepper motors
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: 120
position_max: 120
homing_speed: 10 # Can be increased after initial setup, Max 100
homing_retract_dist: 0
homing_positive_dir: true
step_pulse_duration: 0.000004
[stepper_y]
## Refer to https://docs.vorondesign.com/build/startup/#v0
step_pin: Y_STEP
dir_pin: !Y_DIR # Check motor direction in link above. If inverted, add a ! before PC4
enable_pin: !Y_EN
rotation_distance: 40
microsteps: 32
full_steps_per_rotation: 200 # Set to 400 for 0.9° degree stepper motor, 200 is for 1.8° stepper motors
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: 120
position_max: 120
homing_speed: 10 # Can be increased after initial setup, Max 100
homing_retract_dist: 0
homing_positive_dir: true
[stepper_z]
## Refer to https://docs.vorondesign.com/build/startup/#v0
step_pin: PC15
dir_pin: !PC5 # Check motor direction in link above. If inverted, remove a ! before PC4
enable_pin: !PC12
rotation_distance: 8 # For T8x8 integrated lead screw
microsteps: 32
endstop_pin: Z_STOP
position_endstop: 117.5
position_max: 117.5
position_min: -1.5
homing_speed: 120
second_homing_speed: 3.0
homing_retract_dist: 3.0
[extruder]
step_pin: E_STEP
dir_pin: !E_DIR
enable_pin: !E_EN
microsteps: 16
rotation_distance: 23
gear_ratio: 50:10
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: HEAT
sensor_pin: HEAT_TEMP
sensor_type: ATC Semitec 104GT-2
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 350
min_extrude_temp: 10
step_pulse_duration: 0.000004
########################################
# BED
########################################
[heater_bed]
heater_pin: BED_OUT
sensor_pin: BED_TEMP
sensor_type: ATC Semitec 104GT-2
control: watermark
min_temp: 0
max_temp: 110
max_power: 1.0
########################################
# FANs
########################################
[fan]
pin: FAN0
#cycle_time: 0.50
########################################
# TMC2208 configuration./2209/2225
########################################
[tmc2209 stepper_x]
uart_pin: X_CS
interpolate: False
run_current: 1.1
sense_resistor: 0.110
stealthchop_threshold: 200 # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle
diag_pin: PA4 # YOU NEED TO JUMP THIS DIAG PIN ON YOUR BOARD FOR SENSORLESS HOMING TO WORK
driver_SGTHRS: 25 # 255 is most sensitive value, 0 is least sensitive
[tmc2209 stepper_y]
uart_pin: Y_CS
interpolate: False
run_current: 1.1
sense_resistor: 0.110
stealthchop_threshold: 200 # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle
diag_pin: PA5 # YOU NEED TO JUMP THIS DIAG PIN ON YOUR BOARD FOR SENSORLESS HOMING TO WORK
driver_SGTHRS: 25 # 255 is most sensitive value, 0 is least sensitive
[tmc2209 stepper_z]
uart_pin: Z_CS
run_current: 0.5500
interpolate: False
[tmc2209 extruder]
uart_pin: E_CS
run_current: 0.5500
interpolate: False
[gcode_macro SENSORLESS_HOME_X]
gcode:
{% set HOME_CUR = 0.700 %}
{% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %}
{% set RUN_CUR = driver_config.run_current %}
# Set current for sensorless homing
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
# Pause to ensure driver stall flag is clear
G4 P2000
# Home
G28 X0
# Move away
G90
G1 X5 F1200
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
#打印开始
[gcode_macro PRINT_START]
# Use PRINT_START for the slicer starting script - please customize for your slicer of choice
description: 开始打印
gcode:
G90
M107
M82
G28
G1 Z20 F3000
G92 E0
G1 X110 Y0.5 F2000
G1 Z0.28 F400
G1 X30 Y0.5 E18 F1000
G1 Z0.5 F200
G92 E0
#打印结束
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customize for your slicer of choice
gcode:
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-4.0 F3600 ; retract filament
G91 ; relative positioning
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
# Check end position to determine safe direction to move
{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.z < (max_z - 2) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}
G0 Z{z_safe} F3600 ; move nozzle up
G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing
TURN_OFF_HEATERS
M107 ; turn off fan
G90 ; absolute positioning
G0 X60 Y{max_y} F3600 ; park nozzle at rear
SET_SKEW CLEAR=1
[safe_z_home]
home_xy_position: 60,115
speed: 120