Filament Runout Sensor
Function Description
The filament runout sensor is used to pause printing when filament runs out, breaks, or the sensor state changes. In Klipper, [filament_switch_sensor] is commonly used to configure a switch-type filament detection module.
Notes
- After initial configuration, first check the sensor status in the console before starting a test print.
- The sensor trigger logic may be opposite depending on the wiring method. Use
!to adjust the pin state. switch_pinneeds to be replaced with the actual motherboard pin. Do not directly copy thePC2example.
Basic Configuration
printer.cfg
[filament_switch_sensor Filament Monitor]
pause_on_runout: True
switch_pin: ^PC2
runout_gcode:
M118 Filament runout, pausing print
insert_gcode:
M118 Filament restored
Parameter Description
| Parameter | Description |
|---|---|
pause_on_runout | Whether to automatically pause when filament runout is detected |
switch_pin | Filament sensor signal pin, common format is ^pin or ^!pin |
runout_gcode | G-code to execute when filament runout is triggered |
insert_gcode | G-code to execute when filament is restored or reinserted |
Pin State Adjustment
If the sensor state is opposite to the actual state, modify switch_pin:
printer.cfg
# When showing triggered when not triggered, try adding or removing !
switch_pin: ^!PC2
Common formats:
| Format | Usage |
|---|---|
PC2 | Standard signal input |
^PC2 | Enable pull-up |
!PC2 | Invert trigger state |
^!PC2 | Enable pull-up and invert trigger state |
Testing Method
- Save the configuration and restart Klipper.
- Open the machine status or console on the web interface.
- Manually insert and remove the filament, observe if the sensor state changes.
- If the state is opposite, modify the
!inswitch_pin. - After confirming the state is correct, proceed with the print pause test.
Configuration with Filament Change Prompt
printer.cfg
[filament_switch_sensor filament_sensor]
pause_on_runout: True
switch_pin: ^!PC2
runout_gcode:
M118 Filament runout detected, print paused
insert_gcode:
M118 Filament detected, please confirm extrusion is normal before resuming printing
Tip
If using a filament sensor with clog detection, additional motion detection or plugin features may need to be configured according to the product documentation. The standard [filament_switch_sensor] can only determine the switch state.
Loading...