CNC Programming PDF
Document Details
Uploaded by Deleted User
Tags
Summary
This document is a comprehensive guide to Numerical Control (CNC) programming. It details the fundamental concepts, elements, and classifications of CNC systems. The document further explains types of programming, from manual to computer-assisted methods, along with the ISO programming language and its applications. The document also provides practical examples and exercises. A thorough understanding of CNC programming concepts and practices is vital in modern manufacturing.
Full Transcript
# Control Numérico (CN) ## Definition of Numerical Control (CN) - Numerical control (CN) is a form of automation programmable in which, based on a series of coded instructions (program), all actions of a machine or mechanism are governed by making this develop a sequence of operations and movement...
# Control Numérico (CN) ## Definition of Numerical Control (CN) - Numerical control (CN) is a form of automation programmable in which, based on a series of coded instructions (program), all actions of a machine or mechanism are governed by making this develop a sequence of operations and movements previously established by the programmer. - Appropriate for volumes of production that are low or medium because it is easier to write new programs than to make changes in processing equipment. ## Basic Elements of a CN System - **Program of instructions** consists of a series of sentences that are executed step by step, which directly control the processing equipment. The program is written in a special language (code). - **Numerical control (CN)** is the unit that must interpret the instructions contained in the program, convert them into signals that operate the machines and verify the result. - **Processing equipment** is the component that performs the useful work, and is made up of the work table, machine tools, motors, and controls to move them. ## Classification of Numerical Control (CN) - **System of reference:** Fixed/Floating. - **Trajectory control:** Point-to-point/Continuous. - **Type of drive:** Hydraulic, electric, or pneumatic. - **Control loop:** Open or closed. - **Control technique**: - Numerical control (CN)- Hardware - Computerized Numerical Control (CNC)-Software - Adaptive Numerical Control (CNA) ## Machine-Tool Characterization of CN - **Positioning mechanisms**: - **Actuators:** motors, valves, etc. - **Control systems:** Open loop, closed loop - **Measuring systems:** - **Sensors:** Induction, photoelectric, etc... - **Machine design:** - Precision and repeatability - Cooling, chip removal - **Tool change systems:** - Turret - Tool magazine - **Control techniques:** CN, CNC, CNA ## When is CN Useful? - Production is frequent and in small-medium size lots. - The geometry of the parts is complex. - Processing a part requires many operations. - Frequent design changes occur. - Precision and reliability requirements. - Production defects in a part result in high costs. - 100% inspection of the parts is required. ## Types of Programming - **Manual programming:** - Trajectories are calculated from 2D drawings. - The program is manually coded on a console or computer. - **Pseudo-assisted programming by computer:** - There is a CAD description of the part, but no CAM module exists. - Trajectory points are obtained from the CAD description. - The program is manually coded on a console or computer. - **Computer-assisted programming (CAM):** - Interface for comfortable manual generation of trajectories. - Possibility of automatically generating trajectories from the CAD description. - Detection of tool/part/support collisions. - Simulation of the machining process. - **Conversational programming:** - The operator is guided through questions asked by the system. - Appearance and methodology depend on the manufacturer. ## Manual Programming - **Steps required to create a program:** 1. **Analyze the part drawing to be manufactured:** Dimensions, tolerances and surface finishes, material 2. **Define the elementary operations:** - Starting data: machining to be performed on each plane - Result: elementary trajectories feasible by a tool - Generally straight or circular trajectories 3. **Selection of machines and sequencing of operations:** - Choosing the most suitable machines for each elementary operation - Minimizing machine changes is desirable 4. **Tool selection:** - For each elementary operation - Considerations: tool geometry, tolerances and surface finishes 5. **Definition of machining conditions:** Feed rate, cutting speed, depth of cut 6. **Program coding:** - Generally following the ISO standard for programming 7. **Performance testing:** - Simulation of machine tool movements on screen - Empty run (without part, only the movements of the machine are observed) - Test on a soft material model (wood, wax) - Test with corrected Z axis (less material is removed as needed) 8. **Program execution:** - Block by block execution (each operation is supervised before continuing) - Operation in automatic mode (normal operation) ## Manual Programming Flowchart - **Drawing:** Geometry, part material - **Preparation of work:** - Part clamping in the machine - Process definition - Tool selection - Selection of technological parameters (feed rate...) - **Program development:** - Part CAD geometry - Program definition with the CAD/CAM system - Post-processing of the program -> **Work plan:** Transmission of the CN program to the machine - **Drawing:** Work plan, CN program - **Shop floor:** - Graphic simulation - Empty run - Test on soft material -> **Order to launch the manufacturing** ## Axes and reference systems - **ISO Standards:** (ISO R841, RS267-1) - **Z axis:** - Direction of the spindle (provides cutting power) - If the machine has no spindle or its axis is variable, Z is perpendicular to the clamping surface of the piece. - Positive Z direction: away from the piece - **X axis:** - Perpendicular to the Z axis. - Horizontal translation axis. - Positive X direction: depending on whether Z is vertical or horizontal, according to various standards. - **Y axis:** - Selected so that it forms a right-handed triad with X and Z. - (X×Y=Z) - **Other axes:** - U, V, W: secondary axes, parallel to the principal axes (X, Y, Z). - P, Q, R: tertiary axes, parallel or not to the principal axes. - A, B, C: circular movement axes (rotation around X, Y, Z). ## Reference points considered: - **Machine reference point (M):** - Origin of machine coordinates. - Defined in a conventional way, depending on the machine axes - **Machine reference point (R):** - Reference point for tool changes. - M and R are fixed on each machine. - **Part reference point (W):** - Allows referencing the part with respect to the machine tool. - The programmer can choose it freely. - Offset: distance between M and W measured on each axis. - **Tool setting point (E):** - Tool point from which the tool tip dimensions are obtained. - It is necessary to know the tool geometry in order to correctly calculate the trajectories of point E. ## ISO programming language - **Header:** - Indication of the system used. - Part identification (drawing number). - Machining process identification (process sheet). - **Machining program:** - Definition of trajectories to be followed by the tool. - Numbered sentences (blocks). - Comments can be included to facilitate reading. - Sequential execution. - **End of program:** - Return to the initial block after execution or not. - Cancellation of preparatory functions ## ISO programming language format - **Word format** - Each program block (instruction for the machine tool) requires a series of data: - Final values for eache axis. - Feed rate and spindle speed. - Auxiliary data - Each data is specified using a word in the following format: - Data identifier (standard prefix: S is spindle speed, X is the 'x' position to be reached, etc.) - Data value. ## Block Sequence: - **N:** Block number - **G:** Preparatory functions - **X:** Final position on the X axis. - **Y:** Final position on the Y axis. - **Z:** Final position on the Z axis. - **F:** Feed rate. - **S:** Spindle speed - **T:** Tool number - **M:** Auxiliary functions - **EOB:** End of block ## Programming function examples (G codes): | Function | Description | Function | Description | |---|---|---|---| | G00 | Rapid traverse (non-machining) | G40 | Cancels tool radius compensation | | G01 | Linear movement | G41 | Tool radius offset (tool to the right) | | G02 | Circular movement (clockwise) | G42 | Tool radius compensation (tool to the left) | | G03 | Circular movement (counterclockwise) | G70| Programming units in inches | | G04 | Dwell | G71 | Programming units in mm | | G08 | Exponential acceleration curve | G74 | NC emulation, 1 quadrant | | G09 | Exponential deceleration curve | G75 | End of emulation (4 quadrants) | | G17 | Select XY plane for circular motion | G80 | | | G18 | Select XZ plane for circular motion | G81-89 | Canned cycles for drilling, etc. | | G19 | Select YZ plane for circular motion | G90 | Absolute programming | | | | G91 | Incremental programming | ## Circular motion example - **Objective**: Circular path - **Actual location**: 5000, 4000 - **Final location:** 7000, 2000 - **Center of the circle:** 5000, 2000 - **Example block:** - N0100 G02 X7000 Y2000 15000 J2000 - N0100 G03 X7000 Y2000 15000 J2000 ## Auxiliary Functions (M codes) | Function | Description | Function | Description | |---|---|---|---| | M00 | Program stop | M06 | Tool change | | M01 | Optional program stop (button) | M07 | Coolant 1 on | | M02 | End of program and return to the beginning | M08| Coolant 2 on | | M03 | Spindle on (clockwise) | M09 | Coolant off | | M04 | Spindle on (counterclockwise) | M30 | End of program | ## Other functions: - **F:** Feed rate. Can be written in two ways: - In mm/min (if the preparatory function G94 is active) - In mm/rev (if G95 is active) - **S:** Spindle speed. It can also be specified in two ways: - In m/min or constant cutting speed (if preparatory function G96 is active) - In rpm (if G97 is active) - **T:** Tool number. Generally, its position in the carousel is also indicated. ## Exercise: - Create the ISO code corresponding to the following figure. - **Solution**: | Line number | Code | Comment | |---|---|---| |10 | G90 G71 G94 G17 F300 S2000 | Absolute coordinates, programming in mm, feed rate in mm/min, XY work plane | | 20 | G00 X5 Y0 Z2 M03 | Rapid traverse to X=5, Y=0, Z= 2, spindle on clockwise | | 30 | G01 Z-2 M08 | Linear feed to Z=-2, coolant on| | 40 | G01 Y-10| Linear feed, work feed rate to Y=-10 | | 50 | X10 | Feed to X=10 | | 60 | G02 X30 Y10 120 J0| Circular interpolation to point X=30 Y=10, with center located at X=20 J=0 relative to the starting point | | 70 | G01 Y15 | Linear feed to Y=15 | | 80 | X20 | Feed to X=20 | | 90 | G02 X15 Y20 10 J5 | Circular interpolation to point X=15 Y=20, with relative center at X=0 Y=5 | | 100 | G01 X-15 | Linear feed to X=-15 | | 110 | G02 X-20 Y15 1-5 J0 | Circular interpolation to point X=-20 y=15 with center at X=-5 Y=0 measured from the starting point | | 120 | G01 X-30 | Linear feed to X=-30 | | 130 | Y10 | Feed to Y=10 | | 150 | G01 X-5 | Feed to X=-5 | | 160 | Y0 | Feed to Y=0 | | 170 | G02 X5 Y0 15 J0 | Circular feed to X=5 Y=0, with relative center at X=5 J=0| | 180 | G01 Z2 M09 | Linear feed to Z=2, coolant off | | 190 | G00 Z60 M05 | Rapid traverse to Z=60 and spindle stop | | 200 | M30 | End of program | ## Fixed Cycle Functions - **Fixed cycles for lathes:** - G68: Facing in the X axis. - G69: Facing in the Z axis. - G81: Turning of straight sections. - G82: Facing of straight sections. - G84: Turning of curved sections. - G85: Facing of curved sections. - G86: Longitudinal threading. - G87: Front threading. - G88: Grooving in the X axis. - G89: Grooving in the Z axis. - **Fixed cycles for machining centers:** - G79: Definable by the user. - G81: Drilling. - G82: Drilling with time control. - G83: Deep drilling. - G84: Tapping with a tap. - G85: Boring. - G86: Drilling with fast retraction. - G87: Rectangular pocket. - G88: Circular pocket. - G89: Drilling with slow retraction. ## Parametric Programming - **Parameters:** Replace numerical values. They are equivalent to variables. - A single program is valid for various applications. - It is even possible to introduce branching in programs - **Parameter definition:** - They are usually named as Rx, where x is a number that identifies the variable. - An example of a parameter definition block would be the following: - N37 R1=10 R29=-20.05 R5=50 - **Using previously defined parameters:** - The direction assumes the value that the parameter has at that time. - Example: - N38 Z=R5 X=-R29 - **Operations with parameters:** - Depending on the controllers, more or less complex operations are allowed. - Example: - N39 Y=10+R1 X=-R29/2 Z=R1+R5 # RoutoLink GUI ## Quick Guide for using the RouterLink Interface - **Main screen:** - **Menu base:** mm, FRESTAS, CN? - **F1:** Reset (keyboard) - **F9:** Message viewer - **Shift + F9:** Input/output viewer - **F10:** Help manual - **Shift + F10:** Calculator - **F11:** Activate/deactivate graphics modes. - **Shift + F11:** Exit. - **F2:** Load the programs generated in F7 for execution on the machine. - **F3:** Load the list generated in Shift + F7 for execution on the machine. - **F4:** Manual mode of axis movement. - **F5:** Zero point search. - **F6:** MDI semiautomatic that allows direct dialogue with the machine. - **F7:** Program editor. - **Shift + F7:** MIX file editor. - **F8:** Services (edit equipment and machine settings). - **F2:** Automatic mode - **F3:** MDI mode - **F4:** Tool change, tool change (for drilling only) - **F8 Services screen:** - **F2:** Create backups - **F3:** Equipment editor (allows access to TLG tool files) - **F4:** Access machine configuration - **F5:** Change language. - **F6:** Change date and time. - **F7:** Format floppy disk - **F8:** Job statistics. - **F3 Equipment editor screen:** - **F2:** Open the file. - **F3:** Move or rename a file. - **F4:** Copy - **F5:** Delete. - **F6:** Create a directory. - **F7:** Activate equipment. - **Fixed Tools (Drills) screen:** - **Data:** Drill length and drill diameter. - **F3:** View the equipment. - **F7:** Copy the tool from another. ## Fixed Tools- Drills - **Types:** - L (lance) - P (flat) - S (countersink) - Empty: Not specified ## Other Groups of Tools (Cutters) - **Data:** Cutter length, cutter diameter, revolutions, and storage location. - **F3:** View the equipment. - **F7:** Copy the tool from another. ## Program Editor screen: - **F4:**Stop visualization. - **Ctrl +:** Activate zoom. - **Ctrl -:** Deactivate zoom. ## Program Editor screen (Active Graphic Mode) - **F3:** Enter the text editor mode. - **F4:** View a list of instructions in insert mode. - **F5:** Delete line. - **F6:** Insert or close a line. - **F7:** Visualize the drawing. ## Program Editor screen (Selecting a Block) - **F3:** Cut the selection. - **F4:** Copy. - **F5:** Delete. - **F6:** Paste. ## MDI screen (Semi-automatic): - **F2:** Dialogue with the machine (ISO codes). - **F3:** Dialogue with the drilling unit. - **F4:** Dialogue with the milling unit. ## MDI - Milling unit - **M51:** Manual tool change. - **1st line:** Tool holder position. - **2nd, 3rd lines:** Position indicators. ## MDI – Drilling unit - Only the first icon is used by entering the drill number to activate (enter and green) - To deactivate (raise the drill) enter zero (enter and green). ## Automatic Programming screen: - **F2:** Load the program. - **F3:** Allow the program to repeat. - **F4:** Cancel the automatic mode. - **F5:** Visualize the path while running. - **F6:** Bar positioning (not available). - **F7:** Internal test piece (internal simulation). ## Importing DXF files - To import a DXF file, follow the following steps: - In Autocad, convert everything to polylines and make sure all entities are situated at the drawing origin. - Export the drawing as an AutoCAD 12 DXF file to drive C: in the XILOG3, PGM folder. - Minimize Autocad and open Xilog3. - Enter the Services screen (F8). - Go to the parameters editor (F4). - Configure the CAD parameters, including the desired tools, depth, inputs/outputs, and panel measurements (all entries are in each "GO" entry). - Save the information (F2). - Launch the program editor (F7). - Open the DXF file (F7). If you can't open it, copy the file to drive C: (F4) or to disk (F4). ## General Data screen: - **Data:** General data. - Ensure the data is correct and that the “equipment” is filled with “FRESAS” (or a different one, if necessary) from the TLG files (services screen: F8, + F3) for loading tools. ## General Program screen: - **F3:** Change data in each profile. - **F4:** Internal general replanning with changes made in F3. - **F5:** Delete a line from a profile (not recommended) - **F6:** Change the direction of the profile. - **F7:** Change plan data. - **F8:** Change profile execution order. - **Shift + F4:** Symmetries for the program. - **Shift + F5, Shift + F6:** Interpolations in a profile. - **Shift + F7, Shift + F8:** Profile to profile changes. ## Program in Automatic Mode - Once the program is edited, the automatic program needs to be executed. - To execute the program, click F2, select the desired program, and click F2 again to access the general options screen to define elements like name, dimensions, field, repetitions, empty, location of the piece, and equipment. - Click F6 to access the automatic mode screen. Ensure the piece is properly clamped, then launch the machine using the green button. - **F2:** Allows you to load another program in a different field - **F3:** Modify the number of parts to create. - **F4:** Interrupt the work. - **F5:** Displays the work in real time. - **F6:** Start machine operation. ## Control systems - **Point-to-point:** Uses fixed points to define the path, and the machine only moves to those points. - **Paraxial:** Combines linear and circular movements, allowing for more efficient and precise paths. - **Contour:** Continuous and synchronized coordinated movements, allowing for complex shapes and detailed paths. ## Machine Programming Language - **Language of Programming** - **Program of a panel:** A program is a sequence of blocks with instructions that describe a work cycle on a panel. It is stored in PGM format and translated into ISO language when executed on the machine. - **Instructions** - **Header:** Contains the main data of the panel and its position on the machine for its execution. It is mandatory. - **Operational Instructions:** They affect the meaning of all coordinates (x, y, z) programmed in the subsequent operational instructions. For example, instruction "C" referencing a tool corrector, with a value of "2" makes all instructions that order a tool movement from here on, to be to the left of the elaborated profile. This is cancelled with another instruction "C". - **Modal Instructions:** - **C:** Origin displacement - **F:** Work face - **C:** Tool correction - **IX:** Incremental value in X - **IY:** Incremental value in Y - **SX:** Mirror in X - **SY:** Mirror in Y - **PL:** Plane inclination - **SET:** Parameter of the system - **Operational Instructions:** They define the effective jobs in the piece. Each one corresponds to a movement or preparation for that movement. - **Installation, input, output instructions:** - **G0/XG0:** Starts cutting - **GIN/XGIN:** Automatic entry - **GOUT/XGOUT:** Automatic exit - **GREP/XGREP:** Repeats a profile - **N/XN:** Null operation - **Basic/Complete drilling Instructions:** - **B/XB:** Drilling - **BO/XBO:** Optimized drilling - **Linear milling Instructions:** - **G1:** Straight line - **XL2P:** Straight line - **XSP:** Two straight line segments (broken line) - **Contour milling Instructions:** - **G2:** Clockwise circular milling. - **G3:** Counterclockwise circular milling. - **G5/XG5:** Tangent to previous motion. - **ATP/XATP:** Arc tangent to previous motion. - **XA2P:** Arc for two points. - **XA3P:** Arc for three points. - **XAR:** Arc given the radius. - **XAR2:** Arc given the radius 2. - **GCHA:** Chamfer connection between previous and subsequent movements. - **XLR:** Chamfer connection. - **GFIL:** Circular connection between anterior and posterior movements. - **XLU:** Circular connection. - **XRAT:** Tangent arc segment. - **XTAR:** Arc tangent segment. - **XEA:** Ellipse arc. ## Programming Instructions List - **Graphical Instructions:** Any instruction whose name begins with an "X" allows for programming expressions. - **Program Flow Management Instructions:** Execute an instruction only if the expression evaluates to true. - **Header:** Header instructions are mandatory, and require information to be provided for the panel dimensions, work area, file name, equipment type, tool number, etc. - **Tool Change:** The tool change instruction is typically indicated with the tool number (T), and can be programmed as a separate line or embedded within the program.