[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN106681275B - A kind of prediction forecasting method of nc program section - Google Patents

A kind of prediction forecasting method of nc program section Download PDF

Info

Publication number
CN106681275B
CN106681275B CN201510745462.0A CN201510745462A CN106681275B CN 106681275 B CN106681275 B CN 106681275B CN 201510745462 A CN201510745462 A CN 201510745462A CN 106681275 B CN106681275 B CN 106681275B
Authority
CN
China
Prior art keywords
interpreter
auxiliary
section
main
preanalysis
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
CN201510745462.0A
Other languages
Chinese (zh)
Other versions
CN106681275A (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.)
Liaocheng Lusheng Numerical Control Machinery Co Ltd
Shenyang Institute of Computing Technology of CAS
Original Assignee
Liaocheng Lusheng Numerical Control Machinery Co Ltd
Shenyang Institute of Computing Technology of CAS
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 Liaocheng Lusheng Numerical Control Machinery Co Ltd, Shenyang Institute of Computing Technology of CAS filed Critical Liaocheng Lusheng Numerical Control Machinery Co Ltd
Priority to CN201510745462.0A priority Critical patent/CN106681275B/en
Publication of CN106681275A publication Critical patent/CN106681275A/en
Application granted granted Critical
Publication of CN106681275B publication Critical patent/CN106681275B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/408Numerical 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 data handling or data format, e.g. reading, buffering or conversion of data
    • G05B19/4083Adapting programme, configuration
    • 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/34Director, elements to supervisory
    • G05B2219/34167Coarse fine, macro microinterpolation, preprocessor

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The present invention is to belong to numerical control program language interpretation field, specifically a kind of prediction forecasting method of nc program section.In order to realize that the prediction of program segment prefetches, explain double interpreter structures that the software module of processing program uses main interpreter and auxiliary interpreter forms, the several program segments of the auxiliary advanced main interpreter of interpreter, preanalysis is carried out to several program segments of prediction, the parameter obtained after preanalysis is write toward memory buffer, uses for main interpreter when explaining present procedure section;The parameter that main interpreter needs down-stream section in analysis present procedure Duan Shiru, can read the parameter of auxiliary interpreter preanalysis from memory buffer, complete the interpretive analysis of present procedure section, generate actual machine tool action instruction.The present invention is on the basis of preferably inheriting original software achievement, and by adding a supplementary explanation device, the prediction for realizing processing program section is prefetched, and the realization for complicated G code function provides a good basis.

Description

A kind of prediction forecasting method of nc program section
Technical field
The present invention relates to the interpretation field of processing program language (G code) in digital control system, specifically a kind of processing The prediction forecasting method of program segment.
Background technique
In digital control system, the explanation of processing program is usually to read in one section of processing program, so as unit of program segment Afterwards to the carry out syntax and semantics analysis of this program segment keyword one by one, so that corresponding practical machine tool action order is generated, Such as straight-line feed, circular arc feeding opens cooling, main shaft forward or reverse.But certain ginsengs of present procedure section are determined sometimes Number generally requires to carry out Conjoint Analysis, when such as cutter radius compensation, the end of current kinetic section to several subsequent processing program sections The determination of point coordinate and interference checking need the common parsing to subsequent one or more motor segments;But it is subsequent at this time Processing program section is read in not yet, is not analyzed, causes the interpretive analysis of present procedure section difficult.Conventional processing method is The parsing for postponing present procedure section, related command parameter is stored, the dissection process of following program segment is then carried out, until correlation Condition meets, and command parameter stored above is just carried out reprocessing and forms actual machine tool action order;Such method lacks Point is to bring complicated coding to the processing of interpreter software data flow to realize.
Summary of the invention
In order to solve the case where interpretive analysis of present procedure section relies on down-stream section, the invention proposes a kind of principal solutions It releases device and auxiliary interpreter cooperates, the prediction forecasting method of concurrent working, by several journeys of the advanced main interpreter of auxiliary interpreter Sequence section completes prefetching and working the preanalysis of these prediction program segments for these prediction program segments, by what is obtained after preanalysis Parameter sends main interpreter to, so that main interpreter when analyzing present procedure section, can obtain completely relying on parameter.
The technical solution adopted by the invention is as follows: a kind of prediction forecasting method of nc program section, including following step It is rapid:
When the explanation of today's numerical control processing program section relies on down-stream section, several journeys of the auxiliary advanced main interpreter of interpreter Sequence section generates preanalysis parameter, and main interpreter completes the interpretive analysis of current processing program section with reference to preanalysis parameter, obtains machine Bed action command is for controlling numerically-controlled machine tool.
Several program segments of the advanced main interpreter of auxiliary interpreter generate preanalysis parameter, and main interpreter refers to preanalysis Parameter completes the interpretive analysis of current processing program section, obtain machine tool action instruction the following steps are included:
Into double interpreter working methods: main interpreter initializes auxiliary interpreter, auxiliary interpreter since present procedure section, Several subsequent program segments are prefetched, the preanalysis parameter obtained after preanalysis is write toward core buffer, and main interpreter refers to these After the preanalysis parameter of down-stream section, to present procedure section interpretive analysis, machine tool action instruction is generated;
Double interpreter concurrent workings: main interpreter reads in next program segment, and auxiliary interpreter also reads in forward next journey Sequence section, auxiliary interpreter several program segments that always advanced main interpreter is fixed;Auxiliary interpreter first analyzes the program of oneself reading Section writes obtained preanalysis parameter toward core buffer interactive between the two after preanalysis;Main interpreter is slow with reference to memory The preanalysis parameter in area is rushed, the interpretive analysis to present procedure section is completed;
When the interpretive analysis of current processing program section does not depend on down-stream section, main interpreter closes auxiliary interpreter, principal solution Device autonomous working is released, does not analyze current processing program section referring again to preanalysis parameter interpretation.
The main interpreter and the shared data and method of auxiliary interpreter are encapsulated in an interpreter base class, main interpreter It is derived from auxiliary interpreter from this base class.
Beneficial effects of the present invention and advantage:
1. the present invention can inherit pervious interpreter software achievement completely, and increase little feelings in interpreter calculation amount Realize that the prediction of processing program section prefetches under condition, the number for program segment of looking forward to the prospect is configurable, relatively more flexible.
2. invention software structure is simple, data flow is clear, it is easy to encode realization.
Detailed description of the invention
Fig. 1 is the class-hierarchy structure gragh of interpreter software;
Fig. 2 is the work structuring figure that prediction prefetches double interpreters when program segment;
Fig. 3 is work flow diagram when assisting interpreter starting;
Syntactic analysis controlling stream graph when Fig. 4 is double interpreter concurrent workings;
Semantic analysis controlling stream graph when Fig. 5 is double interpreter concurrent workings.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and embodiments.
Conversion process by single interpreter working method to the double interpreter working methods for prefetching program segment of looking forward to the prospect is as follows:
1) auxiliary interpreter is initialized, auxiliary interpreter prediction prefetches several program segments.
Initialize auxiliary interpreter, replicate the global working condition of main interpreter to supplementary explanation device, then auxiliary interpreter from The working condition of main interpreter is set out, and the program segment of specified number is prefetched, after preanalysis by obtained preanalysis parameter in It deposits buffer area and passes to main interpreter, after main interpreter obtains these preanalysis parameters, present instruction could be continued to solve Analysis is released, machine tool action instruction is generated, completes the processing of current processing program section.
2) major-minor two interpreter concurrent workings.
After the prediction of auxiliary interpreter takes the program segment of specified number in advance, main interpreter according to the supplemental characteristic of preanalysis, Also the interpretive analysis for completing present procedure section, after generating machine tool action instruction, major-minor two interpreters have been entered simultaneously and concurrently Working stage.The mobile file pointer of main interpreter reads in a program segment, and auxiliary interpreter also reads in forward a program segment, auxiliary solution Release the device always fixed several program segments of advanced main interpreter;Auxiliary interpreter first analyzes the program segment of oneself reading, preanalysis (language Method analysis and semantic analysis) after obtained supplemental characteristic is write toward core buffer interactive between the two, auxiliary interpreter at this time The analysis of program segment is terminated;Hereafter the parsing work for the present procedure section read in oneself could be unfolded in main interpreter, generate Actual machine tool action instruction.It is worth noting that, after the analysis of main interpreter present procedure section, also memory buffer Middle correspondence is deleted when the pre-analysis data of leading portion;Otherwise, it may result in main interpreter in the next program segment of interpretive analysis pair There is mistake or buffer overflow in the understanding for the parameter that preanalysis obtains.
3) auxiliary interpreter is closed.
When main interpreter does not need pre- reading instruction of looking forward to the prospect, so that it may close auxiliary interpreter.
It should be noted that auxiliary interpreter is that the program segment prefetched to prediction explains analysis, it is practical there is no generating Machine tool action instruction, these program segments prefetched, main interpreter will also explain analysis again, at this moment just will form reality Machine tool action instruction.
As shown in Fig. 2, due to the concurrent working of major-minor two interpreters, so that the interpreter module phase in digital control system Calculation amount increases when for the work of single interpreter, considers further that the processing program section for needing prediction to prefetch down-stream section is limited, So the case where being not necessarily all major-minor interpreter concurrent working during the entire process of explaining processing program, but work as main interpreter It was found that at this moment can just initialize when the G code instruction of current dissection process needs down-stream section and open auxiliary interpreter, hereafter Major-minor two interpreter concurrent workings may turn off auxiliary solution when main interpreter, which no longer needs to look forward to the prospect, prefetches subsequent program segment Device is released, single interpreter working method is reentered.
Explain that the software module of processing program is divided into two kinds of operating modes of single interpreter and double interpreters, present procedure section When explanation does not depend on down-stream section, only main interpreter works;It is major-minor when the explanation of present procedure section relies on down-stream section Two interpreters work at the same time.
Using the RS274/NGC interpreter of open source as source, be discussed in more detail how on the basis of this interpreter structure It makes one and can look forward to the prospect and prefetch the interpreter software module of program segment.
Using object-oriented programming method, major-minor interpreter is shared and identical data and method are packaged into one A base class basic_interpreter, such as description interpreter global state _ setup structure, each field of processing program section is described The block structure of parameter is opened file open (), carry out the read () of syntactic analysis, read_a () ..., read_z (), And it is other;The correlation technique of semantic analysis is mended if convert_... () function can be claimed as pure virtual function by derived class It fills.Main interpreter and auxiliary interpreter are packaged into two classes main_interpreter and assistant_ respectively Interpreter, the two derive to obtain (with reference to attached drawing 1) from basic_interpreter class;But the semantic analysis of the two Module is very different, and the methods of the semantic analysis convert_... () of former RS274/NGC interpreter can be indiscriminately imitated master Interpreter, the instruction processing part for needing to prefetch program segment is modified slightly, and the semantic analysis convert_... of auxiliary interpreter () method and main interpreter are very different, it does not generate actual machine tool action instruction, are rewritten as needed;But it to infuse It anticipates and arrives, what not all convert_... () method required, when such as cutter radius compensation, pre-read in program segment us Only need to handle movement instruction, other auxiliary interpreters do not need, so the encoding amount of auxiliary processor is very limited.
The recapitulative realization framework for describing interpretation software module above, below with a specifically example introduction explanation Software module is prefetched the conversion process and realization of double interpreter working methods of program segment by single interpreter working method to prediction Method, the starting including auxiliary interpreter, the closing of double interpreter concurrent workings and auxiliary interpreter.
When carrying out cutter radius compensation, subsequent one or multiple motor segments are needed to carry out the calculating of terminal point coordinate and do Inspection is related to, then opening at first encountered the movement instruction after radius compensation, calls auxiliary interpreter respectively by main interpreter (assistant_interpreter) init () and open () method initialize auxiliary interpreter and open processing program text Part, then by the duplication of the global state of main interpreter _ set_up structural body variable it is a to auxiliary interpreter _ set_up variable, Then several times, prediction is pre- by the read () and execute () method for calling auxiliary interpreter (assistant_interpreter) Several segments processing program is read, the parameter pre-processed (mainly coordinate) is write into core buffer (with reference to attached by auxiliary interpreter Fig. 3);Hereafter control stream can just come back to main interpreter, and main interpreter is completed to open according to the pre-analysis data of auxiliary interpreter The processing of first motor segment after radius compensation.
Then into double interpreter working conditions, when read () method of main interpreter (main_interpreter) is adjusted Used time, read () method of auxiliary interpreter is called in the read () of main interpreter, auxiliary interpreter takes forward prior to main interpreter A processing program section out carries out the syntactic analysis of program segment, and then control flow back into read () method of main interpreter, complete At the syntactic analysis (referring to attached drawing 4) of the present procedure section of main interpreter.When the side execute () of main_interpreter When method is called, call execute () method of auxiliary interpreter in the execute () of main interpreter, auxiliary interpreter prior to Main interpreter completes semantic analysis to program segment, after auxiliary interpreter preanalysis to parameter (mainly coordinate) write toward memory Buffering, hereafter control flow back into the execute () of main interpreter, completes the semantic analysis (ginseng of the present procedure section of main interpreter Examine attached drawing 5).
It when exiting radius compensation (G40), is gone to close auxiliary interpreter by main interpreter, entire module work is in single solution at this time Release device state.

Claims (2)

1. a kind of prediction forecasting method of nc program section, it is characterised in that: use main interpreter and auxiliary interpreter group At double interpreter structures;Method includes:
When the explanation of today's numerical control processing program section relies on down-stream section, the main interpreter is several in advance for the auxiliary interpreter A program segment generates preanalysis parameter, and the main interpreter completes the explanation point of current processing program section with reference to preanalysis parameter Analysis obtains machine tool action instruction for controlling numerically-controlled machine tool;
It mainly comprises the steps that
(1) enter double interpreter working methods: main interpreter initializes auxiliary interpreter, auxiliary interpreter since present procedure section, Several subsequent program segments are prefetched, the preanalysis parameter obtained after preanalysis is write toward core buffer, and main interpreter refers to these After the preanalysis parameter of down-stream section, to present procedure section interpretive analysis, machine tool action instruction is generated;
(2) double interpreter concurrent workings: main interpreter reads in next program segment, and auxiliary interpreter also reads in forward next program Section, auxiliary interpreter several program segments that always advanced main interpreter is fixed;Auxiliary interpreter first analyzes the program segment of oneself reading, Obtained preanalysis parameter is write toward core buffer interactive between the two after preanalysis;Main interpreter refers to core buffer In preanalysis parameter, complete to the interpretive analysis of present procedure section;
(3) exit double interpreter working methods: when the interpretive analysis of current processing program section does not depend on down-stream section, principal solution is released Device closes auxiliary interpreter, and main interpreter works independently, and does not analyze current processing program section referring again to preanalysis parameter interpretation.
2. a kind of prediction forecasting method of nc program section according to claim 1, which is characterized in that the principal solution The shared data and method for releasing device and auxiliary interpreter are encapsulated in an interpreter base class, main interpreter and auxiliary interpreter from this Base class derives from.
CN201510745462.0A 2015-11-05 2015-11-05 A kind of prediction forecasting method of nc program section Active CN106681275B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510745462.0A CN106681275B (en) 2015-11-05 2015-11-05 A kind of prediction forecasting method of nc program section

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510745462.0A CN106681275B (en) 2015-11-05 2015-11-05 A kind of prediction forecasting method of nc program section

Publications (2)

Publication Number Publication Date
CN106681275A CN106681275A (en) 2017-05-17
CN106681275B true CN106681275B (en) 2019-04-09

Family

ID=58858814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510745462.0A Active CN106681275B (en) 2015-11-05 2015-11-05 A kind of prediction forecasting method of nc program section

Country Status (1)

Country Link
CN (1) CN106681275B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273134B (en) * 2017-06-23 2020-08-07 深圳市雷赛控制技术有限公司 Numerical control program execution method and device
CN109669880A (en) * 2017-10-13 2019-04-23 展讯通信(上海)有限公司 A kind of data prefetching method and device, microprocessor
JP6838031B2 (en) * 2018-10-31 2021-03-03 ファナック株式会社 Numerical control system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008165324A (en) * 2006-12-27 2008-07-17 Fanuc Ltd Program creation support device
CN101510087A (en) * 2009-01-21 2009-08-19 西安交通大学 Forward looking self-adapting speed controlling method for high-speed processing tiny line segment
CN101833306A (en) * 2010-05-12 2010-09-15 中国科学院沈阳计算技术研究所有限公司 Multi-program-segment continuous acceleration and deceleration control method based on advanced-filter technology
CN101957611A (en) * 2009-07-16 2011-01-26 中国科学院沈阳计算技术研究所有限公司 Spline real-time interpolation method
CN102193530A (en) * 2010-03-10 2011-09-21 中国科学院自动化研究所 Numerical control system and control method based on dual-core architecture teamwork
CN102540973A (en) * 2010-12-09 2012-07-04 中国科学院沈阳计算技术研究所有限公司 Implementation method for command multi-transmitting mechanism of numerical control system
CN102540964A (en) * 2010-12-09 2012-07-04 中国科学院沈阳计算技术研究所有限公司 Processing program interpreter implementation method for numerical control system with single motor to drive multiple shafts
CN102789196A (en) * 2012-08-28 2012-11-21 北京航空航天大学 Method for optimizing integral structure configuration of special machine tool based on post information
CN104281096A (en) * 2013-07-08 2015-01-14 广州中国科学院先进技术研究所 Construction method of numerical-control code compiler
CN104570959A (en) * 2013-10-18 2015-04-29 发那科株式会社 Numerical controller provided with program pre-reading function

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008165324A (en) * 2006-12-27 2008-07-17 Fanuc Ltd Program creation support device
CN101510087A (en) * 2009-01-21 2009-08-19 西安交通大学 Forward looking self-adapting speed controlling method for high-speed processing tiny line segment
CN101957611A (en) * 2009-07-16 2011-01-26 中国科学院沈阳计算技术研究所有限公司 Spline real-time interpolation method
CN102193530A (en) * 2010-03-10 2011-09-21 中国科学院自动化研究所 Numerical control system and control method based on dual-core architecture teamwork
CN101833306A (en) * 2010-05-12 2010-09-15 中国科学院沈阳计算技术研究所有限公司 Multi-program-segment continuous acceleration and deceleration control method based on advanced-filter technology
CN102540973A (en) * 2010-12-09 2012-07-04 中国科学院沈阳计算技术研究所有限公司 Implementation method for command multi-transmitting mechanism of numerical control system
CN102540964A (en) * 2010-12-09 2012-07-04 中国科学院沈阳计算技术研究所有限公司 Processing program interpreter implementation method for numerical control system with single motor to drive multiple shafts
CN102789196A (en) * 2012-08-28 2012-11-21 北京航空航天大学 Method for optimizing integral structure configuration of special machine tool based on post information
CN104281096A (en) * 2013-07-08 2015-01-14 广州中国科学院先进技术研究所 Construction method of numerical-control code compiler
CN104570959A (en) * 2013-10-18 2015-04-29 发那科株式会社 Numerical controller provided with program pre-reading function

Also Published As

Publication number Publication date
CN106681275A (en) 2017-05-17

Similar Documents

Publication Publication Date Title
CN111881401B (en) WebAssemble-based browser deep learning method and system
CN106681275B (en) A kind of prediction forecasting method of nc program section
EP2418577A1 (en) Application of optimization techniques to intermediate representations for code generation
KR20220002823A (en) Method, device and electronic equipment for deploying operators in deep learning framework
CN104573193A (en) Rapid designing method for GNC (Guidance, Navigation and Control) system of spacecraft
CN108197027A (en) Software performance optimization method, can storage medium, computer, computer program
KR101826828B1 (en) System and method for managing log data
CN110471659B (en) Multilingual implementation method and system, man-machine interface configuration software end and equipment end
Pohl et al. vMAGIC—automatic code generation for VHDL
CN110795165A (en) Neural network model data loading method and related device
CN110968404B (en) Equipment data processing method and device
EP4330810A1 (en) Code injection from natural language derived intent
KR950702721A (en) A controller for a computer program executing multiple threads that enables optional graphical user interface (GUI) control and command line (TTY) control from a terminal emulator or user program. (Controller for computer program running multiple threads enabling selective graphic user Interface (GUI) control and command line (TTY) control from terminal emulator or user program)
US7574688B1 (en) Using high-level language functions in HDL synthesis tools
CN110502439B (en) Debugging method, device, electronic equipment and storage medium
CN109710244B (en) User-defined animation configuration method and device, equipment and storage medium
Fleischmann et al. Java driven codesign and prototyping of networked embedded systems
Llorach et al. Say hi to eliza: An embodied conversational agent on the web
JP2009515243A (en) Method for generating a simulation program executable on a host computer
CN105868092A (en) Log file processing method and device
Hofmann et al. XBERT: Xilinx Logical-Level Bitstream Embedded RAM Transfusion
CN116009836B (en) RPA programming method, device, equipment and storage medium based on script language
Hassairi et al. Matlab/systemc for the new co-simulation environment by jpeg algorithm
JP2001255912A (en) Method for executing motion program
CN106444629B (en) A kind of control method based on insertion expression formula program

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