You are on page 1of 12

Computers in Industry 60 (2009) 686–697

Contents lists available at ScienceDirect

Computers in Industry
journal homepage: www.elsevier.com/locate/compind

Web-based virtual operating of CNC milling machine tools


He Hanwu *, Wu Yueming
Faculty of Electromechanical Engineering, Guangdong University of Technology, Guangzhou 510090, China

A R T I C L E I N F O A B S T R A C T

Article history: This paper attempts to propose a virtual operating system applied to operation training of
Received 15 July 2007 manufacturing facility and manufacturing process simulation. The system is based on VRML and
Received in revised form 21 March 2009 browser/server structure, so user only needs to install a free plug-in, and run the package normally via
Accepted 18 May 2009
Microsoft Internet Explorer. Initially this paper studies the system framework, structure models and
Available online 9 July 2009
concept models. Then, a communication approach based on VRML, Java and HTML, which is key to realize
the virtual operating of CNC machines, has been presented. The algorithm of material removed
Keywords:
simulation based on VRML Z-map is also presented in this paper. It has the advantages such as a lower
CNC machine tools
Virtual operating
memory requirement, and a faster computation speed. Finally, in order to validate the feasibility of the
VRML proposed approach, the CNC milling machine has been taken as an illustrative example for the prototype
Training development.
Machining simulation ß 2009 Elsevier B.V. All rights reserved.

1. Introduction machine. For these reasons, we propose combination of VRML,


JavaApplet and JavaScript to solve this problem.
The international market place is becoming more dynamic and This paper describes a VRML and web-based NC machine tool
fast changing, whilst the trends in manufacturing have been operation and attempts to propose a virtual operating system that
shifting from mass-scale production to single (customized) or can be applied to operation training of the manufacturing facility
small-scale production runs. These challenges call for the and manufacturing process simulation. The rest of paper is
manufacturing companies that want to succeed in the interna- organized as follows. In Section 2, related research to virtual
tional market, to respond to market agilely and shorten the lead- machining simulation is discussed. Then, virtual operating defini-
time [1]. Virtual reality (VR) technology has many advantages such tion is given in Section 3. This is followed by the realization of
as excellent interaction, high verisimilitude for 3D display and interaction between operator and virtual machine in Section 4.
offers opportunities for manufacturing firms to meet the above Development of CNC machine tools virtual operating system and its
challenges [2,3]. VR technology had been widely used in implementations is described in Section 5. Finally, we drew some
manufacture simulation, especially, the web-based virtual conclusions in Section 6.
machining simulation system that has become the popular due
to its cooperation facility, good platform independence [4–6]. 2. Recently related research
The Virtual Reality Modeling Language (VRML) is a file format
for describing interactive 3D objects, having the character of being 2.1. Virtual reality
simple to use, open, interactive and web-based which make it a
powerful tool for setting up the web-based CNC machine The term VR was coined by Jaron Lanier in the early 1980s.
simulation systems [6,7]. The virtual operating of NC machine Initially, VR referred to an immersive system that allowed the user
includes various manual operations similar to practical manipula- to use natural head and hand movements to interact with the
tion. To realize all these virtual manipulations, it is crucial to solve computer-generated environment [8]. With the development of
information generated by mouse, keyboard and files between the VR technology, the meaning of VR has been broadened. Nowadays,
operator and the visualized virtual machine. Although VRML has the semi-immersive systems like large screen projections, and
strong ability for graphics display and good web running, it lacks even the non-immersive system like monitor-based viewing of
the functions for file reading and writing, as well as its inferior two- three-dimensional objects are also called VR systems [9].
dimensional word display effect. This means that make VRML
cannot meet the special demand of virtual operation of a CNC 2.2. Web-based virtual reality

* Corresponding author. In the era of the Internet, great changes have taken place in the
E-mail address: hwhe@gdut.edu.cn (H. Hanwu). research of virtual reality. The web, which is one of the most

0166-3615/$ – see front matter ß 2009 Elsevier B.V. All rights reserved.
doi:10.1016/j.compind.2009.05.009
H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697 687

popularly used Internet tools, aims to provide a light-weight, easily verification, machining process simulation and machining error
deployed and system-independent platform for users to search, evaluation, but ignored the virtual operating of CNC machine tools.
browse, retrieve, disseminate and share the information remotely Since virtual operation of CNC machine tools can mimic the
[10,11]. Based on the web, cooperative design, remote teaching, realistic operation of CNC machine, it is very helpful for the
remote training and remote meeting can be easily achieved. For operational training of the company’s staff. Ong and Mannan [26]
these reasons, more and more web-based virtual reality applica- presented a web-based teaching package that provided a dynamic
tions have been developed and they play a more and more and interactive environment for a module on automatic machine
important role in every walk of life. tools, but it still cannot provide a realistic virtual environment for
In the design and manufacturing area, there has been a lot of the student to practice how to operate a CNC machine tool.
research and development and a numbers of software tools have
been developed in this area. Li [12] developed an Internet-based 3. Virtual operation definition
integrated system which enabled designers to design products
collaboratively, supported product preview and evaluation of 3.1. Virtual machine model
design parts using web-based virtual reality technology. Kan et al.
[13] developed an Internet-based virtual reality collaborative A key factor for developing a virtual operating of CNC machine
environment (VRCE) using VNet, Java, and VRML. As it is a platform tools system is how to represent the CNC machine tools precisely
independent, VRCE can be run using inexpensive computer and effectively in the virtual environment. In this paper, we only
hardware and software and is composed of a set of comprehensive focused on the key motion components of CNC machine tools and
functionality with customizability which makes VRCE more ignore the physical status, such as the driving system of CNC
attractive than many existing VCS systems. Choi and Chan [14] machine. The main components of CNC machine are as shown in
presented a virtual prototype system (VP) for rapid product Fig. 1.
development. This VP system incorporates the dexel-based and the Based on the design method described in Ref. [4], those
layer-based fabrication approaches to simulate the powder-based components are defined as the follows (Node, SFVec3f, SFRotation,
and laminated sheet-based RP process, respectively. The virtual MFFloat are the types of data defined in VRML):
prototypes of this system can be transmitted, via the Internet to (1) Bed Definition
customers to facilitate global manufacturing. Object Bed
In the teaching and training area, enormous interest has been
Importing data types Node, SFVec3f
provoked by VR. Brodlie et al. [15] studied a cost-effective web-
based virtual reality system for surgery training using VRML. Wang Attributes
et al. [16] proposed a methodology that enabled people with (A1) Shape: Node
acquired brain injury (ABI) to receive rehabilitation training at (A2) Position: SFVec3f
home and in their own time to relearn activities of daily living
(A3) Color: SFVec3f
(ADL) at a low cost with the help of the Internet and desktop VR
applications. Waller and Foster [17] developed a web-based virtual End
training application in chemistry. Students can learn to operate the
virtual instrument using this application.
There also has been considerable interest in the medical area
employing Internet technology and VR technology. Liang and
O’Grady [18] proposed a methodology using VR technology to
realize the medical collaboration via the Internet. A virtual surgical
telesimulation application for micrographic dermatologic surgery
(MOHS) has been presented by Vélez et al. [19]. This application
can provide educational telesimulation in the dermatologic
surgery technique known as Mohs micrographic surgery.
In the Internet commerce, increasingly more e-commercial
applications are using virtual reality technology [20]. Lee and
Chung [21] developed an intelligent Internet shopping mall by
integrating virtual reality and avatar. This application can offer the
customer a far more interesting way to shop effectively.

2.3. Virtual machining simulation

Virtual machining simulation is receiving a lot of attention in


the field of virtual manufacture [1,22]. Suh and Lee [23] studied an
algorithm which was used to evaluate the NC controller error and
developed a software program for extracting the error patterns of
NC controller. Suh et al. [4] presented methods to represent the
motion paths and operation of CNC machine tools on the Web. Ong
et al. [5] developed an Internet-based virtual CNC Milling system to
evaluate and optimize the machining process on the Internet. The
MTS company in German developed a virtual CNC machining
simulation system which can provide realistic 2D and 3D
machining simulation result [24]. Yeung et al. [25] presented a
comprehensive virtual simulation model of realistic and modular
CNC system which can be used to predict realistic CNC system
performance. These research papers focused on CNC program Fig. 1. Main components of the CNC machine.
688 H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697

(2) Workbench Definition Attributes


Object Workbench (A1) Shape: Node
Importing data types Node, SFVec3f, boolean (A2) Color: SFVec3f
Methods (A3) Position: SFVec3f
add-children(Node), set-position(SFVec3f) (A4) Rotation: SFRotation
Attributes (A5) Children: Node
(A1) Shape: Node (A6) children-added? : Boolean
(A2) Position: SFVec3f Valuation B: Node, R: SFRotation, P: SFVec3f
(A3) Color: SFVec3f (V1) [add-children(B)] children-added? = true;
(A4) Children: Node (V2) [add-children(B)] Children = B;
(A5) children-added? : boolean (V3) [set-rotation(R)] Rotation = R;
Valuation B: Node, P: Position (V4) [set-position(P)] Position = P
(V1) [add-children(B)]children-added? = true; (V5) [remove-children(B)]Children = NULL
(V2) [add-children(B)]Children = B; (V6) [remove-children(B)]children-added? = false
(V3) [set-position(P)]Position = P Safety B: Node
Safety B: Node (S1) Per(add-children(B)) ! children-added? = false
(S1) Per(add-children(B)) ! children-added? = true (S2) Per(remove-children(B)) ! children-added? = true
End End

(3) Saddle Definition


(6) Fixture Definition
Object Saddle
Object Fixture
Importing data types Node, SFVec3f
Importing data types
Methods
Node, SFVec3f
set-position (SFVec3f)
Methods
Attributes
(M1) add-children(Node)
(A1) Shape: Node
Attributes
(A2) Position: SFVec3f
(A1) Shape: Node
(A3) Color: SFVec3f
(A2) Position: SFVec3f
Valuation P: SFVec3f
(A3) Color: SFVec3f
(V1) [set-position(P)] Position = P
Valuation B: Node
End
(V1) [add-children(B)] children-added? = true

(4) Lifting Table Definition Safety B: Node

Object Lifting Table (S1) Per(add-children(B)) ! children-added? = false

Importing data types Node, SFVec3f End

Methods The Objective model of CNC machine tools can be represented


as Fig. 2.
set-position(SFVec3f)
Attributes
(A1) Shape: Node 3.2. Operation command description
(A2) Position: SFVec3f
Although for the different CNC systems, its control panel,
(A3) Color: SFVec3f
operation methods are different, the final goal of a certain
Valuation P: SFVec3f operation among different CNC system is the same. Therefore,
(V1) [set-position(P)] Position = P classification and definition of each operating of the CNC machine
End is advantageous to realize the rapid configurability of virtual
operating system and meet the requests for compatibility with
different CNC system.
(5) Spindle Definition
In general, these operating of CNC machine tools can be
Object Spindle classified as follows:
Importing data types
Node, SFVec3f, Boolean, SFRotation (1) Manual Movement Control
Methods The manual mode of a CNC control causes the machine tool
to react identically to a standard machine tool. It includes
(M1) Add-children(Node)
continuous moving control, pointing control and hand-wheel
(M2) Set-rotation(SFRotation) moving control.
(M3) Set-position(SFVec3f) (2) Spindle Control
(M4) Remove-children(Node) It includes spindle rotation control and stop control.
H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697 689

Fig. 3. Virtual CNC control panel.

The architecture of the virtual control panel model is shown in


Fig. 4, it includes the following three main components:

(1) Virtual LCD Screen


The LCD screen in the virtual control panel model is created
by using HTML and JavaScript code. Each display format is
defined in a layer because of different display format of each
screen. In default status, the visibility attributions of layers are
all set to hiding. When a particular screen needs to be
displayed, the visibility attribution of that layer is set to show
and the contents of that layer are refreshed. The principle of the
virtual LCD screen is shown in Fig. 5.
(2) Control Elements
The control elements in the virtual control panel model are
achieved by using VRML. A TouchSensor node is situated in
each control element, and it will send the information to the
operation command translator when the user clicks the control
element. Fig. 6 indicates the principle of control elements.

Fig. 2. Objective model of the numerical control machine.

(3) CNC Programming


CNC Programming includes CNC code entering, modifica-
tion, exporting and management.
(4) CNC Program Performance
It includes program selection, program performance,
program pause, program reset, and parameter settings. Fig. 4. Architecture of control panel model.
(5) Reference Point Return and Machine Zero Point Return

3.3. Virtual control panel model

CNC control panel is an independent unit with control and


display elements. According to the operation command mentioned
above, a standard CNC control panel should combine with seven
elements as Fig. 3 shown.
In these seven elements, the LCD Screens is the display element of
the CNC control panel, whilst the others are control elements. Thus,
the virtual control panel model mimicks the counterpart in the real
world. Since a command translator is used to extract the valid
information from the operation command that the user inputs via
virtual control panel and sends the information to the central control
module of the whole system to create the virtual operation, it should
be populated in the virtual control panel mode either. Fig. 5. Virtual LCD.
690 H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697

Fig. 6. User’s operating information reception in manual operation area.

(3) Operation Command Translator


In the CNC control panel, a particular operation is accom-
plished by one or more buttons with a certain logical relations
and mutually restrains instead of only one isolative button. The
operation command translator model cannot guarantee versa- Fig. 7. Communication of HTML (JavaScript)–JavaApplet–VRML.
tility if these relations are defined in its methods or its attributes
when the model is being defined. Therefore, in order to create the
versatility of the operation command translator model, a rule the other hand, JavaApplet is strong in the calculation and 2D text
library (called jRuleLib_IDj) is defined to store these restraint display, but it does not have the capability of reading or writing
relations. Different CNC systems have a different rule library. local files due to the security problem. To achieve the reading or
writing ability, it must draw support from the JavaScript that is
The concept model of the command translator in the virtual embedded in the Hyper Text Mark-up Language (HTML) file.
control panel is described as follows: The prototype system in this paper is an integrated system
Object CommandTranslator which embeds JavaScript, Java applets and VRML plug-ins by using
Importing data types HTML. In this system, VRML is used to create the virtual NC
boolean, jRuleLib_IDj, int, cmddata machining environment, JavaScript and Java applets are used to
Constant provide simulations and handle all the information inputted from
the operator. To create the prototype system, the following issues
//the button clicked by user
have to be solved:
(C1) jButtonKeyj: bk
Methods (1) Information transfer among JavaScript, JavaApplet and VRML;
(M1) Get-buttonkey; (2) Information transfer among multi-VRML windows;
(3) Information transfer among JavaApplet in different pages.
//Search the rule in jRuleLib_IDj
(M2) Check-lib(buttonkey, jRuleLib_IDj); 4.1. Information transfer between JavaScript, JavaApplet and VRML
(M3) SendCommand;
Attributes JavaScript and JavaApplet can communicate by using their
internal interface and JavaApplet can communicate with VRML by
(A1) Buttonkey: int;
using the External Authoring Interface (EAI). JavaScript cannot
(A2) Rule-checked?: Boolean make a communication with VRML directly. It has to communicate
(A3) Command: cmddata with VRML through JavaApplet which plays the role of commu-
Valuation nication bridge. The principle is as shown in Fig. 7.
(V1) [get-buttonkey] buttonkey = bk (1) Communication between JavaScript and JavaApplet
(V2) [check-lib(buttonkey,jRuleLib_IDj)] (a) Method of JavaScript accessing the function of JavaApplet
rule-checked? =true or =false JavaScript can access the public function which is defined
Safety in JavaApplet by the following code:
(S1) Per(SendCommand) ! rule-checked? = true window. document. <applet-Name>.<method-name>
End Here the name of the applet is the name given to it in
the applet tag in HTML code as the follows:
4. Interaction between operator and virtual machine <applet code = ‘‘File name of Applet’’ name = ‘‘Applet tag
name’’>
Virtual operations with a CNC machine includes various manual
operations similar to practical manipulation, such as selecting (b) Method of JavaApplet accessing the function of JavaScript
work piece or tools, tool sitting, rectifying tools, input NC code and
JavaApplet can access the function of JavaScript via the
setting the parameters of NC machine from virtual control panel.
imported class named netscape.javascript.JSObject.
So the virtual operating system should also has the ability to
The methods of JSObject class shown in Table 1.
display the text and other non-graphic status (such as feed speed,
rotation speed of the main shaft), and the ability of file reading and The following steps indicate how to let JavaApplet
writing by which the operator can import/export the work piece access the function of JavaScript:
model or NC code into/from the system. VRML is weak in the 2D Step 1: Add a new attribute called MAYSCRIPT into
text display area, although it is strong in the 3D graphic display. On applet tag in HTML code;
H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697 691

Step 2: Create the instance object of JSObject class; Table 1


JSObject Methods.
Step 3: Use JSObject method named call to evoke the
function of JavaScript. Method Description

call(String functionName, Call function of Javascript


(2) Communication between JavaApplet and VRML JSObject args[])
eval(String expression) Call a JavaScript code
The communication between JavaApplet and VRML is created getSlot (int index) Get a index object from a certain container
by external authoring interface of VRML plug-in. JavaApplet getWindow(Applet applet) Get a JavaApplet window
can access the following three control types via EAI:
(a) Access any node in VRML environment;
(b) Send data to any node in VRML environment by EventIn Fig. 8 shows the principle of communication between two
interface; VRML windows. These two VRML windows, one is virtual machine
(c) Get data from any node in VRML environment by tool, the other is virtual control panel. A JavaApplet monitors the
EventOut interface. EventOut interface of all buttons in the virtual control panel. Once
it gets the EventOut information from the virtual buttons, it will
To realize the Communication between JavaApplet and VRML
activate the callback() function to handle the EventOut informa-
should be done as the following steps:
tion and send the information to the virtual machine tool in
Step1: Get the environment information by creating the another VRML window.
instance of Browser Class.
Code: Browser [Instance name of Browser] 4.3. Information transfer among JavaApplet in different pages
For example:
In prototype system, different human–computer interfaces (such
Browser browser = Browser.getBrowser(this);
as virtual the control panel, Tool installation interface, import/
Step2: Get a certain node by creating the instance of Node output work piece model interface, etc.) are placed in different HTML
class. pages. As Fig. 9 shows, the virtual operation in this prototype system
Code: Node [Instance name of Node] is achieved by coordinating the work between different function
For example: pages.
As the functional screens are mutually independent, the
Node theBall = browser.getNode(‘‘Ball’’);
communication between them is achieved by JavaApplets in the
Step3: Make the Communication between JavaApplet and different functional screens. Therefore, a reliable information
the EventIn or EventOut interface of Node. transmission method between JavaApplets must be found.
(1) Make the Communication between JavaApplet and Traditionally, the mutual communication between JavaApplets
EventIn interface of node: is achieved by using the AppletContext getApplet method or the
[Variable Name] = (EventIn[Variable Type])[Instance AppletContext getApplets method. Both methods must run with
Name of Node].getEventIn([EventIn interface name]) the following security restrictions [27]:
For example:
(1) The applets originate from the same directory on the server
Scalesize = (EventInSFVec3f)theBall.getEventIn (the same code base);
(‘‘set_scale’’); (2) The applets are running on the same page, in the same browser
(2) Make the Communication between JavaApplet and window.
EventOut or exposedField interface of node: Clearly, Fig. 9 indicates that the screens of the prototype system
[Variable Name] = (EventOut[Variable Type])[Instance are in different pages. Thus, the methods mentioned will not work
Name of Node].getEventIn([EventIn interface name]) in this form. To achieve this, we must let the applets share the same
operational environment and the same static domain [28,29]. As
For example:
long as we can establish a common shared static JavaApplet as data
Scalesize = (EventOutSFVec3f)theBall.getEventOut sharing pool for other applets in other pages to share the
(‘‘set_scale’’); information, communication among JavaApplets in different pages
Step4: Send data to EventIn interface or get data from can be achieved. In this prototype system, the static data sharing
EventOut or exposedField interface. pool is created by a JavaApplet (called main JavaApplet) at first, and
(a) Send data to EventIn interface by setValue method; then, this main JavaApplet evokes all other JavaApplets in different
pages (called sub JavaApplet). After the above steps, all sub
For example: scalesize.setValue(val);
JavaApplets can communicate with each others by the static data
(b) Get data from EventOut interface by getValue method. sharing pool. The principle of communication among JavaApplets
For example: thescale[i] = Scalesize.getValue()[i]; in different pages is shown in Fig. 10.

4.2. Communication among multi-VRML windows 5. Implementation

Virtual machine tools and control panels model are placed in The specification for the CNC machine tools virtual operating
the two independence VRML windows, respectively. In order to prototype system’s hardware and software environment is
transfer the information between the control panel and the virtual described in the following sections.
machine tools, the communication among the two or more VRML
windows should be setup. 5.1. Environment
As there is no interface to allow a VRML window to communicate
with other VRML windows, we have to make a communication link 5.1.1. Hardware environment
between multi-VRML windows by using JavaApplet as a commu- The hardware runs the supporting system and creates the
nication bridge. computer–human interaction and determines the performance
692 H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697

Fig. 8. Information interfaces between VRML windows.

Fig. 9. Coordinated working between function pages.

of the virtual CNC machine (i.e. the precision degree of the Output device: 1700 CRT.
3D model, the calculation capacity of the computer and the Input device: keyboard and mouse.
realities of the computer–human interactive interface). The
hardware programming environment for the prototype system
5.1.2. Software environment
is as follows:
The prototype system is required to be network-oriented,
operating system independent with a high 3D render quality.
Personal computer: CPU, P4 2.0G; Memory, 512 M.
According to these requirements and the development
Graphic card: GeForce FX5200 128 M DDR Memory.
languages used, the software environment we chose is as
follows:

(1) Support platform: Windows, IE5.0 or above, and Cortona VRML


Client 4.0;
(2) VRML edit tools: VRMLPad;
(3) Java Development Platform: Visual J++ 6;
(4) Web page design Tools: Dreamweaver MX.

5.1.3. Performance test


As our prototype application only needs to communicate with
the server host to download key files, it requires only a low-
bandwidth network connection to the server. The VRML model
files have been optimized and zipped, the download time is 1 or
2 min even with 56K bandwidth speed. The amount of RAM is more
important when the prototype application runs on client
computer. Table 2 shows the detail information in terms of
memory requirement, frame rate per second (FPS) and CPU usages
at client. As shown in Table 2, the key factor which affects the
performance is the size of work piece which needs more memory
Fig. 10. Communication among JavaApplets in different pages. and slows the frame rate.
H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697 693

Fig. 11. Main operation interface of NC machine.

Table 2 (3) Cutting tool addition or removal screen (Fig. 13);


Performance test.
(4) Reference tools addition or removal screen (Fig. 14);
Condition RAM Frame CPU (5) CNC machining process (Fig. 15);
requirement rate per usage (6) The machining simulation result (Fig. 16);
(MB) second (FPS)
(7) G-Code Editor Interface.
No work piece amounted 85 42 4–8%
200  100  10 (length  width 113 23.81 18–35% As shown in Fig. 17, user can enter the G-Code via the virtual
 height) work piece mounted
keyboard and can change the position of the cursor by using the
200  100  30 work piece mounted 114 23.68 18–36%
200  200  10 work piece mounted 119 18.32 34–47%
arrow buttons. User can also use the special button called ‘‘Input’’
200  200  30 work piece mounted 119 18.23 34–48% to import the G-Code from the text file and use the ‘‘Output’’ button
to export the G-Code to text file.

5.3. Algorithm for the material removal simulation


5.2. Operation interface
This system adopts the Z-Map structure model algorithm
Operation interface of this prototype system includes the theory to achieve the cutting simulation [30]. This method has the
following screen mainly: following advantages:

(1) Main operation interface (Fig. 11);


(2) Work piece set up or removal screen (Fig. 12);

Fig. 12. Main interface of work piece set up or removal. Fig. 13. Main interface of cutting tool addition or removal.
694 H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697

Fig. 14. Main interface of reference tools addition or removal.

Fig. 15. NC Machining process.

(1) The algorithm is very easy for program creation;


(2) The system memory will be released, raising the calculation
efficiency because the three dimension points are reduced to
one dimension (only the Z direction is used);
(3) There is ElevationGrid node in the VRML which can be used
directly, so it is not necessary to design other prototype nodes.

5.3.1. Work piece definition by the ElevationGrid node


Work piece can be described by the ElevationGrid node in the
VRML because the ElevationGrid node is very similar to the Z-map
Fig. 16. Machining simulation result. structure model. The steps are:
H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697 695

Fig. 17. G-code Editor Interface.

Step 1: Determine how many points on the X, Y direction are (2) HZ1 is the Z axis value of the top plane of worktable in VRML
needed to describe the work piece which can calculate by Eq. (1) coordinates;
9 (3) Hj is the height of the fixture;
L >
>
X Dim ¼ = (4) TL is the length of the tool;
D (1)
W> (5) Hw is the height of work piece;
Y Dim ¼ >
;
D (6) H = HZ0  HZ1;
(7) clearance = H  ToolLength  Hw  Hj, the space between cut-
XDim is the required number of points on the X direction, YDim is ting tool and work piece. The tool intersects the work piece
the required number of points on the Y direction, L is the length of when the value of space is a negative number.
the work piece, W is the width, D is the distance between the two
vertices. Set the current coordinates of cutting tool to be (x, y, z), the
From Eq. (1), the smaller the D is, the more accurate the work relative zero point coordinates on the XY plane to be (x0, y0), the
piece is and consequently more system memory is required. length of work piece to be L, the width of work piece to be W,
Step 2: Set the height of the dispersed points of the work piece discrete accuracy of work piece to be D, the length of cutting tool to
As shown in Fig. 18, set the height of the edge points (the points be LT, the radius of cutting tool to be R. XDim and YDim can be
in the dotted line frame) to 0, the other is the height of work piece, calculated using formula (1).
finishing the separation of the work piece.

5.3.2. The algorithm for material removed


The system judges whether the tool intersects the work piece
by the relative distance between them. The relative distance
between the tool and the work piece is defined as Fig. 19.
The meaning of the parameters in Fig. 19 is as the follows:

(1) HZ0 is the Z value of the chuck jaw, changing when the tool is
move through the Z direction;

Fig. 18. Work piece entity. Fig. 19. Relative position between tool and work piece.
696 H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697

qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
The detailed steps of the algorithm for material removal are as
ði  T X Þ2 þ ð j  T Y Þ2 < R, the point (i, j) is considered to be the
the follows:
point on the XY plane of cutting tool. And the sequence number of
Step 1: Sequence operation of the center point coordinates of the point in work piece on the XY plane which corresponds to the
cutting tool on the XY plane by Eq. (2). point(i, j) can be calculated by Eq. (3):
9 N ¼ X Dim  ðT Y þ jÞ þ T X þ i (3)
jx  x0 j >
>
TX ¼ =
D (2) If N  XDim  YDim, then this point is on the work piece, namely
jy  y0 j >
>
TY ¼ ; the projection point on the work piece’s XY plane of the tool; else
D means this point is not on the work piece, so abandon it.
Step 2: Find out the projection point on the work piece’s XY Step 3: Compare the height of the found out projection points.
plane of the tool. Name the array to store the height of the points as WHeight. If
Set all the points of the work piece to be one-dimensional array, WHeighti > (HZ0  LT), the height of the target point is considered
and the subscript of each point to be number. Set all the points of larger than the height of the tool, using Eq. (4) to refresh.
cutting tool on the XY plane to be two-dimensional array, and the WHeight i ¼ HZ0  LT (4)
subscript of X is i, the subscript of Y is j.
First traverse through all the values of i and j. The range of i is The workflow of the algorithm for material removed as shown
from TX to TX, the range of j is from TY to TY. If in Fig. 20.

6. Conclusion

This paper studied the web-based CNC machine tool operations.


The versatile CNC machine tool model and CNC control panel
model had been discussed in this paper. Then, a communication
approach based on VRML, JavaApplet and HTML, which is the key
to create the prototype system, had been described. Comparing
with the traditional EAI communication between VRML and
JavaApplet, this approach has two advantages:

(1) The design of the system’s control panel becomes more flexible.
(2) The reading/writing ability can be achieved by the JavaScript
imbedded in the HTML, overcoming the weakness that
JavaApplet needs to be complied with digital signature and
configure the complex system environment to allow it read/
write the local files.

Finally, in order to validate the feasibility of the proposed


approach, the CNC milling machine was taken as an illustrative
example for the prototype development. In comparison with the
traditional stand alone CNC machine simulation system, our
prototype application is platform independent and no special
program needs to be installed on the client computer.

Acknowledgements

This work is supported by National Natural Science Foundation


of China (No. 50775047); Scientific and Technological Project in
Guangdong province, China (No. 2007A010100013). We would like
to express our gratitude to Robert Kelly who helped in correcting
the paper.

References

[1] Y. Yao, J. Li, W.B. Lee, C.F. Cheung, Y. Zhejun, VMMC: a test-bed for machining,
Computers in Industry 47 (2002) 255–268.
[2] M. Weyrich, P. Drews, An interactive environment for virtual manufacturing: the
virtual workbench, Computers in Industry 38 (1999) 5–15.
[3] I.D. Carpenter, J.M. Ritchie, R.G. Dewar, et al., Virtual manufacturing, Manufactur-
ing Engineering 3 (1997) 1–13.
[4] S.-H. Suh, Y. Seo, S.-M. Lee, T.-H. Choi, G.-S. Jeong, D.-Y. Kim, Modelling and
implementation of internet-based virtual machine tools, The International Jour-
nal of Advanced Manufacturing Technology 21 (2003) 516–522.
[5] S.K. Ong, L. Jiang, A.Y.C. Nee, An Internet-based virtual CNC milling system,
The International Journal of Advanced Manufacturing Technology 20 (2002)
44–47.
[6] W. Lihui, P. Orban, A. Cunningham, S. Lang, Remote real-time CNC machining for
web-based manufacturing, Robotics and Computer-Integrated Manufacturing 20
(2004) 562–571.
[7] C. Zhao. Evaluation of Vrml for Modeling Virtual Worlds. Master of Science; Miami
Fig. 20. Flow chart of hidden algorithm. University; Systems Analysis, 2000.
H. Hanwu, W. Yueming / Computers in Industry 60 (2009) 686–697 697

[8] S. Jayaram, H.I. Connacher, K.W. Lyons, Virtual assembly using virtual reality [26] S.K. Ong, M.A. Mannan, Virtual reality simulations and animations in a web-based
techniques, Computer-Aided Design 29 (1997) 575–584. interactive manufacturing engineering module, Computers & Education 43
[9] K.-P. Beier. Web-based virtual reality in Design and Manufacturing Applications. (2004) 361–382.
COMPIT’2000. URL: http://www-vrl.umich.edu/beier/Papers/compit2000/ [27] Sending Messages to Other Applets. The JavaTM Tutorial. URL: http://www.
WebBasedVR.htm. java.sun.com/docs/books/tutorial/deployment/applet/iac.html.
[10] W.D. Lia, S.K. Ong, A.Y.C. Nee, A Web-based process planning optimization system [28] T. Hill. An alternative way for applet-to-applet communication. URL: http://
for distributed design, Computer-Aided Design 37 (2005) 921–930. www.javaworld.com/javaworld/javatips/jw-javatip101.html.
[11] J.Y.H. Fuh, W.D. Li, Advances in collaborative CAD: the-state-of-the art, Computer- [29] L. Qiang, Y. LiLi, Communication among applets in different supervise and control
Aided Design 37 (2005) 571–581. screens in virtual network supervise and control system, Computer Programming
[12] W.D. Li, et al., An Internet-enabled integrated system for co-design and con- Skills & Maintenance 8 (2004) 72–84.
current engineering, Computers in Industry 55 (2004) 87–103. [30] P.-L. Hsu, W.-T. Yang, Realtime 3D simulation of 3-axis milling using isometric
[13] H.Y. Kan, V.G. Duffy, C.-J. Su, An Internet virtual reality collaborative environment projection, Computer-Aided Design 25 (4) (1993) 215–224.
for effective product design, Computers in Industry 45 (2001) 197–213.
[14] S.H. Choi, A.M.M. Chan, A virtual prototyping system for rapid product develop-
He Hanwu is a Professor of the Faculty of Electro-
ment, Computer-Aided Design 36 (2004) 401–412.
[15] K. Brodlie, N. El-Khalili, Y. Li, Using web-based computer graphics to teach mechanical Engineering at Guangdong University of
surgery, Computer & Graphics 24 (2000) 157–161. Technology (GDUT) at Guangzhou, China. He is currently
[16] P. Wang, I.A. Kreutzer, R. Bjärnemo, R.C. Davies, A Web-based cost-effective head of the virtual reality research group at GDUT. He
training tool with possible application to brain injury rehabilitation, Computer received his Ph.D. degree in Electromechanical Engineer-
Methods and Programs in Biomedicine 74 (2004) 235–243. ing in 2001, Master degree in Manufacturing Automation
[17] J.C. Waller, N. Foster, Training via the web: a virtual instrument, Computers & Engineering in 1992 and Bachelor degree in Mechanical
Education 35 (2000) 161–167. Engineering in 1988, all from Huazhong University of
[18] W.Y. Liang, P. O’Grady, The internet and medical collaboration using Science and Technology at Wuhan, China. His main
virtual reality, Computerized Medical Imaging and Graphics 27 (2003) 525– research interests are in the domain of virtual reality,
534. networked manufacturing, virtual reality applications in
[19] J.A. Vélez, A.A. Navarro Newball, C.A. De La Roche, L.E. Múnera, G. Bernabé, driving simulation, product design, manufacturing sys-
C. Bermúdez, et al., A virtual surgical telesimulation in micrographic derma-
tem and medical treatment. His research projects have
tologic surgery (MOHS), International Congress Series 1256 (2003) 151–
been sponsored by a number of organizations including the Natural Science
155.
[20] G. Bhatt, Bringing virtual reality for commercial Web sites, International Journal Foundation of China, HI-Tech Research and Development Program of China, the
of Human–Computer Studies 60 (2004) 1–15. Natural Science Foundation of Guangdong Province and Department of Science and
[21] K.C. Lee, N. Chung, A web DSS approach to building an intelligent internet Technology of Guangdong Province. He received the third prize for the National
shopping mall by integrating virtual reality and avatar, Expert Systems with Science and Technology Progress from China in 1995.
Applications 28 (2005) 333–346.
[22] Y. Seo, D.-Y. Kim, S.-H. Suh, Development of web-based CAM system, The Inter-
Wu Yueming born in 1979, is currently a doctoral
national Journal of Advanced Manufacturing Technology (online) 28 (4) (2005)
candidate in Faculty of Electromechanical Engineering,
101–108.
Guangdong University of Technology, China. He received
[23] S.-H. Suh, E.-S. Lee, Contouring performance measurement and evaluation of NC
machine controller for virtual machining CAM system, The International Journal his master degree in Electromechanical Engineering in
of Advanced Manufacturing Technology 16 (2000) 271–276. 2005 from Guangdong University of Technology. His
[24] CNC & CAD/CAM initial & continuing vocational training, TMS Company, URL: research focuses on virtual reality and augmented reality
http://www.mts-cnc.com/. applications in manufacturing system.
[25] C.-H. Yeung, Y. Altintas, K. Erkorkmaz, Virtual CNC system. Part I. System
architecture, International Journal of Machine Tools & Manufacture 46 (2006)
1107–1123.