💾 Archived View for windle.io › dls › printer_tronxy_x5sa_pro_klipper.cfg captured on 2021-12-03 at 14:04:38. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[pause_resume]
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
[printer]
kinematics: corexy
max_velocity: 300
max_accel: 3000
max_z_velocity: 25
max_z_accel: 30
[stepper_x]
step_pin: PE5
dir_pin: !PE6
enable_pin: !PC13
microsteps: 32 #16
rotation_distance: 40#20
endstop_pin: !PG10
position_endstop: -1
position_min: -1
position_max: 350 # for bed mesh
homing_speed: 100
homing_retract_dist: 10
second_homing_speed: 10.0
[stepper_y]
step_pin: PE2
dir_pin: !PE3
enable_pin: !PE4
microsteps: 32 #16
rotation_distance: 40 #20
endstop_pin: !PA12
position_endstop: 0
position_max: 330
homing_retract_dist: 10
homing_speed: 100.0
second_homing_speed: 10.0
[stepper_z]
step_pin: PB9
dir_pin: PE0
enable_pin: !PE1
microsteps: 32 #16
rotation_distance: 8 #4
endstop_pin: probe:z_virtual_endstop
position_max: 480 #400
position_min: -2
[extruder]
step_pin: PB4
dir_pin: !PB5
enable_pin: !PB8
microsteps: 32 #16
rotation_distance: 22.478 # Titan Extruder Clone Rotation Distance
gear_ratio: 66:22 # Titan Extruder Clone Gear Ratio
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PG12
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA1
control: pid
pid_Kp: 18.831
pid_Ki: 0.821
pid_Kd: 108.044
min_temp: 0
max_temp: 260
max_extrude_only_distance: 300
pressure_advance_smooth_time: 0.040
[heater_bed]
heater_pin: PG11
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA0
control: pid
min_temp: 0
max_temp: 130
pid_Kp: 73.932
pid_Ki: 1.521
pid_Kd: 898.279
[heater_fan hotend_fan]
pin: PG14
[fan]
pin: PG13
[controller_fan drivers_fan]
pin: PD6
[filament_switch_sensor sentinel]
pause_on_runout: True
runout_gcode:
M25
switch_pin: !PA15 # This needs inverting
[output_pin beeper]
pin: PB0
[safe_z_home]
home_xy_position: 165,165 # First looks to be X then Y
speed: 100
z_hop: 10
z_hop_speed: 5 #10
[bed_screws]
screw1: 5,5
screw2: 165,5
screw3: 325,5
screw4: 5,325
screw5: 165,325
screw6: 325,325
[bed_mesh]
speed: 120
probe_count: 5,5
horizontal_move_z: 5
algorithm: lagrange
mesh_min : 20,20
mesh_max : 310,310
mesh_pps: 0
[probe]
x_offset: -35 #-40
y_offset: 0
pin: !PG9
speed: 30
z_offset: 1 #2
[gcode_macro UNLOAD_FILAMENT]
gcode:
M83
G1 E10 F300
G1 E-300 F1800
M82
[gcode_macro LOAD_FILAMENT]
gcode:
M83
G1 E300 F1800
G1 E30 F300
G1 E15 F150
M82
[gcode_macro START_PRINT]
gcode:
G28 ; Home all axes
BED_MESH_CALIBRATE
SET_GCODE_OFFSET Z=-1.15
G92 E0; Reset Extruder
G1 Z5.0 F3000; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0; Move to start position
G1 X0.1 Y325.0 Z0.3 F1500.0 E15; Draw the first line
G1 X0.4 Y325.0 Z0.3 F5000.0; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30; Draw the second line
G92 E0; Reset Extruder
G1 Z5.0 F3000; Move Z Axis up little to prevent scratching of Heat Bed
[gcode_macro END_PRINT]
gcode:
#G1 Y190 F1500; bring Y up front
G10 ; set tool offset? or retract?
G91; Relative Positioning
G1 Z+10; Move Z up so it doesn't hit anything
G1 E-2 F3000
G1 E-2 Z0.2 F1200
G1 X5 Y5 F3600
G1 Z10
#G1 E-10 F300; Retrack-10
G90; Absolute Positioning
G1 X0 Y0
M84 X Y E
#G1 X10 Y220 F2000; Move to X10, Y220
M104 S0; Turn off Extrude (set it to 0)
M140 S0; Turn off Bed (set it to 0)
M106 S0; turn off cooling fan
M84; Disable steppers
[pause_resume]
[gcode_macro M600]
gcode:
{% set X = params.X|default(50)|float %}
{% set Y = params.Y|default(0)|float %}
{% set Z = params.Z|default(10)|float %}
SAVE_GCODE_STATE NAME=M600_state
PAUSE
G91
G1 E-.8 F2700
G1 Z{Z}
G90
G1 X{X} Y{Y} F3000
G91
G1 E-50 F1000
RESTORE_GCODE_STATE NAME=M600_state
[gcode_macro Z_Align]
gcode:
; Home with Z adjust and Z alignment
; first Home
{% set x_max = printer.toolhead.axis_maximum.x %}
{% set y_max = printer.toolhead.axis_maximum.y %}
{% set z_max = printer.toolhead.axis_maximum.z %}
G28
G0 Z10
; move up just to be safe
G91
G0 F480 Z20
G90
; move to a place where the nozzle safely move below the bed
G0 F3000 X1 Y1
; Z calibration step
G4 P200 ;
FORCE_MOVE STEPPER=stepper_z DISTANCE=-10 VELOCITY=6
G0 F480 Z-1.0
G0 Z20
;G0 X0 Y0
G28
; End of Calibrated Home
[force_move]
enable_force_move: true ; enable FORCE_MOVE and SET_KINEMATIC_POSITION
[gcode_macro PAUSE]
rename_existing: PAUSE_BASE
gcode:
##### set defaults #####
{% set x = params.X|default(230) %} #edit to your park position
{% set y = params.Y|default(230) %} #edit to your park position
{% set z = params.Z|default(10)|float %} #edit to your park position
{% set e = params.E|default(1) %} #edit to your retract length
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set lift_z = z|abs %}
{% if act_z < (max_z - lift_z) %}
{% set z_safe = lift_z %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe}
G90
G1 X{x} Y{y} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
rename_existing: RESUME_BASE
gcode:
##### set defaults #####
{% set e = params.E|default(1) %} #edit to your retract length
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro CANCEL_PRINT]
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE