Subscribe to Blog
Email Address
 

Articles and tutorials dedicated to G-Code Milling and Turning programming. Canned Cycles, G and M Codes

Pages:(2) [1] 2

Notepad++: Absolutely Free G-Code Editor With Code Highlighting

March 20, 2016, 4:28 pm by Eldar Gerfanov

Quite often i see people asking which text editors others use to work with their G-Code.

Some even suggest paid ones.

I am using a free general-purpose advanced text editor called Notepad++.
In fact i am using the same editor to create code for my apps too.

It is so flexible, it can recognize the language you are working with and turn on the language-specific highlighting for even the G-Code.

I have created my own Language profile for it. It is attached to this article, so everyone can download it.

Below is how you can apply this language profile to turn on g-code highlighting:

Read More 


G-CODE_N Language G-CODE_N.xml

Did you know there are three ways you can touch off your tools?

Because of how Machine Offsets add up, there are several ways CNC machinists can set their Tool and Work Offsets.

This is especially true Tool Length Offsets.

Tool Offsets can be either Positive or Negative.
Depending on your Machine Shop equipment you should use one or the other.

Regardless of how you set you tool length offset you apply it the same way.
Right after the tool change and after turning on your spindle and moving to your X Y position above the part.
The very first abslute Z movement should be the line where you apply the tool length offset.

Code
T15 M6; (TOOL CHANGE)
G0 G54 G90 X1.0 Y1.5 S1500 M3;(APPLY WORK OFFSET, MOVE TO THE FIRST POSITION, TURN ON THE SPINDLE)
G43 Z2.0 H15; (APPLY TOOL LENGTH OFFSET WHILE MOVING TO 2.0" ABOVE THE PART)
G0 Z0.1 M08;(MOVE TO FEED HEIGHT AND CARRY ON WITH THE PROGRAM..)

Positive Tool Offsets (gage line tool length offsets)

In case of Positive Tool Offsets, the offset represent the Length of the tool measured as a distance from Gauge Line of the spindle (typically spindle nose) to the tip of the tool. The longer the tool, the larger your Tool Length offset will be.

Read More 


Before we run any G-Code program, we need to tell the machine where our part zero is.
A Part Zero is simply a bunch of numbers that offset axis to give machine a new coordinate point to work from.

Work Offsets is one of the most basic pieces of knowledge any machinist must have.

Let us account for all the basic coordinate systems and definitions, available in a generic CNC machine

  • Machine Home and (Absolute) Machine Coordinates
  • Work Offset Coordinates
  • Tool Length Offsets

Machine Home and Machine Coordinates: G53

Machine Coordinates (or Absolute Coordinates) is the absolute and constant representation of machine axis position.
These coordinates never change between Machine Restarts and must remain such. In fact there is often no way for an operator to adjust Absolute Machine Axis Home position.

Machine Home is simply that magical place where all Machine Coordinates should become Zero.

To Home the Machine is to start a machine operation, that will move all Axis to their soft limit position where X,Y and Z axis reading will be set to zero.

Homing must be done every time you restart your machine. Without it machine does not know where is the position of its table or spindle.

When homed your machine coordinates will read X=0 Y=0 and Z=0 and it is going to look like this:


The point where Machine X and Y intersect is called Table Home Position and the one where the Machine Z axis starts from is called Spindle Home.

Now, there is no agreement between machine tool manufacturers on where the machine home should be.

Read More 


Canned cycles are used every time we need to drill, ream or tap holes on our CNC machine

Standard Fanuc G-Code language supports more than a dozen canned cycles.

The most common cycles that will cover 99.9% of your g-Code CNC programming work are:

G-Code Name Motion Style
G81 Standard Drilling Feed-In, Rapid-Out
G83 Deep Hole Peck Drilling Incremental Feed-In by Peck Distance, Rapid Out, Repeat
G84 Right Hand Tapping Feed-In,Reverse Spindle, Feed-Out
G85 Reaming/Boring Feed-In, Feed Out

Subsequent holes

You can drill additional holes After your canned cycle has been initiated.
Any line with X Y position will be treated as another hole position.

Each position can have its own Retract value, feed rate and retract height modifier.

G80 - Canned Cycle Cancel Code

After all the holes of the canned cycle have been drilled, it is required to call G80 code in order to cancel the current cycle.

Read More 


Lessson 2: Outside Profile, Cutter Radius Offset Compensation

January 28, 2014, 11:51 pm by Eldar Gerfanov

In this tutorial we are going to explore different options and techniques when programming cutter movement.

Lets begin with a simple part shown in a drawing below.

Basically it is a rectangular piece 4.00x2.00
For the purpose of simplicity lets make the depth of our profile (z- dimention) 0.75"

We are going to use a 0.5" dia endmill, again because it is a very common size and is easy to do basic math with.

I took a liberty of puting locations for our part/toolpath, so it is easy to extract numbers from the drawing just by looking at it.

Notice the green rectangle. This rectangle represents the path that the center of the tool will have to take to produce the part with required dimentions.
The thing is: because endmills have certain diameter, the center of the tool must be always offset by its radius.

There are two ways of doing that.Read More 


Lesson 1 : Generic G-Code Milling Program Flow

January 24, 2014, 12:40 am by Eldar Gerfanov

At my day job I am starting to do more and more manual programming.

Which i do not realy like, but since am at it anyway i have decided to keep piling little articles about G-Code programming into this new category.
This way when i forget things again i will be able to quicly refresh my memory.

Program Start

O0001 (COMMENT OR PROGRAM NAME)

Starting safety blocks

(G20 IMPERIAL UNITS, G21-METRIC)
(G17 XY ARC PLANE, G18-XZ, G19-YZ)
(G40 CANCEL TOOL RADIUS COMPENSATION)
(G49 CANCEL TOOL LENGTH OFFSET)
(G80 CANCEL CANNED CyCLE)
(G90 ABSOLUTE POSITIONING MODE)

G20 G17 G40 G49 G80 G90

Tool Change Routine

(T14 - call 2.5" Face mill)
(M6 - Perform tool change)
(G0 - rapid feedrate)
(G55-G59 - Choose Work Offset)
(X, Y - Command a Position to move to)
(S - choose spindle speed)
(M03 - Turn spindle on Clockwise, M04 - Counter-clock wise)


T14 M6
G0 G54 G90 X{X} Y{Y} S{SPEED} M03;

Apply Tool length offset at retract height, Turn on Coolant

(G43 H14 Z2.0 - All codes must be in the same line Apply cutter length offset from record #14 to cuttent tool, move to 2.0 above work at the same time )
(M8 - Turn on Coolant)

G0 G43 H14 Z2.0 M8

Rapid tool to plunge height

G0 Z{Z_PLUNGE}

Plunge to cutting depth at plunge feedrate

G01 Z{Z_DEPTH} F{F_PLUNGE}

Make a straight cut in xy direction at cutting feedrate

G1 X{X_POS} Y{Y_POS} F{F_FEED}

Retract to plunge height at either rapid or retract feedrate

G1 Z{Z_PLUNGE}

Retract to rapid height, turn off colant

(M09 - Turn OFF coolant)

G0 Z{Z_RETRACT} M09

Retract to tool change height, turn off spindle

(G28 G91 Z0 - all coes must be in the same line, move Z axis to HOME POSITION through a reference point)
(G91 Z0 - Causes reference point to be the current location, thus sending axis straight up )
(M05 - Turn off spindle)

G0 G28 G91 Z0 M05

Perform Next tool change or end program

M30(end program)


Tired of printing out Operation lists and then wasting time adding setup information by hand?

There is a neat and easy way to replace standard Operations and Tooling lists with something very compact and usable.

Here are config files i use at my work to create Setup Sheets and tooling lists right from SurfCam.

  1. First make sure you backup you Operations.cfg and Tooling.cfg files in case you want to go back (VERY NOT likely)
    Those can be found inside your V5 or V6\Config directory.
  2. Unpack contents of the attached ZIP folder.
  3. Copy .CFG files found within into your V5 or V6\Config folder.
  4. Copy folder "images" into "C:\Surfcam\" directory, if you want also tool images to show with tooling list.
  5. Go to SurfCam Options and in section Setup Sheet select "Current" from several other choises.

Thats it!!

UPDATE!!!!!!

  • Operations list NOW highlights table rows when you move the mouse over them.
  • When you select ANY text on Operations List, the same text will be highlighted over the whole page!!!

Download current file below

Samples are below:

Read More 


Download file:Surfcam_custom_operations_cfg.zip Downloads:(3622)

Programming Efficient Peck Drilling Cycle

June 2, 2012, 9:18 am by Eldar Gerfanov

Using Peck Cycle is often needed when drilling deep holes.
When using proper feed and speed no peck is required at depths of up to 3xDia for regular or 5xDia for High-Performance Parabolic drills.
At depths up to 10x, up to 5 pecks are required for regular  drills and up to 3 for Parabolic.
Anything over 10x Dia requires constant pecking of 0.5-1x Dia for regular drills and 1.5-2 Dia for Parabolic.

Since for programming you need a peck amount. Here are the numbers:

Code:REGULAR JOBBER DRILLS
3x: No Peck
3x-10x: 1xDia Peck
over 10x:.75xDia Peck
over 15x:.5xDia Peck 
 

Code:HI-HELIX HP DRILLS
5x: No Peck
5x-10x: 2xDia Peck
over 10x: 1.5xDia Peck 

Of course our HSMAdvisor Speed and Feed Calculator suggests not only the Speeds and Feeds but also the proper peck depth for various drill types and depths of the hole.
It in fact was the first machinist calculator to do so. This feature was much later borrowed by our competition.

And here is a pretty image showing Peck VS Hole Depth for regular twist drill:

This not only means that peck amount should be different for different styles of drills and depths of holes.
But also that peck distance should be different for different stages of drilling the same hole.
Ideally we should start the hole with large pecks, that continually reduce as the hole gets deeper and deeper.

Let's find out how we can apply this knowledge when programming our toolpaths.
This is format for normal Pecking:

Read More 


okuma prog samples

April 27, 2012, 1:43 pm by Eldar Gerfanov

Here are some Okuma Captain 1200 program samples for work with live tooling.
Samples are quite big so READ full article

Read More 


Compound Cycle Tapping on Okuma Lathe

April 27, 2012, 12:56 pm by Eldar Gerfanov

Cycle Format:

G184 X Z C K (I) F Q E
OR
G184 X (Z) R C K (I) F Q E

G180 (Cancel)

Read More 


Pages:(2) [1] 2

© 200908:53:46-2016 Eldar Gerfanov. All Rights Reserved.
© 2009 Eldar Gerfanov. Materials on this site are presented as is and are mostly for educational use. You may freely reproduce information presented herein without any consent from me, provided you include link to this site.
In case when i am not the copyright holder, you may want to contact proper owner of material. Anyway, they are freely available on the Internet.
If you hold the copyright right for any of the materials on this site and want them removed, please contact me here