MP Lab No 5
MP Lab No 5
Objectives: ..................................................................................................................................... 2
Software Utilized:.......................................................................................................................... 2
Code: .............................................................................................................................................. 2
Explanation: .................................................................................................................................. 3
Part: ................................................................................................................................................ 3
Discussion: ..................................................................................................................................... 4
Conclusion: .................................................................................................................................... 4
Objectives:
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Θ ΥΘ ;
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:
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.