KR19990079125A - Implementation of numerical control device using single central processor - Google Patents

Implementation of numerical control device using single central processor Download PDF

Info

Publication number
KR19990079125A
KR19990079125A KR1019980011531A KR19980011531A KR19990079125A KR 19990079125 A KR19990079125 A KR 19990079125A KR 1019980011531 A KR1019980011531 A KR 1019980011531A KR 19980011531 A KR19980011531 A KR 19980011531A KR 19990079125 A KR19990079125 A KR 19990079125A
Authority
KR
South Korea
Prior art keywords
task
machine
input
script file
operation step
Prior art date
Application number
KR1019980011531A
Other languages
Korean (ko)
Other versions
KR100258893B1 (en
Inventor
장현상
Original Assignee
유철진
현대정공 주식회사
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 유철진, 현대정공 주식회사 filed Critical 유철진
Priority to KR1019980011531A priority Critical patent/KR100258893B1/en
Publication of KR19990079125A publication Critical patent/KR19990079125A/en
Application granted granted Critical
Publication of KR100258893B1 publication Critical patent/KR100258893B1/en

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/414Structure of the control system, e.g. common controller or multiprocessor systems, interface to servo, programmable interface controller
    • G05B19/4147Structure of the control system, e.g. common controller or multiprocessor systems, interface to servo, programmable interface controller characterised by using a programmable interface controller [PIC]
    • 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
    • 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/4155Numerical 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 programme execution, i.e. part programme or machine function execution, e.g. selection of a programme
    • 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/10Plc systems
    • G05B2219/11Plc I-O input output

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)

Abstract

본 발명은 단일 중앙처리부를 이용한 수치제어장치의 구현방법( Design Method for Numerical controller with a single CPU )에 관한 것으로, 기계의 작동상태를 표시하고 사용자의 조작을 지원하여 사용자와 기계와의 인터페이스를 수행하는 인간-기계 인터페이스 작업단계; 상기 인간-기계 인터페이스 작업단계로부터 데이터를 입력받아 프로그램의 번역을 수행하는 베이시스(Basis)작업단계; 상기 베이시스(Basis)작업단계로부터 데이터를 입력받아 실제 운동 궤적을 생성하는 서보 작업단계; 상기 서보제어 작업단계로부터 데이터를 입력받아 운동제어를 수행하는 위치제어 작업단계; 상기의 인간-기계 인터페이스 작업단계에서 입력된 데이터와 기계로부터의 입출력 데이터를 받아 논리제어를 수행하는 논리 제어단계 등 수치제어장치를 구성하는 각각의 독립된 작업들을 실시간 다중처리(RT-OS) 환경하에서 독립된 스래드(Thread)로 구성, 전체 시스템 구성에 소요되는 하드웨어적 비용을 절감할 수 있는 효과가 있다.The present invention relates to a method of implementing a numerical control apparatus using a single central processing unit, and more particularly, to a method of designing a numerical control apparatus using a single central processing unit, A human-machine interface working phase; A Basis work step of receiving data from the human-machine interface work step and performing a translation of the program; A servo operation step of receiving data from the Basis operation step and generating an actual motion trajectory; A position control operation step of receiving data from the servo control operation step and performing motion control; In the real-time multiprocessing (RT-OS) environment, each independent task constituting the numerical control apparatus such as the logic control step of receiving the input data from the human-machine interface work step and the input / output data from the machine, It is possible to reduce the hardware cost of the overall system configuration by configuring it as an independent thread.

Description

단일 중앙처리부를 이용한 수치제어장치의 구현방법Implementation of numerical control device using single central processor

본 발명은 단일 중앙처리부를 이용한 수치제어장치의 구현방법에 관한 것으로서, 특히 전체시스템 구성요소들의 각 기능을 태스크(Task)형태로 소프트웨어화하여 단일 중앙처리장치에서 제어하는 수치제어장치의 구현방법에 관한 것이다.The present invention relates to a method of implementing a numerical control apparatus using a single central processing unit, and more particularly, to a method of implementing a numerical control apparatus in which each function of all system components is software in a task form and controlled by a single central processing unit .

최근 수치제어장치는 중앙처리장치(이하, CPU라 함)의 고속, 고성능화 및 실시간 운영체제(RT-OS)의 발달로 PC를 이용 새로운 형태로 구현되고 있다.Background Art [0002] In recent years, numerical control devices have been implemented in a new form using a PC due to the development of a high-speed, high-performance and real-time operating system (RT-OS) of a central processing unit (hereinafter referred to as CPU).

즉, 별도의 CPU 및 하드웨어로 구현한 MMI 처리기, 명령 해석기, 보간기, 위치 제어기, PLC 처리기로 구성된 기존의 수치제어장치와는 달리, 실시간 환경하에서 많은 프로그램의 다중작업(Multi-tasking)처리가 용이해짐에 따라 하나의 CPU로써 상기의 기능을 태스크의 형태로 소프트웨어적으로 구현하기 위한 시도가 계속 이루어지고 있다.In other words, unlike the existing numerical control system consisting of MMI processor, instruction interpreter, interpolator, position controller and PLC processor implemented with separate CPU and hardware, multi-tasking processing of many programs under real-time environment As a result, an attempt has been made to implement the above functions in a software form as a single CPU.

도 1에 도시된 바와 같이, 일반적인 수치제어장치는 기계의 작동상태를 표시하고 사용자의 조작을 지원하여 사용자와 기계와의 인터페이스 환경을 제공하는 인간-기계 인터페이스(Man-Machine Interface, 이하 MMI라 함, 10)와, 상기 MMI(10)를 통해 사용자가 입력한 데이터와 기계의 작동상태를 입력받은 데이터를 프로그램하여 제어하는 프로그램가능 논리 제어기(Programmable logic controller, 이하 PLC라 함, 20)와, 실제 운동제어를 수행하는 서보기구(30)로 구성되어 있었다.As shown in FIG. 1, a typical numerical control device is a Man-Machine Interface (hereinafter referred to as MMI) that displays an operating state of a machine and supports an operation of a user to provide an interface environment between a user and a machine A programmable logic controller (hereinafter, referred to as a PLC) 20 for programming and controlling data input by the user through the MMI 10 and data input on the operation state of the machine, And a servo mechanism (30) for performing motion control.

상기와 같이 구성된 일반적인 수치제어장치의 동작을 설명하면 다음과 같다.The operation of a general numerical controller having the above configuration will now be described.

상기 MMI(10)를 통해 사용자가 제어입력신호를 인가하고, 상기 제어입력신호의 인가에 의해 실행프로그램을 동작시킨다. 기계의 작동상태를 상기 MMI(10)를 통해 표시한다.A user applies a control input signal through the MMI 10 and operates the execution program by applying the control input signal. And displays the operating state of the machine through the MMI (10).

상기 MMI(10)를 통해 입력된 데이터와 기계의 동작상태 데이터를 상기 PLC(20)에서 입력받아 제어한다.The PLC 20 receives input data and operation state data of the machine through the MMI 10 and controls the received data.

상기 MMI(10)로부터의 실행프로그램에 따라 서보기구(30)가 동작하여 작업을 수행한다.The servo mechanism 30 operates according to the execution program from the MMI 10 to perform the work.

상기 MMI(10), PLC(20), 서보기구(30)에 있는 각각의 프로세서는 각각의 독립된 작업을 수행하며, 상기 각각의 독립된 프로세서는 Bus-level을 이용하여 서로 통신하거나 다중처리작업시 여러개의 프로세서가 하나의 공유기억장치(Shard-memory)를 이용하여 서로 통신함으로써 실시간 환경하에서의 각각의 프로세서간의 조화로운 동작을 실현시킨다.Each of the processors in the MMI 10, the PLC 20 and the servo mechanism 30 performs independent tasks, and each of the independent processors can communicate with each other using a bus-level, Processors communicate with each other using a single shared memory device (Shard-memory), thereby realizing a harmonic operation between the respective processors under a real-time environment.

그러나, 종래의 수치제어장치의 구현방법은 상기 MMI(10), PLC(20), 서보기구(30) 각각에 연산기능 및 통신기능을 부여하여야 함으로써 제품의 가격을 낮추는데 그 한계가 있었다.However, the conventional method of implementing the numerical control apparatus has a limitation in lowering the price of products by requiring the MMI 10, the PLC 20, and the servo mechanism 30 to be provided with arithmetic functions and communication functions.

또한, 종래의 수치제어장치는 하드웨어적으로 구성되어 있어서 새로운 기능이 추가될 경우 시스템 전체를 다시 구성해야 하는 문제점이 있었다.In addition, the conventional numerical control apparatus is configured in hardware, so that when a new function is added, the entire system must be reconfigured.

따라서, 본 발명은 상기한 종래 기술의 문제점을 해결하기 위하여 안출된 것으로서, 그 목적은 서보제어 태스크, PLC 태스크, MMI 태스크 및 위치제어 태스크와 베이시스(Basis) 태스크등을 실시간 운영체제하의 독립 스레드(Thread)로 설계하여 단일 CPU를 이용하여 구현함으로써 하드웨어적인 면에서 비용을 절감할 수 있는 수치제어장치의 구현방법을 제공하는데 있다.SUMMARY OF THE INVENTION Accordingly, the present invention has been made keeping in mind the above problems occurring in the prior art, and it is an object of the present invention to provide a servo control task, a PLC task, an MMI task, a position control task, ), And implementing it by using a single CPU, thereby providing a method of implementing a numerical controller that can reduce cost in terms of hardware.

본 발명의 다른 목적은 상기 수치제어장치를 구성하는 태스크들을 소프트웨어적으로 구성함으로써 시스템 변화시 쉽게 최적화할 수 있는 수치제어장치의 구현방법을 제공하는데 있다.It is another object of the present invention to provide a method of implementing a numerical control apparatus that can be easily optimized when a system is changed by configuring the tasks constituting the numerical controller in software.

도 1은 일반적인 수치제어장치의 구성을 간략히 나타낸 제어회로블럭도,1 is a control circuit block diagram briefly showing a configuration of a general numerical controller,

도 2는 본 발명에 의한 수치제어장치의 각 태스크를 포함한 제어회로블럭도,2 is a block diagram of a control circuit including each task of the numerical controller according to the present invention,

도 3은 본 발명의 제 1 실시예에 의한 수치제어장치의 시스템구성의 초기화루틴의 흐름도,3 is a flowchart of an initialization routine of the system configuration of the numerical controller according to the first embodiment of the present invention,

도 4는 본 발명의 제 2 실시예에 의한 시간대별 각 태스크의 중앙처리장치(CPU) 점유분포도,FIG. 4 is a diagram showing an occupation distribution chart of a central processing unit (CPU) of each task according to the second embodiment of the present invention,

도 5는 본 발명의 제 3 실시예에 의한 모듈 헤더(Module header)를 이용한 루프 드라이버(Loop-driver)의 구성도.5 is a configuration diagram of a loop driver using a module header according to the third embodiment of the present invention.

<도면의 주요 부분에 관한 부호의 설명>DESCRIPTION OF THE REFERENCE NUMERALS

100 : 인간-기계 인터페이스 (MMI) 200 : 메모리100: human-machine interface (MMI) 200: memory

500 : 인터페이스 보드 510 : 아날로그&디지탈 인터페이스500: Interface board 510: Analog & digital interface

520 : 아날로그&디지탈 입출력장치520: Analog & Digital Input / Output Devices

530 : 버퍼메모리 600 : 주변장치530: buffer memory 600: peripheral device

700 : 구동부 800 : 모터700: driving unit 800: motor

900 : 중앙처리장치(CPU)900: central processing unit (CPU)

상기 목적을 해결하기 위한 본 발명의 수치제어장치의 제어방법에 관한 제 1 특징은, 기계의 작동상태를 표시하고 사용자의 조작을 지원하여 사용자와 기계와의 인터페이스를 수행하는 인간-기계 인터페이스 작업단계와, 상기 인간-기계 인터페이스 작업단계로부터 데이터를 입력받아 프로그램의 번역을 수행하고 기계의 보간을 수행하는 베이시스(Basis)작업단계와, 상기 베이시스(Basis)작업단계로부터 데이터를 입력받아 실제 운동 궤적의 생성을 수행하는 서보제어 작업단계와, 상기 서보제어 작업단계로부터 데이터를 입력받아 위치제어와 전체시스템의 작업계획을 수행하는 위치제어 작업단계와, 상기 인간-기계 인터페이스 작업단계에서 입력된 데이터와 기계로부터 출력된 제어입력데이터를 받아 제어프로그램을 작성하여 상기 서보제어 작업단계의 제어를 수행하는 프로그램가능 논리제어 작업단계로 이루어진다.A first aspect related to a control method of a numerical controller according to the present invention for solving the above object is a human-machine interface work step for displaying an operating state of a machine and supporting an operation of a user to perform an interface between a user and a machine A basic operation step of receiving data from the human-machine interface operation step and performing a translation of the program and performing interpolation of the machine; and a control step of receiving data from the basis operation step, A position control operation step of receiving data from the servo control operation step and performing a position control and a work plan of the whole system, Receives the control input data output from the servo control operation unit And a programmable logic control job step for performing control of the system.

상기 목적을 해결하기 위한 본 발명의 수치제어장치의 제어방법에 관한 제 2 특징은, 수치제어장치가 가동됨과 동시에 시스템 스크립트화일(Script File)을 읽어들이는 스크립트화일 판독단계와, 상기 스크립트화일 판독단계후 시스템 인터럽트와 버퍼메모리등을 체크하여 하드웨어를 초기화하는 하드웨어 초기화단계와, 상기 하드웨어 초기화단계후 각 위치제어 태스크, 서보제어 태스크, 프로그램가능 논리제어 태스크, 베이시스 태스크를 차례로 생성시키는 태스크 생성단계와, 상기 태스크 생성단계후 입/출력 스크립트 화일을 읽어들이는 입/출력 스크립트 파일 판독단계와, 상기 입/출력 스크립트 파일 판독단계후 실행 모듈들을 로드시키고 루틴 테이블들을 삽입시키는 루틴 테이블 삽입단계와, 상기의 초기화과정이 성공적인가를 판별하여 상기 판별 결과 상기 초기화 과정이 성공적이라고 판별되면 모든 태스크가 주기적으로 실행되는 태스크 실행단계로 이루어진다.According to a second aspect of the present invention, there is provided a control method for a numerical control apparatus, comprising: a script file reading step of reading a system script file (Script file) A hardware initialization step of initializing the hardware by checking system interrupts and a buffer memory after the step, and a task generating step of sequentially generating each position control task, the servo control task, the programmable logic control task, and the basis task after the hardware initialization step An input / output script file reading step of reading an input / output script file after the task generating step, a routine table inserting step of loading execution modules and inserting routine tables after the input / output script file reading step, It is determined whether or not the initialization process is successful. Results When the initialization process is determined to be successfully accomplished by any task running phase where tasks are performed on a periodic basis.

상기 목적을 해결하기 위한 본 발명의 수치제어장치의 제어방법에 관한 제 3 특징은, 사용자가 각 태스크에 임의로 수행빈도를 설정하는 수행빈도 설정단계와, 상기 수행빈도가 설정회수가 실행되었는가를 판별하는 수행빈도 회수 판별단계와, 설정된 회수가 실행된 경우에는 다른 태스크로 제어수단의 사용권을 이양하는 이양단계로 이루어진다.According to a third aspect of the present invention, there is provided a control method of a numerical control apparatus, comprising: an execution frequency setting step in which a user arbitrarily sets a frequency of execution for each task; and a determination step of determining whether the execution frequency is set And a transfer step of transferring the right to use the control means to another task when the set number of times is executed.

상기 목적을 해결하기 위한 본 발명의 수치제어장치의 제어방법에 관한 제 4 특징은, 각 태스크의 데이터 시그먼트(segment)에 루틴테이블을 정의하고 상기 정의된 루틴 테이블에 시스템 붙업(Boot-up)시 각 루틴의 우선순위에 따라 루틴 테이블을 작성하여, 정상적인 시스템 붙업시 루틴 테이블을 이용한 주기적인 수치제어 루틴들을 실행한다.A fourth feature of the control method of a numerical controller according to the present invention for solving the above-mentioned problems is that a routine table is defined in a data segment of each task, a system boot-up is performed on the defined routine table, The routine table is created according to the priority of each routine, and periodic numerical control routines are executed using the routine table when a normal system is loaded.

이하, 본 발명의 실시예를 참조된 도면을 참조하여 설명하면 다음과 같다.Hereinafter, embodiments of the present invention will be described with reference to the drawings.

도 2는 수치제어장치의 각 태스크를 나타낸 즉, 소프트웨어적으로 표현된 수치제어장치의 개략적인 구성을 보인 시스템 구성도이다.2 is a system configuration diagram showing a schematic configuration of a numerical control apparatus expressed by software, that is, each task of the numerical control apparatus.

인간-기계 인터페이스(이하 MMI라 함, 100)는 기계의 상태를 표시하고 사용자의 조작을 지원하여 사용자와 기계와의 인터페이스를 제공하는 MMI 태스크(110)의 처리를 담당하고 있다. 상기 MMI는 윈도우(WINDOW) 운영체제하에 작동되고 있다.A human-machine interface (hereinafter referred to as MMI) 100 is responsible for the processing of the MMI task 110 that displays the status of the machine and supports the user's operation to provide an interface between the user and the machine. The MMI is operating under a WINDOW operating system.

상기 MMI(100)로부터 입력되는 데이터를 기억시킴과 동시에 외부로부터 입력된 데이터를 저장하는 메모리(200)는 컴퓨터에 의한 수치를 처리하는 CNC(Computerized numerical control)작업(300)과, 상기 MMI와 기계로부터 입력된 데이터를 제어하여 처리하는 PLC 작업(400)이 저장되어 있다.A memory 200 for storing data input from the MMI 100 and storing data input from the outside includes a CNC (Computerized Numerical Control) operation 300 for processing numerical values by a computer, And a PLC job 400 for controlling and processing data input from the PLC job 400 are stored.

상기 CNC 작업(300)은 인터페이스 보드(500)상에 있는 외부 실시간 클럭(Real time clock)이 정해진 샘플링시간마다 인터럽트를 발생시키면 매 샘플링 시간마다 위치제어와 전체스케쥴링을 수행하는 위치제어 태스크(310)와, 상기 위치제어 태스크(310)의 스케쥴링에 의해 제어되어 운동 궤적의 생성을 수행하는 서보제어 태스크(320)와, 상기 MMI 인터페이스 및 보간을 수행하는 베이시스(Basis) 태스크(320)로 이루어져 있다.The CNC operation 300 includes a position control task 310 for performing position control and overall scheduling at every sampling time when an external real time clock on the interface board 500 generates an interrupt every predetermined sampling time, A servo control task 320 controlled by the scheduling of the position control task 310 to generate a motion locus, and a Basis task 320 for performing the MMI interface and interpolation.

상기 PLC 작업(400)은 상기 MMI(100)로부터 데이터 입력과 기계로부터의 입출력 신호에 의하여 기계를 운전하는 PLC 태스크(410)로 이루어져 있다.The PLC job 400 comprises a PLC task 410 for inputting data from the MMI 100 and operating the machine by input / output signals from the machine.

또한, 상기 메모리(200)에는 실시간 운영체제(RT-OS)가 이식되어 있다(미도시).Also, a real-time operating system (RT-OS) is embedded in the memory 200 (not shown).

사용자와 기계와의 인터페이스를 제공하는 인터페이스 보드(500)에는 디지털 및 아날로그신호를 입출력하는 디지털 & 아날로그 입출력장치(520)와, 상기 디지털 & 아날로그 입출력장치(520)를 통해 입출력되는 신호를 변환하는 A/D, D/A 변환장치(510)와, 상기 입출력신호를 일시저장시킴과 동시에 고속으로 안전하게 전송하기 위한 버퍼메모리(VMI, 530)로 구성되어 있다.An interface board 500 for providing an interface between a user and a machine is provided with a digital & analog input / output device 520 for inputting / outputting digital and analog signals, an A / D converter 520 for converting a signal input / output through the digital & A D / A converter 510, and a buffer memory (VMI) 530 for temporarily storing the input / output signal and transmitting the input / output signal safely at high speed.

주변장치(600)는 OP-PANEL과, Bus를 통해 인터페이스시킴으로써 각종 데이터를 백업시킬 수 있는 보조기억장치인 HDD(Hard disk driver)와 FDD(Floppy disk driver)와, 사용자 인터페이스 화면이 출력되는 VGA 등으로 구성되어 있다.The peripheral device 600 includes an OP-PANEL and an HDD (hard disk driver) and an FDD (Floppy disk driver), which are auxiliary storage devices capable of backing up various data by interfacing with a bus, a VGA .

디지털 및 아날로그신호를 입출력하는 디지털 & 아날로그 입출력장치(520)를 통해 출력된 제어신호에 의해 구동되는 구동장치(700)가 상기 인터페이스 보드와 접속되어 있다.A driving device 700 driven by a control signal outputted through a digital & analog input / output device 520 for inputting and outputting digital and analog signals is connected to the interface board.

상기 구동장치(700)의 구동신호에 의해 동작하는 모터(800)가 상기 구동장치와 접속되어 있다.And a motor 800 operated by a driving signal of the driving device 700 is connected to the driving device.

상기 메모리(200)와 상기 인터페이스 보드(500)와 상기 주변장치(600)는 Bus선을 통해 제어프로그램 및 각종 테이터를 처리하는 CPU(900)와 접속되어 있다.The memory 200, the interface board 500, and the peripheral device 600 are connected to a CPU 900 that processes a control program and various data through a bus line.

상기와 같이 구성된 본 발명의 수치제어장치의 동작에 대해 제1 실시예를 통해 상세히 설명하면 다음과 같다.The operation of the numerical controller according to the present invention will be described in detail with reference to the first embodiment.

도 3은 제 1 실시예에 의한 소프트웨어적인 공작 기계용 수치제어장치의 시스템구성이 이루어지는 과정을 나타낸 흐름도로서 구성용 스크립트 화일(Script file)을 이용하여 전체 시스템을 구성하는 방법이다.FIG. 3 is a flowchart illustrating a process of configuring a software configuration of a numerical control device for a machine tool according to the first embodiment, and is a method of configuring an entire system using a configuration script file.

단계 S1에서 상기 수치제어장치가 가동되면 전체시스템을 구성하기 위한 시스템 스크립트 화일을 읽어들인다.If the numerical controller is activated in step S1, the system script file for configuring the entire system is read.

단계 S2에서는 시스템 인터럽트와 버퍼 메모리(530) 등을 체크하는 하드웨어 초기화작업이 진행된다.In step S2, a hardware initialization operation for checking the system interrupt, the buffer memory 530, and the like is performed.

단계 S3에서 위치제어 태스크(310), 서보제어 태스크(320), PLC 태스크(410), 베이시스 태스크(330)를 차례로 생성시킨다.In step S3, the position control task 310, the servo control task 320, the PLC task 410, and the basis task 330 are sequentially generated.

단계 S4에서 상기 각 태스크의 생성후 입/출력 스크립트 화일을 읽어들인다.In step S4, the input / output script file after the generation of each task is read.

단계 S5에서 상기 각 태스크의 실행 모듈들을 로드시키고 프로그램 실행을 위한 루틴 테이블들을 삽입한다.In step S5, the execution modules of the respective tasks are loaded and the routine tables for program execution are inserted.

단계 S6에서 상기의 초기화과정이 성공적인가를 판별하여 상기 판별 결과 초기화 과정이 성공적일 경우에는(예) 단계 S7로 진행한다.In step S6, it is determined whether the initialization process is successful. If the determination result is successful, the process proceeds to step S7.

단계 S7에서 각각의 모든 태스크는 주기적으로 실행되고 상기 모든 태스크가 완료되면 붙업(Boot-up) 처리를 종료한다.In step S7, all the tasks are executed periodically, and when all the tasks are completed, the boot-up processing is terminated.

한편, 단계 S6에서 초기화 과정이 성공적이지 않을 경우에는(아니오) 단계 S8로 진행한다.On the other hand, if the initialization process is not successful in step S6 (NO), the process proceeds to step S8.

단계 S8에서 붙업(Boot-up)을 중단하고 운영체제(Operating system)제어모드로 진행한다.In step S8, the boot-up is interrupted and the process proceeds to the operating system control mode.

도 4는 제 2 실시예로서, 도 3에서 생성된 각 태스크들이 실행될 때의 타이밍 예를 도시한 것으로서 각각의 태스크마다 실시간 운영체제가 제공하는 기본적인 태스크 스위칭외에 임의의 수행 간격을 할당하도록 하는 방법이다.FIG. 4 shows an example of a timing when each of the tasks generated in FIG. 3 is executed as a second embodiment, and is a method for allocating an arbitrary execution interval in addition to basic task switching provided by a real-time operating system for each task.

상기의 소프트 수치제어장치 구현 방법에서 각 태스크의 주기적인 수행시간은 적용될 제어대상 혹은 사용되는 CPU(900)의 성능에 따라 변화될 수 있으므로 사용자가 임의로 개별 태스크의 수행빈도를 정할 수 있는 방법이다.In the method of implementing the soft numerical control device, the periodical execution time of each task may be changed according to the performance of the control object or the CPU 900 to be applied, so that the user can arbitrarily set the frequency of execution of the individual task.

도 4에서 각 태스크들의 실선부분은 CPU(900)를 점한 상태 즉, 실행되는 상태를 나타낸다.In FIG. 4, the solid line portion of each task indicates a state in which the CPU 900 is in the open state, that is, a state in which it is executed.

위치제어 태스크(310)는 그 처리작업의 중요도에 의해 가장 우선순위를 높게 배정했고, 타이머에 의해 주기적으로 발생되는 기준 인터럽트신호에 의해 실행기동되며, 실행이 완료되면 다음으로 우선순위가 높게 배정된 서보제어 태스크(320)로 CPU(700)의 사용권을 이양하게 된다.The position control task 310 assigns the highest priority according to the importance of the processing task and is executed by the reference interrupt signal periodically generated by the timer. When execution is completed, the position control task 310 is assigned the next highest priority And transfers the usage right of the CPU 700 to the servo control task 320.

본 제 2 실시예에서 서보제어 태스크(320)의 주기는 위치제어 태스크(310) 주기의 2배로 하였다.In the second embodiment, the period of the servo control task 320 is twice the period of the position control task 310.

위치제어 태스크(310)가 매 두 번 실행될 때 서보제어 태스크(320)가 한 번 실행되는 이유는 위치제어 태스크(310)가 서보제어 태스크(320)에서 보간된 위치정보를 가지고 위치제어 태스크(310) 내에서 자체의 보간을 수행하기 때문이다.The reason why the servo control task 320 is executed once every time the position control task 310 is executed is that the position control task 310 receives the position information interpolated from the servo control task 320 and outputs the position control task 310 ), Because it performs its own interpolation.

만약 위치제어 태스크(310)와 서보제어 태스크(320)의 주기가 같다면 위치제어 태스크(310)는 보간을 수행하지 않는다.If the cycles of the position control task 310 and the servo control task 320 are the same, the position control task 310 does not perform the interpolation.

마찬가지로 서보제어 태스크(320)의 실행이 완료되면 다음으로 우선순위가 높게 배정된 PLC 태스크(410)로 CPU(900)의 사용권을 이양하게 된다.Similarly, when the execution of the servo control task 320 is completed, the CPU 900 is transferred to the PLC task 410 having the highest priority.

이때, PLC 태스크(410)의 실행이 완료되기 전에 우선순위가 더 높이 배정되어 있는 위치제어 태스크(310)나 서보제어 태스크(320)가 CPU(900)를 점하려 하면 PLC 태스크(410)의 실행을 중지하고 CPU(900)사용권을 이양하게 된다.At this time, if the position control task 310 or the servo control task 320 whose priority is assigned higher prior to the execution of the PLC task 410 is to be pointed to the CPU 900, the execution of the PLC task 410 And transfers the CPU 900 license.

상기의 동작원리는 복수의 태스크들은 처리의 긴급성 및 중요성에 따라 설계시 정해진 우선순위와 주기성 그리고 사용자에 의해서 설정된 주기에 의해 실행되도록 실시간 운영체제하에 작업을 처리하는 이유에서이다.The above operation principle is for the reason that a plurality of tasks are processed under a real-time operating system so that they are executed according to the urgency and importance of the processing, the predetermined priority and periodicity at design, and the period set by the user.

우선순위가 가장 낮게 배정된 MMC 태스크(110)는 주기성을 갖지 않게 설정되어 주기적으로 실행되는 우선순위 태스크들이 실행되고 남은 시간에 CPU(900) 사용권을 이양받아 실행된다.The MMC task 110 having the lowest priority is set to have no periodicity so that the priority tasks that are periodically executed are executed and the CPU 900 is transferred at the remaining time.

이와 같이 소프트웨어적인 수치제어장치의 구현 방법의 동작을 설명하면 다음과 같다.The operation of the software implementation method of the numerical controller will be described as follows.

태스크 수행빈도를 임의로 제어하기 위해 다음의 변수들을 사용한다.The following variables are used to arbitrarily control the task execution frequency.

Task_Status : 태스크의 상태를 나타낸 표시.Task_Status: An indication of the status of the task.

이전의 수행이 완료된 상태이면 Idle(=0)값을 가짐.Idle (= 0) value if the previous execution is completed.

이전의 수행이 완료되지 않은 상태이면 Busy(=1)값을 가짐.If the previous execution is not completed, it has Busy (= 1) value.

Task_Set_Counter : 태스크의 수행 빈도 설정.Task_Set_Counter: Set the task execution frequency.

=Task_Loop_Time % Position_Sampling_Time= Task_Loop_Time% Position_Sampling_Time

Task_Actual_Counter : 매 태스크 완료시 증가.Task_Actual_Counter: Increase on completion of every task.

Position_Task()Position_Task ()

{{

[운동제어에 관련된 인스트럭션;][Instructions related to motion control;

Task1_Actual_Count = Task1_Actual_Count % Task1_Set_Counter;Task1_Actual_Count = Task1_Actual_Count% Task1_Set_Counter;

if(Task1_Actual_Count = = 0)if (Task1_Actual_Count = 0)

{{

if(Task1_Status = = Busy)if (Task1_Status = Busy)

return Busyreturn Busy

elseelse

[Send semaphore to activate Task1;][Send semaphore to activate Task1;]

}}

Task2_Actual_Count = Task2_Actual_Count % Task2_Set_Counter;Task2_Actual_Count = Task2_Actual_Count% Task2_Set_Counter;

if(Task2_Actual_Count = = 0)if (Task2_Actual_Count = 0)

{{

if(Task2_Status = = Busy)if (Task2_Status = Busy)

return Busyreturn Busy

elseelse

[Send semaphore to activate Task2;][Send semaphore to activate Task2;]

}}

............................

}}

상기와 같이 구성된 코드(Code)를 해석하면 다음과 같다.The above-configured code is analyzed as follows.

예를 들어 인터럽트 태스크로 설계된 위치제어 태스크의 샘플링 시간이 1(ms)이고, 태스크1의 태스크 루프 타임(Task_Loop_Time)을 4(ms)로 설정한 경우 Task_Set_Counter는 4가 되고, 이는 시스템 동작시 위치제어 태스크의 매 4회 수행시 테스크1이 한번 수행됨을 의미한다.For example, when the sampling time of the position control task designed as the interrupt task is 1 (ms) and the task loop time (Task_Loop_Time) of the task 1 is set to 4 (ms), the Task_Set_Counter becomes 4, It means that Task 1 is executed once every 4 times of task.

태스크2도 상기와 같이 위치제어 태스크(310)가 매 인터럽트 발생시 일련의 자기 작업을 수행하고 난 후 CPU(900)의 사용권을 기다리는 다른 태스크에 쇄정신호(Semaphore)를 이용하여 CPU(900)의 사용권을 넘겨주는 일련의 과정을 진행한다.The task 2 may also be configured to execute a series of self-tasks when the position control task 310 generates an interrupt, and then use the semaphore to wait for a license of the CPU 900, The process goes through a series of processes.

여기서 각 태스크의 실행주기는 사용자측에서 설정할 때 그 특성상 가능한 짧게 설정할수록 높은 제어성능을 보장받을 수 있다.Here, the execution cycle of each task is set to be as short as possible due to the characteristics of the user, so that a high control performance can be assured.

도 5는 제 3 실시예를 의한 모듈 헤더(Module header)를 이용한 루프 드라이버(Loop-driver)의 구성을 나타낸 블록도로서 일반적으로 NC Kernel이라 불리우는 기능 모듈들을 자동적으로 관리하고 순차적으로 수행시키도록 만들어주는 방법이다.FIG. 5 is a block diagram showing the configuration of a loop driver using a module header according to the third embodiment. In general, functional modules called NC kernels are automatically managed and sequentially executed It is a way of giving.

여기서 정의된 기능 모듈 헤더는 특별히 고안된 시스템 유틸리티 프로그램에 의하여 목적파일의 Compiler specific funtion header를 대치하도록 한다. 따라서 모든 기능 모듈들은 앞부분에 16Byte의 모듈 헤더와 잇따르는 모듈 코드절(Module code section)으로 구성된다.The function module header defined here replaces the Compiler specific funtion header of the object file by a specially designed system utility program. Therefore, all functional modules consist of 16Byte module header and following module code section.

다음의 Table 1은 각 기능마다 정의된 모듈 헤더의 기본 골격이다.Table 1 below shows the basic structure of the module header defined for each function.

Table. 1Table. One

IdentityIdentity TypeType Module priorityModule priority Pointer to module entryPointer to module entry Module lengthModule length VersionVersion Dummy1Dummy1 Dummy2Dummy2 1 Byte1 Byte 1 Byte1 Byte 2 Byte2 Bytes 6 Byte6 Bytes 2 Byte2 Bytes 1 Byte1 Byte 1 Byte1 Byte 2 Byte2 Bytes

Identity : 모듈 파일 헤더(Module file header)의 식별Identity: Identification of the module file header

Type : 모듈 파일의 타입Type: Type of module file

0 × 11 베이시스 태스크를 위한 CNC 모듈0 × CNC module for 11 bases tasks

0 × 12 서보제어 태스크를 위한 CNC 모듈0 × 12 CNC module for servo control task

0 × 14 위치제어 태스크를 위한 CNC 모듈0 × 14 CNC module for position control tasks

0 × 1F CNC 인터럽트 루틴0 × 1F CNC interrupt routine

0 × 20 PLC 모듈0 × 20 PLC module

0 × 2F PLC 인터럽트 루틴0 × 2F PLC interrupt routine

Module priority : 루틴 테이블에 있는 슬롯 번호를 연속적으로 지정Module priority: Specify the slot number in the routine table consecutively

Pointer to module entry : Offset시 코드의 주소를 부름Pointer to module entry: Call the address of the code at offset

Module length : 모듈 헤더가 포함하고 있는 모듈의 길이Module length: The length of the module containing the module header

Dummy 1 : 0 × FF시 앞으로의 사용을 예약Dummy 1: 0 × Scheduled future use of FF

Dummy 2 : 0 × FFFF시 앞으로의 사용을 예약Dummy 2: 0 × Schedule forward use at FFFF

이들 기능 모듈들은 시스템 붙업(Boot-up)시 각 태스크에 할당된 메모리 시그먼트(Memory segment)상에 실행순서에 상관없이 로드된다. 이미 기존의 동일한 기능 모듈이 보조기억장치(Secondary storage)에 한 개 이상 존재할 경우 시스템소프트웨어는 메모리 시그먼트에 로드된 기능 모듈의 모듈 헤더를 이용하여 최신 버젼(Version)이 로드되도록 한다.These functional modules are loaded on the memory segment assigned to each task during system boot-up regardless of the execution order. If more than one existing function module exists in the secondary storage, the system software loads the latest version using the module header of the function module loaded in the memory segment.

이와 같이 소프트웨어적인 수치제어장치의 구현 방법의 동작을 설명하면 다음과 같다.The operation of the software implementation method of the numerical controller will be described as follows.

이들 메모리 시그먼트상에 로드된 기능 모듈들을 할당된 우선순위에 따라 순차적으로 수행시키기 위하여, 각 태스크의 데이터 시그먼트(Data segment)에 루틴 테이블(Routine table)을 정의한다.In order to sequentially execute function modules loaded on the memory segments according to the assigned priority, a routine table is defined in a data segment of each task.

상기 루틴 테이블이 정의되면 시스템 붙업(Boot-up)시 시스템 소프트웨어로 하여금 소속 태스크 및 루틴 테이블을 작성하도록 한다.When the routine table is defined, the system software makes a task and a routine table at the time of system boot-up.

각 태스크마다 루틴 테이블이 완성되면 루틴 테이블을 이용 수치제어 루틴들이 순차적, 주기적으로 수행된다.When the routine table is completed for each task, numerical control routines are executed sequentially and periodically using a routine table.

상술한 바와 같이, 본 발명에 의하면 내장된 작동제어기(Embeded motion controller)를 단순 아날로그 인터페이스 보드나 디지털 인터페이스 보드로 대치하고 상기 내장된 작동제어기의 기능과 MMI 기능을 단일 CPU가 모두 처리함으로써 하드웨어적으로 비용을 절감할 수 있는 효과가 있다.As described above, according to the present invention, a built-in operation controller (Embeded motion controller) is replaced with a simple analog interface board or a digital interface board, and the functions of the built-in operation controller and the MMI function are processed by a single CPU. The cost can be reduced.

상기 수치제어장치를 소프트웨어적으로 구성함으로써 응용대상의 변화에 따라 시스템을 동적으로 최적화 하기가 용이하다.By configuring the numerical controller in software, it is easy to dynamically optimize the system according to the change of the application target.

Claims (4)

단일 CPU를 이용하여 실시간 다중처리 환경에서 NC를 구성하는 각 부분을 독립 스래드(Thread)로 구성하여 소프트웨어적으로 수치제어장치를 구현하는데 있어서,In the realization of a numerical controller in software by constructing each part constituting an NC in a real-time multiprocessing environment using a single CPU as an independent thread, 기계의 작동상태를 표시하고 사용자의 조작을 지원하여 사용자와 기계와의 인터페이스를 수행하는 인간-기계 인터페이스 작업단계,A human-machine interface work step for displaying the operating state of the machine and supporting the user's operation to perform an interface between the user and the machine, 상기 인간-기계 인터페이스 작업단계로부터 데이터를 입력받아 프로그램의 번역을 수행하고 기계의 보간을 수행하는 베이시스(Basis)작업단계,A Basis operation step of receiving data from the human-machine interface work step and performing a translation of the program and interpolating the machine, 상기 베이시스(Basis)작업단계로부터 데이터를 입력받아 실제 운동 궤적의 생성을 수행하는 서보제어 작업단계,A servo control operation step of receiving data from the Basis operation step and generating an actual motion trajectory, 상기 서보제어 작업단계로부터 데이터를 입력받아 위치제어와 전체시스템의 작업계획을 수행하는 위치제어 작업단계,A position control operation step of receiving data from the servo control operation step and performing a position control and a work plan of the whole system, 상기 인간-기계 인터페이스 작업단계에서 입력된 데이터와 기계로부터 입출력 신호를 받아 기계를 운전하는 논리제어 작업단계로 분리한 것을 특징으로 하는 수치제어장치의 구현방법.And a logic control operation step of receiving the input data from the machine and the input / output signal from the machine and operating the machine. 전체시스템을 정의하는 구성용 스크립트화일을 이용하여 수치제어장치를 붙업(Boot-up)시 동적으로 구성하는 방법에 있어서,1. A method for dynamically configuring a numerical controller at boot-up using a script file for configuration defining an entire system, 수치제어장치가 가동됨과 동시에 시스템 스크립트화일(Script File)을 읽어들이는 스크립트화일 판독단계와,A script file reading step of reading a system script file at the same time that the numerical controller is activated, 상기 스크립트화일 판독단계후 시스템 인터럽트와 버퍼메모리등을 체크하여 하드웨어를 초기화하는 하드웨어 초기화단계와,A hardware initialization step of initializing hardware by checking a system interrupt, a buffer memory and the like after reading out the script file, 상기 하드웨어 초기화단계후 각 위치제어 태스크, 서보제어 태스크, 프로그램가능 논리제어 태스크, 베이시스 태스크를 차례로 생성시키는 태스크 생성단계와,A task generating step of sequentially generating each position control task, a servo control task, a programmable logic control task, and a basis task after the hardware initialization step; 상기 태스크 생성단계후 입/출력 스크립트 화일을 읽어들이는 입/출력 스크립트 파일 판독단계와,An input / output script file reading step of reading an input / output script file after the task generation step; 상기 입/출력 스크립트 파일 판독단계후 실행 모듈들을 로드시키고 루틴 테이블들을 삽입시키는 루틴 테이블 삽입단계와,A routine table inserting step of loading execution modules and inserting routine tables after the input / output script file reading step, 상기의 초기화과정이 성공적인가를 판별하여 상기 판별 결과 상기 초기화 과정이 성공적이라고 판별되면 모든 태스크가 주기적으로 실행되는 태스크 실행단계로 이루어진 것을 특징으로 하는 수치제어장치의 구현방법.And a task execution step in which all the tasks are periodically executed if it is determined that the initialization process is successful and the initialization process is determined to be successful as a result of the determination. 제 2 항에 있어서,3. The method of claim 2, 사용자에 의해 태스크의 실행주기를 임의로 제어할 수 있도록 하는 것을 특징으로 하는 수치제어장치의 구현방법.Wherein the execution cycle of the task is arbitrarily controlled by the user. 제 2 항에 있어서,3. The method of claim 2, 테이블에 정의된 모듈 헤더(header)를 이용하여 가 태스크에 정의된 루틴 테이블을 작성하고, 시스템 작동시 루틴 테이블을 이용하여 수치제어 루틴들을 순차적, 지속적으로 구동시키는 것을 특징으로 하는 수치제어장치의 구현방법.And a numerical control routine is sequentially executed by using a routine table defined in the table to define a routine table defined by the module header defined in the table. Way.
KR1019980011531A 1998-04-01 1998-04-01 Numerical controller performance method with unified controller KR100258893B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019980011531A KR100258893B1 (en) 1998-04-01 1998-04-01 Numerical controller performance method with unified controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019980011531A KR100258893B1 (en) 1998-04-01 1998-04-01 Numerical controller performance method with unified controller

Publications (2)

Publication Number Publication Date
KR19990079125A true KR19990079125A (en) 1999-11-05
KR100258893B1 KR100258893B1 (en) 2000-06-15

Family

ID=19535736

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019980011531A KR100258893B1 (en) 1998-04-01 1998-04-01 Numerical controller performance method with unified controller

Country Status (1)

Country Link
KR (1) KR100258893B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101283026B1 (en) * 2007-10-09 2013-07-05 현대자동차주식회사 System for real time control of total control system and method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101283026B1 (en) * 2007-10-09 2013-07-05 현대자동차주식회사 System for real time control of total control system and method thereof

Also Published As

Publication number Publication date
KR100258893B1 (en) 2000-06-15

Similar Documents

Publication Publication Date Title
US5261107A (en) Programable interrupt controller
US5291614A (en) Real-time, concurrent, multifunction digital signal processor subsystem for personal computers
US4414624A (en) Multiple-microcomputer processing
US6823517B1 (en) Multi-tasking-real-time operating system for microprocessors with limited memory that constrains context switching to occur only at task level
KR100313261B1 (en) Low Power Multi-task Controller (Name Correction)
US4109311A (en) Instruction execution modification mechanism for time slice controlled data processors
US3651482A (en) Interlocking data subprocessors
US5557764A (en) Interrupt vector method and apparatus
US4005391A (en) Peripheral interrupt priority resolution in a micro program data processor having plural levels of subinstruction sets
EP0426331B1 (en) Programmable interrupt controller and method
US9152454B2 (en) Method for enabling sequential, non-blocking processing of statements in concurrent tasks in a control device
US4627025A (en) Memory programmable controller with word and bit processors
JPS6334645A (en) Multi-channel sharing resource processor
KR100258893B1 (en) Numerical controller performance method with unified controller
Mustafa Microcomputer interfacing and applications
JP2826309B2 (en) Information processing device
US5278959A (en) Processor usable as a bus master or a bus slave
EP0445288A1 (en) Operation processing unit
Jelemensky et al. The MC68332 microcontroller
EP1008054A1 (en) Real time software system
Gracon et al. A high performance computing system for time critical applications
JPS5922146A (en) Task scheduling circuit
JP2601359B2 (en) Concurrent processing microprocessor
JPH02214938A (en) Data processor
CHMIEL et al. Remarks on Improving of Operation Speed of The PLCs

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee