M400 vs G4 P0
-
Woww that was a quick answer. Yhea I also observed that it does not, so I have tried to reduce it down to 1 ms but then found out that M400 worked better. However, during connectivity issues, is it possible that a lack of Gcode buffer results in weird stepper motor behavior?
-
G4 S1 will work, right? waiting just one millisecond is definitely good enough for me. I do not want to use M400 anymore cause I use a Duet wifi and it seems that clearing the buffer is causing me some troubles as the connection gets interrupted sometimes...
Also, I couldn't find how big this Gcode buffer is... Today I had the issue that the printer needs to wait for a movement to finish, like:
G91 G1 A-500 B-500 F200 ; running
M400
M118 "finished 1"
M105 ; show temp
G91 G1 A-1000 B-500 F200 ;running
M400
M118 "finished 2"
M105 ; show tempHowever, the printer stopped after the first move command and showed a status of idle. It did not log the "finished 1" nor showed the temp...
The only reason I can find is that the connection is interrupted and miscommunication has occurred...
(connection gets interrupted because I use a second wifi dongle. One to connect with the printer, one to connect to the wifi of our university (not a very stable signal, our building is basically a Faraday cage...)
Sincerly,
Max -
@Tricep-terry said in M400 vs G4 P0:
G4 S1 will work, right? waiting just one millisecond is definitely good enough for me. I do not want to use M400 anymore cause I use a Duet wifi and it seems that clearing the buffer is causing me some troubles as the connection gets interrupted sometimes...
Waiting for the move buffer to empty (which M400, G1 P1 and G1 S1 all do) will not cause disconnections.
-
Oke now i'm a bit confused, sorry. What is exactly meant by the buffer in this case?
if I would run the following code, the machine will wait until the move is finished before it will send the M118 command (this I want):
G91 G1 A-1000 B-500 F200 ;running
M400
M118 "finished 2"if I would run the following line, the message is sent as the move starts (this I don't want).
G91 G1 A-1000 B-500 F200 ;running
M118 "finished 2"To me, this means that the duet sees the code in advance before it has finished the current line.
Now I wonder if "clearing the buffer" means that it "forgets" the lines that will be running in the future. If that is the case, and a connection loss would occur (not due to M400 or G1 but just bad connectivity), what then would happen, and would this also happen if G4 S1 is used?
-
@dc42 , Is there a maxium time a single line of code may take?
I just tried to run a script with really really slow motions (1 line takes about 1,2 hours). The printer does not continue to the second line but goes to idle without showing print finished in the console... -
I have done some testing and it seems that the issue is related to the duration of the execution of a single line of code. If I divide the same line into 10 separate lines of codes, it works.
@dc42 could you confirm if there is indeed an auto-sleep mode or something similar that will turn the printer status into idle if the duration for 1 line of code (gcode command) takes longer than a certain amount of time?
-
@Tricep-terry said in M400 vs G4 P0:
@dc42 could you confirm if there is indeed an auto-sleep mode or something similar that will turn the printer status into idle if the duration for 1 line of code (gcode command) takes longer than a certain amount of time?
There is no such timeout.
G4 S1 will delay for 1 second. G4 P1 will delay for one millisecond.
-
Hmm well when splitting the Gcode up it does work and without it doesn't, but I do run out of any other reasons too why I observe this behavior. Thanks for your time and answers, it's really appreciated.
Whish you al the best,
-
What happens if you split it up into just 2 moves?
-
@dc42 I will try today as well. pleased to screen-record the console of the duet web control application and run three replicas to see if it happens at the same time timepoint.
Max