Skip to content

Instantly share code, notes, and snippets.

@justheath
Created April 22, 2023 15:57
Show Gist options
  • Save justheath/197f4fa803a5aa7ad7601457d86bb034 to your computer and use it in GitHub Desktop.
Save justheath/197f4fa803a5aa7ad7601457d86bb034 to your computer and use it in GitHub Desktop.
Tronxy X5SA, stock except replaced Extruder with original TH3D Tough Extruder
# these are needed by mainsail macros
[gcode_macro _CLIENT_VARIABLE]
variable_use_custom_pos : False ; use custom park coordinates for x,y [True/False]
variable_custom_park_x : 0.0 ; custom x position; value must be within your defined min and max of X
variable_custom_park_y : 0.0 ; custom y position; value must be within your defined min and max of Y
variable_custom_park_dz : 2.0 ; custom dz value; the value in mm to lift the nozzle when move to park position
variable_retract : 1.0 ; the value to retract while PAUSE
variable_cancel_retract : 5.0 ; the value to retract while CANCEL_PRINT
variable_speed_retract : 35.0 ; retract speed in mm/s
variable_unretract : 1.0 ; the value to unretract while RESUME
variable_speed_unretract : 35.0 ; unretract speed in mm/s
variable_speed_hop : 15.0 ; z move speed in mm/s
variable_speed_move : 100.0 ; move speed in mm/s
variable_park_at_cancel : False ; allow to move the toolhead to park while execute CANCEL_PRINT [True,False]
## !!! Caution [firmware_retraction] must be defined in the printer.cfg if you set use_fw_retract: True !!!
variable_use_fw_retract : False ; use fw_retraction instead of the manual version [True/False]
gcode:
# --------------------------------------------------------------------
[include mainsail.cfg]
[include macros.cfg]
[mcu]
# plugged into USB HUB
serial: /dev/serial/by-path/pci-0000:00:14.0-usb-0:2.1:1.0-port0
restart_method: command
# having issues with mcu disconnects, must choose the same when build the bin file
baud:115000
[printer]
kinematics: corexy
max_velocity: 300
max_accel: 4500
max_z_velocity: 25
max_z_accel: 30
#testing to see if I had access to swd pins as GPIO, it does
#[output_pin testpin1]
#pin: PA14
#[output_pin testpin2]
#pin: PA13
[stepper_x]
step_pin: PE5
dir_pin: !PF1
enable_pin: !PF0
microsteps: 32
rotation_distance: 40
endstop_pin: !PC15
position_endstop: 0
position_min: -1
position_max: 335 # for bed mesh
homing_speed: 50
homing_retract_dist: 10
second_homing_speed: 10.0
[stepper_y]
step_pin: PF9
dir_pin: !PF3
enable_pin: !PF5
microsteps: 32
rotation_distance: 40
endstop_pin: !PC14
position_endstop: 0
position_min: -1
position_max: 330
homing_retract_dist: 10
homing_speed: 50.0
second_homing_speed: 10.0
[stepper_z]
step_pin: PA6
dir_pin: PF15
enable_pin: !PA5
microsteps: 32
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_max: 400
position_min: -4
[extruder]
step_pin: PB1
dir_pin: !PF13
enable_pin: !PF14
microsteps: 32
rotation_distance: 22.241
gear_ratio: 3:1 # Titan Clone
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PG7
sensor_type: Generic 3950
sensor_pin: PC3
#control: pid
#pid_Kp: 20.72
#pid_Ki: 1.88
#pid_Kd: 57.18
min_temp: 0
max_temp: 300
max_extrude_only_distance: 350
min_extrude_temp: 0 # dangerous, but bowden loading is much easier without it
[heater_bed]
heater_pin: PE2
sensor_type: Generic 3950
sensor_pin: PC2
min_temp: 0
max_temp: 130
#control: pid
#pid_Kp: 73.932
#pid_Ki: 1.521
#pid_Kd: 898.279
[heater_fan hotend_fan]
heater: extruder
heater_temp: 50.0
pin: PG9
[fan]
pin: PG0
[controller_fan drivers_fan]
pin: PD7
[filament_switch_sensor filament_sensor]
pause_on_runout: True
runout_gcode:
M25
switch_pin: !PE6
[output_pin beeper]
pin: PA8
[safe_z_home]
home_xy_position: 165, 165
speed: 50
z_hop: 10
z_hop_speed: 5
[bed_screws]
screw1: 5, 5
screw2: 165, 5
screw3: 325, 5
screw4: 5, 325
screw5: 165, 325
screw6: 325, 325
[screws_tilt_adjust]
screw1: 60, 30
screw1_name: front left screw
screw2: 203, 30
screw2_name: front middle screw
screw3: 335, 30
screw3_name: front right screw
screw4: 60, 315
screw4_name: rear left screw
screw5: 203, 315
screw5_name: rear middle screw
screw6: 335, 315
screw6_name: rear right screw
horizontal_move_z: 20.
speed: 150.
screw_thread: CW-M3
[bed_mesh]
speed: 120
probe_count: 5, 5
horizontal_move_z: 5
algorithm: lagrange
mesh_min : 30, 10
mesh_max : 290, 310
mesh_pps: 0
fade_start: 1
fade_end: 10
fade_target: 0
[probe]
x_offset: -40
y_offset: -10
pin: !PE3
speed: 10
samples: 2
#z_offset: 3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment