Skip to content

Instantly share code, notes, and snippets.

@whi-tw
Created August 10, 2021 17:26
Show Gist options
  • Save whi-tw/df670b56c1fc1aae94b26a371c63a969 to your computer and use it in GitHub Desktop.
Save whi-tw/df670b56c1fc1aae94b26a371c63a969 to your computer and use it in GitHub Desktop.
Klipper config for my ANET A8
# This file contains common pin mappings for Anet A8 printer from 2016
# and 2017. To use this config, the firmware should be compiled for
# the AVR atmega1284p.
# Note that the "make flash" command does not work with Anet boards -
# the boards are typically flashed with this command:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# See docs/Config_Reference.md for a description of parameters.
[mcu]
[stepper_x]
step_pin: PD7
dir_pin: PC5
enable_pin: !PD6
microsteps: 16
rotation_distance: 32
endstop_pin: ^!PC2
position_endstop: -31.1
position_max: 220
position_min: -31.1
homing_speed: 120
[stepper_y]
step_pin: PC6
dir_pin: PC7
enable_pin: !PD6
microsteps: 16
rotation_distance: 32
endstop_pin: ^!PC3
position_endstop: -17.5
position_min: -17.5
position_max: 215
homing_speed: 120
[stepper_z]
step_pin: PB3
dir_pin: !PB2
enable_pin: !PA5
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_max: 240
position_min: -2
homing_speed: 20
[extruder]
step_pin: PB1
dir_pin: PB0
enable_pin: !PD6
microsteps: 16
rotation_distance: 7.619
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA7
control: pid
pid_Kp: 32.73
pid_Ki: 4.21
pid_Kd: 63.68
min_temp: 0
max_temp: 285
pressure_advance: 0.045
[heater_bed]
heater_pin: PD4
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA6
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: PB4
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 1000
max_z_velocity: 20
max_z_accel: 100
[probe]
pin: ^!PC4
x_offset: 19
y_offset: -23.40
z_offset: 2.475
[safe_z_home]
home_xy_position: 110,110
z_hop: 5
[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 10, 10
mesh_max: 210, 190
probe_count: 5,4
mesh_pps: 2,3
algorithm: bicubic
bicubic_tension: 0.2
fade_start: 1
fade_end: 10
fade_target: 0
[display]
lcd_type: hd44780
rs_pin: PA3
e_pin: PA2
d4_pin: PD2
d5_pin: PD3
d6_pin: PC0
d7_pin: PC1
up_pin: PA1
analog_range_up_pin: 9000, 13000
down_pin: PA1
analog_range_down_pin: 800, 1300
click_pin: PA1
analog_range_click_pin: 2000, 2500
back_pin: PA1
analog_range_back_pin: 4500, 5000
#kill_pin: PA1
#analog_range_kill_pin: 400, 600
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
M117 Homing
# Use absolute coordinates
G90
# Use absolute extrusion
M82
# Home the printer
G28
# Move the nozzle near the bed
G1 X-1 Y-1 Z5 F6000
# Start bed heating and continue
M117 Waiting for temp
M140 S{BED_TEMP}
{% if printer.heater_bed.temperature < params.BED_TEMP|float*0.85 %}
M190 S{params.BED_TEMP|float*0.85} # wait till 0.85 of bed temp is reached, then continue
{% endif %}
M140 S{BED_TEMP}
M190 S{BED_TEMP}
# Probe the bed
M117 Probing
BED_MESH_CALIBRATE
M109 S{EXTRUDER_TEMP}
# Prime line
PRIME_LINE
M117 Printing...
[gcode_macro END_PRINT]
gcode:
M117 Done printing :)
# move z up
G91
G1 E-3 Z+10 F3000
# absolute xy
G90
G1 X-1 Y210 F2000
#disable hotend and heated bed
M104 S0
M140 S0
# disable steppers
M84
BED_MESH_CLEAR
[gcode_macro PRIME_LINE]
gcode:
M117 Prime Line
G92 E0.0 ;Reset Extruder
# move z axis
G1 Z5.0 F3000 ;Move Z Axis up
# move to prime position
G1 X0.0 Y0.0 Z0.1 F3000.0 ; go outside print area
G1 X60.0 E9.0 F1000.0 ; intro line
G1 X100.0 E15.0 F1000.0 ; intro line
G92 E0.0 ; reset extruder distance position
G1 Z2.0 F3000 ;Move Z Axis up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment