Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Conditional Gcode question

    Beta Firmware
    2
    3
    102
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • nikscha
      nikscha last edited by

      I want to extrude filament until my filament sensor triggers. I know there is a way where i use the sensor as an endstop, but i would like to know how to do it using conditional gcode. Something like this maybe?:

      while !sensors.filamentsensor.trigger
          G1 E1
      

      (not sure about the syntax/names)
      As far as i can tell, this wont result in a smooth motion though.

      1 Reply Last reply Reply Quote 0
      • OwenD
        OwenD last edited by OwenD

        What's your use case?
        Can't see why it wouldn't process just as fast as any other G Code, but it wouldn't be synchronous with any other moves.
        I don't have a filament monitor, but I presume it will have a triggered state value
        Edit: Just checked and it's "filamentPresent"

        I'd try

        while sensors.filamentMonitors[0].filamentPresent
              G1 E1
              M400 ; wait for move to complete
        

        This assumes you only have one filament monitor or want to check the first one. (index 0)
        The M400 may be needed to stop a case of many moves being queued before the trigger

        1 Reply Last reply Reply Quote 0
        • OwenD
          OwenD last edited by

          You could have the problem that filament monitoring is only active when printing from teh SD card
          https://duet3d.dozuki.com/Wiki/Gcode#Section_M591_Configure_filament_sensing

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA