How Do CNC Engineers Use ChatGPT To Implement Automated Programming?
Technology is advancing and times are changing. We know very well that with the deep learning of artificial intelligence(AI) technology, based on big data storage and computing, knowledge mining and innovation, three-dimensional display of machine vision, speech recognition, natural language to computer programming language processingd With the improvement of capabilities in all aspects, this will streamline the work process for humans, thereby greatly improving work efficiency! Our manufacturing industry may also be full of possibilities for change. For this reason, our JXGC technicians have learned in depth how to use Chat GPT and tried to use artificial intelligence ChatGPT to produce some feasible automated programming experiences for us.
We all know that CNC numerical control programming machining center is based on the underlying principles of computer code programming to achieve mechanized cutting and cutting of a workpiece to achieve the purpose of processing. So what we are sharing today is our engineer Mr. Qing, who has twenty years of programming experience. The following is the summary of the Q&A narrated by Mr. Engineer Qing:
Hana: Mr. Qing, how long have you been studying the application of artificial intelligence ChatGPT to CNC programming technology?
Qing: This has always been our dream. Before openOI released ChatGPT, I was thinking that it would be great if I could directly tell my computer using my natural language and let it automatically generate programming formulas. When openOI released ChatGPT, I just tried to understand whether it could really answer a question like a human being, as I expected, and I found that its performance was excellent. So I started trying to apply the professional knowledge used in my work and train it, because I expected him to understand what I wanted, so I have been using Chat GPT to apply CNC programming technology.
Hana: Is there anything you need to pay attention to when using ChatGPT?
Qing: Of course there are things you need to pay attention to. Although artificial intelligence is very intelligent, it is not able to understand what you want from the beginning. In our CNC programming technology, our engineers’ daily work is to think about the processing of a workpiece. We need to optimize the processing strategy and be vigilant about the workpiece. Regarding processing accuracy, each customer’s workpiece accuracy requirements are different. Similarly, as members of the company, we should also think about how to reduce maintenance and processing costs for the company. During the machining process, we are very concerned about the parameters of the machining process, as well as the machine tool, tool movement, and tool magazine changes. The shape characteristics of our workpieces will also affect our choice of different CNC processes to achieve processing purposes. ChatGPT's automated programming is mainly to reduce the difficulty of processing workpieces with complex structures, such as special shapes or large curved surfaces, and high precision requirements, because we inject our experience and habits into ChatGPT and let it imitate what we have done. The simulation of trajectories and the arrangement of tool paths are carried out based on the processing ideas. Of course I would check that its output is correct and that it is trustworthy.
Hana: Can you show me your commands and ChatGPT session results?
Qing: Of course. Please see the picture and table below.
Qing’s Order |
ChatGPT’s Token |
To write a 100 mm × 100 mm square milling program, first, we need to set the tool and processing parameters. We assume that an end mill is used with a diameter of 10 mm, a length of 75 mm, a rotation speed of 2500 r/min, a feed rate of 100 mm/min, and a cutting depth of 5 mm.
Then, establish the workpiece coordinate system and programming origin. We can use the workpiece center as the programming origin and establish a workpiece coordinate system centered on the programming origin. Next, we can write the program. It is assumed here that FANUC programming instructions are used based on G code. |
To write a 100 mm × 100 mm square milling program using FANUC programming instructions based on G code, you could use the following steps:
1. Define the tool and processing parameters as mentioned in your question.
2. Establish the workpiece coordinate system and programming origin by setting the workpiece center as the origin of the work coordinate system (X0, Y0).
3. Start the program by executing the G00 G01 G40 G90 G91 G0 Y100 commands in sequence. This will set the tool axis to the X-axis, move it 100 mm in the positive Y direction, set the tool offset to zero, and switch to the work coordinate system.
4. Execute the G17 G43.17 F100 commands to select the end mill as the cutting tool, specify its diameter, and set its feed rate to 100 mm/min.
5. Execute the G40 G94 commands to turn on cutting and to set the positioning mode to absolute.
6. Execute the G17 G43.17 F5.00 commands to select a 5 mm cutting depth.
7. Execute the G00 G01 G00 Z0.5 commands in sequence to move the tool down 0.5 mm to the workpiece surface, retract it 0.5 mm, and home it.
8. Execute the G01 G00 Y100 commands to move the machine table 100 mm in the positive Y direction with the end mill cutting in place.
9. Execute the G00 G01 X100 Y100 commands to move the machine table 100 mm in the positive X direction with the end mill cutting in place.
10. Execute the G00 G01 G38.5 F100 commands to move the machine table 100 mm at a feed rate of 100 mm/min to perform roughing.
11. Execute the G01 G38.5 F100 commands to move the machine table 100 mm at a feed rate of 100 mm/min to perform finishing.
12. Execute the G00 G01 Y100 commands to move the machine table 100 mm down with the end mill cutting in place.
13. Execute the G00 G01 X100 Y100 commands to move the machine table 100 mm to the right with the end mill cutting in place.
14. Execute the G00 G01 G38.5 F100 commands to move the machine table 100 mm at a feed rate of 100 mm/min to perform finishing.
15. Execute the G00 G01 Y100 commands to move the machine table 100 mm down with the end mill cutting in place.
16. Execute the G00 G01 X100 Y100 commands to move the machine table 100 mm to the right with the end mill cutting in place.
17. Execute the G00 G01 G38.5 F100 commands to move the machine table 100 mm at a feed rate of 100 mm/min to perform finishing.
18. Execute the G00 G01 Z0.5 commands to move the tool up 0.5 mm.
19. Execute the G01 G00 X100 Y100 commands to move the machine table 100 mm to the left with the end mill cutting in place.
20. Execute the G00 G01 Z0.5 commands to move the tool up 0.5 mm.
21. Execute the G01 G00 X100 Y100 commands to move the machine table 100 mm to the left with the end mill cutting in place.
22. Execute the G00 G01 G40 G90 G91 commands in sequence to switch off cutting and tool offset, return to the initial coordinate system, and retract the tool. 23. End the program by executing the G43 P1 commands. |
Hana: Do you have anything else to add about ChatGPT’s CNC programming technology?
Qing: Yes, our overall use of ChatGPT is very smooth, but it still has not reached our ideal. Maybe we need to continue training it to make it more helpful for CNC programming! We also look forward to many CNC colleagues joining us to train ChatGPT and discuss this new technology together!