I am trying to use a TinyG board in an instrument and need to turn on a flag on the fly once the XY stage has reach speed while tracing a pattern. I'm trying to use the coolant signal for this, but I'm seeing the XY motion pausing briefly when executing either the M8 or M9 commands in g-code. Is there a $parameter that controls this behavior? Can it be turned off?
Turned off, I'll say probably not.
What is likely happening is that the motion planner sees the M8/M9 as a break in the motion stream, breaking it into two pieces.
Since the planner and jerk really control "reaching speed", I'm not sure a discrete M8/M9 would be real accurate. You could, perhaps, monitor the upstream status and observer the actual speed.
Could you use an external interface, such as an arduino executing a json command, to flag?
As a point of interest, ‘M’ commands aren’t processed the same way as ‘G’ commands: “Grbl puts all stepper commands into a buffer that is executed by the
Stepper.c interrupt routine
- Codes like M7, M8, M9, M112, etc... do not get put into this buffer
- The buffer takes time to execute in the backgroud
- A code like the M9 (air off command) will get executed BEFORE the
buffer of X,Y (and Z) commands has finished executing”
This is so that your emergency stop, etc. is immediately handled, rather than sitting in the serial queue.
Maybe using a comment line may work?
This topic is from the original forum (August 2018). Your reply starts a new discussion linked to it.