dotfiles.nix/nixos/lavender/printer/printer.cfg

280 lines
7 KiB
INI
Raw Normal View History

2023-08-06 08:57:14 +08:00
# This file contains pin mappings for the stock 2022 Creality Ender 3
# V2 Neo. To use this config, during "make menuconfig" select the
# STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
# communication.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC
# Flash this firmware by copying "out/klipper.bin" to a SD card and
# turning on the printer with the card inserted. The firmware
# filename must end in ".bin" and must not match the last filename
# that was flashed.
# This also works for the GD32F303 based Creality 4.2.2 board.
# See docs/Config_Reference.md for a description of parameters.
[stepper_x]
step_pin: PC2
dir_pin: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 235
homing_speed: 80
[stepper_y]
step_pin: PB8
dir_pin: PB7
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 0
position_max: 235
homing_speed: 80
[stepper_z]
step_pin: PB6
dir_pin: !PB5
enable_pin: !PC3
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_max: 250
homing_speed: 4
second_homing_speed: 1
homing_retract_dist: 2.0
[extruder]
max_extrude_only_distance: 100.0
step_pin: PB4
dir_pin: PB3
enable_pin: !PC3
microsteps: 16
rotation_distance: 34.406
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
control: pid
# tuned for stock hardware with 200 degree Celsius target
2023-08-06 09:17:55 +08:00
pid_Kp: 26.120
pid_Ki: 1.741
pid_Kd: 97.951
2023-08-06 08:57:14 +08:00
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
# tuned for stock hardware with 70 degree Celsius target
2023-08-06 09:17:55 +08:00
pid_kp: 70.073
2023-08-06 08:57:14 +08:00
pid_ki: 1.229
2023-08-06 09:17:55 +08:00
pid_kd: 998.534
2023-08-06 08:57:14 +08:00
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: 5000
max_z_velocity: 5
square_corner_velocity: 5.0
max_z_accel: 100
[bltouch]
sensor_pin: ^PB1
control_pin: PB0
x_offset: -40.0
y_offset: -12.0
z_offset: 1.72
2023-08-06 08:57:14 +08:00
speed: 20
samples: 1
sample_retract_dist: 8.0
[safe_z_home]
home_xy_position: 160,120
speed: 150
z_hop: 10
z_hop_speed: 10
[bed_mesh]
speed: 120
mesh_min: 30,30 # Need to handle head distance with cr-touch (bl_touch)
mesh_max: 189,189 # Max probe range
probe_count: 5,5
fade_start: 1
fade_end: 10
fade_target: 0
algorithm: bicubic
[bed_screws]
screw1:30,25
screw1_name:1
screw2:200,25
screw2_name:2
screw3:200,195
screw3_name:3
screw4:30,195
screw4_name:4
[screws_tilt_adjust]
screw1: 80, 50
2023-08-06 08:57:14 +08:00
screw1_name: front left screw
screw2: 235, 50
2023-08-06 08:57:14 +08:00
screw2_name: front right screw
screw3: 235, 208
2023-08-06 08:57:14 +08:00
screw3_name: rear right screw
screw4: 80, 208
2023-08-06 08:57:14 +08:00
screw4_name: rear left screw
horizontal_move_z: 10
speed: 200
screw_thread: CW-M4 # Use CW for Clockwise and CCW for Counter Clockwise
# [display]
# The Ender 3 v2 Neo's 4.3" LCD display is not supported by klipper
[output_pin beeper]
pin: PB13
# Replace the slicer's custom start and end g-code scripts with
# START_PRINT and END_PRINT. See docs/Slicers.md for more information on using these macros.
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(200)|float %}
# Start bed heating
M140 S{BED_TEMP}
# Use absolute coordinates
G90
# Reset the G-Code Z offset (adjust Z offset if needed)
SET_GCODE_OFFSET Z=0.0
# Home the printer
G28
# Wait for bed to reach temperature
M190 S{BED_TEMP}
# Perform bed mesh leveling
BED_MESH_CALIBRATE
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
# Cura slicer purge line
G92 E0 # Reset Extruder
G1 Z2.0 F3000 # Move Z Axis up little to prevent scratching of Heat Bed
G1 X10.1 Y20 Z0.3 F5000.0 # Move to start position
G1 X10.1 Y200.0 Z0.3 F1500.0 E15 # Draw the first line
G1 X10.4 Y200.0 Z0.3 F5000.0 # Move to side a little
G1 X10.4 Y20 Z0.3 F1500.0 E30 # Draw the second line
G92 E0 # Reset Extruder
G1 Z2.0 F3000 # Move Z Axis up little to prevent scratching of Heat Bed
G1 X15 Y20 Z0.3 F5000.0 # Move over to prevent blob squish
[gcode_macro END_PRINT]
gcode:
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Move nozzle away from print while retracting
G91
G1 X-2 Y-2 E-3 F300
# Raise nozzle by 10mm
G1 Z10 F3000
G90
# Disable steppers
M84
2023-08-06 08:57:14 +08:00
# Fluidd initial setup
# Allows file uploads to work correctly.
[virtual_sdcard]
path: /var/lib/moonraker/gcodes
# Required to properly support display updates in fluidd
[display_status]
# Enables Pause / Resume functionality within klipper.
[pause_resume]
# These can be assumed sane defaults, but should be checked and modified to your own needs.
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% 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} F900
G90
G1 X{x_park} Y{y_park} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
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