The measures and application of the intelligent formation of numerical control code

1 Overview CNC system is widely used in various equipments in manufacturing. Good CNC system is the guarantee for processing high-performance and high-precision parts products such as CNC machine tools. With the development of open CNC, the research on CNC system development method has become a Important research direction. The research from early structured programming to object-oriented thinking and component-based CNC system design is basically a code-centric development approach. However, it has the following disadvantages: (1) system testing lags, it is difficult to ensure system reliability; (2) system development cycle is long, and development efficiency is low. Although model-driven CNC system development.

It has certain improvement effects on the above drawbacks, but its modeling language is UML, which is difficult to be directly applied by CNC system developers. Therefore, this paper proposes a numerical control system development method based on domain modeling to solve the problems encountered by traditional development methods. problem.

2 The development method of domain modeling based on domain modeling development framework improves the position of the model in the whole development. Whether it is system analysis, system design or system implementation, the model is constructed and transformed as the core, and This enhances the coupling degree of each link in the development process, based on the domain modeling CNC system development framework. It describes the core content of the domain-based modeling CNC system: domain modeling, model transformation and automatic code generation. Domain modeling includes the construction of numerical control system metamodel and numerical control system model construction. Firstly, the common meta-model is used to define the elements of the numerical control system meta-model and the connection of elements. The numerical control system meta-model defines the modeling rules (ie grammar and semantics) of the numerical control system model. After the interpretation, the meta-model becomes a computer. CNC Numeric Control Modeling Language (CNML), CNCML has obvious features in the field of numerical control. Each modeling element has explicit domain semantics and is easily recognized and used by engineers in the numerical control field. Model conversion is mainly responsible for converting the CNC system model to a third-party verification environment (such as real-time performance verification tool UPPAAL). Engineers can effectively improve the model based on the results of verification and simulation, realize early system performance verification, ensure the reliability of the final system, and improve the system. quality. Automatic code generation implements traversal, analysis, and synthesis of the model, and establishes mapping rules corresponding to the target programming language (such as C language) according to strict meta-model syntax and semantics, and realizes automatic conversion from model to runnable code. In this way, the development efficiency of the system is improved.

This paper introduces the construction of the numerical model of the numerical control system and the related research on the automatic generation of code, in which the model is transformed.

3 The construction of the meta-model of the numerical control system meta-model describes how to establish the model, how to integrate and interoperate between models in a specific domain modeling environment. The metamodel defines the grammar and semantics of the domain, and can represent all or all of the systems in the domain, and after interpretation, directly becomes the modeling language of the domain. In this study, the multi-view based Meta Modeling (MVMM) method was used to construct the numerical control metamodel using the GME metamodeling tool.

MVMM mainly describes the system from a functional perspective and a non-functional perspective combined with a hierarchical approach. From the main point of view of the function. The basic functional area of ​​the system is divided into three parts: HMI, PLC, and NC. HMC continues to be divided into human-computer interaction (HMI), system configuration, and fault diagnosis functions; PLC is divided into logic control, input and output control; NC is divided into motion preparation, motion control, and axis control. For example, in the HMI part of the human-computer interaction, the CNC system is divided into six major modes according to the operation mode: manual mode, zero return mode, automatic mode, edit mode, entry mode, and handwheel mode, and detailed metamodel.

From the non-functional main point of view, the computer numerical control system is a typical real-time system, real-time is the most important non-functional attribute, in addition, the priority execution of each task and the synchronization between the working axes, these non-functional requirements must It can be faithfully reflected in the metamodel.

The specific analysis is as follows: (1) The motion task element is the main element of the whole control module. According to the actual motion task, two seed task types are derived: TTMotionTask and ETMotionTask, which represent the time-triggered hard real-time motion task and the event-triggered weak real-time. task.

(2) Each task has parameters such as WCET, period, and priority. According to different target platforms (mainly real-time operating systems), the parameters of the tasks can be set to meet the requirements of task scheduling.

(3) AxisManager (AxisManager) starts the corresponding tasks according to the type of motion instruction (MotionCmd). These relationships can be represented by the relationship between them. For example, TaskCmdConn represents the relationship between the motion task and the motion instruction.

4 code automatic generation to achieve automatic generation of product-level source code from the model is a key part of the CNC system development method based on domain modeling. The flexible code auto-generation technology has the following obvious advantages: (1) improved code change capability; (2) flexible synchronization mechanism between code and model; (3) greatly improved work efficiency; (4) guaranteed Consistency of all generated code.

The mechanism for automatic code generation is to generate the source code of the specification according to the metadata of the read model and according to the specified mapping rules. Generally, the generation process can be divided into the following two steps: (1) model analysis. Model analysis is to access the model, extract model information, and prepare for the next model-to-code mapping. This study is based on the Meta Object Network (MON) and the Builder Object Network (BON).

Establish a parsing class library for the numerical control field, parse different application models through the domain parsing class library, and obtain information corresponding to the model. The information is stored in various types of data structures, and is used for the next step from the model to the code. Or the mapping of other information provides preparation.

(2) Model mapping. Model mapping is a mapping from model information to code or other model information, and the corresponding code or configuration data is automatically generated according to different domain application models. This study uses a mapping method based on mapping rule base and code template, and combined with reusable component library, can automatically generate product-level source code.

In essence, the model mapping process is a process in which the domain application model is input and the product-level source code is output. The domain application model is different according to the system requirements. It is necessary to map different application models into corresponding system source code. The mapping law must come from the modeling rules of the application model and the organization structure of the target source code. The modeling specification in this study is the numerical domain domain meta-model. The organizational structure of the target source code is closely related to the specific platform information. The information mainly includes the software architecture oriented to the target platform, the programming language type, and the integrated development source code organization structure and its configuration. structure. For example, the motion control system based on the DSP platform generally uses C/C++ for its programming language. The integrated development environment is the CCS development environment of TI. The real-time control application software is built on the real-time scheduling kernel of DSP/BIOS. Therefore, it is oriented to DSP. The code mapping of the platform must examine how CCS organizes the source code organization, how to perform multitasking configuration, and what type of service interface DSP/BIOS provides.

In order to standardize the mapping process, combined with the openness requirements of the numerical control system, this study proposes a mapping process based on the mapping rule base and the code template library model. Firstly, a comprehensive analysis of the numerical domain domain metamodel rules and the target platform source code organization structure is analyzed. The purpose is to establish a mapping rule table from model to code, and design corresponding code template for automatic code generation. Mapping rule base and code template library are important sources of information in code mapping process; the content of analysis is mainly model invariance And variability characteristics, and their correspondence with the target source code. The mapping process is implemented in four steps: (1) parsing the model according to the domain parsing class library, and storing the acquired model information in a specific data format; (2) based on the model information, according to the mapping rule table, Determine whether code mapping is needed, and call the corresponding mapping algorithm to map; (3) parse the code template, find related keywords (Keyword) or zone flag (BlockFlag), extract, fill or replace the code according to the model information. , generating the corresponding code; (4) selecting the appropriate component from the component library, bonding and supplementing with the automatically generated code, and finally forming a complete product level source code.

5 Three-axis lathe design example Based on the above analysis and the established meta-model and the corresponding code automatic generator, this example mainly completes the three-axis lathe design. The lathe adopts an open CNC implementation scheme based on Windows CE DSP, that is, the upper computer embedded single board computer (SBC-C26) and the lower computer DSP motion control card realize the connection of the master-slave structure through the PC104 bus. According to this requirement, the lower machine model of the lathe is established using the CNCML formed by the described motion control as shown.

The code of the task management module obtained after using the code automatic generator is as follows: void Tsk_Axis_Manager() { while(true){ // Loop to get the motion instruction sent by the host machine msgID= MsgCom::receiveMsg(pMsgAddr,pHC2DSP_Buf);switch ( msgID) / / judgment message motion instruction {case LINE_3D_MOTION:// three-axis linkage - 3D linear motion ... / / start related tasks break; case ARC_3D_Motion: / / three-axis linkage - 3D arc motion ... / / start related tasks break; Case LINE_3D_MOTION://Three-axis linkage-3D linear interpolation...//Start related tasks break;case BALL_3D_Motion: //Three-axis linkage-spherical interpolation...//Start related tasks break;} 6 Conclusion Improve model in system development The role is the development trend of modern numerical control system. This paper analyzes the development framework of numerical control system based on domain modeling. It points out that automatic code generation is the key step to realize the framework, study the framework and process of model mapping, and design through three-axis CNC lathe. The example confirms the feasibility of the method. At present, the whole project is progressing smoothly. The next step is to solve the multi-objective.

(Finish)

Heated Mattress Pad

Based on the size and types of heating elements in the car seat, the heating process can be faster or slower. There are seats that have carbon fiber heating wires whereas some have been equipped with NiCr heating wires. You need to get a unit that offers quick heating and able to evenly distribute the heat all over the seat for a warm and soothing feeling.Single Dial789Benz789Golf 7 789

Heated Mattress Pad,Electric Heated Mattress,Car Heated Mattress Pad,Sunbeam Heated Mattress Pad

JiLin Province Debang Auto Electric Co.,Ltd. , https://www.carseatheating.com