Le fichier printer.cfg est le véritable système nerveux de votre imprimante sous Klipper. C'est lui qui orchestre les moteurs, calibre le comportement thermique et dicte la précision de chaque mouvement. Pour ce pfinième chapitre, nous allons adopter une démarche 100% pédagogique. Pas de lignes de commandes complexes ni d'accès SSH : nous allons tout faire confortablement depuis l'éditeur de texte intégré de votre interface Web (Mainsail ou Fluidd). Ensemble, nous allons décortiquer l'existant, comprendre ce qu'il faut garder et restructurer ce fichier pour le rendre évolutif.
Méthode Graphique : Ouvrez simplement l'onglet Configuration (ou l'icône de dossier) sur Mainsail/Fluidd et cliquez sur printer.cfg pour l'ouvrir. Tout notre work d'analyse et de modification se déroule ici.
Comprendre la structure brute générée par OpenNept4une avant d'y toucher. Identifier les blocs vitaux et les lignes superflues.
Maîtriser le rôle des fichiers d'extension (`mainsail`, `fluidd`, `KAMP`) et anticiper leur future organisation dans le système.
Sanctuariser les données lues et écrites dynamiquement par Klipper (Z-Offset, PID) pour éviter tout plantage au démarrage.
1. L'état des lieux : Le fichier printer.cfg d'origine
Voici à quoi ressemble le fichier initial après le déploiement d'OpenNept4une. Utilisez la molette de votre souris dans l'encadré ci-dessous pour faire défiler le code et visualiser sa structure monolithique complète :
#----------------------------------------------------------------------------
# ____ _ __ __ ____
# / __ \___ ___ ___ / |/ /__ ___ / /_/ / /__ _____ ___
# / /_/ / _ \/ -_) _ \/ / -_) _ \/ __/_ _/ // / _ \/ -_)
# \____/ .__/\__/_//_/_/|_/\__/ .__/\__/ /_/ \_,_/_//_/\__/
# /_/ /_/
#----------------------------------------------------------------------------
; Neptune 4 Series Custom Image by (OpenNeptune3D/OpenNept4une):
#----------------------------------------------------------------------------
; Wiki : https://github.com/OpenNeptune3D/OpenNept4une/wiki
; Discord : https://discord.com/invite/X6kwchT6WM
#############################################################################
# External Config Includes
#############################################################################
[include mainsail.cfg] ; mainsail runs on port 81 (http://IP_ADDRESS:81)
[include fluidd.cfg]
[include KAMP_Settings.cfg]
#[include klipper_debug.cfg]
#[include adxl.cfg] ; Comment this out when you disconnect the Pico/MellowFly
#############################################################################
# Base Config
#############################################################################
[mcu]
serial: /dev/ttyS0 ; The hardware use USART1 PA10/PA9 connect to RK3328
baud: 250000
restart_method: command
[printer]
kinematics:cartesian
max_velocity: 250
max_accel: 3000
max_z_velocity: 8
max_z_accel: 120
square_corner_velocity: 5.0
minimum_cruise_ratio: 0.0
[respond]
#[gcode_arcs]
[pause_resume]
[display_status]
[exclude_object]
[firmware_retraction]
[virtual_sdcard]
path: ~/printer_data/gcodes
[force_move]
enable_force_move : True
[idle_timeout]
timeout: 2100 ; 35min idle timeout (when not paused or printing)
#############################################################################
# Print Start & End Macros
#############################################################################
[gcode_macro PRINT_START]
gcode:
Frame_Light_ON
Part_Light_ON
G92 E0
G90 ; Use absolute coordinates
BED_MESH_CLEAR
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set BED_HEAT_SOAK_MINUTES = params.BED_HEAT_SOAK_MINUTES|default(0)|float %}
{% set BED_MESH = params.BED_MESH|default('adaptive')|string %} ; One of: adaptive (default), full, default, none
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(200)|float %}
SET_BED_TEMPERATURE TARGET={BED_TEMP} ; Heat Bed to target temp
BED_TEMPERATURE_WAIT MINIMUM={BED_TEMP-2} MAXIMUM={BED_TEMP+4} ; Waits until the bed reaches close to target
{% if BED_HEAT_SOAK_MINUTES > 0 %}
RESPOND MSG="Waiting {BED_HEAT_SOAK_MINUTES} minutes for the bed to settle."
G4 P{BED_HEAT_SOAK_MINUTES * 60000}
{% endif %}
CG28
{% if BED_MESH == 'full' %}
BED_MESH_CALIBRATE
{% elif BED_MESH == 'adaptive' %}
BED_MESH_CALIBRATE ADAPTIVE=1
{% elif BED_MESH != 'none' %}
BED_MESH_PROFILE LOAD={BED_MESH}
{% endif %}
Smart_Park
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={EXTRUDER_TEMP} ; Set and heat the final extruder temperature
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={EXTRUDER_TEMP-4} MAXIMUM={EXTRUDER_TEMP+10} ; Wait for extruder to reach near target temperature
LINE_PURGE ; KAMP Line Purge near print
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up
M117 Printing
[gcode_macro PRINT_END]
gcode:
Frame_Light_OFF
Part_Light_OFF
M400 ; wait for buffer to clear
TURN_OFF_HEATERS
G92 E0 ; zero the extruder
G91 ; Relative positioning
G1 E-2 F2700 ; Retract a bit
G1 X5 Y5 F3000 ; Wipe out
G1 E-2 Z0.2 F1600 ; Retract and raise Z
G1 Z4 F3000 ; Raise Z more
G90 ; Absolute positioning
G1 X0 Y415 ; Present print
M107 ; turn off fan
M84 ; turn off steppers
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
M117
END_TUNE ; Print End Beeper Jingle
#############################################################################
# Pause, Resume & Cancel Macros
#############################################################################
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
PAUSE_TUNE
{% set z = params.Z|default(30)|int %}
{% if printer['pause_resume'].is_paused|int == 0 %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target|default(220)}
# Store current extruder temperature before cooling
SET_GCODE_VARIABLE MACRO=LOAD_FILAMENT VARIABLE=prev_temp VALUE={printer['extruder'].target|default(220)}
SET_GCODE_VARIABLE MACRO=UNLOAD_FILAMENT VARIABLE=prev_temp VALUE={printer['extruder'].target|default(220)}
# Store Z-hop value for RESUME
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
SAVE_GCODE_STATE NAME=PAUSE
BASE_PAUSE
G91
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %}
G1 E-2 F2700
G1 X3 Y3 F3000
G1 E-2 Z{z} F1600
SAVE_GCODE_STATE NAME=ZLIFT
{% else %}
{ action_respond_info("Pause zhop exceeds maximum Z height.") }
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
G1 E-2 F2700
G1 X3 Y3 F3000
G1 E-2 F1600
SAVE_GCODE_STATE NAME=ZLIFT
{% endif %}
G90
G1 X{printer.toolhead.axis_minimum.x+5} Y{printer.toolhead.axis_maximum.y-5} F6000
SAVE_GCODE_STATE NAME=PAUSEPARK
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=175
SET_IDLE_TIMEOUT TIMEOUT=43200
{% endif %}
[gcode_macro RESUME]
rename_existing: BASE_RESUME
variable_zhop: 0
variable_etemp: 0
gcode:
{% if printer['pause_resume'].is_paused|int == 1 %}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 ; enable filament sensor
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
{% if etemp > 0 %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={etemp|int}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={etemp|int - 4} MAXIMUM={etemp|int + 10} ; wait for hotend to heat back up to print temp
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=100 ; go back to park position in case toolhead was moved during pause
G91 ; relative positioning
M83 ; set extruder to relative mode
G1 E80 F200 ; extrude 80mm of filament to prime the nozzle
G4 P2000 ; wait for 2 seconds to stabilise pressure
G1 X20 F15000 ; wiggle movement to ensure free movement of purge
G1 X-20
G1 X20
G1 X-20
G1 X20
G1 X-20
RESTORE_GCODE_STATE NAME=ZLIFT MOVE=1 MOVE_SPEED=60 ; restore to the zlift position above the print
G1 X-3 Y-3 F3000 ; Undo the pause Wipe out
G1 Z{zhop * -1} F900
RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60 ; restore to the paused position (lowers to final print location)
M400 ; wait for all moves to complete
BASE_RESUME ; resume print
{% endif %}
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
CLEAR_PAUSE
SDCARD_RESET_FILE
PRINT_END
BASE_CANCEL_PRINT
#############################################################################
# Filament Sensor & Change Macros
#############################################################################
[filament_switch_sensor filament_sensor]
pause_on_runout: True
insert_gcode:
M117 Insert Detected
runout_gcode:
M117 Runout Detected
SET_GCODE_VARIABLE MACRO=UNLOAD_FILAMENT VARIABLE=prev_temp VALUE={printer.extruder.target|int}
UNLOAD_FILAMENT
event_delay: 3.0
pause_delay: 1.0
switch_pin: PA12
[delayed_gcode DISABLE_FILAMENT_SENSOR]
initial_duration: 1
gcode:
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
br /> [gcode_macro M600]
description: Pause for colour change
gcode:
PAUSE
[gcode_macro LOAD_FILAMENT]
variable_prev_temp: 0
variable_load_distance: 25
variable_purge_distance: 75
gcode:
{% set target_temp = prev_temp|int or printer.extruder.target|round(0) or 220 %}
{% if prev_temp|int == 0 and printer.extruder.target|round(0) == 0 %}
RESPOND PREFIX="LOAD_FILAMENT" MSG="No temp set — defaulting to {target_temp}°C"
{% endif %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={target_temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={target_temp - 4} MAXIMUM={target_temp + 40}
{% set speed = params.SPEED|default(300) %}
{% set max_vel = printer.configfile.settings.extruder.max_extrude_only_velocity * 30 %}
SAVE_GCODE_STATE NAME=load_state
G91
G92 E0
G1 E{load_distance} F{max_vel}
G1 E{purge_distance} F{speed}
RESTORE_GCODE_STATE NAME=load_state
[gcode_macro UNLOAD_FILAMENT]
variable_prev_temp: 0
variable_unload_distance: 75
variable_purge_distance: 15
gcode:
{% set target_temp = prev_temp|int or printer.extruder.target|round(0) or 220 %}
{% if prev_temp|int == 0 and printer.extruder.target|round(0) == 0 %}
RESPOND PREFIX="UNLOAD_FILAMENT" MSG="No temp set — defaulting to {target_temp}°C"
{% endif %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={target_temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={target_temp - 4} MAXIMUM={target_temp + 40}
{% set speed = params.SPEED|default(300) %}
{% set max_vel = printer.configfile.settings.extruder.max_extrude_only_velocity * 30 %}
SAVE_GCODE_STATE NAME=unload_state
G91
G92 E0
G1 E{purge_distance} F{speed}
G1 E-{unload_distance} F{max_vel}
RESTORE_GCODE_STATE NAME=unload_state
{% if printer['pause_resume'].is_paused|int == 1 %}
G4 P3000 ; wait 3 s before cooling
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=175
{% endif %}
#############################################################################
# X/Y/Z Stepper Config
#############################################################################
[stepper_x]
step_pin: PC14
dir_pin: PC13
enable_pin: !PC15
microsteps: 16
rotation_distance: 40
full_steps_per_rotation:200 ; set to 400 for 0.9 degree stepper
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_min: -2
position_endstop: 0
position_max: 430
homing_speed: 50
homing_retract_dist: 0
homing_positive_dir: false
[stepper_y]
step_pin: PB4
dir_pin: PB3
enable_pin: !PC15
microsteps: 16
rotation_distance: 40
full_steps_per_rotation:200 ; set to 400 for 0.9 degree stepper
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_min: -2
position_endstop: 0
position_max: 430
homing_speed:50
homing_retract_dist: 0
homing_positive_dir:false
[stepper_z]
step_pin: PC10
dir_pin: !PA13
enable_pin: !PC11
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 200
endstop_pin:probe:z_virtual_endstop
position_max: 505
position_min: -5
homing_speed: 8
second_homing_speed: 3
homing_retract_dist: 5
#############################################################################
# TMC Stepper-driver UART Config
#############################################################################
[tmc2209 stepper_x]
uart_pin: PB9
run_current: 1.0
interpolate: True
stealthchop_threshold: 999999 ; Remis d'origine (Mode Silencieux active)
driver_SGTHRS: 90
diag_pin: ^PC0
[tmc2209 stepper_y]
uart_pin: PD2
run_current: 1.1
interpolate: True
stealthchop_threshold: 999999 ; Remis d'origine (Mode Silencieux active)
driver_SGTHRS: 80
diag_pin: ^PB8
[tmc2209 stepper_z]
uart_pin: PC5
run_current: 0.8
interpolate: True
[tmc2209 extruder]
uart_pin: PC4
run_current: 0.8
interpolate: false
#############################################################################
# Extruder Config
#############################################################################
[extruder]
step_pin:PA5
dir_pin:!PA6
enable_pin:!PA4
microsteps: 16
rotation_distance: 28.888 ; 31.4 Bondtech 5mm Drive Gears
gear_ratio: 52:10
full_steps_per_rotation: 200 ; 200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.400
filament_diameter: 1.750
min_temp: 0
max_temp: 330
heater_pin: PA7
sensor_type:NTC 100K MGB18-104F39050L32
sensor_pin: PA1
max_power: 1
control = pid
pid_kp = 25.718
pid_ki = 3.297
pid_kd = 50.150
pressure_advance: 0.02725
pressure_advance_smooth_time: 0.02
max_extrude_cross_section: 5 ; standard klipper default 4* (NozzleDiam^2)
instantaneous_corner_velocity: 5.0
max_extrude_only_distance: 100
max_extrude_only_velocity:45
max_extrude_only_accel:2000
step_pulse_duration:0.000002
[verify_heater extruder]
max_error: 30
check_gain_time: 10
hysteresis: 10
heating_gain: 2
#############################################################################
# Bed Heater Config
#############################################################################
[heater_bed]
heater_pin:PB10
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin: PA0
max_power: 1.0
control = pid
pid_kp = 75.397
pid_ki = 0.823
pid_kd = 1727.531
min_temp: 0
max_temp: 120
pwm_cycle_time: 0.3
[verify_heater heater_bed]
max_error: 120
check_gain_time: 120
hysteresis: 10
heating_gain: 2
[gcode_macro SET_BED_TEMPERATURE]
gcode:
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={params.TARGET}
[gcode_macro BED_TEMPERATURE_WAIT]
gcode:
{% if params.MINIMUM is defined and params.MAXIMUM is defined %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={params.MINIMUM} MAXIMUM={params.MAXIMUM}
{% elif params.MINIMUM is defined %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={params.MINIMUM}
{% elif params.MAXIMUM is defined %}
TEMPERATURE_WAIT SENSOR=heater_bed MAXIMUM={params.MAXIMUM}
{% else %}
RESPOND TYPE=error MSG="Error on 'BED_TEMPERATURE_WAIT': missing MINIMUM or MAXIMUM."
{% endif %}
#############################################################################
# Probe Config
#############################################################################
[probe]
pin:^PA11
x_offset: -24.25
y_offset: 20.45
#z_offset = 0.0
speed: 6.0
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.025
samples_tolerance_retries: 3
[bed_mesh]
speed: 150
horizontal_move_z: 5
mesh_min: 10, 21
mesh_max: 397, 404
probe_count: 11, 11 ; Remis d'origine (Grille Haute Densite)
algorithm: bicubic
bicubic_tension: 0.2
mesh_pps: 4, 4 ; Remis d'origine (Interpolation de precision)
fade_start: 1.0
fade_end: 10.0
#############################################################################
# LED Config
#############################################################################
[output_pin Frame_Light]
pin: rpi:gpiochip2/gpio2
[output_pin Part_Light]
pin: rpi:gpiochip2/gpio15
[gcode_macro Frame_Light_ON]
gcode:
SET_PIN PIN=Frame_Light VALUE=1
[gcode_macro Frame_Light_OFF]
gcode:
SET_PIN PIN=Frame_Light VALUE=0
[gcode_macro Part_Light_ON]
gcode:
SET_PIN PIN=Part_Light VALUE=1
[gcode_macro Part_Light_OFF]
gcode:
SET_PIN PIN=Part_Light VALUE=0
#############################################################################
# Beeper Config
#############################################################################
[pwm_cycle_time beeper]
pin: PA2
value: 0
shutdown_value: 0
cycle_time: 0.0005 ; Default PWM frequency: 2 kHz
[gcode_macro M300]
gcode:
{% set S = params.S|default(2000)|int %} ; Set frequency (S), default to 2 kHz if omitted or invalid
{% set P = params.P|default(100)|int %} ; Set duration (P), default to 100ms if omitted or invalid
SET_PIN PIN=beeper VALUE=0.8 CYCLE_TIME={ 1.0/S if S > 0 else 1 } ; Activate the beeper at a 80% duty cycle
G4 P{P} ; Hold the beep for the specified duration
SET_PIN PIN=beeper VALUE=0 ; Turn off the beeper
[gcode_macro PAUSE_TUNE]
gcode:
M300 S784 P300
M300 S587 P600
[gcode_macro END_TUNE]
gcode:
M300 S392 P250
M300 S494 P250
M300 S587 P250
M300 S523 P300
#############################################################################
# Fan & Temp Monitoring Config
#############################################################################
[controller_fan heatbreak+mainboard_fan]
pin: PC7
fan_speed: 1.0
idle_speed: 0.8
idle_timeout: 43200 ; 50% speed for 12h then OFF
shutdown_speed: 1
heater: extruder, heater_bed
stepper: stepper_x, stepper_y, stepper_z, extruder
[fan]
pin: PB7
[fan_generic fan3]
pin: PC9
[fan_generic fan4]
pin: PA8
[fan_generic fan5]
pin: PA15
[delayed_gcode start_fan_at_idle_speed]
initial_duration: 5. ; 5s wait after boot
gcode:
# Gcode Hack to trigger the mainboard fan from printer boot
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=1 ; bed heat to 1degC
G4 P2000 ; wait 2s
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=0 ; bed heat off
[temperature_sensor RockchipHost]
sensor_type: temperature_host
min_temp: 10
max_temp: 80
[temperature_sensor STM32MCU]
sensor_type: temperature_mcu
min_temp: 10
max_temp: 85
#############################################################################
# Homing & Levelling Config/Macros
#############################################################################
[gcode_macro CG28]
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% else %}
{% endif %}
[safe_z_home]
home_xy_position: 239.75,194.55
speed: 100
z_hop: 10
z_hop_speed: 5
[axis_twist_compensation]
calibrate_start_x: 25
calibrate_end_x: 395
calibrate_y: 210
[gcode_macro Axis_Twist_Comp_Tune]
gcode:
CG28
AXIS_TWIST_COMPENSATION_CALIBRATE
[screws_tilt_adjust]
screw1: 239.25,254.55
screw1_name: middle-rear bed mount (shim adjust)
screw2: 239.25,134.55
screw2_name: middle-front bed mount (shim adjust)
screw3: 56.75,377.05
screw3_name: rear left screw
screw4: 56.75,194.55
screw4_name: center left screw
screw5: 56.75,12.05
screw5_name: front left screw
screw6: 421.75,12.05
screw6_name: front right screw
screw7: 421.75,194.55
screw7_name: center right screw
screw8: 421.75,377.05
screw8_name: rear right screw
horizontal_move_z: 5
speed: 150
screw_thread: CW-M4
[gcode_macro Bed_Level_Screws_Tune]
gcode:
BED_MESH_CLEAR
{% set current = printer.heater_bed.target|round(0) %}
{% set target = current or 60 %}
{% if current == 0 %}
RESPOND PREFIX="Bed_Level_Screws_Tune" MSG="No bed target, heating to {target} °C"
SET_BED_TEMPERATURE TARGET={target}
{% else %}
RESPOND PREFIX="Bed_Level_Screws_Tune" MSG="Waiting for bed to reach {target} °C"
{% endif %}
BED_TEMPERATURE_WAIT MINIMUM={target - 2} MAXIMUM={target + 5}
CG28
SCREWS_TILT_CALCULATE
[gcode_macro Calibrate_Probe_Z_Offset]
gcode:
CG28
PROBE_CALIBRATE
[gcode_macro Auto_Full_Bed_Level]
gcode:
RESPOND PREFIX="info" MSG="Running Custom Bed Leveling Macro"
BED_MESH_CLEAR
SET_BED_TEMPERATURE TARGET=60
BED_TEMPERATURE_WAIT MINIMUM=58 MAXIMUM=65
CG28
BED_MESH_CALIBRATE
#############################################################################
# PID Tuning Macros
#############################################################################
[gcode_macro PID_Tune_EXTRUDER]
gcode:
{% set temperature = params.TEMPERATURE|default(210) %}
CG28
M106 S255
PID_CALIBRATE HEATER=extruder TARGET={temperature}
SAVE_CONFIG
[gcode_macro PID_Tune_BED]
gcode:
{% set temperature = params.TEMPERATURE|default(60) %}
CG28
M106 S255 ;Sets Print Fans to 100%
PID_CALIBRATE HEATER=heater_bed TARGET={temperature}
SAVE_CONFIG
#############################################################################
# SPI Accelerometer Config
#############################################################################
[mcu rpi]
serial: /tmp/klipper_host_mcu
#[adxl345 x]
#cs_pin: rpi:None
#spi_bus: spidev0.0
#axes_map:x,z,-y
#[adxl345 y]
#cs_pin: rpi:None
#spi_bus: spidev0.1
#axes_map:-x,-y,-z
#[resonance_tester]
#accel_chip_x: adxl345 x
#accel_chip_y: adxl345 y
#probe_points:
# 215, 215, 20
#############################################################################
# Input Shaper Config
#############################################################################
[input_shaper]
shaper_type_x: zv
shaper_freq_x: 116.2
shaper_type_y: zv
shaper_freq_y: 38.8
#############################################################################
[include user_settings.cfg] ; Users custom macros
#############################################################################
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*# [probe]
#*# z_offset = 0.600
2. Ce que l'on garde dans le fichier principal et pourquoi
Pour bâtir notre architecture en cascade, nous avons opéré un nettoyage en profondeur. Cependant, certaines sections vitales doivent impérativement rester ancrées au cœur de votre fichier racine printer.cfg. Ces blocs constituent les liaisons système profondes de votre machine ; tenter de les déporter compliquerait l'initialisation de Klipper ou le diagnostic en cas de panne.
Voici la logique de notre tri sélectif :
- Le retrait de mainsail.cfg & fluidd.cfg : Contrairement aux configurations d'origine, nous ne gardons pas ces inclusions d'interface web directement dans notre entête. Ces fichiers tiers sont désormais encapsulés et gérés de manière transparente en arrière-plan. Cela évite les redondances de directives, purifie la lecture du fichier maître et élimine tout risque de conflit.
- KAMP_Settings.cfg : Il s'agit du module de maillage adaptatif intelligent (Klipper Adaptive Mesh & Purge). Pour l'heure, cet appel reste situé à la racine de votre arborescence. Notez-le bien : lors de nos prochains chapitres, nous modifierons son emplacement pour le ranger proprement dans un sous-dossier dédié nommé "Macros", afin de parfaire la clarté de notre système.
- Les liaisons matérielles physiques ([mcu] & [mcu rpi]) : Ces blocs définissent la communication matérielle essentielle. Le bloc
[mcu]gère la liaison série physique (/dev/ttyS0) avec la puce de la carte mère d'usine, tandis que le bloc[mcu rpi]gère le micro-contrôleur hôte virtuel (Orange Pi / Rockchip). Klipper doit obligatoirement charger et valider ces liaisons dès la première milliseconde de son démarrage pour pouvoir exister ; ils ne peuvent donc aller nulle part ailleurs. - Où est passée la section [printer] (Cinématique et limites) ? C'est ici que notre architecture prend tout son sens. Les limites de vitesse, d'accélération et la taille du plateau étant indissociables de la structure physique de la machine, nous les avons sorties du fichier central. Elles seront logées dans un bloc matériel dédié. Pourquoi ? Pour que votre fichier principal reste universel. Si demain vous adaptez cette architecture sur une Neptune 4 standard (au plateau plus petit), votre fichier maître restera inchangé : seul le bloc matériel pivotera.
- Les services et fonctionnalités natifs de Klipper : Les déclarations comme
[respond],[exclude_object](indispensable pour annuler une pièce ratée sur un plateau de groupe),[virtual_sdcard]pour la gestion des fichiers G-code locaux, ou encore[idle_timeout](qui coupe la chauffe après 35 min d'inactivité) sont des extensions de bas niveau directement liées au démon Klipper. Leur place reste légitimement dans le tronc commun. - Le monitoring thermique ([temperature_sensor]) : La surveillance thermique en temps réel de l'hôte Rockchip et du processeur de la carte mère reste déclarée à la racine. C'est une sécurité matérielle essentielle pour garder un œil constant sur la santé de l'électronique embarquée dans la base de l'imprimante.
La stratégie ZEW : En isolant strictement les services profonds au sein du fichier principal et en externalisant les spécificités mécaniques, nous obtenons un printer.cfg d'une stabilité absolue, lisible au premier coup d'œil, et prêt à évoluer vers n'importe quelle machine de la gamme.
3. Le résultat final : Votre printer.cfg structuré
Voici l'architecture propre et définitive que doit adopter votre fichier principal. Notez l'introduction de la ligne [include user_settings.cfg] : placée stratégiquement tout en bas, elle garantit que vos réglages et macros écraseront par défaut toutes les configurations d'usine pré-existantes.
Rappel crucial : Le bloc SAVE_CONFIG tout en bas reste géré à 100% par la machine. Ne tapez jamais rien à l'intérieur ni en dessous de lui sous peine de corrompre le démarrage de Klipper.
#############################################################################
#############################################################################
# ZEW-Neptune4Max V1.0 | MAIN PRINTER CONFIGURATION
# -------------------------------------------------------------------------
# MODULE : CENTRAL HUB (printer.cfg)
# FUNCTION : Hardware Integration, MCU Orchestration & Global Features
# DESIGNED BY : Frédéric IMBERT
# VERSION : 1.0.1 (2026-05-21)
# STATUS : PRODUCTION / STABLE
#############################################################################
#############################################################################
#############################################################################
# MODULAR CONFIGURATION (INCLUDES)
#############################################################################
[force_move]
enable_force_move: True
# A venir ....
#############################################################################
# BASE CONFIG (MCU & PRINTER)
#############################################################################
# --- MAIN MCU (STM32) ---
[mcu]
serial: /dev/ttyS0
baud: 250000
restart_method: command
# --- HOST MCU (Orange Pi / Rockchip) ---
[mcu rpi]
serial: /tmp/klipper_host_mcu
#############################################################################
# KLIPPER SERVICES & FEATURES
#############################################################################
[respond]
[gcode_arcs]
[pause_resume]
[display_status]
[exclude_object]
[firmware_retraction]
[virtual_sdcard]
path: ~/printer_data/gcodes
[idle_timeout]
timeout: 2100 # 35min of inactivity before shutdown
#############################################################################
# TEMPERATURE MONITORING (HOST & MCU)
#############################################################################
[temperature_sensor Rockchip_Host]
sensor_type: temperature_host
min_temp: 10
max_temp: 80
[temperature_sensor STM32_MCU]
sensor_type: temperature_mcu
min_temp: 10
max_temp: 85
#############################################################################
# ADDITIONAL USER SETTINGS
#############################################################################
# --- PERSISTENCE ---
[include user_settings.cfg]
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
Une fois ces modifications ajustées directement dans l'interface, cliquez sur le bouton **"Save & Restart"** en haut à droite de votre écran. Votre hub central est désormais prêt à accueillir le prochain gros morceau : la configuration du cœur même de votre machine.
Votre architecture en cascade est désormais en place via l'interface web. Dans le prochain chapitre de notre série, nous allons franchir un cap majeur en exploitant ce point d'ancrage pour concevoir notre gestionnaire de macros et notre sélecteur de maillage de précision. Restez connectés !