All posts by Kenney Skonieczny

Proud to say I am a 3rd generation Class A machinist ... who took his years of metalworking, cnc and machine shop experiences and followed my entrepreneurial drive to start my own business ... Kentech Inc. ... in 1986. For over 25+ years Kentech Inc. has been a pioneer and a leader in the realm of machine shop software. Please visit my website www.KentechInc.com for more. Thank You !!

CNC Machine Maintenance – For The Not So Ordinary

cnc machine maintenance

Personnel who perform routine maintenance on their CNC equipment usually perform the same common checks and perform the same common tasks … those that I refer to as the “no-brainers”. Filling the way lube tank … greasing the hydraulic chuck … checking the spindle oil level … the common checks and tasks. Unfortunately they are usually the ones where the machine will generate an alarm to remind you … like when the way lube tank runs out.

In this post we wanted to spend a post and remind you of the not-so-common checks and tasks that also need to be performed … “stuff” you might either not be aware of or “stuff” you never really even think about. So we encourage all to jot these down on your CNC maintenance TO-DO LIST. What !!! What do you mean you don’t have a TO-DO LIST !!

One really good thing to do in regards to CNC maintenance and insuring your CNC machine is accurate and running at it’s top condition is to at least post a note on the machine that lists checks and tasks to be performed and at what interval they should be performed. Every day … once a week … once a month … etc, etc. The best method is to supply a log book at the machine that makes your personnel responsible for these tasks by requiring them to sign-in and confirm which tasks were completed and when. This will insure that the tasks are completed … handing responsibility off to either the operator or the programmer.

Estimating

Here is our list of the not-so-common tasks and checks that should also be included in your routine maintenance :

  • Check the hydraulic pressure to make sure it is at the manufacturers recommended setting.
  • Check the hydraulic oil to make sure it is filled to the manufacturers recommended level.
  • If your spindle to machine tool has a cooling system … check the cooling oil to make sure it is filled to the manufacturers recommended level.
  • Clean the chips out of the chip pan on a daily basis … not just when it’s overfilled. Oftentimes an overflowing chip bin will push the chips into areas such as the ball screw cavity and cause those chips to be forced into the ball screw covers. So while you think there is still room left in the chip bin … actually the chips are being forced into areas you do not want them to go.
  • If your machine has a chip conveyor … grease the chain at least once a month.
  • Clean the glass on the window of the door and the light inside the machine every morning. Waiting till you can’t see only makes the job that much tougher … and causes excessive downtime because the job takes twice as long.
  • Wipe down the stainless steel way covers at the end of the shift … and lubricate them with hydraulic oil. In the long run … this is a huge maintenance cost avoided.
  • Check the electrical cabinet fans and filters … these should be cleaned at least once a month.

These are a few of the checks and tasks that should be performed frequently. They’re not always the “glory” items but are essential none the less.

 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 !!!

Way Lube System – Friend or Foe?

Your CNC machine is equipped with an automatic oiler system. Great ! You won’t have to think about oiling the machine and an alarm will tell you when the tank is dry. What a great device ? Right ?

Well, that is the design. Unfortunately, along with the “automatic” description of the system comes the “out of sight, out of mind” aspect of the system. Because many people know it is an automatic system, many people put it out of their minds and simply wait for the alarm to come up showing that the tank is empty and needs to be filled. But what if that alarm never comes on because the tank isn’t empty ? Why wouldn’t the tank be empty ?

As your machine gets older, the way lube system will require service just like any other mechanism. The main problem, which often gets overlooked, is that the “tank empty” alarm never comes on because the tank never drains and nobody ever notices it. Now your machine runs for months on end with no lubrication on the ways and when you finally notice a problem, it’s too late. Here is the “Rest of the Story …”

PROBLEM :  The machine’s ways are not receiving any way lube oil.

SYMPTOMS – IN ORDER OF SEVERITY :

  • Positioning / Repeatability Problems
  • Axis makes noise when moving
  • Axis Drive motor overload alarm coming when the axis is moving

POSSIBLE CAUSES :

  • Way Lube Pump burned out.
  • Way Lube Pump distribution flow set too low.
  • Way Lube Pump filter CLOGGED
  • Way Lube line BROKEN
  • Metering Units are CLOGGED

POSSIBLE CAUSES EXPLAINED :

(1) Way Lube Pump Burned Out : If the way lube pump is burned out, obviously there will not be any lube getting into the system. These pumps are usually set using a timer system. There is basically two types of timer systems used :

  • The pump is on a cam and the way it works is that the pump is always running. One gear turns another which acts like a step-down system and the second gear raises a “primer” lever. When the lever reaches the top of the stroke, the “primer” lever is released and the oil is pushed into the lines. This whole cycle can take 5-20 minutes meaning that even though the pump is always running, the lines get lube only every 5-20 minutes.
  • How to Check It : Take a flashlight and look in the tank or remove the oil tank. Once looking inside, you can see the main gear that should be constantly moving. It may be at a very slow pace, but you will see it moving.
  • The pump is set to an electrical timer set in the controls PC (programmable controller) or an actual physical electrical timer in the cabinet. This type of timer only supplies power to start the pump for every cycle.
  • How to Check It : On some pumps there is no primer lever but a light comes on on the tank when the pump is activated. Make sure this light comes on every 5-20 minutes or some other sign comes on to show the pump is activated every 5-20 minutes.

(2) Way Lube Pump distribution flow set too low : As stated above, the way lube pump usually is set using a timer system. The flow amount that gets distributed into the lines during every cycle is usually set and adjusted at the pump with a manual setting mechanism. This type of adjusting mechanism is usually a knob that can be turned higher or lower to set more or less flow. Also, just look at the primer lever. During the mentioned 5-20 minute cycle, you should see the primer lever raise slowly and then start to drop after reaching the top of the cycle. Check the stroke of the lever – short stroke, less flow.

  • How to Check It : The normal pump usage is in an 8 hour shift, you should fill the tank every 2-3 days. Also, you should see way lube flowing onto the ways. Always remember, the more flow the better. Yes, it may contaminate the coolant but that is better than ruining the ways and thus the machine just to save a couple of bucks.

 The photo above shows a way lube pump unit which includes a manual flow control device. Adjusting the white knob adjusts the amount of lube being distributed per one cycle of the lube pump. When this type of pump is working correctly, you can see the white knob rising slowly then retracting, pushing the lube into the lines. The amount of rise and fall, and therefore the amount of lube distributed, is determined by the flow adjustment.

(3) Way Lube Pump filter CLOGGED : The way lube tank usually has a filter between the tank itself and the oil line that starts the distribution. This filter is usually in the tank itself at the bottom of the primer lever or in-line right after the main distribution line leaves the tank. It will get clogged over time, especially if there is no filter at the oil fill hole or if someone takes off the filter when filling the tank.

  • How to Check It : Disconnect the main lube line where it exits the tank to feed the system or after the in-line filter if so equipped. When the cycle reaches the pump stage as outlined above, oil should flow through this connection. The flow should be strong at this point. If not, remove the oil tank and search out the filter or remove the in-line filter. They can often be cleaned with a cleaner but the best remedy is to replace it.

(4) Way Lube line BROKEN : Oftentimes a lube line in the system gets crimped or broken during machining or during service. These way lube systems are usually “pressurized” so to speak and if the pressure is released at one point, say at the broken line, the oil will flow all to that point, depriving all the other lines of fluid.

  • How to Check It : When the pump is in the pumping stage, the primer lever should fall slowly. This is due to the fact that it is pushing the oil into the system. If a line is broken, the primer lever will fall quickly as all oil is funneled to the broken line area only. On systems without a primer lever, the pump may have a pressure gauge on the pump. During the pumping cycle, the pressure should register for a couple of seconds as the oil is pumped into the lines. If the pressure is low or does not come up at all during the pumping cycle, a line in the system may be broken.

(5) Metering Units are CLOGGED : In order to create the “pressure” of the system needed for even distribution, each oil line leads to a “metering unit” where the flow is lowered and the oil is discharged. When the pump forces oil into the lines, they all fill and flow to the metering units where the flow is stopped. Each metering unit is set to discharge the desired amount or “drops” of oil and perform their individual duties. Since some areas require more lube, the metering units can be different for each line or area. Since these metering units have actual valve type components in their very small bodies, over time these units can be become clogged or the inner workings can become stuck.

  • How to Check It : This is a much harder area to check. The best remedy and prevention is to change these units every year as part of a yearly maintenance program. Because these units allow only drops to flow through, they are harder to see when troubleshooting. These metering units are usually located in “clumps” around the machine. Several lines lead to these central areas and lube lines are branched out from here to the various areas of the machine. Replacement metering valves should be obtained from the machine tool builder or dealer to insure that you are getting the correct replacement part. When changing these units, pay close attention to the flow arrow that is commonly marked on the units themselves. This arrow shows the direction of installation and flow. Check the original unit before removal and replace accordingly.

 The photo above shows an example of some metering units. These individual fittings are usually located in one or two main terminal blocks that feed certain areas of the machine such as the axis and ball screws. As the system fills with pressure and lube, these fittings discharge the lube at their pre-set flow rate into their lube lines. Over time, like cholesterol in the arteries, these units become clogged and no longer allow lube to exit and thus deny vital areas of the machine the way lube they require. As part of a yearly maintenance program, metering units in the machine should be replaced as a precautionary measure.

Due diligence and a little tracking will insure your Happy ( and ACCURATE ) Chip Making for years to come !!

Estimating

 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 !!!

CNC Machine Warm-Up — How? Why? When?

As former field service engineers … one of the items we always stressed to our CNC customers was the importance of performing a machine warm-up routine. Below are answers to some of their most frequently asked questions … which pretty much tell the whole tale about this activity.

WHY?

A machine warm-up routine benefits both the machine and the machining in a number of areas :

  • Running the spindle and moving the axis give the oils in the machine … spindle oil and way lube … an opportunity to distribute and do their jobs. Especially in a colder environment … start of the day when perhaps the heat in the shop was reduced for the night … running the spindle and moving the axis gives the oils a chance to warm up to their appropriate temperature and “work” the way they were intended. The end result is improved machine life, operation and reduced down time due to break downs.
  • It stands to reason also that when the oils are working as they were intended … the accuracy of the machine can more easily be maintained. It is an unreal expectation to assume that you can walk in in the morning and start the machining and hold a tolerance of .0005″ … perhaps when the machine is brand new … but not in the “real world”. Starting your day like this will most likely result in offset adjustments being made due to the machine’s “cold” condition … and will begin the process of “chasing” size for quite a while. I heard countless times from customers how they spend 1-2 hours in the morning “chasing” size. Hello? Did you warm up the machine?

WHEN?

A lot of people assume that performing a machine warm-up routine is only appropriate after an extended “vacation” period … either by the personnel or by lack of work flowing to the machine. While a longer warm-up period is recommended after an extended break … an everyday warm-up routine is still recommended for the reasons listed above. Here are a couple of options for when to perform a machine warm-up routine :

  • Start of the Day … whether that’s at the shop opening or the start of the 1st shift.
  • After the machine has been idle for a time period of over 4 hours.
  • After an extended vacation period.
  • If the shop temperature is cold during the winter months … a short warm-up should be performed even after lunch  / dinner breaks.
  • If the machining requires holding a tight tolerance … a warm-up routine should be left executing during ANY breaks in the machining … inspection time, bathroom break, at machine deburring process, etc..

Estimating

HOW?

Matching the situations above requires an assortment of warm-up routines. No matter what the length of time … the warm-up routine should always include the following :

  • Spindle running
  • Axis moving along the full stroke of each axis.

The beauty part is that the various warm-up programs can be left in the CNC control and called up anytime as needed. Or in the case of just keeping the spindle warm … it may be a case of just manually starting the spindle and leaving it running while you walk away and attend to something else.

Spindle Warm-Up

After an extended break the spindle should be run through all the speed ranges with substantial dwell times in between speed changes. Start slow and work your way up with at least 15-30 minutes between increases. An example of a Fanuc style program might be :

  • G97 S100 M03
  • G04 X1200.0 ( dwell for 1200 seconds or 20 minutes )
  • S300
  • G04 X1200.0 ( dwell for 1200 seconds or 20 minutes )
  • S500
  • G04 X1200.0 ( dwell for 1200 seconds or 20 minutes )
  • etc. etc. etc. until a speed of at least 3500 RPM is obtained.

You can create a program like the above to be run after extended breaks … and a program with less dwell time to be run after shorter breaks.

As mentioned above … to maintain the spindle temperature during the course of the workday … manually starting the spindle at say 2500 RPM and leaving it running while you leave the machine can also be quite beneficial in maintaining machining accuracy.

Axis Warm-Up

After an extended break  ALL the machine axis should be made traverse the complete length of each axis … or if fixturing / workpieces are in the way the maximum length of the stroke that is possible … using various speeds. You don’t want to start the movement under full rapid traverse speeds … but rather work your way up during the warm-up cycle. The easiest way to accomplish this is to utilize the RAPID OVERRIDE feature on the machine. The G code warm-up program will call for G00 / rapid … but start the program with the RAPID OVERRIDE switch at it’s lowest percentage …. then work it up manually as the routine runs. A sample Fanuc style axis warm-up program might look like this :

  • G00G91G28Z0
  • G00G91G28X0Y0
  • G00G91Z- ***** …. incrementally move the Z axis as close to the table as possible.
  • G00G91G28Z0
  • G00G91X ***** …. incrementally move the X axis to the opposite end of it’s stroke
  • G00G91Y ***** …. incrementally move the Y axis to the opposite end of it’s stroke
  • G00G91G28X0 …… move the X axis back to the zero return / home position
  • G00G91G28Y0 …… move the Y axis back to the zero return / home position
  • G00G91X ***** Y ***** …. incrementally move both axis at the same time to their stroke end
  • G00G91G28X0Y0 …. move X and Y back to their zero return / home position.

The above routine gives you an idea … and feel free to make additions as you see fit. The main idea is to move ALL the axis along as much of their stroke as possible. Not just a “square” pattern … try to make “fancy” moves that can move all the axis through as much of the strokes as possible.

 If you don’t like or don’t have a RAPID OVERRIDE option … you can simple make a longer program using FAST feedrates … such as :
  • G00G91X ***** F100.00
  • etc.
  • etc.
  • G00G91 X**** F200.00

You can get the idea … repeat the program and alter the feedrates as the program progresses. Again … the good part is that once it is written, you can maintain the program in the machines memory and recall it as needed. No need to re-create it each time.

 Spending some time creating these warm-up routine programs … and instituting a policy of when and how they are to be run … can go a long way to improving your machine’s life … as well as your machining efficiency and accuracy.
 

Please visit our website to investigate our
Real World Machine Shop Software


Happy Chip Making … and may you Make Chips and Prosper !!

Cutter Compensation – A Programmers Best Friend

In this post … we would like to touch on some of the points regarding cutter compensation … when turning angles and radii … on Fanuc based CNC controls.

Many programmers shy away from cutter compensation … primarily because they have never taken the time to fully understand both it’s power nor how to use it properly. But the reality is that cutter comp is one of a programmers best friends. The most common reason goes something like this “It’s just as easy to have the CAD/CAM system compensate for the TNR ( tool nose radius ) and out put the hard numbers.” That is true … but life on the shop floor makes this a bad practice. A couple of reasons why :

  1. The “numbers” in the G code don’t match the “numbers” on the part … because they are taking into account the TNR. If manual edits need to be made … even simple edits … this makes it much harder because the part dimensions don’t match the G code numbers.
  2. Say after cutting … the conditions warrant either a bigger or smaller TNR for better cutting conditions. If cutter comp is used … it’s a simple offset change. If not … it’s a trudge back to the CAD/CAM guy or system to re-post and make a new G code program for the revised tool and it’s TNR.
  3. In milling … let’s say I broke my last perfect .250R end mill … but I have a re-ground one that is .245R.. Again, if cutter comp is used … it’s a simple offset change. If not … it’s another trudge back to the CAD/CAM guy or system to re-post and make a new G code program for the revised tool radius.

Conversational

But here we are going to stick with turning here … and here are a couple of simple rules for when to use and when not to use cutter compensation.

  • Whenever angles or radii are involved … you must use TNR compensation or the angles and radii will be off. Because the programmed point of the cutting tool, an imaginary sharp point, does not coincide with the actual point of the cutting tool which always has some corner radius. For this reason, when machining close tolerance angle or radius cuts, inaccurate workpieces will be produced. The amount of error is proportional to the amount of the tool nose radius.
  • Only worry about using it for finishing … It’s really not worth the effort to use it roughing … the amount you leave for finish allowance will probably “hide” the mismatch due to the TNR.
  • You must start cutter comp with a “start up block”. This block is usually the move as you approach the part … the move distance must be greater than the radius in the TNR offset. So if your tool has a radius of .032 … make a move at least .035 … preferably more.
  • Make sure that your TNR is less than any radius on the part … don’t try to jam an .032 tool into a .020 radius … alarms will greet you somewhere along the way.
  • We’ll cover some additional thoughts at the end of the post.

The Details :

The CNC control has the capability to automatically compensate for the tool nose radius thru the CUTTER COMPENSATION codes of G41 and G42. G41 is called cutter compensation left. The left side is explained as the side of the workpiece the cutting tool is on when viewed in the direction of cutter movement or the cutter is moving on the left side of the programmed path. Once commanded, G41 or G42 are modal commands and remain active until the G40 or cancel condition is obtained.

In Fanuc controls, in addition to commanding G41 or G42 direction, the programmer must also tell the control two other aspects of the cutting tool which are : (a) the amount of the tool nose radius and (b) the imaginary tool tip location. Both these values are entered in the tools geometry or wear offset table. In the offset table, the R value is the amount of the tools nose radius. If the program called T0101 in the tool command, in offset table #1, under the R column, the nose radius of the tool would be entered. The T column in the offset tables holds the imaginary tool tip location.

Cutter compensation must be programmed using what is commonly referred to as a start up block. This block, which must be a G01 type block, is used to activate the cutter compensation before the cutting tool actual contacts the workpiece. The movement amount in the start up block must always be greater than the nose radius of the tool stored in the R column of the offset table. Circular commands using G02 or G03 are not allowed on start up blocks.

G40 is used to cancel the automatic compensation of the tool nose radius. G40 should always be commanded on a G00 block as the tool moves away from the workpiece with the tool in a clearance position.

More Rules and Thoughts :

Many rules apply in the use of cutter compensation as the control is always checking the tool position so it can calculate for the tool nose radius. Three rules of thumb apply and should keep you free of the controls cutter compensation alarms :

(1) Always command a start up block before contacting the workpiece and move in the G01 mode with a move greater than the nose radius of the tool.

(2) Use cutter compensation primarily in the finishing cut and try to eliminate it in the roughing passes. The more moves made with G41 or G42 modal, the more likely for a problem. To finish the part, use the start up block, finish cut the part and command G40 when done. Ifadditional cuts are required, use another start up block and cancel the cutter comp each time as soon as the profile cut is finished.

(3) Always cancel G41 or G42 using the G40 command. The best place to command G40 is on a G00 block, at a clearance point or moving to a clearance point. Because cutter compensation causes the control to perform some powerful calculations and is a complex command, you should also consult your controls instruction manual for further info on G41 or G42.

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 !!!

Canned Cycle Drilling & R Plane Tricks

Wasting time drilling air when “drilling” holes in a part with multiple levels is not uncommon for the novice programmer. In this post … we would like to discuss the always important R plane and how you can easily control it in your G code program.

First … the FACTS :

There are two planes that the programmer needs to be concerned with :

INITIAL PLANE … this is the plane used for rapiding around the workpiece. This plane should always be set high enough to avoid the workpiece as well as any clamps or other fixture related objects that can be struck by the tool as it moves around the part.

  • On  Fanuc controlled or Haas machine … the initial plane is defined as the last Z position before the canned cycle is called. So in the sample code below :

G00 G90 Z1.000
G98 G81 Z-.500 R.050 F1.0

  • Z1.00 would be considered the INITIAL PLANE … because it is the last Z position prior to the the G81 canned cycle command.
  • In an Okuma machine … the user can set the INITIAL PLANE by commanding a G71 Z— line prior to the canned cycle command line. So … imitating the above Fanuc line … we would program :

G71 Z1.000
G81 Z-.500 R.050 F1.0

R PLANE : The R plane is defined as the plane at which the drilling operation begins. So basically the tool rapids from the Initial Plane to the R plane … and then starts the drilling operation. The R plane is defined in the canned cycle command line. So in the above examples … R.050 is defined as the R plane … the point where the drilling operation would begin. In the above programs … the tool would rapid from the Z1.00 initial plane to the Z.050 R plane.

After drilling … we can tell the tool where to return by using the G98 ( initial plane return ) or G99 ( R plane return ) … for Fanuc / Haas … in the canned cycle command line. Once commanded … G98 / G99 becomes modal … which means the machine will remember where it is supposed to return … until told differently. When programming for Okuma … we can use the M53 ( like G98 ) / M54  ( like G99 ) commands.

NEXT … the TRICKS :

Did you know that you can very easily change the R plane when drilling on uneven surfaces?

Did you know that you can very easily change the return point between the INITIAL and R planes?

As mentioned above … once G98 or G99 is set … the control remembers where to go. Also … once the R plane is set in the canned cycle command … it remembers where the R plane is. But you can change either very easy … just command it !! Like this :

(1)G00 G90 Z1.000
(2)G98 G81 Z-.500 R.050 F1.0
(3)X1.00 Y1.00
(4)G99 X2.00 Y2.00
(5)X3.00 Y3.00 R-.100
(6)G98 X4.00 Y4.00 R.050
(7)G80

(1) – Sets the Initial Plane as Z1.00
(2) – Sets the R plane as Z.050 … return to the Z1.00 after drilling this hole
(3) – Drill this hole … R plane is .050 and return to Z1.00 … these were modal from (2)
(4) – After drilling this hole … return to R plane … still set to Z.050
(5) – Drill this hole but start at the new R plane of Z-.100 … return to Z-.100 after drilling … G99 is modal.
(6) – Drill this hole but start at the new R plane of Z.050 … return to Z1.00 after drilling this hole G99.
(7) – Cancel the canned cycle … all modal canned cycle information is cleared.

Conversational

On an Okuma machine … users can set and re-set the Initial Plane through the G71 command. For example, the command :
G71Z1.000
… would set the Z plane of 1.00 as the Initial Plane … and this can be changed at any time but just commanding a new G71 line.

On a Fanuc / Haas control … this is not so easy. You would have to cancel the current canned cycle with a G80 … move the Z axis to the desired Initial Plane … then re-command a new canned cycle to set a new Initial Plane.

So … as we illustrated here … it’s fairly easy to efficiently and effectively machine holes on uneven surfaces using a combination of the return plane commands G98 / G99 / M53 / M54 and R plane settings and through the Initial Plane selection.

So … STOP CUTTING AIR !!!
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 !!!

A Major Hidden Cost When Estimating

We developed our KipwareQTE® quoting and estimating software from our real world experiences on the shop floor and running a variety of different machine shops. Over the years, one main category when quoting that is often misunderstood, under quoted and even completely ignored is perishable tooling.

Do you include perishable tooling in your costing and quoting?

If your quoting a part that needs 100 holes drilled … do you include the cost of the drills and center drills?

Our experience from talking with potential clients shows that 80% of estimators DO NOT include perishable tooling in their costs and estimates. A major mistake … that is directly effecting their bottom line … negatively !!

KipwareQTE makes it easy to include perishable tooling into your estimating process. How?
Two ways.

ONE – users can create a database of perishable tools and their associated costs. Then adding tools costs to the quote and estimate is simply a matter of pulling down a drop-down list and selecting the tools that will be used in manufacturing.

TWO – Using an estimated tool life … KipwareQTE® will perform all the calculations to include the complete cost for each of the tools and also calculate the number of each tools required for inclusion in the Bill of Material creation. That way the shop will be prepared when the job hits the floor.

Beyond the feature.

We like to think that thoughtful and important features like this illustrate what sets Kipware® and Kentech Inc. apart from our competition. A simple design, a meaningful feature … that can make the difference between making and losing money … and isn’t that what it’s all about.

We invite you to explore our Kipware® Business Software titles … and discover the difference that REAL WORLD MACHINE SHOP SOFTWARE can make.

Kenney Skonieczny – President
Kentech Inc.

The HOW’s and WHY’s of CNC Sub Programming

If you have done any manual G code program creation, you know you are always looking for some shortcuts  that can not only help cut down the data input … but would also help eliminate errors. Whether they be typing errors or movement errors … the less chance to create one the better.

One of the more powerful tools available to a programmer is the use of SUB PROGRAMMING. In this Making Chips post … we would like to touch on some of the basic ideas, concepts and uses for sub programming. This post will illustrate the Fanuc / Haas coding format … but check out the end of the post for Okuma explanations as well.

What is a Sub Program?

Basically, a sub program is a G code program that is called from another G code program. The contents of the sub program is not limited and can contain tool calls, spindle calls … just about anything any other G code program can contain. The sub program itself resides in memory under it’s own program number … and is separate from the “main program”.

Conversational

Why Would I Use a Sub Program?

As mentioned above … the less data entry means less chance for a mistake. let’s take this example scenario where we have to let’s say spot drilling then drill then chamfer then tap a series of holes. The less times we have to re-type those hole locations, the less chance we will have a typo and / or put a hole in the wrong place. If we can store the X / Y coordinates of the hole locations in one location and call them out as needed … that saves data input and reduces our chances for errors. This is a good example of how a sub program ( in this case it would be the program that stores the hole locations ) can be a big help.

How Do I Program and Call a Sub Program?

A sub program scenario consists of a main program and the sub program. The main program consists of all the code that doesn’t repeat itself … the sub program consists of all the data that will be repeated. In our above example … the tool calls, spindle calls, drilling cycles will all be different for each hole … so we will store that in the main program … but the hole locations will be the same so we will store them in the sub program.

When you create a sub program … it is done just like you would create any other program. On Fanuc / Hass controls you start out with an O number … and type the program as normal. Let’s take our above example of hole locations … the sub program might look like this :

O1234
X1.1 Y1.1
X2.2 Y2.2
X3.3 Y3.3
X4.4 Y5.5
M99
%

Notice that we have an M99 at the end … not an M30 or M02 like a normal program. This indicates that this is a sub program … we’ll explain the M99 command a little later.

This program is entered in the control as any other program … and resides in it’s own memory space.

When a Fanuc / Haas control wants to call a sub program to run … the programmer issues an M98 command in the Main Program. The M98 command is also followed by a P address … which is the “O” number of the external program to run. Our above sample sub program would be called with the command :

M98 P1234

When the main program reads the M98 command … it jumps out of the main program and starts to execute the sub program … in this case program O1234. When it reads the M99 command at the end of the sub program … it jumps back to the main program to the line after the one through which it left. In other words, it jumps back to the line after the M98 command.

The Complete Story

Let’s take a look at the full program and the sub program calls … see if you can follow the path.

Main Program

O0001
G00G91G28Z0
G28X0Y0
M01
N0001
(SPOT DRILL)
G00G91G28Z0
T01M06
G90S3500M03
G00X1.100Y1.100
G43Z.500H01M08
G99G81Z-.130R.050F20.0L0
M98P1234
G80
G00G91G28Z0
M01
N0002
(DRILL)
G00G91G28Z0
T02M06
G90S3000M03
G00X1.100Y1.100
G43Z.500H02M08
G99G73Z-875R.050Q.125F20.0L0
M98P1234
G80
G00G91G28Z0
M01
ETC.    ETC.    ETC.
M30
%

Sub Program

O1234
X1.1 Y1.1
X2.2 Y2.2
X3.3 Y3.3
X4.4 Y5.5
M99
%

Can you follow the path as the program jumps to the sub program?
Here is an in-depth explanation.

N0001
(SPOT DRILL)
G00G91G28Z0
T01M06
G90S3500M03
G00X1.100Y1.100 ——————— Position to our first hole.
G43Z.500H01M08 ——————— Bring the Z axis to the clearance plane.
G99G81Z-.130R.050F20.0L0 ———- Call our canned cycle … but use L0 which means the control will hold the data … but will not execute the cycle.
M98P1234 —————————– Jump to our sub program O1234 which will cause a hole to be spotted at each X / Y location in the sub.
G80 ————————————- When the M99 is read … the program will jump back to here.
G00G91G28Z0
M01
N0002 ———————————- This sequence basically does the same thing …except we are establishing a different canned cycle before we jump to the sub program.
(DRILL)
G00G91G28Z0
T02M06
G90S3000M03
G00X.100Y.100
G43Z.500H02M08
G99G73Z-875R.050Q.125F20.0L0
M98P1234
G80
G00G91G28Z0
M01

Another Example …

Once you are able to follow the above … here is another scenario.

You can also call a sub program and have it executed a set number of times. Let’s take the example where we want to execute a program on our lathe to make a washer (3) times. We will enter the main program and sub program as below.

Main Program :
O0001
M98 P1234 L3
M30
%

Sub Program :
O1234
*********
between here is the complete machining program that includes
tool calls … spindle calls
the feeding of the stock
the machining of the part
the cut-off of the part
*********
M99
%

The cycle start is executed with program O0001 … which calls the sub program O1234 and executes that program (3) times … the L in the M98 line. This feature is different for the various Fanuc controls but is usually commanded either :

M98 P —- L
or
M98 P****$$$$ where **** is the program number and $$$$ is the number of times to repeat.

Differences Between Fanuc / Haas and Okuma OSP

The basic ideas of calling and executing a sub program is the same between these controls … the G code commands are a bit different. Those differences are outlined below.

Sub Program Call
Fanuc / Haas : M98
Okuma : CALL
Example : CALL O1234 will call sub program O1234

 Sub Program End

Fanuc / Haas : M99
Okuma : RTS

Sub Program Call with Repeat
Fanuc / Haas : M98 P1234 L5 or M98 P12345
Okuma : CALL O1234 Q5 with the Q value being the number of repeats.

That’s basically it … just some G code differences but the basic idea and execution is the same.

**************************************

Sub programming is a powerful tool … even if you are not trying to avoid re-typing and repeated data entry. Hopefully this Making Chips post will get you thinking and exploring all the ways sub programs can make you a better programmer.

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 !!!

Move That Vise !!

MOVE THAT VISE !!! … It could mean more years for your machine tool.

It seems the simpler, often overlooked things can be the downfall of most shop equipment. Focusing on a few simple ideas can avoid those big repair bills and keep machine tools running like new much longer.

When most setups are done on a VMC, the workholding fixture is neatly mounted right in the middle of the table. Although it looks good, this is actually one of the worst “habits” for the machine. Locating the vise or fixture in the same place has the following harmful effects on the life of the machine:

  • Table wear, resulting in dip or sag in one spot.
  • Boxway or guideway wear on or around the spot, causing loose surface and gib contact, and shuck in the ways.
  • Ball screw wear, resulting in excessive backlash in that one area of the screw, which cannot be repaired through CNC compensation.

Of course you’re going to clean the table completely before installing the vise.

Then are you going to place the vise so it looks nice and neat in the center of the table?

NO !!!

Placing the vise or fixture in or around the same area of the machine table will cause all of the above, with the most common symptom over time being backlash of the screw. When trying to compensate and set the backlash, the person making the repair will often find different backlash values when checking along the length of the axis stroke. This most often results in the need to replace the whole ball screw. Because most CNC machine controls only permit one backlash compensation value to be set in the parameters, compensating for the backlash cannot be effectively performed through the control.

Conversational

You also may find that the gibs need to be adjusted in that area of the boxway, because the axis has some side-toside movement to it when moving. Squareness in that area will disintegrate; and, in the worst case, this shucking can be heard when the axis changes direction. The most common remedy of adjusting the gib in that area causes the axis to bind when it reveals to the other areas, because the boxway wear is different along the stroke. In this repair, the machine’s boxways may need to be reground, rescraped or both. In either of these cases, the repair bill will be huge.

The remedy is to make sure to move the vise or fixture location around on the tabletop whenever possible. You will see a more consistent wear pattern for the machine, and any backlash that occurs can be taken up correctly through the control. You will not be able to stop machine wear, but you can distribute it more evenly along the machine, which provides a longer life for all the components involved.

 Happy Chip Making !!

Check out our Real World World machine shop software at www.KentechInc.com

At Kentech Inc. … We’re MAKERS and DIY’ers Too

There is no doubt that a lot of folks are letting their creative juices flow today and becoming members of what is touted as the “maker community”. It is so great to see … and to see that great American ingenuity in play in so many ways.

Being a machinist for almost 30 years now … I like to think I have a little of the MAKER in me as well … and not only in metalworking. Here at Kentech Inc. … our various Kipware® machine shop software software titles are used by thousands of professional machinists and machine shops around the world … and also by thousands of MAKERS as well. People doing everything from woodworking to metalworking in garage shops and professional machine shops around the world. We like to think that if a product is good … it finds it’s way into many places. And we are proud of the fact that our Kipware® conversational CNC programming software has made parts for SpaceX as well as that coat rack for Average Joe or Jane.

Kipware® software is also running our sister woodworking company — KÄRV. From quoting and estimating to CNC programming … Kipware® software gives us THE EDGE. Check it out at www.KarvWoodworking.com.

With that MAKER and DIY spirit bubbling inside ( watching Yard Crashers on the DIY network with some java certainly HELPS ) me and my wife decided that this summer would be the summer of our personal YARD CRASH. And so it began.

The Vision

Looking aerially at the yard … I laid out my vision to see if the wife approved. First … a curved walkway leading from the house to a brand new firepit. Not one of those metal, cheap firepits … I mean a new brick firepit with a metal inner ring and nice stone cap. Halfway down the walkway … a detour to our own designed and constructed water feature … waterfall or fountain.  And here’s where the wife chimed in. “How about this” she says later in the evening. She shows me a pic on Pinterest of a bamboo themed waterfall. “I like it” I reply … we’ll think about the design in more detail as we get closer. But there it is … our vision.

The START of Construction

The DEMOLITION and DESIGNER MAKER

The next day we begin the layout in the space where we decided to work … marking the area with string … and removing all the sod. Big job … but we get it done in a couple of days … and start the remodel.

construction2
Aerial view #1 of the “construction site”
construction1
Aerial view #2 of the “construction site”

PHASE 1 – Privacy Panels

The CARPENTER MAKER

The first item in the rebuild was to install some privacy panels to insure our nights spent by the firepit were nice and cozy and private. My wife had a “bamboo theme” in mind … which carried over from the waterfall idea … so we got to designing. We came up with a wooden frame clad on both sides with bamboo fencing. Came out and looked great … just the right amount of light coming through and bamboo effect was very elegant.

PHASE 2 – The Fire Pit 

The MASON MAKER

We purchased a stone firepit kit from a local stoneware vendor and during the week I got the area prepped and the firepit installed. Leveling and preparing for the first layer was quite a job … but it came out great and the feeling of accomplishment was fantastic. If you’re a MAKER … you know what I’m talking about. Friends always say “We just have someone build it” … but there is nothing like that feeling of accomplishment that lasts for years as every time you look at it .. you can proudly say “I built that !!”.

With the fire pit installed … I lay out the artistic walkway … line the outer edge with cobblestones … and fill the inside with stone dust. I was a little apprehensive about using the stone dust as a bottom … it was quite dusty to start with … but it turned out fabulous. Once a good rain shower did it’s thing … it hardened up nicely and makes for a great walkway.

The completed fire pit.
The completed fire pit and walkway area around the pit. The right hand side leads to our nature trail through the woods behind the property.

PHASE 3 – The Water Feature

The ENGINEER and PLUMBER MAKER

The more I viewed my wife’s idea for the water feature … and the more we discussed the details … the more confidence I gained that I could do it. I don’t think my wife was quite as confident though … a lot of probing questions like “How you gonna do this?”

First … we needed to bring electricity from the house to the waterfall area. Following the local code … we dug our trench ( what a b*&%$ ) … layed our cable inside our PVC piping … and presto. 4 new plugs … an outdoor switch … and plenty of juice for our pump. Tough job but very professionally done … and all to code. The wife was the hardest worker through it all. Chipping in with the ditch digging … and keeping me straight and focused through all the aggravation and  at times frustration and hard work.

Next … I bought some reclaimed wooden beams … 6x6x10 … that were once used in the old railroad yard in our city. They became the perfect uprights to support our bamboo “waterfall”.

construction_start
Reclaimed railroad ties in cement and in position.

After the ties had set in their concrete moorings for a week … and another trip to Home Depot ( it became our Saturday morning breakfast trip ) … I began the plumbing work. Again … with the constant nudging from the wife to keep me on the straight and narrow … we got it all in and we’re ready for the big reveal. Remember this was only a vision and a theory … we had never really tried the design. Judge for yourself with the video below :

You can see it all in the video … the bamboo privacy panels and the working waterfall feature. Below is a closer look at the design “behind the scenes”.

Behind the scenes of the waterfall.
Behind the scenes of the waterfall.

The BIG REVEAL …

And that was that. After the wife lent her gardening touches … the big reveal :

The big reveal
The big reveal

… and CONFIRMATION !!

As I mentioned above … I’m a big fan of YARD CRASHERS on the DIY network. A lot of great memories of sitting and binge watching the show on rainy days … getting stoked to start projects of my own around the house … fueling the MAKER spirit if you will.

So when the project was completed … I couldn’t resist tweeting a pic to the host of the show, Matt Blashaw. And low and behold … it got his attention and he replied … AND APPROVED !! WoooHooo !!

Matt Blashaw approves !!
Matt Blashaw approves !!

As the summer nights and weekends go by … we are enjoying the fruits of our work with fabulous fires in the pit with friends and family … accompanied by the zen like sounds of the waterfall. In fact … we have christened the garden with the name the KenZenSue Garden.

Being a machinist I always took a ton of pride in my work … but a lot of it was “business”. It was great to unleash my MAKER side and work on a “for fun” project … and to enjoy the results. To all the fellow MAKERS out there … be proud and go get’em.

Kenney Skonieczny – President

Kentech Inc.

Accurate Machining Cycletime Estimating – THE KEY

No matter what system you utilize to create your cost estimates and quotes … everything starts with an accurate machining cycletime estimate. The phrase … “Oh, that should take about two and a half minutes to machine.” … is doing more harm to your bottom line than you are probably even aware. This type of guesstimating … especially when it comes to machining cycletime … is throwing the whole cost estimating process that comes down the line into question.

If the machining cycletime estimate is not correct … you could be winning work … but unprofitable work. And that’s just what your shop doesn’t need … wasting time manufacturing parts that are losing you money. Taking machine time and employee energy away profitable work.

So what is the KEY to accurate cycletime estimating?

Having lived and “grown up” on the shop floor … we realize that the MAIN KEY to accurate cycletime estimating is to utilize the cutting conditions and parameters that can actually be reproduced on your shop floor … with your equipment.

It doesn’t do any good to estimate using an RPM or SFM and feedrate that your shop floor can never duplicate … or utilize a method of machining that your shop floor would never follow or duplicate.

Sure cycletime estimating software that has feature recognition and auto-determines the method of machining will get you a time quickly and get that estimate done quickly … but what good is it if your shop floor would never machine the part using the method the software determined?

Cycletime estimating software that boasts thousands of materials and speeds and feeds is expensive and seems powerful and complete … but if your shop floor can’t duplicate that “book knowledge” speeds and feeds … what good is it?

Estimating

So Kentech’s KipwareCYC® software is different? How?

It certainly is … and I’m glad you asked.

First : 

KipwareCYC® is a database driven application … utilizing a user-defined database for machine specifications ( max RPM, rapid rates, tool change time, etc. ) and user-defined cutting parameters ( speeds, feeds for various materials and machining operations ). This insures that the calculated times accurately reflect what happens on your shop floor … the key to accurate cycleltime estimating. You create the database and input YOUR specifications and cutting parameters.

Second : 

Using the various outputs and travelers available from KipwareCYC® … the more you use the software, the more accurate it becomes. For example : the Routing Sheet that is automatically created from KipwareCYC® provides the operator / set-up personnel with a complete list of cutting parameters and times for each operation as the part moves through the shop. This means he has a targeted RPM, feedrate and time for each operation. If any of those factors cannot be achieved … a report back to the estimate creator will result in an adjustment to the database information … perhaps a revision to the SFM or feedrate or chip load used for a specific machining operation. Next time … the RPM and feedrate will be more accurate. So the more you use the software … the more accurate it becomes.

Ugh … Entering ALL that database information !!!

Actually … a couple of points that may have crossed your mind. First … we do ship KipwareCYC® with installed database information for common machines, materials and cutting parameters. But again … this is just to get you started … you really need to make the database information your own. Here is what we recommend.

Let’s say today you receive an RFQ for a 316 stainless part that requires some turning. You gather the machine specs for the lathe you’re going to use and grab the normal cutting parameters the shop uses for 316 stainless. One additional point here … most shops use a common insert that works well for them for specific machining operations … there really isn’t a need for a dramatic, all encompassing speeds and feeds database with info you’ll probably never use … let’s keep it simple and keep it real. So you enter that data and now … 316 stainless is done !! Next time you get an RFQ the info is all there and ready to go. With this system … you are building the database as you are preparing quotes and winning work !!! It’s a win -win … with long term benefits.

So … the moral of the story is?

No matter how you are arriving at your machining cycletime estimate … the one certainty is to insure that it is utilizing the cutting conditions and parameters that can actually be reproduced on your shop floor … with your equipment.

 If you are looking for a software application what will insure that key … we invite you to check out our KipwareCYC – Machining CycleTime Estimating software HERE.

Kenney Skonieczny – President

Kentech Inc.