• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    mrehorstdmd
    last edited by mrehorstdmd 10 May 2019, 11:32 5 Oct 2019, 11:31

    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/

    undefined 1 Reply Last reply 9 Oct 2019, 21:26 Reply Quote 0
    • undefined
      whosrdaddy
      last edited by 5 Oct 2019, 13:29

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

      undefined 1 Reply Last reply 6 Oct 2019, 02:00 Reply Quote 2
      • undefined
        Phaedrux Moderator
        last edited by 5 Oct 2019, 23:14

        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

        undefined 1 Reply Last reply 6 Oct 2019, 01:59 Reply Quote 0
        • undefined
          mrehorstdmd @Phaedrux
          last edited by 6 Oct 2019, 01:59

          @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
          • undefined
            mrehorstdmd @whosrdaddy
            last edited by 6 Oct 2019, 02:00

            @whosrdaddy That should do it! Thanks.

            https://drmrehorst.blogspot.com/

            1 Reply Last reply Reply Quote 0
            • undefined
              mrehorstdmd
              last edited by 9 Oct 2019, 11:13

              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
              • undefined
                whosrdaddy
                last edited by 9 Oct 2019, 11:18

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

                1 Reply Last reply Reply Quote 0
                • undefined
                  Phaedrux Moderator
                  last edited by 9 Oct 2019, 16:14

                  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
                  • undefined
                    dc42 administrators @mrehorstdmd
                    last edited by dc42 10 Sept 2019, 21:28 9 Oct 2019, 21:26

                    @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

                    undefined 1 Reply Last reply 10 Oct 2019, 02:08 Reply Quote 0
                    • undefined
                      mrehorstdmd @dc42
                      last edited by 10 Oct 2019, 02:08

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

                      https://drmrehorst.blogspot.com/

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