Computer numerical control, or CNC, machines use a coordinate system and particular commands know as G and M codes to perform certain cutting functions. In order to program a CNC machine successfully, you must know what each command does and the basics of the coordinate plane that these machines use. With a little practice, some guidance and some crashes, you can learn how to program a CNC machine based on the specifications noted a part blueprint.
Learn the action of the machine by observing its movements while in process. In order to understand how to program, you must learn what the machine does related to the cutting, drilling and boring operations performed by a CNC machine. Watch parts being cut with existing programs and follow the commands on-screen to see which codes do what in relation to the process as it occurs.
Study the G and M code commands to get familiar with what each separate command does and how they must be arranged within the program for operations to process successfully. The M codes also denote certain commands such as coolant and air flow and must be placed appropriately within each program. Memorize the coordinate system of the machine you are using. Mills use X, Y and Z most commonly while lathes solely use X and Z. You must also never reverse numbers when associated with coordinates as they may cause a dangerous crash.
Write out programs by hand or in a word processing program, and have an experienced machinist look it over. Have him go over each line and have you explain what you intended to do and what would actually happen based on your program. Experienced machinists read G and M code quickly and precisely and this hands-on exercise can help you learn how to program without damage to the machine.
Write very simple programs that simply move the spindle around on a mill or move the tool turret on a lathe. This will introduce you to the commands needed in M and G code. The control reads each line individually, so you must put the necessary codes in order. For instance, the "coolant on" command must be made before the tool starts cutting, or the tool will overheat.
Use a computer-aided manufacturing (CAM) program to simulate the action of a program you have created. CAM programs can simulate your program with real-time tool changes so you can see how well you have done without having to worry about setting up a machine or crashing tools. You can analyze each tool path to make sure it was programmed properly.