0% found this document useful (0 votes)
14 views5 pages

MP Lab 4

lab report

Uploaded by

chdanish4253
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views5 pages

MP Lab 4

lab report

Uploaded by

chdanish4253
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Table of Contents

Objectives: ..................................................................................................................................... 2

Software used: ............................................................................................................................... 2

Theoretical Terms:........................................................................................................................ 2

Lab Task: ....................................................................................................................................... 3

Explanation: .................................................................................................................................. 3

Drawing: ........................................................................................................................................ 4

Discussion: ..................................................................................................................................... 5

Conclusion: .................................................................................................................................... 5
CNC programming and introduction to G codes M codes.

Objectives:

• Acquire an understanding of CNC programming fundamentals.


• Develop a CNC program tailored to a specific geometry.
• Run a simulation of the CNC program using NC Viewer.
• Grasp the roles and functions of G-code and M-code.

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.

Incremental Programming: In incremental programming, each new coordinate is measured


relative to the previous position of the tool, not from a fixed origin. The next movement is based
on the current position. G91 is the G-code used for incremental positioning.

Lab Task:

Figure 1: Code learned in class.

Explanation:

N01: Line number


G17: Selects XY plane
G21: Units in millimetres
G90: Absolute positioning
G54: Selects coordinate system 1
G64: Continuous feed rate.

N05: Tool change


M06: Tool change command
T01: Tool number 1
H07: Tool holder 7
D05: Diameter compensation 5

N15: Rapid positioning (G00) to Z3


Z03: Move to Z = 3 mm

N10: Rapid positioning to X0 Y0


G00: Move to origin (0,0)

N25: Linear interpolation (G01) to Z = -1 mm


F50: Feed rate of 50 mm/min

N20: Start spindle (M03)


S1000: Spindle speed 1000 RPM
M08: Coolant on

N30: Linear move to X = 5, Y = 0


F100: Feed rate of 100 mm/min

N60: End of program


M02: Program stop.

Drawing:

Figure 2: Drawing made in class


Discussion:

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.

You might also like