Hello. These are my configs for anycubic kobra 2 neo. These configs are very experimental still, but working fine untill this now. I have configured input shaper and pressure advance and it prints really well, almost no defects (unlike stock marlin lol). Please share your opinions and suggestions, i would really appreciate some feedback.
Also, this wouldn’t be possible without kvgx12, j0tp3, jschuh, kuroi and other cool guys from our original thread. (full credits are in printer.cfg)
###############################################
printer.cfg
#################################################
# ORIGINAL CONFIGS BY j0tp3
# MODIFIED AND GENERALLY IMPROVED BY zamonary1
# v0.7.3.5
# kvgx12 was very first to figure out how to flash the firmware
# Input shaper frequencies was provided by xenyon
# stop macro was taken from jschuh's github repo, pause and resume currently doesn't work but i am working on it
# Also you can look at other people, without whom it would be impossible to do this at our discussion (linked below)
# Thank you all guys for making this happen and thank YOU for your interest in our work.
# For suggections or improvements contact me via discord or telegram @zamonary1 or via our discourse thread
# https://klipper.discourse.group/t/getting-orange-pi-3-lts-klipper-working-with-anycubic-kobra-2-neo
# Links to all of those cool guys mentioned above (except me ;_;)
# https://klipper.discourse.group/u/kvgx12/
# https://klipper.discourse.group/u/j0tp3/
# https://klipper.discourse.group/u/xenyon/
# https://klipper.discourse.group/u/kuroi/
# https://github.com/jschuh/klipper-macros/
# Please, do not remove this sign, these configs are distributed free of charge anyways :)
#################################################
[include moonraker_obico_macros.cfg]
[include mainsail.cfg]
[include pause_resume.cfg]
[include scripts.cfg]
#[include display.cfg]
[exclude_object]
[gcode_arcs]
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
baud: 250000
[printer]
kinematics: cartesian
max_velocity: 250
max_accel: 3000
max_z_velocity: 8
max_z_accel: 800
[virtual_sdcard]
path: ~/printer_data/gcodes
on_error_gcode: CANCEL_PRINT
[input_shaper]
shaper_type_x : mzv
shaper_freq_x : 65.200000
shaper_type_y : 2hump_ei
shaper_freq_y : 61.200000
[stepper_x]
step_pin: PA12
dir_pin: PA11
enable_pin: !PA15
microsteps: 16
rotation_distance: 40
endstop_pin: ^!PB11
position_endstop: -10
position_min: -14
position_max: 225
homing_speed: 60
[stepper_y]
step_pin: PA9
dir_pin: !PA8
enable_pin: !PA15
microsteps: 16
rotation_distance: 40
endstop_pin: ^!PC13
position_endstop: -2
position_min: -3
position_max: 240
homing_speed: 60
[stepper_z]
step_pin: PB0
dir_pin: !PB1
enable_pin: !PA15
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_min: -2
position_max: 200
homing_speed: 8
second_homing_speed: 2
[extruder]
max_extrude_cross_section: 5.0
step_pin: PB15
dir_pin: PB14
enable_pin: !PA15
microsteps: 16
max_extrude_only_distance: 200
max_extrude_only_velocity: 80
max_extrude_only_accel: 2500
rotation_distance: 7.084
nozzle_diameter: 0.400
filament_diameter: 1.750
pressure_advance: 0.06
heater_pin: PB8
sensor_type: ATC Semitec 104GT-2
sensor_pin: PC3
min_extrude_temp: 190
min_temp: 0
max_temp: 250
control: pid
#pid_kp: 14.42
#pid_ki: 0.88
#pid_kd: 59.12 # old values
pid_Kp=20.861
pid_Ki=1.095
pid_Kd=99.353
pressure_advance: 0.225 # needs more testing, i am open for suggestions
[heater_bed]
heater_pin: PB9
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC1
min_temp: 0
max_temp: 120
control: pid
#pid_kp: 97.1
#pid_ki: 1.41
#pid_kd: 1675.16 # old values
pid_Kp=59.418
pid_Ki=1.082
pid_Kd=815.506
[probe]
pin: PA1
x_offset : 24.0
y_offset : 13.35
#z_offset: 0
samples: 3
samples_result: average
sample_retract_dist: 1
speed: 3
lift_speed: 8
samples_tolerance : 0.1
samples_tolerance_retries : 3
[bed_mesh]
speed: 200
horizontal_move_z: 3
#mesh_min: -8, 0
mesh_min: 14, 11
mesh_max: 210, 215
probe_count: 6,6
mesh_pps: 5,5 #interpolation, not the actual probe count
algorithm: bicubic
bicubic_tension: 0.2
[safe_z_home]
home_xy_position: 5, 5
speed: 60
z_hop: 4
z_hop_speed: 9
[firmware_retraction]
retract_length: 1.8
retract_speed: 50
#unretract_extra_length: 0
unretract_speed: 50
[controller_fan controller_fan]
pin: PB12
[heater_fan extruder_fan]
pin: PB13
[fan]
pin: PB5
cycle_time: 0.00005 #20kHz
#This pin enables the bed, hotend, extruder fan, part fan.
[output_pin enable_pin]
pin: PB6
value: 1
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = 0
pause_resume.cfg (kinda untested still)
# Copyright (C) 2022 Justin Schuh <code@justinschuh.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
# Enables pause/resume functionality
[pause_resume]
[gcode_macro PRINT_END]
gcode:
M106 S0
G91
G1 E-2
G1 Z5 F200
G90
G1 F2000 X20
G1 F2500 Y200 ; expose the print
M140 S0
M104 S0
M84
[gcode_macro pause]
description: Pauses the current print.
Usage: PAUSE [X=<pos>] [Y=<pos>] [Z=<pos>] [E=<retract_length>] [B=<beeps>]
rename_existing: _KM_PAUSE_BASE
gcode:
{% set km = printer["gcode_macro _km_globals"] %}
# Retract length (negative)
{% set E = (params.E|default(5))|float %}
# Beeps
{% set B = params.B|default(10)|int if "output_pin beeper" in printer else 0
%}
{% if printer.pause_resume.is_paused %}
{ action_respond_info("Print already paused") }
{% elif printer.idle_timeout.state | string == "Printing" or
(printer.virtual_sdcard|default({})).is_active|default(False) %}
_KM_PRINT_STATUS ACTION=CHANGE STATUS=pausing RESET_STACK=1
{% set position = printer.gcode_move.gcode_position %}
SET_GCODE_VARIABLE MACRO=resume VARIABLE=saved_x VALUE="{position.x}"
SET_GCODE_VARIABLE MACRO=resume VARIABLE=saved_y VALUE="{position.y}"
SET_GCODE_VARIABLE MACRO=resume VARIABLE=saved_z VALUE="{position.z}"
SET_GCODE_VARIABLE MACRO=resume VARIABLE=saved_e VALUE="{E}"
SAVE_GCODE_STATE NAME=_KM_PAUSE_OVERRIDE_STATE
_KM_PAUSE_BASE
M83
{% if printer.extruder.can_extrude %}
G1 E{'%.4f' % -E} F{km.load_speed}
{% endif %}
PARK P=2{% for k in params|select("in", "XYZ") %}{
' '~k~'="'~params[k]~'"'}{% endfor %}
# Beep on pause if there's an M300 macro.
{% for i in range(B) %}
M300 P100
G4 P200
{% endfor %}
{% else %}
{ action_respond_info("Print not in progress") }
{% endif %}
[gcode_macro m600]
description: Pauses the current print.
Usage: M600 [B<beeps>] [E<pos>] [L<pos>] [R<temp>] [U<pos>] [X<pos>] [Y<pos>]
[Z<pos>]
gcode:
PAUSE B="{0}" P=2{% for k in params|select("in", "EXYZ") %}{
' '~k~'="'~params[k]~'"'}{% endfor %}
UNLOAD_FILAMENT{% if 'U' in params %} LENGTH={params.U}{% endif
%} BEEPS="{params.B|default(10)|int}"
{% if 'R' in params %}M109 S{params.R}{% endif %}
[gcode_macro m601]
description: Pauses the current print.
Usage: M601
gcode:
PAUSE
[gcode_macro m602]
description: Resumes the currently paused print.
Usage: M602
gcode:
RESUME
[gcode_macro m24]
rename_existing: M24.6245197
gcode:
{% if printer.pause_resume.is_paused %}
RESUME
{% else %}
M24.6245197
{% endif %}
[gcode_macro m25]
rename_existing: M25.6245197
gcode:
PAUSE
[gcode_macro resume]
description: Resumes the currently paused print.
Usage: RESUME [E<pos>]
variable_saved_extruder_temp: 0
variable_saved_x: 0.0
variable_saved_y: 0.0
variable_saved_z: 0.0
variable_saved_e: 0.0
rename_existing: _KM_RESUME_BASE
gcode:
{% if printer.pause_resume.is_paused %}
{% set km = printer["gcode_macro _km_globals"] %}
# Warm the extruder back up if needed.
{% set extruder = printer[printer.toolhead.extruder] %}
{% if extruder.target <= printer.configfile.settings[
printer.toolhead.extruder].min_temp
| float + 0.5 %}
M109 S{saved_extruder_temp}
{% endif %}
# If there's no saved_e assume we're completing a filament change and
# retract enough to avoid drooling on the model.
{% if 'E' not in params and not saved_e %}
{% set saved_e = 5.0 %}
G1 E{'%.4f' % -saved_e } F{km.load_speed}
{% endif %}
SET_GCODE_VARIABLE MACRO=resume VARIABLE=saved_extruder_temp VALUE="{0}"
G90
# Move back to last position before unretracting.
G0 X{saved_x} Y{saved_y} F{km.travel_speed_xy}
G0 Z{saved_z} F{km.travel_speed_z}
G91
# Unretract
G1 E{'%.4f' % (params.E|default(saved_e))} F{km.load_speed}
RESTORE_GCODE_STATE NAME=_KM_PAUSE_OVERRIDE_STATE MOVE=1
_KM_RESUME_BASE
{% else %}
{ action_respond_info("Printer is not paused.") }
{% endif %}
_KM_PRINT_STATUS ACTION=CHANGE STATUS=printing RESET_STACK=1
# TODO: Fix casing after front-ends get fixed
[gcode_macro CANCEL_PRINT]
description: Cancels the current print.
Usage: CANCEL_PRINT
rename_existing: _KM_CANCEL_PRINT_BASE
gcode:
_KM_CHECK_IS_PRINTING
_KM_PRINT_STATUS ACTION=CHANGE STATUS=cancelling RESET_STACK=1
SET_GCODE_VARIABLE MACRO=_print_end_inner VARIABLE=cancelled VALUE="{True}"
PRINT_END
_KM_CANCEL_PRINT_BASE
{% if printer.pause_resume.is_paused %}
RESTORE_GCODE_STATE NAME=_KM_PAUSE_OVERRIDE_STATE MOVE=0
{% endif %}
CLEAR_PAUSE
_KM_APPLY_PRINT_OFFSET RESET=1
{% if 'virtual_sdcard' in printer and not printer.virtual_sdcard.is_active %}
SDCARD_RESET_FILE
{% endif %}
[gcode_macro clear_pause]
description: Clears the current pause state.
Usage: CLEAR_PAUSE
rename_existing: _KM_CLEAR_PAUSE
gcode:
SET_GCODE_VARIABLE MACRO=resume VARIABLE=saved_e VALUE="{0.0}"
SET_GCODE_VARIABLE MACRO=resume VARIABLE=saved_extruder_temp VALUE="{0}"
_KM_CLEAR_PAUSE
scripts.cfg
[gcode_macro PULL_FILAMENT_OUT]
gcode:
G91
G1 E20 F500
G1 E-100 F500
G90
M84 #motors off
[gcode_macro FILAMENT_INSERT]
gcode:
G91
G1 E40 F500 #extrude 40mm of filament
G90
M84 #motors off
[gcode_macro DRY_FILAMENT]
gcode:
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=60
G4 P10800000 #3 hours (3*60*60*1000)
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=0
start gcode (prusaslicer, orcaslicer)
BED_MESH_PROFILE LOAD="default"
M140 S[bed_temperature_initial_layer_single]
M104 S[nozzle_temperature_initial_layer]
M190 S[bed_temperature_initial_layer_single]
M109 S[nozzle_temperature_initial_layer]
G28 X Y Z
PRINT_START EXTRUDER=[nozzle_temperature_initial_layer] BED=[bed_temperature_initial_layer_single]
G92 E0; zero the extruded length
SET_PRESSURE_ADVANCE ADVANCE=0
G1 X70 Y-2 Z0.6 F2400 ; that's scary
G1 E3 F1000
G1 X130 E43 F500 ; Extrude 45mm of filament in a 6cm line.
G1 Z1
SET_PRESSURE_ADVANCE ADVANCE=0.225
end gcode (prusaslicer, orcaslicer) (informative)
PRINT_END
###############################################
Changelog:
[0.7]
- Addied dry_filament macro that heats up the bed, waits for 3 hours and then cools down. Just place a spool of filament on the heated bed and cover it with it’s own box. Because of convection it removes moisture from the spool. Don’t forget to make small holes in the box on the side that would be facing up during the process.
- Improved the original bed calibration algorithm from j0tp3, now it’s way more precise (no more offset by x and y axis)
- Small improvement to pressure advance
- Small improvements to printer.cfg
- Finally got an idea for a changelog and start/end slicer gcode
[0.7.1]
- I’ve removed my testing functions from bed_mesh section, that was awkward
[0.7.2]
- Added input shaper frequencies provided by xenyon
- adjusted the pressure advance but this is not the final value, there are still sharp corners on the models.
- small improvements to slicer end gcode
[0.7.3]
- Added firmware retractions
- Calibrated pid values so the printer will not overshoot temperatures anymore.
- Improved bed calibration algorhitm
- Small unimportant improvements
- Important: bed pid values are calibrated with my bed thermal insulator glued on, but it’s such an essential and at the same time such a cheap upgrade that i recommend everyone either buy one from amazon or aliexpress or just use the default values.
[0.7.3.1]
- Changed start gcode automatically loaded bed mesh from “main” to “default” to avoid confusion
[0.7.3.2]
- Added baud definition in mcu section of printer.cfg because i’ve had problems with it recently
[0.7.3.3]
- Added gcode_arcs section to printer.cfg for arc moves support (G2, G3). @Nemcio
- Added exclude_object section to printer.cfg. Please consider following the instructions to use it.
[0.7.3.4]
- Fixed the virtual sdcard section, it had “/home/zamonary1” absolute path in it (oops) @kosoyamour
[0.7.3.5]
- Changed deprecated “static_value” to “value” in [output_pin enable_pin] section of printer.cfg.
OrcaSlicer profiles (BETA)
They are preconfigured to work with klipper and kobra 2 neo, in the start gcode loaded bed mesh profile is “default”. Use with caution.
OrcaSlicer_PETG.3mf v.1.0 (2.2 MB)
WARNING! You’ll need to calibrate the z offset to avoid damage! You’ll need to figure your value out manually because there is no universal one. The configs are still very experimental so i am not viable for any damage even if done exactly like described here.
Don’t leave your machine completely unattended, especially while drying your filament spools, they might be flammable!
Also, don’t forget to name your bed mesh “default” or change the start gcode.