Resuming after a pause in loop
-
@fcwilt I've been testing with this GCode
; Test Loop ; Pausing with M25, and resuming with M24 whilst inside loop results program skipping to end. while iterations < 11 G4 S1 if iterations == 1 M117 One elif iterations == 2 M117 Two elif iterations == 3 M117 Three elif iterations == 4 M117 Four elif iterations == 5 M117 Five elif iterations == 6 M117 Six elif iterations == 7 M117 Seven elif iterations == 8 M117 Eight elif iterations == 9 M117 Nine elif iterations == 10 M117 Ten continue G4 S1 M106 P0 S1 G4 S1 M106 P0 S0 G4 S1 M106 P0 S1 G4 S1 M106 P0 S0 G4 S1 M106 P0 S1
-
What is the intent of the M106 commands?
When and how are you issuing the M24/M25 commands?
Thanks.
Frederick
-
Unless you are using the if/elif commands you can get a similar result with:
while iterations < 11 G4 S1 M117 {iterations}
-
Hey @fcwilt, I've just included those to highlight how it skips them. It could be anything there. I've been using the web control interface for all these tests.
Thanks
-
@teud said in Resuming after a pause in loop:
Hey @fcwilt, I've just included those to highlight how it skips them. It could be anything there. I've been using the web control interface for all these tests.
Thanks
It seems that for M25/M24 to work you have to be printing something.
Are you doing that?
Frederick
-
Yeah I'm using the interface to 'print' what I attached earlier
-
@teud said in Resuming after a pause in loop:
Yeah I'm using the interface to 'print' what I attached earlier
I think that behavior may be related to this from the M25 docs:
M25 attempts to execute as quickly as possible and follows the following logic:
When RRF receives M25 it will look for a move in the current queue after which it can stop without violating the configured jerk limits.
If it finds one it stops after that move without decelerating (because the jerk limits allow that)
If it can't find one it will plan and execute a deceleration. in this case the pause will occur 1 move+2 seconds after M25 is sent.It may be that the search for a suitable pausing point is not compatible with a while loop.
@dc42 would have to address this behavior.
Frederick
-
-
@teud, I have a few questions:
- Are you running this code directly within a print file, or in a macro called from a print file?
- What is the objective that you are trying to achieve with this code?
One limitation of the current pause/resume system is that pausing is only supported when executing a print file. If the print file calls a macro, and a pause is requested while the macro is being executed (e.g. because the print starts with a G28 command, and the user presses Pause during the homing procedure), then the intended behaviour is that the pause is queued until the macro completes. This is because attempting to pause during e.g. homing, changing tool, running auto-calibration etc. would raise some serious complications, and I don't think it is likely that any general algorithm would handle all cases,
-
Hey @dc42
- These are being run from within a print file.
- Trying to achieve the ability have an extended dwell (1 hour+), where the machine will be able to resume from its position if restarted etc. I was looking to achieve this by looping over much smaller dwell periods and tracking how many interactions its gone through.