M591 output or documentation wrong



  • Firmware Name:	RepRapFirmware for Duet 2 WiFi/Ethernet
    Firmware Electronics:	Duet WiFi 1.02 or later
    Firmware Version:	2.0(RTOS)RC2b (2018-05-13b3)
    WiFi Server Version:	1.21
    Web Interface Version:	1.21.1-RC4
    

    I am setting up a simple filament run-out sensor with a microswitch in Normally Open (so that a loose connector also triggers filament run-out).

    GCode documentation states that I should use P2 in this case "2=simple sensor (high signal when filament present)". When I use M591 D0 P2 C3 and then run M591 D0 it outputs

    Simple filament sensor on endstop 3, output high when no filament
    

    when I use P1 it says output low when no filament which is exactly the opposite of what the documentation states.

    Which one is right here?

    P.S.: reading the wiki page regarding filament sensors I start doubting if I have to use M591 here at all for this to work (do I?) but either way there is a problem in output.

    P.P.S.: I just realized I do not have to use M591 to get the trigger setup with M581 to trigger. Does M591 have any use for this setup? I wonder because there are P values that imply some kind of use.


  • administrators

    The documentation was wrong. I have corrected it. Thanks for pointing this out.



  • @dc42 Thanks!

    Could you also have a comment on what use M591 has when using a simple microswitch? Documentation says "The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.". So what does RRF do and when does it do that? (At least on my tests it did nothing while not printing something)


  • administrators

    @wilriker said in M591 output or documentation wrong:

    @dc42 Thanks!

    Could you also have a comment on what use M591 has when using a simple microswitch? Documentation says "The action on detecting a filament error is firmware-dependent, but would typically be to run a macro and/or to pause the print and display a message.". So what does RRF do and when does it do that? (At least on my tests it did nothing while not printing something)

    Filament monitoring in RRF is only active when printing from SD card. The action on a filament error is to pause the print and advise you that there has been a filament error.



  • @dc42 said in M591 output or documentation wrong:

    Filament monitoring in RRF is only active when printing from SD card. The action on a filament error is to pause the print and advise you that there has been a filament error.

    So, basically this is what M581 T1 ... C1 would also do, right?

    EDIT: I also took the liberty to update https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M591_Configure_filament_sensing with your description and replace that generic sentence (that probably has been copied over from http://reprap.org/wiki/G-code#M591:_Configure_filament_sensing) I cited above so in future this will be clear from the start. 🙂


  • administrators

    @wilriker said in M591 output or documentation wrong:

    @dc42 said in M591 output or documentation wrong:

    Filament monitoring in RRF is only active when printing from SD card. The action on a filament error is to pause the print and advise you that there has been a filament error.

    So, basically this is what M581 T1 ... C1 would also do, right?

    Yes, except you will get a message telling you why the print was paused.



  • @dc42 Yeah, you are right. I missed that part because when I tested this yesterday I used T9 and my trigger9.g was just having a single M117 in it so I could see what it does. 😉

    Thanks for clarifying this! 👍



  • @dc42 I think I am confused on terminology here. I finished my sensor setup yesterday. As mentioned in the beginning it is a normally-open sensor, so missing filament and bad cable/connector has the same effect.

    Now, everything is hooked up to E0 endstop, filament is present. I can see the LED for E0 enstop is on (because the switch is now closed). Next I ran M591 D0 P1 C3 which corresponds to output low when no filament or high signal when filament present respectively (depending on output of firmware or documentation - which now is in sync).

    When trying to start a print like this, though, it will immediately pause the print and tell me that filament ran out.
    When I change my config to M581 D0 P2 C3 it works as expected.

    I assumed that a high signal corresponds to a lit LED, doesn't it? I am confused.


  • administrators

    A low signal lights the LED.



  • @dc42 OK, thanks.
    I would have never assumed it to be that way but I can accept it. 😂


Locked
 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.