0% found this document useful (0 votes)
27 views

CIM & ML Lab_Manual

Manual
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)
27 views

CIM & ML Lab_Manual

Manual
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/ 55

School of Mechanical Engineering

Laboratory Manual

For

B.Tech

VII SEMESTER

COMPUTER INTEGRATED MANUFACTURING AND MACHINE


LEARNING LABORATORY

(B20ER0706)

Prepared by: Dr Raju B S


Professor /SoME ,
REVA University
COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

University Vision
“REVA University aspires to become an innovative university by developing excellent
human resources with leadership qualities, ethical and moral values, research culture and
innovative skills through higher education of global standards”.

University Mission
1. To create excellent infrastructure facilities and state-of-the-art laboratories and incubation
centers
2. To provide student-centric learning environment through innovative pedagogy and
education reforms
3. To encourage research and entrepreneurship through collaborations and extension
activities
4. To promote industry-institute partnerships and share knowledge for innovation and
development
5. To organize society development programs for knowledge enhancement in thrust areas
6. To enhance leadership qualities among the youth and enrich personality traits, promote
patriotism and moral values.

School Vision
“Aspires to be recognized globally for outstanding value based education in mechanical and
allied areas and research leading to well-qualified engineers, who are innovative,
entrepreneurial, successful in their career and committed to the development of the country.”

School Mission

1. To impart quality education to the students and enhance their skills to make them globally
competitive engineers in mechanical and allied areas.
2. To promote multidisciplinary study, cutting edge research and expand the frontiers of
engineers’ profession in mechanical and allied areas.
3. To create state-of-art facilities with advanced technology for providing students and faculty
with opportunities for innovation, application and dissemination of knowledge.
4. To prepare for critical uncertainties ahead for mechanical engineering and allied areas and to
face the challenges through clean, green and healthy solution.
5. To collaborate with industries, institutions and such other agencies nationally and
internationally to undertake exchange programs, research, consultancy and to facilitate
students and faculty with greater opportunities for individual and societal growth.

Program Educational Objectives (PEOs)


After few years of graduation, the graduates of B.Tech Mechanical Engineering will:
PEO 1: Exhibit skills as a member of a team in national and international organizations with
highest ethics through lifelong learning
PEO 2: Pursue higher education through continuous learning with effective communication
skills
PEO 3: Start own enterprise and provide solutions in mechanical engineering and allied areas.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 2


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Program Specific Outcomes (PSOs)


On successful completion of the program, the graduates of B.Tech Mechanical Engineering will
be able to:
PSO 1: Apply mechanical engineering knowledge and skills in Design, Manufacturing, Thermal
and Industrial Engineering to obtain realistic outcomes.
PSO 2: Identify, formulate, analyze and solve problems in Mechanical Engineering and allied
domains.
PSO 3: Conduct investigations in Mechanical Engineering and allied areas to provide optimal
and sustainable solutions
Program Outcomes (POs):
On successful completion of the program, the graduates of B.Tech Mechanical Engineering will be able
to:
PO-1: Engineering Knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, to solve mechanical engineering problems.
PO-2: Problem Analysis: Identify, formulate, review research literature, and analyse complex
engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences and engineering sciences.
PO-3: Design/Development of Solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration
for the public health and safety, and the cultural,
societal, and environmental considerations.
PO-4: Conduct Investigations of Complex Problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions for complex problems
PO-5: Modern Tool Usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modelling to complex engineering activities with an
understanding of the limitations.
PO-6: The Engineer and Society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO-7: Environment and Sustainability: Understand the impact of the professional engineering solutions
in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
PO-8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
PO-9: Individual and Team Work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO-10: Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear
instructions.
PO-11: Project Management and Finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and leader in
a team, to manage projects and in multidisciplinary environments.
PO-12: Life-long Learning: Recognize the need for, and have the preparation and ability to engage in
independent and lifelong learning in the broadest context of technological change.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 3


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

1. Introduction to CAD
CAD involves the use of computers for design, analysis and modification of a new or existing
product. In CAD systems, the images are created using basic geometric elements such as points,
lines, circles, and curves. These can be modified (rotated, moved, reduced etc), rotated and
transformed on the CRT screen using the respective commands leading to creation of desired
model.
Geometric Modeling: Geometric modeling in CAD refers to the creation of the geometry
of an object, which is the computer compatible mathematical description. The software for CAD
is the interface between the designer and the hardware. In geometric modeling, the designer
creates the graphical image of the required product on the CRT screen of the ICG system by
inputting three types of commands to the computer. The first type of command generates basic
geometrics like points, lines, curves etc. The second type of commands is used to form
transformations actions like scaling, modifying, rotation etc. The third type of command is used to
obtain desired shape of the product. During geometric modeling process, the computer converts
these commands into a mathematical model, stores it in its data storage place, and displays on
the CRT screen.

There are 3 basic features of geometric modeling.

1. Wire frame modeling - 2D: Two-dimensional representation is done for flat objects.
2. Surface modelling - 2 ½ D: This represents a 3-D object without any lateral surface details.
3. Solid modelling: 3D- Three-dimensional representation with complete geometry.

Wire Frame Modeling (WFM) is the basic form of geometric modeling. In this wire frames are used
to represent an object. The object is displayed by interconnecting lines.

Surface modeling is the enhancement of WFM, in which the object is represented with surfaces.
Solid Modeling uses solid geometric shapes such as cylinders, cubes etc called primitives to construct an
object. It also considers physical properties of the created object based on the inputs given.

Solid modeling or 3D modeling is the process of developing a mathematical representation of any


three-dimensional surface of an object. It represents the volumetric information of the objects.

1a. Introduction to Computer Integrated Manufacturing

The term "computer-integrated manufacturing" is both a method of


manufacturing and the name of a computer -automated system in which individual
engineering, production, marketing, and support functions of a manufacturing enterprise are
organized.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 4


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Part of the system involves flexible manufacturing, where the factory can be quickly
modified to produce different products, or where the volume of products can be changed
quickly with the aid of computers. Some or all of the following subsystems may be found in a CIM
operation:

Computer-aided techniques:
 CAD (computer-aided design)
 CAE (computer-aided engineering)
 CAM (computer-aided manufacturing)
 CAPP (computer-aided process planning)
 CAQ (computer-aided quality assurance)
 PPC (production planning and control)
 ERP (enterprise resource planning)
 A business system integrated by a common database.

Devices and equipment required:


 CNC, Computer numerical controlled machine tools
 DNC, Direct numerical control machine tools
 PLCs, Programmable logic controllers
 Robotics
 Computers
 Software
 Controllers
 Networks
 Interfacing
 Monitoring equipment

Technologies:
 FMS, (flexible manufacturing system)
 ASRS, automated storage and retrieval system
 AGV, automated guided vehicle
 Robotics
 Automated conveyance systems & others.

2 INTRODUCTION TO NC AND CNC MACHINES

NUMERICAL CONTROL

Numerical control (NC) is a form of programmable automation in which the


mechanical actions of a machine tool or other equipment are controlled by a program
containing coded alphanumeric data.
The alphanumeric data represent relative positions b/w a work head and a work part as well
as other pro instructions needed to operate the machine.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 5


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

According to EIA.
NC is defined as a system in which actions are controlled by the direct insertion of
numerical data some points, where the system must automatically interpret at least portion of
this data.
‘’NC machine is a combination of a machine tool and control system’’.
Numerical control can be applied to a wide variety of processes. The applications divide into two
categories.
i) M/C tool application such as drilling, milling, turning and other metal working.
ii) Non machine tool application such as assembly, drafting and inspection.

BASIC COMPONENTS OF AN NC SYSTEM.


NC system consists of three basic components.
1. A program of instructions.
2. A machine controller unit.
3. Machine tool /processing equipment.
The general relationships among the three components are as shown in the fig 1

1) Program of instructions: It is the detailed step-by-step commands that direct the action of the
processing equipment. In m/c tool application. The program of instructions is called a PART
PROGRAM. It is coded in numeric or symbolic form on some type of input medium that can
be interpreted by the controller unit. The program contains both technical information
(regarding the type of tool, speed &feed) & dimensional information such as length ,width
.radii etc.
o INPUT MEDIA: PUNCHED CARDS---7 3/8’’ X 3 ¼’’ having 80 columns & 20rows
o FLOPPY DISKS----Mylar coated with magnetic oxide cartridge
o MYLAR TAPE ------ Paper Mylar /solid Mylar.
o MAGNATIC TAPE, DISKETTES AND ELECTRONIC TRANFER.

1. Machine control unit: MCU consists of a micro computer and related control hardware that
stores the program of instructions and executes it by converting each command into mechanical
actions of the processing equipment, one command at time .the different types of MCU, are.
o Housed MCU.
o Swing around MCU.
o Stand alone MCU.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 6


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

The MCU of a NC system consists of two main units,


1) Data processing unit (DPU): The function of DPU is to decode the information receive from
the tape, process it and provide data to CLU.
2) Control loop unit (CLU): I t provides a signal announcing that the previous segment is
completed and that the DPU can read a new block of the part program.
3) PROCESSING UNIT: It is also known as machine tool that performs useful work. It
accomplishes the processing steps to transform the starting w/p into a completed part.
The processing equipment consists of the worktable and spindle as wells the motors and controls
to drive them.

FEATURES OF CNC.
The various features of CNC are.
 Storage of more than one part program.
 Various forms of program input.
 Program editing at the machine tool.
 Fixed cycles and programming subroutines.
 Interpolation
 Positioning features for setup
 Cutter length and size compensation.
 Acceleration and declaration calculation.
 Communication interface.
 Diagnostics.
 Control start-up Diagnostics.
 Malfunction and failure analysis.
 Tool life monitoring.
 Programming Diagnostics.
 Preventive maintenance notices.

CLASSIFICATION OF NC SYSTEMS
The classification of NC machine tools is based on,
1. According to the type of machine.
i) point-to – point.
ii) Straight line or straight cut.
iii) contouring or continues path

POINT-TO-POINT

Fig 2 : Point to point type

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 7


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

PTP system is also called as positioning system, move the work table to a
programmed location without regard for the path taken to get to that location .once the
move has been completed, some processing action is accomplished by the work head at the location
.thus it consists of a series of point location at which operation are performed as shown in the
above figure 2.

STRAIGHT CUT:

Fig 3: Straight Cut type


The system is capable of moving the cutting tool parallel to one of the major axes at a
control rate suitable for machining .it is not possible to combine movements in more than a single
axes direction with straight cut NC system and angular cuts on the work piece is not possible as
shown in figure 3.

CONTOURING:

Fig 4: Contouring type

The continuous path systems are capable of continuous, simultaneous control of two or more
axes. It is a universal type system which can perform all kinds of motion .It provides control of
the tool trajectory relative to the work part as shown in the figure 4.
2. According to the structure of the controller hardware based.
i) NC II) CNC

3. According to the programming method.


i) Incremental ii) Absolute program.
Motion control is concerned with whether positions are defined relative to the origin of the
coordinate system or relative to the previous location of the tool.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 8


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

In absolute positioning- The work head locations are always defined with respect to the axis system.
In incremental positioning- The next work head position is defined relative to the locate

ABSOLUTE DIMENSION SYSTEM.

Data in absolute dimension system, refers to a fixed reference point in the drawing , which
is also known as coordinate zero point .The dimensions lines run parallel to the coordinate
axes &always start at the reference point as shown in fig 5.
Absolute dimensions are also called as “REFERENCE DIMENSIONS”.

Fig 5 : Absolute Dimensioning system.

Advantages of absolute Dimension system.


1. Possibility of easily changing the dimensional data in the part program whenever they
required.
2. While describing contours &positions, it is always preferable to employ absolute
dimensions.
3. Easier to check for errors.
4. In case of interruptions that force the operator to stop the m/c, the cutting tool
automatically returns to previous position.

INCREMENTAL DIMENSION SYSTEM


In incremental dimension system, every measurement reefers to a previously
dimensioned position. Incremental dimensions are distance b/w adjacent points these
distance are converted into incremental coordinates by accepting the last dimension point as the
coordinate origin for the new point as shown in fig 6. It is also called as ‘RELATIVE DIMENSIONS’
OR ‘CHAIN DIMENSIONS’.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 9


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

The incremental coordinate are.

Point X Y
P1 0 0
P2 20 0
7
0

P3 0 20

40
P4 50 0
P5 0 -20
P6 30 0
P7 0 40
P8 -30 30
P9 -70 0

All dimensions are in mm


Fig 6: Incremental Dimensioning System

An advantage of incremental dimension system

1. If manual programming is used, with incremental system the inspection of the part
program, before punching the tape is easy.
2. Minor image programming is facilitated with incremental system.
3. The performance of the incremental system can be checked by a closed-loop tape.
The last position command on the tape causes the table to return to the initial
position.

4. According to the type control loops.


i) Open loop ii) Closed loop

NC COORDINATE SYSTEM

Fig 7: Coordinate system used in NC (a) For flat and prismatic work (b) For rotational work
(turning)
To program the NC processing equipment, a std, axes system must be defined by which the position
of the work head relative to the work part can be specified.
SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 10
COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

The both axis systems are based on the Cartesian coordinate system. The axis system for flat and
prismatic parts consists of three linear axes (X.Y.Z) plus three rotational axes (a, b,
c) as shown in the fig 7. In the most m/c tool application the x & y axis are used to move and
position the work table to which the part is attached and the Z-axis is used to control the vertical
position of the cutting tool. The (a,b,c)rotational axis specifies angular position about (x,y,z)axis.
The coordinate axis for a rotational NC system is illustrated in fig, which are associated the lathe
and turning centres. Although the work rotates, the y axis isn’t used. The path of the cutting tool
relative to the rotating W/P is defined in the X-Z plane, where the x-axis is the radial location and
the Z-axis is parallel to the axis of the rotation of the part.

WHERE NC IS MOST APPROPRIATE /APPLICATION OF NC


1. Parts are processed frequently in small lot size(BATCH PRODUCTION)
2. Complex part geometry.
3. Hazardous environment.
4. High accuracy and repeatability.
5. Increased productivity.
6. Scrap reduction.
7. Engg.. Changes are likely to be ,
8. Where parts require 100% inspection.
9. To achieve close tolerance.
10. Where ever part is expensive.
11.Repeated orders.
12. More no of operations to be performed on the part.

ADVANTAGES & DISADVANTAGES OF NC SYSTEM.


Advantages of NC system are as follows,
1. Non productive time is reduced.
2. greater accuracy &repeatability.
3. lower scrap rates &rework.
4. Greater manufacturing flexibility.
5. Reduced manufacturing lead time.
6. Reduced setup time .
7. Reduced /less floor space.
8. Elimination of jigs& fixtures.
9. Inspection requirements are reduced.
10. Longer tool life.
11. Reduced part inventory.
12. production of more intricacy of part geometry.(complex geometry)
13. To achieve 100% quality (Improved quality control)
SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 11
COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Disadvantages of NC system.
1. Higher investment cost.
2. Higher maintenance effort.
3. Skilled labour required which is more expensive.
4. Down time is very expensive.
5. Part programming mistakes.
6. Not cost effective for low production levels,

2.7 NC PROCEDURE
The various basic steps in NC procedure,
Process planning.
Part programming.
Part program entry.
Providing the part programs.
Production.

1. Process planning:
The part programmer will often carry out the task of process planning process
planning is the procedure of deciding what operations are to be done on the component, in
what order and with what tooling and work holding facilities.
The process planning procedure is as follows,
Receive the part drawing from part drawing information, check suitability of part to be
machined against the machine capacity.
Determine a method of driving the components. (Chuck type, chuck size type of jaw, collate
size, face driver etc.) and method of machining .
Identify the tooling required for machining and determine the order of machining and
tooling stations.
Determine planned stop.(cycle interrupt procedure , incorporating block delete
codes) for checking dimensional sizes where required by operator .
Determine cutting speeds based on.

Component material, method of driving, rigidity of components.

Tooling selected for roughing and finishing.
Determine the depth of cut and feeds for roughing operation.
Determine surface finish requirements and feed rates.
Allocate tool offsets as required.
Complete planning sheet.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 12


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

2. PART PROGRAMMING
Part programming consists of planning documentation/documents the sequence of
processing steps to be performed on an NC machines. The part programmer must have
knowledge of machining as well as geometry and trigonometry.
Part programming can be accomplished using a variety of procedures ranging from highly
manual to highly automated methods.

The methods are:


i) Manual part programming.
ii) Computer –assisted part programming.
iii) Part programming using CAD/CAM.
iii) Manual data input.

3. PART PROGRAM ENTRY


The part program is prepare /punched on a 25mm (1-inch) wide paper tape with 8 tracks
and is then fed to MCU in order to produce a components of interest on M/C tool. Other forms
of input media include, punched cards, magnetic tape, and 35mm motion picture film.
The input to the NC system can be in two ways.
 Manual input data
 Direct numerical control.
MDI is the editing of part program already resident in controllers memory.
DNC is the process of transferring part programs into the memory of a CNC machine tool form a
host computer is called DNC.

4. PROVING PART PROGRAM.


It is a safe practice to check the programmed path for any (interface) interference b/w
the tool and the work before using the part program for production. Hence, This process is
known as providing part program.

Proving part program is usually done by.


o Visual Inspection.
o Single step execution.
o Dry run.
o Graphical simulation.
Visual Inspection:
It represents the method of checking visually the program present in the memory of the
CNC machine. In this, actual program is run and programmed movements in all axes are to be
checked along with ensuring the offset and cutter compensation feature.
Single step execution:
Before auto running the part program it should be executed in a signle step mode i.e.,
block by block during this execution , spindle speed and feed rate override facilities are
SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 13
COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

to be used so that the axes movement can be easily monitored, which is carried out with or
without mounting the component on machine.

 Dry run:
A dry run consists of running the part program in auto mode I this, the component is not
installed on the machine table and cutting is done in air.
The purpose of this run is to verify the programmed path of the tool under
continuous operation and to check whether adequate tolerance/ clearance exists b/w the
clamping arrangement and other projections with the setup.

 Graphical simulation:
A graphical simulation package emulates the machine tool and using computer graphics,
plots out the machine movements on a VDU screen.

5. PRODUCTION:
The processing of a component with a proper sequence of operation in a factory model is
known as production.

BLOCK FORMATS USED IN PART PROGRAMING.


The various block formats are.
1. Fixed sequential formats are:
This format was used on many of the first commercially available NC
machine .each instruction block contains five words specified in only numerical data and in
a very fixed order.
2. Fixed sequential format with TAB ignored:
It is same as the fixed sequential format except that TAB codes are used to separate the
words for easier reading.
3. Tab sequential format:
The words in each instruction /block are always provided in the same sequence but
each word is preceded by the TAB character. If the instructions remain unchanged in succeeding
blocks, the instructions needn’t be repeated but TAB character must be punched.
4. Word address format:
This format uses a letter prefix to identify the type of word.
5. Word address format with TAB separation and var, word order.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 14


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

WORD ADDESS FORMAT


The format uses a letter prefix to identify the type of word.
Words in an instruction block are intended to convey all of the commands and data
needed for the machine tool to execute the move defined in the block.

The words required for one machine tool type may differ from those required for a
different type.
The words in a block are in the following order.
 Sequence number (N-word).
 Preparatory word (G-word).
 Coordinates(X, Y, Z words for linear axes U, V, W words for rotational axes.
 Feed rate (F- word).
 Spindle speed(S-word).
 Tool selection (T-word)Miscellaneous command.(M-word)
 End -of-block (EOB Symbol)

GENERAL PROCEDURE FOR NC PROGRAM (TURN)

Word
Prefix Function
N Sequence number; identifies block of instruction from one to four digits can be used
G Preparatory word; prepares controller for instructions given in the block.
Coordinate data for the three linear axis, specified in either inches or Millimeter for
X,Y,Z
absolute programming.
U,V,W Coordinate data for incremental moves.
Coordinate values of arc center, corresponding to X,Y and Z axis respectively used in
I, J, K
circular interpolation .
F Feed rate per minute or per revolution in either mm/inches as specified by G words
Spindle rotation speed in revolutions /minute. (It is expressed as a % of maximum
S speed available on machine).
T Tool selection, used for m/c tools with automatic tool changes or tool turret.
Miscellaneous command; used to signal an action from a miscellaneous group of
M commands.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 15


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Machine Language codes G & M codes


G- WORDS:
G word is called as preparatory words, which consists of two numerical digits that
prepare MCU for the instructions and data contained in the block.
A 2-digit number following address and determines the meaning of the command of the
block concerned.
The G codes are divided into the following two types.
*One shot G codes: G code is effective only at the block in which it was specifies.
*Model G codes: G code is effective until another G code in the same group is commanded.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 16


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

The Various G CODES used for CNC turn are,


G CODES. FUNCTION
G00 Rapid positioning /Rapid traverse.
Point-to-point movement b/w previous point and end point defined in
current block. Block must include X-Y-Z coordinates of end position.
G01 Linear interpolation movement .(feed)
G02 Circular interpolation (clock wise)
Block must include either arc center; coordinates of end position must also
be specified.
G03 Circular interpolation (counter clock wise).Block must include either arc radius or
arc center. Coordinates of end position must also be specified.
G04 Dwell for a specified time .
G20 Data input specified in inches.
G21 Data input specified in millimeters.
G28 Return to reference point.
G32 Thread cutting.
G40 Tool nose radius compensation cancel.
G41 Tool nose radius compensation left of part surface.
G42 Tool nose radius compensation right of part surface.
G50 Work coordinate change /max, spindle speed setting.
Finishing cycle.
G70
Stock removal in turning (repetitive operation).
G71
Stock removal in facing.
G72
G73 Pattern repeating.
G74 Peck drilling in Z-axis.
G75 Grooving in X-axis.
G76 Thread cutting cycle (Repetitive action).
G81 Grooving cycle.
G90 Box turning cycle.
G92 Thread cutting cycle (without canned cycle).
G94 Facing Cycle (Without canned Cycle)
G96 Constant surface speed control.
G97 Constant surface speed controls cancel.
G98 Feed per minute.
G99 Feed per revolution.
G94 Box facing cycle.
NOTE OF G- CODES
 Maximum spindle speed setting (G50) is valid when the constant surface speed
control (option) is provided.
 G-codes are marked* are set when the power turned on.
G codes may not apply to each machine.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 17


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

M- WORDS
M-words are used to specify miscellaneous or auxiliary function that are available on the
machine tool. Examples:
 starting the spindle rotation.
 Stopping the spindle for a tool change.
 Turning the cutting fluid on and off ….miscellaneous commands are normally placed at
the end of the block.
M-CODE: These are instruction describing miscellaneous function like the calling the tool,
spindle rotations, coolant on ……etc.
M CODES. FUNCTION
M00 Program stop; used in the middle of the program.
M01 Optional program stop; active only when optional stop required’
M02 Program end. (M/c stop).
M03 Spindle forward (clockwise).
M04 Spindle forward(counter clockwise direction)’
M05 Spindle stop.
M06 Tool change-execute tool change, either manually or automatically. If
manually operator much restarts m/c. doesn’t include selection of tool. This
is done by T-word if automatic.
M07 Cutting fluid on flood’
M08 Coolant off.
M09 Coolant on.
M10 Chuck opens.
M11 Chuck close.
M30 End of program.(program rest and rewind).
M98 Sub program call.
M99 Sub program exit.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 18


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

PROGRAM BUILD UP FOR CNC LATHE (FANUC)

CNC program can be divided into 3parts,


 Start –up of the program.
 Body or structure of the program.
 End of the program.
START UP OF CNC PROGRAM,,
O1000
BILLET X……..Z………
G21/G20 G98/G99 G40
G50 S…………
G28 U0 W0
M06 T0101
M03 /M04 S1000
GOO X……… Z…………

01000 In ,Fanuc controller first line has to be started with letter ‘o’ followed by 4 digit number.
Billet X….Z…. It defines the w/p dimensions with dia and length.
G21/G20 Code specifies that program data input in metric or in imperial units.
G98/G99 Code specifies feed in mm/minute or mm/revolution compensation cancel.
G40 Compensation cancel.
G50 S1800 Clamps the spindle speed at 1800 rpm.
G28 U0 W0 Make the tool to go home position U&Ware secondarymovements about X and y axis.
M06 T0101 M06 –tool change.
The first two digit specify the tool position in the turret and last two digits
denotes the offset number.
M03 /M04S… M03: Makes the spindle rotate in clock wise direction
Mo4: Makes the spindle to rotate in Counter clock wise direction
s……: spindle rotates at 1000 rpm.
Goo gives rapid position of the tool to a point X…. Z…… which is just above the
G00 X…. Z…. billet .this point is called as tool entry points.

BODY OF THE PROGRAM


It is also known as structure of the program which defines the cutter tool path of the
profile in the part geometry .It involves various sequence of operation in the profile.

END OF PROGRAM
G28 U0 W0
M05
M02/M30
G28 U0 W0 Makes the tool to go to home position U and w secondary Movements
about X &Z-axis.
M05 Stop the spindle rotation
M02/M30 M02 optional stop / M30 program stop and rewind

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 19


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

METAL CUTTING PARAMETERS FOR LATHE OPERATION.


BILLET MATERIAL: ALUMINUM.
OPERATION CUTTING SPEED FEED DEPTH OF CUT
(rpm) (mm/min) (mm)
TURNING 1000-1500 30-55 0.1-1
GROOVING 600- 800 15- 25 0.25 -0.5
THREADING 300- 350 _ 0.02- 0.04
(Height & pitch of the
thread required)
PECK DRILLING &FACING 900-1200 30-45 0.4-0.8

Co-ordinate System in NC/CNC

Machining of a work piece by an NC program requires a coordinate system to be applied to the


machine tool. As all machine tools have more than one slide. It is important that each slide is
identified individually.
There are three planes in which movement can take place.
 Longitudinal
 Vertical
 Transverse
Each plane is assigned a letter and is referred to as an axis. i.e.,
 Axis X
 Axis Y
 Axis Z
The three axes are identified by upper case X, Y and Z and the direction 0 movement along each
axis is specified as either PLUS (+) or MINUS (-). The Z-axis is: always parallel to the main spindle of
the machine. The X-axis is always parallel to tilt work-holding surface, and always at right angles
to the Z-axis. The Y-axis is at right angle to both Z and X-axis. The Coordinate System for turning
operations is shown in Fig. 8.

Fig 8: Coordinate system for turning operations


(Tool positioned Behind Centre Line)

The coordinate system for designating the axes is the conventional “Right Hand Coordinate System”
as shown in Fig.9. A labeling of the axes is a right hand coordinate system whenever the
fingers of the fight hand are aligned with the positive X axis and are then rotated (through the
smaller angle) toward the positive Y axis, then the thumb of the right hand points in the direction
SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 20
COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

of the positive Z axis. Otherwise, the orientation is a “Left Hand Coordinate System”. The right
hand coordinate system is also known as “Clockwise Rotating Coordinate System”. The reason
for this is the sequence of the axis definitions if the X-axis is rotating in the direction of the Y-axis,
the movement is the same as if a screw is turned in the Z direction as shown in Fig.10.

Fig 9: Right Hand Co-ordinate Systems Fig 10: Clock wise Rotating Coordinate system

One could use his right hand to get these alternative relative positions of the same right hand
coordinate system as shown in Fig.11. In programming it must be assumed that the work piece is
stationary and the tools move in the coordinate system. The work piece is positioned within the
coordinate system so that the Z-axis coincides with the turning center- line (axis of rotation) and
the X and Y coordinates always have the same values. Therefore the Y coordinate is not used in
turning.

Fig 11: Co-ordinate system

Zero Points & Reference Points:


On CNC coordinating systems controls machines tool traverses. Their accurate position within
the machine too1 is established by “Zero Points” as shown in fig. 12.

Fig 12: Zero & Reference points on a CNC machine

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 21


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Machine zero point (M): is specified by the manufacturer of the machine. This is the zero point
for the coordinate systems & reference points in the machine. On turning lathes, the machine
zero point as shown in FIG.13 & FIG.14 is generally at the centre of the spindle nose face. The
main spindle axis (centre line) represents the Z-axis; the face determines the X-axis. The directions
of the positive X and Z-axis point toward the working area. When the tool traverses in the positive
direction, it moves away from the work piece

Fig.13.Position of machine Zeropoint Fig 14. Position of Machine Zero point on


Turning lathes (WhenMachiningwith on turning lathes (When machining with
Tools behind the centre line). Tools on centre line).

Reference Point (R): This point serves for calibrating and for controlling the measuring system
of the slides and tool traverses. The position of the reference point as shown in FIG.15 is
accurately predetermined every traverse axis by the trip dogs and limit switches Therefore, the
reference point coordinates always have the same, precisely known numerical value in
relation to the machine zero point. After initiating the control system, the reference point must
always be approached from all axes to calibrate the traverse measuring system. If current slide
and tool position data should be lost in the control system as, for example, through an electrical
failure. The machine must again be positioned to the reference point to re-establish the proper
positioning values

Fig 15. Position of reference point on lathe


Work piece Zero Point (W): This point determines the work piece coordinate system in
relation to the machine zero point. The work piece zero point is chosen by the programmer and
input into the CNC system when setting up the machine. The position of the work piece zero point
can be freely chosen by the programmer within the work piece envelope of the machine. It is,
however, advisable to place the work piece zero point in such a manner that

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 22


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

the dimensions in the work piece drawing can be conveniently converted into coordinate values
and orientation when damping/chucking, setting up and checking, the traverse measuring
system can be affected easily. For turned parts, the work piece zero point should be placed along
the spindle axis (centre line), in line with the right-hand or left-hand end face of the finished
contour as shown in FIG.16. Occasionally, the work piece zero point is also called the “Program
Zero Point”.

Fig 16. Examples of Work piece Zero point position for turned parts

Tool Point: Which machining a work piece, it is essential to able to control the tool point or the
tool cutting edges in precise relationship to the work piece along the machining path Since
tools have different shapes and dimensions, precise tool dimensions have to be established
beforehand and input into the control system. The tool dimensions arc related to a fixed tool
setting point during pre-setting.
The tool selling point .E is located at a certain point on the tool holder as shown in Fig. 17. This
setting point permits measuring of tools away from the CNC machine. The data thus measured
such as tool length, tool point offset or tool radius is input into the tool data storage
(memory) or the control system. The mate of the tool setting point is the Socket point N on the
tool carrier. When the tool or tool holder is inserted into the tool carrier (e.g., turret), the
setting point and the tool socket point coincide.

Fig 17: Tool Reference point

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 23


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

4 SYNTAX FORMATS of CNC TURN

 BOX FACING CYCLE


G94 X…….. Z………….. F.
G94- Box facingcode.
X- Diameter to which the movement is being made.
Z-The Z-axis coordinate to which movement is being mode.
F- Feed rate.

 Multiple facing cycle

G72 W……… R…….


G72 P……… Q……. U……. W…… F……
W= Depth of cut in the Z-axis (0.5-0.1mm)
R= Relief amount or escape (1mm)
P= Line no, in the program marking the start of the finished form required.
Q =Line no, in the program marking the end of the finished form required.
U=Amount and direction of the finishing allowance left in the X- axis.
W=Amount and direction of the finishing allowance left in the Z-axis.
F =Feed rate.

 BOX TURNING CYCLE.


G90 X……… Z………. F………. G90-
Box turning code.
X- Diameter to which the movement is being made.
Z- Z-axis coordinate to which the movement is being made.
F- Feed rate.

 Multiple turning cycles.


G71 U*…….. R……
G71 P……. Q…… U….. W……. F……..
……………….
……………………
G70 P……. Q…….. U……. W……… F………
U* =Depth of cut (0.1mm-0.5mm/1mm)

R = Relief amount (1mm)


P = Stark of the block in canned cycle.
Q =End of the block in canned cycle.
U = Clearance in the X axis (0.1mm)
W =Allowance in the X axis (0.1mm)
F =Feed rate.
G71 = Canned cycle (Multiple turning)
G70 = Finishing cycle (Multiple turning).

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 24


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

 TAPERTURNING CYCLE,
G90 X……. Z..... R…….. F……..
X—Diameter to which the movement is being made.
Z—Z-axis coordinate to which movement is being made.
F—Feed rate.
R—The different in incremental of the cut start radius value and cut Finish radius value.
If an ‘R’ value is specified in the command format of G90 cycle , tapering Will be
performed.

R= D1-D2 = 10-22 =-6 R=D1-D2 =22-10 =6


2 2 2 2

G90 X22 Z-25 R0 F30 G90 X22 Z-25 R0 F30


R-1 R1
R-2 R2
R-3 R3
R-4 R4
R-5 R5
R-6 R6

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 25


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

EXTERNAL GROOVING.( GROOVING CYCLE)


G75 and G81 cycle is designed for grooving .which is commanded by two distinct lines of data.
G75 R……….
G75 X……… Z…….. W……… P………… Q……….. F………
R:Reture amount.(usually expressed as 1.0)
X:Total depth along x-axis (Absolute)
Z:Total width along Z-axis (Absolute)
W:Total width along Z-axis (incremental)
P:Peck increment in X-axis (Microns)
Q:Stepping distance in x-axis (Microns)
F:Feed rate(mm)

G75 R1
G75 X14 W-2 P100 Q1500 F15

Relief amount ,R=1.0mm


Depth of groove. X=6mm.
Z: 5mm width of groove.
W: Width of groove with
incremental. P: Peck increment along
x axis (0.1mm)=100microns.
Q: Stepping distance along Z axis (01.5mm)
=1500microns

G81 G01 X….. Z…….. F………..


G81: Grooving code when groove width of standard, size, 3, 6, 9……..
X : Diameter to which the movement is made for groove.
Z: Z-axis coordinate to which the movement is made. F:Feed.

Peck Drilling
Syntax format for end face peck drilling on lathe machines.,

G74 R……
G74 Z…….. Q……… F………….
R : Return Amount / Relief Amount ,1mm
Z : Total Depth F: Feed Rate
Q : Depth of cut ( Incremental mode) Expressed in Microns
 For centre drill - 0.1mm = 100 microns
 For Peck drill – 0.4mm = 400 microns

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 26


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

BOX THREADING CYCLE:

G92 X………. Z…….. F………


X: Depth of cut.
Z: Length of thread.
F: Lead or pitch of thread.

Calculation of height of the thread


P=0.613xpitch
=0.613x……..
Core diameter =D-2P Where D= Major dia
P= Height of the thread

MULTIPLE THREADING CYCLE . G76


G76 P(m)(r) (a) q1 ………… R………..
G76 X………… Z………. P1……… Q2……….. F……….
Where m= Repetitive count in finishing. (1to99).
R = Pull out angle.
A = Angle of tool tip (80°,60°,55°,30°,29° and 0° )
X = Minor diameter (core diameter).
Z = End position of thread.
P = Height of the thread. (In terms of 1000’s).
Q2 = Depth of first cut (in terms of 1000’s).
F = Pitch of thread.
Q1 = Minimum cutting depth-20microns.

G76 P031560 Q20 R0.015


G76 X………. Z……… P………. Q50 F……….
03: No of passes for finishing operation.
15: chamber amount or pull out angle.
60: ANGLE OF THE THREAD, DEG.
Q1: Minimum cutting depth =20 microns.
R: Finishing allowance.
Q2: Depth of cut for first pass =50 microns.(0.05mm).

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 27


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

5 Exercise program on Turning operation

Write a Manual part programming for the following programs


i) Without canned cycles
ii) With canned cycles

PROGRAM NO 1:

70

PROGRAM NO 2.

PROGRAM NO 3.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 28


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

PROGRAM NO 4:

PROGRAM NO 5:

PROGRAM NO 6:

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 29


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

PROGRAM NO 07:

PROGRAM NO 8:

PROGRAM NO 9:

PROGRAM NO 10:

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 30


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

6 Introduction to MILLING
Machining of a work piece by an NC program requires a coordinate system to be
applied to the machine tool. The entire machine tools have more than one slide, it is
important that each slide is identified individually. There are three planes in which
movement can take place,
 Longitudinal
 Vertical
 Transverse
Each plane is assigned a letter and is referred to as an axis, i.e,
 Axis x
 Axis Y
 Axis Z
The three axes (coordinate system) which are identified are as shown below.,

The z-axis is always parallel to the main spindle of the machine. The X axis is always parallel to the
work holding surface and always at right angles to the Z axis. The y-axis is at right angles to both
Z and X axis.

Coordinates for CNC milling machining centers

Zero points and Reference points


On CNC machines, tool traverses are controlled by coordinating systems. Their accurate position
within the machine tool is established by “ZERO POINTS”
 Machine zero point (M): This is specified by the manufacturer of the machine,
which is the zero point for the coordinate systems and reference points in the
machine.
The machine Zero point can be the centre of the table or a point along the edge
of the traverse range.
 Reference point: This point serves for calibrating and for controlling the
measuring system of the slides and tool traverses.

GENERAL PROCEDURE FOR NC PROGRAM (MILL)

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 31


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

M codes and G Codes for MILL


G codes: The various G codes are as listed below., M codes: the various M codes are
as listed below.,
G00 Positioning or RapidTraverse M 00 Program Stop
G01 Linear Interpolation M 01 Optional Stop
G02 Circular Interpolation in Clock M 02 Program End
wise direction M 03 Spindle Forward
G03 Circular Interpolation in Counter M 04 Spindle Reverse
Clock wise direction
M 05 Spindle stop
G04 Dwell Time or exact stop
M 06 Tool Change
G17 X, y Plane selection
M 08 Coolant on
G18 Z, x plane selection
M 09 Coolant off
G19 Y, Z plane selection
M 10 Vice on
G20 Input in inches
M 11 Vice off
G21 Input in Millimetres (mm)
M 13 Coolant Spindle forward
G28 Return to reference point
M 14 Coolant Spindle reverse
G40 Cutter compensation cancel
M 30 Program Stop and Eng
G41 Cutter compensation Left
M 70 Mirror X on
G42 Cutter compensation right
M 71 Mirror Y on
G43 Tool length compensation in +ve
direction M 80 Mirror X off
G44 Tool length compensation in –ve M 81 Mirror Y off
direction
G49 Tool length compensation cancel
G50 Clamping the spindle
G73 Peck drilling cycle for high speed
G74 Tapping cycle
G76 Fine boring operation
G80 Canned cycle cancel
G83 Peck drilling cycle
G88 Boring cycle
G90 Absolute coordinate system
G91 Incremental coordinate system
G92 Set datum
G94 Feed per minute
G95 Feed per resolution
G99 Canned Cycle

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 32


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Structure of a CNC milling program


Startup of the program
O0001
Billet Size x…… Y…… Z….. Tool Defn
T1D5 T2D10 ……………
Edge Move X……… Y……… (Optional – Datum Setting)
G21 /G20 G40 G49 G80
G94 / G95 G50
S2000
G90/G91 G28 Z0
G28 X0 Y0
M06 T01
M03 /M04 S……
G90 G00 X0 Y0 Z5 ………… (Rapid Positioning)
Explanation
O0001 Program on Fanuc controller first line has to be started with letter
‘O’ followed by four digit number which specifies the
program name.
Billet Size x…… Y…… Z….. It is used for simulation purpose. It defines the work piece
dimensions in x, y & Z direction ( LX b X W)
Tool Defn T1D5 T2D10 It directive sets the length and diameter of the tool for
simulation.
Edge Move X………Y……… It directive sets up the required offset from the program Zero
position to lower left hand corner of the billet.
G21 /G20 G40 G49 G80 G codes with respect to input, Compensation, Canned cycle.
G50 S2000 Clamps the spindle speed at 2000 rpm
G90/G91 G28 Z0 Home position Z direction
G28 X0 Y0 Home position along X, Y direction
M06 T01 Tool Change to Tool No 01
M03 /M04 S…… Spindle rotation and Setting spindle speed
G90 G00 X0 Y0 Z5 Rapid positioning of the Tool, known as tool entry point.

Body of the Program


It describes the various operations to be performed according the profile

Program End

G28 X0 Y0 Z0 Tool to Home position


M05 Stops the spindle rotation
M30 Program stops and rewind

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 33


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

7 Syntax Format for CNC mill

Syntax format for drilling operation:


G73 x…….. y……z….. p…. Q…. R….. F…..

X & Y defines the hole position of the drill Z –


Depth of the hole
P – Dwell time (Always Zero)
Q - Depth of cut in each passes (1mm) R –
Z coordinates point
F – Feed

Syntax format of Circular pocketing


G170 R P Q XY Z I J K
G171 P* S R* F B J*
R : Position of tool to start (or) the cycle for Flat surface P
: Specifies the surface finish in terms of microns
Q : Peck increment of each cut
X, Y & Z: specifies the coordinates of center of pocketing I
: Finishing allowance of the side
J : Finishing allowance for pocket base K
: Radius of the circular pocket
P* : Cutter movement percentage for next step (50%) S :
Spindle speed in rpm
R* : Feed in Z direction for each cut (50 mm per min) F
: Feed in x & Y Direction
B : Finishing spindle speed (up to 2500 rpm) J*
: Finishing feed (150mm/Min)

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 34


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Syntax format of rectangular pocketing


G172 I J K P Q R X Y Z
G173 I* K* P* T S R* F B J* Z*

I : Length of the Pocket in X Direction J :


Length of the Pocket in Y Direction K :
Corner Radius
P : Specifies the surface finish which will always be zero Q
: Depth of cut for each pass
R : absolute depth from the surface X
: Pocket corner in X Direction
Y : Pocket corner in Y Direction Z
: Absolute base of the Pocket
I* : Pocket side finish allowance (0) K*
: Pocket base finish allowance (0) P*
: Cutter width percentage (75%) T
: Tool Number
S : Spindle Speed (1500 rpm)
R* ; Roughing Feed in Z direction (50mm / Min)
F : Roughing Feed in X & Y direction (200mm / Min) B
: Finishing Spindle speed (2000 rpm)
J* : Finishing Feed in mm / Min
Z* : Safety Z Position (5)

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 35


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

8. Exercise Program on Milling operation

Write the manual part programming for the profile as shown below:-

Program No 1:

Program No 2:

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 36


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Program No 03:

Program No 04:

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 37


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Program No 05:

Program No 06:

Program No 07:

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 38


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

9. Introduction to Machine Learning


Introduction
Machine learning is a buzzword for today's technology, and it is growing very rapidly
day by day. We are using machine learning in our daily life even without knowing it such as
Google Maps, Google assistant, Alexa, etc. Below figure shows the most trending real-world
applications of Machine Learning:

Figure 18. Most trending real-world applications of Machine Learning


Machine learning has given the computer systems the abilities to automatically learn
without being explicitly programmed. But how does a machine learning system work? So, it
can be described using the life cycle of machine learning. Machine learning life cycle is a
cyclic process to build an efficient machine learning project. The main purpose of the life
cycle is to find a solution to the problem or project.

The Machine learning life cycle as shown in below figure, involves seven major steps,
which are given below:
 Gathering Data
 Data preparation
 Data Wrangling
 Analyse Data
 Train the model
 Test the model
 Deployment

Figure 19. Machine learning life cycle

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 39


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

1. Supervised learning
Supervised Learning is the types of machine learning in which machines are trained using
well "labelled" training data, and on basis of that data, machines predict the output. The labelled
data means some input data is already tagged with the correct output.
In supervised learning, the training data provided to the machines work as the supervisor
that teaches the machines to predict the output correctly. It applies the same concept as a
student learns in the supervision of the teacher. Supervised learning is a process of providing
input data as well as correct output data to the machine learning model. The aim of a supervised
learning algorithm is to find a mapping function to map the input variable(x) with the output
variable(y). In the real-world, supervised learning can be used for Risk Assessment, Image
classification, Fraud Detection, spam filtering, etc.
Types of supervised Machine Learning Algorithms:
Supervised learning can be further divided into two types of problems:

Figure 20. Types of supervised learning


i) Regression
Regression algorithms are used if there is a relationship between the input variable and the output
variable. It is used for the prediction of continuous variables, such as Weather forecasting, Market
Trends, etc. Below are some popular Regression algorithms which come under supervised learning:
 Linear Regression
 Regression Trees
 Non-Linear Regression
 Bayesian Linear Regression
 Polynomial Regression
ii) Classification
Classification algorithms are used when the output variable is categorical, which means there are two
classes such as Yes-No, Male-Female, True-false, etc.
 Random Forest
 Decision Trees
 Logistic Regression
 Support vector

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 40


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Advantages of Supervised learning:


 With the help of supervised learning, the model can predict the output on the basis
of prior experiences.
 In supervised learning, we can have an exact idea about the classes of objects.
 Supervised learning model helps us to solve various real-world problems such as
fraud detection, spam filtering, etc.

Disadvantages of supervised learning:


 Supervised learning models are not suitable for handling the complex tasks.
 Supervised learning cannot predict the correct output if the test data is different
from the training dataset.
 Training required lots of computation times.
 In supervised learning, we need enough knowledge about the classes of object.

2. Unsupervised Learning
is a machine learning technique in which models are not supervised using training
dataset. Instead, models itself find the hidden patterns and insights from the given data. It
can be compared to learning which takes place in the human brain while learning new
things. Unsupervised learning cannot be directly applied to a regression or classification
problem because unlike supervised learning, we have the input data but no corresponding
output data. The goal of unsupervised learning is to find the underlying structure of dataset,
group that data according to similarities, and represent that dataset in a compressed
format.
Types of Unsupervised Learning Algorithm:

Figure 21. Types of unsupervised learning


i) Clustering
It is a method of grouping the objects into clusters such that objects with most
similarities remains into a group and has less or no similarities with the objects of another
group. Cluster analysis finds the commonalities between the data objects and categorizes
them as per the presence and absence of those commonalities.
ii) Association
It is an unsupervised learning method which is used for finding the relationships
between variables in the large database. It determines the set of items that occurs together
in the dataset. Association rule makes marketing strategy more effective. Such as people
who buy X item (suppose a bread) are also tend to purchase Y (Butter/Jam) item. A typical
example of Association rule is Market Basket Analysis.
SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 41
COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Below is the list of some popular unsupervised learning algorithms:


 K-means clustering
 KNN (k-nearest neighbors)
 Hierarchal clustering
 Anomaly detection
 Neural Networks
 Principle Component Analysis
 Independent Component Analysis
 Apriori algorithm
 Singular value decomposition
Advantages of Unsupervised Learning
 Unsupervised learning is used for more complex tasks as compared to
supervised learning because, in unsupervised learning, we don't have labeled
input data.
 Unsupervised learning is preferable as it is easy to get unlabeled data in
comparison to labeled data.
Disadvantages of Unsupervised Learning
 Unsupervised learning is intrinsically more difficult than supervised learning
as it does not have corresponding output.
 The result of the unsupervised learning algorithm might be less accurate as
input data is not labeled, and algorithms do not know the exact output in
advance.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 42


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

10 Random Forest, Logistic Regression, Decision Trees

Random Forest is a popular machine learning algorithm that belongs to the supervised learning
technique. It can be used for both Classification and Regression problems in ML. It is based on the
concept of ensemble learning, which is a process of combining multiple classifiers to solve a
complex problem and to improve the performance of the model.

Random Forest is a classifier that contains a number of decision trees on various subsets of the
given dataset and takes the average to improve the predictive accuracy of that dataset." Instead
of relying on one decision tree, the random forest takes the prediction from each tree and based
on the majority votes of predictions, and it predicts the final output. The greater number of trees
in the forest leads to higher accuracy and prevents the problem of over fitting. The below figure
explains the working of the Random Forest algorithm:

Figure 22. Working of the Random Forest algorithm

Assumptions for Random Forest


Since the random forest combines multiple trees to predict the class of the dataset, it is possible
that some decision trees may predict the correct output, while others may not. But together, all
the trees predict the correct output. Therefore, below are two assumptions for a better Random
forest classifier:
 There should be some actual values in the feature variable of the dataset so that the
classifier can predict accurate results rather than a guessed result.
 The predictions from each tree must have very low correlations.

Below are some points that explain why we should use the Random Forest algorithm:
 It takes less training time as compared to other algorithms.
 It predicts output with high accuracy, even for the large dataset it runs efficiently.
 It can also maintain accuracy when a large proportion of data is missing.

Applications of Random Forest


Industry: to predict and prevent the machine and its tool breakdowns.
Banking: Banking sector mostly uses this algorithm for the identification of loan risk.
Medicine: With the help of this algorithm, disease trends and risks of the disease can be
identified.
Land Use: We can identify the areas of similar land use by this algorithm.
Marketing: Marketing trends can be identified using this algorithm.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 43


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Advantages of Random Forest


 Random Forest is capable of performing both Classification and Regression tasks.
 It is capable of handling large datasets with high dimensionality.
 It enhances the accuracy of the model and prevents the overfitting issue.

Disadvantages of Random Forest


 Although random forest can be used for both classification and regression tasks, it is not
more suitable for Regression tasks.

Logistic regression
is much similar to the Linear Regression except that how they are used. Linear Regression
is used for solving Regression problems, whereas Logistic regression is used for solving
the classification problems. In Logistic regression, instead of fitting a regression line, we
fit an "S" shaped logistic function, which predicts two maximum values (0 or 1). The curve
from the logistic function indicates the likelihood of something such as whether the cells
are cancerous or not, a mouse is obese or not based on its weight, etc. Logistic Regression
is a significant machine learning algorithm because it has the ability to provide
probabilities and classify new data using continuous and discrete datasets. It can be used
to classify the observations using different types of data and can easily determine the
most effective variables used for the classification. The below figure is showing the
logistic function:

Figure 23. Logistic Function


Type of Logistic Regression:
On the basis of the categories, Logistic Regression can be classified into three types:

 Binomial: In binomial Logistic regression, there can be only two possible types of
the dependent variables, such as 0 or 1, Pass or Fail, etc.
 Multinomial: In multinomial Logistic regression, there can be 3 or more possible
unordered types of the dependent variable, such as "cat", "dogs", or "sheep"
 Ordinal: In ordinal Logistic regression, there can be 3 or more possible ordered
types of dependent variables, such as "low", "Medium", or "High".

Decision Tree is a Supervised learning technique that can be used for both classification
and Regression problems, but mostly it is preferred for solving Classification problems. It
is a tree-structured classifier, where internal nodes represent the features of a dataset,
branches represent the decision rules and each leaf node represents the outcome. In a
Decision tree, there are two nodes, which are the Decision Node and Leaf Node. Decision
nodes are used to make any decision and have multiple branches, whereas Leaf nodes are

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 44


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

the output of those decisions and do not contain any further branches. The decisions or
the test are performed on the basis of features of the given dataset. It is a graphical
representation for getting all the possible solutions to a problem/decision based on given
conditions. It is called a decision tree because, similar to a tree, it starts with the root
node, which expands on further branches and constructs a tree-like structure. In order to
build a tree, we use the CART algorithm, which stands for Classification and Regression
Tree algorithm. A decision tree simply asks a question, and based on the answer (Yes/No),
it further split the tree into sub trees. Below figure explains the general structure of a
decision tree:

Figure 24. General structure of a decision tree

Advantages of the Decision Tree


 It is simple to understand as it follows the same process which a human follows
while making any decision in real-life.
 It can be very useful for solving decision-related problems.
 It helps to think about all the possible outcomes for a problem.
 There is less requirement of data cleaning compared to other algorithms.

Disadvantages of the Decision Tree


 The decision tree contains lots of layers, which makes it complex.
 It may have an overfitting issue, which can be resolved using the Random Forest
algorithm.
 For more class labels, the computational complexity of the decision tree may
increase.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 45


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

10. Exercise Program on ML algorithm

Exercise1- Machining of Aluminium material over CNC mill machine and identification
of optimal cutting forces by Machining Learning algorithm.

The following flow chart illustrates the steps to be adopted to get the optimize cutting
forces by developing ML algorithm.

Start

Import of experimental data in .csv format

Verification of experimental data

Analyzing the cutting forces data and identifying its range

Setting of tartget_flag for the range of cutting forces

Analyzing the experimental data by Bivariate Analysis

Training the experimental data by 80-20 rule

Execution of confusion matrix and predicted cutting forces by ML


algorithm

Obtaining the optimal values of cutting forces

Start

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 46


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

Exercise -2 Machining of Aluminium material over CNC mill machine and binary
conversion of optimal machining parameters by Machining Learning algorithm.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 47


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

11 CIM & Machine Learning Lab : VIVA QUESTIONS

1. Define the following terms:


 CAD
 CAM
 CIM
 CAPP
 NC
 CNC/DNC
2. Define CIM and automation. Differentiate between them.
3. What are the components and elements of CIM
4. What are the different types of CNC programming? Explain.
5. Define the elements of NC blocks
6. Define NC according to EIA.
7. Differentiate between NC and CNC, CNC and DNC.
8. Differentiate between topology and geometry.
9. Explain preparatory and miscellaneous functions in details.
10. Explain G00 , G01, G02 , G03 and G04
11. Explain the various G codes in detail: G70, G71, G72, G74, G75 & G76.
12. What are the steps involved in writing a CNC programme.
13. Explain absolute and incremental programming.
14. What are the different part programming formats
15. Explain the axis conventions in lathe and milling machine.
16. What are the features of seeNC turn and seeNC mill.
17. What are the features of caps turn and caps mill.
18. Explain cutter radius compensation and tool length compensation.
19. Explain the various canned cycle used in milling related operations.
20. Explain the following
 Drilling cycle
 Peck drilling cycle
 Reaming cycle
 Tapping cycle
 Boring cycle
21. Briefly explain the process steps involved in CAPSTURN AND CAPSMILL
22. Briefly explain the process steps involved in SEENC turn and SEENC Mill.
23. Where NC is most appropriate.
24. Advantages and Disadvantages of NC machines.
25. What is fixed zero and Floating zero?
26. What is Absolute & Incremental; NC machine tool system.
27. Define industrial robot. Explain the anatomy of a robot
28. Explain the various configurations of robots.
29. What are end effectors? Explain
30. List the application of robots.
31. What the method of robot programming
32. List the sensors used in robots.

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 48


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

33. List the robot languages


34. What are the significant advantages of using a robot in a computer integrated
manufacturing system
35. Describe the elements of a robot system
36. How do you justify the use of a robot
37. How do you classify robot
38. What are the different types of derives used in robot
39. What are the different type of control system used in robots
40. How do you specify a robot
41. Define FMS? Explain the components of FMS
42. What are the types of FMS? Differentiate between FMS and CIM.
43. What are the advantages and application of FMS environment?
44. Define AS/RS. What are its type? List the benefits of AS/RS.
45. Define AGV.
46. How is FMS optimized
47. What are different type s of data associated with FMS
48. How are jobs scheduled in FMS
49. How NC program control is effective in a FMS
50. Define fluid power.
51. List fields of application when fluid power can be used more effectively than other
sources.
52. What are the differences between pneumatic system and hydraulic systems?
53. Name the basic components required in a hydraulic system and pneumatic system.
54. Name the basic components required in a pneumatic system.
55. List the applications of fluid power in the automotive industry.
56. List the various hydraulic and pneumatic applications.
57. What are the primary functions of hydraulic fluids?

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 49


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

CRITICAL THINKING QUESTIONS

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 50


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 51


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 52


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 53


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 54


COMPUTER INTEGRATED MANUFACTURING & MACHINE LEARNING LAB B20ER0706

SCHOOL OF MECHANICAL ENGG. REVA UNIVERSITY Page 55

You might also like