CN110488755A - A kind of conversion method of numerical control G code - Google Patents

A kind of conversion method of numerical control G code Download PDF

Info

Publication number
CN110488755A
CN110488755A CN201910775600.8A CN201910775600A CN110488755A CN 110488755 A CN110488755 A CN 110488755A CN 201910775600 A CN201910775600 A CN 201910775600A CN 110488755 A CN110488755 A CN 110488755A
Authority
CN
China
Prior art keywords
code
control system
row
numerical control
input
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.)
Pending
Application number
CN201910775600.8A
Other languages
Chinese (zh)
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.)
Jianglu Machinery and Electronics Group Co Ltd
Original Assignee
Jianglu Machinery and Electronics Group Co Ltd
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 Jianglu Machinery and Electronics Group Co Ltd filed Critical Jianglu Machinery and Electronics Group Co Ltd
Priority to CN201910775600.8A priority Critical patent/CN110488755A/en
Publication of CN110488755A publication Critical patent/CN110488755A/en
Pending legal-status Critical Current

Links

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
    • G05B19/40937Numerical 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 concerning programming of machining or material parameters, pocket machining
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/32Operator till task planning
    • G05B2219/32161Object oriented control, programming

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)
  • Machine Translation (AREA)

Abstract

The invention discloses a kind of conversion methods of numerical control G code, steps are as follows: pre-processing first to the G code of input, then the G code type of current G code and generation target is determined, G code transfer framework is established based on neural network algorithm again, and G code transfer framework is trained, obtain G code transformation model, then G code is read in rows, G code is passed to G code transformation model, G code is translated, finally judge whether conversion is completed, it is unfinished then continue to convert.The characteristic for the different machine tool systems that method disclosed by the invention can adapt to very well has many advantages, such as that scalability is strong, G code conversion quality is high.

Description

A kind of conversion method of numerical control G code
Technical field
The present invention relates to a kind of conversion methods of numerical control G code.
Background technique
For numerical control industry, numerical control machine code relation the processing benefit of numerical control, quality the problems such as, with the epoch Progress, different lathes is also required to be updated iteration, such as in the change-brain engineering that country advocates, some old numerically-controlled machine tools System will change new digital control system into, but since the digital control system before most change-brain is different from the system after change-brain, cause Some optimizations, cure parameter G code used in numerically-controlled machine tool processing before, can not new numerically-controlled machine tool after change-brain Enterprising enforcement is used.Due to of the remote past, some even can not generate numerical control machining code by Geometric Modeling.Although big at present Most lathes all use the universal standard, even if being the universal standard, still have some differences slightly on programming details, are Understand never be badly in need of with code sharing problem between numerically-controlled machine tool it is a kind of can intelligently, the numerical control code that adapts between not homologous ray turns Change method.
Summary of the invention
The numerical control G code that in order to solve the above technical problem, the present invention provides a kind of algorithms is simple, conversion accuracy is high turns Change method.
Technical proposal that the invention solves the above-mentioned problems is: a kind of conversion method of numerical control G code, comprising the following steps:
Step 1: input G code is pre-processed:
Step 2: determining the G code type of current A digital control system and generates the class of the G code of target B digital control system Type;
Step 3: G code transfer framework is established based on neural network algorithm, and G code transfer framework is trained, is obtained To G code transformation model;
Step 4: reading in every row G code in rows, and the G code of A digital control system is passed to G code transformation model, G Code conversion model encodes the G code of A digital control system, after attention mechanism, is decoded to A digital control system; Deep learning G code model database trained in advance is called, G code is translated;
Step 5: judging whether the translation conversion of the row is completed, and then continues to translate as unfinished, continues to sentence if completing Whether all disconnected translation terminates, and is such as not finished, then repeats step 4 to step 5, continue to read next line G code, if having tied Beam then exports the G code for generating target B digital control system.
The conversion method of above-mentioned numerical control G code, the step 1 specific steps are as follows: to the G code of input according to line number into Row is split, and every row is divided into a list, and to the element further division of every row.
The conversion method of above-mentioned numerical control G code, the step 2 specific steps are as follows:
2-1) pass through data prediction, after extracting to each G code of the every row of data, statistical method is based on, to defeated The G code entered is judged: assigning lesser weight firstly for the code of standard universal, non-standard general code is assigned Biggish weight is given, and possible generic is carried out to each G code and is given a mark, last score is counted, and root It is ranked up according to weight to small;
Digital control system belonging to the G code for 2-2) estimating input according to last highest score is possible, provides judgement As a result, being confirmed by client;
2-3) selection needs the G code classification exported.
The conversion method of above-mentioned numerical control G code, in the step 3, G code conversion frame is divided into coded portion and decoding Part;
In code area part, G code passes through XiIt carries out after being input to hidden layer, is encoded,
ht=Φ (ht-1,xt)=f (W(hh)ht-1+W(hx)xt)
Wherein XtFor input layer, htFor hidden layer, connected each other between hidden layer, W is weight;
The prediction under the complete semanteme of every a line of attention mechanism help G code generates next G code for meeting semanteme, Rather than one-to-one simple local code;When hidden layer is after attention mechanism, attention mechanism is according to the G code of every row Whole sentence semantic information q, the hidden layer h of final each G codetThe weighted average c of output onet=∑tstht, wherein coefficient st It indicates and most degree of correlation in every row G code q;
In decoded portion, wherein
ht'=ct=φ (ct-1)=f (W(hh)ct-1)
yt=softmax (W(s)ht′)
ht' indicate hidden layer, ytOutput is indicated, in forecast period, ytThe predicted value of G code after indicating conversion.
The conversion method of above-mentioned numerical control G code, the training process of G code transfer framework in the step 3 are as follows:
3-1) input G code is pre-processed: the G code of input being split by line number, every row is divided into a column Table, and to the G code further division of every row;
3-2) pass through one sentence pair of G code of the G code of the A digital control system to same machining information and B digital control system It should be used as training set, off-line training neural network;
It 3-3) is passed to G code transfer framework: after encoding using Recognition with Recurrent Neural Network to G code, passing through attention machine It makes, finally G code to be transformed is predicted in decoding, reduces error by using minimum cross entropy in the training process, final to obtain To trained G code transformation model.
The conversion method of above-mentioned numerical control G code, the step 3-3) in, using the formula for minimizing cross entropy reduction error Are as follows:
The conversion method of above-mentioned numerical control G code in the step 4, passes through and calls trained G code transformation model, G Code is after coding, attention mechanism, the value decoded, the target G code as to be converted.
The beneficial effects of the present invention are: the invention discloses a kind of conversion methods of numerical control G code, first to input G code is pre-processed, and is then determined the G code type of current G code and generation target, is resettled G code modulus of conversion Type then reads in G code in rows, and G code is passed to G code transformation model, translates to G code, finally judges Whether conversion is completed, unfinished then continue to convert.The different machine tool systems that method disclosed by the invention can adapt to very well Characteristic, have many advantages, such as that scalability is strong, G code conversion quality is high.
Detailed description of the invention
Fig. 1 is specific flow chart of the invention.
Fig. 2 is the structure chart of the G code transfer framework in the present invention.
Specific embodiment
The present invention is further illustrated with reference to the accompanying drawings and examples.
As shown in Figure 1 and Figure 2, a kind of conversion method of numerical control G code is converted into Fa Nake's with Central China numerical control G code For G code, comprising the following steps:
Step 1: input G code is pre-processed.
The G code file of Central China numerical control is inputted, and the G code of input is split according to line number, every row is divided into one List, and to the element further division of every row.
Step 2: determining the G code type of current A digital control system and generates the class of the G code of target B digital control system Type.Specific steps are as follows:
2-1) in conversion, Central China numerical control G code file of input, by data prediction, to the every of the every row of data After a G code extracts, it is based on statistical method, the G code of input is judged: assigned firstly for the code of standard universal Lesser weight is given, if the G code of international regulations is meant that uniquely, smaller weight can be given.For non-standard general code Biggish weight is assigned, such as: G92 is workpiece coordinate setting in Central China numerical control system, is followed in Fa Nake for the turning that is screwed Ring gives big weight for this distinguishing code, and carries out possible generic to each G code and give a mark, to most Score afterwards is counted, and is ranked up according to weight to small;
Digital control system belonging to the G code for 2-2) estimating input according to last highest score is possible, provides judgement As a result, being confirmed by client;
The rough anticipation of this input, help the attribute for tentatively prejudging G code to be converted: Central China numerical control system reduces input The input of G code to be converted, gets the wrong sow by the ear if provided, and can also voluntarily select classification;
2-3) selection needs the G code classification exported: Fa Nake.
Step 3: G code transfer framework is established based on neural network algorithm, and G code transfer framework is trained, is obtained To G code transformation model.
For G code transfer framework in training and prediction, function has slightly difference, as shown in Fig. 2, G code converts frame It is divided into coded portion and decoded portion;
In code area part, such as: when the G code of a line Central China numerical control system passes through XiIt carries out after being input to hidden layer, It is encoded,
ht=Φ (ht-1,xt)=f (W(hh)ht-1+W(hx)xt)
Wherein XtFor input layer, htFor hidden layer, connected each other between hidden layer, W is weight;
The prediction under the complete semanteme of every a line of attention mechanism help G code generates next G code for meeting semanteme, Rather than one-to-one simple local code;When hidden layer is after attention mechanism, attention mechanism is according to the G code of every row Whole sentence semantic information q, the hidden layer h of final each G codetThe weighted average c of output onet=∑tstht, wherein coefficient st It indicates and most degree of correlation in every row G code q;
In decoded portion, wherein
ht'=ct=φ (ct-1)=f (W(hh)ct-1)
yt=softmax (W(s)ht′)
ht' indicate hidden layer, ytThe G code for indicating output Fa Nake, in forecast period, ytIndicate the G code after converting Predicted value, i.e., the G code for the Fa Nake being converted to by Central China numerical control system.But then indicate that the G of Fa Nake is true in the training stage Code.
The training process of G code transfer framework are as follows:
3-1) input G code is pre-processed: the G code of input Central China numerical control and Fa Nake is torn open by line number Point, every row is divided into a list, and to the G code further division of every row;
3-2) pass through one sentence pair of G code of the G code of the A digital control system to same machining information and B digital control system It should be used as training set, off-line training neural network;Pay attention to the code and be the code that artificial optimization crosses, such as: in Central China numerical control system Unite the G code of operation, after manually adjusting, can on Central China numerical control system perfect operation G code.
It 3-3) is passed to G code transfer framework: after encoding using Recognition with Recurrent Neural Network to G code, passing through attention machine It makes, finally G code to be transformed is predicted in decoding, reduces error by using minimum cross entropy in the training process, final to obtain To trained G code transformation model.Using the formula for minimizing cross entropy reduction error are as follows:
Deep neural network model can be RNN (Recognition with Recurrent Neural Network) or shot and long term Recognition with Recurrent Neural Network, and Other neural networks.The model for reaching requirement by the final selection of multistage training is final mask, the G code which obtains Transformation model be a kind of dual model, the G code that can not only be transformed into Fa Nake by setting Central China numerical control system can also pass through hair That section is to Central China numerical control system.
Step 4: reading in every row G code in rows, and the G code of A digital control system is passed to G code transformation model, G Code conversion model encodes the G code of A digital control system, after attention mechanism, is decoded to A digital control system; Deep learning G code model database trained in advance is called, G code is translated;
Step 5: judging whether the translation conversion of the row is completed, and then continues to translate as unfinished, continues to sentence if completing Whether all disconnected translation terminates, and is such as not finished, then repeats step 4 to step 5, continue to read next line G code, if having tied Beam then exports the G code for generating target B digital control system.

Claims (7)

1. a kind of conversion method of numerical control G code, comprising the following steps:
Step 1: input G code is pre-processed:
Step 2: determining the G code type of current A digital control system and generates the type of the G code of target B digital control system;
Step 3: G code transfer framework is established based on neural network algorithm, and G code transfer framework is trained, obtains G Code conversion model;
Step 4: reading in every row G code in rows, and the G code of A digital control system is passed to G code transformation model, G code Transformation model encodes the G code of A digital control system, after attention mechanism, is decoded to A digital control system;It calls Trained deep learning G code model database in advance, translates G code;
Step 5: judging whether the translation conversion of the row is completed, and then continues to translate as unfinished, and continuing judgement if completing is No all translations terminate, and are such as not finished, then repeat step 4 to step 5, continue to read next line G code, if having terminated, Output generates the G code of target B digital control system.
2. the conversion method of numerical control G code according to claim 1, which is characterized in that the step 1 specific steps are as follows: The G code of input is split according to line number, every row is divided into a list, and to the element further division of every row.
3. the conversion method of numerical control G code according to claim 1, which is characterized in that the step 2 specific steps are as follows:
2-1) pass through data prediction, after extracting to each G code of the every row of data, statistical method is based on, to the G of input Code is judged: assign lesser weight firstly for the code of standard universal, for non-standard general code assign compared with Big weight, and possible generic is carried out to each G code and is given a mark, last score is counted, and according to power Weight is ranked up to small;
Digital control system belonging to the G code for 2-2) estimating input according to last highest score is possible, provides judging result, Confirmed by client;
2-3) selection needs the G code classification exported.
4. the conversion method of numerical control G code according to claim 1, which is characterized in that in the step 3, G code turns Change frame and is divided into coded portion and decoded portion;
In code area part, G code passes through XiIt carries out after being input to hidden layer, is encoded,
ht=Φ (ht-1,xt)=f (W(hh)ht-1+W(hx)xt)
Wherein XtFor input layer, XiFor input signal, htFor hidden layer, connected each other between hidden layer, W is weight;
The prediction under the complete semanteme of every a line of attention mechanism help G code generates next G code for meeting semanteme, without It is one-to-one simple local code;When hidden layer is after attention mechanism, attention mechanism is according to the whole sentence of G code of every row Semantic information q, the hidden layer h of final each G codetThe weighted average c of output onet=∑tstht, wherein coefficient stIt indicates With most degree of correlation in every row G code q;
In decoded portion, wherein
h′t=ct=φ (ct-1)=f (W(hh)ct-1)
yt=soft max (W(s)h′t)
h′tIndicate hidden layer, ytOutput is indicated, in forecast period, ytThe predicted value of G code after indicating conversion.
5. the conversion method of numerical control G code according to claim 4, which is characterized in that G code is converted in the step 3 The training process of frame are as follows:
3-1) input G code is pre-processed: the G code of input is split by line number, every row is divided into a list, and And to the G code further division of every row;
It should 3-2) be made by the G code of the A digital control system to same machining information and one sentence pair of G code of B digital control system For training set, off-line training neural network;
3-3) it is passed to G code transfer framework: after encoding using Recognition with Recurrent Neural Network to G code, by attention mechanism, most G code to be transformed is predicted in decoding afterwards, in the training process by using cross entropy reduction error is minimized, finally obtains training Good G code transformation model.
6. the conversion method of numerical control G code according to claim 5, which is characterized in that the step 3-3) in, using most The formula of smallization cross entropy reduction error are as follows:
7. the conversion method of numerical control G code according to claim 6, which is characterized in that in the step 4, pass through calling Trained G code transformation model, G code is after coding, attention mechanism, the value decoded, the mesh as to be converted Mark G code.
CN201910775600.8A 2019-08-21 2019-08-21 A kind of conversion method of numerical control G code Pending CN110488755A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910775600.8A CN110488755A (en) 2019-08-21 2019-08-21 A kind of conversion method of numerical control G code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910775600.8A CN110488755A (en) 2019-08-21 2019-08-21 A kind of conversion method of numerical control G code

Publications (1)

Publication Number Publication Date
CN110488755A true CN110488755A (en) 2019-11-22

Family

ID=68552649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910775600.8A Pending CN110488755A (en) 2019-08-21 2019-08-21 A kind of conversion method of numerical control G code

Country Status (1)

Country Link
CN (1) CN110488755A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346737A (en) * 2021-01-08 2021-02-09 深圳壹账通智能科技有限公司 Method, device and equipment for training programming language translation model and storage medium
CN113326581A (en) * 2021-05-28 2021-08-31 江麓机电集团有限公司 Genetic scheduling method based on combined production and equipment fault constraint

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081378A (en) * 2010-11-01 2011-06-01 北京数码大方科技有限公司 Method and device for converting universal code based on macroprogram
CN109543667A (en) * 2018-11-14 2019-03-29 北京工业大学 A kind of text recognition method based on attention mechanism
CN109614111A (en) * 2018-12-28 2019-04-12 北京百度网讯科技有限公司 Method and apparatus for generating code
CN109766355A (en) * 2018-12-28 2019-05-17 上海汇付数据服务有限公司 A kind of data query method and system for supporting natural language
CN109902862A (en) * 2019-02-13 2019-06-18 北京航空航天大学 A kind of time series forecasting system of time of fusion attention mechanism

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081378A (en) * 2010-11-01 2011-06-01 北京数码大方科技有限公司 Method and device for converting universal code based on macroprogram
CN109543667A (en) * 2018-11-14 2019-03-29 北京工业大学 A kind of text recognition method based on attention mechanism
CN109614111A (en) * 2018-12-28 2019-04-12 北京百度网讯科技有限公司 Method and apparatus for generating code
CN109766355A (en) * 2018-12-28 2019-05-17 上海汇付数据服务有限公司 A kind of data query method and system for supporting natural language
CN109902862A (en) * 2019-02-13 2019-06-18 北京航空航天大学 A kind of time series forecasting system of time of fusion attention mechanism

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李亚超 等: "神经机器翻译综述", 《计算机学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346737A (en) * 2021-01-08 2021-02-09 深圳壹账通智能科技有限公司 Method, device and equipment for training programming language translation model and storage medium
CN112346737B (en) * 2021-01-08 2021-04-13 深圳壹账通智能科技有限公司 Method, device and equipment for training programming language translation model and storage medium
CN113326581A (en) * 2021-05-28 2021-08-31 江麓机电集团有限公司 Genetic scheduling method based on combined production and equipment fault constraint
CN113326581B (en) * 2021-05-28 2022-07-19 江麓机电集团有限公司 Genetic scheduling method based on combined production and equipment fault constraint

Similar Documents

Publication Publication Date Title
CN110111399B (en) Image text generation method based on visual attention
CN110488755A (en) A kind of conversion method of numerical control G code
CN112818646B (en) Method for editing pictures according to text based on generation of countermeasure network and dynamic editing module
CN111652357B (en) Method and system for solving video question-answer problem by using specific target network based on graph
Zhao et al. Gaussian mixture density modeling of non-Gaussian source for autoregressive process
US5694128A (en) Tree structured binary arithmetic coder
EP1227595A3 (en) System and method for encoding an input data stream by utilizing a predictive, look-ahead feature
DE60316125D1 (en) METHOD FOR OPERATING A LANGUAGE DIALOG SYSTEM
CN108920472A (en) A kind of emerging system and method for the machine translation system based on deep learning
CN113591770A (en) Multimode fusion obstacle detection method and device based on artificial intelligence blind guiding
KR980011007A (en) Speech recognition method, information formation method, speech recognition apparatus and recording medium
CN108197123A (en) A kind of cloud translation system and method based on smartwatch
CN112634918B (en) System and method for converting voice of any speaker based on acoustic posterior probability
KR102061300B1 (en) Linear predictive coding apparatus, linear predictive decoding apparatus, methods thereof, programs and recording media
CN111898482A (en) Face prediction method based on progressive generation confrontation network
CN114168721A (en) Method for constructing knowledge enhancement model for multi-sub-target dialogue recommendation system
Nair et al. State estimation under bit-rate constraints
CN115346269A (en) Gesture motion recognition method
CN116486794A (en) Chinese-English mixed speech recognition method
CN114691858A (en) Improved UNILM abstract generation method
CN112348033B (en) Collaborative saliency target detection method
Chan et al. Generalized product code vector quantization: A family of efficient techniques for signal compression
CN101477686B (en) Nonsupervision image segmentation process based on clone selection
KR20190019460A (en) Apparatus and method for discriminating vocoder type
CN115407874B (en) VR maintenance training operation proficiency prediction method based on neural network

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191122