CN110580000B - Automatic programming method for processing finishing allowance of die - Google Patents

Automatic programming method for processing finishing allowance of die Download PDF

Info

Publication number
CN110580000B
CN110580000B CN201910934244.XA CN201910934244A CN110580000B CN 110580000 B CN110580000 B CN 110580000B CN 201910934244 A CN201910934244 A CN 201910934244A CN 110580000 B CN110580000 B CN 110580000B
Authority
CN
China
Prior art keywords
function
character
establishing
characters
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910934244.XA
Other languages
Chinese (zh)
Other versions
CN110580000A (en
Inventor
夏琴香
张心言
陈志平
叶福缘
徐晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN201910934244.XA priority Critical patent/CN110580000B/en
Publication of CN110580000A publication Critical patent/CN110580000A/en
Application granted granted Critical
Publication of CN110580000B publication Critical patent/CN110580000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/4093Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by part programming, e.g. entry of geometrical information as taken from a technical drawing, combining this with machining and material information to obtain control information, named part programme, for the NC machine

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)

Abstract

The invention provides an automatic programming method for processing the finishing allowance of a die, which comprises the following steps: 1. storing the processing program in a TXT format in a G code form; 2. reading data of a TXT document of a processing program; 3. sequentially extracting a line of data in a processing program document, and classifying and integrating information; 4. judging whether the data extracted in the step 3 needs to be corrected, if so, jumping to the step 5, otherwise, jumping to the step 7; 5. obtaining the size and the vector direction of the machining allowance; 6. correcting the processing G code according to the size of the processing allowance and the vector direction thereof, and outputting a new G code; 7. directly outputting the rest processing G codes to a text window, extracting the next line of data in the TXT document of the processing program, if the last line of the line is the line, finishing the G code modification part in the automatic programming, otherwise, jumping back to the step 3; the invention can improve the efficiency of numerical control programming and simultaneously reduce the error rate.

Description

Automatic programming method for processing finishing allowance of die
Technical Field
The invention belongs to the technical field of numerical control programming of molds, and particularly relates to an automatic programming method for processing finishing allowance of a mold.
Background
Numerical control programming is one of main contents in a preparation stage of numerical control machining, and is the whole process from part drawing to obtaining of a numerical control machining program; generally comprises analyzing part patterns and determining a machining process; calculating a feed track to obtain tool position data; writing a numerical control machining program; manufacturing a control medium; checking procedure and trial cutting of first articles.
Numerical control programming is divided into two methods, namely manual programming and automatic programming.
The manual programming is a method for a programmer to directly and manually complete the whole process of analyzing the process of a part drawing, processing the process and data, calculating and writing a numerical control program and inputting the numerical control program to program verification. The manual programming is widely used for point location processing with simple shapes and plane contour processing consisting of straight lines and circular arcs.
The automatic programming is a method using computer aided programming technology, which processes the geometric information of the part by special computer numerical control programming software to realize the automatic calculation of the numerical control machining cutter location point. For parts with complex geometric shapes, a computer is used for writing a part source program by using a specified numerical control language, and a machining program is generated after processing.
The machining error refers to the deviation value of the actual geometric parameters (size, shape and position) of the machined workpiece from the design geometric parameters. In production practice, the process factors affecting the machining accuracy are intricate and complex. Due to different error compensation modes, the error compensation can be divided into processing error compensation and original error compensation, wherein the former is used for compensating errors in the part processing process, the latter is used for compensating error sources causing part processing errors, and the former is adopted by the software.
In addition, for the problem of automatic programming in mold processing, domestic experts and scholars have conducted a lot of research, as follows.
Zhongzhenhui and the like (Zhongzhenhui, NX-based automatic programming [ J ] scientific and technical information, 2017 (50) (50-52.) take a complex curved surface part as a research object, and research is carried out on a series of key links such as cutter selection, machining parameter setting, tool path generation and verification, post-processing and the like in the automatic programming of numerical control machining based on an NX _ CAM module so as to provide reference for implementation of the automatic programming technology of numerical control machining. Sunworchen et al (Sunworheng, Zhouyang et al. surface dimension error compensation for free contour curved surface milling [ J ] mechanical design and manufacture 2018(11): 124-. The study and development of a Xun (Xun-type cavity mold complex insert numerical control automatic programming system) [ D ]. Huazhong university of science and technology ] take Unigraphics NX as a framework platform of a programming system, and the automation of all programming flows such as machining operation creation, operation parameter setting, tool path track generation, post-processing completion and the like is realized by using a programming language according to a numerical control machining process scheme and operation parameters selected by the system through a secondary development function interface provided by the Xun.
The disadvantages of the above method are:
1. aiming at a manual programming method, for machining allowance generated during the fine machining of complex parts, particularly machining surfaces with non-circular curve surfaces or parts with uncomplicated geometric shapes, the workload of programming is large, or the parts need to be processed by complex processes and procedures.
2. Aiming at an automatic programming method, for machining allowance generated during complex part fine machining, a designer needs to modify a machining part model according to the allowance, automatically programs the machining part model by UG on the basis of the model to obtain a machining program, and restores the model to the original state after programming is finished to ensure the consistency of the model. The whole process is repeatedly operated in a large quantity, and the time consumption is high and the efficiency is low.
3. Aiming at the research results of current experts and scholars and aiming at the problem of automatic programming in mold processing, the method mainly reprograms a 3D structural model of the mold through manual or software programming based on an NX _ CAM module, and finally outputs a G code so as to achieve the purpose of automatic programming. However, this method requires processing the 3D structural model of the mold, which is time-consuming and inefficient. There is an urgent need for an automatic programming technique for directly processing the G code of the machining program.
Disclosure of Invention
Aiming at the technical problems of low machining efficiency and high machining cost of the existing manual programming and automatic programming, the invention provides an automatic programming method for processing the finish machining allowance of the die, which is used for processing the numerical control programming of the finish machining allowance of the die, and can improve the efficiency of the numerical control programming and reduce the error rate.
The invention is realized by at least one of the following technical schemes.
An automated programming method for processing a mold finishing allowance, comprising the steps of:
s1, storing the processing program in a TXT format in a G code form to form a TXT document of the processing program;
s2, establishing a file reading function, and reading the data of the TXT document of the processing program in the step S1;
s3, establishing an extraction function, extracting a line of data in the TXT document of the processing program in sequence, and classifying and integrating the information in the TXT document;
s4, judging whether the data extracted in the step S3 needs to be corrected, if so, jumping to the step S5, otherwise, jumping to the step S6;
s5, obtaining the size and the vector direction of the machining allowance;
s6, correcting the processed G code according to the size of the machining allowance and the vector direction of the machining allowance, and gradually outputting a new G code to a text window;
s7, directly outputting the residual machining G codes to a text window, extracting the data of the next line in the TXT document of the machining program, if the last line of the line is the line, finishing the G code modification part in the automatic programming, otherwise, jumping back to the step S3.
And S8, creating a TXT document, copying the modified G code into the TXT document, and then re-introducing the TXT document into the numerical control machine tool to perform secondary processing on the product, wherein the automatic programming is finished.
Further, step S3 specifically includes the following steps:
s31, establishing a file line reading function uc4514(intchan, char × Cbuf), reading a line of data in the TXT document of the processing program and storing the line of data into an array Cbuf [64] of char type;
s32, establishing a plurality of char type arrays for storing characters X, Y, Z, X, Y and characters of numerals behind Z in the document, which are named as Cbuf _ X [64], Cbuf _ Y [64] and Cbuf _ Z [64], respectively;
s33, establishing a plurality of char type arrays for storing all characters in front of the character X, Y, Z in the document, wherein the characters are named as temp _ X [64], temp _ Y [64] and temp _ Z [64 ];
s34, establishing a plurality of char type arrays for storing all characters behind the character X, Y, Z in the document, which are named as Cbuf _ AX [64], Cbuf _ AY [64] and Cbuf _ AZ [64 ];
s35, establishing a char type array as a cache space, storing all contents behind a space, named temp _ sapce [64 ];
s36, reading the margin size to be modified through an expression0- > Value () function, and storing the margin size as a double type, namely Value;
s37, reading the Vector direction of the margin to be modified through a Vector0- > Vector () function, and storing the Vector direction as a Vector3d type, named Vector.
Further, the step S4 of determining whether the data extracted in the step S3 needs to be modified includes the following steps:
s41, establishing a pool type variable key, recording an initial value as false, and making key = true when a character G91 is detected; when G91 is detected again, let key = false, and so on;
s42, establishing a strcat (char strDestination, const char strSource) function to traverse the characters of the data, and checking whether the row of data has characters X, Y or Z; if not, no correction is needed; if yes, continuing to judge whether the key is true, if yes, needing to be corrected, otherwise, needing no correction.
Further, step S5 specifically includes the following steps:
s51, reading the margin size to be modified through an expression0- > Value () function, and storing the margin size as a double type, namely Value;
s52, reading the Vector direction of the margin to be modified through a Vector0- > Vector () function, and storing the Vector direction as a Vector3d type, named Vector.
Further, step S6 specifically includes the following steps:
s61, firstly, initializing relevant variables by using an initialization function memset (void filler, int c, int count), emptying the memory, and removing the influence of the previous line of data;
s62, establishing a function for copying the character in front of the X; establishing a function for copying characters preceding Y; establishing a function for copying characters in front of Z;
s63, establishing a function for copying the characters behind the X; establishing a function for copying characters following Y; establishing a function for copying characters following Z;
s64, establishing a function for adjusting the value behind the character X along the vector direction on the basis of copying the function of the character behind the character X; establishing a function for adjusting the value of the character Y along the vector direction on the basis of copying the function of the character behind the character Y; establishing a function for adjusting the value after the character Z along the vector direction on the basis of a function for copying the character after the character Z;
s65, traversing the characters of the array Cbuf [64], checking which or all of the characters X, Y or Z exist in the line of data, and then correcting the line of data according to the sequence X, Y, Z. Because the correction process has certain similarity, the following description takes the case that only X exists in the row data as an example, and the correction comprises the following steps:
s651, copying the character before the character X into temp _ X [64] by using a function for copying the character before the character X, and calling an output function to print the information to an information window;
s652, using vector.x to obtain a unit vector (double type) along the X axis direction in the target vector direction, then value vector.x can obtain the correction amount along the X axis direction. The Y and Z directions are the same;
s653, substituting the correction quantity along the X-axis direction into a function for adjusting the numerical value of the character X along the vector direction, and correcting the number behind the character X;
s654, by determining whether there is a space in the character following X, it can be determined whether there is another character following X except the number. If the character behind the X has a space, printing the character behind the space by using a pointer function in the C + + language and entering the next step, otherwise, directly entering the next step;
and S655, judging whether the line is the last line in the text, if not, reading a function uc4514(intchan, char) by the line, reading a line of data in the TXT document of the processing program, storing the line of data into an array Cbuf [64] of the char type, and returning to the step S3 for circulation, otherwise, ending the program.
Further, step S7 is specifically as follows:
the whole process from step S3 to step S7 is included in a while loop or a for loop, and whether the last line is used as a judgment condition is judged, if not, the loop is continued, and if so, the automatic programming is ended.
Further, the file reading function in step S2 is uc4504(const char fspec, inoode, intftype).
Further, the extraction function in step S3 is uc4514(intchan, char × cbuf).
Compared with the prior art, the invention has the beneficial effects that:
1. the invention can be suitable for processing parts with any shape and structure, and has high adaptability;
2. the invention is a technical scheme for secondary development on the basis of UG and has very high universality;
3. compared with the traditional numerical control programming, the method does not need to modify the 3D structure of the machined part, does not need to utilize UG software to carry out numerical control programming, can directly combine the residual quantity of the machining and the vector direction thereof to directly program and modify the G code used for machining, solves the problems of heavy workload, large repeated workload, low working efficiency, easy occurrence of uncontrollable errors and the like in the numerical control programming process, improves the numerical control programming efficiency, and thus improves the competitiveness of company products;
4. by combining with the current increasingly mature online detection system, detection data can be imported after online detection, rapid automatic programming is realized, the processing error is reduced, and the processing efficiency is improved.
Drawings
FIG. 1 is a schematic flow chart illustrating an automatic programming method for processing a finishing allowance of a mold according to the present embodiment;
FIG. 2 is a header file required for programming in an automatic programming method for processing a finishing allowance of a mold according to the present embodiment;
FIG. 3 is a flowchart illustrating the automatic programming method for processing the finishing allowance of the mold according to the present embodiment to determine whether the row needs to be modified;
FIG. 4 is a flowchart of the correction of the machining G code in the automatic programming method for processing the machining allowance of the mold finishing according to the embodiment;
fig. 5 is a diagram illustrating the result of the new G code of the automatic programming method for processing the finishing allowance of the mold according to the present embodiment.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but the present invention is not limited thereto.
As shown in fig. 1, an automatic programming method for processing a finishing allowance of a mold includes the steps of:
s1, converting the machining G code from a ptp format into a TXT format to form a machining program TXT document, and installing a corresponding language environment;
in this embodiment, in step S1, the processing G code is converted from the ptp format to the TXT format, and the corresponding language environment is installed as follows:
the G code is exported by using numerical control programming software, opened in the form of a notebook and stored in a TXT format. Microsoft Visual Studio 2010 is then installed with the header files needed for programming as shown in FIG. 2.
S2, reading all the information in the TXT document of the G code, specifically:
by inputting the address of the TXT document of the G code, the data of the machining program TXT document in step S1 is read by the file read function uc4504(const char × fspec, intode, intftype).
S3, establishing a function uc4514(intchan, char ×) to sequentially extract a line of data in the TXT document of the processing program, and classifying and integrating information therein, specifically including the following steps:
s31, establishing a file line reading function uc4514(intchan, char × Cbuf), reading a line of data in the TXT document of the processing program and storing the line of data into an array Cbuf [64] of char type;
s32, establishing a plurality of char type arrays, wherein the char type arrays are used for storing characters of X, Y, Z and following numbers in a document and are named as Cbuf _ X [64], Cbuf _ Y [64] and Cbuf _ Z [64] respectively;
s33, establishing a plurality of char type arrays for storing all characters in front of X, Y, Z in the document, wherein the characters are named as temp _ X [64], temp _ Y [64] and temp _ Z [64 ];
s34, establishing a plurality of char type arrays which are used for storing all characters behind X, Y, Z in the document and are named as Cbuf _ AX [64], Cbuf _ AY [64] and Cbuf _ AZ [64 ];
s35, establishing a char type array as a cache space, storing all contents behind a space, named temp _ sapce [64 ];
s36, reading the margin size to be modified through an expression0- > Value () function, and storing the margin size as a double type, namely Value;
s37, reading the Vector direction of the margin to be modified through a Vector0- > Vector () function, and storing the Vector direction as a Vector3d type, named Vector.
After information in a document is read by using a file reading function uc4504(const _ fspec, inode, intftype), the function uc4514(intchan, char) is read by using a file row, and the information is stored in an array Cbuf [64] of the char type.
S4, as shown in fig. 3, using the logic statement in the C language to determine whether the data extracted in step S3 needs to be corrected, if so, jumping to step S5, otherwise, jumping to step S6, specifically including the following steps:
s41, establishing a pool type variable key, recording an initial value as false, and making key = true when a character G91 is detected; when G91 is detected again, let key = false, and so on;
s42, establishing a strcat (char strDestination, const char strSource) function to traverse the characters of the array Cbuf [64], and checking whether the row of data has the characters X, Y or Z; if not, no correction is needed; if yes, continuing to judge whether the key is true, if yes, needing to be corrected, otherwise, needing no correction.
S5, obtaining the size and the vector direction of the machining allowance, and specifically comprising the following steps:
s51, reading the margin size to be modified through an expression0- > Value () function, and storing the margin size as a double type, namely Value;
s52, reading the Vector direction of the margin to be modified through a Vector0- > Vector () function, and storing the Vector direction as a Vector3d type, named Vector.
S6, as shown in fig. 4, the step of correcting the machining G code according to the magnitude of the machining allowance and the vector direction thereof, and gradually outputting a new G code specifically includes:
s61, firstly, initializing Cbuf _ X [64], Cbuf _ Y [64], Cbuf _ Z [64], temp _ X [64], temp _ Y [64], temp _ Z [64], Cbuf _ AZ [64] and temp _ sapce [64] by using an initialization function memset (void value buffer, int c, int count), emptying the memory, and removing the influence of the previous line of data;
s62, establishing a void copying _ before X (char str2, char str1) function for copying the characters in front of the X; establishing a void copying _ before Y (char str2, char str1) function for copying the character in front of Y; establishing a void copying _ before Z (char str2, char str1) function for copying characters in front of Z;
s63, establishing a void copying _ afterX (char str2, char str1) function for copying the characters behind X; establishing a void copying _ afterY (char str2, char str1) function for copying characters after Y; establishing a void copying _ afterZ (char str2, char str1) function for copying characters after Z;
s64, establishing a void copying _ pickX (char str2, char str1, double tmp _ value) function on the basis of copying _ afterX (char str2, char str1) function, and using the function to adjust the value of the character X along the vector direction; on the basis of a copy string _ afterY (char str2, char str1) function, a void copy string _ pickY (char str2, char str1, double tmp _ value) function is established for adjusting the value of the character Y along the vector direction; on the basis of a copying _ afterZ (char str2, char str1) function, a void copying _ pickZ (char str2, char str1, double tmp _ value) function is established for adjusting the value of the character Z along the vector direction;
the S65, strcat (char strDestination, const char strSource) function traverses the characters of the array Cbuf [64], looks at which or all of the characters X, Y or Z exist in the row of data, and then corrects them in the order of X, Y, Z. Because the correction process has certain similarity, the following description takes the case that only X exists in the row data as an example, and the correction comprises the following steps:
s651, copying characters before the character X into temp _ X [64] by using a copying _ before X (char str2, char str1) function, and calling an output function to print the information to an information window;
s652, using vector.x to obtain a unit vector (double type) along the X axis direction in the target vector direction, then value vector.x can obtain the correction amount along the X axis direction. The Y and Z directions are the same;
s653, the correction quantity along the X-axis direction is substituted into a copy string _ pickX (char str2, char str1, double tmp _ value) function, and the number behind the character X is corrected;
s654, by determining whether there is a space in the character following X, it can be determined whether there is another character following X except the number. If the character behind the X has a space, printing the character behind the space by using a pointer function in the C + + language and entering the next step, otherwise, directly entering the next step;
and S655, judging whether the line is the last line in the text, if not, reading a function uc4514(intchan, char) by the line, reading a line of data in the TXT document of the processing program, storing the line of data into an array Cbuf [64] of the char type, and returning to the step S3 for circulation, otherwise, ending the program.
S7, outputting the residual machining G codes, extracting the next line data in the TXT document of the machining program, judging whether the line is the last line or not by using a loop statement in the C language, if not, jumping back to the step S3, otherwise, finishing the automatic programming, specifically, including the whole process from the step S3 to the step S7 by a while loop or a for loop to judge whether the last line is the condition, if not, continuing the loop, and if the last line is, finishing the G code modification part in the automatic programming. The actual results are shown in FIG. 5.
And S8, creating a TXT document, copying the modified G code into the TXT document, and then re-introducing the TXT document into the numerical control machine tool to perform secondary processing on the product, wherein the automatic programming is finished.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (8)

1. An automatic programming method for processing a finishing allowance of a mold, comprising the steps of:
s1, storing the processing program in a TXT format in a G code form to form a TXT document of the processing program;
s2, establishing a file reading function, and reading the data of the TXT document of the processing program in the step S1;
s3, establishing an extraction function, extracting a line of data in the TXT document of the processing program in sequence, and classifying and integrating the information in the TXT document;
s4, judging whether the data extracted in the step S3 needs to be corrected, if so, jumping to the step S5, otherwise, jumping to the step S7;
s5, obtaining the size and the vector direction of the machining allowance;
s6, correcting the processed G code according to the size of the machining allowance and the vector direction of the machining allowance, and gradually outputting a new G code to a text window;
s7, directly outputting the residual processing G codes to a text window; after the output is finished, judging whether the line is the last line of data in the TXT document of the processing program, if the line is the last line, finishing the G code modification part in the automatic programming, and jumping to the step S8; if the line is not the last line, extracting the next line data in the TXT document of the processing program, and jumping back to the step S4;
and S8, creating a TXT document, copying the modified G code into the TXT document, and then re-introducing the TXT document into the numerical control machine tool to carry out secondary processing on the product, so far, finishing the automatic programming.
2. The automated programming method for processing a mold finishing allowance of claim 1, wherein the step S3 specifically comprises the steps of:
s31, establishing a file line reading function uc4514(int chan, char) and reading a line of data in the TXT document of the processing program and storing the line of data into an array Cbuf [64] of a char type;
s32, establishing a plurality of char type arrays for storing characters X, Y, Z, X, Y and characters of numerals behind Z in the document, which are named as Cbuf _ X [64], Cbuf _ Y [64] and Cbuf _ Z [64], respectively; x, Y, Z represents X axis, Y axis and Z axis of the three-dimensional coordinate system, and the following numbers correspond to coordinate values of X axis, Y axis and Z axis respectively;
s33, establishing a plurality of char type arrays for storing all characters in front of the character X, Y, Z in the document, wherein the characters are named as temp _ X [64], temp _ Y [64] and temp _ Z [64 ];
s34, establishing a plurality of char type arrays for storing all characters behind the character X, Y, Z in the document, which are named as Cbuf _ AX [64], Cbuf _ AY [64] and Cbuf _ AZ [64 ];
s35, establishing a char type array as a buffer space, storing all the contents behind the space, named temp _ sapce [64 ].
3. The automatic programming method for processing finishing allowance of mold as claimed in claim 1, wherein the step S4 of determining whether the data extracted in the step S3 needs to be modified comprises the following steps:
s41, establishing a pool type variable key, recording an initial value as false, and making key = true when a character G91 is detected; when G91 is detected again, let key = false, and so on;
s42, establishing a strcat (char strDestination, const char strSource) function to traverse the characters of the data, and checking whether the row of data has characters X, Y or Z; if not, no correction is needed; if yes, continuing to judge whether the key is true, if yes, needing to be corrected, otherwise, needing no correction.
4. The automated programming method for processing a mold finishing allowance of claim 1, wherein the step S5 specifically comprises the steps of:
s51, reading the margin size to be modified through an expression0- > Value () function, and storing the margin size as a double type, namely Value;
s52, reading the Vector direction of the margin to be modified through a Vector0- > Vector () function, and storing the Vector direction as a Vector3d type, named Vector.
5. The automated programming method for processing a mold finishing allowance of claim 1, wherein the step S6 specifically comprises the steps of:
s61, firstly, initializing relevant variables by using an initialization function memset (void filler, int c, int count), emptying the memory, and removing the influence of the previous line of data;
s62, establishing a function for copying the character in front of the X; establishing a function for copying characters preceding Y; establishing a function for copying characters in front of Z;
s63, establishing a function for copying the characters behind the X; establishing a function for copying characters following Y; establishing a function for copying characters following Z;
s64, establishing a function for adjusting the value behind the character X along the vector direction on the basis of copying the function of the character behind the character X; establishing a function for adjusting the value of the character Y along the vector direction on the basis of copying the function of the character behind the character Y; establishing a function for adjusting the value behind the character Z along the vector direction on the basis of copying the function of the character behind the character Z;
s65, traversing characters of an array Cbuf [64], checking whether characters X, Y or Z exist in the row of data, and then correcting the row of data according to the sequence X, Y, Z, wherein the Cbuf [64] is an array of char type and stores a row of data in a TXT document of a processing program; because the correction process has certain similarity, the following description takes the case that only X exists in the row data as an example, and the correction comprises the following steps:
s651, copying the character in front of the character X into temp _ X [64] by using a function for copying the character in front of the character X, and calling an output function to print the character information in front of the character X to a text window, wherein the temp _ X [64] is a char type array and is used for storing all the characters in front of the character X in the document;
s652, obtaining a unit Vector along the X-axis direction in the target Vector direction by using vector.X, and obtaining a correction quantity along the X-axis direction by using value vector.X, wherein the Vector is a Vector3d type variable, the unit Vector of a margin to be modified is stored inside the Vector, and the vector.X represents a component of the Vector along the X-axis direction; value is a double-type variable, and the size of the margin to be modified is stored inside, so value vector.X represents the correction quantity of the G code along the X-axis direction;
s653, substituting the correction quantity along the X-axis direction into a function for adjusting the numerical value of the character X along the vector direction, and correcting the number behind the character X;
s654, judging whether other characters except the number exist behind the X by judging whether the space exists behind the X; if the character behind the X has a space, the character behind the space is printed by utilizing the pointer function in the C + + language and then the next step is carried out, otherwise, the next step is directly carried out.
6. The automated programming method for processing a mold finishing allowance of claim 1, wherein the step S7 is as follows:
and (4) including the whole process from the step S4 to the step S7 by a while loop or a for loop, taking whether the last line is taken as a judgment condition, if not, continuing the loop, and if so, finishing the G code modification part in the automatic programming.
7. The automatic programming method for processing finishing allowance of mold according to claim 1, wherein the file reading function of step S2 is uc4504(const char fspec, int ompode, int ftype).
8. The automated programming method for processing mold finishing stock of claim 1, wherein the extraction function of step S3 is uc4514(int chan, char).
CN201910934244.XA 2019-09-29 2019-09-29 Automatic programming method for processing finishing allowance of die Active CN110580000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910934244.XA CN110580000B (en) 2019-09-29 2019-09-29 Automatic programming method for processing finishing allowance of die

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910934244.XA CN110580000B (en) 2019-09-29 2019-09-29 Automatic programming method for processing finishing allowance of die

Publications (2)

Publication Number Publication Date
CN110580000A CN110580000A (en) 2019-12-17
CN110580000B true CN110580000B (en) 2021-07-13

Family

ID=68814185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910934244.XA Active CN110580000B (en) 2019-09-29 2019-09-29 Automatic programming method for processing finishing allowance of die

Country Status (1)

Country Link
CN (1) CN110580000B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111046511B (en) * 2019-12-30 2023-04-21 武汉益模科技股份有限公司 NX-based method for calculating processing residual quantity by section rolling integration method
CN113467369B (en) * 2021-07-19 2022-05-13 中航沈飞民用飞机有限责任公司 Automatic drilling and riveting numerical control code visual interactive correction method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0740240A2 (en) * 1991-09-17 1996-10-30 Mitsubishi Denki Kabushiki Kaisha Numerical control unit
JP2005138162A (en) * 2003-11-10 2005-06-02 Kanto Auto Works Ltd Method for processing shaped surface of press die
CN105739433A (en) * 2016-03-18 2016-07-06 沈阳飞机工业(集团)有限公司 Cavity triaxial machinable area automatic construction method based on secondary spheronization method
CN106292529A (en) * 2016-08-19 2017-01-04 马良花 A kind of processing path generation method of lathe
CN106774144A (en) * 2016-12-21 2017-05-31 上海华括自动化工程有限公司 A kind of intelligent CNC processing methods based on industrial robot

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0740240A2 (en) * 1991-09-17 1996-10-30 Mitsubishi Denki Kabushiki Kaisha Numerical control unit
JP2005138162A (en) * 2003-11-10 2005-06-02 Kanto Auto Works Ltd Method for processing shaped surface of press die
CN105739433A (en) * 2016-03-18 2016-07-06 沈阳飞机工业(集团)有限公司 Cavity triaxial machinable area automatic construction method based on secondary spheronization method
CN106292529A (en) * 2016-08-19 2017-01-04 马良花 A kind of processing path generation method of lathe
CN106774144A (en) * 2016-12-21 2017-05-31 上海华括自动化工程有限公司 A kind of intelligent CNC processing methods based on industrial robot

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
数控加工自动编程及仿真实验系统开发;王建;《中国优秀硕士学位论文全文数据库工程科技Ⅰ辑》;20130315(第3期);全文 *

Also Published As

Publication number Publication date
CN110580000A (en) 2019-12-17

Similar Documents

Publication Publication Date Title
CN107239595B (en) Tire three-dimensional modeling system based on NX software PTS module and modeling method thereof
CN110580000B (en) Automatic programming method for processing finishing allowance of die
CN110096033A (en) A method of check and correction numerical control program precision
CN107562015B (en) Process geometric model construction method based on numerical control machining programming
KR20050039750A (en) Design build test cycle reduction
CN103544343A (en) Serialized and parameterized modeling method of power chuck
ITVI20090080A1 (en) METHOD FOR BREAKING A PART PROGRAM IN ELEMENTARY OPERATIONS.
CN103309283A (en) Self-adaptive generating method for machining programs for part three-dimensional model changes
CN111723441B (en) Plastic part pre-deformation part modeling method, system, device and storage medium
CN103869755A (en) Method for guaranteeing smoothness of machine tool output power by adjusting machining code feeding speed
CN110795835A (en) Three-dimensional process model reverse generation method based on automatic synchronous modeling
CN108333937B (en) Contour machining method for multi-axis linkage machine tool
CN103065020A (en) Method for applying CAD (computer-aided design) drawing to precision finger-type milling cutter for involute gears
CN112906215A (en) Pipe tool path generation method based on SolidWorks secondary development
CN103869754A (en) Numerical control machining method
Kim et al. Verification of NC tool path and manual and automatic editing of NC code
Yildiz et al. Development of a feature based CAM system for rotational parts
Diyachenko et al. Features of development of control programs by means of the modular description of elementary forms
Epureanu et al. Reconfigurable machine tool programming–a new approach
CN112947307A (en) Control method for surface appearance of high-speed cutting workpiece
US6681144B1 (en) Process and system for working a workpiece through numerically controlled machine tools
CN116974241B (en) Geometric optimization method and device for numerical control machine tool for green low-carbon manufacturing
CN112184853B (en) Gauge construction method and device, electronic equipment and storage medium
TW201947334A (en) Automatic surface error compensation method and computer program product therefor
US20220168833A1 (en) Processing Method for Electrical Discharge Machine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant