Machining program conversion device and machine tool system
The machining program conversion device addresses the issue of inappropriate block-by-block conversions by using special code and general address conversion tables to consider command status and validity, enhancing the accuracy of machining program conversions.
Patent Information
- Application Number
- JP2022170988
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2025-12-10
- Estimated Expiration
- 2042-10-25
AI Technical Summary
Existing machining program conversion technologies convert machining programs independently on a block-by-block basis, failing to consider the command contents of previous blocks, leading to inappropriate conversions.
A machining program conversion device that includes a processor and memory, utilizing special code and general address conversion tables to convert machining programs by considering the command status and validity of special codes, and updating these tables for each block to ensure accurate conversion.
Enables more appropriate conversion of machining programs, ensuring accurate interpretation of general addresses based on special code command status and validity, thereby improving the conversion process.
Smart Images

Figure 0007783797000001 
Figure 0007783797000002 
Figure 0007783797000003
Abstract
Description
[Technical Field]
[0001] This specification discloses a machining program conversion device that converts a first machining program created in accordance with a first rule into a second machining program created in accordance with a second rule, and a machine tool system equipped with a numerical control device that functions as the machining program conversion device. [Background technology]
[0002] Generally, the format of a machining program for numerically controlling a machine tool differs depending on the manufacturer of the numerical control device or the generation of the numerical control device. Therefore, a user who owns multiple machine tools with different types of numerical control devices must create a machining program for each numerical control device, even if the workpiece to be machined is the same, which is extremely time-consuming.
[0003] Patent Document 1 discloses a numerical control device that converts a machining program created in accordance with a predetermined standard (e.g., JIS B6315-1, etc.) into execution data that can be executed by the numerical control device. In Patent Document 1, the numerical control device pre-stores a "single conversion table" and a "mixed conversion table" that record the correspondence between words before conversion and words after conversion. The numerical control device then converts the loaded machining program by checking it against these single conversion table and mixed conversion table. The technology in Patent Document 1 eliminates the need for the operator to create multiple machining programs depending on the numerical control device, thereby reducing the burden on the operator. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Japanese Patent Application Publication No. 7-334225 Summary of the Invention [Problem to be solved by the invention]
[0005] However, in Patent Document 1, machining programs are converted independently on a block-by-block basis. In other words, in Patent Document 1, when converting a block, the command contents of previous blocks are not taken into consideration. As a result, in Patent Document 1, there are cases where machining programs cannot be converted appropriately.
[0006] Therefore, this specification discloses a machining program conversion device and a machine tool system that can convert machining programs more appropriately. [Means for solving the problem]
[0007] The machining program conversion device disclosed in this specification is a machining program conversion device that converts a first machining program created in accordance with a first rule into a second machining program created in accordance with a second rule, and includes a processor and a memory. The memory stores a special code conversion table that records external special codes, which are special codes that can be used in the first machining program, and internal special codes, which are special codes that can be used in the second machining program, in one-to-one correspondence, and a general address conversion table that records correspondence between external general addresses, which are general addresses that can be used in the first machining program, command statuses and valid statuses of the special codes, and internal general addresses, which are general addresses that can be used in the second machining program. The processor is configured to read the first processing program block by block, convert the pre-conversion code, which is the special code before conversion that has been read, into the internal special code by comparing it with the special code conversion table, determine the current command status and validity status of the special code based on the result of reading the block, and compare the pre-conversion address, which is the general address that has been read, and the command status and validity status of the current special code with the general address conversion table to convert the pre-conversion address into the internal general address, wherein the special code is a G code or an M code, and in the general address conversion table, some of the external general addresses are associated with the internal general addresses in a one-to-multiple relationship.
[0008] In this case, the internal special codes are classified into a plurality of groups, and the memory further stores a special code characteristics table indicating whether the group is modal or one-shot, and an internal special code table that records the group to which the internal special code commanded in the current block belongs and the internal special code that is valid in the current block, and the processor may be configured to refresh the internal special code table based on the special code characteristics table each time the block to be read is updated, convert the pre-conversion code to the internal special code, and then update the internal special code table based on the conversion result, and determine the command status and validity status of the current special code based on the internal special code table.
[0009] Furthermore, the machine tool system disclosed in this specification comprises a machine tool and a numerical control device that functions as the above-mentioned machining program conversion device, wherein the second machining program is execution data for numerically controlling and operating the machine tool, and the numerical control device numerically controls the machine tool in accordance with the execution data.
[0010] In this case, the numerical control device may further include a display, and the numerical control device may display the special code that is commanded and valid in the block that is executing the numerical control on the display in the form of the external special code. [Effects of the Invention]
[0011] According to the technology disclosed in this specification, machining programs can be converted more appropriately. [Brief explanation of the drawings]
[0012] [Figure 1] FIG. 2 is a block diagram of a machining program conversion device and a machine tool. [Figure 2] FIG. 2 is a functional block diagram of the machining program conversion device. [Figure 3] FIG. 10 is a diagram showing an example of a machining program. [Figure 4] FIG. 10 is a diagram showing an example of a machining program. [Figure 5] 10A and 10B are diagrams showing an external special code allocation table, a special code conversion table, and a special code characteristic table. [Figure 6] FIG. 10 is a diagram showing an external special code table and an internal special code table. [Figure 7] FIG. 10 is a diagram showing a general address translation table. [Figure 8] FIG. 10 is a diagram showing an external general word table and an internal general word table. [Figure 9] FIG. 2 is a schematic diagram showing a configuration of execution data. [Figure 10] 10 is a display example of execution data. [Figure 11] 10 is a flowchart showing a flow of conversion of a machining program. [Figure 12] 10 is a flowchart showing the first half of the flow of general word conversion. [Figure 13] 10 is a flowchart showing the second half of the general word conversion process. [Figure 14] FIG. 10 is a diagram illustrating an example of conversion of a machining program. [Figure 15] This is an internal special code table corresponding to the block. DETAILED DESCRIPTION OF THE INVENTION
[0013] The configuration of the machining program conversion device 10 will be described below with reference to the drawings. FIG. 1 is a block diagram of the machining program conversion device 10 and a machine tool 16. The machining program conversion device 10 of this example is incorporated into a numerical control device 12 of a machine tool system 11. The numerical control device 12 converts a machining program 100 (also referred to as an NC program) created by an operator into execution data 110 for numerically controlling the machine tool 16. This pre-conversion machining program 100 corresponds to a first machining program created in accordance with a first rule, and the execution data 110 corresponds to a second machining program created in accordance with a second rule. Once the execution data 110 has been generated, the numerical control device 12 drives multiple servo motors mounted on the machine tool 16 based on the execution data 110. In this way, a workpiece is machined by the machine tool 16.
[0014] The numerical control device 12 is physically a computer including a processor 20, a memory 22, a communication I / F 24, and a UI device 26. This "computer" also includes a microcontroller in which a computer system is incorporated into a single integrated circuit. The processor 20 refers to a processor in a broad sense, and includes general-purpose processors (e.g., CPU: Central Processing Unit, etc.) and dedicated processors (e.g., GPU: Graphics Processing Unit, ASIC: Application Specific Integrated Circuit, FPGA: Field Programmable Gate Array, programmable logic device, etc.).
[0015] The memory 22 is a device for storing various data, and includes both a main storage device that the processor 20 directly accesses and an auxiliary storage device that the processor 20 accesses via an input / output channel. The main storage device includes, for example, a semiconductor memory. The auxiliary storage device includes, for example, a semiconductor memory or a magnetic storage device.
[0016] The memory 22 stores a plurality of tables T01 to T08 that are referenced or edited for converting the machining program 100. Details of these tables T01 to T08 will be described later. The memory 22 also functions as an execution data buffer 42 that temporarily stores the generated execution data 110.
[0017] The communication I / F 24 transmits and receives data to and from other external electronic devices via wired or wireless communication. The communication I / F 24 communicates with, for example, the machine tool 16 or other external computers. The UI device 26 presents various information to the operator and receives instructions from the operator. The UI device 26 includes, for example, output devices such as a display 50 and a speaker, and input devices such as a keyboard, a mouse, a microphone, and a touch panel. Note that the machining program conversion device 10 does not need to be a single computer, and may be configured by combining multiple physically separated computers.
[0018] Next, a brief description will be given of the configuration of the machining program 100 to be converted.
[0019] The machining program 100 is usually created in accordance with a predetermined standard (for example, JIS B6315-1, etc.). As shown in the upper part of Figure 3, each line of the machining program 100 is called a "block." The machining program 100 includes multiple blocks. Each block ends with a line break or a semicolon (;).
[0020] The bottom row of Figure 3 shows an example of a block. A block is made up of multiple words, each of which consists of an address and numeric data. Addresses are made up of alphabetic characters. Numeric data includes at least numbers and may also include operators such as "=" and "+". For example, in the word "G00", "G" is the address and "00" is the numeric data. Among these words, the word "N**" written at the beginning of the block represents a sequence number. A group of one or more words following the sequence number is called a "data word".
[0021] Furthermore, words containing the address "G" are called preparatory function words, or G codes. Furthermore, words containing the address "M" are called auxiliary function words, or M codes. As will be explained in detail later, these G codes and M codes affect the interpretation of other words depending on their command status and validity status. Therefore, in this specification, these G codes and M codes are referred to as "special codes" to distinguish them from other words. Furthermore, hereafter, words other than special codes are referred to as "general words," and addresses contained in general words are referred to as "general addresses." In the example at the bottom of Figure 3, "X100," "Y100," and "Z20" correspond to general words, and "X," "Y," and "Z" correspond to "general addresses." In this example, the description rule for the machining program 100 includes the use of "=" at the beginning of numeric data when the general address is two or more characters. Therefore, if an operator wants to command the general word "RP3," he or she writes "RP=3" in the machining program 100. However, of course, such a description rule is not necessary. As will be described in detail later, when numeric data includes an operator, the machining program conversion device 10 treats the numeric data as a numerical value resulting from an operation. Therefore, when "RP=3" is written in the machining program 100, the machining program conversion device 10 treats the writing as "RP3," and when "RP=3+3" is written, the machining program conversion device 10 treats the writing as "RP6."
[0022] The numerical control device 12 interprets the machining program 100 and generates execution data 110 for numerically controlling the machine tool 16. At this time, in order to properly utilize the functions of the machine tool 16, it is necessary to convert the words written in the machining program 100 into words in the internal processing format of the numerical control device 12 according to the type and generation of the numerical control device 12. Hereinafter, words that can be used in the machining program 100 will be referred to as "external words" and words in the internal processing format will be referred to as "internal words" to distinguish them. A similar distinction will also be made for general addresses and special codes.
[0023] For example, an external special code "G10" may need to be converted into an internal special code "G69" depending on the type of the numerical control device 12. Similarly, an external general address also needs to be converted into an internal general address suitable for the internal processing of the numerical control device 12 depending on the type of the numerical control device 12.
[0024] Here, the command content represented by the external special code is always constant and is not affected by other words, and the external special code can be associated with the internal special code one-to-one. Therefore, the external special code can be easily converted to the internal special code. On the other hand, the meaning of the external general address may change depending on the command status and validity status of the external special code. Therefore, it has been difficult to properly convert the external general address to the internal general address in the past. This will be explained with reference to FIG. 4.
[0025] FIG. 4 is a diagram showing an example of a machining program 100. The machining program 100a in the upper part of FIG. 4 includes block B1 and block B2. The external special code "G00" in block B1 indicates a positioning command. The external general word "X100" indicates the X coordinate of the positioning target position, and the external general word "A30" indicates the angle of the target position direction relative to the X axis, i.e., the elevation angle. In other words, in block B1, the external general address "A" means "elevation angle."
[0026] Although the external special code "G00" is not written in block B2, the external special code "G00" remains valid in block B2. In other words, special codes are divided into modal and one-shot codes depending on their validity range. Once a modal special code is commanded, it remains valid in subsequent blocks. Such a modal special code remains valid until another special code belonging to the same group is commanded. A one-shot special code is a code that is valid in only one block.
[0027] Since the external special code "G00" is modal, even if "G00" is not commanded in block B2, "G00" indicating a positioning command is valid in block B2. In this case, the external general address "A" in block B2 means "elevation angle" just like in block B1.
[0028] The machining program 100b in the middle of Figure 4 includes block B3 and block B4. The external special code "G11" in block B3 indicates a command to translate / rotate the coordinate system. "X40" and "Y20" following "G11" indicate the position to translate the coordinate system, and "A30" indicates the angle to rotate the coordinate system. In other words, in block B3, the external general address "A" indicates the rotation angle of the coordinate system.
[0029] The machining program 100c in the lower part of Figure 4 includes blocks B5, B6, and B7. The external special code "G381" in block B5 indicates a drilling command. The "X100" and "Y60" following "G381" indicate the drilling position on the XY plane, and "Z-12" indicates the target Z-axis position for drilling. Furthermore, "RP=3" indicates the Z-axis position where drilling begins, and "A5" indicates the cutting depth during the drilling operation. In other words, in block B5, the external general address "A" indicates the cutting depth.
[0030] As is clear from the above explanation, the external general address "A" means the elevation angle in blocks B1 and B2, the rotation angle in block B3, and the cutting depth in block B5. In other words, the meaning of the external general address "A" changes depending on the command status and validity status of the external special code. In addition, since there are modal external special codes, it is not possible to determine the currently valid external special code from just one block, and therefore it is not possible to accurately determine the meaning of the external general address. Therefore, in the past, it was difficult to properly convert such external general addresses into internal general addresses.
[0031] In this example, to solve this problem, the command status and validity status of the special code are temporarily stored, and the external general address is converted to an internal general address according to the command status and validity status. The conversion of the machining program 100 will be described below. First, the multiple tables T01 to T08 stored in the memory 22 will be described. As described above, the numerical control device 12 stores multiple tables T01 to T08 in order to convert the machining program 100 into execution data 110. FIGS. 5 to 8 are diagrams showing examples of these tables T01 to T08. Note that both FIGS. 6 and 8 show tables T04, T05, T07, and T08 immediately after initialization (step S10 in FIG. 11).
[0032] The external special code allocation table T01, the special code conversion table T02, and the special code characteristic table T03 shown in FIG. 5 are prepared in advance and stored in the memory 22. Similarly, the general address conversion table T06 shown in FIG. 7 is also prepared in advance and stored in the memory 22. These four tables T01, T02, T03, and T06 are reference tables that are not changed during the conversion of one machining program 100. On the other hand, the external special code table T04 and the internal special code table T05 shown in FIG. 6 are recording tables in which data is edited during the conversion of one machining program 100. Similarly, the external general word table T07 and the internal general word table T08 shown in FIG. 8 are recording tables in which data is edited during the conversion of one machining program 100.
[0033] The external special code allocation table T01 shown in Fig. 5 is a table showing the correspondence between external special codes and the group numbers to which the external special codes belong. For example, in the example of Fig. 5, it can be seen that "G00", "G01", "G02", and "G03" are all associated with the group number "0".
[0034] The special code conversion table T02 is a table in which external special codes are recorded in one-to-one correspondence with internal special codes. In the example of Fig. 5, it can be seen that the external special code "G10" written in the machining program 100 should be converted to the internal special code "G69" when converted into the execution data 110. Note that the special code conversion table T02 only records special codes that require conversion, and does not record special codes that do not require conversion (for example, "G00").
[0035] The special code characteristics table T03 is a table that records the association between group numbers and valid characteristics. A valid characteristic is the range in which a special code is valid. Valid characteristics include one-shot, which is valid only in one block, and modal, which remains valid until another special code belonging to the same group is specified. In Figure 5, one-shot is indicated as "OS" and modal is indicated as "MD." In the example of Figure 5, group number "0" is a modal code, and group number "1" is a one-shot code. Therefore, for example, once an external special code "G00" belonging to group number "0" is commanded, it remains valid until one of the other external special codes "G01," "G02," or "G03" belonging to group number "0" is commanded. On the other hand, because external special code "G04" belonging to group number "1" is a one-shot code, even if it is commanded in one block, it will be invalid in the next block.
[0036] 6 is a table in which external special code is temporarily recorded in association with group number in a format that allows the command status and validity status of the external special code to be determined. More specifically, the external special code table T04 includes a group number (first column), a command flag (second column) indicating whether or not a command is issued in the current block, and an external special code issued in the current block (i.e., a code before conversion, third column).
[0037] This external special code table T04 is refreshed and updated for each block of the machining program 100. During the refresh, the command flag is changed to "No" in all rows, and "Null" is recorded in the external special code field (third column) of the row of the one-shot group number. This is because the one-shot external special code becomes invalid when the block is updated. On the other hand, the modal external special code remains valid even when the block is updated, so during the refresh process, the external special code field of the row of the modal group number remains unchanged. When one block is read, the command flag is changed to "Yes" in the row corresponding to the external special code (i.e., the pre-conversion code) commanded in that block, and the pre-conversion code is recorded in the external special code field (third column).
[0038] As will be explained in detail later, in this external special code table T04, the external special code column (third column) records the external special codes that are valid in the current block, and the command flag (second column) indicates whether or not the external special code is commanded (written) in the current block. In other words, the second column of the external special code table T04 indicates the command status of the external special code, and the third column indicates the validity status of the external special code.
[0039] The internal special code table T05 is a table in which the conversion results of special codes are temporarily recorded in a format that allows the command status and validity status of the internal special code to be determined. The configuration of this internal special code table T05 is almost the same as that of the external special code table T04. However, in the internal special code table T05, the third column records the internal special code, i.e., the converted code obtained by converting the pre-conversion code into an internal format.
[0040] Furthermore, like the external special code table T04, the internal special code table T05 is refreshed and updated each time one block of the machining program 100 is read. During the refresh, the command flag is changed to "none" in all rows, and "Null" is recorded in the internal special code field (third column) in the row of the one-shot group number. After the refresh, the command flag is changed to "yes" in the row corresponding to the converted internal special code, and the converted code is recorded in the internal special code field (third column).
[0041] 7 is a table that records the correspondence between external general addresses and internal general addresses. However, as mentioned above, the meaning of some external general addresses changes depending on the command status and validity status of the special code.
[0042] Therefore, in the general address conversion table T06, for some external general addresses, multiple internal addresses are associated with one external general address. In addition, for each internal general address, the conditions under which it can be converted to that internal general address are recorded. In this example, the group number (second column) and internal special code (third column) are recorded as conversion conditions. The group number indicates the command status of the special code. If a special code belonging to the group recorded in this group number column is commanded in the current block, conversion to the corresponding internal general address is permitted. For example, if the external special code "G11" (internal special code "G68") belonging to group "6" is commanded in the current block, the external general address "A" written in that block can be converted to the internal general address "AR".
[0043] In addition, the internal special code column (third column) of the general address conversion table T06 indicates the validity status of the special code. If the internal special code recorded in this internal special code column is valid in the current block, conversion to the corresponding internal general address is permitted. For example, because the internal special code "G00" is modal, it may be valid in the current block even if it is not commanded in the current block. In such a case, the external general address "A" written in the block can be converted to the internal general address "AG." Note that general addresses that do not require conversion, i.e., general addresses where the internal general address and external general address are the same, are not recorded in the general address conversion table T06.
[0044] As will be explained in detail later, the conversion condition in the second column (i.e., the command status) takes precedence over the conversion condition in the third column. For example, consider a block "G00 X100 A30" in which the internal special code "G68" is valid. In this case, both the condition in the first row, third column and the condition in the third row, second column of the general address conversion table T06 are satisfied. In this example, the conversion condition in the second column takes precedence, so the external general address "A" in the above block is converted to the internal general address "AG."
[0045] As will be explained in detail later, the rows of the general address conversion table T06 are arranged in the same order as the priority of the conversion conditions. For example, consider a case where both the internal special codes "G68" and "G00" are valid but not specified in a certain block. In this case, the external general address "A" specified in that block is converted to "AR" according to the entry in the first row of the general address conversion table T06.
[0046] The external general word table T07 in FIG. 8 is a table that temporarily records the command status of external general words in the machining program 100. Specifically, if an external general address exists in the currently loaded block, the processor 20 records "Yes" in the command flag column corresponding to the external general address and then records the numeric data. For example, if "A30" exists in the loaded block, the processor 20 records "Yes" in the command flag column for "A" in the external general word table T07 and records "30" in the numeric data column. Note that if the numeric data includes an operator, the result of the operation is recorded in the numeric data column. For example, if "RP=3" exists in the loaded block, the processor 20 records "Yes" in the command flag column for "RP" in the external general word table T07 and records only the number "3" without the "=" in the numeric data column. Similarly, if "RP=3+3" exists in the read block, the processor 20 records "Yes" in the command flag column for "RP" in the external general word table T07, and records only the numeric value "6", which is the calculation result of "=3+3", in the numeric data column. This external general word table T07 is refreshed and updated every time one block of the machining program 100 is read. During the refresh, the command flag column is set to "No" and the numeric data column is set to "Null" in all rows of the external general word table T07.
[0047] The internal general word table T08 is a table that temporarily records the command status of external general words in the machining program 100, with the words replaced with internal general words. For example, when converting the external general word "A30" of the currently loaded block to the internal general word "AR30," the processor 20 records "Yes" in the command flag column for "AR" in the internal general word table T08 and records "30" in the numeric data column. Like the external general word table T07, this internal general word table T08 is refreshed and updated every time a block of the machining program 100 is loaded. During the refresh, the command flag column is set to "No" and the numeric data column is set to "Null" in all rows of the internal general word table T08.
[0048] Next, the flow of conversion of the machining program 100 will be described with reference to Fig. 2. Fig. 2 is a functional block diagram of the machining program conversion device 10. The processor 20 of the machining program conversion device 10 functions as multiple functional blocks shown in Fig. 2. The machining program reading unit 30 reads the machining program 100 one block at a time and outputs it to the word sorting unit 32.
[0049] The word allocating unit 32 refreshes the external special code table T04 and the external general word table T07. Here, refresh refers to a process of erasing the results of word allocation for the previous block prior to word allocation. When refreshing the external special code table T04, the word allocating unit 32 sets the command flag column to "None" in all rows of the external special code table T04. The word allocating unit 32 also sets the external special code column to "Null" in rows of the external special code table T04 that have one-shot group numbers. The word allocating unit 32 determines whether a word is one-shot by referring to the special code characteristics table T03. When refreshing the external general word table T07, the word allocating unit 32 sets the command flag column to "None" and the numeric data column to "Null" in all rows of the external general word table T07.
[0050] Next, the word sorting unit 32 reads the input block in word units in order, and sorts and records the read results in the external special code table T04 and the external general word table T07.
[0051] Specifically, if an external special code (i.e., a pre-conversion code) is present in the read block, the word allocation unit 32 checks the pre-conversion code against the external special code allocation table T01 to identify the group number of the pre-conversion code. The word allocation unit 32 then records "Yes" in the command flag column of the identified group number in the external special code table T04, and records the pre-conversion code in the external special code column. If the external special code allocation table T01 does not contain an external special code that matches the pre-conversion special code, the word allocation unit 32 determines that a special code that cannot be internally processed has been commanded, and outputs an alarm.
[0052] Furthermore, if an external general word (i.e., a general word before conversion) exists in the read block, the word allocating unit 32 breaks down this general word before conversion into a general address and numeric data. Next, the word allocating unit 32 records "Yes" in the command flag column corresponding to the specified general address before conversion in the external general word table T07, and records the actual numeric data in the numeric data column.
[0053] For example, consider the case where the read block is "G00 X100 A30." By referencing the external special code allocation table T01, it is found that the group number of the external special code "G00" is "0." Therefore, in this case, the word allocation unit 32 sets the command flag column to "Yes" and records "G00" in the external special code column for the row of group number "0" in the external special code table T04. The word allocation unit 32 also records "Yes" in the command flag column and "100" in the numeric data column for the row of external general address "X" in the external general word table T07, and records "Yes" in the command flag column and "30" in the numeric data column for the row of external general address "A." The external special code table T04 with the allocation results recorded therein is output to the special code conversion unit 34, and the external general word table T07 is output to the general word conversion unit 36.
[0054] The special code conversion unit 34 refreshes the internal special code table T05 and then records the conversion results of the special codes in the internal special code table T05. First, the refresh process of the internal special code table T05 will be described. When refreshing the internal special code table T05, the special code conversion unit 34 changes the command flag column to "none" in all rows of the internal special code table T05. In addition, the special code conversion unit 34 sets the internal special code column to "Null" in rows of the internal special code table T05 that have one-shot group numbers.
[0055] Once the refresh process is complete, the special code conversion unit 34 converts the special codes. Specifically, the special code conversion unit 34 extracts the external special codes with a command flag set to "Yes" and their group numbers from the external special code table T04. The extracted external special codes are the external special codes commanded (written) in the current block and are pre-conversion codes. The special code conversion unit 34 compares the extracted pre-conversion codes with the special code conversion table T02 to identify the internal special code corresponding to the pre-conversion code. The special code conversion unit 34 then sets the command flag column for the extracted group number to "Yes" in the internal special code table T05 and records the identified internal special code in the internal special code column. Note that if the pre-conversion code does not exist in the special code conversion table T02, the special code conversion unit 34 determines that conversion of the pre-conversion code is unnecessary. In this case, the special code conversion unit 34 records the pre-conversion code as an internal special code in the internal special code table T05.
[0056] For example, consider the case where "6 Yes G10" is recorded in the row of group number "6" in the external special code table T04. The external special code "G10" corresponds to the internal special code "G69." Therefore, in this case, the special code conversion unit 34 records "6 Yes G69" in the row of group number "6" in the internal special code table T05. As another example, consider the case where "0 Yes G00" is recorded in the row of group number "0" in the external special code table T04. Since the external special code "G00" is not recorded in the special code conversion table T02, it can be determined that conversion is not necessary. Therefore, in this case, the special code conversion unit 34 records "0 Yes G00" in the row of group number "0" in the internal special code table T05.
[0057] The special code conversion unit 34 outputs the internal special code table T05, which records the conversion results, to the general word conversion unit 36 and the execution data generation unit 38. Here, this internal special code table T05 contains information indicating not only the conversion results of the special codes but also the command status and validity status of the special codes. That is, the internal special code column (third column) of the internal special code table T05 records data on internal special codes valid in the current block. Furthermore, the command flag column (second column) of the internal special code table T05 indicates whether the corresponding internal special code is specified in the current block. Therefore, by referring to the second column of the internal special code table T05, the internal special code specified in the current block can be identified, and by referring to the third column, the internal special code valid in the current block can be identified.
[0058] The general word conversion unit 36 refreshes the internal general word table T08 and converts general words. When refreshing the internal general word table T08, the general word conversion unit 36 changes the command flag column to "none" and the numeric data column to "Null" in all rows of the internal general word table T08.
[0059] If the internal general word table T08 can be refreshed, the general word conversion unit 36 converts the external general word into an internal general word and records the conversion result in the internal general word table T08. This general word conversion process will be described with reference to FIGS. 12 and 13.
[0060] The general word conversion unit 36 refers to the external general word table T07 and identifies an external general address whose command flag is set to "Yes" as a pre-conversion address (S30). Then, it initializes the value of the reference pointer p (S32). That is, it sets p=1.
[0061] Thereafter, the general word conversion unit 36 sequentially reads the general address conversion table T06 and searches for a row in which the external general address and code command status match the pre-conversion address and current command status (S34-S44). Specifically, the general word conversion unit 36 identifies the external general address recorded in the pth row of the general address conversion table T06 (S34), and checks whether the external general address matches the pre-conversion address (S36). If they match, the general word conversion unit 36 then identifies the group number recorded in the pth row of the general address conversion table T06 as the target number (S38).
[0062] The general word conversion unit 36 checks whether the internal special code of the identified group number (target number) is commanded in the current block (S40). Specifically, the general word conversion unit 36 searches for the target number in the internal special code table T05 and checks the command flag corresponding to the target number. If the command flag is "Yes" as a result of the check, i.e., if the internal special code belonging to the target number is commanded in the current block, the general word conversion unit 36 converts the pre-conversion address to the internal general address listed in the pth row of the general address conversion table T06 (S62). The general word conversion unit 36 updates the internal general word table T08 according to the conversion result (S64). Specifically, the general word conversion unit 36 searches for the converted internal general address in the internal general word table T08, sets the command flag corresponding to the internal general address to "Yes," and records the numeric data of the pre-conversion word in the numeric data field. The value of the numeric data field is determined by referring to the external general word table T07. As described above, even if numeric data is written in the machining program 100 in a format including operators, only the numerical value after the operation is recorded in the external general word table T07. Therefore, the data recorded in the numeric data column of the internal general word table T08 will also be only the numerical value after the operation. For example, even if "RP = 3 + 3" is written in the machining program 100, only the number "6" will be recorded in the numeric data column for "RP" in the external general word table T07 and the internal general word table T08. However, this procedure for numeric data is just an example, and it goes without saying that numeric data may be recorded in the external general word table T07 and the internal general word table T08 with the operators remaining.
[0063] On the other hand, if the pre-conversion address does not match the external general address of the pth row in step S36, or if the current command status does not match the command status of the pth row in step S40, the general word conversion unit 36 increments the pointer p (S42). Thereafter, the general word conversion unit 36 checks whether the pth row exists in the general address conversion table T06 (S44), and if the pth row exists, returns to step S34 and repeats the processes of S34 to S44.
[0064] If the pth row does not exist in step S44, the general word conversion unit 36 reinitializes the pointer p (S46). Thereafter, the general word conversion unit 36 sequentially reads the general address conversion table T06 and searches for a row whose external general address and code validity status match the pre-conversion address and current code validity status (S48-S60). Specifically, the general word conversion unit 36 identifies the external general address recorded in the pth row of the general address conversion table T06 (S48) and checks whether the external general address matches the pre-conversion address (S50). If they match, the general word conversion unit 36 then identifies the valid internal special code recorded in the third column of the pth row of the general address conversion table T06 as the target code (S52).
[0065] The general word conversion unit 36 checks whether the target code is valid in the current block (S54). That is, the general word conversion unit 36 searches the internal special code table T05 for the target code. If the search result shows that the target code is recorded in the internal special code table T05, that is, if the target code is valid in the current block, the pre-conversion address is converted to the internal general address listed in the pth row of the general address conversion table T06 (S62). The general word conversion unit 36 updates the internal general word table T08 according to the conversion result (S64).
[0066] On the other hand, if the pre-conversion address does not match the external general address of the pth row in step S50, or if the current code validity status does not match the code validity status of the pth row in step S54, the general word conversion unit 36 increments the pointer p (S56). Thereafter, the general word conversion unit 36 checks whether the pth row exists in the general address conversion table T06 (S58), and if the pth row exists, returns to step S48 and repeats the processes of S48 to S58.
[0067] On the other hand, if the pth row does not exist in step S58, the general word conversion unit 36 determines that conversion of the pre-conversion address is not necessary (S60). In this case, the general word conversion unit 36 updates the internal general word table T08 using the pre-conversion address as the post-conversion address (S64). Thereafter, if another pre-conversion word exists (Yes in S66), the processes of steps S30 to S66 are repeated again. If another pre-conversion word does not exist, the general word conversion process ends.
[0068] When the conversion process of the general words is completed, the execution data generation unit 38 generates the execution data 110 based on the internal special code table T05 and the internal general word table T08. The execution data 110 is data for numerically controlling the machine tool 16. Since conventional technology can be used to generate the execution data 110, detailed explanation will be omitted here.
[0069] 9 is a schematic diagram showing the configuration of the execution data 110. The execution data 110 includes XYZ coordinates and arc radii for instructing axial movement, an external special code table T04, and an internal special code table T05. Such execution data 110 is generated for each block and output to the execution data writing unit 40.
[0070] The execution data writing unit 40 writes the execution data 110 into the execution data buffer 42. The execution data reading unit 44 reads out the necessary execution data 110 from the execution data buffer 42 according to the control status of the machine tool 16, and outputs it to the machine control execution unit 46 and the execution data output unit 48. The machine control execution unit 46 numerically controls the machine tool 16 based on the input execution data 110.
[0071] The execution data output unit 48 displays the execution data 110 being executed by the machine control execution unit 46 on the display 50. Fig. 10 is an example of the display of the execution data 110. As is clear from Fig. 10, the type of operation being executed, and the current and target positions of the machine are displayed on the display 50. In addition, the external special code commanded in the block being executed and the valid external special code are displayed separately on the display 50.
[0072] When displaying the external special code commanded in the block currently being executed, the execution data output unit 48 searches for a row in the external special code table T04 included in the execution data 110 where the command flag column is set to "Yes." The execution data output unit 48 then displays the external special code in the row with "Yes" on the display 50 as the external special code commanded in the current block. The execution data output unit 48 also displays on the display 50 the external special code recorded in the external special code column of the external special code table T04 as the external special code valid in the current block.
[0073] For example, in the example of Figure 10, in the block with sequence number N4, "G381" is displayed as the external special code commanded in the current block, and "G00" and "G381" are displayed as the external special codes valid in the current block. Here, "G381" and "G00" are both external special codes, not internal special codes. By displaying the external special codes before conversion in this way, the operator can check the machine operation by looking at the external special codes used when creating the machining program 100.
[0074] Next, the flow of conversion of the machining program 100 by the machining program conversion device 10 will be described with reference to Figs. 11 to 13. When converting the machining program 100, the processor 20 initializes the recording tables T04, T05, T07, and T08 recorded in the memory 22 (S10). Specifically, the processor 20 changes all of the second columns (command flags) of the external special code table T04, the internal special code table T05, the external general word table T07, and the internal general word table T08 to "None." In addition, the processor 20 changes all of the third columns (special codes or numeric data) of the external special code table T04, the internal special code table T05, the external general word table T07, and the internal general word table T08 to "Null."
[0075] Once the initialization of the recording table is complete, the processor 20 converts the machining program 100 into execution data 110 for each block (S12 to S24). Specifically, the processor 20 first refreshes the special code tables T04 and T05 and the general word tables T07 and T08 (S12). That is, the processor 20 changes all of the second columns (command flags) of the special code tables T04 and T05 to "None." The processor 20 also sets the data in the third column (special code) of the special code tables T04 and T05 in the rows of the one-shot group numbers to "Null." The processor 20 also changes all of the second columns (command flags) of the general word tables T07 and T08 to "None," and sets all of the data in the third column (numeric data) to "Null."
[0076] When the refresh process of tables T04, T05, T07, and T08 is completed, the processor 20 reads one block of the machining program 100 (S14). After that, the processor 20 divides the read block into word units and executes a special code allocation process and a general word allocation process (S16).
[0077] When allocating special codes, the processor 20 refers to the external special code allocation table T01 to identify the group number of the external special code (i.e., the pre-conversion code) written in the read block. Then, the processor 20 sets the command flag (second column) of the identified group number in the external special code table T04 to "Yes" and records the pre-conversion code in the external special code field (third column).
[0078] When allocating a general word, the processor 20 identifies the address (i.e., pre-conversion address) of the external general word (i.e., pre-conversion word) written in the read block. Then, the processor 20 sets the command flag column (second column) of the row in the external general word table T07 that matches the pre-conversion address to "Yes" and records the numeric data of the pre-conversion word in the numeric data column (third column).
[0079] Next, the processor 20 converts the pre-conversion code into an internal special code and updates the internal special code table T05 according to the conversion result (S18). Specifically, the processor 20 identifies a row in the external special code table T04 where the command flag column (second column) is "Yes" and identifies the group number (first column) and external special code (third column) written in that row as the target number and pre-conversion code. Next, the processor 20 compares this pre-conversion code with the special code conversion table T02 and identifies the corresponding internal special code as the converted code. After that, the processor 20 sets the command flag column to "Yes" in the row in the internal special code table T05 where the group number (first column) matches the target number, and records the converted code in the internal special code column.
[0080] Next, the processor 20 converts the pre-conversion word into an internal general word and updates the internal general word table T08 according to the conversion result (S20). This conversion process has been described with reference to Figures 12 and 13, so a detailed description will be omitted here.
[0081] When the updating of the internal general word table T08 is completed, the processor 20 generates execution data 110 based on the internal special code table T05 and the internal general word table T08, and writes the generated execution data 110 to the execution data buffer 42 (S22). Thereafter, the processor 20 determines whether or not there is a next block to be read (S24), and if there is a next block, returns to step S12 and repeats steps S12 to S24. If there is no next block, the conversion process of the machining program 100 ends.
[0082] Next, the conversion of the machining program 100 will be described with reference to a specific example. FIG. 14 is a diagram showing an example of the conversion of the machining program 100. The upper part of FIG. 14 is an example of the machining program 100, and the lower part is a diagram in which the external special codes and external general words of the machining program 100 in the upper part have been replaced with internal special codes and internal general words. FIG. 15 is an excerpt of internal special code tables T05_1 to T05_7 corresponding to blocks N1 to N7. Note that in FIG. 15, for ease of understanding, the corresponding external special code is written in parentheses after the internal special code, but as mentioned above, such parentheses are not present in the actual internal special code table T05.
[0083] In the example of FIG. 14, the internal special code "G68" (external special code "G11", group number "6") is commanded in block N1. Therefore, in the internal special code table T05_1, the command flag for group number "6" is set to "Yes", and "G68" is recorded in the internal special code column. Also, consider the case where the external general address "A" in block N1 is converted. In this case, since the command flag for group number "6" is set to "Yes", p=1 is obtained in step S40 of FIG. 12. In this case, the external general address "A" is converted to the internal general address listed in the first row of the general address conversion table T06, i.e., the internal general address "AR" representing the rotation angle. Note that the external general addresses "X", "Y", "Z", and "RP" do not need to be converted, and therefore their conversion will not be described below.
[0084] Next, consider the case of converting block N2. Because group number "6" is a one-shot, the command flag for group number "6" in the internal special code table T05_2 of block N2 becomes "None," and the internal special code "G68" is also deleted. Meanwhile, the internal special code "G00" (external special code "G00," group number "0") is commanded in block N2. Therefore, in the internal special code table T05_2, the command flag for group number "0" becomes "Yes," and "G00" is recorded in the internal special code column.
[0085] Group number "0" is modal. Therefore, in the internal special code table T05_3 of block N3, the command flag for group number "0" is changed to "None," but "G00" in the internal special code column is maintained and not deleted. Here, in block N3, internal special codes belonging to groups "6," "20," and "0" are not commanded. On the other hand, the internal special code "G00" is not commanded in the current block N3, but is valid. In this state, consider a case where the external general address "A" of block N3 is converted. In this case, the loop of steps S34 to S44 ends without proceeding to "Yes" in step S40 of FIG. 12. Subsequently, in the loop of steps S48 to S58 of FIG. 13, when p=3, the answer is "Yes" in step S54. In this case, the external general address "A" of block N3 is converted to the internal general address listed in the third row of the general address conversion table T06, i.e., the internal address "AG" representing the elevation angle.
[0086] In block N4, a new internal special code "G83" (external special code "G381", group number "20") is commanded. Therefore, in the internal special code table T05_4 of block N4, the command flag for group number "20" is changed to "Yes", and "G83" is recorded in the internal special code field. Also, "G00" remains recorded in the internal special code field for group number "0". When converting the external general address "A" of block N4, if p=2 in the loop of steps S34 to S44, step S40 becomes Yes. In this case, the external general address "A" of block N4 is converted to the internal general address listed in the second row of the general address conversion table T06, i.e., the internal general address "AD" representing the cutting depth command.
[0087] Since group number "20" is modal, in the internal special code table T05_5 of block N5, the command flag for group number "20" is changed to "None," but "G83" remains in the internal special code field. Here, in block N5, the internal special codes belonging to group numbers "6," "20," and "0" are not commanded. Meanwhile, the internal special codes "G00" and "G83" are valid, even though they are not commanded in the current block N5. In this case, when converting the external general address "A" of block N5, the loop of steps S34 to S44 ends without proceeding to "Yes" in step S40. Subsequently, in the loop of steps S48 to S58, when p=2, the answer to step S54 becomes "Yes." In this case, the external general address "A" of block N5 is converted to the internal general address listed in the second row of the general address conversion table T06, i.e., the internal general address "AD" representing the cutting depth command.
[0088] Here, in block N5, both "G00" and "G83" are valid. However, in the general address translation table T06, the row for "G83" is read before the row for "G00." Therefore, in block N5, the external general address "A" is translated to "AD" instead of "AG."
[0089] In block N6, a new internal special code "G00" (external special code "G00", group number "0") is commanded. Therefore, in the internal special code table T05_6 of block N6, the command flag for group number "0" is changed to "Yes", and "G00" is recorded in the internal special code column. When converting the external general address "A" of block N6, if p=3 in the loop of steps S34 to S44, step S40 becomes Yes. In this case, the external general address "A" of block N6 is converted to the internal general address written in the third row of the general address conversion table T06, i.e., the internal address "AG" representing the elevation angle.
[0090] In block N7, no internal special code is specified. Therefore, in the internal special code table T05_7 of block N7, the command flags of all rows are changed to "None." Meanwhile, the internal special codes "G00" and "G83" remain recorded in the internal special code table T05_7. Since no external special code is specified in block N7, when converting the external general address "A" of block N7, the loop of steps S34 to S44 ends without proceeding to "Yes" in step S40. Subsequently, in the loop of steps S48 to S58, when p=2, the answer in step S54 becomes "Yes." In this case, the external general address "A" of block N7 is converted to the internal general address listed in the second row of the general address conversion table T06, i.e., "AD."
[0091] As is clear from the above explanation, the machining program conversion device 10 disclosed in this specification temporarily records the command status and validity status of the special code. Then, based on the command status and validity status of this special code, it determines which internal general address to convert the external general address to. This makes it possible to appropriately convert an external general address to an internal general address even if the meaning of one external general address changes depending on the command status and validity status of the special code.
[0092] The above-described configuration is merely an example. As long as the machining program conversion device 10 has the configuration described in claim 1, other configurations may be modified as appropriate. For example, the configurations of the various tables T01 to T08 may be modified as appropriate. For example, in the above description, the external special code allocation table T01, the special code conversion table T02, and the special code characteristic table T03 are described as being separate tables. However, these tables T01 to T03 may be combined into a single table. For example, a table may be provided in which the external special code is recorded in the first column, the group number in the second column, the internal special code in the third column, and an identifier indicating one-shot or modal in the fourth column. Furthermore, in the above description, the machining program conversion device 10 is incorporated into the numerical control device 12. However, the machining program conversion device 10 may be a device independent of the numerical control device 12 or the machine tool 16. [Explanation of symbols]
[0093] 10 machining program conversion device, 11 machine tool system, 12 numerical control device, 16 machine tool, 20 processor, 22 memory, 24 communication I / F, 26 UI device, 30 machining program reading unit, 32 word allocation unit, 34 special code conversion unit, 36 general word conversion unit, 38 execution data generation unit, 40 execution data writing unit, 42 execution data buffer, 44 execution data reading unit, 46 machine control execution unit, 48 execution data output unit, 50 display, 100 machining program, 110 execution data, T01 external special code allocation table, T02 special code conversion table, T03 special code characteristic table, T04 external special code table, T05 internal special code table, T06 general address conversion table, T07 external general word table, T08 internal general word table.
Claims
1. A machining program conversion device that converts a first machining program created in accordance with a first rule into a second machining program created in accordance with a second rule, A processor and a memory, The memory may include: a special code conversion table in which external special codes that are special codes that can be used in the first processing program and internal special codes that are special codes that can be used in the second processing program are recorded in one-to-one correspondence; a general address conversion table that records the correspondence between external general addresses that are general addresses that can be used in the first processing program, command statuses and valid statuses of the special codes, and internal general addresses that are general addresses that can be used in the second processing program; and the processor stores: reading the first machining program block by block; The pre-conversion code, which is the read pre-conversion special code, is converted into the internal special code by checking the special code conversion table. Based on the result of reading the block, determine the command status and validity status of the current special code; the pre-conversion address, which is the read general address, and the current command status and validity status of the special code are compared with the general address conversion table, and the pre-conversion address is converted into the internal general address; It is structured as follows: The special code is a G code or an M code, In the general address conversion table, some of the external general addresses are associated with the internal general addresses in a one-to-multiple relationship. A machining program conversion device characterized by:
2. 2. The machining program conversion device according to claim 1, The internal special code is classified into a plurality of groups, The memory further comprises: a special code characteristic table indicating whether the group is modal or one-shot; an internal special code table that records the group to which the internal special code designated in the current block belongs and the internal special code that is valid in the current block; and the processor stores: Refreshing the internal special code table based on the special code characteristic table every time a block to be read is updated; After converting the pre-conversion code into the internal special code, the internal special code table is updated based on the conversion result; determining the command status and validity status of the current special code based on the internal special code table; The machining program conversion device is characterized by being configured as follows.
3. 1. A machine tool system, comprising: Machine tools and a numerical control device that functions as the machining program conversion device of claim 1 or 2; the second machining program is execution data for operating the machine tool by numerical control, the numerical control device numerically controls the machine tool in accordance with the execution data; A machine tool system characterized by:
4. 4. The machine tool system according to claim 3, Further, a display is provided, the numerical control device causes the display device to display the special code that is instructed and valid in a block that is executing numerical control in the form of the external special code; A machine tool system characterized by:
Citation Information
Patent Citations
Program executing system for cnc
JP1995334225A
Program conversion device
JP2006293744A
Display device for processing program
JP2020077096A
Numerical control device
WO2014068650A1