Well      10/10/2023

How to create a control program for a CNC machine. Creating programs for CNC machines Drawing up a CNC control program from a drawing

Any owner of a CNC machine faces the question of choosing software. The software used for such technological equipment must be multifunctional and easy to use. It is advisable to purchase licensed software products. In this case, programs for CNC machines will not freeze, which will increase the efficiency of production processes.

Set of software for CNC machines

The choice of software largely depends on the type of equipment and the tasks that the user intends to solve. However, there are universal programs that can be used for almost all types of CNC machines. The most widely used products are:


1. . This software package was developed for the modeling and design of products manufactured on machine tools. It is equipped with the function of automatically generating models from flat drawings. The ArtCAM software package contains all the necessary tools for designing creative products and creating complex spatial reliefs.
It is worth noting that this software allows you to use three-dimensional templates to create designs for future products from simple elements. In addition, the program allows the user to insert one relief into another, as in a two-dimensional drawing.


2. Universal control program LinuxCNC. The functional purpose of this software is to control the operation of a CNC machine, debug a part processing program, and much more.
A similar software package can be used for machining centers, milling and lathes, and thermal or laser cutting machines.
The difference between this product and other software packages is that its developers partially combined it with the operating system. Thanks to this, the LinuxCNC program has advanced functionality. You can download this product completely free of charge on the developer’s website. It is available both as an installation package and as a LifeCD.
The user interface of this software is intuitive and accessible. For the software to function smoothly, your computer’s hard drive must have at least 4 gigabytes of free memory. A detailed description of the LinuxCNC program can be found freely available on the Internet.


3. . This software has a huge army of fans all over the world. The software is used to control milling, turning, engraving and other types of CNC machines. This software package can be installed on any computer running the Windows operating system. The advantage of using this software is its affordable cost, regular updates, and the presence of a Russian version, which makes it easier for an operator who does not speak English to use the product.



4. Mach4. This is the latest development from Artsoft. Mach4 is considered the successor to the popular Mach3 program. The program is considered one of the fastest. Its fundamental difference from previous versions is the presence of an interface that interacts with electronics. This new software can handle large files on any operating system. The user has access to a manual for using the Mach4 program in Russian.



5. MeshCAM. This is a package for creating control programs for CNC machines based on three-dimensional models and vector graphics. It is noteworthy that the user does not need to have extensive CNC programming experience to master this software. It is enough to have basic computer skills, as well as accurately set the parameters by which products will be processed on the machine.
MeshCAM is ideal for designing two-sided processing of any 3D models. In this mode, the user will be able to quickly process objects of any complexity on the machine.


6. SimplyCam. This is a compact and multifunctional system for creating, editing, saving drawings in DXF format. This software generates control programs and G-codes for CNC machines. They are created using mortar patterns. The user can create an image in one of their computer's graphics programs and then upload it to SimplyCam. The program will optimize this drawing and convert it into a vector drawing. The user can also use a feature such as manual vectorization. In this case, the image is outlined using standard tools that are used in AutoCAD. SimplyCam creates toolpaths for CNC machining.



7. CutViewer. This program simulates material removal processing on two-axis CNC machines. With its help, the user can obtain visualization of processed workpieces and parts. The use of this software allows you to increase the productivity of the technological process, eliminate existing programming errors, and also reduce the time spent on debugging work. CutViewer is compatible with a wide range of modern machine tools. Its effective tools allow you to detect serious errors in the technological process and eliminate them in a timely manner.



8. CadStd. It is an easy to use drawing program. It is used to create projects, diagrams and graphics of any complexity. Using the advanced toolset of this program, the user can create any vector drawings that can be used to design milling or plasma processing on CNC machines. The generated DXF files can then be loaded into CAM programs to generate correct part paths.

Canned cycles of a CNC machine

Rice. 8.8. It is necessary to drill 7 holes with a diameter of 3 mm and a depth of 6.5 mm

Example No. 2

Rice. 8.9. It is necessary to drill 12 holes with a diameter of 5 mm and a depth of 40 mm, first perform the centering operation of the holes

Program code Description
% O0002 (PROGRAM NAME – HOLES2) N100 G21 N102 G0 G17 G40 G49 G80 G90 (CENTROVKA) N104 T1 M6 N106 G54 X21.651 Y12.5 S1200 M3 N108 G43 h2 Z100. N110 Z2. N112 G99 G81 Z-.8 R2. F70. N114 X12.5 Y21.651 N116 X0. Y25. N118 X-12.5 Y21.651 N120 X-21.651 Y12.5 N122 X-25. Y0. N124 X-21.651 Y-12.5 N126 X-12.5 Y-21.651 N128 X0. Y-25. N130 X12.5 Y-21.651 N132 X21.651 Y-12.5 N134 X25. Y0. N136 G80 N138 Z100. N140 M5 N142 G91 G28 Z0. N144 G28 X0. Y0. N146 M01 (DRILL 12 HOLES) N148 T2 M6 N150 G54 X21.651 Y12.5 S1000 M3 N152 G43 h3 Z100. N154 Z2. N156 G99 G83 Z-40. R2. Q2. F45. N158 X12.5 Y21.651 N160 X0. Y25. N162 X-12.5 Y21.651 N164 X-21.651 Y12.5 N166 X-25. Y0. N168 X-21.651 Y-12.5 N170 X-12.5 Y-21.651 N172 X0. Y-25. N174 X12.5 Y-21.651 N176 X21.651 Y-12.5 N178 X25. Y0. N180 G80 N182 Z100. N184 M5 N186 G91 G28 Z0. N188 G28 X0. Y0. N190 M30% Program number Program name Metric operation Safety line Comment Centering call Move to hole No. 1 Tool length compensation Rapid move to Z2. Canned drilling cycle Centering hole #2 Centering hole #3 Centering hole #4 Centering hole #5 Centering hole #6 Centering hole #7 Centering hole #8 Centering hole #9 Centering hole #10 Centering hole #11 Centering hole #12 Canned cycle cancel Move to Z100. Spindle stop Return to the starting position in Z Return to the starting position in X, Y Temporary stop Comment Calling a drill with a diameter of 5 mm Moving to hole No. 1 Compensating the tool length Rapid movement to Z2. Intermittent drilling cycle Drill hole No. 2 Drill hole No. 3 Drill hole No. 4 Drill hole No. 5 Drill hole No. 6 Drill hole No. 7 Drill hole No. 8 Drill hole No. 9 Drill hole No. 10 Drill hole No. 11 Drill hole No. 12 Cancel the canned cycle Move to Z100. Spindle stop Return to home position in Z Return to home position in X, Y End of program

planetacam.ru

2.17. Example of a control program for processing

details "Threaded roller"

In Fig. 41 shows a combined drawing of the workpiece and the “Thread Roller” part with the trajectories of movement of the cutting tools for processing it on a 16A20F3 machine equipped with a 2P22 CNC system.

Rice. 41. Scheme for processing the “Threaded roller” part

The control program for processing the “Threaded roller” part has the following form:

N001 T1S3 572 F0.43 M08

Cutter T1 – roughing, third range, n = 572 rpm, s = 0.43 mm/rev, coolant supply turned on.

Approaching the starting point for cycle L08.

N003 L08 A1 P4

Cycle assignment L08, finishing allowance – 1 mm per diameter, cutting depth – 4 mm.

Description of the part outline.

N011 S3 650 F0.2

Mode change n = 650 rpm, s = 0.2 mm/rev.

Starting point before rough facing.

Rough end trimming according to cycle L05.

N014 T3 S3 1000 F0.12

Cutter T3 – finishing, third range, n = 1000 rpm, s = 0.12 mm/rev.

Approaching the starting point for cycle L10.

Setting the cutting speed to constant.

Define finishing cycle L10, detail description from frame N004.

Cancellation of constant cutting speed.

The starting point before finishing the end trim.

Finish trimming of the end.

Retraction of the cutter from the end along the Z axis by 0.5 mm.

Approach the cutter to the starting point of the chamfer 2×45°.

Chamfer turning 2×45°.

N024 T5 S3 600 F0.25

T5 cutter – groove, third range, n = 600 rpm, s = 0.25 mm/rev.

N025 X32 Z-35 E

The starting point before cutting a groove.

Grooving up to ø20 mm.

The removal of the cutter from the groove is accelerated.

N028 T7 S3 720 F0.3

T7 cutter – threaded, third range, n = 720 rpm, s = 0.3 mm/rev.

Starting point of the cycle before thread cutting.

N030 L01 F1.5 W-33.5 A0 X22.08 P0.3 C0

Cycle L01 for thread cutting M24×1.5.

Turn off the coolant supply.

End of control program, return to I.T.

3. Work on machines equipped with a 2p22 CNC system

3.1. Remote Control

To set the operating modes of the 2P22 CNC device, manual data entry, program editing, and dialogue with the device, a control panel is designed, made in the form of a remote unit mounted on the rotating console of the machine. The control panel keyboard is shown in Fig. 17, and the assignment of the keys is in table. 3.

The functions performed in the main and auxiliary operating modes of the 2P22 CNC device are given in Table. 7.

Table 7

Operating modes of the 2Р22 CNC device

Operating mode

basic

auxiliary

Processing a part using a control program

Automatic mode

Processing a part according to a control program with stops at the end of the block

Automatic mode

Single frame mode

Drawing up a program based on a model, recruiting and testing individual personnel

Manual mode

Reference frame reference

Manual mode

Mode “Exit to a fixed point on the machine”

Continuation of the table. 7

Semi-automatic entry into memory of floating zero and tool overhangs

Manual mode

Semi-automatic entry into memory of the starting position

Manual mode

Mode "Semi-automatic input of constants"

,

Return to starting position

Manual mode

"Exit to" mode

initial position"

Entering a control program from the control panel, displaying and editing programs

Input mode

Input, display and editing of tool overhangs, floating zero, initial position, machine parameters

Input mode

“Input constants” mode

Search for the required block number of the technological program and its display

Input mode

“Frame Search” mode

Entering a technological program from magnetic tape

Input mode

Entering a technological program from punched tape

Output mode

External mode

the carrier is punched tape"

End of table. 7

Outputting a program to magnetic tape

Output mode

“External media – magnetic tape” mode

Outputting a program to punched tape

Output mode

External mode

carrier - punched paper tape"

Checking the functionality of the device using tests included in the software

Test mode

Diagnostics mode

Entering tests from magnetic tape

Test mode

“External media – magnetic tape” mode

Entering tests from punched tape

Test mode

Mode “External media – punched paper tape”

Indication of sensors and the state of exchange signals on the input and output connectors of the CNC device

Test mode

Mode “Indication of machine electrical automation”

Resetting the status display

exchange signals

Test mode

Mode “Resetting the indication of machine electrical automation”

To perform the tasks presented in table. 7 functions, you need to enter the corresponding operating mode (main and auxiliary) by pressing the given keys on the control panel of the CNC device.

Keys whose action continues after they are released have a light signal. Keys for selecting main modes 3, 4, 5, 6, 7 have dependent activation, i.e. Only one of them is active at a time. The action of the remaining keys that have a light signal is canceled by pressing again.

studfiles.net

Programming in ISO

Examples of control programs

It is necessary to create a programmer for machining the outer contour of a part (Fig. 11.1) with a cutter with a diameter of 5 mm without compensation for the tool radius. Milling depth – 4 mm. The approach to the contour is carried out along a straight section.

% O0001 (PROGRAM NAME – CONTOUR1) N100 G21 N102 G0 G17 G40 G49 G80 G90 (FREZA D5) Program O0001 Comment – ​​program name Metric data input mode Safety line Comment – ​​cutter Ф5 mm

Calling tool no. 1

Rice. 11.1. Contouring
N106 G0 G90 G54 X25. Y-27.5 S2000 M3 N108 G43 h2 Z100. N110 Z10. N112 G1 Z-4. F100. N116 X-27.5 N118 Y20. N120 G2 X-20. Y27.5 R7.5 N122 G1 X1.036 N124 X27.5 Y1.036 N126 Y-20. N128 G2 X20. Y-27.5 R7.5 N130 G1 Z6. N132 G0 Z100. N134 M5 N136 G91 G28 Z0. N138 G28 X0. Y0. N140 M30 Positioning to the starting point of the trajectory (1), turning on the spindle speed of 2000 rpm Compensation for tool length No. 1 Positioning in Z10 The cutter is lowered to Z-4 at a working feed of 100 mm/min Linear movement to the point (2) Linear movement to the point (3 ) Move along an arc to a point (4) Linear move to a point (5) Linear move to a point (6) Linear move to a point (7) Move along an arc to a point (8) The cutter rises to Z6 The cutter rises at rapid feed to Z100 Stop spindle Return to home position in Z Return to home position in X and Y End of program

Example No. 2. Contouring with tool radius compensation

It is necessary to create a programmer for processing the outer contour of the part (Fig. 11.2) with a cutter with a diameter of 5 mm with correction for the tool radius. Milling depth – 4 mm. The contour is approached tangentially.

Control program Explanation
% O0002 (PROGRAM NAME – CONTOUR2) N100 G21 N102 G0 G17 G40 G49 G80 G90 (FREZA D5) N104 T1 M6 N106 G0 G90 G54 X25. Y-35. S2000 M3 N108 G43 h2 Z100. Program O0002 Comment – ​​program name Metric data input mode Safety line Comment – ​​5 mm milling cutter Calling tool No. 1 Positioning to the starting point of the trajectory (1), turning on spindle speed 2000 rpm Compensation for tool length No. 1

Positioning in Z10

Rice. 11.2. Contouring with correction
N112 G1 Z-4. F100. N114 G41 D1 Y-30. N116 G3 X20. Y-25. R5. N118 G1 X-25. N120 Y20. N122 G2 X-20. Y25. R5. N124 G1 X0. N126 X25. Y0. N128 Y-20. N130 G2 X20. Y-25. R5. N132 G3 X15. Y-30. R5. N134 G1 G40 Y-35. N136 Z6. N138 G0 Z100. N140 M5 N142 G91 G28 Z0. N144 G28 X0. Y0. N146 M30 The cutter is lowered to Z-4 at a cutting feed of 100 mm/min Correction from the left, move to a point (2) Approach the tool tangentially to a point (3) Linear move to a point (4) Linear move to a point (5) Move along an arc to a point (6) Linear move to a point (7) Linear move to a point (8) Linear move to a point (9) Move along an arc to a point (10) Retract the tool from the contour tangentially to a point (11) Linear move to a point (12) with compensation cancelled. The cutter rises to Z6. The cutter rises at rapid feed to Z100. Spindle stop. Return to the starting position in Z. Return to the starting position in X and Y. End of program.

Example No. 3. Contouring

It is necessary to create a programmer for finishing the pocket (Fig. 11.3) without compensation for the tool radius with a cutter with a diameter of 5 mm. Milling depth – 2 mm. The contour is approached tangentially.

Control program Explanation
% O0003 (PROGRAM NAME – FINISH POCKET) N100 G21 N102 G0 G17 G40 G49 G80 G90 (FREZA D5) N104 T1 M6 N106 G0 G90 G54 X-2.5 Y-2.5 S1000 M3 N108 G43 h2 Z100. N110 Z10. N112 G1 Z-2. F100. N114 Y-5. N116 G3 X0. Y-7.5 R2.5 N118 G1 X10.

N120 G3 X17.5 Y0. R7.5

Program O0003 Comment - program name Metric data input mode Safety line Comment - cutter Ф5 mm Calling tool No. 1 Positioning to the starting point of the trajectory (1), turning on the spindle revolutions Compensating the length of tool No. 1 Positioning in Z10 The cutter is lowered to Z-2 at the working feed 100 mm/min Linear movement to a point (2) Approach the tool tangentially to a point (3) Linear movement to a point (4)

Move along an arc to a point (5)


Rice. 11.3. Pocket finishing
N122 X10. Y7.5 R7.5 N124 G1 X-10. N126 G3 X-17.5 Y0. R7.5 N128 X-10. Y-7.5 R7.5 N130 G1 X0. N132 G3 X2.5 Y-5. R2.5 N134 G1 Y-2.5 N136 Z8. N138 G0 Z100. N140 M5 N146 M30 Move along an arc to a point (6) Linear move to a point (7) Move along an arc to a point (8) Move along an arc to a point (9) Linear move to a point (10) Retract the tool tangentially to a point (11) Linear move to a point point (12) The cutter rises to Z8 The cutter rises at rapid feed to Z100 Spindle stop End of program

Example No. 4. Contouring with tool radius compensation

It is necessary to create a programmer for finishing the pocket with compensation for the tool radius. Milling depth – 2 mm. The contour is approached tangentially.

Control program Explanation
% O0004 (PROGRAM NAME – FINISH POCKET2) Program O0004 Comment – ​​program name

Metric input mode


Rice. 11.4. Pocket finishing with correction
N102 G0 G17 G40 G49 G80 G90 N104 T1 M6 N106 G0 G90 G54 X-2.5 Y-5. S1000 M3 N108 G43 h2 Z100. N110 Z10. N112 G1 Z-2. F100. N114 G41 D1 Y-7.5 N116 G3 X0. Y-10. R2.5 N118 G1 X10. N120 G3 X20. Y0. R10. N122 X10. Y10. R10. N124 G1 X-10. N126 G3 X-20. Y0. R10. N128 X-10. Y-10. R10. N130 G1 X0. N132 G3 X2.5 Y-7.5 R2.5 N134 G1 G40 Y-5. N136 Z8. N138 G0 Z100. N140 M5 N146 M30 Safety line Calling tool No. 1 Positioning to the starting point of the path (1), turning on the spindle speed Compensating the length of tool No. 1 Positioning in Z10 The cutter is lowered to Z-2 at a working feed of 100 mm/min Correction on the left, moving to the point (2) Approaching the tool tangent to a point (3) Linear move to a point (4) Move along an arc to a point (5) Move along an arc to a point (6) Linear move to a point (7) Move along an arc to a point (8) Move along an arc to a point (9) Linear movement to a point (10) Retraction of the tool tangentially to a point (11) Linear movement to a point (12) with compensation cancelation The cutter is raised to Z8 The cutter is raised at rapid feed to Z100 Spindle stop End of program

Example No. 5. Milling a rectangular pocket

It is necessary to create a programmer for processing a rectangular pocket with a cutter with a diameter of 10 mm. Milling depth – 1 mm.

Control program Explanation
% O0005 (PROGRAM NAME – ROUGH POCKET) N100 G21 N102 G0 G17 G40 G49 G80 G90 Program O0005 Comment – ​​program name Metric data input mode Security string

Calling tool no. 1


Rice. 11.5. Rough milling of a rectangular pocket
N106 G0 G54 X-13.75 Y3.75 S1000 M3 N108 G43 h2 Z100. N110 Z10. N112 G1 Z-1. F100. N114 Y-3.75 N116 X13.75 N118 Y3.75 N120 X-13.75 N122 X-17.5 Y7.5 N124 Y-7.5 N126 X17.5 N128 Y7.5 N130 X-17.5 N132 X-25. Y15. N134 Y-15. N136 X25. N138 Y15. N140 X-25. N142 Z9. N144 G0 Z100. N146 M5 N152 M30 Positioning to the starting point of the trajectory (1), turning on the spindle revolutions Compensating the length of tool No. 1 Positioning at Z10 The cutter is lowered to Z-1 at a working feed of 100 mm/min Linear movement to the point (2) Linear movement to the point (3) Linear movement to point (4) Linear move to point (1) Linear move to point (5) Linear move to point (6) Linear move to point (7) Linear move to point (8) Linear move to point (5) Linear move to point (9) Linear move to point (10) Linear move to point (11) Linear move to point (12) Linear move to point (9) Cutter rises to Z9 Cutter rises at rapid feed to Z100 Spindle stop End of program

Example No. 6. Milling a round pocket

It is necessary to create a programmer for processing a round pocket with a cutter with a diameter of 10 mm. Depth – 0.5 mm.

Control program Explanation
% O0000 (PROGRAM NAME – N6) N100 G21

N102 G0 G17 G40 G49 G80 G90

Program O0006 Comment – ​​program name Metric data input mode

Security string


Rice. 11.6. Rough milling of a round pocket
N104 T1 M6 N106 G0 G90 G54 X0. Y0. S1000 M3 N108 G43 h2 Z100. N110 Z10. N112 G1 Z-.5 F100. N120 X5. F200 N122 G3 X-5. R5. N124 X5. R5. N126 G1 X10. N128 G3 X-10. R10. N130 X10. R10. N132 G1 X15. N134 G3 X-15. R15. N136 X15. R15. N138 G1 Z10 F300. N140 G0 Z100. N142 M5 N148 M30 Calling tool No. 1 Positioning to the starting point of the trajectory (1), turning on the spindle revolutions Compensating the length of tool No. 1 Positioning in Z10 The cutter is lowered to Z-0.5 at a working feed of 100 mm/min Moving to point (1) Circular movement along the 1st " orbit" ... Move to point (2) Circular movement along the 2nd "orbit" ... Move to point (3) Circular movement along the 3rd "orbit" ... The cutter rises to Z10 The cutter rises at rapid feed to Z100 Spindle stop End of program

planetacam.ru

Writing a simple control program

Introduction to Processing Programming

Parts processed on a CNC machine can be considered as geometric objects. During processing, the rotating tool and the workpiece move relative to each other along a certain trajectory. UE describes the movement of a certain point of the tool - its center. The tool path is represented as consisting of separate sections that merge into each other. These sections can be straight lines, circular arcs, curves of the second or higher orders. The intersection points of these sections are called reference, or nodal, points. As a rule, the CP contains the coordinates of the reference points.

Rice. 3.3. Any detail can be represented as a set of geometric elements. To create a processing program, it is necessary to determine the coordinates of all reference points

Let's try to write a small program for processing the groove shown in Fig. 3.4. Knowing the coordinates of the reference points, this is not difficult to do. We will not consider in detail the code of the entire program, but will pay special attention to the writing of lines (frames of the program) directly responsible for moving through the reference points of the groove. To machine a groove, you first need to move the cutter to point T1 and lower it to the appropriate depth. Next, you need to move the cutter sequentially through all the reference points and move the tool up out of the workpiece material. Let's find the coordinates of all the reference points of the groove and, for convenience, place them in the table. 3.1.

Table 3.1. Coordinates of the groove reference points

Well, if we take into account the fact that 80% of this list was already in the TF 2005 (TF v.7-8) and 20% was in 2010 (TF v.11): then the three-year handicap has dissolved, and now the TF has an advantage over K at 10-15 years. But there are interesting partner solutions that seem to have been integrated into K at some level, but I think if you have a large customer, it’s not difficult to integrate anywhere :):

1992 is the year the company was founded. The first commercial version of the T-FLEX CAD 2.x (TopCAD) system has been developed. https://www.tflex.ru/about/history/ 1989 - Development of the first version of KOMPAS for IBM PC. Development centers are located in Leningrad and Kolomna. The first contract was concluded for the supply of 10 KOMPAS seats for the Leningrad Metal Plant. https://ascon.ru/company/history/

Array elements could be excluded for a long time, but the entire element, and not just one part, when the element includes several parts. Apparently it will be possible to exclude her in detail, which is not bad. If the builders put an ascon on the engine, they will make it in time. Do engine builders need a specification?

So SSD is many times slower than RAM, didn’t you know? All the same, your computer with an SSD will work SLOWER when there is not enough RAM than mine without an SSD, but with a full tank of RAM. That's when the RAM runs out - an SSD helps (compared to just a HDD), but it doesn't last long. And already 64GB of RAM DOES NOT REQUIRE an SSD at all. You can even make a virtual disk from the RAM and put a swap file there. But Nafik is so extreme, if the page file with such an amount of RAM can be disabled... In fact, loaded CAD behaves differently. Solid is generally a monster the size of 3 categories, and it often loads all sorts of libraries. Katia also loads modules when you go to them, but it takes 5 seconds on a regular screw and the SSD doesn’t ask for it at all. Delays are noticeable only when the project weighs several gigabytes. Don't forget - saving is not a process of writing to disk directly, there is also write caching, and on a large RAM Windows allocates several gigabytes for caching, and anything less is written to the screw very quickly. Also (I repeat) - there is a prefetch in Windows - when at startup it loads the most “popular” files into the RAM in advance. From here, after waiting a couple of tens of seconds when loading Windows, you can see how your CAD system is loaded not from the screw, but from the cache, in a few seconds. With all its libraries. Well, it’s like loading a heavy program and closing it. The restart will be from the cache. And on a large RAM this effect is already the first time the program is loaded. You just need to let the computer “cache”. For example, Solid 2018 with the penultimate SP loaded for me from the start in 5-8 seconds. From a regular screw. True - I launched it a few minutes after loading Windows (I was busy with another CAD program). In general, it flew like Office 2003 or a light viewer...