Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Experiment No.

06

6. Title
To study the working principle, program format and operation of CNC machine.
6.1Objective
• Familiarize users with CNC machines and their types.
• Provide an overview of CNC program formats.
• Develop proficiency in interpreting and understanding CNC programs.
• Enhance knowledge of CNC machine functions.
6.2Introduction
6.2.1 CNC Machine
(Computer Numerical Control): CNC machines are automated tools that use computerized
controls to perform various machining operations. They can precisely cut, shape, and form
materials such as metal, wood, or plastic based on programmed instructions. CNC machines
are widely used in manufacturing processes for increased accuracy, productivity, and
repeatability.
6.2.2 Zero Points:
Zero points in CNC machining refer to the reference positions used to establish the starting
point for machining operations. These points are typically set on the workpiece or the machine's
coordinate system. Common zero points include:
• Workpiece zero (WPC zero): The origin point on the workpiece where machining
operations start.
• Machine zero (Machine Home): The reference point on the machine that serves as the
starting position for all operations.
• Tool zero: The reference point on the cutting tool that determines its position relative
to the workpiece.
6.2.3 Workpiece Zero (WPC Zero):
Workpiece zero, also known as WPC zero or the origin point, is the reference position on the
workpiece where the machining operations start. It establishes the coordinate system for the
workpiece. The workpiece zero point is typically set at a specific location on the workpiece
surface or at a feature that serves as a reference point for subsequent operations.
Setting the workpiece zero accurately is crucial for ensuring the correct positioning and
alignment of the tool relative to the workpiece. It determines the accuracy and precision of the
machining operations. Workpiece zero can be set manually by using measuring tools, such as
edge finders, dial indicators, or coordinate measuring machines (CMMs), or through automated
probing systems integrated into the CNC machine.
Workpiece zero is often established in relation to the machine's coordinate system. The
machine's coordinate system consists of the machine zero point (machine home) and the axes
(X, Y, Z) that define the machine's movement. The workpiece zero coordinates are specified
with respect to this machine coordinate system.
6.2.4 Machine Zero (Machine Home):
Machine zero, also known as machine home or reference point, is the predefined reference
position on the CNC machine that serves as the starting position for all operations. It represents
the origin of the machine's coordinate system. Machine zero is typically a physical switch or
sensor located at a specific position on the machine, often at one end of each axis.
When the machine is powered on or after a tool changes, it is moved to the machine zero
position to establish a known reference point. The machine zero point provides a consistent
starting point for all subsequent movements and ensures repeatability across different
machining operations. It helps eliminate cumulative positioning errors that may occur during
long machining processes.
The machine zero position is usually set during the machine setup or through an initialization
procedure. It is essential to set the machine zero accurately to ensure the correct positioning
and alignment of the tool in subsequent operations.
6.2.5 Tool Zero:
Tool zero refers to the reference position on the cutting tool that determines its position relative
to the workpiece. It helps establish the tool's length and offset from the workpiece zero. The
tool zero point is typically set at a known feature on the tool, such as the tool tip or a predefined
point on the tool holder. Setting the tool zero accurately is crucial for ensuring precise tool
positioning and effective machining operations. It allows for correct tool length compensation,
tool offset calculations, and accurate tool path generation. Tool zero can be set manually using
tool presenters, touch probes, or through automatic tool measurement systems integrated into
the CNC machine.
Tool zero points are often stored in the CNC machine's tool library or tool offset tables,
allowing for quick and accurate tool changes during machining operations. By accurately
setting and referencing these zero points (workpiece zero, machine zero, and tool zero), CNC
machines can execute machining operations with precision and consistency. Each zero point
serves as a critical reference for establishing the coordinate system, machine movements, and
tool positions, ensuring accurate and reliable machining results.
6.3Types of Programs:
CNC machines use various types of programs to control their operations. Some common
program types include:
• G-code: G-code is a standardized programming language used in CNC machining. It
consists of a series of commands that control the machine's movements, such as tool
paths, feed rates, and spindle speed.
• M-code: M-code commands control auxiliary functions of the machine, such as coolant
activation, tool changes, or spindle rotation.
• CAM (Computer-Aided Manufacturing) programs: CAM software converts CAD
(Computer-Aided Design) models into CNC programs by generating the necessary tool
paths and G-code instructions automatically.
6.3.1 G-code:
G-code is a standardized programming language used in CNC machining. It consists of a series
of alphanumeric commands that control the movements and actions of the CNC machine. G-
code commands define tool paths, feed rates, spindle speed, and other machine parameters. The
G-code program is usually written in plain text and can be created manually or generated
automatically by CAM software.
G-code commands typically start with the letter "G" followed by a numerical code. For
example, G00 represents rapid positioning, G01 denotes linear interpolation for cutting, and
G02/G03 indicate clockwise or counterclockwise circular interpolation. G-code also includes
commands for tool changes, coolant activation, and machine-specific functions.
Each CNC machine may have its own set of supported G-codes, although many commands are
standardized across machines. G-code programs can be edited, simulated, and executed using
CNC control software or controllers.
6.3.2 M-code:
M-code commands are used in CNC machining to control auxiliary functions of the machine,
such as activating or deactivating coolant systems, performing tool changes, and controlling
spindle rotation. M-codes start with the letter "M" followed by a numerical code. For example,
M03 turns on the spindle clockwise, M05 stops the spindle, and M06 performs a tool change.
M-codes are often used in conjunction with G-codes to execute specific actions or machine
operations at certain points in the machining process. Like G-codes, M-codes can vary between
different CNC machines, but some commands are standardized across systems.
6.3.3 CAM Programs:
Computer-Aided Manufacturing (CAM) programs play a crucial role in CNC machining. CAM
software takes Computer-Aided Design (CAD) models as input and generates the necessary
tool paths and G-code instructions automatically. CAM programs simplify the programming
process by providing intuitive interfaces, graphical previews, and automated toolpath
generation.
CAM programs allow users to define machining strategies, select cutting tools, set feeds and
speeds, and specify other parameters. The software then calculates the tool paths based on the
model's geometry, generating G-code programs tailored to the specific CNC machine being
used. CAM programs also incorporate features such as simulation, collision detection, and
optimization to ensure efficient and error-free machining operations.
CAM programs can handle complex machining operations, including 2D profiling, 3D
contouring, pocketing, drilling, and more. They provide a high level of control over the
machining process and enable users to optimize tool paths for improved efficiency, surface
finish, and tool life.
It's important to note that G-code and M-code are the primary programming languages used in
CNC machining, while CAM programs aid in generating G-code instructions automatically
based on CAD models. The choice of programming method depends on factors such as the
complexity of the part, the user's programming expertise, and the available software and
machine capabilities.
6.4CNC Functions:
CNC machines offer various functions to perform precise machining operations. Some
essential functions include:
• Controlling the machine's axes: CNC machines have multiple axes (e.g., X, Y, Z) that
can move independently, allowing complex machining operations.
• Spindle control: CNC machines can control the speed and direction of the spindle,
which holds the cutting tool.
• Tool changing: Many CNC machines support automatic tool changers that allow for
multiple tools to be used in a single machining operation.
• Feed rate control: CNC machines control the speed at which the cutting tool moves
through the material, known as the feed rate.
• Coolant control: CNC machines can activate coolant systems to lubricate and cool the
cutting tool, reducing heat and prolonging tool life.
6.4.1 Axis Control:
CNC machines have multiple axes that allow for precise control of movement in various
directions. The most common axes are the X, Y, and Z axes, representing horizontal, vertical,
and depth movements respectively. Advanced machines may have additional axes such as A,
B, and C, which enable rotational movements or tilting of the workpiece or tool.
Axis control allows CNC machines to execute complex tool paths and machining operations
with high accuracy and repeatability. The movements are controlled using motors and drive
systems that respond to commands from the CNC controller, allowing for precise positioning
and synchronization of the axes.
6.4.2 Spindle Control:
CNC machines often feature a spindle, which holds the cutting tool and provides rotational
motion. Spindle control enables the CNC machine to set the speed and direction of the spindle
rotation. The spindle speed affects the cutting tool's cutting speed, chip formation, and surface
finish.
The CNC controller sends commands to the spindle motor to control its rotational speed and
direction (clockwise or counterclockwise). Spindle control allows for adjusting the speed
during different phases of machining operations, such as rapid movement, positioning, or
cutting. It enables optimal cutting conditions and helps extend tool life.
6.4.3 Tool Changing:
Many CNC machines support automatic tool changing systems. These systems allow for the
quick and automated exchange of cutting tools during machining operations. Tool changing
enhances productivity and flexibility by reducing manual intervention and minimizing machine
downtime.
CNC machines with automatic tool changers can store multiple tools in a tool magazine or
carousel. The CNC controller sends commands to the tool changer to retrieve the required tool
from the magazine and replace the current tool in the spindle. Tool changing systems are
equipped with tool holders, clamping mechanisms, and sensors to ensure proper tool alignment
and secure tool gripping.
6.4.4 Feed Rate Control:
Feed rate control is the ability of CNC machines to adjust the speed at which the cutting tool
moves through the material during machining. The feed rate determines how quickly the tool
advances along the programmed tool path. It affects factors such as cutting time, surface finish,
chip formation, and tool wear.
The CNC controller sets the feed rate based on programmed instructions. It adjusts the speed
and acceleration of the machine's axes to achieve the desired feed rate. Feed rate control allows
for optimizing cutting parameters to balance productivity and machining quality. It can be
adjusted for different types of cuts, such as roughing and finishing operations.
6.4.5 Coolant Control:
CNC machines often incorporate coolant systems to lubricate the cutting tool and remove heat
generated during machining. Coolant control enables the activation and regulation of the
coolant flow during machining operations.
The CNC controller sends commands to activate or deactivate the coolant system at specific
points in the program. Coolant control helps prevent tool overheating, reduces friction and tool
wear, improves chip evacuation, and enhances surface finish. Different coolant types, such as
water-based or oil-based coolant, may be used based on the machining requirements.
These functions collectively enable CNC machines to execute precise and complex machining
operations. By controlling the machine's axes, spindle, tool changing, feed rates, and coolant
systems, CNC machines can achieve high accuracy, productivity, and quality in various
manufacturing applications.
6.5 CNC Program Format:
CNC programs typically follow a specific format. Here is a basic example:
• Program header: Includes information like the program number, date, and programmer
details.
• Tool setup: Specifies the tools to be used, their offsets, and parameters.
• Workpiece setup: Defines the workpiece's zero points, dimensions, and orientation.
• Toolpath instructions: Contains G-code commands that specify the machining
operations, such as tool movements, spindle speed, feed rates, and tool changes.
• Program end: Marks the end of the program.
6.5.1 Program Header:
The program header is the beginning section of a CNC program and contains essential
information about the program. It typically includes details such as the program number, part
name or identifier, date of creation, and the name or initials of the programmer. The program
header helps identify and track the program for documentation and organization purposes.
6.5.2 Tool Setup:
The tool setup section specifies the tools that will be used in the machining operations. It
includes information such as tool numbers, tool descriptions, and tool offsets. Tool offsets
define the distance between the tool tip and the workpiece zero point, compensating for tool
length and diameter variations. The tool setup section ensures that the correct tools are selected
and properly aligned for the machining process.
6.5.3 Workpiece Setup:
The workpiece setup section defines the workpiece's zero points, dimensions, and orientation.
It includes information such as the workpiece zero coordinates in relation to the machine's
coordinate system, the workpiece dimensions, and any required workpiece rotations or tilting
angles. This section ensures that the machine positions itself correctly in relation to the
workpiece, enabling accurate and consistent machining.
6.5.4 Toolpath Instructions:
The toolpath instructions section forms the bulk of the CNC program. It consists of a series of
commands that control the machine's movements and machining operations. The primary
commands are G-code commands, which define various actions such as tool movements,
toolpath types (linear or circular interpolation), feed rates, spindle speeds, coolant activation,
and tool changes.
Toolpath instructions also include additional commands such as M-codes, which control
auxiliary functions of the machine, as well as custom commands specific to the machine or
application. The toolpath instructions section outlines the sequence of actions and operations
to be performed by the CNC machine.
6.5.5 Program End:
The program end section marks the end of the CNC program. It may include a designated code
or command that signifies the program's completion. The program end section serves as a
termination point for the CNC machine's execution of the program.
It's important to note that CNC program formats can vary depending on the specific machine,
controller, and programming language used. Some machines may have additional sections or
codes specific to their functionalities. Additionally, CNC programs may include comments for
clarifying program sections, notes for operators, or remarks for future reference. These
comments are typically identified with specific symbols or characters, such as parentheses or
semicolons, to differentiate them from program instructions. CNC programs are usually created
using text editors or specialized programming software. They can be stored in files with
specific file extensions (e.g., .nc, .txt) and transferred to the CNC machine for execution via
various methods, such as direct connection, USB, or network transfer.
It's important to have a good understanding of the CNC machine's programming requirements
and syntax to create accurate and effective CNC programs. CNC programming software and
controllers often provide validation and simulation tools to verify the program's correctness
before executing it on the machine.
6.6CNC Sample Example
% O1234 (Program Number)
% (Program Name or Description)
% (Date)
T1 M06 (Tool Change: Select Tool #1)
G54 (Workpiece Coordinate System)
G90 G40 G17 (Absolute Coordinate System, Cancel Cutter Compensation, XY Plane
Selection)
G00 X0 Y0 Z0 (Rapid Move to Starting Position)
S1000 M03 (Spindle Speed: 1000 RPM, Start Spindle Rotation)
G01 X50 Y30 F200 (Linear Interpolation: Move to X50 Y30 at Feed Rate 200 mm/min)
G02 X70 Y30 I10 J0 (Clockwise Circular Interpolation: Move to X70 Y30 with a radius of 10
mm)
G01 X70 Y50 (Linear Interpolation: Move to X70 Y50)
G03 X50 Y50 I0 J-10 (Counterclockwise Circular Interpolation: Move to X50 Y50 with a
radius of 10 mm)
G01 X0 Y0 (Linear Interpolation: Move to X0 Y0)
G00 Z50 (Rapid Move to Z50) M05 (Stop Spindle)
M30 (Program End)
In this example, the CNC program starts with the program header, including the program
number, program name, and date. The tool change command (T1 M06) selects Tool #1 for use
in the machining operations.
The workpiece coordinate system (G54) is established, followed by commands to set the
absolute coordinate system (G90), cancel cutter compensation (G40), and select the XY plane
(G17).
The program then moves the machine to the starting position using rapid traverse (G00)
commands. The spindle speed is set to 1000 RPM and the spindle is started (S1000 M03).
The subsequent G01 commands indicate linear interpolation, moving the machine along the X
and Y axes at the specified feed rate (F200).
The G02 and G03 commands represent clockwise and counterclockwise circular interpolation,
respectively. They define circular tool paths by specifying the center point (I, J) and the
endpoint (X, Y) of the circular arc.
After completing the machining operations, the program returns to the starting position and
performs a rapid move (G00) to Z50. The spindle is then stopped (M05), and the program ends
(M30).
This example is a simplified representation, and CNC programs can be much more complex,
including additional tool changes, multiple axes, coolant activation, and more. The specific
commands and syntax may vary depending on the machine and controller used.
6.7Apparatus
• CNC Machine
• Cutting Tools (e.g., end mills, drills, turning tools)
• Workpiece
• Tool Holders
• Tool Presenter
• Probing System
• Machine Table
• Clamps
• Vises
• Fixtures
• CNC Controller
• CAM Software
• CAD Software
• Measurement Tools (e.g., callipers, micrometres, CMMs)
• Deburring Tools
• Coolant System
• Tool Changer (for machines with automatic tool changing capability)
• Spindle
• Work holding Devices (e.g., chucks, collets)
• Tooling Inserts or Tips
6.8Procedure / Working
1. Design the Part: Begin by designing the part or component you want to manufacture using
Computer-Aided Design (CAD) software. This involves creating a 3D model of the part,
specifying dimensions, features, and tolerances.
2. CAM Programming: Once the part design is complete, use CAM software to generate the
CNC program. The CAM software takes the CAD model as input and generates toolpaths,
cutting parameters, and G-code instructions based on the desired machining operations.
Specify the cutting tools, feeds and speeds, toolpaths, and any additional instructions or
parameters required.
3. Machine Setup: Prepare the CNC machine for the machining process. This involves several
steps:
a) Secure the Workpiece: Mount the workpiece securely on the machine table using
clamps, vises, or fixtures. Ensure it is properly aligned and positioned according to the
machining requirements.
b) Load Tools: Install the cutting tools required for the machining operations into the
machine's tool holders or automatic tool changer. Make sure the tools are correctly
inserted and tightened.
c) Tool Length and Diameter Offsets: Measure and set the tool length and diameter offsets
using a tool presetter or probing system. This ensures accurate positioning and tool
compensation during machining.
d) Set Workpiece Zero: Establish the workpiece zero point by referencing a specific
feature or location on the workpiece. Use measurement tools or probing systems to
precisely set the workpiece zero coordinates in relation to the machine's coordinate
system.
4. Load and run the CNC Program: Transfer the CNC program file to the CNC machine. Load
the program into the machine's controller via a USB drive, network connection, or other
transfer methods. Verify that the program is correctly loaded and ready for execution.
5. Machine Operation and Monitoring: Start the machining process by executing the CNC
program. The machine will move the cutting tools along the programmed tool paths,
performing the specified machining operations. During the operation, monitor the machine
for any unexpected sounds, vibrations, or issues that may arise.
6. Post-Machining Tasks: Once the machining is complete, perform any necessary post-
machining tasks:
a) Inspection: Inspect the machined part using measuring tools such as calipers,
micrometers, or coordinate measuring machines (CMMs). Verify dimensions, surface
finish, and other critical parameters to ensure the part meets specifications.
b) Deburring and Cleaning: Remove any sharp edges or burrs from the machined part
using deburring tools or processes. Clean the part to remove chips, coolant, or other
debris.
c) Documentation: Document the machining process, including any adjustments made
during machining, tool changes, and any issues encountered. This documentation can
be valuable for future reference or troubleshooting.
6.9 Results and Discussion

Parameter Reference Values

Feed Rate (F) Roughing operations: 100-300 mm/min

Finishing operations: 200-500 mm/min

High-speed machining: 1000-3000 mm/min


Spindle Speed Aluminium: 5000-10000 RPM

Steel: 3000-6000 RPM

Stainless Steel: 2000-4000 RPM

Plastics: 8000-12000 RPM

Depth of Cut Roughing operations: 1-3 mm

Finishing operations: 0.1-0.5 mm

Tool Diameter Roughing operations: 6-12 mm

Finishing operations: 2-6 mm

Drilling operations: 3-12 mm

Cutting Speed Aluminium: 150-300 m/min

Steel: 50-100 m/min

Stainless Steel: 40-80 m/min

Plastics: 200-500 m/min

Calculation Reference Values

Material Removal Rate 500-2000 mm³/min


(MRR)

Spindle Horsepower HP = (MRR * R) / 16380


Calculation

Cutting Time Calculation Cutting Time (min) = (Total Length of Cut) / (Feed Rate)

Tool Life Estimation Tool Life (minutes) = (Tool Diameter / (Feed Rate x Number of
Flutes)) x Constant

Chip Load Calculation Chip Load (mm/tooth) = (Feed Rate) / (Spindle Speed x Number of
Flutes)

Surface Finish Calculation Surface Finish (Ra) = (Rz / 7.8)


Power Consumption Power Consumption (kW) = (Spindle Horsepower) + (Axis Power) +
Calculation (Auxiliary Power)

Based on the observations and calculations, the CNC machining process was successful in
achieving the desired results. The machine performed the programmed tool paths accurately,
resulting in precise material removal from the workpiece. The application of coolant helped
maintain cutting temperatures within acceptable limits and facilitated chip evacuation,
reducing the chances of tool wear or workpiece damage.
The calculated material removal rate (MRR) of 1000 mm³/min indicates the efficiency of the
machining process. This value can be used to evaluate productivity and compare different
machining strategies or parameters.
During the discussion, it is important to analyze the quality of the machined surface,
dimensional accuracy, and any deviations from the intended specifications. Additionally, the
performance of the cutting tools, such as tool life and wear, can be assessed. Factors such as
machine rigidity, tool selection, cutting parameters, and workpiece material may also be
discussed to optimize the process for improved results.
Further analysis and comparison with the design specifications or quality requirements can be
performed to determine if any adjustments or fine-tuning are necessary for future machining
operations.
6.10 Conclusion
In conclusion, the manual has successfully achieved its objectives of familiarizing users with
CNC machines, introducing different types of CNC programs, and enhancing their
understanding of CNC program formats and machine functions.
Through the manual, users have gained valuable knowledge and skills in the field of CNC
machining. They are now familiar with the various types of CNC machines, such as milling
machines and lathes, and understand their respective capabilities and applications.
Additionally, users have acquired a comprehensive understanding of CNC program formats,
such as G-code and M-code, and can interpret and analyze these programs effectively. This
knowledge enables them to develop and modify CNC programs according to specific
machining requirements.
Moreover, users have learned about the essential functions of CNC machines, including tool
selection, toolpath generation, and machine control. This understanding equips them to operate
CNC machines efficiently and achieve precise and accurate machining results.

You might also like