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 would create a macro and call it at the end of config.gwith M98.



  • 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?



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



  • @whosrdaddy That should do it! Thanks.



  • 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...



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



  • 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.


  • administrators

    @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.



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


Log in to reply