Phone / WhatsApp / Skype
+86 18810788819
E-mail
john@xinfatools.com    sales@xinfatools.com

Basic knowledge to help you get started with UG programming

CNC machining programming is to write the process of machining parts, process parameters, workpiece size, direction of tool displacement and other auxiliary actions (such as tool changing, cooling, loading and unloading of workpieces, etc.) in the order of movement and in accordance with the programming format to write program sheets using instruction codes. the process of. The program list written is the processing program list.

CNC Tools News 1

 

Xinfa CNC tools have the characteristics of good quality and low price. For details, please visit:
CNC Tools Manufacturers – China CNC Tools Factory & Suppliers (xinfatools.com)

Determination of machine tool coordinate system and movement direction

The three coordinate systems of the machine tool’s linear motion X, Y, and Z adopt the right-handed Cartesian rectangular coordinate system, as shown in Figure 11-6. The order of defining the coordinate axes is to determine the Z axis first, then the X axis, and finally the Y axis. For machine tools that rotate the workpiece (such as lathes), the direction of the tool away from the workpiece is the positive direction of the Look, the right direction is the positive direction of the X-axis.

The three rotation axis coordinate systems are parallel to the X, Y, and Z coordinate axes respectively, and the forward direction of the right-hand thread is taken as the positive direction.

Basic instructions for CNC lathes

1) Program format

The processing program usually consists of three parts: program start, program content and program end.

The beginning of the program is the program number, which is used to identify the start of the processing program. The program number is usually represented by the character “%” followed by four digits.

The end of the program can be indicated by auxiliary functions M02 (end of program), M30 (end of program, return to starting point), etc.

The main content of the program consists of several program segments (BLOCK). The program segment is composed of one or several information words. Each information word is composed of address characters and data character letters. The information word is the smallest unit of instruction. (When there is no one to guide you, it is very slow for you to rely on your own abilities, or to get through and accumulate bit by bit on your own. If others teach you their experience, you can avoid many detours.
2) Program segment format

Currently, the word address program segment format is commonly used, and the application standard is JB3832-85.

The following is a typical word address program segment format:

N001 G01 X60.0 Z-20.0 F150 S200 T0101 M03 LF

Among them, N001-represents the first program segment

G01―Indicates linear interpolation

X60.0 Z-20.0 – represents the movement amount in the X and Z coordinate directions respectively

F, S, T – represent feed speed, spindle speed and tool number respectively

M03 – Indicates that the spindle rotates clockwise

LF – indicates the end of the program segment

3) Basic function codes in the CNC system

(1) Program segment number: N10, N20…

(2) Preparation function: G00-G99 is a function that enables the CNC device to perform certain operations.

G codes are divided into two types: modal codes and non-modal codes. The so-called modal code means that once a certain G code (G01) is specified, it is always valid until the same group of G codes (G03) is used in the subsequent program segment to replace it. The non-modal code is only valid in the specified program section and must be rewritten when needed in the next program section (such as G04). Metal processing WeChat is worthy of your attention.

a. Quick point positioning command G00

The G00 command is a modal code, which commands the tool to quickly move from the point where the tool is to the next target position in point positioning control. It is just for quick positioning without movement trajectory requirements.

The command writing format is: G00 Collisions below are more dangerous.

b. Linear interpolation command G01

The linear interpolation instruction is a linear motion instruction and is also a modal code. It commands the tool to make linear motion with any slope between two coordinates or three coordinates in an interpolation linkage manner at the specified F feed rate (unit: mm/min).

The command writing format is: G01 X_Z_F_; the F command is also a modal command, and it can be canceled with the G00 command. If there is no F command in the block before the G01 block, the machine tool will not move. Therefore, there must be an F command in the G01 program.
c. Arc interpolation instructions G02/G03 (using Cartesian coordinates to judge)

The arc interpolation command instructs the tool to perform circular motion in the specified plane at a given F feed rate to cut the arc contour. When processing an arc on a lathe, you must not only use G02/G03 to indicate the clockwise and counterclockwise direction of the arc, and use XZ to specify the end point coordinates of the arc, but also specify the radius of the arc.

The instruction writing format is: G02/G03 X_Z_R_;

(3) Auxiliary functions: used to specify the auxiliary actions of the machine tool (such as the start and stop of the machine tool, steering, cutting fluid switch, spindle steering, tool clamping and loosening, etc.)

M00-Program pause
M01 – Program plan paused
M02-End of program
M03-Spindle forward rotation (CW)
M04-Spindle reverse (CCW)
M05-Spindle stops
M06-Tool change in machining center
M07, M08-coolant on

M09-Coolant off
M10 – workpiece clamping
M11-Work piece loosened
M30 – End of program, return to starting point
The M05 command must be used between the M03 and M04 commands to stop the spindle.

(4) Feed function F

If the direct designation method is used, write the required feed speed directly after F, such as F1000, which means the feed rate is 1000mm/min); when turning threads, tapping and threading, since the feed speed is related to the spindle speed, The number after F is the specified lead.

(5) Spindle function S

S specifies the spindle speed, such as S800, which means the spindle speed is 800r/min.

(6) Tool function T

Instruct the CNC system to change the tool, and use the address T and the following 4 digits to specify the tool number and tool compensation number (tool offset number). The first 2 digits are the tool serial number: 0~99, and the last 2 digits are the tool compensation number: 0~32. After each tool is processed, tool compensation must be canceled.

The tool serial number can correspond to the tool position number on the cutterhead;

Tool compensation includes shape compensation and wear compensation;

The tool serial number and tool compensation number do not have to be the same, but can be the same for convenience.

In the CNC device, the program record is identified by the program number, that is, calling the program or editing the program must be called out by the program number.

a. The structure of the program number: O;

The number after “O” is represented by 4 digits (1~9999), and “0″ is not allowed.

b. Program segment sequence number: Add the sequence number before the program segment, such as: N;

The number after “O” is represented by 4 digits (1~9999), and “0″ is not allowed.

Setting of workpiece coordinate system

The workpiece is installed on the chuck. The machine tool coordinate system and the workpiece coordinate system generally do not coincide. In order to facilitate programming, a workpiece coordinate system should be established so that the tool can be processed in this coordinate system.

G50XZ

This command specifies the distance from the tool starting point or tool change point to the workpiece origin. The coordinates X and Z are the starting point position of the tool tip in the workpiece coordinate system.

For CNC machine tools with tool compensation function, the tool setting error can be compensated by tool offset, so the requirements for adjusting the machine tool are not strict.

Basic tool setting methods for CNC lathes

There are three commonly used tool setting methods: test cutting tool setting method, tool setting with mechanical detection tool setter, and tool setting with optical detection tool setter.

Using G50 U W can cause the coordinate system to shift, replace the old coordinate values with new coordinate values, and replace the machine tool coordinate system and the workpiece coordinate system with each other. It should be noted that in the machine tool coordinate system, the coordinate value is the distance between the tool holder center point and the machine tool origin; while in the workpiece coordinate system, the coordinate value is the distance between the tool tip and the workpiece origin point.


Post time: May-27-2024