Skip to content

Instantly share code, notes, and snippets.

@daltonnyx
Last active October 25, 2022 09:10
Show Gist options
  • Save daltonnyx/ff919b5c3466abbd763312292a4924c5 to your computer and use it in GitHub Desktop.
Save daltonnyx/ff919b5c3466abbd763312292a4924c5 to your computer and use it in GitHub Desktop.
# PLA+ Profile
[stepper_x]
step_pin: PC2
dir_pin: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 220
position_max: 220
homing_speed: 50
[stepper_y]
step_pin: PB8
dir_pin: PB7
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 220
position_max: 220
homing_speed: 50
[stepper_z]
step_pin: PB6
dir_pin: PB5
enable_pin: !PC3
microsteps: 16
rotation_distance: 4
endstop_pin: probe:z_virtual_endstop
# position_endstop: 0.0 Disalbe for bl touch
position_max: 250
position_min: -3
[bltouch]
sensor_pin: ^PB1
control_pin: PB0
samples: 2
x_offset: -43.5
y_offset: -11.2
probe_with_touch_mode: True
pin_up_touch_mode_reports_triggered: True
#z_offset: 2.9
[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 10, 20
mesh_max: 170, 205
probe_count: 4, 4
fade_start: 1
fade_end: 10
fade_target: 0
[safe_z_home]
home_xy_position: 110, 110 # Change coordinates to the center of your print bed
speed: 50
z_hop: 10 # Move up 10mm
z_hop_speed: 5
[extruder]
max_extrude_only_distance: 100.0
step_pin: PB4
dir_pin: PB3
enable_pin: !PC3
microsteps: 16
rotation_distance: 31.210
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
#control: pid
#pid_Kp: 24.831
#pid_Ki: 1.346
#pid_Kd: 114.532
min_temp: 0
max_temp: 260
#pressure_advance: 0.090
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
pid_Kp: 66.429
pid_Ki: 1.197
pid_Kd: 921.707
min_temp: 0
max_temp: 130
[fan]
pin: PA0
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
# [input_shaper]
# shaper_freq_x: 58.1
# shaper_freq_y: 38.7
# shaper_type: ei
# [gcode_arcs]
# resolution: 1.0
[display] # RET6 12864 LCD
lcd_type: st7920
cs_pin: PB12
sclk_pin: PB13
sid_pin: PB15
encoder_pins: ^PB14, ^PB10
click_pin: ^!PB2
[output_pin BEEPER_Pin]
pin: PC6
pwm: True
value: 0
shutdown_value: 0
cycle_time: 0.001
scale: 1
[firmware_retraction]
retract_length: 3.5
# The length of filament (in mm) to retract when G10 is activated,
# and to unretract when G11 is activated (but see
# unretract_extra_length below). The default is 0 mm.
retract_speed: 65
# The speed of retraction, in mm/s. The default is 20 mm/s.
unretract_extra_length: 0.0
# The length (in mm) of *additional* filament to add when
# unretracting.
unretract_speed: 65
# The speed of unretraction, in mm/s. The default is 10 mm/s.
########################################
###. Gcode Macro ###
########################################
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(40)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(170)|float %}
# Set and wait for bed to reach temperature
M190 S{BED_TEMP}
# Set extruder temperature
M104 S{EXTRUDER_TEMP}
# Load bed mesh profile
BED_MESH_PROFILE LOAD=default
# Homing
G28
# Reset extruder
G92 E0
# Move Z axis up a little to prevent scratching heat bed
G1 Z2.0 F3000
# Move to start position
G1 X10.1 Y20 Z5.0 F5000.0
# Wait for Extruder temperature
M109 S{EXTRUDER_TEMP}
# Move to start for purge line
G1 X10.1 Y20 Z0.20 F5000.0
# Draw 1st line
G1 X10.1 Y200.0 Z0.20 F1500.0 E15
# Move to side a little
G1 X10.4 Y200.0 Z0.20 F5000.0
# Draw 2nd line
G1 X10.4 Y20 Z0.20 F1500.0 E30
# Reset extruder
G92 E0
# Retract a bit to avoid ozzing
G1 E-1.5 F3000
G1 X10.0 F1000 ; Wipe back to break string.
G1 X11.0 F1000 ; Wipe forward to break string.
# Reset extruder
G92 E0
# Move Z up a little
G1 Z5.0 F3000
[gcode_macro END_PRINT]
gcode:
G91
# Retract a bit
G1 E-4 F2700
G1 E-2 Z0.2 F2400
G1 X5 Y5 F3000
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Raise nozzle by 10mm
G1 Z10 F3000
G90
# Deliver print
G1 X220 Y220
# Disable steppers
M84 X Y E
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 25.397
#*# pid_ki = 1.333
#*# pid_kd = 120.954
#*#
#*# [bltouch]
#*# z_offset = 1.600
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.085625, 0.104375, 0.116875, 0.094375
#*# 0.011875, 0.033750, 0.003125, -0.008125
#*# -0.057500, -0.029375, -0.026250, -0.058750
#*# -0.108750, -0.108125, -0.088750, -0.110625
#*# tension = 0.2
#*# min_x = 10.0
#*# algo = lagrange
#*# y_count = 4
#*# mesh_y_pps = 2
#*# min_y = 20.0
#*# x_count = 4
#*# max_y = 204.97
#*# mesh_x_pps = 2
#*# max_x = 169.99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment