# printer_size: 300x300x300
# This file contains pin mappings for the stock 2021 Creality Ender 3
# S1 & S1 Pro. To use this config, check the STM32 Chip on the
# Mainboard, during "make menuconfig" select accordingly either the
# STM32F103 with "28KiB bootloader" or the STM32F401 with
# "64KiB bootloader" and serial (on USART1 PA10/PA9) for both.
# For a direct serial connection, in "make menuconfig" select
# "Enable extra low-level configuration options" and Serial
# (on USART2 PA3/PA2), which is on the 10 pin IDC cable used
# Flash this firmware by copying "out/klipper.bin" to a SD card and
# turning on the printer with the card inserted. The filename
# must be changed to "firmware.bin"
# With STM32F401, you might need to put "firmware.bin" in a
# folder on the SD card called "STM32F4_UPDATE" in order to flash.
# See docs/Config_Reference.md for a description of parameters.
description: Pause the actual running print
rename_existing: PAUSE_BASE
# change this if you need more or less extrusion
##### 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 = max_z - act_z %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
{action_respond_info("Extruder not hot enough")}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 X{x_park} Y{y_park} F6000
{action_respond_info("Printer not homed")}
description: Resume the actual running print
rename_existing: RESUME_BASE
##### 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) %}
{% set get_params = "" %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
{action_respond_info("Extruder not hot enough")}
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
{% if "xyz" in printer.toolhead.homed_axes %}
{action_respond_info("Printer not homed")}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
endstop_pin: probe:z_virtual_endstop #enable to use bltouch
#endstop_pin: !PA15 #disable to use bltouch
max_extrude_only_distance: 1000.0
sensor_type: EPCOS 100K B57560G104F
# tuned for stock hardware with 200 degree Celsius target
sensor_type: EPCOS 100K B57560G104F
# tuned for stock hardware with 50 degree Celsius target
#set heater fan runnig with temperature over 60;
[heater_fan my_nozzle_fan]
serial: /dev/serial/by-id/usb_serial_1
# serial: /tmp/klipper_host_mcu
[filament_switch_sensor filament_sensor]
sensor_pin: ^PC14 #signal check port ^stand for pull up
control_pin: PC13 #singal control prot
#z_offset: 0 #z off_set configuration
stow_on_each_sample = false #high speed for bltoch,
samples_tolerance_retries: 3
mesh_min: 25,30 #need to handle head distance with bl_touch
mesh_max: 273,250 #max probe range
square_corner_velocity: 5.0