Server-side Ladder Logic of a Web-based ...

3 downloads 18317 Views 495KB Size Report
In this central control system, cheap and simple embedded controllers ... The server provides a web page which contains a ladder diagram computer-aided.
Applied Mathematics & Information Sciences – An International Journal © 2012 NSP

6 (1) (2012), 53S-59S

Server-side Ladder Logic of a Web-based Supervisory Control System Wu-Jeng Li1 , Shu-Chu Tung 2 , and Shih-Miao Huang 1 1

Department of Mechanical Design Engineering, National Formosa University, Yunlin County , 632, Taiwan, Email Address: [email protected] Email Address: [email protected]

2

Department of Environmental Engineering, Kun Shan University, Yongkang Dist., Tainan City , 710, Taiwan Received June 1, 2011; Revised August 1, 2011; Accepted August 31, 2011

Cloud computing technology is changing the way we work. Thin-client is now a new trend. This research develops a thin-controller web-based supervisory control system. The supervisory control system contains a central supervisory server and multiple local controllers. Each local controller controls a system. It merely reads the system input data, sends them to the control server, and executes the driving commands from the server. All the control algorisms for all controlled systems are performed in the control server. In this central control system, cheap and simple embedded controllers can be used as local controllers. The control programs can be designed with ladder diagrams. The control server is also a web server. An information system inside the server is used as human interface to manage users, controlled systems, and local controllers. The server provides a web page which contains a ladder diagram computer-aided design applet to help user design PLC programs. Once the design is done, the program can be sent to server for execution. There is also a supervisory control applet program to help user monitor controlled systems. The feasibility of central control depends on server performance, reliability of internet, and bandwidth of network. The rapid development of information technology has made central control possible. It might not be appropriate for industrial usage, but it can be used in domestic application to form cloud control system. Keywords: Cloud Computing, Ladder Logic, PLC, Supervisory Control.

1 Introduction Controllers evolves with the development of technology. In electrical age, electrical devices, such as buttons, relays, timers, and counters, are used to construct electrical circuits for sequential control. While in electronic age, special-purpose computers are used for control. Following the design logic of electric circuit, the control circuits are transformed into computer programs, so called software circuits. That is the ladder logic [1] for programmable logic controller (PLC) [2]. In the age of post-PC, computer became more powerful and cheaper. Controller, like distributed control system, PC-based controller, and digital signal processing controller, emerged. In Internet era Internet ready is a basic requirement for a controller. PLC based on embedded PC became PAC controller. When web 2.0 was popular, browsers were used as user interface of

54 Wu-Jeng Li et al

controllers. When the phrase “the network is the computer” was created, people knew that Internet would largely change the structure of computer. With many years of development, Cloud computing now becomes a popular technology. Cloud computing provides computation, software, data access, and storage services that do not require end-user knowledge of the physical location and configuration of the system that delivers the services. A big heavy server-side Cloud can serves huge number of thin client-side devices. This research applies the spirit of Cloud computing into sequential control. Serverside ladder logic is developed to serve multiple thin-controllers and turn those controllers into PLCs. Because that this research is experimental, the server-side ladder logic is constructed on a web server. When the technology of Cloud computing is mature, it is easy to be moved to Cloud environment.

2 System And Methods Traditionally, supervisory control in a factory is a distributed control system [3]. Various types of local controllers are executing their local control jobs. The statuses of these controllers are collected into a supervisory station with communication methods. A HMI (Human-Machine Interface) presents process data to a human operator, and through which the human operator controls the process. It is the local controller which really executes control law. The supervisory station merely collects, stores, and provides data. In this research, the computation loads of control laws were shifted from local controllers to central server to form a central control system. The whole supervisory control system is shown in Fig. 1. Every monitored station may have more than one controller. This supervisory control system can have all kinds of application, like home security, factory automation, depending on the design of sensors, actuators, and control laws. Despite of different applications, all controllers just sense sensor signal, upload their input/output data to the server, and then bring back driving commands for execution. All control laws are executed in the server. Because that all control law computations are fulfilled in the server-side, a cheap and simple 8 bit microcontroller can be used as local controller. In this research, Arduino controllers are used. Although cheap local controllers are used, complex control laws can be applied for different applications.

2.1. Central control server The central control server, shown as Fig. 2, contains a web server (tomcat 6) which is a Servlet/JSP container, a data transmission service program, and a database server (MySQL). Web server together with database server provides information management system and is used as user interface for the supervisory control system.

55 Automatic and Precise Image Registration Based ....

Fig. 1. The web-based central control system

The information management system helps users register their Arduino controllers and specify their input/output configurations. Only after a controller is registered, then it can be connected to the control server. Otherwise, its connection request will be rejected. When a user registers a controller, an identification code is created for the controller. A controller must carry his identification code to connect to the control server. The data transmission service program, resident in the computer, receives data from local controllers, executes ladder logic, and return driving commands for respective controllers. There is a remote control Java applet program embedded in a webpage under the web server. Users can load the webpage to remotely monitor and control their controlled systems with any Java-enabled browser. There is also a ladder logic computer-aided design Java applet program [4] embedded in a webpage under the web server. Users can load the webpage to remotely design control laws for their controllers.

2.2. Arduino local controller Arduino controller used in this research contains an Arduino controller board and an Ethernet shield. Arduino [5] is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. The Arduino Uno used in the research is a microcontroller board based on the ATmega328. It has 14 digital input/output pins, 6 analog inputs, a USB connection. The Arduino Uno can be programmed with the Arduino software through USB connection. To use Arduino Uno as a local controller in our supervisory controller system, an Ethernet shield [6] is attached to the Uno board. The Ethernet Shield allows an Arduino board to connect to the internet. Fig. 3 shows flowchart of the Arduino controller. Once the controller is started, it setups up its input/output configuration, initializes network chip, logins to the server as a

56 Wu-Jeng Li et al

user for security reason. And then it starts control loop. In the control loop, it reads input data from different sensors, uploads input/output values to the server, and waits for the driving commands to drive different actuators. In central control the sampling rate of controllers are limited by their computation power and network bandwidth and that limits their application. They might not suitable for servo control which needs high sampling rate but should feasible for sequential control.

Fig. 2. The structure of the central control server.

Fig. 3. Flowchart of the Arduino controller.

2.3. Ladder logic computer-aided design Java applet In this central control system, to help local controllers with control laws design, a ladder logic computer-aided design program is provided. In order to let users design their control laws remotely, the computer-aided design program is developed as Java applet program which can be embedded in a webpage under the control server. Fig. 4 shows the interface of the ladder logic design program. Once the webpage with the applet program is loaded into user’s browser and started, the program asks the user to login. After the user logins, his controller related data, like controller id, input/output

57 Automatic and Precise Image Registration Based ....

configuration, are downloaded. The user can switch to different controller for ladder logic design. When a controller is chosen, the relevant input/output points are shown as visual components in the program to provide interactive design visually. The user can pick the input/output switches (NO or NC point) and system provided electric devices (relays, timers, counters) to construct his control ladder. The program then can convert the ladder into PLC codes and simulate the control results according to his design. During simulation, the PLC codes are executed and statuses of input/output switches and electric devices are changed accordingly. The changes are shown visually in the visual components which forms an animation effect to help design debugging. When the design is done, the user can upload his design to the control server and save it to the database. When the control server is put on and web server (tomcat 6) is up, PLC software objects are constructed for all controllers. These software objects are resident in the RAM of the server and kept alive all the time. Ladder logics are loaded to respective PLC objects. At the time the data transmission service program receives input/output data from certain controller (see Fig. 2. And Fig. 3.), the ladder logic in the PLC object of the controller is executed. The calculation results of the ladder logic are sent back to the controller for driving output. When a user modifies the ladder logic design for his controller remotely and uploads the new design to the server, the new design will be effective immediately. Because when the control server saves the new ladder design into database, it will update the ladder logic in the PLC object accordingly.

Fig. 4. Ladder logic computer-aided design Java applet.

2.4. Supervisory control Java applet

58 Wu-Jeng Li et al

All operation data of the central control system are kept in the database in the control server. It is easy to provide an interface for live data viewing. Therefore, a supervisory control Java applet embedded in a webpage under the server is used to provide remote monitoring and control. A controlled system may have many monitor pages in its supervisory control. Before a user can remotely monitor and control his systems, he must login to the control server information management system to setup monitor layouts for his systems. A monitor layout has a layout map and multiple layout points. Layout points are selected from system input/output points. Each layout point may have a mask map. If a layout point has a mask map, when the layout point is ON, its mask map will be overlaid on the layout map at position specified by the user. Users can use any Java-enabled browser to perform supervisory control for his systems. Once the supervisory control applet program is loaded into user’s browser and started, the program asks the user to login. After the user logins, his layout related data and controller related data, such layout id, layout points, controller id, input/output configuration, are downloaded. Then, the program starts a data update thread to keep updating input/output data. The user can switch to different layout for live data viewing. If necessary, the user can click on the visual component of a layout point (corresponding to an output point) to set value for output. The setting will be sent to the server for executing. Note that the setting cannot conflict with the control laws of ladder logic.

3 Results And Discussion In order to demonstrate the application of the server-side ladder logic of the webbased supervisory control system in this research, a simple company security system controlled by the Arduino controller is designed as shown in Fig. 5. Motion detection sensors located around front door, office, and back door are connected to digital input pin 0, 1, and 2 of the Arduino controller respectively. And the digital output pin 0 and 1 of the Arduino controller are used to drive front door lamp and office lamp. A desktop personal computer is used as central control server. The operation system for the computer is Fedora Linux. MySQL database server is running as a service in the computer. Tomcat 6 is also running as a web server service in the computer. Data transmission service program and information management system formed by servlet programs are created for the control server as shown in Fig. 2. Firstly, the Arduino controller for the company security system is registered in the control server information management system. And then, when the input sensors and output relays are set, the controller is connected to the control server through Internet. For supervisory control, a layout and its layout points from all input/output points are set. In the beginning there are no control laws for the Arduino controller, the controller just read sensor inputs and upload his input/output data to the server. Even so, the supervisory control Java applet program can be used to monitor the company. When the company is invaded in the front door and the motion detector picks up a signal. Statuses of the input are transferred to the server and then transferred to the applet program. The status of digital input 0 (front door) is shown, invasion region is marked, and alarm is on

59 Automatic and Precise Image Registration Based ....

as shown in Fig. 5. At that moment, the user can remotely put on front door lamp by clicking on button of front door lamp in the applet program. Intelligence can be added to the company security system by server-side ladder logic. Fig. 6. Shows a simple ladder logic added to the company security system to add interaction between motion detection and front door lamp. When the front door motion detector is on, it will put front door lamp on for 3 seconds. It could be used to scare outsider or provide illumination for company employee during the night. Fig. 6 is a snapshot of simulation of the ladder logic execution. Once the ladder design is finished, it can be uploaded to the server and makes the control laws effective immediately.

Fig. 5. A simple company security system without control laws.

60 Wu-Jeng Li et al

Fig. 6. A simple ladder logic for company security

Fig. 7. Company security system with server-side ladder logic.

Fig. 7 shows supervisory control of company security system with server-side ladder logic from Fig. 6. When the front door invasion is detected, the front door lamp is put on

61 Automatic and Precise Image Registration Based ....

automatically. This simple example is just to demonstrate the feasibility of server-side ladder logic. Much more complex control laws can be applied for different applications. Despite of the complexity of control laws for a controlled system, the controller for the system can be simple and cheap. There are lots of advantages for a central control system, such as cheaper controllers, easy to deploy programs, easy to update control laws, and easy to service for multiple controllers. But, central control system has also its weak points. If the network transmission is broken, all controls will fail. Even if the network transmission is secured, there is a transmission delay and the delay time might be different in different situations. Therefore, the sampling rates of the controlled systems are limited. Also, a central control system demands higher computer performance for the server and the server security might be an issue. The disadvantages of a central control system are also the disadvantages of Cloud computing system [7]. The recent population of Cloud system means that the problems of a central control system are gradually solved.

4 Conclusion This research proposed server-side ladder logic of a web-based supervisory control system. In this supervisory control system one control server serves multiple Arduino controllers. A ladder logic computer-aided design Java applet program is used to help users with ladder logic design for their controlled systems. The ladder logic could be designed remotely with any Java-enabled browser and be executed in the control server to enhance control intelligence without complex local controller.

Acknowledgements This work was supported by the Taiwan National Science Council under grant NSC 99-2221-E150 -033.

References [1] [2] [3] [4]

Ladder logic, http://en.wikipedia.org/wiki/Ladder_logic. Programmable logic controller, http://en.wikipedia.org/wiki/Programmable_logic_controller. Distributed control, system http://en.wikipedia.org/wiki/Distributed_control_system. Chiaming Yen, Wu-Jeng Li, and Jui-Cheng Lin , A Web-based Collaborative Computer-aided Sequential Control Design Tool, IEEE Control Systems Magazine, Vol. 23, No. 2, (2003), 14-19. [5] Arduino, http://www.arduino.cc/. [6] Arduino Ethernet Shield, http://arduino.cc/en/Main/ArduinoEthernetShield. [7] Cloud computing, http://en.wikipedia.org/wiki/Cloud_computing.

Wu-Jeng Li received the PhD degree in the Department of Mechanical Engineering from University of California, Los Angeles, USA. He is currently a Professor in the Department of Mechanical Design

62 Wu-Jeng Li et al

Engineering at National Formosa University, Taiwan. His research interests are in the areas of supervisory control, mechatronics and embedded system. Shu-Chu Tung received the PhD degree in Department of Environmental Engineering from National Cheng Kung University in Taiwan. She is currently a Associate Professor in the Department of Environmental Engineering at Kun Shan University, Taiwan.. Her research interests are in the areas of wastewater treatment, ecology monitor and ecology investigation. Shih-Miao Huang received the MSD degree at School of Design from Arizona State University in USA and PhD degree in Department of Industrial Management from National Taiwan University of Science and Technology in Taiwan. He is currently an Associate Professor in the Department of Mechanical Design Engineering at National Formosa University, Taiwan. His research interests are in the areas of human – computer Interfaces and emotional design.