How to do cnc programing
Program the home information on the first line. This will tell the machine what type of material you are cutting and the maximum feed and speed rates to use for the cutting processes. This line will include some G code, but mostly M codes, which refer to specific mechanical functions such as coolant flow, stops and air flow.
Set the location of the first cut as well as the tool you will use for the operation. The program will use a logical course to bring the spindle to this location and start the cutting process. If the incorrect tool is in the spindle, the machine will recognize the tool change command and make the necessary changes.
Program the remaining cuts with the tool in the spindle for maximum efficiency. If you need to make a tool change, place it into the program on a separate line, as it will be easier for you or the operator to read. If there is a stop, type in the correct M code for that; simply tap the "Start" program button to continue.
Place tool change commands and X, Y and Z coordinates for drilling. You can dictate the amount of drilling in a single pass based on the material. The machine will have standard pecking, but that can be altered. Aluminum can have long pecking cycles, while steel needs short rapid pecking on drilling cycles to clear chips and prevent heat buildup.
Use G code to call up macro programs. Macro programs are preset cycles that reside within a program. These are often called canned cycles and are used for simple, repeated operations. You can also program tapping and boring cycles using G code.
Set the finish line on the program, which will call the spindle back to the home position. It will also stop the spindle and will stop the air or coolant using an M code. The finish line can also have information about repeating the program or starting over at a particular place. This cycle mid-start can help the programmer avoid repeating commands and saves time, as the machine will jump up to a previous operation and repeat it.