Limit switch for filament runout



  • I want to add a basic limit switch style filament sensor to my duet wifi 2.

    The switch is called "trianglelab filament sensor"
    This switch is OPEN when filament is not present, CLOSED when filament is loaded.

    I want to double check if my code is correct:

    ; Filament sensor
    M591 P2 C"e0stop" S1 D0
    

    Do I need to add code anywhere else? If it senses a filament out, will it enter into "pause" mode, similar to when I press the "pause print" button?

    Based on this guide:
    https://duet3d.dozuki.com/Wiki/Connecting_and_configuring_filament-out_sensors

    It says "S1" will enable filament sensing when printing from SD card. I normally print by uploading to the ip address on the browser "upload and print" button. Is this also considered as printing from SD card?

    I plan to put this above my heater parameters in config.g

    ; Heaters
    M308 S0 P"spi.cs2" Y"rtd-max31865"            ; configure sensor 0 as thermocouple via CS pin spi.cs2
    M950 H0 C"bedheat" T0                         ; create bed heater output on bedheat and map it to sensor 0
    M143 H0 S120                                  ; set temperature limit for heater 0 to 120C
    M307 H0 B0 S1.00                              ; disable bang-bang mode for the bed heater and set PWM limit
    M140 H0                                       ; map heated bed to heater 0
    M308 S1 P"e0temp" Y"thermistor" T100000 B4138 ; configure sensor 1 as thermistor on pin e0temp
    M950 H1 C"e0heat" T1                          ; create nozzle heater output on e0heat and map it to sensor 1
    M143 H1 S280                                  ; set temperature limit for heater 1 to 280C
    M307 H1 B0 S1.00                              ; disable bang-bang mode for heater  and set PWM limit
    
    

    Thank you



  • Update:
    When measuring GND and Sensor I get:
    NO filament = 3.3V
    Filament loaded = 1.3V

    When I set:
    M591 P2 C"e0stop" S1 D0
    I can start the print and correctly trigger the sensor when I remove filament from sensor. However, once I add the filament back, it will not detect a loaded filament anymore.

    I am guessing 1.3V is still too high for it to be considered as low?


  • Moderator

    @likevvii said in Limit switch for filament runout:

    It says "S1" will enable filament sensing when printing from SD card. I normally print by uploading to the ip address on the browser "upload and print" button. Is this also considered as printing from SD card?

    Yes that is printing from the internal SD card.



  • Final Update:

    The only way I got it to work was to ignore the LED function of the limit switch PCB.

    Just treat it as a pure limit switch. No LED.
    Wire it in a way where the switch would connect GND and SIG.
    Where 3.3V is supposed to go in the limit switch is where ground would be.
    Disconnect the 3.3V wire from the Duet side.

    M591 P1 C"e0stop" S1 D0
    


  • "I am guessing 1.3V is still too high for it to be considered as low?"
    @likevvii

    This is true, I went through a process to hand select a protection diode out of a set for my induction probe to get the off down to 1.1V for a constant responsive low reading (Duet Wifi V1.2)


Log in to reply