0% found this document useful (0 votes)
16 views4 pages

MP Lab No 5

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)
16 views4 pages

MP Lab No 5

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/ 4

Table of Contents

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

Software Utilized:.......................................................................................................................... 2

Code: .............................................................................................................................................. 2

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

Part: ................................................................................................................................................ 3

Discussion: ..................................................................................................................................... 4

Conclusion: .................................................................................................................................... 4
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 Utilized:

NC Viewer is an online G-code simulation tool that allows users to visualize the toolpaths of CNC
(Computer Numerical Control) machining processes. It provides a user-friendly platform to upload
and simulate G-code, enabling machinists, engineers, and hobbyists to check and optimize their
CNC programs before actual machining. NC Viewer supports a wide range of G-code formats and
offers 2D and 3D visualizations, which help in detecting errors, ensuring accurate tool movements,
and improving the overall quality of CNC operations. It is particularly useful for those working
with milling, turning, or other CNC-based manufacturing methods.

Code:

N01 GOO XΘ ΥΘ ;

NO3 G01 XO Y15 F100;

N05 X30 Y40;

N07 X50 Y40;

N08 G03 X65 Y25 R15;

G01 X70 Y25;

G02 X80 Y15 10 J-10;

G01 X80 Y-15;

G02 X70 Y-25 R10;

G01 X65 Y-25;

G03 X50 Y-40 10 J-15;


G01 X30 Y-40;

G01 X0 Y-15;

G01 X0 Y0;

Explanation:

This G-code represents a CNC machining path with various linear (G01) and circular (G02, G03)
movements. The program begins with a rapid positioning move (GOO) to the coordinates X0 Y0,
followed by a linear feed movement (G01) to X0 Y15 at a feed rate of 100. The tool then moves
to X30 Y40 and X50 Y40 in straight lines. A counterclockwise circular move (G03) to X65 Y25
with a radius of 15 is executed, followed by a straight line to X70 Y25. A clockwise arc (G02)
moves the tool to X80 Y15 with I/J parameters defining the center of the arc, then it moves in a
straight line to X80 Y-15. Another clockwise arc (G02) moves the tool to X70 Y-25 with a radius
of 10, followed by a straight line to X65 Y-25. Another counterclockwise arc (G03) takes the tool
to X50 Y-40 using the specified radius or I/J for arc control. Finally, the tool moves in a straight
line to X30 Y-40, X0 Y-15, and returns to the starting point at X0 Y0. This G-code represents both
linear and circular tool movements in a 2D plane, creating a complex shape.

Part:

Figure 1: Part 2D NC viewer image.


Discussion:

G and M codes are fundamental components of CNC (Computer Numerical Control)


programming, used to control the movements and operations of CNC machines. G-codes, or
preparatory codes, primarily manage the tool's motion and positioning, such as linear moves (G01),
rapid positioning (G00), or circular interpolation (G02 and G03). They define the path the machine
will follow to cut or shape a material. M-codes, or miscellaneous codes, control auxiliary machine
functions like starting or stopping the spindle (M03, M05), coolant control (M08, M09), and
program stop (M00, M01). Together, G and M codes provide precise instructions for the CNC
machine to execute complex machining tasks accurately. Understanding both sets of codes is
essential for ensuring efficient and error-free CNC operations.

Conclusion:

• G and M codes are critical for controlling the precise movements and auxiliary functions
of CNC machines, enabling complex machining operations with high accuracy.
• While G-codes dictate the tool’s motion and path, M-codes manage the machine’s auxiliary
operations, making both essential for the smooth execution of CNC programs.
• Mastering G and M codes is fundamental for machinists and CNC operators to optimize
manufacturing processes, minimize errors, and ensure quality production.

You might also like