Skip to content

Instantly share code, notes, and snippets.

@jeanfbrito
Last active June 17, 2024 05:40
Show Gist options
  • Save jeanfbrito/e2063fa39c0e910d9c0467dc7a2a8178 to your computer and use it in GitHub Desktop.
Save jeanfbrito/e2063fa39c0e910d9c0467dc7a2a8178 to your computer and use it in GitHub Desktop.
Anycubic i3 Mega S Klipper configuration
# This file contains pin mappings for the Anycubic i3 Mega with
# Ultrabase from 2017. (This config may work on an Anycubic i3 Mega v1
# prior to the Ultrabase if you comment out the definition of the
# endstop_pin in the stepper_z1 section.) To use this config, the
# firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
#[gcode_arcs]
#resolution: 0.05
# An arc will be split into segments. Each segment's length will
# equal the resolution in mm set above. Lower values will produce a
# finer arc, but also more work for your machine. Arcs smaller than
# the configured value will become straight lines. The default is
# 1mm.
[stepper_x]
step_pin: ar54
dir_pin: !ar55
enable_pin: !ar38
microsteps: 16
rotation_distance: 40
endstop_pin: ^!ar3
position_min: -7
position_endstop: -5
position_max: 220
homing_speed: 80.0
[stepper_y]
step_pin: ar60
dir_pin: ar61
enable_pin: !ar56
microsteps: 16
rotation_distance: 40
endstop_pin: ^!ar42
position_endstop: 0
position_max: 220
homing_speed: 80.0
[stepper_z]
step_pin: ar46
dir_pin: ar48
enable_pin: !ar62
microsteps: 16
rotation_distance: 8
endstop_pin: ^!ar18
position_endstop: 0.0
position_min: -2
position_max: 180
homing_speed: 10.0
[stepper_z1]
step_pin: ar36
dir_pin: ar34
enable_pin: !ar30
microsteps: 16
rotation_distance: 8
endstop_pin: ^!ar43
[extruder]
step_pin: ar26
dir_pin: ar28
enable_pin: !ar24
#step_distance: .002440
microsteps: 16
rotation_distance: 7.495
nozzle_diameter: 0.600
filament_diameter: 1.750
max_extrude_only_distance: 220.0
heater_pin: ar10
sensor_type: ATC Semitec 104GT-2
sensor_pin: analog13
#control: pid
#215
#pid_Kp=28.278
#pid_Ki=1.746
#pid_Kd=114.528
#200
#pid_Kp=28.010
#pid_Ki=1.653
#pid_Kd=118.694
min_temp: 0
max_temp: 265
#pressure_advance: 0.537 # Titan
#pressure_advance: 0.64
#pressure_advance: 0.34 # eSun + BMG
#pressure_advance: 0.443 #ABS + BMG Direct Drive
# The amount of raw filament to push into the extruder during
# extruder acceleration. An equal amount of filament is retracted
# during deceleration. It is measured in millimeters per
# millimeter/second. The default is 0, which disables pressure
# advance.
#pressure_advance_smooth_time: 0.040
# A time range (in seconds) to use when calculating the average
# extruder velocity for pressure advance. A larger value results in
# smoother extruder movements. This parameter may not exceed 200ms.
# This setting only applies if pressure_advance is non-zero. The
# default is 0.040 (40 milliseconds).
[heater_fan extruder_fan]
pin: ar44
[heater_bed]
heater_pin: ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog14
#control: pid
#pid_Kp=76.304
#pid_Ki=1.657
#pid_Kd=878.444
min_temp: 0
max_temp: 130
[fan]
pin: ar9
[mcu]
serial: /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
pin_map: arduino
[mcu rpi]
serial: /tmp/klipper_host_mcu
[adxl345 hotend]
cs_pin: rpi:None
[adxl345 bed]
cs_pin: rpi:None
[resonance_tester]
accel_chip_x: adxl345 hotend
accel_chip_y: adxl345 bed
probe_points:
100,100,20 # an example
[input_shaper]
shaper_freq_x: 54.6
shaper_type_x: mzv
shaper_freq_y: 38.2
shaper_type_y: mzv
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 2900
max_accel_to_decel: 1450
max_z_velocity: 20
max_z_accel: 60
#max_velocity: 300
#max_accel: 2900
square_corner_velocity: 5.0
max_velocity: 300
max_accel: 2900
square_corner_velocity: 5.0
#[input_shaper]
#shaper_freq_x: 70
#shaper_freq_y: 85
#shaper_type: mzv
[heater_fan stepstick_fan]
pin: ar7
[endstop_phase]
[pause_resume]
recover_velocity: 60.
# When capture/restore is enabled, the speed at which to return to
# the captured position (in mm/s). Default is 50.0 mm/s.
# Enable the "M118" and "RESPOND" extended commands.
[respond]
#[gcode_macro G29]
#gcode: BED_MESH_CALIBRATE
[gcode_macro m205]
gcode:
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.377500, -0.355000, -0.367500, -0.330000, -0.157500
#*# -0.347500, -0.385000, -0.432500, -0.432500, -0.357500
#*# -0.312500, -0.355000, -0.402500, -0.442500, -0.380000
#*# -0.275000, -0.310000, -0.357500, -0.387500, -0.330000
#*# -0.095000, -0.167500, -0.240000, -0.260000, -0.152500
#*# x_count = 5
#*# y_count = 5
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = lagrange
#*# tension = 0.2
#*# min_x = 19.0
#*# max_x = 199.0
#*# min_y = 12.0
#*# max_y = 200.0
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 33.959
#*# pid_ki = 2.220
#*# pid_kd = 129.894
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 69.772
#*# pid_ki = 3.164
#*# pid_kd = 384.617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment