Design and Implementation of CNC Machine Remote Monitoring and Controlling System Based On Embedded Internet

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

2010 International Conference on Intelligent System Design and Engineering Application

Design and Implementation of CNC Machine Remote Monitoring and Controlling


System Based on Embedded Internet

Zhai Wen-zheng1,2 HU Yue-li1,2


1 School o f Mathemat ics & Information Engineering, 1. Key Laboratory of Advanced Display and System
Taizhou University, Taizhou 300070, China; Applications (Shanghai University), Ministry of Education;
2 School of Mechatronics Engineering and Automat ion, 2. School of Mechatronics Engineering and
Shanghai University, Shanghai 200072, China; Automation, Shanghai Key Laboratory of Po wer
e-mail: zhwen zheng@shu.edu.cn Station Automation Technology, Shanghai University,
Shanghai 200072, China;
e-mail: huyueli@shu.edu.cn

Abstract—The network control of CNC machine is the mu ltiform models, great difference and difficult networking
inexorable development trend of modern manufacturing in NC system.
industry, and the combination of embedded technology with Based on embedded ARM Cortex-M 0 microprocessor
network has become a research hot. This paper puts forward a LPC1114 and Ethernet controller ENC28J60, an embedded
novel design idea of remote monitoring and controlling system Ethernet communication module is constructed to facilitate
of CNC machine based on embedded Internet, presents its the communication between the upper industrial control PC,
architecture principle design and software-hardware the field monitoring host and the various CNC machine
implementation procedure of the whole system. On the basis of Tools. After development an embedded software runtime
embedded ARM Cortex-M0 microprocessor LPC1114,
environment and NC application software modules of the
Ethernet controller ENC28J60, ported µC/OS -II and LwIP, an
embedded Ethernet communication module is constructed to remote monitoring and controlling system of NC machine
facilitate the communication between the upper industrial tool (NC-RM CS), the data and status from field NC
control PC, the field monitoring host and the various CNC machines can be accessed and monitored by Ethernet.
machine Tools. After the hardware architecture design and Furthermore, the system can perform remote monitoring and
software programming are completed, the system is tested and controlling, load and download NC program, convey
the results indicate that NC-RMCS functions have been productive task and manage machining task on the Internet.
realized. Also, the network control technology is practical and The NC-RMCS is general and costs lower. It can be
has higher application value. applied on many traditional NC systems to realize remote
monitor and management. The experimental results indicate
Keywords-CNC machine network;remote monitoring and that the network control technology is practical and has
controlling system;Embeded ethernet communication higher application value.
modules;ARM Cortex-M;RTOS
II. A RCHITECT URE PRINCIPLE OF REMOTE MONITORING
I. INT RODUCTION AND CONT ROLLING OF NC MACHINE TOOLS
With the rapid development of the information
technology and the CNC technology, the network 5HPRWH0RQLWRULQJ+RVW 5HPRWH&RQWUROOLQJ+RVW :HE%URZVHU
management of the NC industry has become a necessity [1].
Internet
Some famous NC machine and system manufacturers in
overseas, such as Mazak and Oku ma in Japan, Siemens in 'DWDEDVH /RFDO
$SSOLFDWLRQ6HUYHU
German, etc. have realized the network monitor, diagnose 6HUYHU 6HUYHU
Intranet
and management with integrated network communication in
NC system. That reflected the tendency of NC machine tool ,QWHOOLJHQW'HYLFH/HYHO

to the network direction. At the present, most of NC Embedded Ethernet NC Unit No.1 Embedded Ethernet NC Unit No.n

machines at home use the traditional closed NC system, such 8SSHU,QGXVWU\


&RQWURO3&
)LHOG0RQLWRULQJ
+RVW
8SSHU,QGXVWU\
&RQWURO3&
)LOHG0RQLWRULQJ
+RVW
as the FANUC, MITSUBISHI, Siemens, etc. That kind of
Ethernet
system, which transmits by common RS232, RS422 or Ethernet

Embeded Ethernet Embeded Ethernet


RS485, is unfavorable to extend the network. So it's Embeded Ethernet
Communication Module
Embeded Ethernet
Communication Module Communication Module Communication Module
indispensable to append network function communication
outside the NC system to put into effect network CNC Machine Tool CNC Machine Tool CNC Machine Tool CNC Machine Tool

management of NC machines.
In the paper, a novel architecture of general network
control applied to traditional NC system is proposed against Figure 1. The architecture principle diagram of the NC-RMCS based on
the physical circu mstances in our country of various brands, embedded Internet

978-0-7695-4212-6/10 $26.00 © 2010 IEEE 506


DOI 10.1109/ISDEA.2010.283
The NC-RM CS is co mposed of embedded Ethernet by several parts: embedded ARM processor LPC1114,
communication modules, field monitoring hosts, upper SDRAM and FLASH to set up a basic system; ENC28J60
industrial control PC, the application server, the database chip takes the charge of the communication with Ethernet;
server, the web browser computers, the remote monitoring the LCD and the keyboard circuit realize a man-machine
and controlling host. The architecture is shown in Fig.1. interaction.
The system adopts three-layer architecture based on B/S
mode. On the upper layer, the web browser computers based A. ARM LPC1114
on Internet handles human-machine interface (HMI) of the The ARM Cortex-M 0 is by now the smallest, lowest-
system, such as NC system input and output interface, power, and most energy-efficient ARM processor available.
remote monitor and control, remote fault diagnosis, network The exceptionally s mall silicon area, low-power and minimal
communication and so on. code footprint of the processor enables developers to achieve
The second layer is application server, which is 32-bit performance at an 8-bit price point.
responsible for executing of NC function modules and The LPC1114 is a ARM Cortex-M0 based, low-cost 32-
applications of the system. The system can response users bit MCU, designed for 8/16-b it microcontroller applications,
request by starting relevant application, and then sends the offering performance, low power, simple instruction set and
results to the client. It also can establish connection with memory addressing together with reduced code size
database server which is used to store NC programs, compared to existing 8/16-bit architectures.
machine tool information, operation log and feedback data The peripheral co mplement of the LPC1114 includes 32
etc. KB of flash memory, 8KB of data memory, one RS-485
The bottom layer is intelligent device layer, which UART, up to two SPI interfaces with SSP features, four
consists of the embedded Ethernet communication module, general purpose counter/timers, a 10-bit A DC, and up to 42
CNC machine tools, upper industrial control hosts and field general purpose I/O pins.
monitoring hosts. The field monitoring host can In the design, The RealView M icrocontroller
simultaneously monitor all the CNC machine tools in one Development Kit (MDK) for ARM is used as Integrated
Ethernet, including display the machine status information, Development Environ ment (IDE) which provides developers
monitor the communication settings between the upper with a feature-rich environment optimized for A RM powered
industrial control PC and CNC mach ines, and transport microcontrollers and development board SACB1100 is u sed
between machine tool commands and NC code and so on. as target board in the process of transplantation. Host
Moreover, it can be directly accessed application server and computer is connected to target board to establish a cross -
local server by Internet so that conduct the remote fault development environment for debugging through JTAG.
diagnosis about the status data of NC machine tools.
B. Ethernet Module
The characteristics of this system are simp le operation,
easy application, stable and reliable running. Remote The ENC28J60 is a stand-alone Ethernet controller with
supervisory and diagnosis of working and operating status of an industry standard Serial Peripheral Interface (SPI). It is
several NC machines is put into effect. Transmission designed to serve as an Ethernet network interface for any
efficiency of NC program is improved. The management of controller equipped with SPI. The ENC28J60 meets all of
machin ing and processing of traditional NC machine is the IEEE 802.3 specifications. It incorporates a number of
improved and the actual productive efficiency is increased packet filtering schemes to limit incoming packets. It also
effectively. provides an internal DMA module for fast data throughput
and hardware assisted checksum calculation, which is used
III. HARDWARE DESIGN in various network protocols. Co mmunication with the host
As one of the most important components of NC-RMCS, controller is imp lemented via an interrupt pin and the SPI,
the embedded Ethernet communication module co mpletes with clock rates of up to 10 MHz. Two dedicated pins are
the communication between the upper industrial control PC, used for LED link and network activity indication. With the
the field monitoring host and the various CNC machine ENC28J60, Connecting the embedded communication
Tools. Fig.2 is the diagram of the module, which is consisted module to Ethernet is achieved easily.

IV. SOFTWARE DESIGN


$50&RUWH[0 Ethernet Module
TPOUT The software system architecture of the NC-RMCS is
ENC28J60 RJ45 shown in Fig.3. It co mprises two parts: the embedded
TPIN
1;3 software runtime environment and NC application software
/3&
components. The embedded software runtime environment
GPIO

LCD
KEY contains an embedded real-time operating system (RTOS)
µC/ OS-II, an embedded TCP/IP stack LwIP, an embedded
FLASH
file system and a number of drivers such as those for
Ethernet, keyboard, LCD display and UART interface. The
MAX232 RS232
NC application software components are composed of a
number of tasks and functional modules, such as the NC
Figure 2. Embeded Ethernet Communication Module machine status monitoring module and operation control

507
module, which are either scheduled to execute by OS or C. Aplication
trigged by interrupts. The main program flow chart design is given in the
Figure 4. In view of the system functional modules: serial
$SSOLFDWLRQ&RPSRQHQWV

0XOWLWDVN6FKHGXOLQJ3URFHGXUH
sending and receiving subtasks module, Ethernet sending
and receiving subtasks module, the system main design
1&0DFKLQH
8SSHUKRVW
6WDWXV
2SHUDWLRQ 1&:HE process has been divided into nine subtasks. We could set
$50FRPP &RQWURO 6HUYLFH
0RQLWRULQJ every task priority, make the priority of serial sending
subtask lowest, and make the priority of Ethernet receiving
subtask highest. With embedded Ethernet communication
module, we could realize data conversion between the
/Z,31HWZRUN3URWRFRO6WDFN )LOH6\VWHP
different data on different bus and the Ethernet to implement
5XQQLQJ(QYLURQPHQW

嘕&26Ċ26.HUQHO remote access control for NC machine tools.


The design of application program is based on the idea of
(WKHUQHW 'LVSOD\ .H\ERDUG 6HULDO&RPP )LOH the real-time multitask, thus we needn’t consider all tasks
'HYLFH'ULYHUV running simultaneously. On the basis of this programming
idea, we can also lighten programmer’s burden, reduce the
/3&%636WDUWXS,QLWLDOL]DWLRQ failure probability and make programs reliable [6].
Figure 3. The software system architecture of the NC-RMCS
67$57

A. µC/OS-II Operation System


,QLWLDOL]H
As µC/OS-II is a high performance, open-sourced, /3& (WKHUQHW 56&

scaleable, reliable and preemptive multi-task management


6WDUW0DLQ7DVN
modularized real-time operating system [2], it can be 2SHQVXEWDVN

transplanted into the ARM microcontroller LPC1114,


providing file system, network interface, memo ry )ODJ(WKHUQHW
6LJQDO2ULJLQ
)ODJ8SSHU+RVW

management and multi-task schedule etc. in the NC system. -XGJPHQW

Users can extend or delete functional modules of both


hardware and software easily. 6XEWDVN 6XEWDVN 6XEWDVN 6XEWDVN
Only four system files need to be amended in the 5HFHLYH&RQWURO 5HFHLYH1&3URJUDPPHU 5HFHLYH:DUQLQJIURP 5HFHLYH6WDWXVIURP
&RPPDQGIURP(WKHUQHW IURP(WKHUQHW &1&0DFKLQH &1&0DFKLQH
transplanting of µC/OS-II to embedded platform [3], they are
OS_CPU_A.ASM, OS_ CPU.H, OS_ CPU_C.C and
6XEWDVN 6XEWDVN 6XEWDVN 6XEWDVN
OS_CFG.H. One of the most frequent operations during the 6HQG&RQWURO&RPPDQG 6HQG1&3URJUDPPHWR 6HQG&RQWURO&RPPDQG 6HQG6WDWXV,QIRUP
task running is context switch, which can guarantee that the WR&1&0DFKLQH &1&0DFKLQH WR&1&0DFKLQH WR8SSHU+RVW

priority of current running task is the highest in the ready list.


The time tick could be considered as the beginning o f the 6XEWDVN
:ULWHWR
context switch. The ready list will be check after the tick. If 'DWDEDVH6HUYHU

there is a ready task with higher priority, by which the


current task will be rep laced. OS_Sched( ) takes the charge 1R
of checking ready list [4]. /RJ2XW"

There are several software sub-modules in the <HV

embedded Ethernet communication module, and the usage of )LQLVKHG

services of µC/OS-II makes it easier to lin k those sub- Figure 4. the main program flow chart
modules.
B. LwIP(Lightweight Internet Protocol) When the remote monitoring and controlling hosts send a
request to the local system via Internet, the corresponding
Due to the limitation of hardware resource in the monitoring procedure begins to work and the status data
embedded system and the low-efficiency of general purpose fro m CNC machine tools are sent back the remote host after
TCP/IP protocol stacks and protocol models, LwIP is they have been processed.
required when accessing to Internet. When the embedded Ethernet communication module
LwIP is a small independent imp lementation of the receives alarm information fro m CNC mach ine tools, the
TCP/IP suite, which focuses on reducing memory usage and module sends the appropriate control commands to CNC
code size and makes it suitable for the embedded systems. machine to ensure machine running normally.
LwIP provides user an API that does not require any data After hardware p latform design and software
copying [5]. In addition, LwIP also provides a BSD socket programming are completed, the ultimate generated code
API. Real-t ime tasks can use any of those APIs to send and which has been compiled is downloaded the target system -
receive packets through the network. the embedded Ethernet communication module. The code
includes hardware system startup code, µC/OS -II kernel,

508
LwIP protocol stack, SPI port drivers and part of the NC REFERENCES
application. [1] Yi-Hong Long, Zu-De Zhou, Quan Liu, Ben-Yuan Chen, Heng-Lin
Zhou, “Embedded-based modular NC systems,” Adv. Manuf Technol,
V. CONCLUSIONS vol. 40, Feb. 2009, pp. 7–8, doi: 10.1007/s00170-008-1384-x.
In the paper, the architecture of NC-RM CS based on [2] Xinjuan Jin, Quan Liu and Yihong Long, “ Research and
embedded Internet is proposed and the embedded Ethernet Development of Embedded Numerical Control Service System,” Proc.
IEEE ICIT. Industrial T echnology (SCIS 07), IEEE Press, April 2008,
communication module is developed to complete the pp. 1-5, doi:10.1109/ICIT.2008.4608597.
communication between the upper industrial control PC, the [3] Dejing Zhang, Jianping Xing, Gang Chen, Kai Qin, “ Collaborative
field monitoring host and the various CNC Machine Tools. Design of Heterogeneous Data Integration Communication Gateway
the system can perform NC machine tool remote monitoring Based on the Embedded Platform,” Embedded Software and Systems
and controlling. Symposia, 2008. ICESS Symposia '0 8. International Conference ,
Future work will concentrate on Qos features IEEE Press, July 2008, pp. 248-252, doi:10.1109/ICESS.
Symposia.2008.29.
improvement of the NC-RM CS. It will also include porting
[4] Wang Mei, Zhao Ruimei, Duan Huiting, “Design and Realization of
µClinu x to the embedded Ethernet communication module. Embedded Ethernet Communication System Based on ARM,”
Second International Symposium on Information Sciencd and
A CKNOWLEDGMENT Engineering. Dec 2009, pp. 287-289, doi:10.1109/ISISE.2009.98.
This work is supported by IC Special Foundation of [5] Wei Chen, Shu-Bo Qiu, Ying-Chun Zhang, “The Porting and
Shanghai Municipal Co mmission of Science and Technology Implementation of Light-Weight T CP/IP for Embedded Web Server,”
Wireless Communications, Networking and Mobile Computing, 2008.
(Grant No. 09706201300), Shanghai Municipal Co mmission WiCOM '08. 4th International Conference, IEEE Press, Oct. 2008, pp.
of Economic and Information (Grant No.090344), Shanghai 1-4, doi:10.1109/WiCom.2008.1005.
High-tech Industrialization of New Energy Vehicles (Grant [6] Nan Xie, Haibo Zhang, Weimin Chen ,Yan Ma, Jinghua Tian,
No.09625029) and Graduate Innovation Fund of Shanghai “Research and Design of Industrial Ethernet Int elligent Gateway
University, Youth Foundation of Taizhou University (No. Based on ARM,” Embedded Software and Systems Symposia, 2008.
09QN06). ICESS Symposia '08. International Conference , IEEE Press, July
2008, pp. 324-327, doi:10.1109/ICESS. Symposia.2008.52.

509

You might also like