💾 Archived View for windle.io › dls › printer_tronxy_x5sa_pro_klipper.cfg captured on 2022-06-11 at 23:06:34. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-03)

-=-=-=-=-=-=-

This is a Klipper configuration for TronXY X5SA Pro CoreXY Printer (2020)

330x330x400 size with CXY-V6 motherboard, Tronxy blue self-levelling plate sensor

and stock Titan Extruder Clone.

CAUTION: The Touchscreen cannot be used with Klipper!!! #

You will lose all the display functionalities!!! #

=== FLASHING WITH STOCK BOOTLOADER ===

You should make firmware for STM32F103 with bootloader offset

at 0x8008800 (Chitu v6 Bootloader) and serial (on USART1 PA10/PA9)

communication.

Use "./scripts/update_chitu.py ./out/klipper.bin ./out/update.cbd"

after make to generate update.cbd. Put "update.cbd" file onto SD card,

and reboot the printer.

It will be automatically installed after you hear 2 beeps,

and you will be able to update it this way.

See docs/Config_Reference.md for a description of parameters.

Raspberry Pi Temp

[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

Help for calculation: https://www.klipper3d.org/Rotation_Distance.html#obtaining-rotation_distance-from-steps_per_mm-or-step_distance

rotation_distance: 3.9072 #3.71184 #3.9072 #35.520 # This calulates the extrution rate

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_speed: 0.5

[fan]

pin: PG13

max_power: 0.5

[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 Macros:

These macros intercept gcode and replace them with the macro defined.

GCode WIKI: https://reprap.org/wiki/G-code

================================================================================

================================================================================

GCode Macro: START_PRINT

Add START_PRINT in your slicers starting script.

================================================================================

[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

Add END_PRINT in your slicers ending script

================================================================================

[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

Filament Change

M600: Filament Change. This macro will pause the printer, move the

tool to the change position, and retract the filament 50mm. Adjust

the retraction settings for your own extruder. After filament has

been changed, the print can be resumed from its previous position

with the "RESUME" gcode.

[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

https://www.reddit.com/r/klippers/comments/oeb87e/can_klipper_macros_implement_mechanical_gantry/h47wvmp?utm_source=share&utm_medium=web2x&context=3

[force_move]

enable_force_move: true ; enable FORCE_MOVE and SET_KINEMATIC_POSITION

[gcode_macro PAUSE]

description: Pause the actual running print

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]

description: Resume the actual running print

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]

description: Cancel the actual running print

rename_existing: CANCEL_PRINT_BASE

gcode:

TURN_OFF_HEATERS

CANCEL_PRINT_BASE

*# <---------------------- SAVE_CONFIG ---------------------->

*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.

*#

*# [bed_mesh DEFAULT]

*# version = 1

*# points =

*# -0.837500, -1.141250, -1.165000, 2.737500, -0.715000

*# 0.116250, -0.226250, -0.352500, -0.296250, -0.052500

*# 0.413750, 0.070000, -0.057500, 0.001250, 0.287500

*# 0.187500, -0.115000, -0.186250, -0.096250, 0.222500

*# -0.403750, -0.631250, -0.613750, -0.481250, -0.137500

*# tension = 0.2

*# min_x = 20.0

*# algo = lagrange

*# y_count = 5

*# mesh_y_pps = 0

*# min_y = 20.0

*# x_count = 5

*# max_y = 310.0

*# mesh_x_pps = 0

*# max_x = 310.0

*#

*# [bed_mesh default]

*# version = 1

*# points =

*# -0.976250, -0.690000, -0.578750, -0.575000, -0.603750

*# -0.273750, -0.177500, -0.121250, -0.167500, -0.247500

*# -0.016250, -0.033750, -0.007500, -0.020000, 0.003750

*# -0.191250, -0.275000, -0.257500, -0.192500, -0.023750

*# -0.741250, -0.857500, -0.786250, -0.636250, -0.388750

*# tension = 0.2

*# min_x = 20.0

*# algo = lagrange

*# y_count = 5

*# mesh_y_pps = 0

*# min_y = 20.0

*# x_count = 5

*# max_y = 310.0

*# mesh_x_pps = 0

*# max_x = 310.0