What is M30 supposed to do?

chucktilbury

chucktilbury
When I run this GCODE, the Z goes back to zero and X goes back to 1.0625 after the M30. Is that expected?

Thanks,
Chuck Tilbury
 

Attachments

  • fipple2.nc
    341 bytes · Views: 29

machinedude

machinedude
A M 30 just ends and rewinds the program back to the beginning. but your code looks like you wrote it by hand since you have no work offset or anything else other than you rapid and feed rate moves with a tool change in there i guess too.

it's probably because of that i'm guessing. usually when you write a program you have a starting block of code that will act like a safety to clear any commands stored in the controller. when you end a program before the M 30 an end block of code that acts the same way. because you have nothing to clear things in the controller in your code those positions are probably in the controller.

if you get a good CAM software package to program with and have a good post processor when you post your code all this is in your program already.
 

chucktilbury

chucktilbury
I am using QCAD/CAM to generate the gcode. It's pretty basic. I did hand edit the last couple of lines, but the rest of it is out of a generic post processor. When I use this exact same code and end it with M02 instead of M30, it behaves as I would expect it to.

Are you saying that there is some setup at the beginning that the M30 instruction expects to see? If so, then can you point me to an example? I suspected that I am probably the only one experiencing this. :)

I am working on my own post processor for this, so that information would be very useful in any case.
 

evermech

evermech
Hi @chucktilbury

it shouldn't do anything after an M30 command except stop the program and rewind back to start no matter what preparatory code is used. Whether or not this is the case with the Masso I don't know but that's what's supposed to happen. I can't get mine to rewind to the top of the program.

Guy
 

machinedude

machinedude
Quote from evermech on September 9, 2019, 3:07 am

Hi @chucktilbury

it shouldn't do anything after an M30 command except stop the program and rewind back to start no matter what preparatory code is used. Whether or not this is the case with the Masso I don't know but that's what's supposed to happen. I can't get mine to rewind to the top of the program.

Guy

i agree Guy it should not do anything other than end and rewind. But who knows what is going on in the mind of the controller? CNC machines are stupid that is a good rule of thumb :)

i think i seen something from support about a space after the M 30 is needed for the controller to act as you would expect it. but don't hold me to that :)
 

breezy

Moderator
Quote from machinedude on September 9, 2019, 3:52 am

Quote from evermech on September 9, 2019, 3:07 am

M30 command stop the program and rewind back to start. I can't get mine to rewind to the top of the program.

i think i seen something from support about a space after the M 30 is needed for the controller to act as you would expect it. but don't hold me to that
?

@chucktilbury

My understanding is that the MASSO reads a line, then moves to the next line of code and acts on the code just read, so you need a blank line after M30 so that the controller can act on the M30 command. I modified my Fusion mill post processor to add a blank line after a M30 command and suggested to Masso Support that they get Autodesk to add that change to Masso Mill post processor.

The M30 command is end of code, rewind and stop. No further action to take place.

But there are few situations that can catch you out, manual tool change with auto tool zero for one. Controller moves to the tool change location, you change the tool, it auto zeros the tool and returns to the point the head was located at when the tool change command is issued, even though the next tool is going to start in a different location. When that happens for the first time, you are not expecting it, the process can be frightening.

Regards,

Arie.
 

chucktilbury

chucktilbury
Quote from evermech on September 9, 2019, 3:07 am

it shouldn't do anything after an M30 command except stop the program and rewind back to start no matter what preparatory code is used.

Guy

@evermech

If that's the case, then I think I have found a bug because that's not what is actually happening. It actually seems to backtrack to the last G1 position after the M30 command.
 

chucktilbury

chucktilbury
Quote from Breezy on September 9, 2019, 10:04 am



My understanding is that the MASSO reads a line, then moves to the next line of code and acts on the code just read, so you need a blank line after M30 so that the controller can act on the M30 command.

@breezy

When I was originally trying to get this post processor to work, I saw the blank line at the end thing. It does not seem to process the last line without a blank at the end. That seems odd, but okay. I thought that maybe I was hallucinating. :)

I am planning to contrive some tests today and probably submit a bug on the M30.
 

cncnutz

CNCnutz
Staff member
Hi @chucktilbury

I loaded your file into Masso and ran it on my setup.

Everything seems to run exactly as it should. At the end if the file the M30 sends it back to the beginning of the file.

The spindle has stopped and the DRO's read X0,Y0, Z1

Pressing the cycle start runs the file again and each time it runs exactly the same, ending by rewinding the file with DRO's reading X0,Y0, Z1

Guy is correct that there needs to be a line after the M30 for it to work. The very last line of the Gcode file is ignored so just hit Enter to create a blank line as you did with this file and it will work ok.

What version software are you running, I tested using the latest release v3.42 Mill.

Cheers

Peter
 
Top