Duet3D Logo

    Duet3D

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

    Conditional on G29 S0 or S1

    Gcode meta commands
    4
    5
    246
    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.
    • Stephen6309
      Stephen6309 last edited by

      Conditional to do a G29 S0 if heightmap.csv doesn't exist.
      RepRapFirmware for Duet 3 MB6HC version 3.1.1 running on Duet 3 MB6HC v1.01 or later (SBC mode)

      Something like:
      if heightmap.csv exists do G29 S0 else do G29 S1.

      Tried searching and got nowhere.

      1 Reply Last reply Reply Quote 0
      • A Former User
        A Former User last edited by

        you could perhaps use the exec on mcode thing and have the pi check for the file and in turn execute some gcode from the pi's shell?

        1 Reply Last reply Reply Quote 0
        • dc42
          dc42 administrators last edited by

          I haven't tested it, but this may work:

          G29 S1
          if result > 1
            G29 S0
          

          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
          • Stephen6309
            Stephen6309 last edited by

            G29 S1
            if result > 1
            G29 S0
            When I deleted the heightmap.csv:
            G32
            Error: G29: Failed to load height map from file heightmap.csv: Could not find file '/opt/dsf/sd/sys/heightmap.csv'.
            35 points probed, min error -0.170, max error 0.168, mean 0.000, deviation 0.089
            Height map saved to file heightmap.csv

            After a system page refresh, it's there.

            Then I changed it to:
            G29 S1
            if result > 1
            G29
            It works with no errors

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

              @Stephen6309 said in Conditional on G29 S0 or S1:

              G29 S1
              if result > 1
              G29
              It works with no errors

              I was just playing with this.
              Since I have a heated bed and also use the filaments/config.g to set different bed temps depending on the filament loaded - the bed heights could vary, but I haven't really seen that in real life. With that being said, I always do G29 with the bed heated to the filament's config.g settings. So depending on the different filaments in the DWC profiles, bed warp-age could vary - so not one bed height.csv for all. Hence this:

              G29 S1 [P{move.extruders[0].filament^".heightmap.csv"}]
              if result > 1
                 G29
                 G29 S3 [P{move.extruders[0].filament^".heightmap.csv"}]
              

              Will yield:

              G29 S3 [P{move.extruders[0].filament^".heightmap.csv"}]
              Height map saved to file 0:/sys/PETG.heightmap.csv
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA