# Know the Code… Students will participate in an activity that will help them understand CNC programming and how machines read programmed information. http://www.global-trade.com.

## Presentation on theme: "Know the Code… Students will participate in an activity that will help them understand CNC programming and how machines read programmed information. http://www.global-trade.com."— Presentation transcript:

Know the Code… Students will participate in an activity that will help them understand CNC programming and how machines read programmed information. CHSE-Lance Tatro 2010

Objectives for this lesson…
By the end of the lesson, students should be able to: Identify the values of typical CNC code used in simple programming. Know the roll of G code as used in Numerical control programming language Know the roll of M code as used in Numerical control programming language Interpret a simple code used for a CNC Mill CHSE-Lance Tatro 2010

Review… Q. How are points named?
Q. What is the first number, second, third? Q. Do you need to name all the points on your design? If so, why? CHSE-Lance Tatro 2010

Vocabulary Terms… G-Code, or preparatory code or function, are functions in the Numerical control programming language. The G-codes are the codes that position the tool and do the actual work M Codes control the overall machine, causing it to stop, start, turn on coolant, etc. S Code controls the speed of the spindle (cutter). CHSE-Lance Tatro 2010

M-Code (S) (*) M codes control the overall machine, causing it to stop, start, turn on coolant, etc. CHSE-Lance Tatro 2010

Partial list of M-Codes
M00=Program Stop (non-optional) M01=Optional Stop, machine will only stop if operator selects this option M02=End of Program M03=Spindle on (CW rotation) M04=Spindle on (CCW rotation) M05=Spindle Stop M06=Tool Change M07=Coolant on (flood) M08=Coolant on (mist) M09=Coolant off M10=Pallet clamp on M11=Pallet clamp off M30=End of program/rewind tape (may still be required for older CNC machines) CHSE-Lance Tatro 2010

Example…. An example of an M-Code might be
M01 This would indicate the “Optional Stop” function of the machine. This function will only take place if the operator selects to do so. CHSE-Lance Tatro 2010

G-Codes G Code (s), or preparatory code or function, are functions in the Numerical control programming language. The G-codes are the codes that position the tool and do the actual work. CHSE-Lance Tatro 2010

G-Codes for a typical Milling Machine
Positioning in Rapid G01 Linear Interpolation G02 Circular Interpolation (CW) G03 Circular Interpolation (CCW) G04 Dwell G07 Imaginary axis designation G09 Exact stop check G10 Program parameter input G11 Program parameter input cancel G12 Circle Cutting CW G13 Circle Cutting CCW G17 XY Plane G18 XZ Plane G19 YZ Plane G20 Inch Units G21 Metric Units G22 Stored stroke limit ON G23 Stored stroke limit OFF G27 Reference point return check G28 Automatic return to reference point G29 Automatic return from reference point G30 Return to 2nd, 3rd, 4th reference point G31 Skip function . G33 Thread cutting G34 Bolt hole circle (Canned Cycle) G35 Line at angle (Canned Cycle) G36 Arc (Canned Cycle) G40 Cutter compensation Cancel G41 Cutter compensation Left G42 Cutter compensation Right G43 Tool Length Compensation (Plus) G44 Tool Length Compensation (Minus) CHSE-Lance Tatro 2010

More G-Code… G60 Single direction positioning G61
Exact stop check mode G62 Automatic corner override G63 Tapping mode G64 Cutting mode G65 Custom macro simple call G66 Custom macro modal call G67 Custom macro modal call cancel G68 Coordinate system rotation ON G69 Coordinate system rotation OFF G70 Inch Units G71 Metric Units G72 User canned cycle G73 High-Speed Peck Drilling Cycle G74 Counter tapping cycle G75 G76 Fine boring cycle G77 G78 G79 G80 Cancel Canned Cycles G45 Tool offset increase G46 Tool offset decrease G47 Tool offset double increase G48 Tool offset double decrease G49 Tool Length Compensation Cancel G50 Scaling OFF G51 Scaling ON G52 Local coordinate system setting G53 Machine coordinate system selection G54 Workpiece Coordinate System G55 Workpiece Coordinate System 2 G56 Workpiece Coordinate System 3 G57 Workpiece Coordinate System 4 G58 Workpiece Coordinate System 5 G59 Workpiece Coordinate System 6 CHSE-Lance Tatro 2010

Example… G50 S2000 This code would indicate to the machine to set the spindle speed to 2000 RPMs (Revolutions Per Minute) G50 = Define the Spindle Speed S Spindle Speed of 2000 RPMs CHSE-Lance Tatro 2010

Supplementary Codes (Control)
X absolute position Y absolute position Z absolute 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 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 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 CHSE-Lance Tatro 2010

Example… G01 X-1.25 Y0.75 This would tell the machine that it will be moving in a linear movement to the coordinate -1.25,.75 on the X-Y grid. CHSE-Lance Tatro 2010

Forming The Letter “Z” G00 X0.1 Y0.75 Initial move to start point
G00 Z Plunge the Z axis into the material G01 X1.0 Y0.75 Linear move to point (1.0,.75) G01 X0.0 Y Linear move to point (0.0,-.75) G01 X1.1 Y Linear move to point (1.1,-.75) G00 Z0.5 Retract the Z axis M02 Stop the program CHSE-Lance Tatro 2010

Practice Code Line Code Description N01 M216 N02 G00 X20 Z20 N03
N02 G00 X20 Z20 N03 G50 S2000 N04 M01 N05 T0303 M6 N06 G96 S854 M42 M03 M08 N07 G00 X1.1 Z1.1 N08 G01 Z1.0 F.05 N09 X0.0 N10 G00 Z1.1 N11X1.0 Rapid feed up until the tool is standing at the finished OD N12 G01 Z0.0 F.05 N13 M05 M09 N14 G28 G91 X0 N15 M215 N16 M30 CHSE-Lance Tatro 2010

Line Code Description N01 M216 Turn on load monitor N02 G00 X20 Z20 Rapid move away from the part, to ensure the starting position of the tool N03 G50 S2000 Set Maximum spindle speed N04 M01 Optional stop N05 T0303 M6 Select tool #3 from the carousel, use tool offset values located in line 3 of the program table, index the turret to select new tool N06 G96 S854 M42 M03 M08 Variable speed cutting, 854 rev/min, High spindle gear, Start spindle CW rotation, Turn the mist coolant on N07 G00 X1.1 Z1.1 Rapid feed to a point 0.1" from the end of the bar and 0.05" from the side N08 G01 Z1.0 F.05 Feed in horizontally until the tool is standing 1" from the datum N09 X0.0 Feed down until the tool is on center - Face the end of the bar N10 G00 Z1.1 Rapid feed 0.1" away from the end of the bar N11X1.0 Rapid feed up until the tool is standing at the finished OD N12 G01 Z0.0 F.05 Feed in horizontally cutting the bar to 1" diameter all the way to the datum N13 M05 M09 Stop the spindle, Turn off the coolant N14 G28 G91 X0 Home X axis in the machine coordinate system, then home all other axes N15 M215 Turn the load monitor off N16 M30 Program stop, pallet change if applicable, rewind to beginning of the program CHSE-Lance Tatro 2010

Independent Practice For your assignment, you will use the coordinates developed in the “Developing CNC Code” lesson to write a complete code. You can use the practice code from this lesson and your coordinates from the previous lesson to complete the independent practice assignment. Look at the code we used for the letter “Z” and use that information to help you develop your code. CHSE-Lance Tatro 2010

Teacher Information Sheet
Description: Student will be introduced to CNC code writing, and learn to decipher a simple code using information learned in this lesson. Materials Needed: 1. Paper 2. Pencil 3. Computer W/PowerPoint 4. Worksheet/Handouts References: STANDARDS CTE/Technology & Engineering Education Standard: CTE/Manufacturing and Product Development Industry Sector Foundational Standards: 1.1 Mathematics 5.0 2.4 Listening and Speaking 4.0 Technology 4.1; 4.2; 4.5 5.0 Problem Solving and Critical Thinking 5.1; 5.2 10.0 Technical Knowledge and Skills 10.3; 10.5 Pathway Standards: C7.0; C7.3; C8.0 Teacher Performance Expectations: TPE 1, TPE2, TPE 3, TPE 5, TPE7, TPE 9, TPE10, TPE 12 SDAIE Strategies: modeling, bridging, contextualization CHSE-Lance Tatro 2010

Download ppt "Know the Code… Students will participate in an activity that will help them understand CNC programming and how machines read programmed information. http://www.global-trade.com."

Similar presentations