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

    gcode to run at power up

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    4
    10
    606
    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.
    • mrehorstdmdundefined
      mrehorstdmd
      last edited by mrehorstdmd

      Is there some way to use the ressurect.g or other means to run a gcode file at every power-up, regardless of the machine's state when it was powered off? Can the code for the erase pattern just be included in the config.g file, or can it be "called" from the config.g file?

      I'd like to home the machine and run an erase pattern on my sand table whenever I turn on the power to the table.

      https://drmrehorst.blogspot.com/

      dc42undefined 1 Reply Last reply Reply Quote 0
      • whosrdaddyundefined
        whosrdaddy
        last edited by

        I would create a macro and call it at the end of config.gwith M98.

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

          I'd be weary of having automatic movement on power up. Seems contrary to best practice. Perhaps a push button to trigger the macro instead?

          Z-Bot CoreXY Build | Thingiverse Profile

          mrehorstdmdundefined 1 Reply Last reply Reply Quote 0
          • mrehorstdmdundefined
            mrehorstdmd @Phaedrux
            last edited by

            @Phaedrux This is for a sand table- nothing is exposed where anyone can touch it.

            https://drmrehorst.blogspot.com/

            1 Reply Last reply Reply Quote 0
            • mrehorstdmdundefined
              mrehorstdmd @whosrdaddy
              last edited by

              @whosrdaddy That should do it! Thanks.

              https://drmrehorst.blogspot.com/

              1 Reply Last reply Reply Quote 0
              • mrehorstdmdundefined
                mrehorstdmd
                last edited by

                I put in an M98 call to a subprogram that erases the sand table and it works fine, however, the wifi access point mode doesn't start up until after the erase is done. In config.g I put the M98 command after the M552 S2 to turn on access point, and even added a 10 second dwell command, but no joy. It still runs the called subprogram first, then turns on the wifi. Is that normal? I'd like to have the access point on first, then run the erase subprogram...

                https://drmrehorst.blogspot.com/

                1 Reply Last reply Reply Quote 0
                • whosrdaddyundefined
                  whosrdaddy
                  last edited by

                  What happens if you put M552 as the first command in your macro?

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

                    The wifi commands are delayed until after everything else in config.g has finished on purpose. Not sure if that applies to other macros as well.

                    Z-Bot CoreXY Build | Thingiverse Profile

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

                      @mrehorstdmd said in gcode to run at power up:

                      Is there some way to use the ressurect.g or other means to run a gcode file at every power-up, regardless of the machine's state when it was powered off? Can the code for the erase pattern just be included in the config.g file, or can it be "called" from the config.g file?

                      I'd like to home the machine and run an erase pattern on my sand table whenever I turn on the power to the table.

                      I suggest you use M581 in config.g to create a trigger that runs the erase macro when a spare endstop input is in its default state. Then use a M582 command at the end of config.g to force that trigger to be checked even though the endstop input doesn't change state. The erase macro can disable the trigger too.

                      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

                      mrehorstdmdundefined 1 Reply Last reply Reply Quote 0
                      • mrehorstdmdundefined
                        mrehorstdmd @dc42
                        last edited by

                        @dc42 That's so decadent! I'll try it!

                        https://drmrehorst.blogspot.com/

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