MP Lab 4
MP Lab 4
Objectives: ..................................................................................................................................... 2
Theoretical Terms:........................................................................................................................ 2
Explanation: .................................................................................................................................. 3
Drawing: ........................................................................................................................................ 4
Discussion: ..................................................................................................................................... 5
Conclusion: .................................................................................................................................... 5
CNC programming and introduction to G codes M codes.
Objectives:
Software used:
• SolidWorks.
• NC viewer.
Theoretical Terms:
NC (Numerical Control): NC is the automation of machine tools that operate based on pre-
programmed sequences of commands, using punched tapes or cards for input. These machines are
manually set up and require operator intervention.
CNC (Computer Numerical Control): CNC automates machine tool control through a computer,
allowing for more precise, faster, and flexible manufacturing. The program, written in G-code,
controls the movements of tools and the operation of the machine with minimal human
involvement.
GNC (Global Numerical Control): GNC refers to systems that leverage global networks to
control and monitor CNC machines across multiple locations. It allows for remote programming,
monitoring, and adjustment of machines in various facilities from a centralized location.
G-codes: G-codes are used in CNC programming to control the movement and operation of the
machine. They specify actions like positioning, cutting, drilling, and tool changes, such as G00
(rapid positioning) and G01 (linear interpolation).
M-codes: M-codes manage machine operations that are not related to motion, such as starting and
stopping the spindle, coolant control, or tool changes. Examples include M03 (spindle on) and
M30 (program end).
Absolute Programming: In absolute programming, all coordinates are measured from a fixed
origin point (typically set as the machine's zero point). Each movement command refers to this
consistent reference point. For example, G90 is used in CNC programming to indicate absolute
positioning.
Lab Task:
Explanation:
Drawing:
NC (Numerical Control) codes form the foundation of automated machine control, where
machines follow a predefined sequence of commands to perform tasks such as cutting, drilling, or
milling. In traditional NC systems, these commands were input via punched tapes or cards, lacking
real-time modification capabilities. With the advancement to CNC (Computer Numerical Control),
G-codes and M-codes became standardized programming languages, providing precise control
over machine functions through digital input. G-codes are primarily concerned with controlling
the motion of the machine tool, such as tool positioning, speed, and trajectory, ensuring the
machine operates with high accuracy.
G-codes and M-codes play complementary roles in CNC programming. G-codes (e.g., G01 for
linear motion and G02 for circular motion) dictate how and where the tool moves in relation to the
workpiece, while M-codes handle auxiliary functions that are not directly related to motion. M-
codes manage operations such as spindle control (M03 for spindle start), coolant activation (M08),
and program termination (M30). Together, G-codes and M-codes enable comprehensive control
over machining operations, allowing for automated, highly precise manufacturing processes across
various industries.
Conclusion:
• G-codes and M-codes are essential components of CNC programming, controlling both the
movement and auxiliary functions of machine tools.
• CNC programming offers superior precision and efficiency compared to traditional NC,
allowing for complex operations with minimal human intervention.
• Understanding the distinctions between G-codes and M-codes is critical for effective CNC
machine control and optimized manufacturing processes.