To subscribe: Simply email us (firstname.lastname@example.org) and let us know you'd like to be added to our distribution list.
To unsubscribe: Respond to this email, typing REMOVE in the subject. Please accept our apologies if we have disturbed you.
Manager's Corner: The 10% Time Rule
A good manager has the ability to inspire their staff. They know it's mandatory to keep people learning new things in order to keep them interested in what they're doing. Without growth, people become stagnant and complacent. And if there's no need or motivation to improve, people won't improve. It's that simple. In order to improve, people must learn new things.
I know for myself that if I'm not learning something new, I will eventually start to feel lazy. So I've tried to force myself to learn something new at all times. In my personal life, sometimes it's as simple as reading a book or watching an educational television show. I might take a class at the local community college. I often try to get involved in a new hobby that's related to a subject I'm interested in. In any case, I know my mind is happiest when I'm learning something new.
Frankly speaking, it is easy to go a little overboard with this concept. Learning new things is addictive. When I'm extremely interested in a new subject, I tend to become obsessed with what I'm studying and let everything else fall by the wayside. The lawn doesn't get mowed, the car doesn't get washed, and my normal chores don't get done. I know from past experience that I've got to limit the time I spend learning new things.
I apply the same thinking to my work. I know that if I stop learning new work-related things, my work will become stagnant. I know that in order to stay current, I've got to keep honing my skills. This might mean learning new computer software, reading trade journals, surfing the Internet to see what's become available, and anything else that helps me do my job better.
But as in my personal life, I know I must balance the time I spend learning something new with the time I spend performing my normal duties. I know I cannot become obsessed with learning or nothing else will get done. So I've come up with what I call the 10% time rule.
About 10% of my time at work will be spent learning new things. This equates to about forty-five minutes per eight-hour work day, four hours a week, 16 hours a month, or 200 hours per year. While I don't adhere to a strict schedule, I try to maintain the 10% rule over the long term.
I happen to be in a position that allows me to apply the 10% rule. Since I own my own company, I can decide what I'm working on (to a certain extent at least). As managers, you may also be in this position. And if you're not already doing so, I urge you to apply the 10% time rule for yourself. If you've never done so, I guarantee that this will help you stay fresh in your work. You may even want to increase it to 15% or 20% to start - especially if you have a lot of catching up to do.
As a manager, you also have the ability, if not the responsibility, to apply the 10% rule for your staff. Your people probably don't have the authority to apply the 10% rule for themselves. So make sure you do it for them.
Consider, for example, a CNC operator. This person's normal responsibilities will keep them busy 100% of the time - if you let it. They cannot, on their own, take time out to learn something new during working hours. You must provide the time, and just as importantly - the learning material, they need to improve.
Past articles in The Optional Stop newsletter have addressed the importance of improving the proficiency of your workers. We've said time and time again that the single-largest way to improve productivity in any area is to improve the proficiency of the people involved. The 10% time rule provides you with a way to gain the needed time to improve productivity.
Keep in mind that the new material being learned doesn't always have to apply directly to what a person is doing in their job. Again, the goal is to keep them fresh. And learning something new always helps - regardless of the topic. While you may be tempted to target improving productivity right from the start, you may actually see a better long-term improvement if you vary the topics you provide for your people.
Admittedly, the 10% time rule does take quite a commitment on the part of your company. While you may not be able to provide all of the time needed to help your people learn new work-related things, at least provide the materials. Even if you expect your people to study on their own (with materials you provide), at least the most motivated people on your staff will have the chance to apply the 10% rule in their own personal lives - on their own time.
Instructor note: Teaching CNC with the Key Concepts approach - part five
Part five - Key concept number four: You must understand the compensation types
Here are some links that allow you to review other parts of this article:
Here in part five, we're going to discuss topics related to the various compensation types. Here is a list of the general topics that we include in key concept number four:
This key concept is quite lengthy. For this reason, I break it into four segments (lessons), including for machining centers, introduction to compensation, fixture offsets, tool length compensation, and cutter radius compensation.
Introduction to compensation
As with every other key concept, we start in general terms. In this case, we devote an entire lesson to introducing compensation. Just about everything in this lesson is related to the three compensation types.
The marksman analogy
I like to begin with an analogy comparing CNC compensation types to the compensation a marksman needs when firing a rifle. A marksman must compensate for the distance to the target. To do so, they must judge the distance to the target and adjust the sight of the rifle accordingly. If they make a mistake in judging distance, or if they don't allow for other variables (like wind), the first shot won't be perfect. Another sight adjustment will be necessary. The next shot will be closer to the target than the first.
Point out that this is amazingly similar to CNC compensation types. In all cases, the setup person will do their best to perfectly set them. But if they make a mistake, or if they don't allow for some other variable (like tool pressure), the first cut won't be perfect. Depending upon the tolerance to be held, they may have to make a an adjustment. The second time the tool cuts, it will machine the workpiece more accurately.
Point out that all compensation types use offsets. Offsets are referenced by an offset number and contain numerical values. The actual value doesn't mean anything to the control by itself. The compensation usage (in the program) determines what each offset value represents. You can easily compare CNC offsets to the memories of an electronic calculator (they are referenced by a number, contain numerical values, and don't have any special meaning until they are referenced in a calculation).
Depending upon the control model/s involved, you may want to show the display screen/s of related offset pages. Point out that some offsets contain more than one register (like the tool length and cutter radius compensation offsets for some machining centers and the wear offsets of turning centers).
Explain some of the variables that an offset can be used to represent. With tool length compensation, for example, the offset can represent the length of a tool. With cutter radius compensation, it represents a milling cutter's radius. And with fixture offsets, offsets specify the location of the program zero point.
Finally, explain the general reason why offsets are required. There are many tooling related variables that a programmer won't know as they write the program- the exact length and radius of a milling cutter, for example. All compensation types allow the programmer to ignore exact specifications of tooling (including workholding tooling) while the program is being created. Prior to or during setup, these exact values are measured and entered into the control - into offsets. Again, this separates many setup related tasks from programming.
Introduce sizing and trial machining
Explain that CNC machines are capable of very high accuracy. They can hold very small tolerances. And if tolerances are very small, it is likely that the initial entry for certain offsets will not be precise enough to hold the tolerance. Point out that even if a setup person perfectly measures and enters a counter-boring tool's length, for example, it is no guarantee that the counter-boring tool will machine to the exact depth specified in the program. Again, the setup person could make a mistake while measuring or entering the tool's length, but even if they do not, tool pressure may cause the tool to machine a little too shallow (or deep, depending upon the type of tool being used).
Explain that when a setup person notices a very small tolerance on the blueprint - and if they are at all concerned that the cutting tool will not machine the related dimension to size on its first try, they can use a technique called trial machining to ensure that a little extra material will be left by the tool when it cuts for the first time.
While this may be a little detailed at this stage in your presentation, explain that trial machining involves six steps:
Make sure students understand that trial machining helps them make the very first workpiece a good one. Once the machine is in production, and depending upon how many workpieces must be machined, it is possible that further adjustments may be necessary as tools wear. Generally speaking, as a tool wears, it leaves more material on the workpiece - it may even have the tendency to "push away" from the workpiece (leaving yet more stock) due to increased tool pressure. Depending upon how small the tolerance is, this workpiece growth may cause dimensions to come close to the limits of the tolerance band. If left to continue, they will run out of tolerance.
We call adjustments made to maintain size as tools wear sizing adjustments. In order to make sizing adjustments, of course, the CNC operator must be able to interpret tolerances, determine the target value for each dimension, calculate the deviation from the target value (along with its polarity), and enter this value into the appropriate offset.
Your most basic goal in this key concept, of course, it to get students to understand how the compensation features are programmed and used. But to be successful programmers, setup people, and operators, they must also understand sizing and trial machining. As you discuss each compensation type, be sure to demonstrate the implications of these two important skills.
This feature is introduced in key concept number one. And frankly speaking, you may have said enough about it in key concept number one to ignore it here in key concept number four. But be sure students know that the feature fixture offsets is a compensation type. It allows the programmer to ignore the precise placement of the workholding setup on the machine's table. A command in the program (G54 if only one workholding device is being used) tells the control where to look to find the program zero assignment values. These values are the distances from the spindle (center in X and Y and nose in Z) at the zero return position to the program zero point on the workpiece. These will normally be large negative values - and we show how to measure them in key concept number one.
While this may not be the right time to do so, you'll eventually want to discuss other points about fixture offsets:
Again, you may want to save these presentations until later - after students have a few programs under their belts. We recommend discussing them during key concept number six (special features of programming).
Tool length compensation
Tool length compensation allows the programmer to ignore the precise length of each tool while they are creating the program. In essence, the same program will work regardless of how long or short each tool is.
There are actually two ways to use tool length compensation. Each is programmed essentially the same. And it's pretty easy to explain how tool length compensation is programmed.
Explain that tool length compensation must be instated during each tool's first approach movement in Z to the workpiece. A G43 word is used to instate tool length compensation. Include in the G43 command is an H word that specifies the offset number to be used with tool length compensation. (I like to help newcomers remember the H word by saying that H stands for the height of each tool.) Tell students to make the value of the H word equal to the tool station number. Tool number one will use offset one (H01). Tool number two will use offset two (H02). And so on. Also within the G43 command is a Z axis departure to the tool's approach position.
Here are the first few commands of a program to stress the points:
Be sure to point out that since tool length compensation is instated during each tool's first Z axis approach movement, there is no need to cancel it (though there is a command, G49, that does so).
The two ways to use tool length compensation
Again, there are two ways of using tool length compensation. The program shown above will work for both methods. With one method, the tool's length as used as the tool length compensation value (the value placed into the offset for each tool. This is the method we urge you to teach. It allows the most flexibility during setup. With the second method, the distance from the tip of each tool down to the Z axis program zero surface is the tool length compensation value.
Program zero assignment considerations
If using our recommended method (tool's length is the tool length compensation value, students must understand that the Z axis program zero assignment value (fixture offset Z value) must be set to the distance from the spindle nose as the Z axis zero return position to the program zero surface in Z. To measure this value at the machine (after the workholding setup has been made):
Point out that in step three, some setup people like to use a gauge block or feeler to keep from having to actually touch the spindle nose to a workpiece.
With the second method of using tool length compensation (offset is the distance from the tool tip down to program zero surface in Z), the Z axis program zero assignment value will be zero.
Again, with our recommended method, the setup person (or someone) will determine the length of each tool. The tool's length is the distance from the tool tip to the spindle nose of the machine (a positive value). This value can be measured for each tool on the machine or off line. To measure tool lengths on the machine:
One important benefit of using our recommended method is that tool lengths can also be measured off line, while getting ready for the next (or some future) job. You don't have to use the machine as an expensive height gauge. Other benefits include:
Trial machining considerations
Explain that tool length compensation allows a setup person to easily trial machine Z surfaces. When they see a Z surface (depth) that has a critical tolerance, they can simply increase the tool length compensation value (by a value of 0.010 inch is usually good enough). This will make the machine think that the tool is longer than it really is - keeping it away from the surface being machined. Once the tool has machined the surface, the program is stopped and the surface is measured. The offset will then be adjusted based upon the findings of the measurement. The tool will then be rerun. The next time it cuts, the surface will be within the tolerance band.
Explain that most cutting tools used on machining centers don't machine critical Z surfaces. Center drills, drills, taps and reamers, for example, seldom have critical depth tolerances. But with counter-boring tools and certain milling cutters, it's likely that depth tolerances are more critical. As tools wear, their tendency will be to shorten in length. And again, with most tools, they won't shorten enough during their lives to cause a dimension to go out of tolerance. But for those tools that machine extremely critical depth tolerances, the operator may have to reduce the tool length compensation value before the tool is completely dull.
Cutter radius compensation
Just as tool length compensation allows the programmer to ignore the precise length of each tool, so does cutter radius compensation allow them to ignore the precise size (radius) of certain milling cutters. Point out that, unlike tool length compensation that is used for every tool in every program, cutter radius compensation is only used for milling cutters - and only when milling on the periphery of the cutter, as when contour milling.
There are other subtle advantages to using cutter radius compensation. As with tool length compensation, cutter radius compensation allows sizing and trial machining. If an XY surface is not being machined to size, an offset can be adjusted. Also, cutter radius compensation makes programming easier. Without cutter radius compensation, the programmer must specify all XY coordinates for the contour to be milled based upon the cutter's centerline path - which doubles the needed calculations. With cutter radius compensation, the programmer specifies all XY coordinates on the work surface. In many cases, this means print dimensions can be used in the program.
Point out right away that cutter radius compensation tends to be one of the more difficult programming features to fully master. Frankly speaking, it is a little difficult to explain this feature. I'll give you a few pointers that have helped me.
There are three steps to programming cutter radius compensation:
By far, the most difficult step for you to explain and for students to understand is instating cutter radius compensation. Start by pointing out that there are three G codes used with cutter radius compensation. One of G41 or G42 is used to instate cutter radius compensation. G40 is used to cancel it. I have two ways to explain whether to use G41 or G42. If students have manual milling experience, they understand the difference between climb and conventional milling. Then it's easy:
This assumes that they are using a right hand milling cutter (spindle running forward, M03). To help them remember, point out that climb comes before conventional (alphabetically) and 41 comes before 42 (numerically). So if they're going to be climb milling, G41 will be used to instate cutter radius compensation. If they're going to be conventional milling, G42 will be used to instate.
If students don't understand the difference between climb and conventional milling (they probably have had other problems to this point in the class), it be more difficult to explain whether to use G41 or G42. I'll say something like: "Look in the direction the cutter will be moving during its cutting operation. You may have to rotate the print to do so. Looking in this direction, ask yourself which side of the workpiece the cutter is on. If the cutter is on the left, you'll be using G41 to instate cutter radius compensation. If the cutter is on the right, you'll use G42." And to help them remember, again, point out that left comes before right (alphabetically) and 41 comes before 42 (numerically).
Unfortunately, determining whether to use G41 or G42 is just the beginning. Point out that as with tool length compensation, an offset is used with cutter radius compensation - and that most controls use a D word to specify the offset number used with cutter radius compensation. With some controls, there are two registers for each offset - one for the tool's length and the other for its radius. With this kind of control the D word should be made the same as the tool station number (and the tool length compensation number).
But most controls have but one register per offset. With these controls, the offset number that corresponds to the tool station number is already being used to specify the tool length compensation value. So another offset must be chosen. We recommend adding a constant number (that is larger than the number of tools the machine can hold) to the tool station number to come up with the offset to be used with cutter radius compensation. If the machine can hole twenty tools, for example, add thirty to the tool station number to come up with the cutter radius compensation offset number. For tool five, for example, use offset number five to specify the tool's length and offset thirty-five to specify its radius.
There is one more thing related to instating cutter radius compensation - and it tends to be the most difficult thing for students to understand. Explain that before instating cutter radius compensation, the milling cutter must first be positioned to a position that clears the first surface to mill. I call this the prior position. The next drawing shows our example.
Shown as point one in the drawing, notice that this position is still the centerline coordinate of the milling cutter. It must be at least the cutter radius away from the first surface to mill for the largest cutter you anticipate using. That is, this prior position also determines the maximum cutter size.
Say, for example, we intend to use a 1.0 inch diameter cutter for the example above. The X coordinate for point one must be at least X6.5 (this will bring the cutter perfectly flush with the surface to mill. If the setup person enters anything larger than 0.5 in the cutter radius compensation offset, an alarm will be sounded. For this reason, most programmers make the prior position a little further away from the first surface to mill. A position of X6.6 in our example would allow a 1.125 diameter cutter to be used. Actually any cutter up to 1.2 inches in diameter (0.6 radius) can be used before an alarm will sound.
To actually instate, a command including the G41 or G42 (whichever is appropriate), the D word, and a movement in X and/or Y to the first surface to mill will be given. Note that this can be done in a rapid motion (if the cutter is clear of the workpiece) or a straight line motion. Cutter radius compensation cannot be instated during a circular motion. In our case, cutter radius compensation will be instated during a motion from point one to point two.
Once cutter radius compensation is instated, it remains in effect until it is cancelled. It is during these motions under the influence of cutter radius compensation that the contour is milled (in our case only one surface is milled - a movement to point three). In many cases, however, there will be several surfaces to mill. Point out that the control will be constantly looking ahead in the program to determine what's coming up in the next command. Based upon what it sees, it will continue to keep the cutter on the left or right side of all surfaces it sees (based upon whether G41 or G42 is used to instate).
Finally, cutter radius compensation must be cancelled. And again, G40 is used to cancel. We recommend retracting the tool in Z (if possible) prior to cancelling. So after the movement from point two to point three, the tool will be retracted (at rapid) and a G40 will be specified.
Here is an example program that shows the three steps to using cutter radius compensation. Note that we're assuming the control has but one register per offset.
Trial machining considerations
Explain that cutter radius compensation allows a setup person to easily trial machine XY surfaces. When they see an XY surface that has a critical tolerance, they can simply increase the cutter radius compensation value (by a value of 0.010 inch is usually good enough). This will make the machine think that the cutter is larger in diameter than it really is - and it will keep it away from the surface being machined. Once the tool has machined the surface, the program is stopped and the surface is measured. The offset will then be adjusted based upon the findings of the measurement. The tool will then be rerun. The next time it cuts, the surface will be within the tolerance band.
With milling cutters that machine critical XY surfaces it's likely that tool wear will impact the surfaces being machined. As tools wear, their tendency will be to become smaller in diameter. And again, with most tools, they won't shrink enough during their lives to cause a dimension to go out of tolerance. But for those tools that machine extremely critical XY tolerances, the operator may have to reduce the cutter radius compensation value before the tool is completely dull.
What about turning centers?
While our discussions have applied only to machining center compensation types, many of these same points apply to turning center compensation types (geometry offset, wear offsets, and tool nose radius compensation). The entire introduction will apply nicely Geometry offsets are similar to fixture offsets in that they are used to assign program zero. And tool nose radius compensation is quite similar to cutter radius compensation. Rest assured that our Turning Center Curriculum does include appropriate presentations for these features.
Time saver: Program Offset Entries Whenever Possible
As you know, certain offsets must be entered before a job can be run. For machining centers, these offsets include fixture offsets, tool length compensation offsets, and cutter radius compensation offsets. For turning centers, they include geometry offsets, wear offsets, and tool nose radius compensation offsets.
In most CNC applications, setup people are responsible for entering offsets manually - during the setup. Indeed, one of the main benefits of most compensation types is that they allow the separation of programming tasks from setup tasks. For those tooling-related variables a programmer won't know when programming (like a cutting tool's exact length or radius), a setup person will handle them at the time the setup for the job is made.
While compensation types do, in most cases, make life easier for programmers, there are times when you will know (or will find out) what the values of certain offsets will be long before a setup is made. We make a very important statement about this: Any time you know the values of offsets prior to running a job, you can probably reduce the time a machine is down between production runs (setup time) by programming the offset settings.
Tool length compensation offsets
Consider, for example, a company that measures tool length compensation values for tools used on machining centers off line. A tool setter (probably in the company's tool crib) assembles and measures these values. They probably write tool length values down on a piece of paper for the setup person to copy into the machine during setup.
Instead of writing down the offset settings, the tool setter could be entering (or modifying) a tool offset entry program as long as they have a computer with a simple text editor close by. Consider this template program:
Notice all the G10 commands. These are data setting commands. G90 tells the control to overwrite the current offset register value with the one included in this command. The L word tells the control the kind of data to be set (L1 specifies tool offset data for most Fanuc controls). The P word specifies the offset number. We've included twenty tools in this template program. If the job doesn't require twenty tools, the tool setter will simply delete the unneeded commands. The R word specifies the value to be entered into the offset. Note that with this template program, the tool setter must simply modify the R word in each command.
In our template program, we've included a value of 20.0000 for all R words, which is longer than any tool the company uses. If the tool setter doesn't have all the needed components to assemble a given tool, they'll leave the value as 20.000 and the setup person will easily see which tool/s have not been assembled and measured. (Note that if the setup person accidentally runs the program with an offset set to 20.0000, the tool will be run well above the setup.)
Again, as the tool setter assembles and measures a given tool, they will edit the appropriate R word in this program. After loading all cutting tools in the machine, the setup person will simply load this program and run it once. Doing so will enter all tool offsets. While this assumes your company has a pretty good distributive numerical control (DNC) system, this can be done within seconds. Entering twenty offsets manually will take much more time and is an error-prone task.
Note that there are tool length measuring devices that will actually create the program shown above (or one much like it). Go to the Parlec website to see one. This eliminates the need for the tool setter to type the offset value, and also eliminates the possibility for typing mistakes.
Tool nose radius compensation offsets
Again, any time you know the value of offsets prior to making a setup, it is wise to program offset entries. Another example has to do with tool nose radius compensation for turning centers.
As you know, the setup person must enter the tool type (a code number) and the tool nose radius for any single point cutting tool that uses tool nose radius compensation. If the setup person forgets to do so (and current values are zero), the control will behave just as if tool nose radius compensation is not being used - and the workpiece will not be machined correctly.
Most programmers will specify the tool nose radius to be used for each tool right on the setup sheet, meaning they do know the value of tool nose radius compensation offsets as the program is written. Consider this program.
Notice that this program begins with two G10 commands. In line N005, the R register of offset number two is set to 0.0312 and the T is set to a value of 3 (a turning tool). Offset four's R is set to 0.0156 and T is set two 2 (a boring bar). These commands keep the setup person from having to enter the offset values manually (saving time) and eliminate the possibility of forgetting them - or entry mistakes.
One last example we'll mention is related to fixture offsets. If you make qualified setups that are repeated on a regular basis, the program zero location/s will be in exactly the same location every time the setup is made. For the first time the setup is made, it may be necessary to actually measure these values and manually enter them. But for every subsequent time the setup is made, these same numbers must be re-entered.
Again, if you know the values of offsets, why would you force a setup person to manually enter them? Consider this program:
For many Fanuc controls, L2 specifies that you're setting fixture offsets. The P word specifies which fixture offset is being set. And X, Y, and Z specify the values going into the fixture offset registers.
G-code primer: Outputting Fixture Offset SettingsPrograms provided by Steve Legg of Messier-Dowty
Two special commands are used in custom macro B to send data out through the communications port (RS-232c port). One called BPRNT allows the output of alpha-numeric text data and a few special characters, as well as macro variable values formatted as integer numbers with a variable number of significant digits. BPRNT outputs variable numeric data as a combination of 8-bit characters that yield 32-bit binary values. I've seen little use for BPRINT.
DPRNT also allows the output of alpha-numeric text data and a few special characters, as well as macro variable values, formatted with a variable number of decimal places. DPRNT outputs variable numeric data as text characters. In most applications, DPRINT will be your command of choice for outputting data through the communications port.
If your machine has custom macro B, you can use the DPRNT command any time you want to output information. This command is used, for example, with touch probe-based post-process gauging systems to output the measurements taken by the probe.
In this article, we'll be demonstrating the use of DPRNT for the purpose of outputting fixture offset settings. You may know that Fanuc provides a standard way to output the current values of all tool offset registers (for tool length and cutter radius compensation values). But this action does not include fixture offset registers.
If you have qualified tooling and jobs are often repeated, the values of fixture offsets for those jobs are known, but must still be re-entered each time the job is run. Long prove outs or large batches of parts sometimes have to be interrupted too. Recording, then changing fixture offset values allows operators on a multi-pallet machining centre to readily switch between jobs, proving out new work during the day and afternoon shifts (for example), then running production on another pallet at night. Setup people commonly write these values down somewhere, a practice that leaves room for copying mistakes and information loss. One of the programs we'll be showing outputs a nicely formatted list of all current fixture offset settings instead, quickly eliminating the possibility of recording an incorrect value, or losing correct ones.
When the job is rerun, the setup person must re-enter the fixture offset values, which takes time, and again, opens the door to entry mistakes. If your machine/s allow G10 (data setting by program command), our second program will be very helpful. It actually outputs a program including the appropriately formatted G10 commands. When the job must be re-run, the setup person simply loads and runs this program.
Before we show the programs, you must understand a little about the DPRNT command. It is also important to know how fixture offsets are referenced within custom macro.
Opening and closing the communications port
Prior to giving the DPRNT command/s, you must open the communications port for transmission with POPEN. And when you're finished, you must close the port with PCLOS.
With DPRNT, you can output a series of alpha characters and numerical values, including any value stored in a variable. For numerical values, you must also specify the decimal format to be used when the value is printed. The best way to present the DPRNT command is to show an example:
Notice how the commands POPEN and PCLOS commands surround the DPRNT statement/s. Again, they open and close the communications port.
Everything within the expression to the right of the DPRNT word is enclosed in brackets. This is part of the syntax for DPRNT. Alpha characters (like the word AXIS) are printed exactly as they appear. Each asterisk character will be printed as a space character.
Notice the bracketed numbers to the right of local variables #5 and #30. They specify the decimal format to be used for printing the current values of #5 and #30. For #5, which is currently set to a value of one (1), the value will be printed with one place to the left of the decimal point and zero places to the right of the decimal point. In essence, this value will print a whole number.
For #30, the value (-32.8616) will be printed with three significant digits to the left of the decimal point and four digits to the right of the decimal point. Since our current value (-32.8616) has only two significant values to the left of the decimal point (32) only two values will be printed to the left of the decimal point.
The result of this command, when printed, will be the text:
AXIS 1 - 32.8616
Accessing the values of fixture offsets
A series of system variables gives you access to fixture offsets. Unfortunately, the system variable numbering varies from one Fanuc control model to another, so you'll have to find those that are used on your particular control model. For a 10, 11, and 15 series control, among others, they happen to range in the 5200 series. Here is the list of system variables for these control models:
Notice how each fixture offset system variable is twenty greater than the previous one. That is, the X system variable for fixture offset number two is twenty greater than the X system variable for fixture offset number one. This trend repeats for every axis of every fixture offset. This will be important to know as you study the programs below.
Printing the current list of fixture offset settings
Here is an example of the text that will be sent out through the communications port when our first program (O5555) is run:
Again, the output of this program will be a simple text file that can be printed and included with the setup documentation for the job. The next time the job is run, the setup person will enter the values into the control from this sheet.
Here is the program that outputs the current fixture offset settings:
Outputting a G10 program
Again, the previous program does require the setup person to manually enter the fixture offset values each time the job is run. If your machine allows the G10 command (data setting by programmed command), as most current machines do, you can actually eliminate the need for manual fixture offset entry. Here is an example of a program that will be created:
Note that this program does leave the control in fixture offset number six (G59), so be sure to include the initial fixture offset instating command at the beginning of your machining program/s. Also, notice the M00 at the beginning of the program. Since this program will overwrite the current settings of all fixture offset registers, this command gives the operator one chance to abort the program if they've run it by mistake.
Here is the custom macro that outputs the G10 program.
A limitation of DPRNT
You may be wondering why, if the control has custom macro, we use G10 for the purpose of getting fixture offsets re-entered. The commands:
for example, can be used to set the X, Y, and Z registers of fixture offset number one to the current values of #24, #25, and #26 respectively. These commands can be used instead of the G10 command. However, we've run into a limitation of the DPRNT command when trying to output the text "#5201=#24".
There seems to be no way (we know of) to print certain characters like the pound sign (#) and the equal sign (=). This eliminates the possibility of using the commands shown above to re-enter the fixture offset setting commands. This means the machine must have the G10 option enabled in order for this program to work.
A request for help!
If you know of a way to use the DPRNT command to print these special characters, please let us know. Simply email us at email@example.com. We'll include your technique in an upcoming issue of The Optional Stop newsletter.Again, thanks to Steve Legg for providing these excellent programs. It is exactly this kind of information The Optional Stop newsletter is intended to provide. If you have techniques you would like to share, be sure to let us know!
Parameter preference: Setting Up User Defined G and M codes
Parameters control countless things about the way your CNC machine tools behave. In each Parameter preference segment, we will expose parameters that have an important impact on how your machines run. But first, a disclaimer. Parameters vary from one Fanuc control model to another - as do the actual functions they control. Always check in your Fanuc Operators manual and/or Maintenance manual to confirm the parameter number and settings we show. Never blindly change a parameter! If there is any doubt about what the parameter does, contact your machine tool builder to learn more.
As you know, there are many G and M codes included with your CNC machine tool. These words have a fixed usage that is determined by the control manufacturer (Fanuc in our case) and the machine tool builder. What you may not know is that you have a way of creating your own G and M codes - you can even change the function of those that your machine currently has.
Though this application is commonly thought of as a custom macro application, note that most machines don't require custom macro in order for you to create user defined G and M codes. By far, the best applications for user defined G and M codes involve custom macro techniques, but in this article, we'll limit our discussions to applications that do not require custom macro.
One example application involves safety words that many programmers like to include at the beginning of their programs. These words ensure that the machine is in the appropriate states (commonly the same states as when the machine is first turned on). Here is an example of a series of safety commands for a machining center program:
Remember that there is a limitation when it comes to how many G codes can be included in one command (with most Fanuc controls, it is three). This is why we've broken the safety words into three commands.
As stated, many programmers like to include these commands (or something like them) at the beginning of all programs. To shorten the amount of words needed in your program, you can define your own G or M code which would instate all of these words.
When picking the G or M code number you wish to define, you must be careful not to overwrite a current G or M code since Fanuc also allows you to redefine any G or M code as well as create new ones. To ensure that you don't pick one that's already in use, Fanuc allows you to define G and M codes over a value of one-hundred (G101 or M101, for instance).
So instead of invoking the safety words given in the three commands shown above, you can simply have the command
do so (after defining G101, of course).
You probably already have many programs that are run on your CNC machine/s. If you add G101 (or any new G code) now, it's likely that many programs will have to be changed. This is one time when re-defining a current G or M code can be helpful. If you can pick an appropriate G or M code, you may save a lot of editing.
In our case, we might want to change the function of G90 - the absolute mode selector. If we do, whenever the control executes a G90, it will invoke all of safety words and perform the normal function of G90. Since most programmers include a G90 at the beginning of all programs (and at every tool change), we can be sure that the machine is always in the desired states when programs are run.
How it works
There is really nothing magical going on. All we do to create a user defined G or M code is set up a cross-reference within the control. A series of parameters is used for this purpose. In the case of defining the G101, for example, a parameter is set to tell the control that whenever a G101 is executed, it must run a pre-determined program. Within this special program, we'll include all of the safety words.
The same is true for re-defining a current G or M code. And if the invoking word (G90 in our example) is included within the special program, the control will perform its normal function (selecting the absolute mode in our case). The control will not try to execute the special program a second time.
Finding the parameters
As always, we recommend starting in the Fanuc Operator's Manual in the section that is most closely related to the parameter/s in question. Since user defined G and M code parameters are associated with custom macro, I start by looking at the custom macro descriptions.
Toward the end of the custom macro descriptions in the 15 series manual, I find three headings of interest: Macro call using G code, Macro call using M code, and Subprogram call using M code. For M codes, I recommend using Macro call using subprogram, since it most closely emulates how true M codes work.
There are ten parameters related to user defined G codes, meaning up to ten user defined G codes can be defined. They range from parameter 7050 through 7059 (again, for a 15 series control). I notice that each is related to a pre-determined program. 7050 is related to program O9010. 7051 is related to O9011. And this continues through parameter 7059, which is related to program O9019.
User defined M code parameters are similar. They range (for this control) from parameters 7071 through 7079. Program O9001 is related to parameter 7071. Program O9002 is related to parameter 7072. And this continues through parameter 7079, which is related to program O9009.
Creating a user defined G code
Say I want to create a new user defined G code (G101). To do so, I must first set parameter 7050 (or any of the available user defined G code parameters) to a value of 101. I must also load/type program O9010 (or the corresponding program number) into the control:
Note that this program must end with an M99, like a subprogram.
From this point, whenever a G101 is read by the control, it will execute program O9010, and invoke the various safety words.
Changing the function of a current G code
The same thing goes for re-defining a current G code. Say I want G90 to be used to invoke all safety words, and, of course, to set the absolute mode. This time I'll set parameter 7050 to a value of 90. And here is the related program:
Notice that the only difference is the addition of a G90 word. Remember, this will cause the control to perform the normal function of G90 - it will not try to execute program O9010 a second time.
An application for user defined M codes
Our simple application for user defined M codes is related to making two similar machines more compatible with regard to M codes. Consider, for example, two turning centers made by different manufacturers. One uses M41 and M42 for low and high spindle range. The other uses M23 and M25.
Any program that must be run in both machine will have to be edited on a regular basis. But we can make these two machines more compatible by adding two user defined M codes to one of the machines. We'll pick the machine that uses M25 and M25.
On this machine (assuming it has a 15 series control), we'll set parameter 7071 to a value of 41 and parameter 7072 to a value of 42. From this point on, whenever the control sees an M41, it will execute program O9001. When it sees an M42, it will execute program O9002. Here are the two programs:
Notice that all we've done is included the appropriate M code for low or high spindle range in each program. Again, when the control reads an M41, it will execute program O9001 and perform an M23. When it reads an M42, it will execute program O9002 and perform an M25.
There are countless applications for user defined G and M codes. We're showing some pretty simple ones. To learn more, you'll need to learn more about custom macro - which is Fanuc's version of parametric programming. Note that we offer several training products that can help your learn custom macro.
Safety tip: Watch Out For That Tailstock Center!
Many turning centers, commonly called universal style turning centers, have the ability to do chucking work, bar work, and shaft work. These machines have horizontal spindles, meaning the workpiece is loaded and held in a horizontal orientation. With chucking work and most bar work, the tailstock is not used. It is usually retracted far out of the way. Our safety tip has to do with how you manually load workpieces when doing chucking and shaft work.
We recommend getting in the habit of holding workpieces when loading them into horizontal spindle turning centers from below. Never allow your hand to get behind the workpiece (grabbing it from the right end) during the loading process. While this may be okay for loading in chucking applications, when you're performing shaft work - and the tailstock center is in close proximity - your hand will be right in the way of the tailstock center if you grab the workpiece from its end.
As you know, most turning centers use foot-pedals to activate the chuck and tailstock - and with some machines these foot-pedals are quite close to one another. If you step on the wrong one by mistake, the tailstock will advance when you're expecting the chuck to close. And again, if your hand is in the way, you'll be seriously injured. If you always hold and support workpieces from below whenever loading them, your hand will never be in the way of the tailstock center.