SlideShare a Scribd company logo
Computer Numeric Control
TA202A 2017-18(2nd) Semester
Prof. J. Ramkumar
Department of Mechanical Engineering
IIT Kanpur
Computer Numeric Control
A system in which actions are controlled by the direct insertion of numerical data at some point. The
system must automatically interpret at least some portion of this data.
Computer Numerical Control (CNC) Machine
Advantages and Disadvantages of CNC
Advantages:
 High Repeatability and Precision e.g. Aircraft parts.
 Volume of production is very high.
 Complex contours/surfaces can be easily machined.
 Flexibility in job change, automatic tool settings, less scrap.
 More safe, higher productivity, better quality.
 Less paper work, faster prototype production, reduction in lead times.
Disadvantages:
 Costly setup, skilled operators.
 Computer programming knowledge required.
 Maintenance is difficult.
Open Loop Systems
Open loop systems have no access to the real time data about the performance of the system and therefore no
immediate corrective action can be taken in case of system disturbance.
Block Diagram of an Open Loop System.
Open loop system
Close Loop Systems
In a close loop system, feed back devices closely monitor the output and any disturbance will be
corrected in the first instance. Therefore high system accuracy is achievable.
Block Diagram of a Close Loop System
Close loop system
Three measures of precision:
1. Control resolution: Distance separating two adjacent addressable points
in the axis movement.
2. Accuracy: Maximum possible error that can occur between the desired
target point and the actual position taken by the system.
3. Repeatability: Defined as ±3σ of the mechanical error distribution
associated with the axis.
Precision in positioning system
Plot showing measures of precision
1. Point-To-Point Control in CNC:
Drilling of Three Holes in Flat Plate
Motion Control Systems
 System moves to a location and performs an operation at that location (e.g., drilling)
 Also applicable in robotics
2. Continuous path control in CNC
Profile Milling of Part Outline
 Also called contouring systems in machining
 System performs an operation during movement (e.g., milling and
turning)
Elements of a CNC system
 Input Device
 Central Processing Unit/ Machine Control Unit
 Machine Tool
 Driving System
 Feedback Devices
 Display Unit
Input Devices
Floppy Disk Drive
USB Flash Drive
Serial Communication
Ethernet communication
Conversational Programming
Central Processing Unit/ Machine Control Unit
 The CPU is the heart of a CNC system.
 It accepts the information stored in the memory as part program.
 This data is decoded and transformed into specific position control and velocity signals.
 It also oversees the movement of the control axis or spindle and whenever this does not
match with the programmed values, a corrective action as taken.
Machine Tool
 Most are made from high speed steel (HSS), tungsten carbide or ceramics.
 Tools are designed to direct waste away from the material.
 Some tools need coolant such as oil to protect the tool and work.
Driving System
 The requirement is that the driving system has to response accurately according to the programmed
instructions.
 The motor is coupled either directly or through a gear box to the machine lead screw to moves the
machine slide or the spindle.
Three types of electrical motors are commonly used:
1. DC Servo motor
2. AC Servo motor
3. Stepping motor as explained ahead.
1. DC Servo Motor
 The principle of operation is based on the rotation of an armature winding in a permanently energized
magnetic field.
 The armature winding is connected to a commutator, which is a cylinder of insulated copper segments
mounted on the shaft.
 DC current is passed to the commutator through carbon brushes, which are connected to the machine
terminals.
2. AC Servo Motor
 In an AC servomotor, the rotor is a permanent magnet while the stator is equipped with 3-phase
windings.

 The speed of the rotor is equal to the rotational frequency of the magnetic field of the stator, which
is regulated by the frequency converter.
3. Stepping Motor
 The stepper motor is known by its property to convert a train of input pulses (typically square wave pulses)
into a precisely defined increment in the shaft position.
 Each pulse moves the shaft through a fixed angle.
 Multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron.
 The electromagnets are energized by an external driver circuit or a micro controller. In that way, the motor can
be turned by a precise angle.
 To make the motor shaft turn, first, one electromagnet is given power, which magnetically attracts the
gear's teeth.
 When the gear's teeth are aligned to the first electromagnet, they are slightly offset from the next
electromagnet.
 This means that when the next electromagnet is turned on and the first is turned off, the gear rotates
slightly to align with the next one.
 From there the process is repeated. Each of those rotations is called a "step", with an integer number of
steps making a full rotation.
What does Stepper means?
 However, stepping motors are not commonly used in machine tools due to the following drawbacks:
 slow speed,
 low torque,
 low resolution
 easy to slip in case of overload.
Open Loop Positioning Systems
Stepper Motor calculations
 It uses a stepper motor to rotate the lead screw. A stepper motor is driven by series of
electrical pulses generated by MCU.
 For each pulse the motor rotates a fraction of revolution called Step Angle, it is given by
Where, ns = Number of step angles for the motor (an integer).
 If np is the pulses received by the motor then angle through which motor rotates is
Stepper Motor calculations
 Lead Screw is connected to the motor shaft through a gear box.
 Angle of the lead screw rotation taking the gear ratio into account is given by
rg = Gear ratio
= Am/A= Nm/ N
Nm= RPM of motor, N= RPM of lead Screw
The linear movement of worktable is given by
p = pitch of lead screw
Stepper Motor calculations
 Total number of pulses required to achieve a specified x-position increment is calculated by:
Where ,ns = 360/ α
Control pulses are transmitted from pulse generator at a certain frequency which drives the work table at
the corresponding velocity.
The rotational speed of lead screw depends on the frequency of
the pulse train
N = RPM of lead screw, fp = frequency of pulse train (Hz, Pulses/sec)
Equation (1)
Stepper Motor calculations
 The table travel speed in the direction of lead screw axis is determined by:
Where, Vt = Table travel speed (mm/min)
fr = Table feed rate (mm/min)
p= Lead screw pitch (mm/rev)
The required pulse train frequency to drive the table at a specified
linear travel rate by combining equations (1) and (2):
Equation (2)
Ball Lead Screws
 Ball lead screw is the heart of the drive system.
 Advantages of ball lead screw are:
 Precise position and repeatability
 High Speed capability
 Less Wear
 Longer life
Feedback Devices
Two types of feed back devices normally used are:
1. Positional Feed Back Devices
1.1 Linear Transducers - a device mounted on the machine table to measure the actual displacement of the
slide in such a way that backlash of screws; motors etc would not cause any error in the feed back data.
1.2 Rotary Encoders: a device to measure the angular displacement. It cannot measure linear
displacement directly so that error may occur due to the backlash of screw and motor etc.
2. Velocity Feedback Device
 The actual speed of the motor can be measured in terms of voltage generated from a tachometer mounted
at the end of the motor shaft.
 The voltage generated by the DC tachometer is compared with the command voltage corresponding to
the desired speed.
 The difference of the voltages is used to actuate the motor to eliminate the error.
Display Unit
 Interface between the machine and the operator.
The Display Unit displays:
 position of the machine slide
 spindle RPM
 feed rate
 part programs
 graphics simulation of the tool path.
Interpolation Methods
1.Linear interpolation
Straight line between two points in space
2. Circular interpolation
Circular arc defined by starting point, end point, centre or radius, and direction.
3. Helical interpolation
Circular plus linear motion
4. Parabolic and cubic interpolation
Free form curves using higher order equations
Circular Interpolation
Approximation of a curved path in NC by a series of straight line segments, where
tolerance is defined on only the outside of the nominal curve.
Circular Interpolation
Approximation of a curved path in NC by a series of straight line segments, where
tolerance is defined on both the inside and outside of thenominal curve.
Circular Interpolation
Approximation of a curved path in NC by a series of straight line segments, where
tolerance is defined on only the inside of the nominal curve.
Machine axes
Machine axes are established according to the industry standard report EIA RS - 267A
Axes configuration
 X axes moves from right to left as you face the machine
 Y axes move toward and away from you
 The Z axes is the spindle movement up and down spindle .
 A move toward work is Z(-Z)
 A move away from work is Z(+ Z)
Dimensioning Systems
CNC Programming
 Programming consists of a series of instructions in form of letter codes
Preparatory Codes:
 G codes- Initial machining setup and establishing operating conditions
 N codes- specify program line number to executed by the MCU
 Axis Codes: X,Y,Z - Used to specify motion of the slide along X, Y, Z direction
 Feed and Speed Codes: F and S- Specify feed and spindle speed
 Tool codes: T – specify tool number
Miscellaneous codes – M codes For coolant control and other activities
Programming Key Letters
O - Program number (Used for program identification)
N - Sequence number (Used for line identification)
G - Preparatory function
X - X axis designation
Y - Y axis designation
Z - Z axis designation
R - Radius designation
F – Feed rate designation
S - Spindle speed designation
H - Tool length offset designation
D - Tool radius offset designation
T - Tool Designation
M - Miscellaneous function
Table of Important G Codes
G00: Rapid Transverse
G01: Linear Interpolation
G02: Circular Interpolation, CW
G03: Circular Interpolation, CCW
G17: XY Plane, G18: XZ Plane,G19: YZ Plane
G20/G70: Inch units
G21/G71: Metric Units
G40: Cutter compensation cancel
G41: Cutter compensation left
G42: Cutter compensation right
G codes are instructions describing machine tool movement
G43: Tool length compensation (plus)
G44: Tool length compensation (minus)
G49: Tool length compensation cancel
G80: Cancel canned cycles
G81: Drilling cycle
G82: Counter boring cycle
G83: Deep hole drilling cycle
G90: Absolute positioning
G91: Incremental positioning
Table of Important M codes
M Codes are instructions
describing miscellaneous
functions like calling the tool,
spindle rotation, coolant on/off
etc.,
Programming Example
CNC Turning operation
N5 M12
N10 T0101
N15 G0 X100 Z50
N20 M3 S600
N25 M8
N30 G1 X50 Z0 F600
N40 Y-30 F200
N50 X80 Y-20 F150
N60 G0 X100 Z50
N70 T0100
N80 M5
N90 M9
N100 M13
N110 M30
Programming Example
CNC multi step Turning operation
Part program
N1 T0101 Tool no 1 with offset no 1 FANUC Control
N2 G97 S500 M03 Spindle rotation clockwise with 500 RPM
N4 G01 X25 G95 F0.3 Feed
N5 G01 Z-7.5 P1
N6 G01 X40 Z-15 P2
N7 G01 Z-25 P3
N8 G01 X60 Z-35 P4
N9 G40 G00 X200 Z100 Tool nose radius compensation cancel
CNC milling example
N5 G90 G71
N10 T1 M6
N15 G92 X-100 Y86 Z95
N20 G0 X0 Y0 S2500 M3
N25 Z12.5
N30 G1 Z-12.5 F150
N35 X-20 Y30
N40 G2 X10 Y100 R80
N45 G1 X140 Y60
N50 G2 X150 Y0 R50
N55 G1 X0 Y0
N60 G0 Z12.5
N65 G91 G28 Z0 M5
N70 G91 G28 X0 Y0
N75 M30
Programming Example
N2 G17 G71 G90 G94 G54
N4 T1 L90
N6 G00 Z5 D5 M3 S500 X20 Y90
N8 G01 Z-2 F50
N10 G02 X60 Y50 I0 J-40
N12 G03 X80 Y50 I20 J0
N14 G00 Z100
N16 M02
Sample program on drilling
N1 T16 M06
N2 G90 G54 G00 X0.5 Y-0.5
N3 S1450 M03
N4 G43 H16 Z1. M08
N5 G81 G99 Z-0.375 R0.1 F9.
N6 X1.5
N7 Y-1.5
N8 X0.5
N9 G80 G00 Z1. M09
N10 G53 G49 Z0. M05
N11 M30
THANK YOU

More Related Content

PPTX
Me761 a lecture-4 cnc
PPT
PPT ON BHEL HARIDWAR
PPTX
CNC principle & machining centre
PDF
Welcome to International Journal of Engineering Research and Development (IJERD)
DOCX
REPORT
PPTX
Stepper motors
PDF
IRJET- Design and Realisation of Antenna Control Servo System using Direct Dr...
PPTX
CNC PROGRAMMING FOR BEGAINER Part 1
Me761 a lecture-4 cnc
PPT ON BHEL HARIDWAR
CNC principle & machining centre
Welcome to International Journal of Engineering Research and Development (IJERD)
REPORT
Stepper motors
IRJET- Design and Realisation of Antenna Control Servo System using Direct Dr...
CNC PROGRAMMING FOR BEGAINER Part 1

Similar to Computer Numerical Control_2018.pdf (20)

PPT
Presentation200 (1).ppt
PDF
Lecture 2
PPTX
Cnc feed drives
PDF
CAM-2 NC CNC machines.pdf
PDF
report_komal
PPTX
nc and cnc dp
PPTX
LEARN CNC.pptx
PPTX
PMSM-Motor-Control : A research about FOC
PDF
Modeling of DC Motor and Choosing the Best Gains for PID Controller
PPTX
Ncmachine (1)
PPTX
Introduction to CNC machine and Hardware.
PDF
Speed Control of PMBLDC Motor using LPC 2148 – A Practical Approach
PPTX
CNC AND ITS COMPONENTS
PPTX
PPTX
CNC AND ITS COMPONENTS
PDF
F05613947
PDF
International Journal of Engineering Research and Development (IJERD)
PPT
Part programming for nc machines
DOCX
MODELLING OF DC SERVO MOTOR USING MATLAB-SIMULINK
PDF
L0364068072
Presentation200 (1).ppt
Lecture 2
Cnc feed drives
CAM-2 NC CNC machines.pdf
report_komal
nc and cnc dp
LEARN CNC.pptx
PMSM-Motor-Control : A research about FOC
Modeling of DC Motor and Choosing the Best Gains for PID Controller
Ncmachine (1)
Introduction to CNC machine and Hardware.
Speed Control of PMBLDC Motor using LPC 2148 – A Practical Approach
CNC AND ITS COMPONENTS
CNC AND ITS COMPONENTS
F05613947
International Journal of Engineering Research and Development (IJERD)
Part programming for nc machines
MODELLING OF DC SERVO MOTOR USING MATLAB-SIMULINK
L0364068072
Ad

Recently uploaded (20)

PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Construction Project Organization Group 2.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
DOCX
573137875-Attendance-Management-System-original
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
web development for engineering and engineering
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Welding lecture in detail for understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Well-logging-methods_new................
PPTX
Geodesy 1.pptx...............................................
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Automation-in-Manufacturing-Chapter-Introduction.pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Construction Project Organization Group 2.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
573137875-Attendance-Management-System-original
CYBER-CRIMES AND SECURITY A guide to understanding
Operating System & Kernel Study Guide-1 - converted.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Foundation to blockchain - A guide to Blockchain Tech
Lecture Notes Electrical Wiring System Components
web development for engineering and engineering
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Welding lecture in detail for understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems
Well-logging-methods_new................
Geodesy 1.pptx...............................................
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Ad

Computer Numerical Control_2018.pdf

  • 1. Computer Numeric Control TA202A 2017-18(2nd) Semester Prof. J. Ramkumar Department of Mechanical Engineering IIT Kanpur
  • 2. Computer Numeric Control A system in which actions are controlled by the direct insertion of numerical data at some point. The system must automatically interpret at least some portion of this data.
  • 4. Advantages and Disadvantages of CNC Advantages:  High Repeatability and Precision e.g. Aircraft parts.  Volume of production is very high.  Complex contours/surfaces can be easily machined.  Flexibility in job change, automatic tool settings, less scrap.  More safe, higher productivity, better quality.  Less paper work, faster prototype production, reduction in lead times. Disadvantages:  Costly setup, skilled operators.  Computer programming knowledge required.  Maintenance is difficult.
  • 5. Open Loop Systems Open loop systems have no access to the real time data about the performance of the system and therefore no immediate corrective action can be taken in case of system disturbance. Block Diagram of an Open Loop System.
  • 7. Close Loop Systems In a close loop system, feed back devices closely monitor the output and any disturbance will be corrected in the first instance. Therefore high system accuracy is achievable. Block Diagram of a Close Loop System
  • 9. Three measures of precision: 1. Control resolution: Distance separating two adjacent addressable points in the axis movement. 2. Accuracy: Maximum possible error that can occur between the desired target point and the actual position taken by the system. 3. Repeatability: Defined as ±3σ of the mechanical error distribution associated with the axis. Precision in positioning system
  • 10. Plot showing measures of precision
  • 11. 1. Point-To-Point Control in CNC: Drilling of Three Holes in Flat Plate Motion Control Systems  System moves to a location and performs an operation at that location (e.g., drilling)  Also applicable in robotics
  • 12. 2. Continuous path control in CNC Profile Milling of Part Outline  Also called contouring systems in machining  System performs an operation during movement (e.g., milling and turning)
  • 13. Elements of a CNC system  Input Device  Central Processing Unit/ Machine Control Unit  Machine Tool  Driving System  Feedback Devices  Display Unit
  • 14. Input Devices Floppy Disk Drive USB Flash Drive Serial Communication Ethernet communication Conversational Programming
  • 15. Central Processing Unit/ Machine Control Unit  The CPU is the heart of a CNC system.  It accepts the information stored in the memory as part program.  This data is decoded and transformed into specific position control and velocity signals.  It also oversees the movement of the control axis or spindle and whenever this does not match with the programmed values, a corrective action as taken.
  • 16. Machine Tool  Most are made from high speed steel (HSS), tungsten carbide or ceramics.  Tools are designed to direct waste away from the material.  Some tools need coolant such as oil to protect the tool and work.
  • 17. Driving System  The requirement is that the driving system has to response accurately according to the programmed instructions.  The motor is coupled either directly or through a gear box to the machine lead screw to moves the machine slide or the spindle. Three types of electrical motors are commonly used: 1. DC Servo motor 2. AC Servo motor 3. Stepping motor as explained ahead.
  • 18. 1. DC Servo Motor  The principle of operation is based on the rotation of an armature winding in a permanently energized magnetic field.  The armature winding is connected to a commutator, which is a cylinder of insulated copper segments mounted on the shaft.  DC current is passed to the commutator through carbon brushes, which are connected to the machine terminals.
  • 19. 2. AC Servo Motor  In an AC servomotor, the rotor is a permanent magnet while the stator is equipped with 3-phase windings.   The speed of the rotor is equal to the rotational frequency of the magnetic field of the stator, which is regulated by the frequency converter.
  • 20. 3. Stepping Motor  The stepper motor is known by its property to convert a train of input pulses (typically square wave pulses) into a precisely defined increment in the shaft position.  Each pulse moves the shaft through a fixed angle.  Multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron.  The electromagnets are energized by an external driver circuit or a micro controller. In that way, the motor can be turned by a precise angle.
  • 21.  To make the motor shaft turn, first, one electromagnet is given power, which magnetically attracts the gear's teeth.  When the gear's teeth are aligned to the first electromagnet, they are slightly offset from the next electromagnet.  This means that when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one.  From there the process is repeated. Each of those rotations is called a "step", with an integer number of steps making a full rotation. What does Stepper means?
  • 22.  However, stepping motors are not commonly used in machine tools due to the following drawbacks:  slow speed,  low torque,  low resolution  easy to slip in case of overload.
  • 23. Open Loop Positioning Systems Stepper Motor calculations  It uses a stepper motor to rotate the lead screw. A stepper motor is driven by series of electrical pulses generated by MCU.  For each pulse the motor rotates a fraction of revolution called Step Angle, it is given by Where, ns = Number of step angles for the motor (an integer).  If np is the pulses received by the motor then angle through which motor rotates is
  • 24. Stepper Motor calculations  Lead Screw is connected to the motor shaft through a gear box.  Angle of the lead screw rotation taking the gear ratio into account is given by rg = Gear ratio = Am/A= Nm/ N Nm= RPM of motor, N= RPM of lead Screw The linear movement of worktable is given by p = pitch of lead screw
  • 25. Stepper Motor calculations  Total number of pulses required to achieve a specified x-position increment is calculated by: Where ,ns = 360/ α Control pulses are transmitted from pulse generator at a certain frequency which drives the work table at the corresponding velocity. The rotational speed of lead screw depends on the frequency of the pulse train N = RPM of lead screw, fp = frequency of pulse train (Hz, Pulses/sec) Equation (1)
  • 26. Stepper Motor calculations  The table travel speed in the direction of lead screw axis is determined by: Where, Vt = Table travel speed (mm/min) fr = Table feed rate (mm/min) p= Lead screw pitch (mm/rev) The required pulse train frequency to drive the table at a specified linear travel rate by combining equations (1) and (2): Equation (2)
  • 27. Ball Lead Screws  Ball lead screw is the heart of the drive system.  Advantages of ball lead screw are:  Precise position and repeatability  High Speed capability  Less Wear  Longer life
  • 28. Feedback Devices Two types of feed back devices normally used are: 1. Positional Feed Back Devices 1.1 Linear Transducers - a device mounted on the machine table to measure the actual displacement of the slide in such a way that backlash of screws; motors etc would not cause any error in the feed back data.
  • 29. 1.2 Rotary Encoders: a device to measure the angular displacement. It cannot measure linear displacement directly so that error may occur due to the backlash of screw and motor etc.
  • 30. 2. Velocity Feedback Device  The actual speed of the motor can be measured in terms of voltage generated from a tachometer mounted at the end of the motor shaft.  The voltage generated by the DC tachometer is compared with the command voltage corresponding to the desired speed.  The difference of the voltages is used to actuate the motor to eliminate the error.
  • 31. Display Unit  Interface between the machine and the operator. The Display Unit displays:  position of the machine slide  spindle RPM  feed rate  part programs  graphics simulation of the tool path.
  • 32. Interpolation Methods 1.Linear interpolation Straight line between two points in space 2. Circular interpolation Circular arc defined by starting point, end point, centre or radius, and direction. 3. Helical interpolation Circular plus linear motion 4. Parabolic and cubic interpolation Free form curves using higher order equations
  • 33. Circular Interpolation Approximation of a curved path in NC by a series of straight line segments, where tolerance is defined on only the outside of the nominal curve.
  • 34. Circular Interpolation Approximation of a curved path in NC by a series of straight line segments, where tolerance is defined on both the inside and outside of thenominal curve.
  • 35. Circular Interpolation Approximation of a curved path in NC by a series of straight line segments, where tolerance is defined on only the inside of the nominal curve.
  • 36. Machine axes Machine axes are established according to the industry standard report EIA RS - 267A
  • 37. Axes configuration  X axes moves from right to left as you face the machine  Y axes move toward and away from you  The Z axes is the spindle movement up and down spindle .  A move toward work is Z(-Z)  A move away from work is Z(+ Z)
  • 39. CNC Programming  Programming consists of a series of instructions in form of letter codes Preparatory Codes:  G codes- Initial machining setup and establishing operating conditions  N codes- specify program line number to executed by the MCU  Axis Codes: X,Y,Z - Used to specify motion of the slide along X, Y, Z direction  Feed and Speed Codes: F and S- Specify feed and spindle speed  Tool codes: T – specify tool number Miscellaneous codes – M codes For coolant control and other activities
  • 40. Programming Key Letters O - Program number (Used for program identification) N - Sequence number (Used for line identification) G - Preparatory function X - X axis designation Y - Y axis designation Z - Z axis designation R - Radius designation F – Feed rate designation S - Spindle speed designation H - Tool length offset designation D - Tool radius offset designation T - Tool Designation M - Miscellaneous function
  • 41. Table of Important G Codes G00: Rapid Transverse G01: Linear Interpolation G02: Circular Interpolation, CW G03: Circular Interpolation, CCW G17: XY Plane, G18: XZ Plane,G19: YZ Plane G20/G70: Inch units G21/G71: Metric Units G40: Cutter compensation cancel G41: Cutter compensation left G42: Cutter compensation right G codes are instructions describing machine tool movement
  • 42. G43: Tool length compensation (plus) G44: Tool length compensation (minus) G49: Tool length compensation cancel G80: Cancel canned cycles G81: Drilling cycle G82: Counter boring cycle G83: Deep hole drilling cycle G90: Absolute positioning G91: Incremental positioning
  • 43. Table of Important M codes M Codes are instructions describing miscellaneous functions like calling the tool, spindle rotation, coolant on/off etc.,
  • 44. Programming Example CNC Turning operation N5 M12 N10 T0101 N15 G0 X100 Z50 N20 M3 S600 N25 M8 N30 G1 X50 Z0 F600 N40 Y-30 F200 N50 X80 Y-20 F150 N60 G0 X100 Z50 N70 T0100 N80 M5 N90 M9 N100 M13 N110 M30
  • 45. Programming Example CNC multi step Turning operation
  • 46. Part program N1 T0101 Tool no 1 with offset no 1 FANUC Control N2 G97 S500 M03 Spindle rotation clockwise with 500 RPM N4 G01 X25 G95 F0.3 Feed N5 G01 Z-7.5 P1 N6 G01 X40 Z-15 P2 N7 G01 Z-25 P3 N8 G01 X60 Z-35 P4 N9 G40 G00 X200 Z100 Tool nose radius compensation cancel
  • 47. CNC milling example N5 G90 G71 N10 T1 M6 N15 G92 X-100 Y86 Z95 N20 G0 X0 Y0 S2500 M3 N25 Z12.5 N30 G1 Z-12.5 F150 N35 X-20 Y30 N40 G2 X10 Y100 R80 N45 G1 X140 Y60 N50 G2 X150 Y0 R50 N55 G1 X0 Y0 N60 G0 Z12.5 N65 G91 G28 Z0 M5 N70 G91 G28 X0 Y0 N75 M30
  • 48. Programming Example N2 G17 G71 G90 G94 G54 N4 T1 L90 N6 G00 Z5 D5 M3 S500 X20 Y90 N8 G01 Z-2 F50 N10 G02 X60 Y50 I0 J-40 N12 G03 X80 Y50 I20 J0 N14 G00 Z100 N16 M02
  • 49. Sample program on drilling N1 T16 M06 N2 G90 G54 G00 X0.5 Y-0.5 N3 S1450 M03 N4 G43 H16 Z1. M08 N5 G81 G99 Z-0.375 R0.1 F9. N6 X1.5 N7 Y-1.5 N8 X0.5 N9 G80 G00 Z1. M09 N10 G53 G49 Z0. M05 N11 M30