Mp lab no 4
Mp lab no 4
5th SEMESTER
Theory
CNC and NC machines:
In this lab, we learned about the CNC and NC machines and discussed their differences,
some of which are given as Numerical Control (NC) and Computer Numerical Control
(CNC) machines are both used in automated manufacturing, but they have several key
differences. First, NC machines operate through hardwired controls, meaning that
instructions are given via punched cards or tapes, whereas CNC machines are controlled
by computers, allowing for more flexibility and ease of programming through software.
Second, CNC machines offer much greater precision and repeatability compared to NC
machines, as the computerized controls allow for fine adjustments and corrections in real-
time. Third, CNC machines can store multiple programs, enabling them to switch between
different tasks quickly, while NC machines require manual reprogramming, which is time-
consuming. Fourth, maintenance and troubleshooting are easier with CNC machines due
to the advanced diagnostics available through their software, while NC machines often
require more manual intervention. Lastly, CNC machines can execute more complex
operations like 3D machining with minimal human intervention, while NC machines are
generally limited to simpler tasks and require more operator involvement. These
differences make CNC machines more advanced, efficient, and adaptable in modern
manufacturing processes.
In CNC (Computer Numerical Control) machining, G-code and M-code are the two primary
types of codes used to control the machine's operations:
➢ G-code (Geometric Code) G-code mainly controls the movement and
positioning of the machine tools. It deals with the geometry of the machine’s operation,
specifying how the machine should move in terms of positioning and speed.
G-code and M-code form the core instructions for CNC machines to execute tasks by
controlling both tool movement and auxiliary functions.
Lab task:
We were assigned to move the tool of a milling machine in a square geometry with
some cutting depth on NC viewer.
Solution:
NC Viewer CODE
• N01 G17 G90 G21 G54 G64;: Select XY plane (G17), set absolute positioning (G90),
use millimeters (G21), set work coordinate system (G54), and enable path blending
without exact stops (G64).
• N05 M06 T01 D12 H07;: Tool change to Tool 01 (M06), use Tool Diameter 12, and Tool
Length Offset 07.
• N06 M41;: Select low gear (M41) for spindle speed.
• N10 G00 X0 Y0;: Rapid move to X0, Y0 (machine's origin).
• N15 G00 Z03;: Rapid move to Z = 3 (above the workpiece).
• N20 M03 S1000 M08;: Start spindle clockwise at 1000 RPM (M03) and turn on
coolant (M08).
• N25 G01 Z-1 f0.01;: Feed move to Z = -1 (cut depth) at a feed rate of 0.01.
• N30 G01 X0 Y10 f0.01;: Linear feed move to X0, Y10 at the same feed rate.
• N35 X-10 Y10;: Feed move to X = -10, Y = 10.
• N40 X-10 Y0;: Feed move to X = -10, Y = 0.
• N45 X0 Y0;: Feed move back to origin (X0, Y0).
• N50 Z3;: Rapid move up to Z = 3 to lift the tool.
• N55 M02;: End of program (M02).
Figure:
In the lab, we received a basic introduction to CNC machines, focusing on G and M codes,
including their meanings and applications. We used NC Viewer software to run the codes,
which helped us visualize the results effectively. This experience was unique, and
intriguing compared to previous labs that primarily concentrated on SolidWorks
commands. At the end of the lab, we were given an assembly challenge to demonstrate
our understanding of the course material. Initially, I faced several challenges due to my
lack of knowledge about CNC programming. However, by the end of the lab, I absorbed
the information and successfully completed my tasks with confidence.