Academic journal article Technology and Engineering Teacher

# Understanding and Writing G & M Code for CNC Machines: Whether Computer-Aided Drafting, Robotics, Machining, or Design, Technology Students Benefit from Understanding and Utilizing Procedural and Conceptual Mathematics to Solve Problems

Academic journal article Technology and Engineering Teacher

# Understanding and Writing G & M Code for CNC Machines: Whether Computer-Aided Drafting, Robotics, Machining, or Design, Technology Students Benefit from Understanding and Utilizing Procedural and Conceptual Mathematics to Solve Problems

## Article excerpt

In modern CAD and CAM manufacturing companies, engineers design parts for machines and consumable goods. Many of these parts are cut on CNC machines. Whether using a CNC lathe, milling machine, or router, the ideas and designs of engineers must be translated into a machine-readable form called G & M Code that can be used to cut parts to precise dimensions and tolerances. Machine operators and engineers must be able to read the G & M Code that forms the basis of communicating with CNC machines. If there is a problem in manufacturing a part, the ability to read and write G & M Code is crucial to getting production back on line quickly. In this article, the context and skills of using mathematics in a technology laboratory are developed around a G & M Code activity.

G & M Code in STEM Classrooms

An activity described in this article will teach students how to write G & M Code for several parts. The activity helps students develop both a conceptual and procedural understanding of mathematics. Teachers will be able to address some of the technology, engineering, and mathematical content of STEM. In addition, this project may be considered an example of authentic integration of mathematics and technology education based on modeling, not drill and practice (Daugherty, Reese & Merrill, 2010).

The teaching of G & M Code has a clear match with both Standards for Technological Literacy: Content for the Study of Technology (STL) (ITEA/ITEEA, 2000, 2002, 2007) and Principles and Standards for School Mathematics (NCTM, 2011). The five standard benchmarks in Table 1 identify outcomes that graduating students should understand and be able to do to demonstrate their technological and mathematical literacy. By tying these abstract concepts to real manufacturing applications, the teaching of Cartesian coordinates and G & M Code can help students develop mathematical and visualization skills that might not otherwise be possible.

[ILLUSTRATION OMITTED]

Cartesian Coordinates and G & M Code

The first use of numerical control of industrial machinery occurred in the 1950s. In the 1960s, standardization of machine code was developed by the Electronic Industries Alliance (EIA). A final version, RS274D, was approved in February 1980 for use in the United States. The original data interchange medium was 64-character punched tape. This obsolete standard has been replaced by the use of computers and ASCII character bit patterns (Walker, 2000, Linuxcnc. org, 2011).

G & M code is based on a three-dimensional Cartesian coordinate system. The code is written in lines called blocks that are precisely formatted. The code tells the machine where to move the tool and what to do with it at specific points within the work (stock or part being machined). Many math concepts are used in determining those points in space. The three-dimensional Cartesian grid may be organized by absolute, relative, or polar coordinates. Absolute coordinates are based on the 0, 0, 0 point of origin, generally the lower left-hand corner of the work to be cut. Relative (incremental) coordinates measure distances from the last point. In AutoCAD, polar coordinates are measured by the distance and angle of degree from either the point of origin (absolute) or the last relative point (Zurflieh, 2005). When using polar coordinates, a ruler and protractor may be used to find estimated numbers, but geometry and trigonometry are used to find the precise points needed for accurate CNC cuts.

G & M Codes are written in lines of code that are formatted for specific machines. In almost all cases, the code is written as N (sequence number, i.e.; 001 - 100+), G (preparatory functions), X axis, Y axis, Z axis, F (Feedrate) and M (Misc commands or functions). Preparatory (G) functions are commands you need to tell the machine before it starts. For example, the machine will need to know if your numbers are in inches or metric, and if the coordinates are in absolute, relative, or polar. …

Search by...
Show...

### Oops!

An unknown error has occurred. Please click the button below to reload the page. If the problem persists, please try again in a little while.