TriangleLab filament runout sensor with Duet

Discussion in 'Guides, Mods, and Upgrades' started by Duncan Chivers, Apr 19, 2020.

  1. Duncan Chivers

    Duncan Chivers Well-Known Member

    Joined:
    Apr 19, 2016
    Messages:
    138
    Likes Received:
    7
    Hi All, hope everyone is well in these odd times.

    I've just ordered a TriangleLab filament rumour sensor -
    https://www.amazon.co.uk/TriangleLab-Filament-Runout-Detector-Printer/dp/B07DHD8WHF

    Has anyone used one of these or similar? Specifically I've got a duet ethernet board now, so also looking for tips with that. Pretty sure it needs to go into E0 or E1, but not too sure what needs adding to the config.g so that it pauses a print when it gets triggered?

    I have a gantry printed at the back to hold the cabling up and out of the way, so I'm thinking of attaching it to that.

    :)
     
  2. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,560
    Likes Received:
    483
    That looks like a nice simple switch. If there's filament, the switch is closed, and if the filament runs out, the switch will open. There are probably numerous ways to get the desired effect. I'm not sure if RRF provides specific runout-sensor definitions, but in any case, you could simply define the input switch that you connect this to using M950, than connect that input pin to a trigger. In the example below, I have a joystick button mounted on the back of printer which I can hit in order to reset the machine; my panic button. Here you can see that I've connected this to e2stop on the duex, than mapped that to trigger 2, which then executes trigger2.g when the switch is closed. Trigger2.g then simply contains M999. You might need to define this slightly differently for a normally closed switch, possibly defining the pin as !duex.e2stop, and/or changing the S parameter in the second line for S1.

    Code:
    M950 J1 C"duex.e2stop"   ; Define Input J1 for pin duex.e2stop
    M581 P1 S1 T2 C0       ; Connect Input J1 (P1) to trigger 2 (T2) always (C0) for inactive to active (S1 - also default)
    
    Your trigger2.g needs to trigger a pause, probably using M226 (https://duet3d.dozuki.com/Wiki/Gcode#Section_M226_Gcode_Initiated_Pause)
     
  3. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,560
    Likes Received:
    483
  4. Duncan Chivers

    Duncan Chivers Well-Known Member

    Joined:
    Apr 19, 2016
    Messages:
    138
    Likes Received:
    7
    Thanks, that looks pretty straightforward, I don't have a duex so it'll be going straight into the Duet.

    I chose this one because it seems to be the only mechanical one that has a roller on the switch, so the friction on the filament is going to be minimised.

    My goal is to use up all of those 'ends of spools' that inevitably build up, without having to keep checking back. It's especially annoying because I use an enclosed spool holder (the one by Spannerhands on Thingiverse), and it hangs on the wall behind the printer.
    First world problems! :D
     
  5. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,560
    Likes Received:
    483
    Do report back. Tempted to try it out too. The more advanced ones will also detect jams by comparing requested motion with detected motion, but the switch variety is simply - is it there or not.
     
  6. Duncan Chivers

    Duncan Chivers Well-Known Member

    Joined:
    Apr 19, 2016
    Messages:
    138
    Likes Received:
    7
    Will do. Plenty of time for testing at the moment!
     
  7. Duncan Chivers

    Duncan Chivers Well-Known Member

    Joined:
    Apr 19, 2016
    Messages:
    138
    Likes Received:
    7
    So it turned out to be even easier than first thought!

    I had to fiddle with the wiring a bit to begin with because (as it turns out) the connector that comes with it isn't wired up correctly. Or at least for the one I got.

    Once I had moved a wire, so that the left and middle pins were connected on the sensor, I hooked it up to the two outer pins on E0.

    It then took a single line of code in config.g which was

    M591 D0 P1 C3 S1

    This is extruder 0, hi when present, position E1 on the board, and S1 is for filament monitoring.

    So now endstop 3 shows a 'yes' when filament is present, and a 'no' when it's not.

    But best of all, if it runs out and gets triggered it automatically pauses the print, I didn't have to add anything else to get it to happen! :D
    The display shows "Extruder 0 reports no filament" and you can safely resume once more has been loaded.

    Absolute genius, and yet another reason why the Duet board is a revelation!

    So the next question (which I have no idea whether it's even possible) is can DWC send a push notification when it pauses ... ? o_O
     
  8. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,560
    Likes Received:
    483
    It could do at least two kinds of notification. Simple one would be to put in a bleep sounds into the pause.g code. Try this in the DWC console to test:

    M300 S375 P750

    If you want something more complex, you'll need to look on the Duet forums. You can send a message to a pin, pick that up with a Pi, for example, then relay that into an email, or anything else you want to craft.
     
  9. Mrfixit718

    Mrfixit718 New Member

    Joined:
    May 15, 2020
    Messages:
    1
    Likes Received:
    0
    hey I have the same setup I'm installing it on my duet 2 WiFi can you describe the wiring in more detail for me you connected it to the end stop but what did you use for power ? On my sensor it has the red blue black wires going into it from left to right thanks for your help
     

Share This Page