JustPaste.it

printer.cfg

# For the ZNP Robin Nano DW v2.2 board:
#   - Compile with the processor model STM32F401.
#   - Select the 32KiB bootloader,
#   - Select (Serial (on # USART1 PA10/PA9) for the communication interface.
#   - Select (Serial (on # USART2 PA3/PA2) if you want to use the serial UART pins on J17 (wifi section)
# Note that the "make flash" command does not work with ZNP Robin boards. After running "make", run the following command:
# cp out/klipper.bin out/ZNP_ROBIN_NANO.bin
#
# Copy the file out/ZNP_ROBIN_NANO.bin to an SD card and then restart the printer with that SD card.
# See docs/Config_Reference.md for a description of parameters.

[include timelapse.cfg]
[include KAMP_Settings.cfg]

[exclude_object]

[virtual_sdcard]
path: /home/pi/printer_1_data/gcodes

[gcode_arcs]
resolution: 1.0

[pause_resume]

[display_status]

[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
    TURN_OFF_HEATERS
    CANCEL_PRINT_BASE

[idle_timeout]

[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
    # Parameters
    {% set z = params.Z|default(10)|int %}                                                   ; z hop amount

    {% if printer['pause_resume'].is_paused|int == 0 %}
        SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z}                              ; set z hop variable for reference in resume macro
        SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target}    ; set hotend temp variable for reference in resume macro

        SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0                                  ; disable filament sensor
        SAVE_GCODE_STATE NAME=PAUSE                                                          ; save current print position for resume
        BASE_PAUSE                                                                           ; pause print
        {% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %}       ; check that zhop doesn't exceed z max
            G91                                                                              ; relative positioning
            G1 Z{z} F900                                                                     ; raise Z up by z hop amount
        {% else %}
            { action_respond_info("Pause zhop exceeds maximum Z height.") }                  ; if z max is exceeded, show message and set zhop value for resume to 0
            SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
        {% endif %}
        G90                                                                                  ; absolute positioning
        G1 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_minimum.y+5} F6000   ; park toolhead at front center
        SAVE_GCODE_STATE NAME=PAUSEPARK                                                      ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error)
        M104 S0                                                                              ; turn off hotend
        SET_IDLE_TIMEOUT TIMEOUT=43200                                                       ; set timeout to 12 hours
    {% endif %}

   
[gcode_macro RESUME]
rename_existing: BASE_RESUME
variable_zhop: 0
variable_etemp: 0
gcode:
    # Parameters
    {% set e = params.E|default(2.5)|int %}                                          ; hotend prime amount (in mm)

    {% if printer['pause_resume'].is_paused|int == 1 %}
        SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1                          ; enable filament sensor
        #INITIAL_RGB                                                                    ; reset LCD color
        SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}  ; set timeout back to configured value
        {% if etemp > 0 %}
            M109 S{etemp|int}                                                        ; wait for hotend to heat back up
        {% endif %}
        RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=100                     ; go back to parked position in case toolhead was moved during pause (otherwise the return zhop can error)
        G91                                                                          ; relative positioning
        M83                                                                          ; relative extruder positioning
        {% if printer[printer.toolhead.extruder].temperature >= printer.configfile.settings.extruder.min_extrude_temp %}
            G1 Z{zhop * -1} E{e} F900                                                ; prime nozzle by E, lower Z back down
        {% else %}
            G1 Z{zhop * -1} F900                                                     ; lower Z back down without priming (just in case we are testing the macro with cold hotend)
        {% endif %}
        RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60                          ; restore position
        BASE_RESUME                                                                  ; resume print
    {% endif %}


[mcu]
serial: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0
restart_method: command

[led LED_Light]
white_pin: PB9
initial_white: 1.0

#[output_pin LED_Light] #toggle for LED Light - use this instead of [LED] for sonic pad
#Pin: PB9
#cycle_time: 0.01
#pwm: true
#value: 1

[printer]
kinematics: cartesian
max_velocity: 500
max_accel: 3000
max_z_velocity: 15
max_z_accel: 100
square_corner_velocity: 5
# Use those higher values just to configure Input Shaper
#max_accel: 10000
#max_accel_to_decel: 10000

[stepper_x]
step_pin: !PC12
dir_pin: PB3
enable_pin: !PD2
microsteps: 16
rotation_distance: 40
endstop_pin: PA13
position_endstop: -6.0
position_min: -6
position_max: 235
homing_speed: 50

[stepper_y]
step_pin: PC11
dir_pin: PA15
enable_pin: !PC10
microsteps: 16
rotation_distance: 40
endstop_pin: PB8
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_z]
step_pin: PC7
dir_pin: !PC9
enable_pin: !PC8
rotation_distance: 8
microsteps: 16
position_min: -2
position_max: 280
endstop_pin: probe:z_virtual_endstop # Use Z- as endstop
homing_speed: 5.0


[extruder]
max_extrude_only_distance: 100.0
step_pin: PB10
dir_pin: PB1
enable_pin: !PC6
microsteps: 16
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA6
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC1
min_temp: 0
max_temp: 250
# Calibrate E-Steps https://www.klipper3d.org/Rotation_Distance.html#calibrating-rotation_distance-on-extruders
rotation_distance: 7.808
# Calibrate PID: https://www.klipper3d.org/Config_checks.html#calibrate-pid-settings
#  - Example: PID_CALIBRATE HEATER=extruder TARGET=200
#control = pid
#pid_kp = 30.356
#pid_ki = 1.857
#pid_kd = 124.081
# Calibrate PA: https://www.klipper3d.org/Pressure_Advance.html
pressure_advance = 0.0942
max_extrude_cross_section: 5

[heater_bed]
heater_pin: PA5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC0
pwm_cycle_time: 0.020 # set to 0.0166 if your grid runs on 60Hz to fix lights flickering
max_temp: 110
min_temp: 0
# Calibrate PID: https://www.klipper3d.org/Config_checks.html#calibrate-pid-settings
#  - Example: PID_CALIBRATE HEATER=heater_bed TARGET=60
#control = pid
#pid_kp = 64.230
#pid_ki = 0.723
#pid_kd = 1425.905

[heater_fan hotend_fan]
pin: PB0
heater: extruder
heater_temp: 50.0

[fan]
pin: PA7

[force_move]
enable_force_move: True

[safe_z_home]
home_xy_position: 117.5, 117.5
z_hop: 10

[probe]
pin: ^PA8
speed: 5
lift_speed: 15
samples: 3
x_offset: -28
y_offset: 20
# Calibrate probe: https://www.klipper3d.org/Bed_Level.html
# - Example: PROBE_CALIBRATE, then adjust with TESTZ Z=+/-X
#z_offset = -0.100

[filament_switch_sensor filament_sensor]
pause_on_runout: true
switch_pin: PB4

[bed_mesh]
speed: 80
horizontal_move_z: 5.0
mesh_min: 20,30
mesh_max: 205,205
probe_count: 5,5
algorithm: bicubic
fade_start: 1
fade_end: 0
bicubic_tension: 0.5
#fade_target: 0

[input_shaper]
# Calibrate IS: https://www.klipper3d.org/Resonance_Compensation.html
shaper_type_y = mzv
shaper_freq_y = 38.2
shaper_type_x = ei
shaper_freq_x = 79.6

[temperature_sensor raspberry_pi]
sensor_type: temperature_host
#min_temp: 10
#max_temp: 105

[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
sensor_temperature1: 25
sensor_adc1: 0.210317
#min_temp: 0
#max_temp: 105

[gcode_macro M420]
description: Load the current mesh
gcode:
  BED_MESH_PROFILE LOAD=default

[gcode_macro LIGHT_OFF]
description: turns off the light
gcode:
  SET_LED LED=LED_Light WHITE=0
 
[gcode_macro LIGHT_ON]
description: turns on the light
gcode:
  SET_LED LED=LED_Light WHITE=1

[gcode_macro G29]
description: creates automated homing and bed mesh
gcode:
  G28
  BED_MESH_CALIBRATE
  DATA_SAVE

######################################################################
## Filament Change                                                  ##
######################################################################
# M600: Filament Change. This macro will pause the printer, move the
# tool to the change position, and retract the filament 130mm. Adjust
# the retraction settings for your own extruder. After filament has
# been changed, the print can be resumed from its previous position
# with the "SWAP_RESUME" gcode.
[gcode_macro M600]
description: pause for filament change
gcode:
  PAUSE

#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = 1.504
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 26.119
#*# pid_ki = 1.707
#*# pid_kd = 99.906
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 66.095
#*# pid_ki = 0.922
#*# pid_kd = 1184.760
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*#   0.125000, 0.045833, -0.035000, -0.103333, -0.209167, -0.304167, -0.367500, -0.454167, -0.531667, -0.586667
#*#   0.182500, 0.090000, 0.005000, -0.057500, -0.158333, -0.246667, -0.314167, -0.388333, -0.468333, -0.541667
#*#   0.185000, 0.096667, 0.015833, -0.047500, -0.136667, -0.219167, -0.290000, -0.367500, -0.446667, -0.515000
#*#   0.200000, 0.128333, 0.052500, 0.001667, -0.081667, -0.166667, -0.230000, -0.297500, -0.375000, -0.446667
#*#   0.188333, 0.115833, 0.050833, 0.010833, -0.068333, -0.142500, -0.200833, -0.258333, -0.333333, -0.402500
#*#   0.205000, 0.133333, 0.070000, 0.024167, -0.051667, -0.125000, -0.179167, -0.245000, -0.309167, -0.375000
#*#   0.257500, 0.184167, 0.115000, 0.075833, -0.008333, -0.076667, -0.133333, -0.199167, -0.261667, -0.326667
#*#   0.264167, 0.191667, 0.121667, 0.079167, 0.008333, -0.062500, -0.114167, -0.172500, -0.227500, -0.283333
#*#   0.255833, 0.187500, 0.117500, 0.074167, 0.010833, -0.055833, -0.100000, -0.156667, -0.205000, -0.255833
#*#   0.233333, 0.175833, 0.114167, 0.076667, 0.015833, -0.044167, -0.086667, -0.130833, -0.174167, -0.210833
#*# x_count = 10
#*# y_count = 10
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.1
#*# min_x = 20.0
#*# max_x = 204.95
#*# min_y = 30.0
#*# max_y = 204.96
#*#
#*# [bed_mesh 9-30-24 1.5]
#*# version = 1
#*# points =
#*#   0.187500, 0.068750, -0.052500, -0.155000, -0.313751, -0.456251, -0.551250, -0.681251, -0.797501, -0.880001
#*#   0.273750, 0.135000, 0.007500, -0.086250, -0.237500, -0.370001, -0.471251, -0.582500, -0.702500, -0.812501
#*#   0.277500, 0.145001, 0.023750, -0.071250, -0.205001, -0.328751, -0.435000, -0.551250, -0.670001, -0.772500
#*#   0.300000, 0.192500, 0.078750, 0.002501, -0.122501, -0.250001, -0.345000, -0.446250, -0.562500, -0.670001
#*#   0.282500, 0.173750, 0.076250, 0.016250, -0.102500, -0.213750, -0.301250, -0.387500, -0.500000, -0.603750
#*#   0.307500, 0.200000, 0.105000, 0.036251, -0.077501, -0.187500, -0.268751, -0.367500, -0.463751, -0.562500
#*#   0.386250, 0.276251, 0.172500, 0.113750, -0.012500, -0.115001, -0.200000, -0.298751, -0.392501, -0.490001
#*#   0.396251, 0.287501, 0.182501, 0.118751, 0.012500, -0.093750, -0.171251, -0.258750, -0.341250, -0.425000
#*#   0.383750, 0.281250, 0.176250, 0.111251, 0.016250, -0.083750, -0.150000, -0.235001, -0.307500, -0.383750
#*#   0.350000, 0.263750, 0.171251, 0.115001, 0.023750, -0.066251, -0.130001, -0.196250, -0.261251, -0.316250
#*# min_x = 20.0
#*# max_x = 204.95
#*# min_y = 30.0
#*# max_y = 204.96
#*# x_count = 10
#*# y_count = 10
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.1