63 G Codes and M Codes (28) of CNC: Part programming is not a language programming but it is a coded programming method used for writing the programs for manufacturing of given components. Part Programming uses standard codes and code means the name given for the program written for a standard measurement of the tool.
These codes are used in part programming.G-Codes Stands for General Purpose Codes and M-codes Stands for Miscellaneous or Machine Codes. Minimum 2 marks will come from this region. Therefore, In this article, I will be explaining about 20 G Codes and M Codes in a detailed manner.
G Codes and M Codes of CNC Part Programming:
20 G Codes and M Codes(14) of CNC Part Programming-Especially for GATE Exam is as follows.
1.G 00: Rapid Traverse: G00 Code stands for Rapid Traverse. It means that whenever the tool required to travel ideally without removing any material. It is required to travel at maximum possible speed, in such cases G00 Code will be used.
2.G 01: Linear Interpolation Whenever the tool required to travel in a straight-line path, G 01 Code will be used.
3. G 02: Circular Interpolation (Clockwise)
4.G 03: Circular Interpolation (Counter Clockwise) Whenever the tool is required in a contour path, G 02 or G 03 will be used.
5.G 04: Dwell Dwell indicates temporary stoppage of a tool in the machine for a specified duration.
6.G 05: Hold Hold indicates stoppage of a tool in the machine for Unlimited Duration. Ex: G04 F120 Here F120 indicates temporary stoppage duration in seconds.
7.G 08: Acceleration Whenever the machine is getting started, it has to start at the lowest velocity and reaches to the maximum velocity in a specified duration. For this, the G 08 Code will be used.
8.G 09: Retardation Whenever the tool is nearing to the destination, it has to reduce its velocity so that it is possible to stop the tool exactly whenever it is required. For this G 09 Code will be used. G 08 and G 09 are the Default codes used in part programming.
9.G 17: Movement of Tool in XY Plane
10.G 18: Movement of Tool in YZ Plane
11.G 19: Movement of Tool in ZX Plane
12.G 33: Thread Cutting with Constant Pitch.
13.G 34: Thread Cutting with Increasing Pitch.
14.G 35: Thread Cutting with Decreasing Pitch.
15.G 41: Tool Radius Compensation Left
16.G 42: Tool Radius Compensation Right
17.G 70: English Programming (Inches)
18.G 71: Metric Programming (mm)
19.G 90: Absolute Mode If each and every movement of the tool is indicated with reference to the only one single reference point called a machine reference point named as Absolute mode of Programming.
20.G 91: Incremental Mode. If the Present position of the tool is taken as a reference point for programming the next position of the tool called as Incremental mode of programming. These are the 20 G-Codes of CNC Part Programming.
Note: Even though incremental mode of programming is easy to write and modify but according to Indian conditions, we prefer to use absolute mode of programming only because during running of the program for producing the components if the power failure occurs, after restoring the power, it is very easy to identify where the program has got stopped if it is an absolute mode of program. The M Codes required in Part Programming are as follows which are very important for GATE Exam.
The above mentioned 20 codes are important for GATE point of view. I will write a few more but those may not be important for GATE Exam.
- G06 Spline interpolation
- G07 Hypothetical axis interpolation
- G11 Mirror image cancel
- G12 Mirror X-Axis values
- G13 Mirror Y-Axis values
- G14 Mirror XY Axis values
- G20 Inch input (equivalent to G70)
- G21 Metric input (equivalent to G71 )
- G28 Return to machine coordinate origin
- G29 Return from machine coordinate origin
- G43 Tool length compensation +
- G44 Tool length compensation –
- G49 Tool length compensation cancel
- G50 Scaling cancel
- G51 Scaling
- G53 Machine coordinate system selected
- G54 Work coordinate frame 1 selection
- G55 Work coordinate frame 2 selection
- G56 Work coordinate frame 3 selection
- G57 Work coordinate frame 4 selection
- G58 Work coordinate frame 5 selection
- G59 Work coordinate frame 6 selection
- G61 Exact stop mode (block by block)
- G64 Continuous mode (look-ahead)
- G73 Peck drilling cycle
- G74 Counter tapping cycle
- G76 Fine boring cycle
- G80 Canned cycle cancel
- G81 Drilling cycle, spot boring
- G82 Drilling cycle, counterboring
- G83 Peck drilling cycle
- G84 Tapping cycle
- G85 Boring cycle
- G86 Boring cycle
- G87 Back boring cycle
- G88 Boring cycle
- G89 Boring cycle
- G92 Work coordinates change
- G93 Inverse time feed
- G94 Feed rate per minute
- G95 Feed rate per revolution
- G98 Canned cycle initial level return
- G99 Canned cycle R point level return
These are the codes of CNC Part Programming. The Aim of speaking about these codes is to solve the problems related to the CNC programming in GATE Exam in an effective manner.
28 M Codes that GATE Student must know in CNC programming:
M codes play a vital role in the CNC Part Programming. Majorly M codes are used to write the main programs and Sub-Programmes in CNC Part Programming. Along with these M Codes, I will be writing about the Main Programmes and Subprograms which are used in CNC Part Programming. But before these, as the GATE Exam is coming by, you should have to focus on those things which are really important i.e. 14 M Codes that GATE Student must know in CNC Programming.
28 M Codes in CNC Part Programming:
However, there are 100 M codes starting from (M00 to M99). But only 14 M codes which are really important in GATE Exam are presented below.
1. M 00 – Program Stop = G05
2. M 01 – Planned Stop = G04
Ex: G 04 F & M 01 F
In both cases, the Stoppage duration was in secs.
3. M 02 – End of Main Program written without the use of Subprogram.
4. M 30 – End of Main Program written with the use of Subprogram.
5. M 17 – End of Sub Program.
6. M 03– Spindle Start (Clockwise)
Ex: M 03 S 500
Where S 500 represents the rpm of the spindle.
7. M 04 – Spindle Start (Counter Clockwise)
8. M 05 – Spindle Stop.
9. M O6 – Tool Change
Ex: M 06 T 13
Here T 13 Represents that the Existing Tool is replaced by T 13 and T can be up to T 32.
10. M 07 – Coolant Pump No.1 ON
11. M 08 – Coolant Pump No.2 ON
12. M 09 – Coolant Pump No.1&2 OFF
13. M 10 – Clamping (Tightening Chuck)
14. M 11 – De Clamp (Releasing Chuck)
These are the 14 M codes that a GATE Aspirant must know for getting good marks in GATE exam.
A few which are not so important for GATE Exam are as follows.
- M12 Clamp/Misc. on
- M13 Clamp/Misc. off
- M19 Oriented spindle stop
- M47 Return to program start
- M48 Bypass feed rate override cancel
- M49 Bypass feed rate override
- M90 User-defined DOS call 1
- M91 User-defined DOS call 2
- M92 User-defined DOS call 3
- M93 User-defined DOS call 4
- M94 User-defined DOS call 5
- M95 User-defined DOS call 6
- M98 Call sub-program
- M99 Return from sub-program
Now let’s discuss…
CNC Machine Parts: NC, CNC, Parts of CNC Machine, Applications:
If Each and every axis of a machine tool is controlled by using numbers or numerals, it is called as a Numerical Controlled Machine Tool. (NC Machine).
NC Machine Parts:
- MCU or CPU
- Drive Unit
- Feedback Devices
- Tape Reader system
- Very Few Manual Controls
All the components of NC and CNC machines are the same except the Tape Reader system and this can be replaced by Mini computer in CNC Machines.
Drive Unit is the stepper motor in NC machine whereas it is Servomotor in CNC Machines.
The Evolution of CNC Machine is due to the wear and tear of Tape reader due to its continuous usage and that can be replaced by writing program in G Codes and M codes which are discussed at the beginning.
All the other parts except Tape reader system is explained below under the explanation of CNC Machines.
Tape Reader System:
The set of instructions (program) are to be printed on the tape reader system so that when it is placed in the machine it can understand and do the operation.
In NC Machine program, one block of information means one complete instruction is given to the machine for traveling the axis from the present position to the next position.
For reading the instruction given in the punched paper tape, tape reader system will be used.
Light is provided on one side of the tape and light receiving sensors are placed on the other side.
When the tape is moving and stopping at some location where the holes are present, the light is passing and is incident on light receiving sensors.
Whatever the sensors which are receiving the light, they will be generating the electrical pulse or electrical energy and is to be sent to MCU so that it can drive any motor to do the operation.
What is a CNC Machine?
If Each and every axis of a machine tool is controlled by using a mini computer[which can run by means of Coding(G-Codes & M-Codes)] called as Computer Numerical Controlled Machine(CNC).
CNC Machine Parts:
- MCU or CPU
- Drive Unit (Servomotor)
- Feedback Devices
- Mini Computer
- Very Few Manual Controls
1.MCU:(Memory Controlled Unit)
MCU is working as a brain of human being i.e. MCU is taking input information from the input devices, analyze the data, and all these decisions will be implemented by using output devices available in the CNC machine.
The Input Information is in the form of the decimal system and as the machine can understand only the Binary System of information, a device is required in MCU to convert the decimal to binary and vice versa and that device are called as Arithmetic Logic Unit(ALU).
It is the device used for converting Electrical energy into Mechanical energy which is required for traveling the axis.
Ex: Electric motor.
Here we can use Servo Motor as the drive unit in CNC Machining.
It is also working similar to that of stepper motor but additionally, there is a quick action Braking System available in the motor so that whenever the power supply is getting stopped, the Braking System will be activated and stops all the moving parts.
Hence it is possible to get the high positional accuracy of the machine. Because the Servo Motors are not available at the time of development of the NC machine, the stepper motor can be used as a drive unit.
It is a Displacement Measuring Equipment used to measure the actual distance traveled by the Axis and giving it as a feedback to the MCU and the MCU will compare the distance traveled by the axis with the distance to be traveled and determines the difference in distance.
The MCU will calculate the no.of pulses and send it to the drive unit. This process continues in the form of a cycle.
Feedback Device→MCU→Drive Unit.
Due to the usage of the minicomputer, the program will be fed into the machine through a keyboard and kept in the memory of a mini-computer in the form of a software program.
Due to the above program, the operation will perform without the intervention of the operator and the dimensional accuracy is also high.
5.Very Few Manual Controls:
Even though the above parts are present in the CNC machine, still the manual interventions are required for switching ON and OFF, loading and unloading of the workpiece etc called as manual controls.
These are the CNC Machine Parts which are explained in a detailed manner.
Advantages of CNC Machines:
- Due to Servo Motors as drive units, the positional accuracy of the component produced is better.
- Feeding the program into the machine through the keyboard is very easier.
- Duplication of software program will be easier i.e.the software program can be copied into the floppy or Disks and can Copy into any number of Machines.
- Because of the software program, the life of a program is infinity.
- Design modifications can be easily incorporated into the existing program.
- Because of very few manual controls, complete automation of the CNC machine is possible.
This is the explanation of CNC Machine Parts: NC, CNC, Parts of CNC Machine, Servomotor, Applications in a detailed way along with G Codes and M Codes.
- 11 Points to know from Ultrasonic Machining Method
- 20 Points you must know between Water Jet Machining and Abrasive Water Jet Machining Processes
- Laser Beam Machining operation-Advantages, Dis-Advantages& Applications
Sharing is Caring. So please do Share…
The article is helpful…Please do share.