Skip to main content

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_pin needs to be replaced with the actual motherboard pin. Do not directly copy the PC2 example.

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

ParameterDescription
pause_on_runoutWhether to automatically pause when filament runout is detected
switch_pinFilament sensor signal pin, common format is ^pin or ^!pin
runout_gcodeG-code to execute when filament runout is triggered
insert_gcodeG-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:

FormatUsage
PC2Standard signal input
^PC2Enable pull-up
!PC2Invert trigger state
^!PC2Enable pull-up and invert trigger state

Testing Method

  1. Save the configuration and restart Klipper.
  2. Open the machine status or console on the web interface.
  3. Manually insert and remove the filament, observe if the sensor state changes.
  4. If the state is opposite, modify the ! in switch_pin.
  5. 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...