From 913649de2e8057e849be2a54e08d34302ee37dad Mon Sep 17 00:00:00 2001 From: "Jason S. McMullan" Date: Sat, 17 Apr 2021 06:54:12 -0400 Subject: loop_sdcard: Add loopable SD card file sections To support continuous belt printing, add nestable repeat loop support via an `[sdcard_loop]` module. Supported G-Code: - SDCARD_LOOP_BEGIN COUNT=n ; Loop for N times, or infinitely if N is 0 - SDCARD_LOOP_END ; End of loop - SDCARD_LOOP_DESIST ; Complete all loops without iterating Marlin M808 compatibility example in `config/sample-macros.cfg`: - M808 Ln ; Loop for N times, or infinitely if N is 0 - M808 ; End of loop - M808 K ; Complete all loops without iterating Added unit tests in test/klippy/sdcard_loop.test See https://reprap.org/wiki/G-code#M808:_Set_or_Goto_Repeat_Marker Signed-off-by: Jason S. McMullan --- docs/Config_Reference.md | 14 ++++++++++++++ docs/G-Codes.md | 7 +++++++ 2 files changed, 21 insertions(+) (limited to 'docs') diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index 30c2468a..812dd7a9 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -1312,6 +1312,20 @@ path: # be provided. ``` +## [sdcard_loop] + +Some printers with stage-clearing features, such as a part ejector or +a belt printer, can find use in looping sections of the sdcard file. +(For example, to print the same part over and over, or repeat the +a section of a part for a chain or other repeated pattern). + +See the `config/sample-macros.cfg` file for a Marlin compatible M808 +G-Code macro. + +``` +[sdcard_loop] +``` + ## [force_move] Support manually moving stepper motors for diagnostic purposes. Note, diff --git a/docs/G-Codes.md b/docs/G-Codes.md index 2f012bf5..cb84fa65 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -66,6 +66,13 @@ In addition, the following extended commands are availble when the - Load a file and start SD print: `SDCARD_PRINT_FILE FILENAME=` - Unload file and clear SD state: `SDCARD_RESET_FILE` +When the [sdcard_loop config section](Config_Reference.md#sdcard_loop) is +enabled, the following extended commands are available. +- Begin a looped section in the SD print: `SDCARD_LOOP_BEGIN COUNT=` + - A count of 0 indicates that the section should be looped indefinately. +- End a looped section in the SD print: `SDCARD_LOOP_END` +- Complete existing loops without further iterations: `SDCARD_LOOP_DESIST` + ## G-Code arcs The following standard G-Code commands are available if a -- cgit v1.2.3-70-g09d2