Skip to content

Instantly share code, notes, and snippets.

@7effrey89
Last active April 8, 2026 21:12
Show Gist options
  • Select an option

  • Save 7effrey89/7331c1d01952420839cfa3c4316de4ab to your computer and use it in GitHub Desktop.

Select an option

Save 7effrey89/7331c1d01952420839cfa3c4316de4ab to your computer and use it in GitHub Desktop.
My Klipper config for Ramps 1.4 using TMC2130 SPI and DRV8825, LCD
# This file contains common pin mappings for RAMPS (v1.3 and later)
# boards. RAMPS boards typically use a firmware compiled for the AVR
# atmega2560 (though other AVR chips are also possible).
# See docs/Config_Reference.md for a description of parameters.
[stepper_x]
step_pin: ar54
dir_pin: !ar55
enable_pin: !ar38
microsteps: 32
rotation_distance: 40
endstop_pin: ^!ar3
#endstop_pin: ^ar2
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
microsteps: 32
rotation_distance: 40
endstop_pin: ^!ar14
#endstop_pin: ^ar15
position_endstop: 0
position_max: 200
homing_speed: 50
# Define a probe
[probe]
pin: ^!ar18
#z_offset: 0
x_offset: 27.5
y_offset: 5
[stepper_z]
step_pin: ar46
dir_pin: ar48
enable_pin: !ar62
microsteps: 32
rotation_distance: 8
endstop_pin: ^ar18
#endstop_pin: ^ar19
#position_endstop: 0.5
position_max: 200
endstop_pin: probe:z_virtual_endstop
position_min: -2 # The Z carriage may need to travel below the Z=0
# homing point if the bed has a significant tilt.
[stepper_z1]
step_pin:ar36
dir_pin:ar34
enable_pin:!ar30
microsteps:32
rotation_distance:8
# See the "stepper" section for the definition of the above parameters.
#endstop_pin:
# If an endstop_pin is defined for the additional stepper then the
# stepper will home until the endstop is triggered. Otherwise, the
# stepper will home until the endstop on the primary stepper for the
# axis is triggered.
# The safe_z_home section modifies the default G28 behavior
[safe_z_home]
home_xy_position: 100,100
speed: 50
z_hop: 15
z_hop_speed: 5
[extruder]
step_pin: ar26
dir_pin: !ar28
enable_pin: !ar24
microsteps: 32
rotation_distance: 7.711
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
control: pid
pid_Kp: 38.609
pid_Ki: 2.181
pid_Kd: 170.843
min_temp: 0
max_temp: 250
#[extruder1]
#step_pin: ar36
#dir_pin: ar34
#enable_pin: !ar30
#heater_pin: ar9
#sensor_pin: analog15
#...
[heater_bed]
heater_pin: ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog14
#control: watermark
min_temp: 0
max_temp: 130
# Example bed_mesh config section
[bed_mesh]
mesh_min: 30,30
# Defines the minimum x,y coordinate of the mesh for rectangular
# beds. This coordinate is relative to the probe's location. This
# will be the first point probed, nearest to the origin. This
# parameter must be provided for rectangular beds.
mesh_max: 200,200
# Defines the maximum x,y coordinate of the mesh for rectangular
# beds. Adheres to the same principle as mesh_min, however this will
# be the furthest point probed from the bed's origin. This parameter
# must be provided for rectangular bed
probe_count: 3,3
# For rectangular beds, this is a comma separate pair of integer
# values (X,Y) defining the number of points to probe along each
# axis. A single value is also valid, in which case that value will
# be applied to both axes. Default is 3,3.
[fan]
pin: ar6
#Fan extension, de har byttet om på D11 og D6.
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
#/dev/ttyACM0
pin_map: arduino
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[z_tilt]
z_positions:
-60, -11
265, -11
points:
20, 100
180, 100
#[heater_fan my_nozzle_fan]
#pin: ar6
#max_power:
#shutdown_speed:
#cycle_time:
#hardware_pwm:
#kick_start_time:
#off_below:
#tachometer_pin:
#tachometer_ppr:
#tachometer_poll_interval:
# See the "fan" section for a description of the above parameters.
#heater: extruder
# Name of the config section defining the heater that this fan is
# associated with. If a comma separated list of heater names is
# provided here, then the fan will be enabled when any of the given
# heaters are enabled. The default is "extruder".
#heater_temp: 50.0
# A temperature (in Celsius) that the heater must drop below before
# the fan is disabled. The default is 50 Celsius.
#fan_speed: 1.0
# The fan speed (expressed as a value from 0.0 to 1.0) that the fan
# will be set to when its associated heater is enabled. The default
# is 1.0
########################################
# TMC2130 configuration
########################################
[tmc2130 stepper_x]
cs_pin: ar42
run_current:0.800
[tmc2130 stepper_y]
cs_pin: ar44
run_current:0.800
# Common EXP1 / EXP2 (display) pins
[board_pins]
aliases:
# Common EXP1 header found on many "all-in-one" ramps clones
EXP1_1=ar37, EXP1_3=ar17, EXP1_5=ar23, EXP1_7=ar27, EXP1_9=<GND>,
EXP1_2=ar35, EXP1_4=ar16, EXP1_6=ar25, EXP1_8=ar29, EXP1_10=<5V>,
# EXP2 header
EXP2_1=ar50, EXP2_3=ar31, EXP2_5=ar33, EXP2_7=ar49, EXP2_9=<GND>,
EXP2_2=ar52, EXP2_4=ar53, EXP2_6=ar51, EXP2_8=ar41, EXP2_10=<RST>
# Pins EXP2_1, EXP2_6, EXP2_2 are also MISO, MOSI, SCK of bus "spi"
# Note, some boards wire: EXP2_8=<RST>, EXP2_10=ar41
[display]
lcd_type: st7920
cs_pin: EXP1_4
sclk_pin: EXP1_5
sid_pin: EXP1_3
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2
#kill_pin: ^!EXP2_8
[output_pin beeper]
pin: EXP1_1
# See the sample-lcd.cfg file for definitions of common LCD displays.
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[pause_resume]
[gcode_macro G29]
gcode:
G28
G1 Z10 F600
BED_MESH_CALIBRATE
[gcode_macro G38]
gcode:
Z_TILT_ADJUST
[gcode_macro BedLevel]
gcode:
BED_MESH_CALIBRATE METHOD=automatic
[gcode_macro RESUME]
rename_existing: BASE_RESUME
default_parameter_E: 1 # edit to your preferred retract length
gcode:
G91
G1 E{E} F2100
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
default_parameter_E: 1.7
gcode:
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% 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 %}
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{z_safe} F900
G90
G0 X{x_park} Y{y_park} F6000
G91
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro PID_Heater200]
gcode:
PID_CALIBRATE HEATER=extruder TARGET=200 [WRITE_FILE=1]
SAVE_CONFIG
[gcode_macro PID_Bed60]
gcode:
PID_CALIBRATE HEATER=heater_bed TARGET=60 [WRITE_FILE=1]
SAVE_CONFIG
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = 0.400
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.090000, 0.210000, 0.123750
#*# -0.453750, -0.013750, -0.321250
#*# -1.903750, -1.485000, -1.630000
#*# tension = 0.2
#*# min_x = 30.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 30.0
#*# x_count = 3
#*# max_y = 200.0
#*# mesh_x_pps = 2
#*# max_x = 200.0
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 58.698
#*# pid_ki = 0.553
#*# pid_kd = 1556.232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment