Main Pages
Home
Main Tutorial
General Tutorial
Downloads
Installation Tutorial
 
The Project
About The Project
What is a Mechanical Tester?
What is a CNC Machine?
What is G-Code?
 
The Project Members
About Us
Contact Us
 
External Links
The Cooper Union
The Cooper Mechanical Testing Project
Our Wiki
 
Email us
CNCMechTest@gmail.com

 


General Tutorial: Programming: The CNC Machine



    Once you have established a physical connection between your component and your CNC machine, you must make the CNC machine move in a desirable way. Firstly, you must familiarize yourself with G-Code. G-Code is a simple, geometry based programming language that all industry standard CNC machines use to define movement paths. This tutorial will assume that you are familiar with some sort of programming language such as Python or C.

    Your CNC machine will move in one of three ways: it will either have a moving spindle, a moving table, or both. Regardless, the method for defining this movement is the same- it's all G-Code. Your CNC machine will have a proprietary software associated with it. This software will allow you to upload your own custom G-Code file to the CNC machine. The CNC machine will then move based on the path defined by your G-Code file. To make this possible, you must write a program in either Python or C or some other programming language which you are familiar with that generates a desired path in G-Code based on the parameters associated with your project.

    You may view the source code for our G-Code generating program by visiting our Downloads page and downloading the file called "G-Code Generating Program." It is a program written in Python that generates a G-Code path based on the parameters of the various tests required for our CNC mechanical testing project. This program will serve as a convenient example for your own G-Code generating program.

    There are other methods for moving your CNC machine, however they are much more difficult to execute. For example, you could gain access to the software drivers of your CNC machine. This would allow you to write a program that engages in real time communication with your CNC machine. In other words, you would be able to dictate the path of your CNC machine at any given time if the parameters for your project suddenly changed. This method, however, requires extensive information regarding your CNC machine, which may only be accessed from the manufacturer of the said CNC machine. Additionally this method requires more advanced programming knowledge and capabilities on behalf of the project members. Therefore, our team recommends that you follow our guidlines and simply write a program that generates the G-Code you need, and then upload that G-Code to the proprietary software of your CNC machine.