Sunday, 6 November 2011

Tool calibration for cnc machine




Tool calibration
Tool calibration consists of lowering a tool until its bottom reaches a fixed reference point and then having the CNC memorize the Z-coordinate. This reference point must be the same for all tools used to make a specific part. Since no universal vertical reference point has been setup on the mill one has to be improvised. Often a flat surface on the part being machined is selected. This surface then becomes the point defining Z=0.

Here are practical pointers:
  • Turn on the spindle during the calibration process. In this way, should the tool be accidentally driven into the workpiece it will hopefully machine away the material and pose a lesser risk of damaging the tool or the machine.
  • Step in the Z-direction with low speed. (Practice manipulating the tool with the tool away from objects so as to avoid collisions. Lower the table if necessary to create clearance.)
  • Control step size using the jog control and use smaller discrete steps when nearing the reference surface.
  • The tool height is noted when the tool just scratches the reference surface.

Cutting Speed and Feed Rate

Cutting Speed and Feed Rate Settings
The cardinal rule in machining is to remove as much material as possible within the limits of machine capability. That is, to machine as quickly as possible. It is not so much a question of minimizing time wasted machining, but one of maximizing cutting tool life.
  • Feedrates that are too low produce excessive heat which may cause premature failure of the cutting edge.
  • Feedrates that are too high may cause the cutting edges to fracture or cause more catastrophic failure.
  • Cutter speeds outside the recommended range may cause the cutting edges to experience buildup, wear excessively, crater, chip, or produce poor workpiece surface finish.
Cutting speed is the term used to express the velocity of the outside edge of the milling cutter (SFPM = surface feet per minute) as it cuts a specific material. Each material has an optimum range for its machinability with each cutting tool material (i.e. H.S.S., Carbide, etc.) Recommended cutting speeds are given in charts, usually as a range.
Feed rate (IPM = inches per minute) is the rate at which the cutting tool advances into the work. The allowable feed rate is governed by the cutter rotation speed (RPM), the number of cutting teeth on the cutter (called "flutes"), and by the size of the chip that the cutter can withstand (the chip load.)
Chip load (IPT = inches per tooth) is a measure of the chip thickness that one tooth can carve off of the workpiece. The recommended values for chip load are based on the cutting tool material, the cutting tool size, and the hardness of the workpiece material. The recommended values for feed per tooth are given in charts, usually as a range.
The formulae shown in the table bellow are used to compute the feedrate and cutter speed. The cut is assumed to be a slot of width equal to the tool diameter. The depth of the cut is specified in the tables that provide the SFPM and IPT values. As a rule-of-thumb do not bore deeper than the tool radius when making slots.
TERMEQUATIONRESULT
Revolution SpeedRPM = 3.82 x SFPM ÷ DSpindle RPM
Inches per MinuteIPM = RPM x IPT x (No. of Flutes)Tool Travel Speed
Where:
D: Tool diameter in inches
SFPM: Surface Feet/Minute. Lookup in a table based on material being machined.
IPT: Chip Load/tooth (feed per tooth in Inches Per Tooth). Lookup in a table.
Remember that the feed rate and speed setting can only be used under ideal circumstances.

Alternatively, this MATLAB M-file may be used to compute feedrate and tool speed. (Note: This program returns different feed and speed values than those computed by hand using information on this page. The M-file uses a different set of tables for SFPM and IPT. This goes to show the variability of the RPM and IPM values.)
While the recommended feedrates found in charts represent good fundamental machining practice, they are however only recommended starting values. SFPM and IPT vary by material machined, material of the cutter, sharpness of cutter, type/amount of coolant used, depth of cut, milling machine horsepower, etc. Circumstances usually require deviation from these recommended values.
For instance,
  • The feedrate used on small or thin work may need reducing.
  • The work holding technique has a great deal to do with the feed rate. Setups lacking rigidity may require a lower feedrate.
Remember that using a chip load that is too small will cause excessive tool wear. Do not just set the feed rate low and think this is correct. A good rule of thumb is to start out at the low or mid range of chip load and increase the feedrate to the capacity of the machine tool, the setup, and the desired surface finish. Selecting the speed and feed for a job is an art and some judgment must be made based on common sense. For instance,
  • Does the chip formation look good?
  • Does the milling machine sound as if it is struggling?
  • Does the finish look bad?
APPROXIMATE CUTTING SPEEDS (SFPM)
 H.S.S. ToolingCarbide Tooling
Aluminum4001000
Brass300800
Cast Iron80350
Steel - Mild100450
Steel - Carbon60300
Steel - Stainless40200
APPROXIMATE CHIP LOAD (IPT) H.S.S. Tooling
1/32 to 3/32"0.0002 - 0.0004"
1/8 to 3/16"0.0002 - 0.001"
1/4 to 5/16"0.0005 - 0.002"
3/8 to 1/2"0.0005 - 0.003"
9/16 to 11/16"0.0005 - 0.004"
3/4 to 15/16"0.001 - 0.006"
1 to 3"0.003 - 0.015"

Friday, 4 November 2011

Limitations of the integrated postprocessing and simulation program

Modelling the material removal:
The actual simulation program does not simulate the material removal process yet. Consequently the
workpiece geometry is not updated during the execution of the milling path. As a result the simulation
program can only perform a collision test on the geometry of either the blank part or the final workpiece. For
most applications this will be sufficient. Simulation using the blank part is safe and the absence of small
details in this geometry fastens the execution of the simulation run. However if a lot off the material is cut to
produce the final shape, the program could report collisions of the tool holder or the machine structure with
bulk material already cut by the preceding part of the tool path.

Automatic modification of the tool path:

Presently it is impossible to inform the CAD/CAM system about a collision in order to force the CAM module to automatically correct the cutter inclination (e.g. lead angle) and to eliminate the collision. To achieve this goal one could integrate the CAM module, the NC-postprocessor and the simulation program. However generating and verifying the NC program depends on the knowledge of the clamping position and the tool length. Therefore combining the tool path generation, the post-processing and the simulation is only useful if both the clamping position and the length of all cutters are known in advance. The CAM module could send each cutter location to the NC-postprocessor. The NC-postprocessor calculates the movement made by the NC machine. The simulation software automatically verifies this movement. If a collision occurs which the  NCpostprocessor can not avoid, then the CAM module becomes informed. The CAM system in its turn applies collision avoidance methods considering the type of collision. Again implementing a general solution able to handle all situations would be very complex. However for certain groups of workpieces, machined on a specific milling machine, one could specify a number of collision avoidance rules that give the CAM module the ability to avoid most collisions.

Kinematics of five axis milling machines

Five-axis milling machine normally has three translational and two rotary degrees of freedom. These configurations allow to program any arbitrary tool axis orientation. Usually both rotary axes are perpendicular to each other and their orientation equals the direction of the linear axes. The primary rotary axes have a constant orientation, while the orientation of a secondary axis changes due to a rotation around the primary axis.
One rotary axis has a fixed inclination with respect to the tool axis. The second rotary axis has a fixed orientation with respect to the clamping table. To simplify the formulae in this section the rotary axis which orientation remains fixed with respect to the tool axis will be defined as the principal rotary axis.

If the conventional kinematics of a five axis milling machine is considered, the conclusion follows that each orientation of the tool-axis (i,j,k) can be achieved at two different positions of the rotary axes. However a limited range of the rotary axes often eliminates one of these solutions. If the principal B-axis is zero ( i=0, j=0, k=1) then any value for the second axis is satisfactory. This is called a degenerated position : the C-axis is parallel to the tool axis and therefore has no influence on the orientation of the tool axis with respect to the clamping plane. If the tool axis is moved from the first solution space (B > 0) into the other solution space (B < 0) then the tool axis goes through the degenerated position (B = 0 and i=0, j= 0, k=1).

Numerical control working

There's not all that much to it as long as the CNC control truly allows direct numerical control. For Fanuc models 6MB and more recent, for example, as long as your communications protocol is properly set up (baud rate, stop bits, handshaking, etc.), the actual task of running a the CNC machine from an off line computer is pretty easy.
This is pretty much the same protocol used for distributive numerical control (transferring a program in its entirety), but with an emphasis on handshaking - usually with xon/xoff . Usually a setting parameter controls whether the cycle start button will activate a program in the control's memory or a program from the serial communications port (computer). With Fanuc controls, it's usually on the setting page and labeled Input Device. For most control models, it must be set to RMT (For remote) when you want to run directly from a computer.
After ensuring that the connection is made between the control and computer and parameter settings are correct, most controls simply require that you first turn on single block (so the program won't run until you're ready for it to).
Next, you press the cycle start button. But since there is no program coming through the serial port (yet), and because of handshaking, the control will simply wait.
Finally, you go to the computer and send it to the machine (like you do for distributive numerical control). When you get back to the machine, you'll notice that it has executed the first command of the program (the program number for a Fanuc control) and stopped (since single block is on).
When you turn off single block and press the cycle start button, the control will execute the program.
With most controls, however, you won't see much of the program on the display screen (as you do when executing a program from memory). Only what's in the look ahead buffer will be displayed. And of course, you won't be able to edit the program at the control as you can when executing a program from memory.

Differences between manual, conversational, and CAM system programming

There are actually three types of programming methods, manual programming (which I think you're referring to as NC), conversational programming (which is also called shop floor programming), and computer aided manufacturing (CAM) system programming. Each has it's place and application.
Generally speaking, manual programming is best when jobs are simple, there aren't all that many new programs required, and/or there is a need for the CNC program to execute as efficiently as possible. A programmer prepares the program in the same language that the CNC machine will execute it, which can be tedious and error-prone - but manual programming lets the programmer be as intimate with the CNC machine as possible. This means programs can be written in a way that they execute as efficiently as possible on the machine. While some CAM systems can generate pretty efficient CNC programs, I'd still recommend manual programming to anyone doing ultra high-volume work. You just can't beat the efficiency of a well formatted manually written program.
Conversational programming is best done when programs must be created while the machine is down in setup. If, for instance, a company sees a great deal of repeat business, if lot sizes are very small, and cycle times are very short, it will be difficult (if not impossible) to prepare programs up front, while the machine is running production. Conversational controls can be thought of as a single-purpose CAM system, making it quick and easy to generate a program right at the machine. With print in hand, the setup person can step up to the machine and quickly create the CNC program. Conversational controls allow programs to be entered without any need for math, and take much of the tediousness out of programming. With one popular turning center conversational control, for example, average programming time is under ten minutes.
CAM systems are best used when there are a variety of machines to program (a programmer would have trouble keeping the language for each machine straight), there is quite a bit of new business (many programs to create), and/or jobs are quite complex (making it difficult to manually program). Like conversational controls, CAM systems remove the tediousness from programming. Workpiece geometry is first imported to the CAM system from a computer aided design (CAD) system, which eliminates the need for the programmer to define the workpiece size and shape. The programmer then specifies how machining is to be done. CAM systems vary dramatically with regard to how machining is defined, but most allow the programmer to choose machining operations from a menu and specify the machining parameters in fill-in-the-blanks fashion. The CAM system then generates a CNC program - the same kind of program a manual programmer will write. This program is then loaded into the CNC machine and run.


Difference between helical and spiral interpolation

Helical interpolation is required when thread milling a straight thread. Two axes (usually X and Y) move along a circular path while the third axis (usually Z) moves along a straight path. The radius remains constant throughout the circular movement in XY.
Spiral interpolation is required when thread milling a tapered thread with a taper thread mill to avoid leaving a nasty witness mark at the beginning/end point for the thread. As the tool moves around the thread in XY, the radius of the circle being machined must decrease (or increase, depending upon the machining direction) in order to compensate for the Z axis motion.

What is the difference between a 2.5 and 3 axis machine?

An axis is a direction of motion controlled by the CNC machine control. It can be linear (motion along a straight line) or circular (a rotary motion). The number of axes a machine has determines it's machining capabilities. A 2.5 axis machine really has three moving axes, but only two axes can move together (most machines sold today are full three axis machines). For machining centers, a three axis machine will have three linear axes. A four or five axis machine will have three linear axes as well as one or two rotary axes.
Note that 2.5 versus 3 axis has yet another context. 2.5 axis machining requires that the machine have three axes, but only two axes must be moving simultaneously at any one time. (Simple operations, like drilling and most milling, fall into this category). On the other hand 3-axis machining requires that all three axes be moving at the same time (More complex operations, like the machining of sculptured surfaces required in molds and airfoils, fall into this category.)

Benefits of constant surface speed.

 There are (at least) four benefits to using constant surface speed mode for appropriate applications.
1) Easier programming
The correct rpm for a cutting tool is based upon this formula: RPM=3.82*SFM/DIAMETER. If an accurate speed in rpm is to be used, the person calculating the rpm must first determine the tool's appropriate speed in surface feet per minute (note that the formula is different when working in the metric mode). Before a person can even begin to make the calculation, they must know the desired speed in sfm. This speed is published by cutting tool manufacturers and is based upon the material being machined and the material of the cutting tool's cutting edge. When using constant surface speed mode, the programmer simply enters the speed in the program directly in sfm (no need for any calculations). The machine will constantly and automatically perform this calculation, updating the spindle speed in rpm.
One common reason why setup people and operators on the shop floor continue to use rpm mode -even though it is easier to use sfm mode - is that they have a background in manual machining. With manual lathes, there is no such thing as constant surface speed. Everything must be done in rpm. When a manual machinist is exposed to constant surface speed on a CNC turning center for the first time, the spindle will probably appear to be running much too fast (most manual machinists cannot run at optimum spindle speeds for obvious safety reasons). Frankly speaking, many manual machinists determine spindle speed in rpm by the seat of their pants, causing the spindle to run at a speed that looks good. Indeed, I've talked to many that never use the rpm formula given earlier - and some that have never heard of it. Many continue using the seat-of-the-pants approach even on CNC turning centers when it is safe to run optimum spindle speeds.
2) Consistent workpiece finish
As long as you work inches- (or millimeters-) per revolution feedrate mode (G99 on a Fanuc control), witness marks left on the workpiece by the cutting tool will remain consistent throughout the cutting tool's machining of the workpiece if you use constant surface speed. Since the feedrate is tied to spindle speed, as the spindle speeds up and slows down in rpm, so will the feedrate in inches per minute. Again, this causes the tool to create a consistent finish throughout the workpiece.
3) Optimum tool life
Since the spindle is constantly running at the appropriate speed in sfm, tool life will be at it's maximum. When compromising speed as must be done when working in rpm mode, the spindle seldom runs at the appropriate rpm, and tool life may suffer.
4) Optimum cycle time
Again, feedrate is directly tied to spindle rpm if you're working in per revolution feedrate mode with constant surface speed. The faster the spindle runs, the faster the tool will machine. So when you're working in constant surface speed mode, cycle time is inversely proportional to spindle speed in rpm. The faster the spindle runs, the shorter the cycle time. Since most machinists working exclusively in rpm mode tend to error on the side of caution (commonly choosing an rpm that is much slower than it must be), cycle time will be longer than it should be.

A few cautions

Out of round workpieces - If you machine a lot of castings or forgings (or any other kind of workpiece that doesn't run true in the spindle), you must be very careful with the constant surface speed mode. One of the reasons why manual machinists have trouble getting used to constant surface speed mode is that they cannot predict what rpm the spindle will be running. And if, for instance, you program the cutting tool to go to the spindle center in X, as is done when facing a workpiece to center, the spindle will run up to its maximum speed in the current spindle range. If working in the high spindle range, the spindle will run up to its maximum. For round, true running workpieces, this is acceptable. But if workpieces are at all out of round, the vibration set up by running too fast can be very dangerous. It can cause the workpiece to be thrown from the workholding device. Note that there is a special function that lets you set a temporary maximum rpm (G50 with Fanuc). But you must remember to use it (and know the maximum rpm a workpiece can be rotated without vibration).
Poor workholding setups - Since speed in rpm is difficult to determine when working in constant surface speed mode, it should only be used when making adequate setups. Another reason why manual machinists tend to prefer working in rpm mode (and running at slower than optimum speeds) is that the workholding devices they've used on manual lathes (commonly manual three-jaw chucks) could not apply the gripping force necessary to run at optimum spindle speed. Most CNC turning centers use hydraulic three-jaw chucks that can supply the gripping force needed to run at maximum speeds. But if you're workholding device cannot grip with adequate force, of course, you cannot run at optimum speeds.
Cycle time waster - While one of the benefits of constant surface speed is improved efficiency, it must be programmed wisely. If you work exclusively in the constant surface speed mode, the spindle will always be rotating at the appropriate speed - matching the diameter the cutting tool would be cutting. While this is great during each tool's cutting operation, consider what happens during tool changing. The cutting tool will rapid to a tool change position (usually a large diameter in X). During this motion, the spindle will slow down. Depending upon your spindle drive system's response time, it will likely take longer for the spindle to slow down than for the rapid motion to occur. If it does, cycle time will be wasted. The same is true during each tool's approach. As the tool rapids to a smaller diameter, the spindle speed will increase in rpm. This constant increase and decrease in rpm not only wastes cycle time, it wastes electricity and causes undue wear-and-tear on the spindle drive system. To program around this problem, most programmers will temporarily switch to the rpm mode just before the rapid motion to the tool change position, using a speed in rpm that is appropriate for the next tool's first position. In this way, the wasted change in spindle speed will not occur, and when the next tool is in position, the spindle will be running at its correct rpm. At this point the constant surface speed mode is re-selected with the proper speed in sfm.
Minimal diameter changes - If you are machining but one diameter on a workpiece, or if there is but a small difference from one diameter being machined to the next (say, under 1 inch of diameter change), constant surface speed will not help you much. In this case, many programmers will calculate the appropriate speed in rpm and run the machine in rpm mode. This also eliminates the cycle time wasting problems caused by constant surface speed (just mentioned).

Confirming that the right pallet is in position.

A pallet changer testing custom macro:


Many machining centers, especially horizontal machining centers, come with a two-pallet pallet changing system. The operator loads one pallet while the other is in cycle. It is quite important, of course, that when the operator activates the cycle, the correct pallet is in the machine. A mistake in this regard can be disastrous.
Unfortunately, most machine tool builders provide little in the way of pallet confirmation. Again, if the wrong pallet is in the machine, the control will simply activate the program, ignoring the problem. If your machine has parametric programming capabilities, it is quite easy to add your own pallet confirmation system. We're showing the example in Fanuc's custom macro B, but with a little ingenuity, you should be able to apply this technique with just about any version of parametric programming.
We'll use a #500 series permanent common variable with which to store the current pallet location. We'll make #501=1 if pallet A is in position and #501=2 if pallet B is in position. #501 is a permanent variable. Like an offset, its value will be retained even after the power is turned off.
With custom macro B, the function of your pallet change activation word (commonly an M60) can be changed to automatically update the value of #501 with each pallet change (see below). A test can be made at the beginning of each program to confirm that the correct pallet is in position before allowing machining to occur.
Note that this is a software solution to the problem and the control could get mixed up if the program is stopped in the middle of a pallet change. A more positive (but much more difficult) method would be to use the #1000 series input signal terminals in conjunction with physical limit switches mounted on the pallet changer to determine which pallet is in position.
Here is the "easy way", using #501 as a flag to determine which pallet is in position:
You must first manually set the value of #501 (just like you set an offset) to initially specify which pallet is in position. You'll find #501on the variables page of your display screen. If pallet A is currently in position, manually set #501 to 1.0. If pallet B is currently in position, set #501 to 2.0.
With custom macro B, a parameter must be set to make the control activate a specific program (O9001 in our case) whenever an M60 is activated. You must reference the custom macro descriptions in the programming manual for your specific control to confirm the parameter number. For a 16M Fanuc control, for example, it is parameter number 6071. You must set this parameter to a value that corresponds to your pallet changing M code. If your pallet changer is activated with an M60, set this parameter to a value of 60. From this point, whenever the control reads an M60, it will execute program O9001.
Next, you must load program O9001 into your control.
  • O9001 (Pallet changing program - control will execute this program when M60 is read)
  • M60 (Normal pallet change command)
  • IF [#501 EQ 1] GOTO 1 (IF pallet A WAS in position GOTO N1)
  • #501=1 (If pallet B WAS in position, set #501 to 1, pallet A now in position)
  • GOTO 2 (Skip N1)
  • N1 #501=2 (Set #501 to 2 - pallet B now in position)
  • N2 M99 (Return to calling program)
Now, in every program that requires the correct pallet to be in position, add these commands at the very beginning:
If pallet A is supposed to be in position:
  • O0001 (Pallet A is supposed to be in position right now!)
  • IF [#501 EQ 1] GOTO 1
  • #3000=100 (WRONG PALLET IN POSITION)
  • N1 (Normal commands in program) . . .
If pallet B is supposed to be in position:
  • O0002 (Pallet B is supposed to be in position right now!)
  • IF [#501 EQ 2] GOTO 1
  • #3000=100 (WRONG PALLET IN POSITION)
  • N1 (Normal commands in program) . . .
The #3000 system variable will, if activated, put the machine into an alarm state (if all is okay, the control will skip this command). The message MC-100 WRONG PALLET IN POSTION will appear on the display screen.
Gary, Remember that the testing commands (at the beginning of programs O0001 and O0002 above) can be placed anywhere in your cutting programs. You could make this testing more "bullet proof" if you include these commands at the beginning of every tool in every program.

Assign more than six program zero points in FANUC


As you may know, Fanuc (and most Fanuc compatibles) are quite limited when it comes to the number of fixture offsets that come standard with the control. While you can buy more fixture offsets as an option (Fanuc offers an extended fixture offset feature containing 48 total fixture offsets), there is a way to assign as many program zero points as you want with but one fixture offset!
However, you do have to give up one important feature of fixture offsets if you use this technique. It is the ability that fixture offsets give you to separate program zero assignment from programs. With the technique we show, you'll be entering program zero assignment values into sub-programs (instead of fixture offsets).
Our technique involves using the G10 command to enter program zero assignment values into fixture offset number one (G54). We'll just keep overwriting this offset over and over again, meaning again, you'll only need one fixture offset!

Here's the technique:

Program zero assigning sub-programs. We recommend using a special series of program numbers (for example, O6001 to assign coordinate system number one, O6002 to assign coordinate system number two, and so on). Here are a few program zero assigning sub-programs.
  • O6001 (Coordinate system number one)
  • G90 G10 L2 P1 X-22.3837 Y-12.2827 Z-11.0387 (Assign fixture offset, this line will be edited whenever coordinate system number one is modified)
  • G54 (Invoke the offset just assigned)
  • M99 (End of sub-program)
  • O6002 (Coordinate system number two)
  • G90 G10 L2 P1 X-15.3332 Y-11.1122 Z-11.3341 (Assign fixture offset, this line will be edited whenever coordinate system number two is modified)
  • G54 (Invoke the offset just assigned)
  • M99 (End of sub-program)
  • O6003 (Coordinate system number three)
  • G90 G10 L2 P1 X-21.1200 Y-13.9377 Z-10.9736 (Assign fixture offset, this line will be edited whenever coordinate system number three is modified)
  • G54 (Invoke the offset just assigned)
  • M99 (End of sub-program)
The L word (L2 in our case) specifies what kind of data is being set. For one popular control, L2 specifies fixture offsets. You'll need to confirm the value of the L word for the specific control's with which you'll be using this technique. P specifies the offset number (number one in our case). We're simply overwriting the current values stored in fixture offset number one in each of these sub-programs. The subsequent G54 ensures that the coordinate system just changed is instated.
You can have as many program zero sub-programs as you need. You're only limited by how many programs your control can hold.
In the main program (or whenever you want to change coordinate systems), simply invoke the related sub-program with an M98 command. Here's a simple program example main program that invokes two of the previously created coordinate systems.
  • O0001 (Main program)
  • N005 T01M06 (1/2 Drill)
  • N010 G90 S600 M03 T02
  • N015 M98 P6001 (Select coordinate system number one)
  • N018 G00 X1.0 Y1.0
  • N020 G43 H01 Z0.1 M08
  • N025 G81 R0.1 Z-0.3 F5.0
  • N030 G80 M09
  • N035 G91 G28 Z0 M19
  • N040 M01
  • N045 T02 M06 (1/4 drill)
  • N050 G90 S1000 M03 T01
  • N055 M98 P6002 (Select coordinate system number two)
  • N060 X2.0 Y2.0
  • N065 G43 H02 Z0.1 M08
  • N070 G81 R0.1 Z-0.5 F3.0
  • N075 G80 M09
  • N080 G91 G28 Z0 M19
  • N085 M30
Again, the one negative to this technique is that the setup person will be modifying programs (O6001, O6002, O6003, etc.) to assign program zero points as opposed to entering values into fixture offsets.