G Code

flytyree

FlyTyree
I am trying to understand the following code:

(5555 NAME)
(CRACKER BARREL GAME)
(T2 D=0.125 CR=0. - ZMIN=-0.755 - FLAT END MILL)
N10 G90 G94 G91.1 G40 G49 G17
N15 G20
N20 G28 G91 Z0.
N25 G90

(2D CONTOUR1)
N30 M5
N35 T2 M6
N40 S24000 M3
N45 G54
N50 G0 X0.0905 Y0.0443
N55 G43 Z0.1894 H2
N60 G1 Z-0.1375 F30.

The results are different if the machine is "homed" vs going to a location and zeroing the X, Y, and Z.
 

machinedude

machinedude
anything in parentheses gets passed over by the controller and is a place to add note or instructions in your program. the G54 is your work off set and that is normally your program origin or 0.0. of your part program. the G17 is telling the controller that you are working in the X Y Plane for you contours, all the N numbers at the beginning of each line are line numbers of the program most controllers don't actually need them and it extra space needed in storage for your program file. H is a tool length offset D is a tool radius offset value which masso does not have unless they changed that recently. G90 is absolute position a G91 is incremental position. A G28 is your machine home position so your machine knows where it is at all the time and the work offset is just temporary to the job set up. the G20 tells the control you are working in inches and a G21 would set the control to metric.



not sure if a missed any particular question ?
 

machinedude

machinedude
N10 G90 G94 G91.1 G40 G49 G17

the above is a general line to clear unwanted stuff from it's memory and is what i would call a starting block of code. cleans the controller memory so no accidents happen and your tool does not take off unexpectedly and causes a crash. your programs should always have this for this reason.
 

flytyree

FlyTyree
Thank you very much.

With the code shown in line N28 the Z axis has plunged to max depth. I took that line out and did not have that problem but, I need to understand why.

Clifford
 

machinedude

machinedude
i would check your work off set to make sure it is set correctly. if the top of the part is your Z 0.0 in your program then your G54 need to be set that way. the H values represent the length of your tools. usually a value in a tool table and a H2 would represent the length of Tool #2 or T2 just as an example. usually the tool length offest is called out in the program a few inched above the part so it has time to apply the off set.
 

machinedude

machinedude
N55 G43 Z0.1894 H2



the above line is where your height off set is getting turned on the Z0.1894 is way to close to the part Z zero for starters i would change that to like Z3.0 if you have the travel if not set that number as high as your travel will permit then and see if that helps any.
 

machinedude

machinedude
the code you have looks like a Fanuc post processor in fusion 360 so i am not sure how well masso will do with that post processor ? that could be your problem as well if it is using codes masso does not support. not sure what you are using exactly as a post processor?
 

flytyree

FlyTyree
I have tried the local college and community college for class on G Code with no luck. Is there a text book, or source that would be good for me to review?
 

flytyree

FlyTyree
I had to upgrade my system and when I download the post processor for Autodesk for Inventor those lines suddenly appeared. Is there a way to install a different post processor more aligned with Autodesk Inventor 2020?
 

machinedude

machinedude
i'm not sure about inventor i never used it but like fusion 360 and use it a lot. CNC Programinning Techniques By Peter Smid is a good book if you want to get into it in depth. anything he has out on CNC should be informative.

post processors are more about matching the right one to the control rather than the software you use to create your code or models with. they should have a list of post processors for different machine controls, they might even be universal between the different autodesk products but i can say if that's the case or not. i would check that section of autodesk out and look for post processors and see what they have.

i have a PDF book that might help you out on machining and i do think they touch on programming as well in the PDF book. i found in on the fusion tutorials on youtube when i was first trying fusion 360 out. cant post it here but might be able to e-mail it to you if you want to have a look at it?
 
Top