Skip to main content

Site Navigation

Your Account

Choose Language

Connecting and configuring filament-out sensors

If your printer knows when it has run out of filament, it can abort the job, or it can pause while you load new filament. To do this the printer needs to have a filament-out sensor attached. These come in two types: simple switches that detect the presence of filament, or sensors that detect the motion of the filament.

Firmware 1.19 and later

RepRapFirmware supports a variety of different filament presence and motion sensors using the M591 Gcode:

Pnn Type of sensor:

  • 0=none,
  • 1=simple sensor (high signal when filament present)
  • 2=simple sensor (low signal when filament present)
  • 3=Duet3D rotating magnet sensor
  • 4=Duet3D rotating magnet sensor with microswitch
  • 5 = Duet3D laser sensor
  • 6 = Duet3D laser sensor with microswitch
  • 7 = pulse-generating sensor

See the M591 Gcode for full configuration information.

There are two Duet3D products for precise motion detection with direction:

Firmware 1.18 and earlier

You can arrange for a simple switch to trigger user-defined actions:

The first step is to connect the switch to an unused endstop connector on the Duet 2. Note that the Duet uses a separate connector for Z probes, and it has five endstop connectors (X, Y, Z, E0, and E1).

To make the firmware run a script when the filament runs out, use M581 to associate the endstop you chose with a "trigger". Trigger 0 is an emergency stop (probably not what you want), trigger 1 pauses the print (running pause.g), and otherwise trigger n runs the file triggern.g., which you can write yourself.

Finally, the trigger only happens when the endstop changes state. If you try to start a print with the filament out, the trigger won't happen. So add M582 to the start of your prints to check the filament state and run the trigger if there's no filament.

One Comment

How exactly does this work, could you make a video tutorial?

RAVON - Reply

Add Comment

View Statistics:

Past 24 Hours: 6

Past 7 Days: 84

Past 30 Days: 474

All Time: 8,643