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, 3:28 pm by Eldar Gerfanov (Admin)
NPPGcodeLang3.png

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++.

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 created my own Language profile for it. It is attached to this article so that everyone can download it.

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

  1. Download and Install Notepad++ from here: https://notepad-plus-plus.org/download/
  2. Download the custom language file attached to this article to your computer: download file
  3. Launch Notepad++ and go to Language>Define Your Language...
  4. Click on "Import" button and select the G-Code_N.XML Language file you have just downloaded from my site.
  5. After it notifies you that Import was successful, close the "Define" window and restart Notepad++

That is it.

Now when you load any G-Code file with Notepad++, select G-CODE_N item from the "Language" menu and enjoy the full power of the best text editor with g-code highlighting:

A thing of beauty!

Happy Coding!

Update: A friend named Lucas sent me a version of the GCode language definition for Dark Theme. Please see it below in the downloads section. Thanks, Lucas!

G-CODE_N Language G-CODE_N.xml G-CODE DARK G-CODE_DARK.xml Size:0.01 MB
Tool_Length_Offset.PNG

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 for 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 your 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 absolute 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 the case of Positive Tool Offsets, the offset represents the Length of the tool measured as a distance from the 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.

In such a case, Part Z Work Offset will represent the distance between the same Gage Line to the top of the part.

Pro's of Gage Line (Positive) offsets:

  1. Tool Length Offset remains the same between many machines.
    You can just pull the tool out of one machine, Put it into the other one, Type in its Tool Offset and off you go. There is no need to touch off the tool again.
  2. Positive offsets are the easiest to wrap your head around.
    Each definition represents exactly what it does.
  3. Positive Tool Offsets can be measured offline on a pre-setter and then tools can be quickly loaded into the machine without the need to tough off each tool on the machine individually.
  4. In addition to offline pre-setters, most tool tough-off probes also operate in the Gage Line system

Cons of Gage Line offsets:

  1. Can be less practical on machines without tool pre-setters
  2. You are forced to operate with large negative Z Work Offset values
  3. If your tool pre-setter goes down (who never had a dead battery?) you will have a hard time trying to touch off your tools the alternative way.

In summary. Positive or Gage Line Tool Offsets are practical on modestly to highly standardized/automated machining environment.

Negative Tool Offsets

Negative Tool Offsets are dead-simple.
In its easiest form, it represents the (negative) distance between the tip of the tool to the top of the part.
In such case Z Work Offset will equal zero:

This Tool Offset setting style is often used on older machinery in non-automated or non-standardized machining environments.

The initial Top Of Part flat surface is often faced and filler gage is used to set the tool of the top of it.

Pros of Top of Part Negative Tool Offsets:

  1. Dead-simple. Tool Offset represents the distance between the top of the part and the tip of the tool.
  2. This Tool Offset setting style is supported by default on most machines. Just jog the tool to the Top of Part and press "Write Offset"

Con's of this Offset Type:

  1. Tools need to be re-touched for each and every job whenever the height of the part changes
  2. Tool offsets are not interchangeable between several machines
  3. The part needs to be faced in order to set the tool offsets
  4. Can not set tool offsets off a curved or irregular surface: Imagine you need to rework an already machined part. How will you set the tool heights?

Top of Gage Block Negative Tool Offsets:

You can, however, have a little bit of both worlds.

If your machine is not equipped with an automatic tool pre-setter you have to use your machine's manual tool offsetting routine.
You can Touch Off all your tools of a pre-defined gage block off the top of your table or ground vice surface.

In this case, Z Work Offset will equal the distance between the top of the touch-off gauge and the top of your part.

It is extremely handy to touch off your tools of the solid vice jaw using a 1x2x3 block or a special analog Tool Probe with a dial scale.
Just make sure to use the same height (for example the 2-inch side) all the time.

Because when machining in a vise the part stick-out is the most important value, it is easy to calculate the proper Z Work Offset height.
All you have to do is set your Z Work Offset to -2.0 (in the case when you tough your tools 2" above the top of the jaw) and then add the height of your part above the vice.

Pros of Top of Gage Block Negative Tool Offsets:

  1. The same tools can be used without the need to re-set their Tool Offsets between jobs. Only your Z Work Offset changes.
  2. This Tool Offsetting Routine is supported by most CNC machines.
  3. No need to face the top of your part to set your tools or work offset. Just calculate the distance between the top of the gauge and the top of your part.
    A dial indicator can be used to set the Z Work Offset
  4. A tool pre-setter can be used to set the tool offsets. You would need to supply the Machine Gage Height value to the pre-setter software to calculate the proper Tool Offset value.

 Con's of Top of Gage Block Negative Tool Offsets:

  1. The math involved can be a bit challenging at first. Thus not many beginning machinists use it.
    Eventually, however, most figure out and "invent" this method for themselves
  2. Tool Offsets will be different between different machines. So they need to be touched off again when used on a different machine.

Which Tool Offset Setting Type to Use in Your Shop?

It depends on your equipment and shop practices.
You should, however, stick to one particular Tool Setting style and use it across the shop to avoid machine crashes and mishaps.

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 the axis to give the 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 the 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 the 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.

Many manufacturers put home in the position where is shown on the picture - this way all our Machine Coordinates will be negative.

Others put Table Home to the lower-left corner and then X and Y Machine coordinates will be positive.

There are a few weird ones, who will put their machine's home position on other (Top Let or Bottom Right) corners and then one of the Axis will be positive while the other one-negative.

But in the end, it does not really matter. As nobody uses Machine Coordinates to machine their parts. All it does however is confuse operators and sometimes make them do silly mistakes.

It does not mean, however, that Machine Coordinates are useless for the operator. They are often used to position the table at the end of the operation for easy loading/unloading or whenever a table needs to move to a safe place for extra-long tool change: any place where the absolute nature of Machine Coordinates is a benefit.

Absolute Movement can be programmed with the G53 code. It is often NON-modal and requires either G01 or G00 motion mode enabled and at least one of the X, Y, or Z coordinates.

Typical example:

Code
...

(move table close to the operator)

G00 G53 X-20.0 Y0

M30

This brings us to the...

Work Offset G54 - G59

Also called Part Zero.
As mentioned before, Work Offsets allow us to specify new coordinate systems based on the relative distance of our Part Zero from the Home Position:

In this picture, the G54 offset will be X=-20.000 and Y-11.000

Each Work Offset is stored in Machine Work Offset Table. This way our program does not need to specify where the part is in relation to the Machine Home.
Your typical Work Offset Table will look like this:

Machine Work Offset Table
G54 G55 etc. G59
X -20.000 X -11.000 X 0.000
Y -11.000 Y -5.000 Y 0.000
Z -13.178 Z -11.000 Z 0.000

Work Offsets are activated using G-Codes G54 through G59
A proper Work Offset should be commanded before any absolute move is made.

Typically Work Offset is commanded right after a tool change is made:

Code
...
T15 M6
G54 G0 G90 X0 Y0 S1500 M3
.....

Work Offset commands are modal and they persist until another work offset command cancels it, the machine gets rebooted, or it gets overridden by a work offset modifier.

X and Y axis Offsets signify the distance from the Machine Home to the Part Zero and Z-Offset value signifies the distance from the Part Zero to the spindle nose in Z Direction.

Looking at the table above it is obvious that something does not quite match the picture: Indeed we have a tool in the spindle.
And because different tools tend to have different Lengths, the distance the Spindle has to travel from its Home to the Top of the part will vary as well!

Thus, to account for different Tool Lengths another offset table was introduced.

Tool Length Offset: H1-H99

Tool length offsets allow machine control to account for the fact that different tools have different Tool Lengths.
Application of Tool Length Offset ensures that Programmed Depth of the cut matches the actual depth of machine movement into the workpiece (or above it).

In other words: Both the T01 which is 3.0 inches long and the T02 which is 5.0" long will move to exactly 0.2" above the part when commanded G00 Z0.2

Machine Tool Length Offset Table
H Offset
1 5.132
2 6.00
3... 8.120
...99 3.000

When the Tool Length Offset is applied, the machine adds the Tool Height to the Work Z-Axis Offset. In such a case Tool Offset means the distance from the Spindle Nose to the tip of the cutter:

(Please note that the setup method is shown above, while easy to comprehend and wrap one's mind around, is not the most practical in terms of manual setup and is mostly used on machines, equipped with an ON-Line or OFF-Line tool pre-setter and/or work probe.
Please see the next article where we explore and compare the two different tool set-up methods.)

Tool length offset is activated with a G43 code, followed by the letter H and then by the address of the length offset in the Machine Tool Length Offset Table.
Typically during programming, in order to prevent crashes and mishaps, Tool Length Offset always matches the Tool Number. But nothing stops you from not following this rule when the situation calls for that.

Tool Length offset must be applied of the very first absolute Z-Axis Move after the tool change:

Code
...
T15 M6 (tool change)
G54 G0 G90 X0 Y0 S1500 M3 (Apply work offset, Turn on the Spindle)

G43 H15 Z2.0 (Apply Tool Length Offset while Moving to the Clearance Height)

...(Start Machining)

 

This is a very quick overview of the basic Work and Tool offsets available for a CNC Milling Machine.

In later articles, I will explore alternative methods of offsetting Tool and Work Offsets, Work offset modifiers, and extended work offsets available on most machines.

Lessson 3: CNC Canned Cycles, Drilling, Tapping, Reaming and Boring Cycles

September 20, 2015, 2:49 pm by Eldar Gerfanov (Admin)

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.

The less common canned cycles are:

G-Code Cycle Name Motion Style
G73 High Speed Chip-Break Drilling Incremental Feed-In by Peck Distance, Stop Feed, Repeat
G74 Left Hand Tapping Feed-In,Reverse Spindle, Feed-Out
G76 Boring, Orient Feed-in, Orient Spindle, Rapid-Out
G82 Spot Drilling Feed-In, Dwell, Rapid-Out
G86 Boring Feed-In, Spindle Stop, Rapid-Out
G87 Back Boring Cycle Orient Spindle, Move to Insert Point, Turn Spindle On,
Feed-In to target Z, Retract to start Z, Move to insert point, Rapid Out
G88 Manual Dwell Boring Cycle

Feed-in, Dwell, Stop Spindle,
Stop Program to let the operator manually retract the tool

G89 Dwell Boring Cycle Feed-In, Dwell, Feed-Out

Support of each of these cycles depends on your particular machine. So make sure to double-check you manual before using any. Especially the ones from the second table!

Retract control codes:

G98 and G99 codes control Z- retract distance between holes in the same cycle.
These codes must be applied on the same line as or before the canned Cycle. Or BEFORE each hole in the cycle

G-Code Code Name Motion Style
G98 Clearance Height Retract After each hole Tool retracts to the last rapid - Z height before the application of the canned cycle. Used when there is need to avoid clamps or part features that are above the R-value height.
G99 R - Height retract After each hole Tool retracts to the R value height of the canned cycle

This is how G98 retract modifier behaves:

And this is how behaves the G99 retract modifier:

Where part geometry is calling for use of G98 you can combine G98 and G99 to save on some rapid time:

As you can see we need to apply G98 on the hole after which we need to retract to the clearance height.

The codes shown on this picture are missing X,Y locations in some places. The correct program would look like this:

Code

G0 Z0.5
G81 G99 X1.5 Y2.0 Z-1.0 R0.1 (Drill First Hole. G99 - Retract to R-height)X2.0 Y2.0 R-0.75 (Drill Second Hole)
G98 X2.5 Y2.0 R-0.75(Drill Third Hole, After it Retract to 0.5" Z-Clearance height)
G99 X3.0 Y2.0 R.1 (Drill fourth hole. Retract to R-height)
X3.5 Y2.0 R-0.7 (Drill fifth hole. Retract to R-Height)

G80 (Cancel Canned cycle)

G0 Z0.5 (retract to clearance height)

The anatomy of a standard drilling program is as follows:

Code

O0001 (COMMENT OR PROGRAM NAME)

(Starting safety blocks)
G20 G17 G40 G49 G80 G90

(Tool Change Routine)
T15 M6

(Position Axis over the work)
G0 G54 G90 X1.5 Y2.125 S1500 M03;

(Apply Tool length offset at retract height, Turn on Coolant)
G0 G43 H15 Z2.0 M8

(Rapid tool to Safe Clearance height)
G0 Z1.0

(Activate Canned Cycle and drill the fist hole)
G81 G99 X1.5 Y2.125 Z-0.5 R0.1 F12.0

(drill subsequent holes)
X1.75 Y2.5
G98 X2.5 Y3.0 (Retract to Clearance height to avoid clamp after THIS hole)
G99 X3.5 Y3.0 (Switch back to retracting to R-value)

(Cancel Canned Cycle)
G80

(Retract to Clearance height, turn coolant off)
G0 Z2.0 M09

(Turn Spindle Off, Retract to TC height)
G0 G91 G28 Z0 M05

(End Program)
M30

 

Canned Cycles Format

G-Code Name Format Standard Example
G81 Standard Drilling

G81 X Y Z R F [K or L]

  • X , Y - Location of the first hole
  • Z - Absolute or relative depth of the hole (depending on your control)
  • R - Retract Height
  • F - Feed Rate
  • [K or L] - Number Repeats

G81 X1.5 Y1.0 Z-0.5 R0.1 F15.0
X2.0 Y1.5 (subsequent hole 1)
X2.5 Y2.1 (subsequent hole 2)
G80

G83 Deep Hole Peck Drilling

G83 X Y Z R Q F [K or L]

  • X , Y - Location of the first hole
  • Z - Absolute or relative depth of the hole (depending on your control)
  • R - Retract Height
  • Q - Peck Depth
  • F - Feed Rate
  • [K or L] - Number Repeats
G83 X1.5 Y1.0 Z-0.5 R0.1 Q0.25 F15.0
X2.0 Y1.5 (subsequent hole 1)
X2.5 Y2.1 (subsequent hole 2)
G80
G84 Right Hand Tapping

G84 X Y Z R F [K or L]

  • X , Y - Location of the first hole
  • Z - Absolute or relative depth of the hole (depending on your control)
  • R - Retract Height
  • F - Feed Rate (Usually in Inches per Revolution,depending on your control)
  • [K or L] - Number Repeats
G84 X1.5 Y1.0 Z-0.5 R0.1 F0.049
X2.0 Y1.5 (subsequent hole 1)
X2.5 Y2.1 (subsequent hole 2)
G80
G85 Reaming/Boring

G85 X Y Z R F [K or L]

  • X , Y - Location of the first hole
  • Z - Absolute or relative depth of the hole (depending on your control)
  • R - Retract Height
  • F - Feed Rate
  • [K or L] - Number Repeats
G85 X1.5 Y1.0 Z-0.5 R0.1 F15.0
X2.0 Y1.5 (subsequent hole 1)
X2.5 Y2.1 (subsequent hole 2)
G80

As already noted above each control will handle these cycles a little differently.
So be careful!

Lessson 2: Outside Profile, Cutter Radius Offset Compensation

January 28, 2014, 10:51 pm by Eldar Gerfanov (Admin)

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.

First option is to program to the center of the tool.

In this case all coordinates must be offset manually. This is usually done by a CAD/CAM system, since it is fairly easy for computer to offset the center of the tool.

Out G-Code would look like this:

Code
T5M6 (0.5" 4 FLUTE ENDMILL)
G90 G54 G0 X-0.75 Y-0.75 S5000 M3 (MOVE TO THE START POSITION OUTSIDE THE PROFILE, TURN ON THE SPINDLE)
G0 G43 H05 Z2.0 M08 (APPLY CUTTER LENGTH OFFSET, MOVE TO 2" ABOVE THE PART, TURN ON THE COOLANT)
G0 Z0.1 (RAPID TO THE FEED PLANE HEIGHT)

G1 Z-0.75 F10.0 (PLUNGE TO THE START POINT OUTSIDE THE PROFILE)
G1 X-0.25 Y-0.25 F50.0 (LEAD IN TO THE LOWER LEFT CORNER)
G1 Y2.25 (MILL WALL 1)
G1 X4.25 (MILL WALL 2)
G1 Y-0.25 (MILL WALL 3)
G1 X-0.25 (MILL WALL 4)
G1 X-0.75 Y-0.75 (LEAD OUT)
G0 Z1.0 M09 (RAPID OUT TO CLEARANCE HEIGHT, TURN OFF THE COOLANT)

G0 G28 G91 Z0 M5 (RAPID TO THE TOOL CHANGE HEIGHT, TURN OFF THE SPINDLE)
M30 (END)

As you can see we had to manually add a 0.25" offset to al of our programmed points.
This may look somewhat easy when doing a simple rectangle, but becomes hard and next to impossible when programming complex profiles.
This is called "programming to the tool centre" This programming style is almost exclusive to CAM programs.

The second option

is to program to the finished profile and tell the CNC machine to offset the toolpath by the radius of the cutter.
In that case we have to first apply cutter compensation, and then simply key in our part coordinates to get the proper result - machine handles cutter radius compensation on its own.

Here is how it looks:

Code
T5M6 (0.5" 4 FLUTE ENDMILL)
G90 G54 G0 X-0.75 Y-0.75 S5000 M3 (MOVE TO THE START POSITION OUTSIDE THE PROFILE, TURN ON THE SPINDLE)
G0 G43 H05 Z2.0 M08 (APPLY CUTTER LENGTH OFFSET, MOVE TO 2" ABOVE THE PART, TURN ON THE COOLANT)
G0 Z0.1 (RAPID TO THE FEED PLANE HEIGHT)

G1 Z-0.75 F10.0 (PLUNGE TO THE START POINT OUTSIDE THE PROFILE)
G1 G41 D55 X0 Y0 F50.0 (APPLY RADIUS OFFSET COMPENSATION LEFT, LEAD IN TO THE LOWER LEFT CORNER)
G1 Y2.0 (MILL WALL 1)
G1 X4.0 (MILL WALL 2)
G1 Y0 (MILL WALL 3)
G1 X0 (MILL WALL 4)
G1 G40 X-0.75 Y-0.75 (LEAD OUT, CANCEL CUTTER RADIUS OFFSET COMPENSATION)
G0 Z1.0 M09 (RAPID OUT TO CLEARANCE HEIGHT, TURN OFF THE COOLANT)

G0 G28 G91 Z0 M5 (RAPID TO THE TOOL CHANGE HEIGHT, TURN OFF THE SPINDLE)
M30 (END)

As you can see in the last example all we had to do is tell the machine to apply the cutter compensation. We used coordinates taken directly from our drawing.

This is why this is called "programming to the part profile".

Let me explain what exactly happens in the last example.
g-code G41 tells the machine to apply the compensation to the left of out finished profile. G41 is most often associated with climb milling, so many CAM systems do not bother to inform you that it is left or right, they just specify "Climb milling".
If we were to use Conventional milling, we would have to reverse the order of our toolpath, and program G42 code which enables cutter radius compensation RIGHT.

Whenever we program G41 or G42 we need to also program a lead-in move to allow machine to apply the offset.
Same goes to cancelling the offset with G40.

Here is a picture showing the difference between LEFT and RIGHT cutter radius comp.

Important things to consider

Many machine controls have only one table for Length and Diameter offsets.
So you may have to use different offset number than the one used for the tool number or tool length.

Many controls do not allow G41,G42 or G40 move to be an arc. It almost always needs to be a straght X, Y or both move.

Lesson 1 : Generic G-Code Milling Program Flow

January 23, 2014, 11:40 pm by Eldar Gerfanov (Admin)

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)

Stylish and functional Operations and Tooling List confings for SurfCam

July 17, 2012, 11:00 pm by Eldar Gerfanov (Admin)

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:

<--operations list--="">

CNC PROGRAM INFORMATION SHEET

JOB: DATE: Wed Jul 18 2012 CNC:
DESCRIPTION: File(S): START:
MATERIAL SIZE: XX END:
INSTRUCTIONS:
Surfcam_custom_operations_cfg.zip Surfcam_custom_operations_cfg.zip Size:0.11 MB

Programming Efficient Peck Drilling Cycle

June 2, 2012, 8:18 am by Eldar Gerfanov (Admin)

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:


Code:HAAS FORMAT

G83 X Y L R Q P F

  • X Y : Location of the hole
  • L : Number of holes to repeat is G91 (incremental mode) is used
  • R : Position of the R plane
  • Q : Peck amount
  • P : Dwell at the last peck in seconds
  • F : Feed Rate
  • Z : Target depth

 

Code:HAAS CODE
...
(T15 7/32 HiHelix DRL DEEP a 3.5" Hole)
(Tool # 15 Drill: .21875 )
T15 M6
S6400 M3
G90 G0 X-0.5 Y-1.0
M8
G43 Z0.5 H15
G83 X-0.5 Y-1.0 Z-3.5 Q0.375 R0.1 F48.
G80 G0 Z0.5
...

 Many machine manufacturers have variable peck drilling cycle.
This allows programmer to use deep pecks in the top of the hole and shallow pecks at the bottom.

Using this feature prolongs tool life and greatly reduces cycle time, this also makes programming proper peck easier.

Format for Variable Pecking

Code:HAAS FORMAT

G83 X Y L R I J K P F

  • X Y : Location of the hole
  • L : Number of holes to repeat is G91 (incremental mode) is used
  • R : Position of the R plane
  • I : First Peck amount
  • J : Peck Reduction per pass
  • K : Minimum Peck amount
  • P : Dwell at the last peck in seconds
  • F : Feed Rate
  • Z : Target depth

 

Code:HAAS CODE
...
(T15 7/32 DRL DEEP a 3.5" Hole)
(Tool # 15 Drill: .21875 )
T15 M6
S6400 M3
G90 G0 X-0.5 Y-1.0
M8
G43 Z0.5 H15
G83 X-0.5 Y-1.0 Z-3.5 I1.125 J0.1875 K0.375 R0.1 F48.
G80 G0 Z0.5
...

The sample code above was posted with Surfcam's MPost processor.
Here is the nessesary modifications to the cycle

Code:SURFCAM HAAS MPOST
...
PECK                                        # Pecking canned/manual cycle        I=First Peck, J=Peck reduction, K=Min peck
G83 G98 X[H] Y[V] Z[D] I[VBite]*3 J[VBite] K[VBite] F[FRate] R[VCLear]
end cancel
...

Using this modification programmer only needs to program a single peck value and the post will automatically calculate the I and J values.

Regardless of how you get the variable pecking set up in your post, you should definitely make sure you are using this feature. As this allows you to make sure you don't only get the proper peck for the depth, but also that is is done as efficiently as possible.

In my particular case drilling thousands of deep holes in large moulds time savings were between 50% and 70% versus the regular pecking cycle.

okuma prog samples

April 27, 2012, 12:43 pm by Eldar Gerfanov (Admin)

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

Code:SIDE DRILLING

O1
(12607T020-AAAN PART BEGIN)
G50 S2000
N300 G0 X100. Y50.
M110
NAT10
G94 M146 M8
G17
M0
(T10-28 .150 DRL SIDE TOP )
G0 X10.838 T1028 SB=3000
M13
G0 X10.838 Z-0.375
G0 X10.838 Z-0.375 C0
C0
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C0 D0.125 F12.0
G180
G0 X10.838
C30.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C30. D0.125 F12.0
G180
G0 X10.838
C60.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C60. D0.125 F12.0
G180
G0 X10.838
C90.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C90. D0.125 F12.0
G180
G0 X10.838
C120.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C120. D0.125 F12.0
G180
G0 X10.838
C150.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C150. D0.125 F12.0
G180
G0 X10.838
C180.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C180. D0.125 F12.0
G180
G0 X10.838
C210.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C210. D0.125 F12.0
G180
G0 X10.838
C240.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C240. D0.125 F12.0
G180
G0 X10.838
C270.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C270. D0.125 F12.0
G180
G0 X10.838
C300.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C300. D0.125 F12.0
G180
G0 X10.838
C330.
G101 X9.138 F200.0
G183 X7.2172 Z-0.375 I0.15 L0.125 C330. D0.125 F12.0
G180
G0 X10.838
G0 X10.838 Z-0.375 C330.
M146
G136
G95 M12 M9
M109
G0 X100. Z50.
M1
TLID
(12607T020-AAAN PART END)
M2

Code:FACE DRILLING SAMPLE
O1
(INCAAG PART BEGIN)
N200 G0 X50. Z50.
G50 S2000
NAT09
M110
G94 M146 M8
G17
M0
(T9-15 #7 DRL MTN HOLES)
G0 Z1. T0915 SB=3000
M13
G137 C0
G0 X0.0001 Y0
Z1.
G0 X0.4688 Y0.8119
G0 X0.4688 Y0.8119
G0 X0.4688 Y0.8119 Z1.
G101 Z-0.225 F200.0
G183 X0.4688 Y0.8119 Z-0.8354 K0.1 L0.125 D0.125 F26.0
G180
G0 Z1.
G0 X-0.4688 Y-0.8119
G101 Z-0.225 F200.0
G183 X-0.4688 Y-0.8119 Z-0.8354 K0.1 L0.125 D0.125 F26.0
G180
G0 Z1.
G0 X-0.4688 Y-0.8119
G0 X0.0001 Y0
M146
G136
G95 M12 M9
M109
G0 X50. Z50.
M1
TLID
(INCAAG PART END)
M2

Compound Cycle Tapping on Okuma Lathe

April 27, 2012, 11:56 am by Eldar Gerfanov (Admin)

Cycle Format:

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

G180 (Cancel)

  • X:
    For face operation: Start Position
    For side operation: Target Diameter
  • Z:
    For face operation: Target Position
    For side operation: Start Position
  • C: C-Axis index position
  • I: Shift from G00 for SIDE operation only
  • K: Shift from G00 for FACE operation only
  • F: Feedrate
  • E: Dwell
  • R:
    For face operation: Depth of hole, Negative
    For side operation: Diameter
  • Q: Number of holes to repeat

Example:

Code:"OKUMA SIDE TAPPING SAMPLE PROGRAM"
O1
(12607T020-AAAQ PART BEGIN)
G50 S2000
N300 G0 X100. Y50.
M110
NAT10
G94 M146 M8
G17
M0
(T10-29 10-24 TAP)
G0 X10.838 T1024 SB=300
M13
G0 Z-0.375
G101 X9.238 F200.0
G184 X7.538 Z-0.375 I0.2 C0 F12.5
G180
G0 X10.838
C30.
G101 X9.238 F200.0
G184 X7.538 Z-0.375 I0.2 C30. F12.5
G180
G0 X10.838
M146
G136
G95 M12 M9
M109
G0 X100. Z50.
M1
TLID
(12607T020-AAAQ PART END)
M2

Pages:(2) [1] 2
Sing In

© 2009-2022 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