CN106444629B - A kind of control method based on insertion expression formula program - Google Patents

A kind of control method based on insertion expression formula program Download PDF

Info

Publication number
CN106444629B
CN106444629B CN201611122693.7A CN201611122693A CN106444629B CN 106444629 B CN106444629 B CN 106444629B CN 201611122693 A CN201611122693 A CN 201611122693A CN 106444629 B CN106444629 B CN 106444629B
Authority
CN
China
Prior art keywords
expression formula
variable
formula
code
curve
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
CN201611122693.7A
Other languages
Chinese (zh)
Other versions
CN106444629A (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.)
Hunan Smart Automation Technology Co Ltd
Original Assignee
Hunan Smart Automation Technology 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 Hunan Smart Automation Technology Co Ltd filed Critical Hunan Smart Automation Technology Co Ltd
Priority to CN201611122693.7A priority Critical patent/CN106444629B/en
Publication of CN106444629A publication Critical patent/CN106444629A/en
Application granted granted Critical
Publication of CN106444629B publication Critical patent/CN106444629B/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/404Numerical 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 control arrangements for compensation, e.g. for backlash, overshoot, tool offset, tool wear, temperature, machine construction errors, load, inertia
    • 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/35Nc in input of data, input till input file format
    • G05B2219/35185Select optimum tool radius

Abstract

The present invention provides a kind of control method based on insertion expression formula program, including, increase instruction in insertion expression formula and is used as starting and ending;The insertion expression formula includes that variable-definition part, parameter curve or parametric surface mathematic formula part and boundary condition definition, resolution define part;The variable-definition part, variable needed for defining the mathematic formula;Code parser parses and executes the insertion expression formula;The code parser of digital control system substitutes into parameter to expression formula according to the boundary condition and resolution of machine tooling setting and curve or curved surface and calculates, and obtains motion profile point, and the tracing point being calculated is stored among annular FIFO caching;Interpolator of CNC System carries out feed speed control and prediction smooth control according to these tracing points.Control method of the invention simplifies the programmed method of complex curve or curved surface, enhances the intuitive of code;Real-time, the execution efficiency for simultaneously executing code greatly promote.

Description

A kind of control method based on insertion expression formula program
Technical field
The invention belongs to industrial control fields, and in particular to a kind of control method based on insertion expression formula program.
Background technique
In industrial control field, common digital control system language or robot language have G code.The programming energy of G code Power is powerful, and easy to learn, however it only directly supports straight line and circular arc.For complicated curve and curved surface, we can be used Straight line and the circular arc segmentation of segment are approached.For complicated parameter curve and curved surface programming, embedding parameter, letter can be passed through Calculating, and circulation, skip instruction are counted to realize.However digital control system is needed when executing the programming of this mode to expression Formula does a large amount of calculating, is not suitable for the occasion of high-speed, high precision.In addition, this programmed method intuitive readability is very poor, programming Difficulty is also big.For robot language, there are same difficulties.
The common software for mathematical computing such as Matlab, Maple, Mathmatica, in the complicated curve of description, use It is intuitive expression formula method.The programmed method of this expression formula can equally make the most of the advantage in numerical control programming.
Summary of the invention
There is scene property in view of numerical control programming, allow programming that there is intuitive can bring huge economic benefit, the present invention mentions A kind of control method based on insertion expression formula program out, comprising:
Increase instruction in insertion expression formula and is used as starting and ending;
The insertion expression formula includes variable-definition part, parameter curve or parametric surface mathematic formula part and side Boundary's conditional definition, resolution define part;The variable-definition part, variable needed for defining the mathematic formula;
Code parser parses and executes the insertion expression formula;
Code parser is according to machine tooling or robot manipulating task task setting and the boundary condition of curve or curved surface And resolution substitutes into parameter to expression formula and calculates, and obtains motion profile point, and the tracing point being calculated is stored in annular Among FIFO caching;Digital control system carries out lathe or robot feed speed control and the smooth control of prediction according to these tracing points System.
Further, the expression formula carries out carrying out tool radius and length compensation when tracing point calculating.
Further, the expression formula is first compiled into scripting language bytecode when calculating.
The beneficial effects of the present invention are: simplifying the programmed method of complex curve or curved surface, enhance the intuitive of code;Together When execute code real-time, execution efficiency greatly promotes.
Detailed description of the invention
Fig. 1 is that the present invention is based on the flow charts of one embodiment of the control method of insertion expression formula program.
Specific embodiment
Below by taking one embodiment as an example, specific implementation of the invention is described.
The present invention proposes a kind of control method based on insertion expression formula program, comprising: agreement instruction is as insertion expression The starting and ending of formula;The expression formula includes variable-definition part, parameter curve or parametric surface mathematic formula part, and Boundary condition definition, resolution define part;The variable-definition part, variable needed for defining the mathematic formula;Generation Code resolver parses and executes this section of expression formula;
Numerical control system code resolver is according to machine tooling setting and the boundary condition and resolution of curve or curved surface Parameter is substituted into expression formula to calculate, and obtains motion profile point, these tracing points being calculated are stored in annular FIFO and cache it In;Interpolator of CNC System carries out feed speed control and prediction smooth control according to these tracing points.
The expression formula carries out that tool radius and length compensation can be carried out when tracing point calculating;
The Interpolator of CNC System carries out feed speed control and prediction smooth control, control strategy according to these tracing points It is set by kinetic control system.
The control method based on insertion expression formula program of the present embodiment, simplifies the programmed method of complex curve or curved surface, Making the intuitive of code enhances;Real-time, the execution efficiency for simultaneously executing code greatly promote.
As shown in Figure 1, for the present invention is based on the flow charts of one embodiment of the control method of insertion expression formula program.From In figure as can be seen that the present embodiment the following steps are included:
Step 101: starting and ending of the agreement G instruction as insertion expression formula instructs statement expression formula interpolation to open with G Begin and terminates.
Step 102:G code parser parses and executes this section of expression formula, and insertion expression formula includes variable-definition part, ginseng Number curve or parametric surface mathematic formula part and boundary condition definition, resolution define part;The variable-definition portion Point, variable needed for defining the mathematic formula.
Step 103: the G code resolver of digital control system is according to machine tooling setting and the boundary condition of curve or curved surface And resolution substitutes into parameter to expression formula and calculates, and obtains motion profile point.
Step 104: the tracing point being calculated is stored among annular FIFO caching.
Step 105: Interpolator of CNC System carries out feed speed control and prediction smooth control according to these tracing points.
Through the above steps, the programmed method for simplifying complex curve or curved surface, enhances the intuitive of code;Make generation simultaneously Real-time, the execution efficiency of code execution greatly promote.
It realizes the control method proposed by the present invention based on insertion expression formula program, first has to the G generation for making digital control system Code resolver support insertion expression formula, it is therefore desirable to G instruction statement expression formula interpolation beginning and end, one embodiment be using G32 statement expression formula interpolation starts, and G33 statement expression formula interpolation terminates.
Here is the embodiment of an expression formula format.
Arrange the entitled underscore of expression formula variable, number, alphabetical any combination, but cannot be started with number;Such as word Symbol string Helix_Z can be used for variable name.Arranging X, Y, Z, A, B, C is reserved word, represents the numerical value of XYZABC axis.
Agreement " > > " it is that bound of parameter range defines connector, "@" is resolution, such as t=1.00 > > 10.00@0.1;It is fixed The justice range (1.00mm-10.00mm) of parameter t, resolution 0.1mm.Arranging 1.00 10.00 can be replaced with expression formula. Such as t=(10.00-8.00)/2 > > 10.00@0.1;It is correct.
Agreement expression formula can carry out+- */%^ | and the basic mathematicals such as & calculate, and C language standard function library is supported to calculate;About The grammar rule for determining expression formula is consistent with C language.
It is the example for processing an elliptical code below:
G32
Alpha=0 > > 2.1*PI@0.001;
AX=100;//X-axis length
AY=80;//Y-axis length
X=AX*cos (alpha);
Y=AY*sin (alpha);
G33
In the operational process of this section of code, the G code resolver of digital control system will recognise that X, Y, Z, A, B, C reserved word And calculation expression, then determine variable element, and since the initial value of variable element by resolution set stepping Incremental calculation expression formula, obtains interpolated point;Such as t=1.00 > > 10.00@0.1, initial point t=1.00, subsequent point is t= 1.10,1.20,1.30 ..., t substitute into expression formula as parameter and are calculated, and obtain interpolated point.If code is in compilation process The middle discovery syntax calculate mistake, and digital control system will not execute this section of code, and report an error.
When carrying out interpolated point calculating, often quickly due to calculating speed, data point is very big, and it is slow to execute speed, and is The caching of system is often limited, therefore interpolation data point is stored in annular FIFO caching;The tail unit of annular FIFO caching Next unit is the first unit of annular FIFO caching, and this structure can prevent memory from overflowing;When caching is full, stop interpolation at once It calculates, waits the generation for caching new space.
Due to expression formula computational short cut code, the speed for calculating interpolated point can be accelerated;By Expression Compiling at being similar to The bytecode of scripting language simulates CPU operation by bytecode virtual machine because bytecode simulates the machine code of CPU operation, Calculating the speed for executing and will increase exponentially.
Due in actual processing, generally requiring the compensation of progress tool radius, therefore the expression formula carries out tracing point Tool radius and length compensation can be carried out when calculating, to be carried out the offset in path according to tool radius and length at this time, be made The actual curve and curved surface that machine tooling generates are consistent with programming input;Digital control system is according to parameter curve or curved surface and side The constraint of boundary's condition and processing setting carries out tool radius and length compensation carries out tracing point calculating.The digital control system according to These tracing points carry out the feed speed control of lathe and the control of prediction smooth control.The feed speed control and prediction is smooth The control strategy of control is set by kinetic control system.
It should be noted that all statements for using " first " and " second " are for differentiation two in the embodiment of the present invention The non-equal entity of a same names or non-equal parameter, it is seen that " first " " second " only for the convenience of statement, does not answer It is interpreted as the restriction to the embodiment of the present invention, subsequent embodiment no longer illustrates this one by one.
It should be understood by those ordinary skilled in the art that: the discussion of any of the above embodiment is exemplary only, not It is intended to imply that the scope of the present disclosure (including claim) is limited to these examples;Under thinking of the invention, above embodiments Or can also be combined between the technical characteristic in different embodiments, step can be realized with random order, and be existed such as Many other variations of the upper different aspect of the invention, for simplicity, they are not provided in details.
In addition, to simplify explanation and discussing, and in order not to obscure the invention, it can in provided attached drawing It is connect with showing or can not show with the well known power ground of integrated circuit (IC) chip and other components.Furthermore, it is possible to Device is shown in block diagram form, to avoid obscuring the invention, and this has also contemplated following facts, i.e., about this The details of the embodiment of a little block diagram arrangements be height depend on will implementing platform of the invention (that is, these details should It is completely within the scope of the understanding of those skilled in the art).Elaborating that detail (for example, circuit) is of the invention to describe In the case where exemplary embodiment, it will be apparent to those skilled in the art that can be in these no details In the case where or implement the present invention in the case that these details change.Therefore, these descriptions should be considered as explanation Property rather than it is restrictive.
Although having been incorporated with specific embodiments of the present invention, invention has been described, according to retouching for front It states, many replacements of these embodiments, modifications and variations will be apparent for those of ordinary skills.Example Such as, discussed embodiment can be used in other memory architectures (for example, dynamic ram (DRAM)).
The embodiment of the present invention be intended to cover fall into all such replacements within the broad range of appended claims, Modifications and variations.Therefore, all within the spirits and principles of the present invention, any omission, modification, equivalent replacement, the improvement made Deng should all be included in the protection scope of the present invention.

Claims (2)

1. a kind of control method based on embedded expression formula program, including,
Increase instruction in embedded expression formula and is used as starting and ending;
The embedded expression formula includes variable-definition part, parameter curve or parametric surface mathematic formula part and boundary Conditional definition, resolution define part;The variable-definition part, variable needed for defining the mathematic formula;
Code parser parses and executes the embedded expression formula;
It is characterized in that, code parser is according to machine tooling or robot manipulating task task setting and the side of curve or curved surface Boundary's condition and resolution substitute into parameter to expression formula and calculate, and obtain motion profile point, and the tracing point being calculated is stored Among annular FIFO caching;Digital control system carries out lathe or robot feed speed control according to these tracing points and prediction is flat Slip control system, the embedded expression formula carry out carrying out tool radius and length compensation when tracing point calculating;
Boundary and the stepping of variable are determined with an expression formula, and arrange G instruction statement interpolation starting and ending;
The embedded expression formula format are as follows: arrange the embedded entitled underscore of expression formula variable, number, alphabetical any group It closes, but cannot be with number beginning;Arranging X, Y, Z, A, B, C is reserved word, represents the numerical value of XYZABC axis;
Agreement " > > " it is that bound of parameter range defines connector, "@" is resolution;
+-*/%^ can be carried out by arranging embedded expression formula | and & basic mathematical calculates, and C language standard function library is supported to calculate;About The grammar rule of fixed embedded expression formula is consistent with C language.
2. the control method according to claim 1 based on embedded expression formula program, which is characterized in that described embedded Expression formula is first compiled into scripting language bytecode when calculating.
CN201611122693.7A 2016-12-08 2016-12-08 A kind of control method based on insertion expression formula program Active CN106444629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611122693.7A CN106444629B (en) 2016-12-08 2016-12-08 A kind of control method based on insertion expression formula program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611122693.7A CN106444629B (en) 2016-12-08 2016-12-08 A kind of control method based on insertion expression formula program

Publications (2)

Publication Number Publication Date
CN106444629A CN106444629A (en) 2017-02-22
CN106444629B true CN106444629B (en) 2019-11-12

Family

ID=58217361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611122693.7A Active CN106444629B (en) 2016-12-08 2016-12-08 A kind of control method based on insertion expression formula program

Country Status (1)

Country Link
CN (1) CN106444629B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101362128A (en) * 2007-08-06 2009-02-11 比亚迪股份有限公司 Tridimensional glue coater control method and tridimensional glue coating method
CN103048947A (en) * 2012-12-29 2013-04-17 东方电气集团东方汽轮机有限公司 Numerical control program post-processing method for five-coordinate linkage machine tools

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101362128A (en) * 2007-08-06 2009-02-11 比亚迪股份有限公司 Tridimensional glue coater control method and tridimensional glue coating method
CN103048947A (en) * 2012-12-29 2013-04-17 东方电气集团东方汽轮机有限公司 Numerical control program post-processing method for five-coordinate linkage machine tools

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
C++的G代码解析算法研究;梁远标;《机械设计与制造》;20160331(第3期);全文 *
可配置的数控G代码解释器的设计与实现;赵炎;《组合机床与自动化加工技术》;20130731(第7期);全文 *
运用FANUC数控系统的椭圆插补指令开发;吕孝敏;《现代制造工程》;20131031(第10期);第56-59页以及第78页 *

Also Published As

Publication number Publication date
CN106444629A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
CN101763447B (en) Automatic data conversion method between three-dimensional modeling software and finite element analysis software
US8577655B2 (en) System and method for constructing virtual NC controllers for machine tool simulation
CN103077064B (en) A kind of parsing also executive language method and interpreting means
CN104281096B (en) The building method of NC code compiler
CN108197027B (en) Software performance optimization method, storable medium, computer program
Liu et al. An intelligent NC program processor for CNC system of machine tool
JP5926358B1 (en) Tool path curving method and curving device for ensuring shape error
CN104573193A (en) Rapid designing method for GNC (Guidance, Navigation and Control) system of spacecraft
US8732679B2 (en) Loop transformation for computer compiler optimization
CN110309629A (en) A kind of web page code reinforcement means, device and equipment
CN106444629B (en) A kind of control method based on insertion expression formula program
CN104793568A (en) Multi-axle interpolation method
CN105988854A (en) Dynamic compilation method and apparatus
CN103942082A (en) Complier optimization method for eliminating redundant storage access operations
CN103838616A (en) Tree program branch based computer program immediate compiling method
CN110488738B (en) Code generation method and device
CN106681275B (en) A kind of prediction forecasting method of nc program section
CN105607569B (en) A kind of method and device that IL language is converted to ladder diagram
CN112527304A (en) Self-adaptive node fusion compiling optimization method based on heterogeneous platform
CN115421714A (en) Method and system for generating multi-terminal table data display page
CN108845804A (en) A kind of design method of the NC code interpreter based on CYCLE circulation
CN102446086A (en) Parameterized specific instruction set processor design platform
CN105717866A (en) Numerical controller
CN108572925B (en) STEP file equivalent binary data storage method
CN106444633A (en) Motion control system

Legal Events

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