Created and Maintained by the Real World Software Developers and Machinists at www.KentechInc.com ... click here to check it out !!
Showing posts with label cnc programming. Show all posts
Showing posts with label cnc programming. Show all posts

Tuesday, March 10, 2015

Shop Efficiency Part 7 - CNC Programming

Our Shop Efficiency series has really taken off ... and we would like to take a few lines to say Thank You to all our readers for your email comments and support. We are very pleased that we have been able to take some of our real world machining and machine shop experiences and turn them into valuable tips and pointers and pass them on to so many of you. Thanks so much for your support.

First - A little background on this Post
At first glance ... since Kentech Inc. develops and sells CNC programming software ... this post might look like straight marketing and a sales pitch for our Kipware® conversational CNC programming software. Actually ... it's a story of just the opposite. Most of our software titles have been designed and developed based on what we saw was lacking in our many years on the shop floor. Our Kipware® conversational CNC programming software is a product of that experience.

One of my most telling personal experiences was working in a shop here in Masachusetts as a CNC machinist. The shop was your typical job shop with all kinds of work coming through the door. Most of it was fairly simple ... with a few plastic injection mold type jobs every once in a while. The CNC programming was supposed to be done by the shop floor machinists ... using a CAM plug-in for Solidworks ... which was a bit complex. No CAD/CAM training more than a simple tutorial was offered or provided. As a result ... since most shop floor machinists were great at cutting chips but lacked intense CAD/CAM experience ... and the jobs were fairly simple ... they often resorted to manual programming. The result was programs loaded with mistakes ... from typo-errors to incorrect toolpaths ... and the result from that was scrap, broken tools and sometimes worse ... but the overall effect was complete shop floor inefficiency.

The frustration level on the floor ... needless to say ... was very high. The machinists were basically unable to do their job ... because no one trained them on the complex CAD/CAM system ... and there were no other tools to help them ... other than an editor.

In this environment ... our conversational CNC programming concept and design was born. It was plain to see that the CAD/CAM and a CAD/CAM programmer was required for the mold work ... but clearly for the 95% of programming we did on the shop floor it was NOT required. In fact ... having the CAD/CAM option as the only option ... actually made things worse.


CNC Programming and the LINK to Shop Efficiency
Which brings us to this post and the subject of CNC programming as it pertains to shop efficiency. Obviously ... if the program isn't created in an efficient and correct manner ... the parts don't get made and the money doesn't flow. But just as important as tooling and fixturing ... the program creation process must have options also. You wouldn't think of placing a simple rectangular piece of stock in a custom made fixture ... you would use a vise. In the same way ... you shouldn't think of programming a simple part with a round pocket and bolt circle through a complex CAD/CAM system. The real key to efficient shop floor programming is having an ARSENAL of tools at your disposal. Thinking about your CNC programming as more of a tool ... with multiple choices for various situations ... will help your shop floor reach a higher level of efficiency.

CNC Programming Tools Available
We've listed what we consider to be the realistic options for CNC programming available to anyone creating CNC programs in a "job shop" environment ... the environment where our readers predominately are working ... and the options up for discussion in this post.
  1. CAD/CAM
  2. Off-Line Conversational CNC Programming Software
  3. Conversational CNC Controls
  4. G Code "wizards"
  5. Manual Programming through an Editor
"Wizards" and Manual Programming
To narrow the discussion a bit ... let's remove the two options that are really not realistic in a professional machine shop environment. So called G code wizards are way too simplistic and act
more as hindrance and weight than any kind of efficient tool. Full conversational programming software makes much more sense both from a financial and capabilities perspective. Full, quality conversational software is a programming system ... not a simplistic crutch.

Manual G code programming should only be considered for the simplest of parts. Human error plays too great of a role in any other scenario and really renders this option a last resort choice for a professional programming environment.

That's not to minimize manual CNC programming knowledge and experience. Any CNC programming option used is made VASTLY more efficient and productive when operated through the hands of an experienced manual CNC programmer. A good Editor should always be available to allow that experienced CNC programmer the tool to alter or edit auto-created G code. The point here is that creating programs from scratch manually is not a good choice. Even for simpler programming ... a tool that will auto-generate the code provides stability ... and the manual tweaking of the code can enhance that output greatly.

CONVERSATIONAL and CAD/CAM
Efficient CNC Programming Requires an ARSENAL of Tools
It's more about OPTIONS than OPTION
In a professional environment ... really the two main options are CAD and / or CAM and full, quality conversational programming software. The CAD/CAM option can really be broken down into two options. First the CAD option is a must for any design environment ... even when that is just supporting the shop floor with fixture design. Professional CAD can range from the simple to the complex ... and from the FREE to megabucks. Each shops design and CAD needs would drive that discussion. However ... going from the CAD drawing to a G code program does not necessarily have to through the expensive and complete CAD/CAM system.

Using conversational software ... that CAD drawing can also be turned into a G code program. DXF import can be used in quality conversational software and a variety of other applications to go from a CAD drawing to a G code program.  And of course ... the integrated CAM option can be used to go from that CAD drawing to a G code program.

The main point is that no two workpieces are exactly alike ... and the right programming option for one will most likely not be the right programming option for another. From our experiences ... the best programming method for any job involves (2) main factors :
  • Who is the best choice to create that program? Shop floor? Dedicated programmer?
  • What is the best tool for that individual to use to create that program quickly and accurately?
Letting the correct answers to these questions guide the process ... rather than forcing the path because of limited options ... will increase your shop efficiency when it comes to programming your CNC's. Some thoughts :
  • Maybe the best person to create the program is not full CAD/CAM proficient but would be the best chip-maker for the job ... a shop floor conversational programming option might be the best solution. 
  • Perhaps the job is very complex ... and the only solution for an accurate and efficient toolpath is the CAD/CAM alternative. 
The point to make is that with an arsenal of tools available ... the experience of your personnel and the complexity of the workpiece / programming can dictate the most efficient path to take for the program creation. This allows for the free flow of efficiency ... rather than ramming the square process through a round hole.

Machine Tools with conversational CNC controls
Conversational CNC controls mounted directly to a CNC machine appear to be the perfect solution ... but actually have some important points to consider. The alternative of purchasing a laptop or Windows based tablet ... loading it with conversational software ... is more often than not the better alternative. Here are our major reasons to support this claim :
  1. CHEAPER ... conversational CNC controls can be quite expensive. A tablet with conversational software will cost less than $1200.
  2. PORTABILITY ... having the ability to do the programming on the shop floor, in the office, at home ... makes a portable alternative very attractive.
  3. PROGRAM MULTIPLE MACHINES ... the ability to simply move the laptop around or pass it off to someone else gives you the ability to use the "conversational control" on multiple machines. Other machines can also be purchased without the conversational option ... you already have a "conversational control".
  4. PROGRAMMING AT THE MACHINE ... even though most modern conversational controls have basically (2) modes ... the conversational programming mode and the machine operation mode ... they can often result in headaches and frustration. Either the machine is not runnning waiting for a program to be created ... or the machinist is programming the next job while trying to run production. Not the best environment to say the least.
  5. CNC CONTROLS ARE NOT COMPUTERS ... most industrial grade CNC controls do not have the power or capability of a desktop or laptop PC ... they are simply not constructed from the same components. And if they are a PC ... they are most likely NOT an industrial grade PC and not fit for the harsh machine shop environment.
  6. CONVERSATIONAL SOFTWARE IS MORE POWERFUL ... backed by the power and capabilities of a PC ... conversational SOFTWARE is more powerful and has more options than conversational software operating on a CNC control.
Some Closing Thoughts ... 
The main reason for combining this post into our Shop Efficiency series is to get shops thinking about all the potential programming tools available. Our experience shows that the most efficient CNC programming is accomplished when an ARSENAL of good tools are made available. Inevitably users might find and use their favorite tools ... but the key is that they have the ability to choose from an assortment. Also ... that the other tools remain available when the need arises ... providing choices. Also ... when an assortment of tools is available ... shops can increase the number of people who can create those programs ... and that is a huge jump in shop efficiency. Creating CNC programs faster ... using more people ... means more spindles turning and that means more profits being generated. And isn't that the true test of Shop Efficiency?

Please come back for our next installment in our series on Shop Efficiency.
Until next time ... Happy Chip Making !!

At Kentech Inc. we are MACHINISTS who create Real World Machine Shop Software.
Who creates the machine shop software guiding your shop's future ??
Check out all our REAL WORLD CNC & MACHINE SHOP titles at 

Wednesday, July 2, 2014

When is a CNC Program more than a G code program ?

... when it's a set-up sheet as well.

Most people are familiar with the ability of most CNC controls to include COMMENTS in the CNC G code program itself. Comments are designated in a variety of ways from :
  1. ( THIS IS A FANUC AND OKUMA COMMENT ) ... any text inside (  ) is considered a comment.
  2. ! THIS IS AN ACRAMATIC COMMENT ... any text following the ! is considered a comment.
  3. ; THIS IS A FAGOR COMMENT ... any text following the ; is considered a comment.
  4. and on and on we could go.
Comments can be a real help when they include operator messages ... such as :

M00 ( TURN PART AROUND )
or
M00 ! CHECK DIMENSION A

... but comments can go well beyond operator messages and can turn your G code program into a complete set-up doc as well that includes tool information, part zero locations and even stock descriptions.

Most people will create either a paper or digital tool sheet / list and / or set-up sheet / list that is stored and re-called when the corresponding G code program is going to be run again. The set-up personnel refer to these docs to set the machine up ... loading required tools and setting height offsets and work offsets. Works great ... no problems. But is there a better alternative? The answer is a "could be" yes. By storing this information directly in the G code program using the COMMENT capability of your CNC control. For example ... something like this :

O1234
( PART #1234 )
( PROVEN PROGRAM : 7/2/2014 )
( PROGRAMMER : JM )

( PART LOCATED IN VISE USING JAWS JW-1234 )
( STOP SET-UP IS RIGHT SIDE - WORKPIECE STOP AGAINST FLANGE )
( X/Y PART ZERO IS LOWER LEFT CORNER )
( Z0 = TOP FINISH SURFACE )

( T1 / H1 = #3 CENTER DRILL )
( T2 / H22  = 1/2 DRILL )
( T3 / H3 = .500 CARBIDE END MILL )

So what is the advantage of keeping this info directly in the G code program using the COMMENTS capability of the CNC control?

  1. Harder to misplace ... if you're going to run the program, you need the program ... and all the set-up info is right there stored right inside the G code program.
  2. Complete info is there for all to see at any time ... no rummaging for loose paperwork or docs.
  3. Any edits or changes can be made directly in the program ... when the running program is saved after execution ... all the current set-up info is changed and saved as well including all updated data.
We often get asked ... "Won't this slow down my program execution speed?" The truth is that it will ... but it will also be so minimal that usually the cost savings of having comments and all the convenience that comes with it far outweigh any reduction in program execution time. Rummaging around for lost documentation or re-creating lost documentation would be the real money waster.

Just a little something to think about if you haven't considered COMMENTS already in your CNC programming. We touched on only a few points here ... but we're sure you can find many more benefits depending on the capabilities or lack thereof pertaining to your particular CNC programming operation. The fact is that expanding the use of COMMENTS in your CNC programming could be a real time and money saving alternative to digital or paper documentation.

Until next time ... Happy Chip Making !!

Please visit our website for the best in Real World Machine Shop Software ... 
just CLICK the pic below !!

Tuesday, May 6, 2014

G01 - Use Me For RAPID Movement Too !!

To experienced G code programmers ... we might be stating the obvious here ... but for the novice, this blog post may reveal a valuable programming trick that may come in handy during your CNC programming life.

When learning G code programming ... one of the first codes taught are G00 and G01. G00 is used for rapid movement ... making the axis move at their top speeds ... while G01 is used for moving at a feedrate in a straight line. If we take a look at some of the details of these codes ... we will also reveal a few hints into how they can be manipulated beyond their basic design.

A couple of notes on G00 :

  • As stated G00 executes axis movement at their top speed ... so we can get to the destination as quickly as possible.
  • Oftentimes ... the two axis are not created with the same rapid traverse speed ... for example the X axis may be able to travel 1200 IPM while the Y axis is only capable of 850 IPM. This is often due to the design of the machine ... size of the ball screw, etc..
  • When two axis are involved in the G00 move ... the distance each axis has to travel is the determining factor as to which axis reaches it's destination first ... resulting in a move that is not a straight line.
  • Oftentimes ... the machine is equipped with a RAPID OVERRIDE switch / dial that allows the user to slow down the rapid movement by some percentage ... 25% - 50% - 100%. BUT ... there is usually no a variable setting ... so the rapid movements are hard to control when working in tight corners during program prove out.
A couple of notes on G01 :

  • G01 executes axis movement at a programmed feedrate ... the axis moves at a rate that we determine via the F command.
  • When two axis are involved in the G01 move ... the machine's CNC controller calcuates the speed at which each axis will move so that each axis arrives at the end point at the same time ... always resulting in a move that is a straight line.
  • Oftentimes ... the machine is equipped with a FEEDRATE OVERRIDE switch / dial that allows the user to slow down the feed movement by percentages ... there is usually a variable setting ... and allows for extensive flexibility during program prove out ... even to pause the movement completely.
SOooo What??
The points outlined above lend themselves to some "bending and twisting" and result in some nice features that can be employed in our CNC programming ... such as :
  • We often think of G01 movement as cutting feed or cutting movement ... but using a faster feed of 200-300 IPM or higher ... when not cutting can turn a G01 move into a "rapid" move. 
The two main advantages of programming G01 for rapid include :
  • Programming a fast feed into a G01 block will always result in a straight line move ... comes in handy sometimes when moving around the part and avoiding possible collisions that a non-linear move like G00 may cause.
  • The FEEDRATE OVERRIDE switch allows us greater flexibility during programming prove out than the RAPID OVERRIDE ... but yet when running at 100% the fast feedrate doesn't have to effect our cycletime.
Thinking Outside the Box ... always produces interesting results. In this case ... we can bend the intended use of G01 to assist us creating an un-intended yet beneficial cutter movement. 

Got Ya Think'in ?? 
Any Other Ideas ??

Wednesday, February 5, 2014

Drill Point Calculations Made Simple

Hanging out on the shop floor we see a lot of programmers / operators "struggling" with finding the correct dimension for either countersinking or drilling through a workpiece. So we thought it a good time to put some simple formulas out there to remind our fellow machinists / programmers how the calcs are done and what factors effect those calculations.


What factors effect the calculations? There are basically two  :
  • Diameter of the drill
  • Angle of the drill point
Once those values are known ... you can easily calculate the length of the drill point using one of the choices below :

The Complicated ... But Accurate Method :
  1. Find the radius of the drill
  2. Take the angle of the drill point and divide that by 2 ... a normal twist drill angle is 118 degrees.
  3. The final formula is drill radius / Tan(angle from step #2)
Obviously this method will work and provide an accurate answer for any angle drill and countersink.

The "Rule of Thumb" Method for STANDARD drills :

Here is the common "rule of thumb" method for standard 118 degree drills. Obviously if you are dealing with countersinks or non-standard tip drills ... you need Method #1 above. But for a down-and-dirty calculation for standard drills ... just multiply the drill diameter by .300 ... inch or metric, doesn't matter.

Here's where that formula came from ... it assumes the standard drill point angle of 118 degrees :
  1. 118 degrees / 2 = 59
  2. 90 -59 = 31 ( using the angle opposite that of the one above )
  3. The tangent of 31 is .6009 / 2 = .3004 ... or rounded of to .3
Hope this helps the next time you are calculating the depth of a counterbore ( in which case method #1 should be employed ) or how to deep to drill through a workpiece ( where the rule of thumb method should do just fine ).

If you're looking for a software application that gives formulas like this as a handy reference ... check our our KipwareTB® - Machine Shop Toolbox Software ... just click the link below.




Until Next Time ... Happy Chip Making !!

Wednesday, August 28, 2013

Fanuc Macro Programming Series - Part #5 : Arithmetic Functions / Control Commands

The power of the Custom Macro language lies in the use of a variety of arithmetic functions within the custom macro body. This features gives the user the power to re-define and re-calculate the values of variables "on the fly." This post is meant as a brief explanation and overall view of some of these functions available with a more in-depth view given in following posts in this series.

Types of Commands Available 

Definition and Substitution
( #100 = #101 )

Addition and Subtraction
( #100 = #101 + #102 )
( #100 = #101 - #102 )

Multiplication and Division
( #100 = #101 * #102 )
( #100 = #101 / #102 )

Logical Sum -- Exclusive OR -- Logical Product
(  #100 = #101 OR  #102 )
(  #100 = #101 XOR  #102 )
(  #100 = #101 AND  #102 )

Trigonometric Functions
( #100 = SIN(#101)) ----- Sine
( #100 = COS(#101)) ----- Cosine
( #100 = TAN(#101)) ----- Tangent
( #100 = ATAN(#101)) ----- Arc Tangent
( #100 = ASIN(#101)) ----- Arc Sine
( #100 = ACOS(#101)) ----- Arc Cosine

Other Mathematical Functions
( #100 = SQRT(#101)) ----- Square Root
( #100 = ABS(#101)) ----- Absolute Value
( #100 = BIN(#101)) ----- Conversion from BCD to BIN
( #100 = BCD(#101)) ----- Conversion from BIN to BCD
( #100 = ROUND(#101)) ----- Rounding Off
( #100 = FIX(#101)) ----- Discard fractions less than 1
( #100 = FUP(#101)) ----- Add 1 for fractions less than 1
( #100 = LN(#101)) ----- Natural Logarithm
( #100 = EXP(#101)) ----- Exponent with base
( #100 = ADP(#101)) ----- Addition of

Another powerful feature of the Custom Macro language is the ability for the user to control the flow of the programs execution. Using a variety of what is called CONTROL COMMANDS, the user can repeat areas, jump to areas and set conditions for program execution.Again, presented here is a brief explanation and overall view of some of these functions available with a more in-depth view given in following posts in this series.

Types of Control Commands Available 

DIVERGENCE
IF < condition> GOTO N----
When the <condition> is satisfied, the program execution jumps
to sequence number N----.
Example : IF [#100 = #102] GOTO N100

CONDITIONAL EXPRESSIONS EXPLAINED
The following are expressions that can be used to define conditional expressions :
EQ = equal to
NE = not equal to
GT = greater than
LT = less than
GE = greater than or equal to
LE = less than or equal to

ITERATION
WHILE < condition> DO <number>
......
END <number>

While the <condition> is satisfied, the program executes blocks between the WHILE statement and the END statement.

Example : 
WHILE [#100 LT #102] DO 1
( program commands )
( program commands )
( program commands )
#100 = #100 + 1 ( add 1 to #100 at the end of each body run )
END 1

BRANCH COMMAND
GOTO N----

Program execution jumps to sequence number N----
Example : GOTO N101

----------------------------

Being well versed in the information from this post will be a big help as we go forward with some macro programming examples in future posts.

The fun is just beginning ... Stay Tuned !!

Wednesday, August 14, 2013

Fanuc Macro Programming Series - Part #4 : System Variables

The last type of Fanuc Macro Variables we will cover in our series are called SYSTEM VARIABLES. System Variables are fixed variables and read and reflect on conditions or values found somewhere in the CNC system. There are a variety of System Variables available to the user but they can for the most part be classified into some major groups :

INTERFACE SIGNALS :
The status of various input / output signals can be read using System Variables #1000 thru #1035, #1100 thru #1115 and #1132 thru #1135. Users should consult with their own individual electrical diagrams as specific input / output signals can be designed differently by different machine tool builders. But the general configuration looks like this :



TOOL GEOMETRY OFFSET VALUES :
Tool offset values as well as work offset values can also be read and modified through the System Variables as well. Those variable configurations look like :


WORK OFFSET VALUES :
Work offset values ... G54 thru G59 ... can also be read and modified through the System Variables as well. Those variable configurations look like :


ALARM GENERATION :
Users have the ability to generate ALARMS with user defined message using System Variable #3000. The format for using System Variable #3000 is :

#3000 = XX ( error message defined here )

In the above format ... XX is the error message # ( must be less than 999 ) and the error message to display is defined between the (   ) . For example :

#3000 = 123 ( ERROR ENCOUNTERED )

When the macro program executes the line as above, the machine would enter the alarm condition ... the CRT will display Error #123 followed by the message ERROR ENCOUNTERED. Clearing the alarm condition is as normal.

The user has complete control over the Alarm # and the message to be displayed.

SUPPRESSION OF MACHINE FUNCTIONS  :
Through the use of the System Variables as outlined below ... users can suppress certain machine functions. Users should exercise caution when using these System Variables.


MODAL INFORMATION :
Modal information ... up to the current block ... can be read using the System Variables as outlined below :


POSITIONAL INFORMATION :
Using the System Variables as outlined below, the position of each axis of the machine can be read. The chart outlines the type of position ... and whether or not the tool offsets are considered.


----------------------------------------

Now that we have all the definitions out of the way ... the next posts in our series will put all these definitions to use. THE FUN BEGINS ... Stay Tuned !!

Wednesday, July 31, 2013

Fanuc Macro Programming Series - Part #3 : Local & Common Variables

Part #3 in our Fanuc Macro Programming Series is dealing a little bit more in-depth with the definition and use of Local Variables and Common Variables

LOCAL VARIABLES :
Local Variables are so named because they are used "locally" in a macro program. This means that the value of the local variable is retained only in the program for which it was assigned. Values of local variables are not retained when branching out to other sub programs.

Local variables are primarily used for data transfer or for intermediate calculations within a macro. The table below represents the local variable available LETTER ADDRESS and corresponding NUMERICAL ADDRESS contained in the macro program. Local variables are assigned either through the use of the G65 command or by direct data input. All local variables are "vacant" unless assigned, and can be freely used by the user.


Program Example using Local Variables :

Assignment by Macro Call :
Macro Call : 
G65 P1234 A2.00 B5.00 ;
Result :  
G65 call assigns the value of 2.00 to local variable #1 ( A )
G65 call assigns the value of 5.00 to local variable #2 ( B )

Program Command :
G01 X#1 F#2
Actual Command :
G01 X2.00 F5.00

Direct Assignment by Program Command :
Macro Statement : 
#1 = #2
Result :
Direct assignment of variable #1 set to the value of variable #2

Intermediate Calculation within a Macro :
Macro Statement : 
#1 = #2 + #3
Result :
Variable #1 is equal to the sum of variables #2 and #3

---------------------------------------------

COMMON VARIABLES :
Common Variables are different from local variables in that once a value is assigned, that value is shared by all other macros and the values are not cleared at M30 or RESET. This means that #100 used in one program is the same value of #100 used in another program. In addition, if the value of a common variable is calculated in one macro, that value is retained when called in another macro.

The main important feature of common variables lies in the fcat that they can be used between macros and that their values are not cleared at M30 or RESET. Users should be careful when performing calculations with common variables because when the program is re-started, the value of common variables is retained from any previous calculations and may produce unexpected results. Common variables can be freely used by the user.

#100 thru #149
These variables are cleared at power off

#500 thru #549
These variables retain their value even after power off.

--------------------------------------------

Stay Tuned for more ... 

Monday, July 15, 2013

Fanuc Macro Programming Series - Part #2 : Variables

What Are Variables
The Fanuc Custom Macro language uses a variety of what are called VARIABLES in the language. Variables can perform a variety of chores in the language, their main job is to carry and gather data for use in the macro program.

A Variable always begins with the # sign, followed by a number. For example, #100 is a variable. In it's simplest form ( without getting into specifics of how that is done ... it will be covered later ), a variable is used to carry data. An example :

First Program Line : #100 = 2.00
Second Program Line : G01 G90 X#100 F10.0

In the above example, the macro program first defines the value of the variable #100 ... that value is 2.00 as defined in the First program line. The variable #100, carrying the value of 2.00, is called or used in the Second program line. To the control, the value of the Second program line is :

G01 G90 X2.00 F10.0

Once the variable is defined ( without getting into specifics of how that is done ... it will be covered later ) anytime the control sees the variable, it replaces it with it's defined value, in this case 2.00.

To take this just a step further ... remember anytime the control sees the variable #100 it will substitute it's defined numerical value, the following line :

G01 G90 X#100 F#100

would read to the control :

G01 G90 X2.00 F2.00

As mentioned, variables have other functions as well. The types of variables available will be discussed in more detail in various posts in our series.

Types of Variables
There are basically (3) different types of variables available ... the type to utilize is dependant on how you want the data to be transmitted.

Local Variables
( # 1 thru #33 )
Local variables are primarily used for data transfer and their value remains active only within the local program. When a sub-program is executed, the value of the Local Variable does not carry over into the sub-program. The value of a Local Variable is usually set using the G65 macro call command.

Common Variables
( # 100 thru #149 and #500 thru #509 )
The main difference between Common Variables and Local Variables are that Common Variable values are retained between programs. That means that the #100 used in one program is the same in every other program or sub-program called. The value of any Common Variable, even if arrived at via a mathematical instruction, is the same value in subsequent program use.

The value of variables #100 thru #149 are cleared at power off, while those of variables #500 thru #509 are retained, even after power off. However, these conditions may be altered via Parameter Settings.

System Variables
System Variables are normally used to obtain conditions, positions or values from areas within the CNC control. Some examples of the use of System Variables :
  • To record an axis position at a certain time
  • To record or adjust a tool offset value
  • To record or adjust a work coordinate offset setting
  • To generate s user defined alarm condition 
  • Suppress the single block, feed hold, feedrate override functions
  • Read and record modal information
Stay Tuned for more in our series !!

Tuesday, July 2, 2013

Fanuc Macro Programming Series - Part #1 : Basics

R U Sitting Down ??
OK then Buckle up !!!

We are about to begin a long ... somewhat complex ... but very beneficial series teaching the how's ... why's ... and details of the Fanuc Macro B Programming Language. If you do CNC programming and are utilizing a Fanuc Control ... your review and understanding about what we are about to present will definitely send you to the next level of CNC programming.

Over the next months ... we will be interspersing articles in this series covering Fanuc Macro B programming from the basics to the complex. We will still be including and sharing some of our sought after CNC Tips and Tricks ... but we will also be including articles in this series as we go along as well.

So check back often ... follow along ... and hopefully we can help bring your CNC programming skills to the next level.

P.S. - A lot of the information here is included in our KipwareEDU® - CNC Programming Training & Reference Software - Macro Version. So if you like what you see here ... and there's tons more in KipwareEDU® ... you can purchase the Macro Version of KipwareEDU® and have this information at your disposal on your own PC ... or use it to tech your personnel. KipwareEDU® contains the info here and tons more along with in-depth video training not included here.

Part One : The Basics
What is Fanuc Custom Macro B ?
Custom Macro is the name given by Fanuc to it's programming language that enables users to take the standard G code programming to another level. Custom Macro allows users to include instructions, mathematical equations, changing variables and a host of other advanced functions in a G code program.

Because of the power of this language, anytime a thought occurs like " I just need to repeat what I did here" or similar, it's probably a good time to consider using custom macro programming. Some examples where Custom Macro programming can be employed :

  • Dimensions or other values require calculations or re-calculations "on the fly". 
  • The programming of family of parts or parts that repeat the basic operations but contain only dimensional changes.
  • Dimensions or other values need to be stored or transferred to other addresses in a program.
  • Complex operations where the basic pattern or cutting sequence remains the same ... an example would be pocketing ... but dimensional changes, that can be defined by one or a series of mathematical formulas, need to be re-calculated "on the fly".
  • The basic "rule of thumb" is that Macro programming probably can be utilized anywhere where repetition exists.

As you explore this series, we will bring out many instances where macro programming can and should be employed ... but we are also sure that these will open doors to macro programming examples in your own world as well. Keep an open mind !!!!

Macro Programming vs. Sub Programming
There are similarities and many differences between a CUSTOM MACRO program and a standard SUB PROGRAM. We outline in this chapter some of the major differences and similarities.

SIMILARITIES :
  • Both types can be called from another program.
  • Both types are stored in memory  under their own program number.
  • Both types can be called to repeat a pre-determined number of times.
  • Both types can be called multiple times from other sub or macro programs.
  • Both types end with the M99 command.
DIFFERENCES :
  • Macro program body can perform and contain mathematical equations.
  • Macro program calls can establish values for variables used in the macro program. 
  • A macro program can be called and made "modal" to repeat until the cancel command is issued.
  • Macro programs can be called from user defined G, M and T codes via parameter settings.
The creation of a custom macro program is identical to the creation of a sub program. Both types are registered to the memory under their own program number and stored separately in the memory. As with sub programs, the end of the custom macro program is done through the use of the M99 command.

OK ... there are some basics. If you have questions ... I'm sure we will address them in the coming articles.

SOOO ... stay tuned for even Happier Chip Making !!





Wednesday, June 19, 2013

Don't Just Fill Your Oils ...

... Track Them ?

Why? I'm glad you asked !!

Did you know that filling your way lube tank can tell you a story about your machine's performance. It can, if you use the information to your advantage. How?


The best way is to make an oil fill reminder form and post it on the machine. Each time oil, any type of oil, is added to the machine, have the operator jot down the following:

  • Type of oil added
  • Date and Time the oil was added
  • Amount of oil added
  • On a turning center, when the chuck was greased

This data can be used for the following :

Type Of Oil : this tells you which oil tank might be giving you trouble. If you're filling the hydraulic tank (a closed system) - WHY and WHERE is the oil leaking from. Low hydraulic oil could result in a loss of pressure and perhaps an un-chucking of a part being machined with catastrophic results. If you're replacing way-lube (which you should), what kind of schedule are you on. This list should show a difference in the frequency of the filling which will easily and early show a way-lube system problem and head-off major repairs.

Date and Time the oil was added : this info gives you a clear view of the filling schedule. Again, not filling the way-lube tank, for example, will be easily seen and catastrophe can be averted.

Amount of oil added : as above, this info gives you a clear schedule of the filling schedule. Filling the way lube tank once every two days instead of once every three days will show up and might signal a line break or other problem that can easily be spotted and repaired in time.

As with everything in life, the info gathered is only as good as the person viewing it. Teach you operators to be hands-on people and to pay attention to this list, perhaps every morning with the machine start-up. Simple ideas like this TIP can help extend your machine's life and cut down dramatically on your machine's down time and repair bills.

Live Long ... and Make Chips !!

Wednesday, June 5, 2013

Spindle Load vs. Spindle RPM

Which is the true test of how hard your machine is working ?

If you had to watch the spindle speed meter or the spindle load meter on your CNC machine ... lathe or mill ... to determine if your machine was working too hard, which one would you choose?


The truth of the matter is that although the spindle load meter does tell you the power draw on the spindle motor, the RPM gage is a more accurate representation of how hard the spindle is working. Most machines come with a specific rating for load % per a specific time such as (in laymans terms) : "You can run this machine at 100% for 30 minutes."


That is of course a true statement and you can watch the load meter while cutting and reach that spec. However, if you watch the RPM gage while cutting and see it fluctuate wildly - basically because the motor is trying to keep the spindle at the specified (programmed) RPM - you'll never reach that 30 minute time frame. Because the cutting is so heavy in this type of case, the motor must keep "powering up" to keep the programmed RPM specified. This takes much more power draw on the motor than simply running constant at 100% load for the 30 minutes.

The Solution : When your machine is cutting, watch the RPM gage first to insure that the cutting conditions are resulting in a smooth RPM for the spindle and not wild fluctations as the motor fights to keep the speed constant. Secondly, adjust the cutting conditions so that the load meter is as high as you think you want (there is nothing wrong with 70-75%) and then recheck the RPM gauge to make sure that the RPM's are smooth at those settings. Smooth RPM cutting will result in better life for the spindle motor and smoother surface finish on the workpiece as well.

Happy Chip Making !!

Check out our Real World World machine shop software at www.KentechInc.com
Conversational CAD/CAM
Quoting & Estimating
G Code Conversion
CNC Training
.... and MORE !!!

Tuesday, May 21, 2013

Multi-Part Machining Series - Part #3

Machining Multiple - Different Parts

So far in our series we have looked at machining multiple parts of all the same part mounted in our fixtures during our machining cycle. What if we want to machine different parts during the cycle ... we want to mount different fixtures on the table and machine one of each during the machining cycle.

First let's look at some reasons WHY we might want to do this.

  1. Perhaps we will be delivering an assembly made of multiple parts we need to machine. If we machine all the components at the same time ... during the machining cycle ... we can better accomplish scheduling and production of the entire assembly.
  2. Perhaps similar parts utilize similar cutting tools ... if we can machine them at the same time we can reduce and better control our tooling requirements both from a "tool in the machine" as well as from an inventory viewpoint.
  3. We need to break into a production run for some "special circumstance" ... rather than halt the production all-together, we can sneak another fixture on the table and machine both parts during the same cycle.
  4. Having lived in the real world ... we could go on and on and on ... you know !!

Looking back at Part #1 and Part #2 in our series ... any of these scenarios certainly becomes a fairly simple task.

Fixture Offsets from Part #1
As we mount the different fixtures on the table ... we can establish a Work Offset for each fixture. Now each fixture is independent of the others ... and can be called with a simple G54-G59 call.


Sub-Programming from Part #2
We could use a variety of sub-programming options to accomplish the various scenarios. The easiest is to simply have a complete machining program for each fixture ... and call it using the sub-program call in our main program. So we would utilize a main program to actually link all our different machining programs together. Something line this :

Main Program :

O0001
G54
M98 P1234 ( program to machine fixture #1 completely )
G55
M98 P5678 ( program to machine fixture #2 completely )
G56
M98 P8888 ( program to machine fixture #3 completely )
M30
%


When we press the cycle start at program O0001 .... it will call each of our compete machining programs and will machine the workpieces at each fixture completely. Simple. You could get very creative and efficient if you did some specific tooling / sub-programming calls ... think about it.

And .... we still have our independent programs available should we need to just machine one of the parts for some reason.

As I'm writing this ... different scenarios and reasons to utilize this approach keep popping into my head. But rather than write a long dissertation here ... look around your shop ... look at your work flow ... and see if you can view some of your own scenarios where better work flow can be achieved using some of our talking points from this series.

If you are so inclined ... please drop us an email at Sales@KentechInc.com ... tell us some of your unique situations ... or even ask us our recommendations ... and we'll publish / add them into this post for the benefit of others to review.

Thanks in advance to everyone ... and Happy Chip Making !!

Check out our Real World World machine shop software at www.KentechInc.com
Conversational CAD/CAM
Quoting & Estimating
G Code Conversion
CNC Training
.... and MORE !!!



Wednesday, May 8, 2013

Multi-Part Machining Series - Part #2

Programming for Multiple Fixtures

So the decision has been made ... "We need production ... which means we need to mount as many vises or fixtures on the table as we can fit ... to make as many parts as possible."

First scenario ...
  1. We are going to make all the same part. 
  2. For our example here ... let's say that we can fit 4 fixtures on the table ... we are going to machine 4 parts in one cycle.
Some thoughts :
  1. When the tool is in the spindle ... we want to do as much work with it as possible. That means hitting each part on each fixture while it's in the spindle.
  2. As mentioned in Part #1 ... each fixture is independent with it's own work coordinate system.
  3. As a set-up ... we want to make one part first ... confirm that it is correct dimensionally and that the cutting conditions are optimal ... and then expand those toolpaths to machine the other vises.
  4. For this article ... we are not going to be concerned with the actual G code program ... more with the flow of the program. How we can structure the program to machine all the parts.
So we mount the fixtures on the table ... set up and record our Work Coordinate Offsets ... G54 - G57.

How can we write the program to machine one part ... then expand it to 3 more parts ... with the least amount of effort. Our suggestion : Sub Programming ( for a more in-depth MAKING CHIPS blog post on sub-programming ... go here : http://kipware.blogspot.com/2013/02/the-hows-and-whys-of-sub-programming.html )

Here is the structure of our initial set-up program :

O0001 ( Main Program )

N0001
G00G91G28Z0
T01M06
G90S3500M03
G43Z1.500H01M08 -------- Put the tool in the spindle, start the spindle, position Z to clearance

G00G54X0Y0 --------------- Move to the first fixture, call the sub to do the work with this tool
M98 P1000

G00G91G28Z0 --------------- End this tools sequence
M01

N0002
G00G91G28Z0
T02M06
G90S1200M03
G43Z1.500H02M08 -------- Put the next tool in the spindle, start the spindle, position Z to clearance

G00G54X0Y0 --------------- Move to the first fixture, call the sub to do the work with this tool
M98 P1001

G00G91G28Z0 --------------- End this tools sequence
M01

ETC
ETC -------------------------- Create similar cycles for all the remaining tools.
ETC
M30

Once all of the above is confirmed ... w're ready to rock and roll on all the fixtures.
Just make these simple edits :

O0001 ( Main Program )

N0001
G00G91G28Z0
T01M06
G90S3500M03
G43Z1.500H01M08

G00G54X0Y0
M98 P1000
G00G55X0Y0
M98 P1000
G00G56X0Y0
M98 P1000
G00G57X0Y0
M98 P1000

G00G91G28Z0
M01

N0002
G00G91G28Z0
T02M06
G90S1200M03
G43Z1.500H02M08

G00G54X0Y0
M98 P1001
G00G55X0Y0
M98 P1001
G00G56X0Y0
M98 P1001
G00G57X0Y0
M98 P1001

G00G91G28Z0
M01

ETC
ETC -------------------------- Create similar cycles for all the remaining tools.
ETC
M30

The above will work fine ... one blaring item is that we are positioning back to the first fixture ... from the last fixture each time ... some wasted movement. Easy to fix because of our structure and the use of sub-programs ... just start each tool at the last vise where the last tool was working ... like this :

First Tool :
G00G54X0Y0
M98 P1000
G00G55X0Y0
M98 P1000
G00G56X0Y0
M98 P1000
G00G57X0Y0
M98 P1000

Next Tool ( work the offsets backwards ):
G00G57X0Y0
M98 P1001
G00G56X0Y0
M98 P1001
G00G55X0Y0
M98 P1001
G00G54X0Y0
M98 P1001

Next Tool :
G00G54X0Y0
M98 P1002
G00G55X0Y0
M98 P1002
G00G56X0Y0
M98 P1002
G00G57X0Y0
M98 P1002

ETC ... ETC ... ETC.

So there you have it ... combining our knowledge of SUB-PROGRAMMING with WORK COORDINATE OFFSETS ... we machined (4) parts on (4) fixtures ... efficiently.

If you followed the other Making Chips posts on SUB-PROGRAMMING and WORK COORDINATE OFFSETS... you will have an even better understanding of why these features will prove so useful when :
  1. Johnny "bumps" the middle fixture with his hammer
  2. Paul adds a revision .... an additional hole to the part
  3. "The Boss" decides he wants to take off one of the fixtures ... who knows why !!!
Anyway ... if you aren't sure why the above are simple fixes ... just go back and review the other posts !!

In the next post in the series ... we'll take a closer look at some other scenarios and options ... Stay Tuned !!

As always ... Happy Chip Making !!!

Check out our Real World World machine shop software at www.KentechInc.com
Conversational CAD/CAM
Quoting & Estimating
G Code Conversion
CNC Training
.... and MORE !!!

Wednesday, April 24, 2013

Multi-Part Machining Series - Part #1

Work Coordinate Systems

Most production shops will rarely utilize a one-vise or one-fixture setup on a VMC or HMC when running a multiple piece production run. The most efficient production will have the cutting tool performing it's function on as many parts as possible while it is in the spindle. That normally means adding as many multiple vises or fixtures as the room on the table will permit.

We will be devoting the next couple of Making Chips posts to set-up and programming tips and tricks dealing with multi-part machining.

What does that multi-part machining mean for programming? As with anything in life ... first we want to reduce the amount of work ... in this case, the amount of programming. The use of sub-programming to cut down on the amount of typing or data entry or whatever work ... is one. ( We dealt with sub programming in a previous post here : http://kipware.blogspot.com/2013/02/the-hows-and-whys-of-sub-programming.html ). The other is a little feature on most machines called WORK OFFSETS. In our post here we will be explaining the Fanuc style and codes of Work Offsets ... since about 95% of machines out there are what we refer to as "fanuc compatible." And that includes the popular Haas machines as well.

Why Work Offsets?

Let's take a simpler example of placing two vises on the VMC table ... both will hold identical pieces of stock ... and we want to machine two identical workpieces using the same identical tools.

Hole dimensions are identical for both workpieces.

We could always do something like use the top left corner on the part on the left as X0/Y0 and then add the 12.300 + 3.100 to program the two holes on the part on the right ... sure, simple in this case. But even this scenario is fraught with potential problems. 

  1. What if we "bump" the vise ... and the 12.300 is no longer the case. We now have to go back into the program and adjust the X and Y coordinates to reflect the new distance. 
  2. What if one vice is a different height / thickness than the other ... the parts Z0 is different.
  3. Next time we run the job ... we have to get the vises exactly 12.300 apart ... or alter the program again.
  4. .... it goes on and on ... none of the scenarios are nice to imagine.

This type of situation ... and this is a simple one ... begs for the use of Work Offsets.

What are Work Offsets?

The Work Offsets allow the user to designate distances from the fixed Zero Return position on the machine to a certain location on the machine through an offset table. The Work Offsets are recorded distances from a fixed position on the machine ... usually the Zero Return or Reference Return position on the machine. This position is the only position that can be repeated on the machine without fail ... because it is defined from a physical limit switch. Once the electronics on the machine are powered off ... most internally recorded positions are lost ... no power to keep the computer running, it loses it's memory. When the machine is powered back on ... we can find our Zero Return by utilizing that function on the machines panel because it searches for that physical limit switch ... it doesn't rely on any memorized position ... it is dependent on the physical limit switch. For that reason ... all Work Offset positions are recorded from that Zero Return position for all axis.

The number of Work Offsets available on a machine tool can vary ... some have as little as one or two and others have 300-500 ... on Fanuc controlled machines the standard number is six ... although options to add  more are available. They are designated by G code calls ... G54, G55, G56, G57. G58 and G59.

If you were to look in the Work Offset table ... you would see something similar to :

So the user measures the distance from the fixed Zero Return position to ... let's use our example ... to the top left corner of the left hand vice as that parts X0/Y0 location. The measured distance is then entered in the Work Offset table ... both X and Y ... under one of the Work Offset designations ... we'll use G54. The steps are repeated for the left hand vice ... and the X and Y distances are entered in the G55 offset locations.

In our example, let's imagine that the vises and the stock are the same height in the Z axis ... just for simplicity ... but the Z axis could have a value similar to X and Y if required.

How to use Work Offsets in the G Code Program?

Let's say we have the scenario below .... the machines Zero Return position is the point on the top right designated with the purple circle :

Our Work Offset Table would look like :

Now for the programming part. Whenever the G code calls out a Work Coordinate System .... G54 thru G59 ... that Work Coordinate System becomes the default and any X / Y / Z coordinates called out for in the G code will reflect the X/Y/Z coordinates from the offset table. So the programming line ...
G00 G90 G54 X0 Y0
 ... would move the tool to the top left corner of the left hand vise. If we were to then command ...
X3.100 Y-2.125
.... we would position to the top left hole of the left hand vise ... because the G54 Work Coordinate System is the default. Similarly ... the command lines :
G00 G90 G55 X0 Y0
X3.100 Y-2.125 
... would position the tool to first the top left corner of the right hand vise ... then the top left hole of the right hand vise using the G55 Work Coordinate System.

So using the Work Coordinate Offsets and Work Coordinate System calls ... it is very easy to switch between the left hand and right hand vise by simply commanding G54 or G55.

The Advantages of Work Offsets

As we outlined above ... we are asking for problems when we don't use the Work Offsets. How did we fix them?

  1. If we "bump" the vise ... only the values in the Work Offset table will change ... the G code program will not need any editing.
  2. If the vises were different heights .... we could easily use the Z value in the Offset Table to make that adjustment ... again, no program editing.
  3. Next time we run the job ... we only need to adjust the G54 and G55 Offset Table values ... no program editing is required.
  4. and on and on and on. I'm sure you will see many more advantages on the shop floor.
As we progress through our Multi-Part Machining Series over the next posts ... we'll try to highlight some of the other programming Tips and Tricks that can be employed.

Stay Tuned .... and Happy Chip Making !!



Check out our Real World World machine shop software at www.KentechInc.com
Conversational CAD/CAM
Quoting & Estimating
G Code Conversion
CNC Training
.... and MORE !!!

Wednesday, April 10, 2013

Circle Milling Like a Professional


Milling a counterbore or doing other circle cutting using an end mill or similar tool can be a powerful and creative machining process. Most times replacing the need for a reamer, boring bar or other sizing tool. This type of cutting, when combined with cutter compensation gives the operator much more flexibility in adjusting the size of the finished hole.

However, the main drawback is usually created using simple programs and is usually found at the entry and exit points where a small tool mark can be created due to the tool pressure caused at the entry of the cut. With a little creative programming technique and some simple calculations, a much more efficient and "professional" program can be created.

In this post, we're going to take you step by step through a program creation to mill a circle using the "loop in - loop out" method which takes the cutter from the center into the side of the hole using an arc move - then cuts completely around the hole - then loops back to the center using another arc move. This type of cutting gives a real nice finish in the hole, helps maintain size a little better and leaves no tool mark at entry or exit points.

In our example, finish milling an inside round pocket using G02 or G03, a cutter mark will remain from tool pressure at the entrance and exit point of the arc. In order to create a smooth entrance and exit, some “tricky” machining technique must be employed because most machines do not have a “canned cycle” for the type of cutting explained here. Although this employs nothing more than simple G02 or G03 commands, the manner in which the codes are used and the type of process that results, makes efficient use of the simple codes and makes a more attractive and accurate workpiece.

The objective with the example below is to create a smooth transition into and out of the cut. In the example below, we are attempting to machine a 2 in. radius circle with a 1 in. radius cutter.

STEP #1 : We calculate the arc needed to move the cutter from the center of the pocket to the finish wall edge. In the example below, we use the following formula :

2.00 (pocket radius) - 1.00 (cutter radius) = 1.00

This is the distance needed to move from the pocket center to the wall edge, allowing for the cutter radius.

STEP #2 : Next divide the total distance in half to obtain the radius needed to swing an arc from the center to the outer edge as calculated above.

1.00 / 2 = .500


If you like this concept ...
we invite you to take a look at our
it auto-creates G code from fill-in-the-blank forms ...
NO CAD experience required !!!

Cutter  Compensation  Note : 
Some controls will allow for the activation of CUTTER COMPENSATION on the example program block #1. In that case, you can calculate the same as above but do not compensate for the cutter radius, instead call the cutter compensation G Code and compensation offset number on the program block. In our example, the program block would be :

G02 G91 G42 X2.00 Y0 R.500 D12 

In this block, we are using G42 (cutter compensation right) and storing the radius of the cutter in offset #12. Using cutter comp as above will allow for the easy adjustment of the pocket size by adjusting the value in offset #12. Don't forget to cancel the cutter comp with G40 after the tools cutting is complete.


Creating a "CYCLE" : 
Using a simple combination of sub-programming, you can take the example above a step further and create a simple Z axis step-down cycle resulting in the roughing of the above example with little effort.

In the program example below, we are taking the circle cutting routine created above and storing it in a sub program. The main program will step the Z axis down - call the sub-program to machine the hole at that depth, then return to the main program which will in turn move the Z axis to another depth and start the process again. This "cycle" repeats until the total depth is achieved.

Main Program : 
{ start and position the tool to the hole center as normal }
G01 G90 Z-.100 F15.0 ; --- move to the depth of the first cut
M98 P1111 ---------------- call Sub Program O1111 which does the cutting as above
G01 G90 Z-.200 F15.0 ; --- move to the next depth of cut
M98 P1111 ---------------- call Sub Program O1111 again at the new depth
G01 G90 Z-.300 F15.0 ; --- move to the next depth of cut
M98 P1111 ---------------- call Sub Program O1111 again
G01 G90 Z-.400 F15.0 ; --- move to the next depth of cut
.... etc. till the desired depth is realized

Sub Program : 
O1111;
G02 G91 X1.00 Y0 R.500 F10.0 ; -- circle to the hole edge
G02 I-1.00 ; --------------------- cut the complete circle
G02 X-1.00 Y0 R.500 ; ------------ circle back to the center
M99 ; ---------------------------- return to the main program

This is just one example of the combination use of the sub-programming feature and "simple" programming codes to create a user cycle. You can always use your initiative and create some other ideas. Maybe think about these  : 
How can you put the Z axis move in the sub-program as well ?
Call the sub program and repeat a set number of times ?
... any others ?

Happy Chip Making !!

Check out our Real World World machine shop software at www.KentechInc.com
Conversational CAD/CAM
Quoting & Estimating
G Code Conversion
CNC Training
.... and MORE !!!