Fundamentals of CNC Machining Notes
I want to learn more about CNC machining.
References
- Fundamentals of CNC Machining, A Practical Guide for Beginners
Introduction and CNC Process Overview
The goal of this book is to teach people with a technical background how to program and operate Computer Numerical Control (CNC) mills and lathes. CNC is a very broad subject and there are many ways to do most things. The goal of this book is to to show how to use CNC to make common types of parts, teach DFM principles, and help engineers become better designers and managers. Subtractive Rapid Prototyping (SRP) deals with small quantities of functional prototypes. Functional protypes are made from materials like aluminum, steel, and polycarbonate that cannot be produced with widely available additive Rapid Prototyping (RP) processes such as SLA (Stereolithography) or FDM (Fused Deposition Modeling). The main advantage of SRP is materials. Almost anything can be machined. Another advantage of SRP is that it teaches real manufacturing constraints typical of the aerospace, biomedical, consumer goods, and electronics industries - all which use CNC for mass production, molds and other tooling. SRP provides the designer with feedback about the manufacturability of design that can save considerable time and money as a part moves from concept to product.
One of the biggest differences between making a few or many parts is in the design of work-holding fixtures. Prototype machining emphasizes quick, simple and cheap work holding solutions such as vises, clamps, screws or even glue or double-sided tape. This book focuses on CNC machines made by Haas Automation, Inc. Hass machines are highlighted because:
- Haas Automation is the largest machine tool builder in the western world
- Haas has donated or endowed many machines to colleges and technical schools
- All Haas machines use the same control, work similarly, and use industry standard programming
- Haas makes several small footprint CNC machines designed specifically for engineering, and other other niche industries
This book uses SolidWorks CAD software and SolidWorks-Integrated CAM (Computer-Aided Manufacturing) software by Autodesk, Inc. for CNC programming. SolidWorks is widely used by both industry and education for mechanical design. HSMWorks is completely and seamlessly integrated into SolidWorks, is very easy to learn and use and is particularly well-suited to persons who known SolidWorks and are new to CNC programming.
The general workflow to go from CAD model to machined CNC part is:
- Begin with CAD model
- Establish job parameters including CNC coordinate system and shock shape/size
- Select CNC process
- Select cutting tool and machining parameters
- Select driving CNC geometry
- Verify toolpath
- Post process
- Transfer G-code program to CNC machine
- Set up and operate CNC machine to make part
Shop Safety
Machine ships are inherently dangerous places that are unforgiving of any carelessness, ignorance, or neglect. Cutting tools, and the chips they produce, are sharp. Chips ejected from the machine can cause eye injuries.
Shop etiquette:
- Know where your hands are at all times
- More deliberately and always look where your hands are going
- Always be aware of what could happen if your hand slips
- Always be aware of what could happen if you lost your footing
- Nor horseplay
- Do not interrupt someone working at the machine
- Never borrow tools from a private toolbox without first asking the owner
- Clean up after yourself
- Always put tools and equipment where you found them
Shop Clothing:
- Wear ANSI approved safety glasses
- If machining operations are loud, use ear protection
- Leather shoes are best
- Do not wear log sleeve shirts
- Remove rings or watches when at the machine
- Wear long pants or work pants
- Long hair should be tied back
- Never wear globes as they can be caught in the machine
General Safety Practice:
- Never use any equipment that you have not been trained to operate by a qualified person
- Never tamper with a machine safety guard or switch
- Use caution with hand cutting tools
- Never push the start button unless you are certain your setup is capable of safety
- Know where the emergency stop is
- Never run a machine alone or without other people in working distance
- Use a paint brush to sweep away sharp chips
- Never use air hose to clear chips from a machine
- Dirty or oily rags must be stored in a fireproof cannister
- Lift with your legs
- Never leave a running machine unattended
- Avoid contact with coolant
- Remain alert
CNC Machine Safety Practices:
- Use machine Rapid and Feed override controls to slow the machine down
- Pay particular attention to moves at the start of program and immediately after a tool change as the tool moves toward the part. Use single-block mode to advance through the program one line at a time until the tool is at cutting depth
- Remain at the machine with a hand on or near the emergency stop button
- Stop the motion at the first sign of trouble
CNC Tools
This chapter introduces the most commonly used tools for prototype and short run production machining. Any tool supply catalog will list many others.
Milling tools include flat, ball, bull nose, and chamfer. Flat nose mills are used for milling 2D contours and pockets. Ball nose mills are used for 3D milling. Bull nose end mills have a radius corner. They are used to creates a fillet at the bottom of a wall. They are also sometimes used for roughing operations. Chamfer mills have an angled nose used to cerate a chamfer or to de-burr parts. Milling tools usually have either two or four cutting flutes. Two flute cutters provide more chip clearance when milling in close areas. Four flute mills are more rigid, can be fed faster, and are preferred when greater chip clearance is not required.
Milling tools are either center cutting or non-center cutting. Center cutting mills can plunge straight down into material, while non-center cutting tools cannot. The cutting edges of the center cutting end mill continue to the center of the tool. Non-center cutting tools require a pilot hole, ramping, or helical motion to plunge into material.
A face mill has inserts that are replaced when worn. They are rigid, may have up to eight cutting edges, and can remove material quickly. They are often used for the first machining operation to quickly create a flat finished plate on the part.
Corner radius (also called Corner Round) tools are used to place a fillet on the outside corner of a part. Slot mills include side milling cutters, slitting saws, and Woodruff keyset cutters. Slitting saws and side milling cutters are installed on a special arbor, Woodruff cutters are single piece tools used for creating slots and undercuts that can be held in a standard tool holder.
Center (spotting) drills are short and very rigid drills used to create a conic on the face of the part. They come to a sharp point and resist bending, so they locate the hole precisely. The conic helps prevent the subsequent drill from wobbling and ensure the drill is located precisely and drills straight down.
Twist drills are available in many diameters and lengths. Usually made of high speed steel, carbide, or cobalt, they may also be used with titanium nitride () for longer life. The tip angle of most twist drills is 118 degrees.
Cutting taps form threads by shearing material away. Form taps (roll taps) form the thread by forming the metal to shape. Form taps produce no chips and are used for soft materials including aluminum, copper, plastic.
Bottoming taps are used to tap blind holes. Spiral point taps push the chips ahead and out the bottom of a through hole. Taps require a hole drilled to the correct size to ensure the thread is formed properly. Most CNC Machines support rigid tapping, which means the tap can be held in a rigid holder. The tap is advanced at a feed rate that matches the thread lead into the hole. The spindle then stops, reverses, and backs out of the hole. Use reamers to create holes of precise shape and excellent surface finish. Reamers require a specific size hole be drilled before use.
A counterbore looks similar to an end mill with a pilot in the center. It is used to spot face holes, and the pilot ensures the spot face is centered on the hole. Counterboring is not necessary when using a CNC machine.
All tools (except left-handed taps) rotate clockwise when viewed from the machine spindle looking down at the part. Cutting tools remove metal by shearing action as shown below. As the tool advances into the material it causes a small amount of the material to shear away, forming a chip.
The thickness of material sheared away by each cutting tooth is called the feed per tooth, or chip load. As the chip is ejected from the work area it carries with it some of the heat generated by the shearing process. One of the best ways to validate cutting speeds and feeds is to observe the chips created by the machining process. Chips should be curled and change color due to heating.
Milling tools can advance through the material so that the cutting flutes engage the material at maximum thickness and then decreases to zero. This is called Climb Milling. Cutting in the opposite direction causes the tool to scoop up the material, starting at zero thickness and increasing to maximum. This is called Conventional Milling. Conventional milling is used often on manual machines because backlash in the machine lead screws causes the tool to lurch when climb cutting. Conventional milling causes the tool to rub against the cutting surface, work hardening the material, generating heat, and increasing tool wear. Raking chips across the finished surface also produces a poorer surface finish. Always use climb milling on a CNC unless specifically recommended by the tool manufacturer.
The tool moves through the material at a specified rotational speed, defined in revolutions per minute (RPM), and feed rate, defined in inches per minute (IPM). CNC mills require calculating speeds and feeds in advance. The best source of data about cutting speeds and feeds for a specific tool, application, and material is the tool supplier. Much of this data is found on manufacturer's web sites or printed tooling catalogs. Another source of speeds and feeds is CAD/CAM software. Speeds and feeds require adjustment due to many factors including the maximum spindle feed or horsepower of the machine, rigidity of work holding, and the quality and condition of the machine tool itself.
Milling machine cutting speeds are derived from:
Speed is the spindle speed in revolutions per minute, SPM is the speed at which the material moves past the cutting edge of the tool in feet per minute, Circumference is the circumference of the cutting tool in feet. There are also formulas for feed and tap feed. The Machinery's Handbook contains extensive information about diagnosing and correcting cutting tool problems.
Coordinate Systems
CNC motion is based on the Cartesian coordinate system.
Most CNC machines can position each axis within .0002 inches or less over the entire machining envelope. This accuracy is achieved in part by the use of a closed loop servo mechanism. The machine control sends a motion signal, via a controller board, to a servomotor attached to each machine axis. This causes the servomotor to rotate a ball screw attached to the table or column, causing it to move. The actual position of the axis is continuously monitored and compared to the commanded position with feedback from a servo transmitter attached to the ball screw. Ball screws have almost no backlash, so when the servo reverses direction, there is almost no lag between a commanded reversing motion and corresponding change in the table direction.
The Origin point for the machine coordinate system is called Machine Home. This is the position of the center-face of the machine spindle when the Z-axis is fully retracted and the table is moved to its limits near the back-left corner. When a CNC machine is first turned on, it does not know where the axes are positioned in the work space. Home position is found by the Power on Restart sequence initiated by the operator by pushing a button on the machine control after turning on the control power.
To make programming and setting up the CNC easier, a Work Coordinate System (WCS) is established for each CNC program. The WCS is a point selected by the CNC programmer on the part, stock, or fixture. While the WCS can be the same as the part origin in CAD, it does not have to be. Its selection requires careful consideration:
- It must be able to be found by mechanical means, such as an edge finder, coaxial indicator or part probe
- It must be located with high precision: typically plus or minus .001 inches or less
- Must be repeatable
- Should take into account how the part will be rotated and moved as different sides of the part are machined
The term Job means a unique machining setup on the machine. Tool and Fixture Offsets are used to relate the Machine Coordinate system to the part WCS and take into account varying tool lengths. Fixture offsets provide a way for the CNC control to know the distance from the machine home position and the part WCS. In conjunction with Tool Offsets, Fixture Offsets allow programs to be written in relation to the WCS instead of the Machine Coordinates.
The Fixture Offset Z value is combined with the Tool Length to indicate to the machine how to shift the Z-datum from part home to the part Z-zero, taking into account the length of the tool.
The CNC machines needs some way of knowing how far each tool extends from the spindle to the tip. This is accomplished using Tool Length Offset (TLO). There are various methods of setting TLO.
CNC Programming Language
CNC machines are very accurate and powerful industrial robots developed jointly by Mr. John Parsons, IBM and Massachusetts Institute of Technology Servomechanism Laboratory in the 1950s.
Most machines have a vocabulary of at least a hundred words, but only thirty that are used often. These thirty or so words are best memorized because they appear in almost every CNC program and knowing them helps you work more efficiently. G&M codes, along with coordinates and other parameters, comprise what is called a CNC program.
CNC programs list instructions to be performed in the order they are written. They read like a book, left to right and top-down. Each sentence in a CNC program is written on a separate line, called a Block. Typically, blocks are arranged in the following order:
- Program Start
- Load Tool
- Spindle On
- Coolant On
- Rapid to position above part
- Machining operation
- Coolant Off
- Spindle Off
- Move to Safe Position
- End Program
It is the job of the CAD/CAM Post Processor to properly format and write the CNC program. CNC programs are simple ASCII character text files that can be viewed or edited in any text editor. Every letter of the alphabet is used as a machine address code. In fact, some are used more than once, and their meaning changes based on which G-code appears in the same block.
G&M codes make up most of the contents of the CNC program. Codes that begin with G are called prepatory words because they prepare the machine for a certain type of motion. Codes that being with M are called miscellaneous words. They control machine auxiliary options like coolant and spin direction.
CNC Operation
- Pre-Start
- Check to ensure coolant and oil levels are full. Ensure the work area is clear.
- Start/Home
- Turn power on the machine and control.
- Load Tools
- Load tools into the tool carousel.
- Set Tool Length Offsets
- For each tool used, jog the machine to find and then set the TLO.
- Set Fixture Offset XY
- Once the vice or other fixture is properly installed and aligned on the machine, set the fixture offset to locate the part XY datum.
- Set Fixture Offset Z
- Use a dial indicator and 1-2-3 block to find and set the fixture offset Z.
- Load CNC Program
- Download the CNC program from your computer to the machine.
- Run Program
- Run the program.
- Adjusts Offsets as Required
- Check the part features and adjust the CDC or TLO registers as needed to ensure the part is within design specifications.
- Shut Down
- Remove tools from the spindle, clean the work area, and properly shut down the machine.
2D Milling Toolpaths
CNC milling toolpaths are broadly classified as either 2D, 3D, 4-axis, and 5-axis, depending on the number of axes involved and how they move. The 2-1/2D milling toolpaths machine only in the XY plane. The Z axis is used only to position the tool at depth. The move to the cutting plane is straight down feed, rapid, ramp, or helical feed move. 3D refers to non-prismatic parts, including molds and complex organic shapes. Most consumer goods, for example, include 3D features. 4th axis toolpaths require an auxiliary rotary axis 4th installed on the CNC machine parallel to either the X or Y-axis.
The operations the CNC programmer chooses and their sequence depends on a bewildering number of factors, including feature size, tool used, capabilities of the machine, feature tolerance and how the part is gripped.
- Clearance Height is the first height the tool rapids to on its way to the start of the tool path. It is usually set $.1000$in above the top of stock because this makes it easier to see if the tool length offset register was set properly.
- Rapid Height is the second height the tool rapids to, and the height the tool retracts to between moves (unless set higher to clear clamps). It is usually set to $.250$in above the top of the finished part face.
- Feed Height is the last height the tool rapids to before starting to feed into the cut. It is usually set to $.1000$in above the top of stock. No rapid motion occurs below this height.
- Top of Stock is the top of the finished face of the part. This value is used as the reference plane for depths.
- Stepdown is the depth of material removed with each cutting pass. This illustration shows one pass, but for deeper cuts or harder materials, many passes may be required to cut to the final depth.
- Depth is the final cutting depth of the machining operation.
- Stepover sets how much material the tool removes with each pass in the XY direction.
- XY Stock Allowance is the material remaining on the finished wall of the part to be removed by subsequent operations.
- Z Stock Allowance is the material remaining on the finished floor of the part to be removed by subsequent operations.
- Toolpath Centerline represents the actual coordinates in the CNC program. In this book, rapid moves are shown as dashed lines and feed moves as solid.
Facing is often the first machining operation. It is used to cut away excess material and finish the highest flat face of the part. Depending on how much stock is removed, several roughing cuts may be required. High speed loop transitions between cut passes produce a fluid tool motion that place less stress and wear on the CNC machine. Contour operations are used to rough and finish outside part walls. Cutter Diameter Compensation provides a way for tool paths to be adjusted at the machine to compensate for tool war and deflection. Pocket tool paths are used to remove excess material. Slots may be machined using the CAD/CAM contour, pocket, or specialized slot milling functions. Chamfer is a type of 2D contour milling. Chamfer mills are of various tip angles are in high speed steel, carbide, or as insert type tools. Radius milling if a form of contour milling. Corner round tools are available in high speed steel, carbide, or insert type tools. Center drills create a conical cut on the face of the part. Holes that are less than the diameter of the drill can be created with a single plunge move. Tap cycles are similar to simple drill cycles except the feed and speed are coordinated to properly match the thread lead.
CNC Turning
Milling machines work by moving a spindle tool over a stationary part. Lathes work by spinning the part and moving the tool, making them ideal for round parts like shafts, pins and pulleys.
- Sheetmetal Protective housing that contains cutting chips and captures coolant for recycling.
- Door The door is closed during operation. Lathes can be dangerous if the part is thrown or a tool breaks during machining. The window is made from a special high impact glass. The lathe should not be operated if this glass is cracked.
- Spindle The spindle is attached at one end to the machine drive system. The other end attaches the chuck, which grips the part.
- Turret The turret holds and moves the tools. Tools are bolted to the turret using a variety of specialized holders, depending on the type of tool. The turret indexes to present the tool to the workpiece.
- Control The CNC control used to operate the machine.
The spindle turns the chuck. The chuck grips the part using hard jaws, soft jaws, or collet. The most common configuration is the three jaw chuck. The chuck requires air pressure to open and close the jaws and set the gripping force. Tool holders bolt to either the front or perimeter of the turret. Tool changes are made by the machine indexing the turret to place the appropriate tool closest to the part. The method by which the tools are attached to the turret, and the direction the tool faces in relation to the part, vary depending on the tool, operation, and cut direction.
Most lathes and 2D machines based on a Z-X Coordinate System. The Z-axis is parallel to the machine spindle and the X-axis is perpendicular to the spindle. Normal spindle rotation is counter-clockwise, though direction can be reversed for left-handed threads just like with a mill by commanding the proper G-code.
Most turning is done using carbide inserts. Inserts are gripped in holders, which in turn are bolted to the lathe turret. Carbide inserts employ highly engineered composite structures, coatings, and geometry features to achieve great accuracy and high material removal rates. Some inserts can be indexed to use other edges when one becomes worn. Inserts are quickly and easily replaced at the machine. A chip breaker is a feature in the face of the insert that disrupts the flow of chops such that they break into short segments. Most inserts have drafter faces in the walls. This is called a relief angle. Relief prevents the walls of the insert from rubbing against the part.
The edge of the tool in the cut direction forms an angle with a line perpendicular to the cut direction. This is called Side Cutting Angle. The angle formed by the trailing edge and parallel to the cut direction is called the End Cutting Angle. The purpose of these angles is to provide proper clearance between the tool and work piece. Rake angle is set by the tool holder. Rake angle helps control the direction of the chip and cutting pressure. Angle is measured from face of the insert to the Z-X plane of the machine.
Carbide inserts use a coding system of numbers and letters to describe their shape, dimensions, and important parameters.
For facing and rough turning, use a more rigid tool such as a round, square, or 80 degree diamond. Finishing may require a more versatile tool. Groove tools are classified in part by their width and corner radii. Precision holes are often finished with a boring tool. Boring bar tools are mounted parallel to the machine spindle. They require a hole in the part large enough to allow the bar to safely enter and exit the bore. Tapped holes at the center of part, up to about one inch diameter, can be made using a form or cutting tap, just like on a mill. Once the part is finished, it is usually parted, or cut off from the stock. A cutoff tool is a special kind of groove tool that is designed to take deeper cuts.
3D Toolpaths
3D toolpaths are used to machine non-prismatic parts such as molds, dies, and organically shaped consumer products. These parts may be composed of hundreds or thousands of faces. CAD/CAM software creates 3D tool paths by first triangulating the model. This mesh is used to calculate the tool path based on tool size and shape. 3D tool paths are calculation intensive in part because of the extensive checking required to ensure the tool does not gouge the part as it moves across the topography of part faces.
CNC controls can only process a finite number of blocks of code per second. The processing speed, called the block execution time, varies between machines. Modern machines may be capable of processing several thousand blocks of code each second while older controls may be limited to less than a hundred. If the number of blocks per second exceeds the machine capacity to process, a phenomenon known as data starving can occur: the control is overwhelmed with data and must pause after each move to wait for the next. Cut tolerance controls how closely a tool path follows a theoretically perfect path along the surface. Runoff surfaces are sometimes required to expand the tool paths to the XY extents of the stock, or to cause the tool to continue to machine down in Z along vertical walls. Holes, fine details, or other features that will be created by subsequent operations may be suppressed or covered with a check surface to prevent the tool from entering those areas. Rest Milling is an acronym for REmaining STock machining. Rest tool paths only remove material left by previous machining operations. They do this by calculating what stock has been previously removed and comparing it against the finished model.
Milling Setups
Work holding for prototypes is often different than that for production machining. Large production lots allow the cost of tooling and fixtures to be amortized over many parts. While it is worth investing in complex fixtures to save seconds when making thousands of parts, it is not making only a few.
A Subplate is a ground aluminum plate that bolts to the top of the machine table. It has threaded holes and bushings at regular intervals. An angle plate is a precision ground steel plate that allows the part to be set on its side. Angle plates can point in a direction parallel to either the X or Y axis.
Comments
You can read more about how comments are sorted in this blog post.
User Comments
There are currently no comments for this article.