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

    Is there a guide for a recommended file structure?

    Scheduled Pinned Locked Moved
    General Discussion
    7
    12
    451
    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.
    • kb58undefined
      kb58
      last edited by kb58

      I'm discovering piecemeal that certain files are needed to create a functional system. I know that it's "just code" and that there's a million ways to do things (with macros, for example), and not everyone has need of every function, but I keep getting surprised to find that another gcode is expecting a routine to exist that doesn't.

      Is there a guide or list for all the routines necessary for a full system? For example, G29 calls bed.g, M703 tries calling a filament config file (confusingly named) config.g, homing X expects that there will be a homex.g, and so on. Some (most?) of these post no error or warning if the file is not present, so I've ignorantly gone on my way, only later figuring out what's going on. Having the list would be helpful because it makes users aware of what's expected in case we use that function.

      And yes, the little voice in my head is saying "well if you'd read the gcode guide, you'd know what each gcode does and what it expects..."

      Scratch-built 350mmx350mm coreXY, linear rails, ballscrews, 3 Z axis, Duet3 6HC, v3.3, Tool Board v1.1, BondTech LGX + Mosquito hot end

      droftartsundefined fcwiltundefined 2 Replies Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @kb58
        last edited by

        @kb58 See https://duet3d.dozuki.com/Wiki/Firmware_Overview#Section_SD_card_structure and https://duet3d.dozuki.com/Wiki/SD_Card#Section_Creating_the_file_structure

        There's also another folder now; 'Firmware' (from RRF 3.3) which holds the firmware files.

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        1 Reply Last reply Reply Quote 0
        • fcwiltundefined
          fcwilt @kb58
          last edited by

          @kb58 said in Is there a guide for a recommended file structure?:

          And yes, the little voice in my head is saying "well if you'd read the gcode guide, you'd know what each gcode does and what it expects..."

          That's basically how I learned - along with asking questions here.

          Frederick

          Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

          1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator
            last edited by

            You can also see what the config tool generates. It won't have some of the more advanced features but it will have all of the required files.

            https://configtool.reprapfirmware.org/Start

            Z-Bot CoreXY Build | Thingiverse Profile

            1 Reply Last reply Reply Quote 0
            • mikeabuilderundefined
              mikeabuilder
              last edited by mikeabuilder

              Great question - I'm closing in on a multi-tool design and pondering the order that the tpreN, tpostN, and tfreeN files are called and if what might call them other than a TN or T-1 code. My plan is to add some comments in those files and watch the log.

              Semi-related.... code style. The group I'm working with keeps our gcode stack in github and I wrote a python script that walks through all the files and copies flagged comments into a separate .md file so that we have some auto generated documentation. I'd be happy to evolve to some common standard if there is one. Here's is an example of our config.g and config.md files. ( I had to change the .md filetype to .md.txt to get past the upload filter)
              config.g
              config.md.txt

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

                @mikeabuilder said in Is there a guide for a recommended file structure?:

                Great question - I'm closing in on a multi-tool design and pondering the order that the tpreN, tpostN, and tfreeN files are called and if what might call them other than a TN or T-1 code. My plan is to add some comments in those files and watch the log.

                tfree#.g is called first if a tool is already selected, where # is the number of the old tool. Then tpre#.g is called, where # is the number of the new tool. Then the new tool is activated; the tpost#.g is called.

                The only other command that may call these files is M109, because M109 does an implicit tool selection if no tool is selected. This is a workaround for slicers that issue M109 without selecting a tool first.

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

                  Thanks. So my assumption about T# and T-1 being the primary caller of the tools is correct (something I'll add to the wiki if I get to the point of editing). One thing that is unclear to me is why there is a need for tpre#.g and also tpost#.g instead of a single command. My assumption at this point is that the separation is for users that want to pre-heat their tools prior to tool selection, maybe as part of machine startup, or maybe in the header of a part file. I assume the RRF does not insert other execution steps between the two when executing a T#.

                  cosmowaveundefined Phaedruxundefined 2 Replies Last reply Reply Quote 0
                  • cosmowaveundefined
                    cosmowave @mikeabuilder
                    last edited by

                    @mikeabuilder said in Is there a guide for a recommended file structure?:

                    One thing that is unclear to me is why there is a need for tpre#.g and also tpost#.g instead of a single command.

                    It's not necessary to use both macros. Leave one macro empty, then it's acting like you have only one macro...

                    Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                    1 Reply Last reply Reply Quote 0
                    • mikeabuilderundefined
                      mikeabuilder
                      last edited by

                      True, I could use just one. But I like to know why things are designed as they are. Usually a very good reason that I might not have thought of.

                      cosmowaveundefined 1 Reply Last reply Reply Quote 0
                      • cosmowaveundefined
                        cosmowave @mikeabuilder
                        last edited by

                        @mikeabuilder The possibilities are much greater with having both macros.
                        There are very different setups and use cases with the Duet boards. The toolchange setup can also be very different.
                        I think, there are users which are happy to have a tpre#.g and tpost#.g

                        Mankati FSXT+, DeltaTowerV2, E3D MS/TC

                        1 Reply Last reply Reply Quote 0
                        • Phaedruxundefined
                          Phaedrux Moderator @mikeabuilder
                          last edited by

                          @mikeabuilder said in Is there a guide for a recommended file structure?:

                          So my assumption about T# and T-1 being the primary caller of the tools is correct (something I'll add to the wiki if I get to the point of editing).

                          https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_T_Select_Tool

                          https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Tool_change_files

                          Z-Bot CoreXY Build | Thingiverse Profile

                          1 Reply Last reply Reply Quote 0
                          • mikeabuilderundefined
                            mikeabuilder
                            last edited by

                            @Phaedrux, thanks for the pointers to the wiki. I've read it before but the step describing setting the tool to the new operating temp after tpre#.g is executed disappeared from my memory.
                            My pseduo code for the three files are:

                            tfree:
                            ;!0. Remember the tool location.
                            ;!1. Lower the bed a bit.
                            ;!2. Retract the filament a bit.
                            ;!3. Call the nozzle wiping macro (if we make one).
                            ;!4. Set the nozzle temperature to a standby value.
                            ;!5. Move the tool in front of the tool dock.
                            ;!6. move the tool into the dock.
                            ;!7. Call the macro that turns the tool latch to the unlatched position.
                            ;!8. Move the tool carrier back from the tool dock.
                            ;!9. Perform some task that confirms the tool was really left on the dock and is not still attached to the carrier, or fell out of the dock. No idea how to do this yet.
                            ;!10. Return to the remembered location.

                            tpre:
                            ;!0. Heat the nozzle to it's target temperature.

                            tpost:
                            ;!1. Lower the bed a bit so we don;t hit anything.
                            ;!2. Switch to the master coordinate system so we can find the tool dock.
                            ;!3. Move to a position just in front of the tool dock.
                            ;!4. Move the tool carrier into the docked tool position (advance Y).
                            ;!5. Call the macro to lock the tool to the carriage.
                            ;!6. Move backout of the dock. Hopefully we have something that verifies the tool is porperly docked.
                            ;!7. Switch to this tools coordinate system (means engage it's offsets in X, Y, and Z).
                            ;!3. Execute the wiping macro (if we make one).
                            ;!4. Move back to the remembered location

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