Need G-code Schooling

TomS

Active User
H-M Supporter Gold Member
Joined
May 20, 2013
Messages
1,906
I've written a simple G-Code program (attached) so that I can lubricate my machine and warm it up a bit before I start machining. The X, Y and Z axis move to the specified coordinates which is great. The problem is, even though I specified a feed rate, the axis move at the same speed no matter what I specify in the G-Code. I can use the feedrate override buttons but for future reference I'd like to know how to properly write the code.

For info the codes in the Mach3 safety bar (that's what I call it) to the right of the Diagnostics button are G15, G1, G17, G40, G20, G90, G94, G54, G49, G99, G64, and G97.

Tom S.
 

Attachments

  • Warm Up Routine.txt
    968 bytes · Views: 29
To be able to set the feed rate from the G-code, use G01 (linear move) rather than G00 (rapid move)
G01 X-.50000 Y-.5000 Z-.5000 F10 (now the feed rate will be active at 10 IPM)
 
To be able to set the feed rate from the G-code, use G01 (linear move) rather than G00 (rapid move)
G01 X-.50000 Y-.5000 Z-.5000 F10 (now the feed rate will be active at 10 IPM)

Thanks Jim. I kind of figured it had to be something simple.

Tom S.
 
Please remember that some codes are modal and remain in effect throughout if not turned off by another line. This will sometimes cause you problems when writing code manually.

Damn, I just looked at G15, it is polar positioning small wonder that it didn't do what you expected, this is modal, a G16 in the code would have turned it back into Cartesian.

G90 is absolute, G91 is incremental, both of these are modal on most controls.
Good luck
 
Last edited:
Please remember that some codes are modal and remain in effect throughout if not turned off by another line. This will sometimes cause you problems when writing code manually.

Damn, I just looked at G15, it is polar positioning small wonder that it didn't do what you expected.

Wreck Wreck - thanks for responding. I don't do much manual code writing but will keep your "modal" comment in my back pocket for future reference.

You lost me with G15. No G15 code in my program.

Tom S.
 
For info the codes in the Mach3 safety bar (that's what I call it) to the right of the Diagnostics button are G15, G1, G17, G40, G20, G90, G94, G54, G49, G99, G64, and G97.

Tom S.
The first line
 
The first line

Here is the code in question......It's the attached text file...... No G15..

(D2nc generated code)

G17 (set xy plane)
G90 (absolute mode)
G40 (cancel cutter radius comp)
G49 (cancel tool len offset)
G80 (cancel canned cycle)
G50 (reset scale 1:1)
G90.1 (IJ absolute arcs)
G20 (inch mode)



G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1
G00 X-.50000 Y-.5000 Z-.5000 F1
G00 X-24.5000 Y-8.1250 Z-14.0000 F1

M30 (end with rewind)
 
I did not look at the actual PDF file just the first post. By the numbers that is a fair sized mill.
Thanks Jim
 
Do I feel dumb! I wrote it and overlooked it twice before I responded. I need a beer. Or two.

Tom S.
 
Back
Top