UNSOLVED Filament Sensor Trigger

  • I am using M581 as an external trigger for a filament sensor (mechanical endstop).
    The problem is that (I think) I am having a mini pulse signal while it is printing and the filament sensor thinks that it is run out but that is not true. Is it possible to include a delay or something similar before getting triggered? I have also tried to configure with M591 S1 and the same.

    I think that maybe if I introduce a timer before it gets triggered, we can correct this step.
    I prefer to use M581 to show specific messages and also to be able to retract the material ones it is triggered because there is no more filament (when really is not more filament).

    I am using version 3.1.1 duet2 wifi.

    Many thanks in advance!


  • administrators

    @Aitor something you could try is uchecking within the trigger2.g to check if this pin is still triggered by the time the firmware has executed trigger.g

    You would need to use conditional gcode with an if statement to check the state of the pin and then either message the user an pause the print, or just continue printing.

    I will defer to @dc42 for the exact sensors.gpio[0] etc query needed.

  • i believe with M950 J1 C"e0stop" and M581 P1 T2 R1 the condition becomes if sensors.gpIn[1].value = 1 as no S in M581 defaults to S1

  • I have done what you told me and it has worked for me even better than I expected

    Where can I find more information about this type of command?

    I don't really understand what I'm doing here {sensors.gpIn[1].value = 1}
    Basically you are looking at a sensor output and see that the result is equal to 1? Is there any listing of the name of the outputs of the board? I am preparing an IDEX machine and it will have another sensor output, I suppose it would be something like this if {sensors.gpIn[2].value = 1}

    ;Filament Sensor
    G4 S10
    if {sensors.gpIn[1].value = 1} ;
    		M25 ;
    		M291 R "Pause" P "No filament presence detected" S3 T0 ;
    M300 S300 P1000

  • Sorry @bearer Where can I find more information about this type of command? if sensors.gpIn[1].value = 1

  • https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands and generally searching for conditional gcode on the forum.

Log in to reply