Skip to content

Instantly share code, notes, and snippets.

@t-nissie
Last active June 26, 2024 10:22
Show Gist options
  • Save t-nissie/00ad4efe8caff9da2ba4583dc800176b to your computer and use it in GitHub Desktop.
Save t-nissie/00ad4efe8caff9da2ba4583dc800176b to your computer and use it in GitHub Desktop.
printer.cfg for ET4000+ and CoreXY
# CoreXY printer.cfg for EasyThreeD ET4000+ board
# I use ET4000+ main board for my CoreXY printer project.
# ET4000+ is MKS Robin Lite compatible.
# Motor ampere can be controlled via pwm pins: PB0, PA7 and PA6.
# Original file is https://github.com/makerbase-mks/Klipper-for-MKS-Boards/blob/main/MKS%20Robin%20Lite%20V1.1/generic-mks-robin-lite-v1.cfg
# The firmware binary is also in the same GitHub directory.
# To use this config, the firmware should be compiled for the
# STM32F103RCT6. When running "make menuconfig", enable "extra low-level
# configuration setup", select the 28KiB bootloader, and serial (on
# USART1 PA10/PA9) communication.
# Note that the "make flash" command does not work with MKS Robin
# boards. After running "make", run the following command:
# ./scripts/update_mks_robin.py out/klipper.bin out/mksLite.bin
# Copy the file out/mksLite.bin to an SD card and then restart the
# printer with that SD card.
# See docs/Config_Reference.md for a description of parameters.
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
[printer]
kinematics: corexy
max_velocity: 80
max_accel: 2000
max_z_velocity: 25
max_z_accel: 100
[output_pin motor_x_y_2_a_max]
pin: PB0
pwm: True
hardware_pwm: True
cycle_time: .000004
value: 0.4
[output_pin motor_z_2_a_max]
pin: PA7
pwm: True
hardware_pwm: True
cycle_time: .000004
value: 0.4
[output_pin motor_e_2_a_max]
pin: PA6
pwm: True
hardware_pwm: True
cycle_time: .000004
value: 0.4
[stepper_x]
step_pin: PC6
dir_pin: !PB12
enable_pin: !PB10
microsteps: 16
rotation_distance: 39.8
endstop_pin: !PC13
position_min: -2
position_endstop: -2
position_max: 138
homing_speed: 30
[stepper_y]
step_pin: PB11
dir_pin: !PB2
enable_pin: !PB10
microsteps: 16
rotation_distance: 39.8
endstop_pin: !PC0
position_min: -74
position_endstop: -74
position_max: 122
homing_speed: 30
[safe_z_home]
home_xy_position: 0.0,0.0
speed: 50.0
z_hop: 0 #move up 10mm
z_hop_speed: 5
[stepper_z]
step_pin: PB1
dir_pin: PC5
enable_pin: !PB10
microsteps: 16
rotation_distance: 8
endstop_pin: !PC12 #Zmin. Use PB9 for Zmax.
#position_endstop: 0.0
position_max: 226
[extruder]
step_pin: PC4
dir_pin: !PA5
enable_pin: !PA4
microsteps: 16
gear_ratio: 310:100 # Large left value results in larger flow of material.
rotation_distance: 23.132
full_steps_per_rotation: 200
nozzle_diameter: 0.600
filament_diameter: 1.750
heater_pin: PC9
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA0
control: pid
pid_Kp: 20.375
pid_Ki: 0.844
pid_Kd: 123.016
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PC8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA1
control: pid
pid_Kp: 325.10
pid_Ki: 63.35
pid_Kd: 417.10
min_temp: 0
max_temp: 130
max_power: 0.5
[fan]
pin: PA8
[virtual_sdcard]
path: /home/takeshi/printer_data/gcodes
[pause_resume]
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
# 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 #####
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### end of definitions #####
G91
G1 E{E} F2100
RESTORE_GCODE_STATE NAME=PAUSE_state
BASE_RESUME
[display_status]
########################################
# EXP1 (display) pins
########################################
######################################################################
# Beeper
# M300 : Play tone. Beeper support, as commonly found on usual LCD
# displays (i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount
# 12864 Full Graphic). This defines a custom I/O pin and a custom
# GCODE macro. Usage:
# M300 [P<ms>] [S<Hz>]
# P is the tone duration, S the tone frequency.
# The frequency won't be pitch perfect.
[output_pin BEEPER_pin]
pin: PD2
# Beeper pin. This parameter must be provided.
pwm: True
# A piezo beeper needs a PWM signal, a DC buzzer doesn't.
value: 0
# Silent at power on, set to 1 if active low.
shutdown_value: 0
# Disable at emergency shutdown (no PWM would be available anyway).
cycle_time: 0.001
# Default PWM frequency : 0.001 = 1ms will give a tone of 1kHz
# Although not pitch perfect.
[gcode_macro M300]
gcode:
# Use a default 1kHz tone if S is omitted.
{% set S = params.S|default(1000)|int %}
# Use a 10ms duration is P is omitted.
{% set P = params.P|default(100)|int %}
SET_PIN PIN=BEEPER_pin VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
G4 P{P}
SET_PIN PIN=BEEPER_pin VALUE=0
[board_pins]
aliases:
# EXP1 header
EXP1_2=<5V>, EXP1_4=<RST>, EXP1_6=PB4, EXP1_8=PB5, EXP1_10=PB15,EXP1_12=<3V3>,EXP1_14=PD2,
EXP1_1=PC3, EXP1_3=PC2, EXP1_5=PB3, EXP1_7=PC1, EXP1_9=PB13,EXP1_11=<GND>,EXP1_13=PA11,
# Pins PB14, EXP1_10, EXP1_9 are also MISO, MOSI, SCK of bus "ssp2"
# See the MKS Lcd Config path file for definitions of common LCD displays.
#[include mks_robin_lite_lcd_12864.cfg]
#[include mks_robin_lite_mini_12864.cfg]
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [stepper_z]
#*# position_endstop = 0.010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment