6
A Web-Based, Collaborative, Computer-Aided Sequential Control Design Tool By Chiaming Yen, Wu-Jeng Li, and Jui-Cheng Lin A Web-based, collaborative, computer-aided design soft- ware tool has been developed for sequential control system design. The software includes functions for specifying a sequential control system using icons for electri- cal devices and circuits. With the software, users can automati- cally generate electrical circuit designs by inputting the required motion sequences. The software’s animated simula- tion function helps users verify or modify their designs. The software is designed to allow multiple users to work together in a collaborative mode over the Internet. During a collaboration session, only the user who “owns” a virtual to- ken can modify the design. Other users can only view, but not modify, the current design. The software is written in Java and thus can be used on any computer with a Java virtual machine. It can either be started as a Java application or executed through a Web browser. Web users can save their system design results into a database. Designed as a Java applet, the software has been embed- ded into Web pages and has become part of courseware on pneumatics. The animated simulation function of the soft- ware is especially suitable for control system demonstration. In the collaborative mode, the applets are used as an online instructional tool. In addition, online circuit design examina- tions are held in classrooms, with all student design results saved in a database for grading by the instructor. In this software, all pneumatic, electrical, and controlled devices are designed as software components. This allows users to visually construct electrical circuits using these components and also to add their own device components to extend the functions of the tool. Over the past few years, electronic devices for mechani- cal manufacturing have become more technologically ad- vanced. Microprocessors are used in almost every mechani- cal system. Mechatronic systems integrate the actuators of mechanical systems and the control signal processing abili- ties of electronics into flexible working units. Functionally speaking, a sequential control system can be divided into two parts: an actuator, which supplies en- ergy to produce mechanical work, and a control unit, which provides control signals to activate the actuators. Early con- trol units consisted of purely mechanical components, which were then replaced with electrical circuits. These days, due to the popularity of microprocessors, the control unit is usually a computer [1]. With electrical circuits for control, the reliability of the system is improved, but the circuit design is not efficient. Every change in the motion sequence involves a new circuit design and hardware wiring, which is time consuming. Mi- croprocessor-based systems, in particular, programmable logic controllers (PLCs), are now widely used in industry be- cause of their reliability and low cost [2]. An obvious benefit of a PLC is that the user can change motion sequences sim- ply by modifying programs (digital circuits) instead of changing the hardware wiring. However, although the elec- trical circuits are replaced by a PLC, the design of electrical circuits is still very critical because the major design method for PLC programming is to translate electrical cir- cuits (ladder diagrams) into PLC codes. But PLCs are closed systems, with each different manufacturer having its own design and format. As a result, PLC evolution has lagged ad- vances in computational technology. In the meantime, the PC with its open structure has evolved several generations in hardware and software, and PC-based control is now affordable. Advances in software engineering have made the development of large-scale pro- grams for the PC far easier than for the PLC. The rapid growth of the Internet in recent years has made network connectivity a basic function of a personal computer, mak- ing PCs even more superior to the PLC. To handle the complexity of large-scale software, ob- ject-oriented programming (OOP) was proposed. Today, OOP has matured, and visual development tools are popular for developing software. Java [3], [4] represents a further 14 IEEE Control Systems Magazine April 2003 EYE EDUCATION on Web Links The computer-aided sequential control system design software described here is available from the author’s Web site: http://nhit.twiic.org/user/li/pneu.htm Readers can download a trial version from the site or try it online at http://nhit.twiic.org/user/li/ladder.htm The software has been integrated with course material on pneumatics. The courseware is available at http://nhit.twiic.org/user/li/ Yen ([email protected]), Li, and Lin are with the Department of Mechanical Design Engineering, National Hu-Wei Institute of Technol- ogy, Yun-Lin, 63208 Taiwan. 0272-1708/03/$17.00©2003IEEE Authorized licensed use limited to: University of Michigan Library. Downloaded on April 09,2010 at 18:16:07 UTC from IEEE Xplore. Restrictions apply.

A Web-Based, Collaborative, Computer-Aided Sequential Control

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Web-Based, Collaborative, Computer-Aided Sequential Control

A Web-Based, Collaborative, Computer-AidedSequential Control Design Tool By Chiaming Yen, Wu-Jeng Li, and Jui-Cheng Lin

AWeb-based, collaborative, computer-aided design soft-ware tool has been developed for sequential controlsystem design. The software includes functions for

specifying a sequential control system using icons for electri-cal devices and circuits. With the software, users can automati-cally generate electrical circuit designs by inputting therequired motion sequences. The software’s animated simula-tion function helps users verify or modify their designs.

The software is designed to allow multiple users to worktogether in a collaborative mode over the Internet. During acollaboration session, only the user who “owns” a virtual to-ken can modify the design. Other users can only view, butnot modify, the current design.

The software is written in Java and thus can be used onany computer with a Java virtual machine. It can either bestarted as a Java application or executed through a Webbrowser. Web users can save their system design resultsinto a database.

Designed as a Java applet, the software has been embed-ded into Web pages and has become part of courseware onpneumatics. The animated simulation function of the soft-ware is especially suitable for control system demonstration.In the collaborative mode, the applets are used as an onlineinstructional tool. In addition, online circuit design examina-tions are held in classrooms, with all student design resultssaved in a database for grading by the instructor.

In this software, all pneumatic, electrical, and controlleddevices are designed as software components. This allowsusers to visually construct electrical circuits using thesecomponents and also to add their own device componentsto extend the functions of the tool.

Over the past few years, electronic devices for mechani-cal manufacturing have become more technologically ad-vanced. Microprocessors are used in almost every mechani-cal system. Mechatronic systems integrate the actuators ofmechanical systems and the control signal processing abili-ties of electronics into flexible working units.

Functionally speaking, a sequential control system canbe divided into two parts: an actuator, which supplies en-ergy to produce mechanical work, and a control unit, whichprovides control signals to activate the actuators. Early con-trol units consisted of purely mechanical components,which were then replaced with electrical circuits. Thesedays, due to the popularity of microprocessors, the controlunit is usually a computer [1].

With electrical circuits for control, the reliability of thesystem is improved, but the circuit design is not efficient.Every change in the motion sequence involves a new circuitdesign and hardware wiring, which is time consuming. Mi-croprocessor-based systems, in particular, programmablelogic controllers (PLCs), are now widely used in industry be-cause of their reliability and low cost [2]. An obvious benefitof a PLC is that the user can change motion sequences sim-ply by modifying programs (digital circuits) instead ofchanging the hardware wiring. However, although the elec-trical circuits are replaced by a PLC, the design of electricalcircuits is still very critical because the major designmethod for PLC programming is to translate electrical cir-cuits (ladder diagrams) into PLC codes. But PLCs are closedsystems, with each different manufacturer having its owndesign and format. As a result, PLC evolution has lagged ad-vances in computational technology.

In the meantime, the PC with its open structure hasevolved several generations in hardware and software, andPC-based control is now affordable. Advances in softwareengineering have made the development of large-scale pro-grams for the PC far easier than for the PLC. The rapidgrowth of the Internet in recent years has made networkconnectivity a basic function of a personal computer, mak-ing PCs even more superior to the PLC.

To handle the complexity of large-scale software, ob-ject-oriented programming (OOP) was proposed. Today,OOP has matured, and visual development tools are popularfor developing software. Java [3], [4] represents a further

14 IEEE Control Systems Magazine April 2003

EYE EDUCATIONon

Web Links

The computer-aided sequential control systemdesign software described here is available

from the author’s Web site:http://nhit.twiic.org/user/li/pneu.htm

Readers can download a trial version fromthe site or try it online at

http://nhit.twiic.org/user/li/ladder.htmThe software has been integrated

with course material on pneumatics.The courseware is available at

http://nhit.twiic.org/user/li/

Yen ([email protected]), Li, and Lin are with the Department of Mechanical Design Engineering, National Hu-Wei Institute of Technol-ogy, Yun-Lin, 63208 Taiwan.

0272-1708/03/$17.00©2003IEEE

Authorized licensed use limited to: University of Michigan Library. Downloaded on April 09,2010 at 18:16:07 UTC from IEEE Xplore. Restrictions apply.

Page 2: A Web-Based, Collaborative, Computer-Aided Sequential Control

step in programming languages because of its platform inde-pendence and its suitability for networking. These develop-ments make this not only an era of PC-based control but ofWeb-based control as well. It won’t be long before a PDA isused to activate a sequential control. Software developed inJava has great merit in such an environment.

Using this method, we have developed a Web-based, col-laborative, computer-aided or computer-automated designprogram for electrical circuit design for sequential control.Although many computer-aided sequential control designsoftware packages exist for pneumatics and hydraulics, toour knowledge most of them are Windows or Internet based.The superior features of the software described in this arti-cle are that it is written in Java and, therefore, is Web based,and its collaboration function makes it an excellent educa-tional tool.

Functions of the ToolThe Web-based, collaborative, computer-aided design soft-ware tool is based on a computer-aided pneumatic circuit de-sign software [5] and follows its principles and design style. Inaddition, the software includes the following enhancements:

• Visualized controlled components: Besides the pneu-matic system, some electrically controlled compo-nents can be used to set up a controlled system.

• Visualized electrical devices: The software providessome electrical devices that can be used to form anelectrical circuit.

• Computer-aided design: The software helps the userdesign electrical circuits with only a few mouse clicks.

• Computer-automated design [6]: With this software,the user can input the required motion sequence sim-ply by clicking the mouse. The tool can also be used toautomatically design electrical circuits according tospecifications.

• Animated simulation: The software simulates the mo-tion of the controlled system according to the circuitdesign.

• PLC codes: The software can translate the electricalcircuit system into codes for different models of PLCs.

• User-defined components: By providing the properdata, the user can edit certain preformatted files toadd components to the program.

• Web accessibility: With a Java-enabled browser, theuser can access the software anywhere at any timewith no installation required.

• Data storage: Using this software, users can save theirdesign results into a database on a remote site.

• Collaborative mode [5]: The software’s collaborativemode allows multiple users to work together on acommon pneumatic circuit.

To achieve the functions listed above, the software’s exe-cution environment is designed as shown in Figure 1. First,

the software can be accessed as a Java applet or executed asa Java application. It can also be used in any computer with aJava virtual machine, or it can be embedded into a Web pagefor access by a browser. It consists of various types of soft-ware components (see the next section) and provides thebasic functions of a computer-aided software program.

When the software is used as an application, users cansave design data in their local computer. Alternatively, de-sign results can be saved in a remote database. To accom-plish the function of storage in a database, Java servlets [7],[8] located in a Web server are used to coordinate access toa database through Java Database Connectivity (JDBC) [9]connections. The applet-servlet communication scheme [7]is used to transfer data between applets and servlets.

To provide collaborative functions, a collaborativeserver is developed on the Web server computer. The col-laborative server manages messages among various com-puter-aided design programs running in the collaborativemode. These messages include user operation messages,chat messages, and token management messages. The col-laborative server is written in Java and utilizes the JavaShared Data Toolkit (JSDT) [10].

Graphical User InterfaceFigure 2 shows the CAD program developed in this research.The elements of the interface are the following:

• Pull-down menu.• Device pools: Pneumatic and electrical devices are

grouped into different kinds of device pools.• Control system panel: The pneumatic circuit panel [5]

of the computer-aided pneumatic circuit design soft-ware is used as a control system panel. This functioncan be used to set up a control system.

• Electrical circuit panel: The electrical circuits de-signed by users are shown here graphically.

April 2003 IEEE Control Systems Magazine 15

Web ServerCollaborative Server

(Pneumatics, Chat, Phone)Applet

Applet

Applet

Apache + Tomcat

Servlet(Connection Pool)

Database Server

Users

Figure 1. Execution environment of the sequential control CADsoftware.

Authorized licensed use limited to: University of Michigan Library. Downloaded on April 09,2010 at 18:16:07 UTC from IEEE Xplore. Restrictions apply.

Page 3: A Web-Based, Collaborative, Computer-Aided Sequential Control

• Electrical device panel: The electrical device panelshows all electrical devices used to design the electri-cal circuit.

• Motion sequence window: In this window, users caninput motion sequences by clicking the mouse.

• PLC code window: This window is used to show PLCcodes corresponding to the electrical circuit.

• Status bar: A concise description of the usage status isshown here.

To create a sequential control de-sign, the typical procedure using thistool is as follows:• Set up control system: Users can set

up a pneumatic system controlledby electrical valves and pick andplace some electrically controlleddevices to form a control system.

• Select required electrical devices:Users can select required electricaldevices to design circuits from elec-trical device pools. Devices se-lected are shown in the electricaldevice panel.

• Computer-aided design of electricalcircuits: Users can click on the sym-bols representing electrical devicesin the electrical device panel and se-lect wires from the wire pool to gen-erate the desired electrical circuits.

• Computer-automated design: Userscan input motion sequences withselected operating conditions andask the computer to design the cir-cuit automatically.

• Animated simulation: Users can en-ter the simulation mode and ob-serve the motion of the controlledsystem and state changes of electri-cal devices to ensure the correct-ness of the design. By using theanimated simulation feature, userscan debug the system design as er-rors occur. Circuits can then bemodified and resimulated until thecorrect design is reached.The “multiuser” function in the

pull-down menu allows users to inter-act with the software in a collabora-tive environment. The functions of itssubmenu are as follows [5]:• Connect: User provides an account

to log into the collaborative serverand uses the software in a collabo-rative mode.

• Disconnect: User disconnects from the collaborativeserver and leaves the collaborative mode.

• Grab token: User gets the token to dominate the de-sign process.

• Release token: User releases the token so that some-one else can take it.

• Synchronize: If a program loses synchronization withother programs in a collaborative mode, users can usethis function to synchronize it.

16 IEEE Control Systems Magazine April 2003

Figure 2. Web-based computer-aided sequential control design software.

Figure 3. Web-based computer-aided sequential control design software in collaborativemode.

Authorized licensed use limited to: University of Michigan Library. Downloaded on April 09,2010 at 18:16:07 UTC from IEEE Xplore. Restrictions apply.

Page 4: A Web-Based, Collaborative, Computer-Aided Sequential Control

• Chat: User opens a chat window to communicate withother users.

To make it easy for the user to add new devices to thesoftware, the software components are designed to be asgeneral as possible. Devices are divided into groups accord-ing to their functions. A software class is defined for eachgroup. With proper data, such as symbol graphic, actionarea, etc., one can add new devices into the software easily.All these data are set in a configuration file, which is read atthe beginning of the program execution and kept in memory.

Class Design of Electrical Device ComponentsGenerally, all electrical devices used in sequential controlare switches, but they may be activated by different meth-ods. Push-button and choice switches are activated by man-ual actions, limit switches are activated by mechanicalforce, relays are activated by electrical signals, timers areactivated when the preset time is up, and counters are acti-vated when the preset count is reached. All switches are ei-ther normally open or normally closed in status. With this inmind, users can apply this function to design a universalclass for all electrical devices. For example:

class EDevicemain variables:

activation method, mode, object name, device name,symbol graphic, timer, preset value, current value, . . . .

main methods:void setStatus(boolean st); // set the status of device.void setSol1Status(boolean st); // set the status of

coil 1.void setSol2Status(boolean st); // set the status of

coil 2.void onTime(ActionEvent evt); // event handler for

the timer.

Class Design of theControlled ComponentsIn this software, pneumatic systems and some electricallyactivated devices form the controlled system. This softwareis based on a computer-aided pneumatic circuit design pro-gram that consists of pure pneumatic components. For apneumatic circuit system to be controlled by electrical de-vices, users need to apply electric valves. Therefore, a uni-versal class named Evalve is designed to represent allpossible valves. This class is listed as follows:

class EValve extends class Valve [5]main variables:

state1 (state of coil1), state2 (state of coil2), symbolgraphics, position of coil1, position of coil2, . . . .

main methods:

void setSolFStatus(boolean b); // set the status ofsolenoid 1.

void setSolBStatus(boolean b); // set the status ofsolenoid 2.

There are many kinds of electrically controlled devices. Ageneral-purpose class is designed for these purposes:

class ESystem extends class Element [5]main variables:

motion type, motion pictures, symbol graphics, state1(state of coil1), state2 (state of coil2), position of coil1,position of coil2, timer, . . . .

main methodsvoid setSolFStatus(boolean b); // set the status of

solenoid 1.void setSolBStatus(boolean b); // set the status of

solenoid 2.

Controlled components, such as objects of class EValveand class ESystem, have a common interface. The polymor-phism property of object-oriented programming was usedto allow users to add customized classes to this system.

Configuration FileAll devices presented in this software, including pneumaticdevices, electrical devices, electrical valves, and controlleddevices, are defined in a configuration file. The file is readwhen a program is started and then kept in memory. Fromthe format of each different model type, the reader can havea thorough acquaintance with the design of the model class.Users can provide some appropriate data to add new de-vices into the software by editing the configuration file.

Animated SimulationThe animated simulation function can be used to simulatethe motions of the controlled system. With this type of simu-lation, users can realize the correctness of their designs anddebug them effectively.

A simple interpreter of PLC codes is used to accomplishthe simulation function. Before simulation starts, the soft-ware translates the electrical circuit into PLC codes. Athread is then used to run the PLC codes with the simple in-terpreter repeatedly. This simulation method acts like a PLCrunning its program. An electrical circuit for sequential con-trol is a set of analog circuits. In the PLC, it is translated intoa ladder diagram, called a digital circuit (PLC codes). Sincethe codes execute fast and repeatedly, the digital circuit canwork like a set of corresponding analog circuits.

When simulation begins, a separate thread is started tokeep executing the following three processes until the simu-lation is stopped.

April 2003 IEEE Control Systems Magazine 17

Authorized licensed use limited to: University of Michigan Library. Downloaded on April 09,2010 at 18:16:07 UTC from IEEE Xplore. Restrictions apply.

Page 5: A Web-Based, Collaborative, Computer-Aided Sequential Control

1) Read inputs: Read the status of input devices (push-button objects and limit-switch objects).

2) Scan codes: The interpreter runs the PLC codes once.3) Write outputs: Write the output results to change the

status of output devices (electrical valve objects andcontrolled component objects).

Under the control of a timer, animated motion can thenbe generated for a certain set of states on controlled systemcomponents.

PLC CodesWith this software, the designed electrical circuits can be

translated into PLC codes for all typesof PLCs. Since there are many types ofPLC models, each with its own hard-ware structure and software format, itis difficult to define a universal PLCclass. However, in this research, whenthe PLC codes are generated from theelectrical circuits, only basic instruc-tions (input/output instructions, logicinstructions, and timer/counter in-structions) are used. These instruc-tions are the basic commands for allPLCs, but the instruction format, andthus the memory addresses, may bedifferent. With this concept in mind, asimple PLC class is defined. By input-ting the proper information, users canadd PLC models into this software. Thetool will then be able to translate theelectrical circuits into the PLC codesassociated with that model.

ResultsFigure 2 shows the computer-aided se-quential control software applet in asingle-user mode, whereas Figure 3shows two applets of the software in acollaborative mode. In this mode, mul-tiple users can work collaboratively ona common system design. In Figure 3,two browsers are open to demonstratethe collaborative operation.

Figure 4 shows a page in thecourseware for sequential control sys-tem demonstration. Due to the dy-namic nature of a sequential controlsystem, animation of the controlledsystem helps users learn and performsequential control design. The sequen-tial control system design page in Fig-ure 5 allows users to design asequential control system online. TheWeb page was also used for online ex-amination. After the examination, usersleft their design data in a database. Theinstructor could then enter the systemto grade the students’ work. Instructors

18 IEEE Control Systems Magazine April 2003

Figure 5. A Web page in the courseware on pneumatics for sequential control systemdesign.

Figure 4. A Web page in the courseware on pneumatics for system demonstration.

Authorized licensed use limited to: University of Michigan Library. Downloaded on April 09,2010 at 18:16:07 UTC from IEEE Xplore. Restrictions apply.

Page 6: A Web-Based, Collaborative, Computer-Aided Sequential Control

can use the software in collaborative mode not only to teachsequential control system design but also to show studentshow to operate the software.

With the courseware on the server side, the educationalcost is reduced to a minimum, because a large amount of cli-ent-side CAD software is no longer needed. In addition, soft-ware update and deployment are much simpler.

Since the software can be used to simulate the controlledresults, it can also be used to control the actual system witha proper hardware interface. A complete Web-based sequen-tial controller with hardware connections will be the nextarea for research.

ConclusionsA Web-based, collaborative, computer-aided design andcomputer-automated sequential control design softwarehas been presented that allows users to set up a controlledsystem with selected electrical devices and electrical cir-cuits for sequential control. Users can take advantage of theautomatic circuit design function by providing the requiredmotion sequence inputs.

Users with Web access can save their designs into a data-base. The system also features a multiple-user mode that al-lows users to work on designs collaboratively. The softwareis designed in Java. Accordingly, all pneumatic, electric, andcontrolled devices are developed as software components.Electric circuits are composed of these software compo-nents to gain the benefits of object-oriented programming.With proper design of the software structure and interface,this system allows users to add customized devices in astraightforward manner.

AcknowledgmentThis article was funded by a grant from the Taiwan NationalScience Council (Grant 89-2212-E-150-036).

References[1] W. Li and S. Jen, Pneumatics and Hydraulics. Taipei, Taiwan: Gou-Li Publish-ing, 1998.

[2] W. Bolton, Programmable Logic Controllers: An Introduction. Oxford, U.K.:Butterworth-Heinemann, 1997.

[3] The JavaTM 2 Platform (Std. ed. v1.3.1), Apr. 2002 [Online]. Available:http://java.sun.com/j2se/1.3/

[4] B. Eckel, Thinking in Java, 2nd ed., June 2000 [Online]. Available:http://www.mindview.net/Books/TIJ/

[5] W. Li and C. Yen, “A Web-based computer-aided pneumatic circuit designsoftware,” Simulation Practice and Theory, submitted.

[6] W. Li, “Automatic design of electrical circuits for pneumatic sequentialcontrol,” Simulation Practice and Theory, submitted.

[7] J. Hunter and W. Crawford, Java Servlet Programming, 2nd ed. New York:O’Reilly, 2001.

[8] T. Neward, Server-Based Java Programming. New York: Manning, July 2000.

[9] JDBC Data Access API [Online]. Available: http://java.sun.com/prod-ucts/jdbc/

[10] JavaTM Shared Data Toolkit [Online]. Available: http://java.sun.com/prod-ucts/java-media/jsdt/

[11] W. Li, “Web-based collaborative computer-aided sequential control designsoftware,” Apr. 2002 [Online]. Available: http://nhit.twiic.org/user/li/pneu.htm

[12] W. Li, “Web-based collaborative computer-aided sequential control de-sign software,” Apr. 2002 [Online]. Available: http://nhit.twiic.org/user/li/lad-der.htm

[13] W. Li, “Courseware on pneumatics,” Apr. 2002 [Online]. Available:http://nhit.twiic.org/user/li/

Chiaming Yen is an associate professor with the Depart-ment of Mechanical Design Engineering at the NationalHu-Wei Institute of Technology, Taiwan. He served as thechair of the Mechanical Design Engineering Departmentfrom 1997 to 1999. He received his M.S. and Ph.D. degrees inmechanical engineering from the University of Texas at Aus-tin in 1988 and 1992. His current research interests includeWeb-based process modeling, simulation, and control. He isa member of the IEEE and ACM.

Wu-Jeng Li is a professor with the Department of Mechani-cal Design Engineering at the National Hu-Wei Institute ofTechnology, Taiwan. He has been chair of the MechanicalDesign Engineering Department since 2002. He received hisM.S. and Ph.D. degrees in mechanical engineering from theUniversity of California, Los Angeles, in 1989 and 1992. Hiscurrent research interests include applications of Web-based learning systems and control system design.

Jui-Cheng Lin is an associate professor with the Depart-ment of Mechanical Design Engineering at the NationalHu-Wei Institute of Technology, Taiwan. He received hisPh.D. degree in mechanical engineering from Taitung Uni-versity, Taiwan, in 1998. His current research interests in-clude system optimization, neural network and moldprocess modeling, simulation, and control.

April 2003 IEEE Control Systems Magazine 19

Authorized licensed use limited to: University of Michigan Library. Downloaded on April 09,2010 at 18:16:07 UTC from IEEE Xplore. Restrictions apply.