M0 and M1 G-codes

I was looking up another code and I saw M0 and M1 in the supported G-Code list.

What is an example of when and how to use them with Carbide Motion?

I have long programs that require a pause, turn off spindle, and clean up chips or the bit or adjust the dust boot between toolpaths. I have a few blocks of code I insert in the gcode file to do this. but they require pressing the Pause button at the right time and place. Could these commands make this easier? thank you

M0 (Stop) and M1 (Opstop) I believe behave the same on these machines. They will pause the program, and enable the “Run” or “Start” button to resume.

You’ll probably want to add a retract & spindle stop before the pause, and a spindle on & return to the previous Z after the pause.

3 Likes

Thank you. That would be the same as pressing the pendant or software Pause buttons I think. It would help. I already have a code block that retracts, turns off the spindle, moves to a proper place, then Dwells so I can Pause, before the next segment starts. I will try adding these in place of the Dwell in separate programs and test.

The difference with the button is it initiates a feed-hold immediately.
M0, M1 should execute in the order programmed.
Although I have experienced it letting a block of code slip through. i.e. In one example I had to put the M0 before a spindle on statement to pause to let the spindle ramp up to speed.
SO, test it well before running a real job.!!!

2 Likes

I did a quick test yesterday. I put an M1 in a safe part of a program between a few rapid moves 6 to 10 inches apart. The spindle was off. It didn’t pause until it executed the line AFTER the M1. That’s weird. No other commands do that.

Is that what you meant by a block slipping through?

Should it be thought of as M1 = Pause after the next line?

Or does it sometimes process M1 in the correct order?

I’ll have to try more direct tests when I have time. thanks.

1 Like

Yes, that’s exactly what I was referring to. And “pause after next block” is a good way to think of it.
The other option, I think would be to include a motion command that doesn’t do anything…
Or add the M1 to the end of the previous block.??

2 Likes

Thanks. I was thinking split it up. If the pause location is X1 Y 1, make it

G0 X1.001 Y1.001
M1
G0 X1 Y1