Creation of programs for CNC machines. Programs for CNC machines - a complete set to get started Development of NC programs for machining

The control program for a CNC machine is a component of machine tools with numerical control. With its help, autonomous or semi-autonomous processing of workpieces is ensured. This component allows for high-quality and precise production of parts with complex shapes. Developing a control program requires special skills.

Purpose

The control program provides control over numerically controlled machines. without the need for constant monitoring. It is a set of commands that are sent to working equipment.

Using the commands:

  • tools are moved;
  • workpieces are moved;
  • processing speed is controlled.

The program is written for specific workpieces. To create it, you need to install a special program on your computer. The presence of such software will allow you to create control methods yourself if you have basic skills.

Software control can be discrete or contour. The first option is used for processing workpieces with simple shapes. It allows you to perform basic functions. UE of the second type is designed for complex processing. It is most often used on turning and . Processing is carried out depending on the characteristics of a particular device. On their basis, specified functions are performed.

To create a process operation, you need to obtain information about:

  • part surfaces;
  • working tools;
  • the amount of allowance;
  • number of passes for each surface;
  • cutting mode.

It is also necessary to remember in what position the tools were initially, and along what trajectory they will move. The trajectory definition is calculated based on the coordinates of the control points.

Using the control program you can perform:

  • turning works;
  • milling;
  • grinding work.

The software can be used for several tasks at once.

You can download it on the Internet for free, or use paid applications. Paid applications may differ in the presence of additional features.

Creation

The methodology for creating a UE includes several stages. At the first stage of creating a control program, a digital model of the product is built. After this, program analysis is carried out. With it, the model can be divided into points to develop a coordinate system. Tools and workpieces will move along it during work.

It is impossible to create a program without a three-dimensional model of the product. This task is performed by a specialist. Also, ready-made models can be downloaded on the Internet, but there is no guarantee that they will be suitable for the required job.

When producing programs for CNC machines, you can use automated programming systems, the most popular of which are:

  • AutoCAD;
  • NanoCAD;
  • T-FlexCAD;
  • ArtCam;
  • SolidWorks.

Using software, you can change the characteristics of a future product. The more information collected, the more accurate the processing will be. At the final stage, control commands are developed that will be combined into a file.

The file will be processed by the processor. Information from the file is read sequentially. Therefore, the commands are executed one after another. The program can be easily recorded on a regular computer and connected using a flash drive. Then it will be recorded in the memory of the computer that controls the machine, and will not need to be used. With the program itself, it will be possible to carry out serial development of parts.

The main component of control programs is G-code. It consists of numeric characters. Number system symbols can be different commands:

  • technological;
  • geometric;
  • preparatory;
  • auxiliary.

The first type is responsible for determining the working tool, processing speed, turning the device on and off. The second type determines and controls given coordinates. The third type allows the program to control the machine and also sets production modes. The latter type turns individual mechanisms on and off. A software engineer can understand the code.

When purchasing equipment, you will receive instructions that indicate how to correctly create numerical control and use different types of commands.

Types of programs

When creating a program for machine tools, it is necessary to take into account a whole range of issues:

  • at what speed the spindle can operate;
  • at what speeds it can operate;
  • what productivity is the machine capable of working with;
  • how much the working tool can move;
  • how many tools the machine can use.

Most questions are related to the characteristics of the machine. To determine the necessary data, it is enough to use the instructions that come with the equipment when purchasing it.

Some controlled machines may have additional functions. They must also be taken into account when programming, otherwise processing may not be carried out accurately. A list of additional functions is also included in the instructions.

  • There are no universal programs for transmitting commands to the machine. The list of the most popular consists of programs for:
  • development of three-dimensional models;
  • quick viewing and editing of three-dimensional models;
  • converting files from one format to another;
  • creation and preview of UE;

performing tasks on the machine.

Control programs allow machine tools to produce complex products. Parts with complex shapes can be made of wood, metal, stone. Less commonly used materials can be processed using special machines.

Advantages

The control program helps to simplify the production process several times. CNC machines do not require more than one, and work using a simple technique. UEs save time and increase processing accuracy.

  • They are used for:
  • production of advertising banners;
  • design of the premises;
  • cutting and cutting sheet material;

production of souvenirs.

With the help of modern applications, a person who does not have a background in programming can create a control program. Thanks to the support of various operating systems, you can run the NC on almost any computer device connected to a machine with a numerical control system. The disadvantage of software applications is that errors occur periodically.

Types of errors Errors occur most often when developing NC programs for processing parts with complex shapes. The most common reason is insufficient training of the operator-programmer.

Therefore, management programs must be developed by trained employees.

  • There are three types of errors:
  • hermetic;
  • technological;

perforation

Technological errors occur when the machine is being set up. Their reason lies in incorrectly set speed, processing parameters, and other commands specified for CNC equipment. The third type of error occurs in the perforated tape or punch.

You can write control programs on a computer in a notepad, especially if you are good at mathematics and have a lot of free time. Or you can do it right on the machine, and let the whole workshop wait, and you don’t mind the extra workpiece. There is a third way of writing - a better one has not yet been invented.

A CNC machine processes a workpiece according to a G-code program. G code is a set of standard commands that CNC machines support. These commands contain information about where and at what speed to move the cutting tool to machine the part. The movement of the cutting tool is called a trajectory. The tool path in the control program consists of segments. These segments can be straight lines, circular arcs, or curves. The intersection points of such segments are called reference points. The text of the control program displays the coordinates of the reference points.

Example program in G codes

Program text

Description

Set the parameters: processing plane, zero point number, absolute values

Calling tool number 1

Spindle activation – 8000 rpm

Fast travel to point X-19 Y-19

Accelerated movement to height
along Z 3 mm

Linear movement of the tool to the XZ point Y3 with feed F = 600 mm/min

Moving the tool along an arc of radius 8 mm to point X8 Y3

Spindle shutdown

Completing the program

There are three methods for programming CNC machines:

  1. Manually.
  2. On a machine, on a CNC rack.
  3. In a CAM system.

Manually

For manual programming, the coordinates of reference points are calculated and the sequence of movement from one point to another is described. This can describe the machining of simple geometries, mainly for turning: bushings, rings, smooth stepped shafts.

Problems

Here are the problems encountered when a program is written on a machine manually:

- For a long time. The more lines of code in the program, the higher the complexity of manufacturing a part, the higher the cost of this part. If the program contains more than 70 lines of code, then it is better to choose another programming method.

- Marriage. We need an extra blank for implementation to debug the control program and check for overcuts or undercuts.

- Equipment or tool failure. Errors in the text of the control program, in addition to defects, can also lead to breakdown of the machine spindle or tool.

Parts for which programs are written manually have a very high cost.

Rack-mounted CNC machine

On the CNC rack, the processing of the part is programmed online. The machine operator fills out a table with processing conditions. Indicates which geometry to process, width and depth of cut, approaches and departures, safe plane, cutting modes and other parameters that are individual for each type of processing. Based on this data, the CNC rack generates G commands for the tool path. This way you can program simple housing parts. To test the program, the machine operator starts the simulation mode on the CNC rack.

Problems

Here are the problems encountered when a program is written on a rack:

- Time. The machine does not work while the operator writes a program to process the part. Machine downtime means lost money. If the program contains more than 130 lines of code, then it is better to choose another programming method. Although, of course, it’s faster to write a program on a CNC machine than by hand.

- Marriage. The CNC machine does not compare the machining result to the 3D model of the part, so the CNC machine simulation does not show gouges or positive allowance. To debug the program, you need to lay down an extra workpiece.

- Not suitable for complex profile parts. It is not possible to program processing of complex-profile parts on a CNC rack. Sometimes, for specific parts and standard sizes, manufacturers of CNC racks make special operations to order.

While the program is being created on the rack, the machine does not bring money to production.

In SprutCAM

SprutCAM is a CAM system. CAM is short for Computer-Aided Manufacturing. This is translated as “computer-assisted manufacturing.” A 3D model of a part or a 2D contour is loaded into SprutCAM, then the sequence for manufacturing the part is selected. SprutCAM calculates the trajectory of the cutting tool and displays it in G-codes for transmission to the machine. A post-processor is used to output the trajectory into G-code. The post processor translates internal SprutCAM commands into G-code commands for the CNC machine. It looks like
for translation from a foreign language.

The principle of operation in SprutCAM is presented in this video:

Advantages

Here are the advantages of working with SprutCAM:

- Fast. Reduces the time to create programs for CNC machines by 70%.

- Implementation without unnecessary workpieces. The program is checked before running on the machine.

- Rules out marriage. According to reviews from our users, SprutCAM reduces the occurrence of defects by 60%.

- Collision control. SprutCAM controls collisions with the part or working units of the machine, and incisions at rapid feed.

- Processing of complex-profile parts. In SprutCAM, for multi-axis operations, 13 strategies for moving the tool along the surface of the part and 9 strategies for controlling the tool axis are used. SprutCAM automatically controls the angle of inclination and calculates a safe processing path so that there is no collision of the holder or cutting tool with the workpiece.

Drawing up a control program for your CNC machine is possible in the full-featured version of SprutCAM. It needs to be downloaded and launched. After installation you will need to register. Immediately after registration, SprutCAM will start working.

For those who have just started trying, we provide a 30-day fully functional free version of the program!

SprutCAM has 15 configurations, including two special versions: SprutCAM Practitioner and SprutCAM Robot. To find out which configuration is suitable for your equipment and how much it costs, call 8-800-302-96-90 or write to info@site.

Metal Working Group provides professional design services in the field of mechanical engineering.

We develop control programs for CNC machines and prepare them using CAM applications for CNC Siemens Sinumerik, Fanuc, Mazatro l, Fagor.

Only we have licensed software for writing programs for Mazak CNC machines - MAZATROL Matrix CAM.

For other CNC systems, writing programs for CNC machines and preparation is carried out in programs SprutCAM, Cimco, CAMWorks.

We have there is a large base of post-processors for almost all types of CNC machines.

It's also possible writing by hand (G-, M-codes) developed control programs for CNC machines.

We carry out writing control programs for CNC racksLJUMO(Lumo) and K524.

We develop the necessary technical documentation.

In our complex we offer the development of 3D models for CNC machines at very affordable prices

We have extensive experience in creating 3D models for CNC machines. Deep knowledge of the entire technological process gives our specialists a competitive advantage. We create ready-made 3D models for high-quality CNC machines, taking into account all the customer’s wishes.

Let's create universal 3D models for CNC machines. This means that our 3D models for CNC machines can be used in any program designed for processing using this technology.

By contacting our company, you will receive:

  • efficiency and timeliness of model development;
  • affordable prices,
  • short project deadlines
  • high quality of work performed.

In the field of developing control programs and 3D models for CNC machines, we work with orders of increased complexity. We cooperate with customers of different levels: small and medium-sized businesses, large enterprises and private clients.

With us you will find affordable prices, short deadlines for completing projects and the quality of the work performed.

Our specialists estimate the cost of your orderFOR FREE.
The time it takes to estimate the cost of an order is less
2 hours.

A complete list of our services can be found in the section Our services

If you have any questions, we will be happy to answer you.

About CNC machines

Modern CNC machines are characterized by high control efficiency, which is achieved through a numerical control system. All operations are performed based on the parameters set by the machine operator. Such a system does not require the presence of a large number of personnel, which makes the process of controlling a CNC machine profitable and accessible to a wide range of users.

Modern CNC machines are equipped with self-tuning systems. While working on the first part, the system optimizes the settings, taking into account which further work is carried out. After obtaining the optimal operating parameters, the entire batch is processed. This technology can be applied in various processing technologies.

The main advantages of CNC machines are:

  • Optimization of labor costs (significant reduction in the number of employees);
  • Optimization of costs for equipment and organization of working areas (one CNC machine replaces several conventional ones);
  • Increased productivity and working time efficiency ratios;
  • Reduced production time (by 50%);
  • Increasing the accuracy of work performed (by 30-50%).

Information about the order of processing of the product on the machine is entered frame by frame. FRAME is a part of a control program, entered and processed as a whole and containing at least one command.

In each block, only that part of the program is recorded that changes in relation to the previous block.

A frame consists of words that define the purpose of the data that follows them.

For example:

N3 - frame sequence number

G02 - preparation function

(G01 - move in a straight line to the point

G02,G03 - circular interpolation clockwise or counterclockwise)

X - Coordinates of the end point of movement along the axes, Y - (for example, X+037540 (375.4mm)

Coordinates of the center of the arc during circular interpolation

F4 - feed code (for example, F0060 (60mm/min)) S2 - spindle speed code T2 - tool number

M2 - auxiliary function (tool change, table change, cooling switch on, workpiece clamping...).

L3 - enter and cancel correction of geometric information.

LF - end of frame.

To create a program for moving the working parts of the machine, you need to associate a certain coordinate system with it. The Z axis is selected parallel to the axis of the main spindle of the machine, the X axis is always horizontal. When compiling a program, they use the concept of zero, starting and fixed points.

Preparation of the control program includes:

1.Analysis of the part drawing and selection of the workpiece.

    Selecting a machine based on its technological capabilities (dimensions, interpolation capabilities, number of tools, etc.).

    Development of a technological process for manufacturing a part, selection of cutting tools and cutting modes.

4.Selection of the coordinate system of the part and the starting point for the tool.

5.Choice of the method of fastening the workpiece on the machine.

    Placement of reference points, construction and calculation of tool movement.

    Encoding information

    Recording a program on software, editing and debugging.

The use of CNC machines has significantly aggravated the problem of using humans in production environments. Doing all

actions to manufacture a part with a machine in automatic mode left the person with the most difficult and uncreative work of installing and removing workpieces. Therefore, simultaneously with the development of CNC machine tools, work was carried out to create systems capable of replacing a person when performing specific actions that require the use of “MANUAL” labor.

Milling machine and multi-operation machine (machining center) with numerical control

3.3 Industrial robots

An industrial robot (IR) is a mechanical manipulator with program control.

A manipulator is a mechanical device that imitates or replaces the actions of human hands on a production object.

Industrial robots are divided into technological (variable)

properties of the object) and transport.

The technological robot performs welding, the transport robot moves the workpieces to the processing area.

According to their carrying capacity they are divided into:

Object weight ultra-light up to 1 kg light 1 - 10 kg medium 10 -100 kg heavy 100-1000 kg super-heavy more than 1000 kg

Ultra-light robots assemble the device, while a heavy robot moves large workpieces.

PRs are also divided according to the number of degrees of freedom of the working body, according to the CNC system (closed and open, contour and positional, CNC, DNC, HNC).

Transport robot service area and workpiece movement path

Currently, transport robots are widely used to load technological equipment, deliver workpieces from the warehouse and transport parts to the warehouse. During stamping operations, transport robots feed blanks to the stamp and remove them.

Robots that weld car bodies and paint them are widely used. Robots are used in the assembly of electronic equipment, watches and other devices.

Together with technological equipment with CNC systems, industrial robots form the basis for comprehensive production automation.

Robots weld car bodies and install wooden panels on a machine for processing (examples of robot application)

Control questions:

1.Which CNC systems allow processing spherical surfaces on lathes?

2.Which CNC systems are advisable to use on drilling machines?

3.How many coordinates are interpolation possible when processing workpieces on lathes? - on milling machines?

4. How do cyclic program control systems differ from CNC systems?

5.What functions do industrial robots perform?

Sample test control card questions.

    In what operations is it advisable to use CNC systems with contour control?

A). When turning stepped rollers.

B) . When milling double curvature surfaces.

IN). When machining holes in printed circuit boards.

    What types of robots are used when painting complex-profile parts? A). Technological with contour control.

B). Large-sized with position control.

IN). Transport with contour control.

A control program for a CNC machine consists of a sequence of frames and usually begins with the program start symbol (%) and ends with M02 or M30.

Each program block represents one processing step and (depending on the CNC) can begin with a block number (N1...N10, etc.) and end with the end of block symbol (;).

A control program block consists of statements in word form (G91, M30, X10., etc.). A word consists of a symbol (address) and a number representing an arithmetic value.

Addresses X, Y, Z, U, V, W, P, Q, R, A, B, C, D, E are dimensional movements, used to designate the coordinate axes along which movements are carried out.

Words describing movement may have a (+) or (-) sign. If there is no sign, the displacement is considered positive.

Addresses I, J, K mean interpolation parameters.

G - preparatory function.

M - auxiliary function.

S - main movement function.

F - feed function.

T, D, H - tool functions.

Symbols may take on different meanings depending on the specific CNC.

Preparatory functions (G codes)

G00- fast positioning.

The G00 function is used to perform rapid movement of the cutting tool to a machining position or to a safe position. Rapid traverse is never used to perform machining, since the speed of movement of the machine's actuator is very high. Code G00 is canceled by codes: G01, G02, G03.

G01- linear interpolation.

Function G01 is used to perform linear movements at a given speed (F). During programming, the coordinates of the end point are specified in absolute values ​​(G90) or incremental values ​​(G91) with the corresponding movement addresses (for example, X, Y, Z). Code G01 is canceled by codes: G00, G02, G03.

G02- circular interpolation clockwise.

The GO2 function is designed to move the tool along an arc (circle) in a clockwise direction at a given speed (F). During programming, the coordinates of the end point are specified in absolute values ​​(G90) or incremental values ​​(G91) with the corresponding movement addresses (for example, X, Y, Z).

Code G02 is canceled by codes: G00, G01, G03.

G03- circular interpolation counterclockwise.

The GO3 function is designed to move the tool along an arc (circle) in a counterclockwise direction at a specified speed (F). During programming, the coordinates of the end point are specified in absolute values ​​(G90) or incremental values ​​(G91) with the corresponding movement addresses (for example, X, Y, Z).

The interpolation parameters I, J, K, which determine the coordinates of the center of the circular arc in the selected plane, are programmed in increments from the starting point to the center of the circle, in directions parallel to the X, Y, Z axes, respectively.

Code G03 is canceled by codes: G00, G01, G02.

G04- pause.

Function G04 is a command to perform a dwell with a specified time. This code is programmed along with an X or P address, which specifies the length of the dwell time. Typically, this time is from 0.001 to 99999.999 seconds. For example, G04 X2.5 - pause 2.5 seconds, G04 P1000 - pause 1 second.

G17- selection of the XY plane.

The G17 code is for selecting the XY plane as the working plane. The XY plane becomes dominant when using circular interpolation, coordinate system rotation, and canned drilling cycles.

G18- selection of the XZ plane.

The G18 code is for selecting the XZ plane as the working plane. The XZ plane becomes dominant when using circular interpolation, coordinate system rotation and canned drilling cycles.

G19- selection of the YZ plane.

The G19 code is for selecting the YZ plane as the working plane. The YZ plane becomes dominant when using circular interpolation, coordinate system rotation, and canned drilling cycles.

G20- input of inch data.

Function G20 activates the inch data mode.

G21- input of metric data.

Function G21 activates the metric data mode.

G40- Cancel tool radius compensation.

The G40 function overrides the automatic tool radius compensation G41 and G42.

G41- left tool radius compensation.

The G41 function is used to enable automatic compensation for the radius of the tool located to the left of the machined surface (when viewed from the tool in the direction of its movement relative to the workpiece). Programmable together with the tool function (D).

G42- right tool radius compensation.

The G42 function is used to enable automatic compensation for the radius of a tool located to the right of the surface being machined (when viewed from the tool in the direction of its movement relative to the workpiece). Programmable together with the tool function (D).

G43- correction for tool position.

Function G43 is used for tool length compensation. Programmable together with the tool function (H).

G52- local coordinate system.

The control system allows you to set, in addition to standard working coordinate systems (G54-G59), also local ones. When the machine's control system executes a G52 command, the origin of the current work coordinate system is shifted to the value specified by the data words X, Y and Z. The G52 code is automatically canceled by the G52 XO YO Z0 command.

G54 - G59- specified offset.

Offset of the working coordinate system of the part relative to the machine coordinate system.

G68- rotation of coordinates.

The G68 code allows you to rotate the coordinate system by a certain angle. To perform a rotation, you need to specify the plane of rotation, the center of rotation, and the angle of rotation. The plane of rotation is set using codes G17, G18 and G19. The center of rotation is set relative to the zero point of the active work coordinate system (G54 - G59). The rotation angle is specified using R. For example: G17 G68 X0. Y0. R120.

G69- cancel coordinate rotation.

The G69 code overrides the G68 coordinate rotation mode.

G73- high-speed intermittent drilling cycle.

The G73 cycle is designed for drilling holes. The movement during processing occurs at the working feed with periodic withdrawal of the tool. The movement to the starting position after processing occurs at an accelerated feed.

G74- left-hand thread cutting cycle.

The G74 cycle is designed for cutting left-handed threads with a tap. The movement during machining occurs at the working feed, the spindle rotates in a given direction. The movement to the starting position after processing occurs at the working feed with reverse rotation of the spindle.

G80- canceling the constant cycle.

A function that cancels any canned loop.

G81- standard drilling cycle.

The G81 cycle is designed for centering and drilling holes. Movement during processing occurs at the working feed. The movement to the starting position after processing occurs at an accelerated feed.

G82- holding drilling.

The G82 cycle is designed for drilling and countersinking holes. The movement during processing occurs at the working feed with a pause at the end. The movement to the starting position after processing occurs at an accelerated feed.

G83- intermittent drilling cycle.

The G83 cycle is designed for deep hole drilling. The movement during the machining process occurs at the working feed with periodic withdrawal of the tool into the retraction plane. The movement to the starting position after processing occurs at an accelerated feed.

G84- thread cutting cycle.

The G84 cycle is designed for tapping threads. The movement during machining occurs at the working feed, the spindle rotates in a given direction. The movement to the starting position after processing occurs at the working feed with reverse rotation of the spindle.

G85- standard boring cycle.

The G85 cycle is designed for reaming and boring holes. Movement during processing occurs at the working feed. The movement to the starting position after processing occurs at the working feed.

G86- boring cycle with spindle rotation stop.

The G86 cycle is designed for boring holes. Movement during processing occurs at the working feed. At the end of processing, the spindle stops. The movement to the starting position after processing occurs at an accelerated feed.

G87- boring cycle with manual retraction.

The G87 cycle is designed for boring holes. Movement during processing occurs at the working feed. At the end of processing, the spindle stops. The movement to the starting position after processing is done manually.

G90- absolute positioning mode.

In the absolute positioning mode G90, the movements of the actuators are made relative to the zero point of the working coordinate system G54-G59 (it is programmed where the tool should move). The G90 code is canceled by the G91 relative positioning code.

G91- relative positioning mode.

In the relative (incremental) positioning mode G91, the zero position is each time taken to be the position of the actuator, which it occupied before moving to the next reference point (it is programmed how much the tool should move). The G91 code is canceled by the G90 absolute positioning code.

G94- feed rate in inches/millimeters per minute.

Using the G94 function, the specified feedrate is set in inches per 1 minute (if the G20 function is in effect) or in millimeters per 1 minute (if the G21 function is in effect). Programmable together with the feed function (F). Code G94 is canceled by code G95.

G95- feed rate in inches/millimeters per revolution.

Using the G95 function, the specified feedrate is set in inches per 1 spindle revolution (if the G20 function is in effect) or in millimeters per 1 spindle revolution (if the G21 function is in effect). Those. Feedrate F is synchronized with spindle speed S. Code G95 is canceled by code G94.

G98- return to the original plane in a cycle.

When a machine canned cycle is run in conjunction with the G98 function, the tool returns to the home plane at the end of each cycle and between all holes being machined. The G98 function is canceled with G99.

G99- return to the retraction plane in a cycle.

If the machine's canned cycle is operated in conjunction with the G99 function, the tool returns to the retraction plane between all holes being machined. The G99 function is canceled with G98.

G-code (GC) can be created manually or automatically in programs such as ArtCam.

For execution, G-code is launched in machine control programs Mach3 And KCam.