Alma G. Rodríguez*
Luis R. Vidal P.**
submitted date: November 2013
Juan Miguel Díaz M.*** received date: December 2013
Cesar Leonardo González Pinzón**** accepted date: February 2014
Abstract
This paper discusses the development process involved in making a user
interface translate G-Code (ISO6983) using Microsoft Visual Basic 2010
together with communication protocol OPC. This interface was developed
in three modules, the first one verifies syntax and lexicon, the second is a
command converter for a Programmable Logic Controller Allen Bradley
L63 using a SERCOS interface card and servo drive ULTRA 3000, and the
last one executes motion control instructions. The interface is used for a
profile milling process, on an XY plane and using G00, G01, G02 and G03
codes generated in a Fanuc postprocessor 3XMILL. The interface shows
errors detected in the verification module according to the parameters
established and identifies the corresponding line; it also monitors the XY
position in real time, The interface allows line-by-line execution or auto-
matic mode. The interface does not require information for cutting speed,
tool advance speed, and spindle speed or tool compensation from the NC
*
B.Sc. In Industrial Engineering, Universidad Autónoma de Ciudad Juárez (México). E-mail: arodriguez@uacj.mx
**
B.Sc. And MSc. in Industrial Engineering, Instituto Tecnológico y de Estudios Superiores de Monterrey (México).
Current position: Professor Universidad Autónoma de Ciudad Juárez (México). E-mail: lvidal@uacj.mx
***
B.Sc. In Industrial engineering and MSc. in Industrial Engineering, Instituto Tecnológico y de Estudios Superiores de
Monterrey, (México). Current position: Professor Universidad Autónoma de Ciudad Juárez (México).
E-mail: jdiaz@uacj.mx
****
B.Sc. In Production engineering, Universidad EAN, Bogotá (Colombia). MSc. In Industrial Automation Engineering,
Universidad Nacional de Colombia, (Colombia). Current position: Professor Universidad Autónoma de Ciudad Juárez
(México).E-mail: cempaques@hotmail.com, cesar.gonzalez@uacj.mx
Electronic Vision - year 7 number 1 pp. 143 - 153 january -june of 2014
143
Alma G. Rodríguez - Luis R. Vidal P. - Juan Miguel Díaz M. - Cesar Leonardo González Pinzón
program. The interface was also developed using With the implementation of Programmable
incremental and reuse oriented methodologies. Logic Controller (PLC) [4] the motion control
functions can be executed, assisted by motion
Key words control instructions and motion analysis soft-
Interface, G-Code, Programmable Logic Con- ware. The motion control is an automation
troller, Milling process, servo drive, commu- field in charge of developing technologies and
products that improve precision systems sig-
nication protocol.
nificantly [5]. Servomotors are controlled by
the PLC through the use of a servo drive and
1. Introduction a communications interface, such as the I/O
cards for sensors and other actuators.
The increasing demand for quality products
introduces the need to develop and impro- In recent years, research on G-Code inter-
ve CNC (Computer Numerical Control) ma- preters has become relevant and intended to
chine tools. CNC systems have a computer develop open systems with universal appli-
that reads and interprets instructions in ma- cations, some cover standards ISO6983 and
chine language or G-Codes for guiding a tool basic NC program structures [6], [7], [8], [9],
[1]. The Numerical Control (NC) program is some others cover the most recent standard
the one that details the instructions step by STEP-NC (Standard for the Exchange and
step, indicating the machine what path to fo- Sharing of Product) [10] and [11]. In general,
llow and which operation to execute for the the trend is marked by the interpreter.
machining of a part. At the beginning, CNC
machines were used exclusively by the aeros- 2. Methodology
pace industry, now they have been adapted to
other industries like wood [2] and plastics [3]. The method used for the development of
What distinguishes a particular machine for this study includes six main stages, as shown
a specific application is a variety of settings in Figure 1. In the first stage, requirements
like load charges, vibration, cutter, working are defined, namely the definition of the NC
area, machining velocities and precision re- program structure, selection of the post pro-
quirements. Through the Computer Aided cessor used for test and validation, hardware
and software requirements. The second sta-
Design and Computed Aided Manufacture
ge is called conceptual design and consists in
(CAD/CAM) it is possible to create different
proposing the conceptual model. The third
part designs and generate the corresponding
stage is the development of the GUI, where
NC program with a postprocessor. Postpro-
the main module and the process interface are
cessors are translation tools of CAM software
explained. Since the validation of the interface
that convert a design, or path, in a language is taken to a physical cutting process, the next
that can be understood by the control modu- stage, called development of the control mo-
le of the CNC machine. The commands and dule, is necessary for the control of the multi-
information described in the NC program axis system. After the GUI and the control
cannot be managed directly, so it is the inter- module are finished, integration takes place in
preter that extracts the corresponding data order to make everything work together. Fi-
and translates it into machining and motion nally, the last stage involves validation of the
control commands for the controller. method. Two validations were conducted; the
first validation is through a checklist of the ex- of the file is not satisfied, the program will
A CASE-STUDY
pected operation and performance of the GUI stop and the error should be shown to the VISION
as a software product, and the second valida- user in the interface and saved on an errors
tion was performed over the milling process file (location shown to the user). Some of the
when machining an irregular path. rules defined for the verification function are:
2.1 Defining requirements 1. XY plane.
The structure and format of the NC program
change from one postprocessor to another, so it 2. Metric system.
was necessary to specify a basic structure with 3. Absolute coordinates.
a generic format for the test of the G-Code in-
terpreter prototype. The structure was defined 4. Eliminate commentaries.
following the research made by Hong et al. [12].
5. Each block must be numbered (exam-
The format considered the default postproces-
ple,”N100 G00 X3. Y3.”).
sors included in MasterCAM X4; the one selec-
ted was a Fanuc 3XMILL postprocessor. 6. Machining commands G00, G01, G02, and
G03 are written once and the following
Figure 1. Method blocks take the same command unless
other command is specified.
Electronic Vision - year 7 number 1 pp. 143 - 153 january -june of 2014
145
Alma G. Rodríguez - Luis R. Vidal P. - Juan Miguel Díaz M. - Cesar Leonardo González Pinzón
The interface follows sequential programming. When the process is running, either on semi-
A CASE-STUDY
The NC program is chosen and verified. automatic or single block mode, the main VISION
interface displays the current and expected
For the process to start, it is necessary to
position using monitoring variables created
make sure that the OPC connection has been
with the first reused-oriented component.
established. The “Connect” button calls for the
OPC connection function from the VB class of The main interface also displays the comple-
the second reused-oriented component. te NC program for further observations. The
user has the option of stopping and resetting
For the semi-automatic mode, the file is read the process in case of emergency or whe-
again line by line sending the data extracted never a particular situation arises. The data
from each block. The next line is read until the
sent to the PLC in these cases is a priority for
axes operation is finished. The single block
the controller program. Once the stop button
mode also reads line by line, extracting the co-
rresponding data, but the data is sent until the is activated, the reset button is enabled and
user makes this decision, as long as the pre- it has to be pressed to star another process
vious axes operation has been completed. from the beginning, Figs. 3 a, b.
Soruce:
Overall, 33 OPC items were used for the co- program to the PLC so it has most of the OPC
rrect NC program interpretation and functio- item used. In Figure 4, the items and their co-
nality of the interface and process. The items rresponding interface relation is shown. It is
exchange data between the interfaces and the important for the process to start with all the
PLC, which controls the servo drives and the- items on-line; to this end, on the first tests,
refore the axis system. The process interface the items were monitored in the OPC Test
sends the information extracted from the NC Client tool of RSLinx.
Electronic Vision - year 7 number 1 pp. 143 - 153 january -june of 2014
147
Alma G. Rodríguez - Luis R. Vidal P. - Juan Miguel Díaz M. - Cesar Leonardo González Pinzón
Electronic Vision - year 7 number 1 pp. 143 - 153 january -june of 2014
149
Alma G. Rodríguez - Luis R. Vidal P. - Juan Miguel Díaz M. - Cesar Leonardo González Pinzón
The equipment used for the control modu- For the first run with the whole system inte-
A CASE-STUDY
le included an L63 PLC, a Multi-Axis MPS- grated, a 1/8” cutter was used at a 4mm depth VISION
Series and two servos drives ULTRA3000, and a speed of 35.43in/min in a delrin sheet
brand Allen Bradley. The control module of 1ft 2.1 of thickness. For a better surface fi-
program consists of seven routines: Startup, nish, the rest of the validation tests were run
Shutdown, Homing, Restart, Positioning Mo- at a speed of 7.08 in/min with a 2mm depth.
tion, Linear Motion, and Circular Motion. The path designed in MasterCAM X4, used
for the validation, is shown in Figure 10. The
final machining is shown in Figure 11.
Figure 8. Motion control-routine test result.
a) Diamond, b) Moon, c) Square
Figure 10. “UACJ” paths CAM design.
a)
c)
3. Conclusion
A prototype of G-Code interpreter was propo-
sed. The interpreter was successfully imple-
mented through a semi-automatic and single-
block CNC milling process. The machining
process used for the validation was possible
through the control of a three-axis system. The
control was PLC-based and the data was sent
Source: own elaboration using OPC, making the communication bet-
Electronic Vision - year 7 number 1 pp. 143 - 153 january -june of 2014
151
Alma G. Rodríguez - Luis R. Vidal P. - Juan Miguel Díaz M. - Cesar Leonardo González Pinzón
ween the user interface and the control modu- [5] Rockwell Automation, “Literature Li-
le possible. The conversion into motion control brary”, 2013, April, disponible en: http://
instructions made it possible to construct the ab.rockwellautomation.com/
interpreter from a physical point of view. Since
[6] Long Chen, Dong Yu, Han Zhang, Cong
the purpose of this research was to validate the
Geng & Lei Dong. "Design and imple-
interpretation of the motion machining control
ment of a modularized CNC interpreter
commands, the non-motion machining control
based on the integration of tool path
commands remained fixed during the milling
planning module". IEEE International
process. Compared to previous works, the pre-
Conference on Computer Science and
sent interpretation of the motion machining
Automation Engineering (CSAE), vol.
commands of the G-Code was taken into a con-
3, DOI: 10.1109/CSAE.2012.6273027,
trol module to actually carry out a machining
2012, pp. 613-616
process (milling), [17], [18].
[7] Gao Qi & Zu Yingli (2011). Research on
In future work, the lexicon and syntax rules universal NC program processor for CNC
will be incremented to have a complete dic- system. 2nd International Conference on
tionary data structure as well as the control of Digital Manufacturing & Automation.
the Z-Axis for a complete automatic control of 2011, pp. 1046- 1049.
the CNC milling prototype machine. The GUI [8] Yadong Liu, Xingui Guo, Wei Li, Kazuo
will also be improved by adding an edition tab Yamazaki, Keizo Kashihara & Makoto
and a simulator for path and machining. Fujishim, “An intelligent NC program
processor for CNC system of machine
References tool. Robotics and Computer-Integrated
Manufacturing”.2007, pp.160-169
[1] Albert. "Understanding CNC Routers. [9] Xingui Guo, Yadong Liu, Daoshan Du,
Canada",Canadá: FP Innovations. 2011. Kazuo Yamazaki & Makoto Fujishima, “A
[2] Fusaomi Nagata, Yukihiro Kusumoto & universal NC program processor design
Keigo Watanabe. "Intelligent machining and prototype implementation for CNC
system for the artistic design of wooden systems”. The International Journal of
paint rollers. Robotics and Computer-In- Advanced Manufacturing Technology,
tegrated Manufacturing",2009, pp. 680- 2012, volumen 60, pp. 561-575, DOI:
688. doi:10.1016/j.rcim.2008.05.001: 1.1007/s00170-011-3618-6
[3] Hui Zhang, Changsheng Ai, Fang Zhao [10] H. Lan, R. Liu & C. Zhang, “A multi-
& Xiangbo Ze, “The CNC Development agent-based intelligent STEPNC contro-
of the Sawing and Milling Machining ller for CNC machine tools". Internatio-
Center for Plastic Door and Window nal Journal of Production Research. , vol.
PVC Profile Based on Fanuc0. 7th World 46, no. 14, pp. 3887-3907, Julio 2008
Congress on Intelligent Control and Au-
[11] W. X. Chen (2010). Research on STEP-
tomation (WCICA)”, DOI:10.1109/WCI-
Compliant CNC System for Integration
CA.2008.4593912, 2008, pp. 9362 - 9367
of CAD/CAPP/CAM. Mechanical Manu-
[4] W. Bolton, “Programmable Logic Contro- facturing and Automation, pp. 529-551,
llers”. USA: Newnes, 2009. 2010.
[12] Haitao Hong, Dong Yu, Xiaohui Zhang & [15] Rockwell Automation (2010, November).
A CASE-STUDY
Long Chen (2010), Research on a new MP-Series Integrated Multi-axis Linear VISION
model of numerical control program Stages. Allen Bradley, Rockwell Soft-
interpreter. 2nd International Confe- ware, Rockwell Automation, pp. 1-136,
rence on Advanced Computer Control 2010, November
(ICACC), vol. 2, 467-472. doi: 10.1109/ [16] Rockwell Automation (2011, November).
ICACC.2010.5486632 SERCOS and Analog Motion Configura-
[13] Guo Huijuan, Guo Huijuan & Zhi Derui. tion and Startup. Allen Bradley, Rockwell
Design of several OPC servers commu- Software, Rockwell Automation, 1-318,
nication system. International Conference MOTION-UM001B-EN-P.
on Electric Information and Control Engi- [17] QIAN Xinhua, JIA Shiyang, SU Xing,
neering (ICEICE), pp. 317-319, 2011. CHEN Yue, WANG Kefeng & YAO Pin-
[14] Yuxiang Wu & Christine W. Chan, “A data gjing (2010). Adaptive
analysis decision support system for the [18] On-line Operation Guide for Dry Gas-to-
carbon dioxide capture process. Expert ethylbenzene Reactor. Chinese Journal
Systems with Applications”, pp. 9949- of Chemical Engineering, vol.18, no.3,
9960, 2009 419-424.
Electronic Vision - year 7 number 1 pp. 143 - 153 january -june of 2014
153