You are on page 1of 8

Computer Numerical Control Programming Basics

Definitions
CAD – COMPUTER-AIDED-DESIGN ■ Designing the part to be machined by CNC machine CAM – COMPUTER-AIDED-MANUFACTURING ■ Developing the toolpaths, feeds and speeds for the CNC Machines CNC – COMPUTER-NUMERICAL-CONTROLLED ■ Computer controlled machine controlled by a Machine Control Unit (MCU)

Programming Process
CAD - DRAW PART IN AUTOCAD OR AUTODESK INVENTOR Program Transfer – Load drawing file into MasterCAM

CAM – PROGRAM CUTTERS, TOOLPATHS, SPEEDS, FEEDS, ETC. IN MASTERCAM Post Processor - A software link in the CAD/CAM chain that communicates instructions from CAM to a CNC machine. . Program data transfer - PC to Machine Control Unit which runs the CNC machine CNC – MACHINE PART ON A CNC MACHINE USING INSTRUCTIONS FORM CAD/CAM PROGRAMMING

CNC Machine Types CNC Milling Center CNC Turning Center CNC Gantry Router .

. ● The tool or material moves. programming knowledge required ● Maintenance is difficult How CNC works: ● Controlled by G and M codes. or “NC”. tool movement. ● Feedback is provided by sensors (transducers) Closed loop? ● Tool magazines are used to change tools automatically. higher productivity. tool selection. skilled operators ● Computers.g. faster prototype production. In a CNC Machine functions and slide movements are controlled by motors using computer programs. and controls the slide movements by hand. ● Numerical control developed out of the need to meet the requirements of high production rates. better quality ● Less paper work. ● A numerical control. and cutting fluid flow. E. ● Each number or code is assigned to a particular operation. reduction in lead times Disadvantages: ● Costly setup. ● Larger machines have a machine control unit (MCU) which manages operations. depth of cut etc depending on type of job . ● These are number values and co-ordinates. ● Advantages: ● High Repeatability and Precision e. ○ G&M codes are automatically generated by the computer software. ● Tools can operate in 1-5 axes. an operator decides and adjusts various machines parameters like feed . uniformity and consistent part quality. ● Movement is controlled by a motor (actuators). Turbines ● Flexibility in job change. system controls many machine functions and movements which were traditionally performed by skilled machinists. ○ Typed in manually to CAD by machine operators. Aircraft parts ● Volume of production is very high ● Complex contours/surfaces need to be machined.What is a CNC Machine? CNC : Computer and Numeric Control: Conventionally.g. Programmed instructions are converted into output signals which in turn control machine operations such as spindle speeds. less scrap ● More safe. automatic tool settings.

rpm. . ● Speeds are the rate at which the tool operates e. harder materials need slower feeds and speeds.Tool Paths.g. material and quality of finish needed. . ● Rouging cuts remove larger amounts of material than finishing cuts. Expressed in IPM (inches per minute) ● Feeds and speeds are determined by cutting depth.g. ● Motion can be described as point to point. a feed rate. a center. a radius. ● Rapid traversing allows the tool or work piece to move rapidly when no machining is taking place Point to Point and Contour Tool Paths: Point to Point Toolpath Point to Point toolpaths cut following lines Contour ToolPath Contour toolpaths cut follow surfaces Linear Interpolation :( Point to Point) Linear interpolation consist of a programmed point linked together by straight lines Circular Interpolation: (Contour) Circular interpolation is the process of programming arcs and circles. or contouring. and a direction of movement. e. and Cutting Motions: ● Tool paths describe the route the cutting tool takes. ● Feeds are the rate at which the cutting tool and work piece move in relation to each other. Circular interpolation requires endpoints.

a part program is interpreted one command line at a time until all lines are completed.06789 MO3 N001 G01 X12345 Y6789 M03 Represents the sequence number of the operation Represents linear operation (tool movement) Will move the tool or table 1.Preparatory function X .Tool radius offset designation T .Tool length offset designation D .Program number (Used for program identification) N . which are also referred to as blocks.2345 Y. Each letter address relates to a specific machine function. N001 G01 X1.Spindle speed designation H . “G” and “M” letter addresses O .2345 in.6789 in.Sequence number (Used for line identification) G .CNC Programming Basics Block of Information: When running. along the Y axis Turns spindle on clockwise Commands.Z axis designation R .X axis designation Y .Tool Designation . are made up of words which each begin with a letter address and end with a numerical value.Y axis designation Z . a positive direction along the X axis Will move the tool or table 0.Radius designation F – Feed rate designation S .

Miscellaneous function G. CCW G17 XY Plane. CW G03 Circular Interpolation.G18 XZ Plane.M .G19 YZ Plane G20/G70 Inch units G21/G71 Metric Units G40 Cutter compensation cancel G41 Cutter compensation left G42 Cutter compensation right G43 Tool length compensation (plus) 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 . G00 – Rapid Movement G01 Linear Interpolation (movement) G02 Circular Interpolation.CODES (Preparatory Functions) which cause some movement of the machine table or head.

reset to start Important things to know: Feed rate and spindle speed ● Feed and Speed Codes: F and S. Flood.G91 Incremental positioning M-CODES (Miscellaneous) which turn ON or OFF different functions M00 Program stop M01 Optional program stop M02 Program end M03 Spindle on clockwise M04 Spindle on counterclockwise M05 Spindle stop M06 Tool change M08 Coolant on M09 Coolant off M10 Clamps on M11 Clamps off M30 Program stop.Initial machining setup and establishing operating conditions . Mist Tool Control: Tool and tool parameters ● Tool codes: T – specify tool number Programming consists of a series of instructions in form of letter codes Preparatory Codes: ● G codes.Specify feed and spindle speed Coolant Control: On/Off.

125 AT 5IPM) (FEED DIAGONALLY TO X3 Y2 AT 10IPM) (RAPID UP TO Z1) (RAPID OVER TO X0 Y0) (SPINDLE OFF) (PROGRAM END . IN INCHES) (TOOLCHANGE TO TOOL #3) (SPINDLE ON CW AT 1250RPM) (RAPID OVER TO X1 Y1) (RAPID DOWN TO Z0.Y.Z .125 F5 N35 X3 Y2 F10 N40 G00 Z1 N45 X0 Y0 N50 M05 N55 M30 (Program Number) (ABSOLUTE COORDINATE.Used to specify motion of the slide along X. Y.specify program line number to executed by the MCU Axis Codes: X. Z direction Program Example O1234 N5 G90 G20 N10 M06 T3 N15 M03 S1250 N20 G00 X1 Y1 N25 Z0.● N codes.1) (FEED DOWN TO Z-0.1 N30 G01 Z-0.