43
Computer Numerical Control By Dr. Mohammad Salah Mechatronics Engineering Department Hashemite University

Computer umerical Control

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer umerical Control

Computer Numerical Control

By

Dr. Mohammad SalahMechatronics Engineering Department

Hashemite University

Page 2: Computer umerical Control

٢

Dr. Mohammad Salah – Mechatronics

Outlines

What is a CNC Machine?Why CNC Machining?IntroductionCNC ComponentsTypes of CNC MachinesMotion ControlAbsolute and Incremental MotionCNC Programming

Page 3: Computer umerical Control

٣

Dr. Mohammad Salah – Mechatronics

What is a CNC Machine?

Numerical Control (NC) is a system in which actions are controlled by direct insertion of numerical data at some points. The system must automatically interpret at least some portion of this data.The abbreviation CNC stands for computer numerical control, and refers specifically to a computer "controller" that reads G-code instructions and drives a machine tool (i.e., a powered mechanical device typically used to fabricate components by the selective removal of material).Computer Numerical Control (CNC) is a numerical control system in which the data handling, control sequences, and response to input is determined by a computer system at the machine tool.

Page 4: Computer umerical Control

٤

Dr. Mohammad Salah – Mechatronics

What is a CNC Machine?

CNC is a form of programmable automation.Typical program contains coded alphanumeric data such as G01 X120 Y200The data represents relative positions between a cutting tool and a workpiece.CNC has touched almost every form of manufacturing process in one way or another.If you are working in manufacturing, it's likely that you are dealing with CNC on a regular basis.CNC is the process of manufacturing machined parts in a production environment

An alphanumeric code is a series of letters and numbers (hence the name) which are written in a form that can be processed by a computer

Page 5: Computer umerical Control

٥

Dr. Mohammad Salah – Mechatronics

What is a CNC Machine?

Page 6: Computer umerical Control

٦

Dr. Mohammad Salah – Mechatronics

What is a CNC Machine?

Page 7: Computer umerical Control

٧

Dr. Mohammad Salah – Mechatronics

What is a CNC Machine?

Page 8: Computer umerical Control

٨

Dr. Mohammad Salah – Mechatronics

What is a CNC Machine?

Page 9: Computer umerical Control

٩

Dr. Mohammad Salah – Mechatronics

What is a CNC Machine?

Page 10: Computer umerical Control

١٠

Dr. Mohammad Salah – Mechatronics

What is a CNC Machine?

Page 11: Computer umerical Control

١١

Dr. Mohammad Salah – Mechatronics

Why CNC Machining?

Provides improved Automation

Improves the quality and accuracy of manufactured parts (reduces operator fatigue)

Provides process repeatability

Provides flexibility to manufacture complex or otherwise impossible tasks (can implement 2D and 3D contours)

Provides easy programming (using G-code)

Reduces manufacturing costs

Relaxes the requirements for skilled operatorsHowever, CNC has relatively high initial cost and needs special

maintenance

Page 12: Computer umerical Control

١٢

Dr. Mohammad Salah – Mechatronics

Introduction

It is commonly referred to the style of machine that CNC is replacing as the conventional machine.Everyone involved in the manufacturing environment should be well aware of what is possible with these sophisticated machine tools.The design engineer, for example, must possess enough knowledge of CNC to perfect dimensioning and tolerancing techniques for workpieces to be machined on CNC machines.The tool engineer must understand CNC in order to design fixtures and cutting tools for use with CNCmachines.

Page 13: Computer umerical Control

١٣

Dr. Mohammad Salah – Mechatronics

Introduction

Quality control people should understand the CNCmachine tools used within their company in order to plan quality control and statistical process control accordingly.Production control personnel should be abreast of their company's CNC technology in order to make realistic production schedules.Managers, foremen, and team leaders should understand CNC well enough to communicate intelligently with fellow workers.CNC programmers, setup people, operators, and others working directly with the CNC equipment must have an extremely good understanding of CNC.

Page 14: Computer umerical Control

١٤

Dr. Mohammad Salah – Mechatronics

Introduction

Conventionally, an operator adjusts most parameters in the machine like feedrate and depth of cut depending on the nature of the task required and later on controls the slide movements by hand.In a CNC machine, functions and movements are controlled by motors using computer programs.The control unit then decides cutting speed, depth of cut, tool selection, coolant on/off, and tool paths…etc.The control unit issues commands in form of numeric data to motors that position tool/bed/parts accordingly.Programmed instructions are converted into output signals which in turn control machine operations such as spindle speed, tool selection, tool movement, and cutting fluid flow.The need to meet the requirements of high production rates, uniformity and consistent part quality was the reason behind developing the numerical control technology.

Page 15: Computer umerical Control

١٥

Dr. Mohammad Salah – Mechatronics

CNC Components

Machine tool

Actuators (motors)

Drive circuits to operate the actuators

Sensors to provide feedback signals

Conditioning circuits for the sensor signals

Controller (PC-based and microcontroller-based)

Mechanical body and parts

Page 16: Computer umerical Control

١٦

Dr. Mohammad Salah – Mechatronics

CNC Components

A machine tool is a machine, typically powered other than by human muscle (e.g., electrically, hydraulically, or via line shaft), used to make manufactured parts (components) in various ways that include cutting or certain other kinds of deformation.Examples of machine tools are:- Drill press- Lathe- Screw machines- Milling Machine- Saws- Shaper- Planner

Machine Tool

Page 17: Computer umerical Control

١٧

Dr. Mohammad Salah – Mechatronics

Types CNC Machines

Page 18: Computer umerical Control

١٨

Dr. Mohammad Salah – Mechatronics

Types CNC Machines

Page 19: Computer umerical Control

١٩

Dr. Mohammad Salah – Mechatronics

Motion Control

All forms of CNC equipment have two or more directions of motion, called axes.These axes can be precisely and automatically positioned along their lengths of travel.The two most common axis types are linear (driven along a straight path) and rotary (driven along a circular path).CNC machines allow motions to be commanded through programmed commands (generally speaking, the motion type could be rapid, linear, and circular)The axes to move, the amount of motion and the motion rate (feedrate) are programmable with almost all CNC machine tools.

Page 20: Computer umerical Control

٢٠

Dr. Mohammad Salah – Mechatronics

Motion Control

The drive motor is rotated a corresponding amount, which in turn drives the ball screw, causing linear motion of the axis.A feedback device confirms that the proper amount of ball screw revolutions have occurred.A CNC command executed within the control (commonly through a program) tells the drive motor to rotate a precise number of times.The rotation of the drive motor in turn rotates the ball screw. And the ball screw causes drives the linear axis.A feedback device at the opposite end of the ball screw allows the control to confirm that the commanded number of rotations has taken place.

Page 21: Computer umerical Control

٢١

Dr. Mohammad Salah – Mechatronics

Motion Control

A CNC

axis may be either a linear axis in which movement is in a straight line, or a rotary axis with motion following a circular path.

Page 22: Computer umerical Control

٢٢

Dr. Mohammad Salah – Mechatronics

Motion Control

All CNC controls allow axis motion to be commanded simply and logically by utilizing some form of coordinate system.The two most popular coordinate systems used with CNCmachines are the rectangular coordinate system and the polar coordinate system.By far, the most popular of these two is the rectangular coordinate system.Axes are broken into increments.Each linear axis of a CNC machine's rectangular coordinate system is broken into increments of measurement.In the inch mode, the smallest increment is usually 0.0001 inch.In the metric mode, the smallest increment is 0.001 millimeter.For rotary axes the increment is 0.001 degrees.

Page 23: Computer umerical Control

٢٣

Dr. Mohammad Salah – Mechatronics

Motion Control

Each axis within the CNC machine's coordinate system must start somewhere.The place where the vertical and horizontal base lines come together is called the origin point and in CNCmachines, this origin point is commonly called the program zero point (also called work zero, part zero, and program origin).The program zero point establishes the point of reference for motion commands in a CNC program. This allows the programmer to specify movements from a common location.If program zero is chosen wisely, usually coordinates needed for the program can be taken directly from the print.

Page 24: Computer umerical Control

٢٤

Dr. Mohammad Salah – Mechatronics

Motion Control

If the programmer wishes the tool to be sent to a position one inch to the right of the program zero point, X1.0 is commanded.If the programmer wishes the tool to move to a position one inch above the program zero point, Y1.0 is commanded.The control will automatically determine how many times to rotate each axis drive motor and ball screw to make the axis reach the commanded destination point.This lets the programmer command axis motion in a very logical manner.With the examples given so far, all points happened to be up and to the right of the program zero point.The two axes are labeled as X and Y.Though the names of each axes will change from one CNC machine type to another (other common names include Z, A, B, C, U, V, and W).

Page 25: Computer umerical Control

٢٥

Dr. Mohammad Salah – Mechatronics

Absolute and Incremental Motion

In the absolute mode (commonly specified by G90), the end points for all motions will be specified from the program zero point.For beginners, this is usually the best and easiest method of specifying end points for motion commands.In the incremental mode (commonly specified by G91), end points for motions are specified from the tool's current position, not from program zero.With this method of commanding motion, the programmer must always be asking "How far should I move the tool?“Generally speaking, this is the more unwieldy and difficult method of specifying motion and beginners should concentrate on using the absolute mode.

Page 26: Computer umerical Control

٢٦

Dr. Mohammad Salah – Mechatronics

Absolute and Incremental Motion

Page 27: Computer umerical Control

٢٧

Dr. Mohammad Salah – Mechatronics

Absolute and Incremental Motion

Another benefit of working in the absolute mode has to do with mistakes made during motion commands.In the absolute mode, if a motion mistake is made in one command of the program, only one movement will be incorrect.On the other hand, if a mistake is made during incremental movements, all motions from the point of the mistake will also be incorrect.To this point, our primary concern has been to show you how to determine the end point of each motion command.Doing this requires an understanding of the rectangular coordinate system.

Page 28: Computer umerical Control

٢٨

Dr. Mohammad Salah – Mechatronics

Absolute and Incremental Motion

However, there are other concerns about how a motion will take place (e.g., the type of motion (rapid, straight line, circular, etc.), and motion rate (feedrate)).Keep in mind that the CNC control must be told the location of the program zero point by one means or another.This is commonly done with a G92 (or G50) command at least at the beginning of the program and possibly at the beginning of each tool.

Page 29: Computer umerical Control

٢٩

Dr. Mohammad Salah – Mechatronics

CNC Programming

Almost all current CNC controls use a word address format for programming/commanding.Each command is made up of CNC words.Each CNC word has a letter address and a numerical value.The letter address (X, Y, Z, etc.) tells the control the kind of word and the numerical value tells the control the value of the word.Words in a CNC command tell the CNC machine what it is we wish to do at the present time.There are two programming methods:- Automatically Programmed Tool (APT) / G-Code- Computer Aided Machining (CAM) System

Page 30: Computer umerical Control

٣٠

Dr. Mohammad Salah – Mechatronics

CNC Programming

The preparatory function (G) specifies is commonly used to set modes.Miscellaneous functions (M words) allow a variety of special functions.Miscellaneous functions are typically used as programmable switches (like spindle on/off, coolant on/off, and so on).To a beginner, all of this may seem like CNCprogramming requires a great deal of memorization. But rest assured that there are only about 30-40 different words used with CNC programming. If you can think of learning CNC manual programming as like learning a foreign language that has only 40 words, it shouldn't seem too difficult.

Page 31: Computer umerical Control

٣١

Dr. Mohammad Salah – Mechatronics

CNC Programming

Almost all current model CNC controls allow a decimal point to be used within the specification of each letter address requiring real numbers.For example, X3.0625 can be used to specify a position along the X axis.On the other hand, some letter addresses are used to specify integer numbers.Examples include the spindle speed designator (S), the tool station designator (T), sequence numbers (N), preparatory functions (G), and miscellaneous functions (M).For these word types, most controls do NOT allow a decimal point to be used.

Page 32: Computer umerical Control

٣٢

Dr. Mohammad Salah – Mechatronics

CNC Programming

G-code is a common name for the programming language that drives NC and CNC machine tools. It was developed by EIA in the early 1960s, a final revision was approved in February 1980 as RS274D.G-code is also the name of any word in a CNC program that begins with the letter G, and generally is a code telling the machine tool what type of action to perform.Examples include (1) Rapid move controlled feed move in a straight line or (2) arc series of controlled feed moves (3) a workpiece cut (routed) to a specific dimension or (4) a decorative profile shape added to the edge of a workpiece.

Page 33: Computer umerical Control

٣٣

Dr. Mohammad Salah – Mechatronics

CNC Programming

G00 Fast positioning/Rapid TransverseG01 Linear interpolationG02 CW circular interpolationG03 CCW circular interpolationG10/G11 Data writing/Data write cancelG17 X-Y plane selectionG18 X-Z plane selectionG19 Y-Z plane selectionG20/G70 Programming in inchesG21/G71 Programming in mmG28 Return to home position

Common G-Code

Page 34: Computer umerical Control

٣٤

Dr. Mohammad Salah – Mechatronics

CNC Programming

G31 Skip function (used for probes and tool length measurement systems)G33 Constant pitch threadingG34 Variable pitch threadingG40 Tool radius compensation offG41 Tool radius compensation leftG42 Tool radius compensation rightG90 Absolute programmingG91 Incremental programmingG94/G95 Inch per minute/Inch per revolution feedG96/G97 Constant cutting speed (Constant surface speed)/Constant rotation speed (constant RPM)

Common G-Code

Page 35: Computer umerical Control

٣٥

Dr. Mohammad Salah – Mechatronics

CNC Programming

O - Program number (Used for program identification)

X- absolute X position

Y- absolute Y position

Z- absolute Z position

A- position (rotary around X)

B- position (rotary around Y)

C- position (rotary around Z)

U- Relative axis parallel to X

V- Relative axis parallel to Y

W- Relative axis parallel to Z

Page 36: Computer umerical Control

٣٦

Dr. Mohammad Salah – Mechatronics

CNC Programming

M- Code (another "action" register or Machine code(*)) (otherwise referred to as a "Miscellaneous function")

F- feed rate

S- spindle speed

N- line number

R- Arc radius or optional word passed to a subprogram/canned cycle

P- Dwell time or optional word passed to a subprogram/canned cycle

T- Tool selection

Page 37: Computer umerical Control

٣٧

Dr. Mohammad Salah – Mechatronics

CNC Programming

I- Arc data X axis

J- Arc data Y axis.

K- Arc data Z axis, or optional word passed to a subprogram/canned cycle

D- Cutter diameter/radius offset

H- Tool length offset

Page 38: Computer umerical Control

٣٨

Dr. Mohammad Salah – Mechatronics

CNC Programming

M00 Program stopM01 Optional program stopM02 Program endM03 Spindle on CWM04 Spindle on CCWM05 Spindle stopM06 Tool changeM08 Coolant onM09 Coolant offM10 Clamps onM11 Clamps offM30 Program stop, reset to start

Important M Codes

Page 39: Computer umerical Control

٣٩

Dr. Mohammad Salah – Mechatronics

CNC Programming

Two computer-based systems which impact the use of CNC technology are computer aided design (CAD) and computer aided manufacturing (CAM).A CAD system uses computers to graphically create product designs and models.These designs can be reviewed, revised, and refined for optimum end use and application.Once finalized, the CAD design is then exported to a computer aided manufacturing, or CAM, system.CAM systems assist in all phases of manufacturing a product, including process planning, production planning, machining, scheduling, management and quality control.

Page 40: Computer umerical Control

٤٠

Dr. Mohammad Salah – Mechatronics

CNC Programming

G-code files may be generated by CAM software such as Alphacam, Artcam, Edgecam, Featurecam, GibbsCAM, Mastercam, OneCNC, Plasma cam, Router-CIM, SmartCAM, Surfcam, etc.G-code is also output by specialized CAD systems used to design printed circuit boards.Such software must be customized for each type of machine tool that it will be used to program.

Page 41: Computer umerical Control

٤١

Dr. Mohammad Salah – Mechatronics

CNC Programming

Page 42: Computer umerical Control

٤٢

Dr. Mohammad Salah – Mechatronics

0

CNC Programming

It is required to turn a 1" diameter (X), 1" long (Z) part. Assume that a bar of material is in the machine and that the bar is slightly oversized in length and diameter and that the bar protrudes by more than 1“ from the face of the chuck.

Example

+X

+Z0

Page 43: Computer umerical Control

٤٣

Dr. Mohammad Salah – Mechatronics

CNC ProgrammingExample

DescriptionCodeLine

Turn on load monitorM216N01

Rapid move away from the part, to ensure the starting position of the toolG00 X20 Z20N02

Set Maximum spindle speedG50 S2000N03

Optional stopM01N04

Select tool #3 from the carousel, use tool offset values located in line 3 of the program table, index the turret to select new toolT0303 M6N05

Variable speed cutting, 854 ft/min, High spindle gear, Start spindle CW rotation, Turn the flood coolant on

G96 S854 M42 M03 M08N06

Rapid feed to a point 0.1" from the end of the bar and 0.5" from the sideG00 X0.5 Z1.1N07

Feed in horizontally until the tool is standing 1" from the datumG01 Z1.0 F0.05N08

Feed down until the tool is on center - Face the end of the barX0.0N09

Rapid feed 0.1" away from the end of the barG00 Z1.1N10

Rapid feed up until the tool is standing at the finished ODX1.0N11

Feed in horizontally cutting the bar to 1" diameter all the way to the datumG01 Z0.0N12

Stop the spindle, Turn off the coolantM05 M09N13

Home X axis in the machine coordinate system, then home all other axesG28 G91 X15 Z15N14

Turn the load monitor offM215N15

Program stop, pallet change if applicable, rewind to beginning of the programM30N16