Journal of Materials Processing Technology 138 (2003) 472–474
Study on a reconfigurable model of an open CNC kernel Wang Yuhan*, Hu Jun, Li Ye School of Mechanical Engineering, Shanghai Jiao Tong University, 200030 Shanghai, PR China
Abstract Based on a behavioral model, in this paper a new dynamic modeling method is presented and used to analyze the life cycle of application objects and their interactions in an open-architecture CNC controller model. Since a CNC kernel has a high capability real-time multi-task controller, it is important to develop CNC software based on non-real-time preempt multi-task operating system (Windows NT). A proper method for software high capability real-time control is employed when open on CNC kernel is designed. Further, the paper develops a solution for how to realize reconfigurable structures in CNC systems and seamless connection between function modules and a system. # 2003 Elsevier Science B.V. All rights reserved. Keywords: CNC system model; Real-time; Behavior model; State machine
1. Introduction The purpose of developing open-architecture computer numerical control (CNC) is to establish a kind of software architecture that fits in with a general computer and is independent of a control vendor, whilst at the same time, a communication standard among computer hardware, an operation system and application software must be built. Using the advantage of open CNC developing, users can quickly build an advanced capability controller to possess a characteristic function base on a general computer and operation system. An open system, as defined by IEEE (IEEE 1003.0, 1990), provides capabilities that enable properly implemented applications to run on a variety of platforms from multiple vendors, inter-operate with other system applications and present a consistent style of interaction with the user. Likewise, an open CNC system is a modular, software architecture that exhibits such capabilities as interoperability, interchangeability, scalability and portability [1]. To fulfill this, one should utilize the object-oriented paradigm at the system analysis stage to decompose the whole system’s functions into different independent function modules, connected by a client–server communication mechanism through standard application program interface (API). Compared with the modeling of other systems, modeling a CNC system has its own characteristics: a static object *
Corresponding author. E-mail addresses:
[email protected],
[email protected] (W. Yuhan).
model may be quite simple, while a dynamic model is quite complex and needs multi-level real-time requirements. Therefore, it is a challenge to describe clearly each object’s function, behavior, and process, and the relationship among objects in CNC system. A clear description in modeling a CNC system will determine the system’s performance and reliability at its running stage. Utilizing the latest software control technology, in this paper it is shown how to develop a software high capability real-time controller based on Windows NT that could be used in industry that is independent of the computer hardware used. A whole CNC kernel model to describe multi-task real-time control that integrates programmable logic controller (PLC) control, multi-channel control, multiaxis interpolation and high-speed and high-accurate servo control, is built.
2. Task partition for a CNC kernel in a multi-channel structure An open CNC system kernel consists of a motion control management (MCM) task area, a motion control (MC) task area, an axis control (AC) task area and a spindle control (SC) task area. The system kernel is designed in a multichannel structure that can manage several spindles by incorporating corresponding MC modules and SC modules. An MC module can implement spindle interpolation (virtual axis). The number and type of axes (parallel axis and rotary axis) in each channel are set in the CNC configuration system (Fig. 1).
0924-0136/03/$ – see front matter # 2003 Elsevier Science B.V. All rights reserved. doi:10.1016/S0924-0136(03)00121-3
W. Yuhan et al. / Journal of Materials Processing Technology 138 (2003) 472–474
473
sequence of operation, describes the object’s operation process in an system. It has the following concepts: (i) State: the basic component of a behavior model, which describes the object’s real state at a certain stage. (ii) Transition: the process of an object’s changing from one state to another, represented by an arrow. (iii) Trigger: the event and condition which triggers the change of an object’s state. (iv) Action: an object’s activity when its state changes.
Fig. 1. Multi-channel structure CNC kernel.
The present open CNC system kernel is in a software pattern in which the task of multi-channel control is implemented. Synchronization among channels is carried out by the MCM module. The MCM module is also in charge of system operation modes that include automatic, manual data input (MDI), reference, JOG and increment mode. 3. Behavior model of client–server To be equipped with reconfigurable, open-architecture CNC controllers, each object’s behavior model should be defined clearly at its initial design stage. An object’s behavior model, one of the system attributes related to time and
In this paper, the authors use a state machine to describe a CNC module’s behavior. By way of a client–server mechanism, pre-defined standard APIs can realize the interoperation among modules in open-architecture CNC. The reason for utilizing this kind of communication mechanism is that it can increase the extensibility and interchangeability of the controller software, thereby is suitable for hierarchical distribution of system function and load on various platforms. Thus it is an ideal communication mechanism for an open-architecture CNC controller. Requests for a server can be divided into three categories: parameter requests, command request and management request. A server may simply react to a client’s request immediately, or it may answer the client after some cycles. Requests for a server can be divided into the following three categories: (i) Parameter request: set and get the data members of an object, e.g., get(), set().
Fig. 2. General state space.
474
W. Yuhan et al. / Journal of Materials Processing Technology 138 (2003) 472–474
These functions will be called automatically at the configuration stage during system start-up. Since the general state machine, independent of modules, is defined by the system, the user should not be concerned with the development of the modules. On the other hand, he/she can inherit the transition functions of the general state machine and insert his/her own codes. Each module has its own states and state transition, so under the lower level there is a specific state machine. The user should regulate specifically the states and trigger actions according to the actual functions of each module.
4. The implementation for concurrent multi-task real-time control
Fig. 3. The relationship between general state machine and specific state machine.
(ii) Command request: command to realize one specific function, e.g., movement with absolute coordinate, interpolation of a certain path, etc. (iii) Management request: coordinate the performances of modules, such as enable, disable or update a module. A management request, e.g., ‘‘processServoloop’’ request for module ‘‘AXIS’’, will realize a servo function where the module gets data (position order and feedback value) in, calculates and sends out a new point in each servo loop. The former request can be satisfied once the server has received it, while the latter ones need a state space to coordinate the interaction between client and server, otherwise the status of request being processed in a server will be unknown to the client. Fig. 2 shows a general state space of a module. When a module responds to a command request, it enters into execution state. During this stage, the module (server) and client will interact through the embedded state space (the dashed frame in Fig. 2 describes the detailed substates in a state space). To realize reconfigurable structures in CNC systems and seamless connection between function modules and system, the authors divide the state machine into two levels: general state machine and specific state machine [2], as shown in Fig. 3. Each module in the system has some common states, such as activating, deactivating, shutdown, resetting, etc., which can be regarded as a general state machine. Each state transition can be mapped onto a function in the basic class (i.e. BAOC) provided by a system platform (i.e. OSACA).
Based on a preempt multi-task operating system (Windows NT), developing CNC software needs to solve two problems: how to set priorities and to allocate CPU time for each real-time object. Because different CPU gives different time to the same object, fixed CPU time cannot indicate actually time used by an object. One defines a start-up interval for each object to make the CNC system hardware-neutral. The start-up interval of each object will not change on different CPU platforms when an object is activated by the task scheduling module according to the object’s priority. The CNC kernel is a multi-task real-time controller. There are four tasks that required critical concurrent implementation in the CNC kernel: multi-channel control, multi-axis interpolation, high-speed and high-accuracy servo control and logic control. The authors build a real-time CNC development environment covering a hardware to application layer by extending the kernel of a non-real-time preempt multi-task operating system. All these real-time tasks are implemented by software. The time of a single axis servo cycle is 60 ms when the system is operated. Acknowledgements This work was supported by the Science and Technology Development Foundation of Shanghai Science and Technology Committee (995107011). References [1] G. Pritschow, J. Daniel, W. Sperling, Open controllers—a challenge for the future of the machine tool industry, Ann. CIRP 42 (1) (1993). [2] W. Yuhan, et al., Research on OSACA open architecture standard and software platform, Mechatronics 5 (2) (1999) 20–22.