• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Conditional GCode

Scheduled Pinned Locked Moved
General Discussion
6
10
1.3k
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.
  • undefined
    Garfield
    last edited by 29 Dec 2019, 13:08

    Can conditional statements be included in gcode as they can in Marlin ?

    for instance this is run at the end of a print on my Prusa to move the extruder / hot end up and away from the last line printed - but it takes account of where on the Z axis the print completes and if less than max print height moves to either Z+30 or max print height.

    {if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up

    I ask since search produces nothing definitive for RepRap other than it was being developed.

    1 Reply Last reply Reply Quote 0
    • undefined
      Danal
      last edited by 29 Dec 2019, 13:10

      Not yet. Coming in a release of V3. From a few things the primary developer, @DC42, has said, coming relatively soon (next few months??)

      Delta / Kossel printer fanatic

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User
        last edited by 29 Dec 2019, 13:13

        As pointed out, comming "soon". Maybe follow this thread? https://forum.duet3d.com/topic/13516/conditional-gcode-and-object-model-variables/25

        1 Reply Last reply Reply Quote 0
        • undefined
          Garfield
          last edited by 29 Dec 2019, 13:24

          Followed .... hadn't found that one.

          1 Reply Last reply Reply Quote 0
          • undefined
            tekkydave
            last edited by tekkydave 29 Dec 2019, 13:29

            @Garfield said in Conditional GCode:

            Can conditional statements be included in gcode as they can in Marlin ?

            for instance this is run at the end of a print on my Prusa to move the extruder / hot end up and away from the last line printed - but it takes account of where on the Z axis the print completes and if less than max print height moves to either Z+30 or max print height.

            {if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up

            I ask since search produces nothing definitive for RepRap other than it was being developed.

            Isn't this conditional slicing in Slic3r rather than actual conditional g code? The expression is evaluated at slice time and fixed G codes placed in the .gcode file. I may be wrong but the final gcode file is just standard gcode.
            If that's true it will work regardless of what firmware you are using.

            ~ tekkydave ~
            D-Bot: 300x300mm | Duet WiFi + Duex2 | 3 independent z motors | X,Y & Z linear rails | E3D Titan Aero + V6 | Precision Piezo z-probe
            FreeCAD, PrusaSlicer

            undefined 1 Reply Last reply 29 Dec 2019, 13:34 Reply Quote 0
            • undefined
              daavery @tekkydave
              last edited by 29 Dec 2019, 13:34

              @tekkydave yep that's all done in slic3r at slice time , nothing in the firmware

              1 Reply Last reply Reply Quote 1
              • undefined
                Garfield
                last edited by 29 Dec 2019, 13:34

                You know I've not looked, you're probably correct as I've just looked at some gcode produced by it and theres no conditions present, hadn't really considered the slicer's part in all this.

                So I guess the question becomes can the 'Printer' automatically add stuff based on specific conditions such as change tool, finish print, start print - so that slicers without the capability are accomodated ?

                undefined 1 Reply Last reply 29 Dec 2019, 14:22 Reply Quote 1
                • undefined
                  dc42 administrators @Garfield
                  last edited by 29 Dec 2019, 14:22

                  @Garfield said in Conditional GCode:

                  So I guess the question becomes can the 'Printer' automatically add stuff based on specific conditions such as change tool, finish print, start print - so that slicers without the capability are accomodated ?

                  There are already specific macro files that RRF calls in those 3 situations.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    Garfield
                    last edited by 29 Dec 2019, 14:39

                    I'm not sure what those are (will go look) but could we make it call specific / tailored macros to avoid messing with 'defaults' ?

                    I apologise to all for whom this is old ground ... it's new to me I'm afraid.

                    1 Reply Last reply Reply Quote 0
                    • ?
                      A Former User
                      last edited by 29 Dec 2019, 14:41

                      https://duet3d.dozuki.com/Wiki/Macros#Section_System_Macros

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