The Design of Remote Control System Based on the Embedded Web Server

Publications

Share / Export Citation / Email / Print / Text size:

International Journal of Advanced Network, Monitoring and Controls

Xi'an Technological University

Subject: Computer Science, Software Engineering

GET ALERTS

eISSN: 2470-8038

DESCRIPTION

12
Reader(s)
12
Visit(s)
0
Comment(s)
0
Share(s)

SEARCH WITHIN CONTENT

FIND ARTICLE

Volume / Issue / page

Related articles

VOLUME 6 , ISSUE 1 (Apr 2021) > List of articles

The Design of Remote Control System Based on the Embedded Web Server

Xu Shuping * / Yue Hongqing / Yang Fan / Wan Yajuan

Keywords : CGI, Remote Control, Web Serve, Embedded Systems

Citation Information : International Journal of Advanced Network, Monitoring and Controls. Volume 6, Issue 1, Pages 41-49, DOI: https://doi.org/10.21307/ijanmc-2021-007

License : (CC-BY-NC-ND 4.0)

Published Online: 19-April-2021

ARTICLE

ABSTRACT

In order to expedite the development of the control network, according to the newest fruition of the internet, the hardware and software of the system is designed. Since the resource of the sever in embedded remote control system is limited, an approach is presented which use CGI and XML technology to realize remote monitoring computer and embedded Web server for dynamic interaction. Combined with the basic requirements of embedded remote control system, the idea of component design is proposed, the major components of system functions are defined. According to the system functional requirement, the software is designed and realized. The practice prove, the scheme realize the remote control of the transmitter by the small cost. And the system is convenient and safe. The definite reference value is offered to the offspring complex remote control system.

Graphical ABSTRACT

I. INTRODUCTION

With the development of information network and innovation of technology, the remote control is no longer refers to the LAN remote control, but it is based on information network remote control [1-2]. Information network has more advantages than control network. Then the combination of the Information network and control network, using the advantage of the development of information network to develop the remote control system, which has already attracted widespread attention. The rapid development of network technology and embedded technology and their mutual integration has laid a good foundation of technology for On-site inspection and miniaturization and intelligence of control equipment, but also which directly promotes the development of embedded applications toward a deeper level [3-4]. The TCP/IP protocol is embedded in field equipment which makes it possess the embedded Web server functions, and with the help of CGI technology which can achieve real-time dynamic interaction between the field data and embedded Web server, eventually, embedded devices meet needs of networking with Internet directly, the real-time monitoring network has a good foundation to achieve [5].

Embedded WEB server has the advantage of small size, low price, and good platform migration and so on, which the WEB server does not have. In the system, in addition to considering its above advantages, the optional of embedded WEB server is more important to take into account the embedded WEB server which is more suitable for industrial control field [6-8]. The embedded WEB server which is used in control system not only makes the information collection and dissemination integration into embedded devices to simplify the structure of the control system, but also uses standard interfaces of embedded WEB server and the standard communication protocols, to provide operation and control interface which is unified and browser-based for users who any access to[9]. This way fundamentally changes the operation of equipment and management, reduces maintenance cost of control operation, and improves the efficiency of maintenance of control system. In this study, information network is introduced into the control network to achieve a real-time remote control which is based on information network, and provide a new reference method for the design and implementation of a remote control system [10-11].

II. SYSTEM SCHEME

As is shown in Figure 1, the system mainly consists of client modules, Internet module, embedded WEB server module, PLC programmable controller and the controlled object modules. Users who are in the client use the browser to access the embedded WEB server, the data is sent to embedded WEB server by the HTTP protocol and the WEB server embedded as a PC automatically encapsulate serial data which is transmitted from the programmable controller PLC as TCP or UDP, then which is transmitted in the network. Similarly network port receives the data which is automatically unwrapped from TCP or UDP packets and sends the it to the serial port, and then the conversion that is between serial and network signal can be completed, the host computer through the serial port transfers data to the lower machine by the communication protocol. According to communication protocol, lower machine receives data which was sent from the host computer, as a result, the communication between embedded WEB server and PLC completes. Embedded WEB server is the core of the whole control system, to archive the interactive information between the remote client and accused objects. The part of Lower machine mainly receives the remote client commands; complete the control of the controlled object, and returns running the information of the controlled object to the remote client.

Figure 1.

System’s overall structure

10.21307_ijanmc-2021-007-f001.jpg

A. Remote Client module

The main function of Remote Client is to complete the communication of embedded WEB server, so as to provide the user with a friendly and intuitive interactive interface; also, it receives the operating parameters from the PLC to control field devices; and, it displays dynamically the WEB page. Users login the embedded WEB server by a browser, and enter into the Control page, then go to the control operations in the corresponding form, next click on the submit button, the data is transferred to the embedded WEB server, and then the control command which were obtained by the serial handle of the embedded WEB server is sent to the lower machine, the browser is as a receiver to receive the feedback information from the lower machine. The remote client is to complete the remote client-server communication in main, after adding wireless routing module for multi-client mode, users can control and surveillance the second line device by the PC, mobile phone, PAD, etc. Monitoring which support the HTTP protocol terminals with a browser.

B. Network Module

The system is based on the Internet, and completes the remote control in the Internet. The network module is as a transmission channel of information, and corresponds to a range of LAN, cable and wireless router physical for connecting remote clients and embedded WEB server. The information is transferred from one place to another in internet; in this processing it does nothing, only connecting client and server, keeping the security and the smooth of path. While the network module makes the entire control system and information network combined. Also the remote control system is no longer confined to the local area network, and with the usage of the advantage of information network the remote control can be more convenient. In this module, wireless router uses the function of WIFI, which can make features that smart phones control second line of PLC comes true.

C. Embedded WEB server module

This part is the central part of the whole control system, and completes the function of transfer which happened in information exchange in the object of PLC control and remote users. On the one hand, Embedded WEB server establishes a connection with lower machine, and the serial port data which is transmitted from lower machine is encapsulated as the TCP / IP packets which are transmitted in the Internet, and the lower machine running parameters in real time sent to the remote client. On the other hand, the TCP / IP packets which are sent from the network unpack according to HOST LINK serial communication protocol, as a result, serial data which can be identify by programmable controllers twill be gotten, and the control commands which are from remote client are passed to the lower machine, so as to control lower machine by the programmable controller. Meanwhile it implements the HTTP protocol conversion and encapsulation, when users access the web through a browser, just enters the IP address of embedded WEB server, it can be accessed.

D. Programmable controllers and the controlled object module

The module is charged with the ultimate object of the whole system, controls the controlled object by programmable controller, which is choose, exchanges the data information which is in the upper server host computer by RS232 serial, and implements the control which PC controls the lower machine. Programmable controller works in accordance with the instructions, and the implementation of the current device is sent to the embedded WEB server by the corresponding serial communication protocol, and finally the user’s browser obtains them by the Internet. So, even users are away from the industrial site, can also control the controlled object and get the implementation of the object.

III. THE DESIGN OF HARDWARE SYSTEM

Brushless DC motor controller to control the DSP core. Six Road, pulse-width modulation channels for PWM wave output, driving the main power circuit, three-way capture the channel, on the one hand is used to capture the location of the state brushless DC motor, control motor operation, the other for the speed of calculation, speed the completion of the closed-loop operation. Serial communication port to complete the upper and lower-bit machine information exchange, remote client through the Internet to control information sent to the embedded web server, and then down through the serial-bit machine to send commands to achieve the control of the motor, while the next crew to motor Real-time operational status through the serial port back to the remote client in order to monitor the motor running. In addition, the control system is also designed to power-surge protection, overvoltage, undervoltage and some basic over-current protection circuit.

A. Drive Circuit Design

After separation from the DSP came out 6-channel PWM wave signal and cannot be directly sent to the main power circuit drive motor, it must be larger. The role of the driver circuit is to output pulse amplification to power a power transistor, or MOSFET. IR2136 is a voltage applied to the mother is not higher than 600V circuit in the power MOS gate devices, which may be the largest positive peak output drive current of 250mA, while the reverse peak drive current of 500mA. IR2136 has the over-current, over voltage, under voltage, logic identification protection, as well as the blockade and instructions such as protection areas, the internal bootstrap technique to make it available for high-pressure system, and the input signal and is compatible with TTL and COMS level. Drive circuit inductance, the general location of the capacitor as close to the IR2136, the size of bootstrap capacitor 10 times. R20, R25, R28, R19, R24, R29 in order to avoid being driven by the power MOSFET drain-source voltage between electrodes of the oscillation, thus avoiding therefore caused by RF interference and MOSFET subjected to high du / dt caused by the breakdown damage. R21, R26, R30, R22, R27, R31 is the same bridge arm in order to avoid rotation of the two MOSFET turn-on; the instantaneous short-circuit current caused by two MOSFET sets the voltage between the emitter oscillation. EN termination PC817 isolation, when the DSP to a low when, EN-side enable, IRZ136 then be able to work properly. DSP issued by the 6-channel PWM wave through the internal circuitry IR2136 RP, amplified output, driving the main power circuit.

B. Main Power Circuit Design

The system’s main power circuit using three-phase full-controlled circuit. In this circuit, the motor for the Y-connected three-phase windings. V1 ~ V6 6 MOSFET, the switch from the role of windings, which are N-channel MOSFET, high conduction time, their methods can be divided into 22 power conduction mode and 33 two kinds of conduction mode, the system conduction mode using 22 intervals of 1 / 6 cycle for phase one, each time a commutation power tube, each power transistor conduction angle of 120 ° electrical. In this way, whenever the motor is running 360 ° electrical angle, the stator there are six kinds of magnetic potential state, each difference 60 ° electrical angle, was leaps and bounds, non-continuous state.

IV. THE DESIGN IDEA OF THE SOFTWARE

The design of system software is based on the idea of component, including Web Server component, CGI component, serial communication component, data storage components and so on. The logical relationship is between these components as is shown in Figure 2. Web Server component is the realization of the basic content of TCP / IP protocol, able to response and handle user requests, and achieve independent communication, also is known as a Web server. Because the TCP / IP -related protocols are achieved, so Web server has the ability to interact with the browser, can handle user requests of client, transmits the network message and returns the result to the browser, in addition, it can work with other applications. CGI component is designed in accordance with the standard of CGI, and is program modules of possessing individual functions, also is a standard interface which implement interaction between the embedded Web server and external expansion application. The data of field devices is transmitted to the embedded Web server by CGI component, which is real time. So, the interaction of dynamic data can be completed between the remote client and the field devices. Serial communication component is independent program modules which can complete the function of serial communication. It realizes that the data is transferred from field devices to CGI components. And it cooperates with the CGI program components, so to make data of the embedded Web server update. Data storage component is a functional module which has the ability to save the data that is collected in the field, and provides methods of reading and writing for the other functional components. The realization of data storage components has two modes. One is file, another is embedded databases.

Figure 2.

Driven circuit

10.21307_ijanmc-2021-007-f002.jpg
Figure 3.

Structure diagram of software system

10.21307_ijanmc-2021-007-f003.jpg

In system, users which are located in the remote control terminal enter the IP address of embedded WEB server into the Internet browser, and log in to the appropriate page, then send control commands. The embedded WEB server receives control commands and handles them, next responses to connection requester from the client browser, obtains the control information, and which is sent to the controlled object. After a series of internal operations in the embedded WEB server, the message is converted to the message which the PLC can be identified, so as to complete the processing of communication. Embedded WEB server can also obtain real-time information from the controlled object, by handling, the message is sent to remote clients, while it responds to the connection request from the client browser, the results are in the form of dynamic page and are returned to the client. The embedded WEB server is working on “Serial channel mode”, it means that all serial data are automatically encapsulated as TCP or UDP packets, and which are transmitted in IP network. Similarly, received from the network port to TCP or UDP packets will be automatically unpacking the data, and which is sent to the serial port one by one byte. Embedded server automatically load embedded multi-tasking operating systems and a streamlined WEB server when the system starts up. The web Server listens to the HTTP requests which is sent from client, and delegates HTTP requests to the server process which is CGI program, and which is responsible for receiving data which WEB requests. And serial port communication implements the handling of data, and the results are in the form of dynamic pages and are returned to the client.

V. REALIZATION OF SOFTWARE SYSTEM

A. Building of Boa server

The WEB server of Boa is a very compact Web server, its executable code is about 60KB around. Boa is a Web server of single task, so it only can complete the user’s request in turn, and will not fork a new process to handle the concurrent connection requests. But Boa supports CGI, CGI programs can be able to fork out a process to execute.

Download a Boa server under the operating system of Linux from the Internet, and configure the corresponding compiler environment of development board in the development environment of ARM. In this design, the system which the ARM uses is linux-2.6.32.2-1208-nfsandjffs2-w35-ok, the environment of cross compiler is arm-linux-gcc-3.4.1, the Boa server is unzipped through the command of tar, the MAKEFILE which includes in the cabinet needs to be complied crossing, and require a executable Boa file which can run in the ARM environment, then according to the ARM file of boa. conf configure the ARM system.

According to the Boa. conf, configure the environment of ARM and put the error logs, access logs, executable files of Boa, Webpage of the Web site, and CGI procedures in the corresponding directory. Then, the /etc/init.d/Rcs file is changed, we compile and Boa boot from self-start, eventually Boa server is set up completely.

B. Writing of CGI Programs

The embedded WEB server uses the Linux operating system, CGI program uses function of the language of C to realize, source program of CGI provides assembly format: int NAME(WCT*w, char *file, char*; head) ;NAME is the name of function of corresponding components of CGI, w is the communication structure, the request and response of receiving data are manipulated by w; file is the name of request of the common gateway interface; head is the header message of request, the length of request packet and Cookie information is obtained by it.

After the CGI is developed, also must be registered with the WEB server, so that when it is invoked, the CGI can connect to the function corresponding, and enable the CGI process to handle.

Registration form which the development of CGI accords to as follows.

Register(“POST/GET”, NAME, “NAME.cgi”);

In the development of CGI, user request have two ways of GET and POST, the way of GET is through submitting the parameter data in the table to the URL which the action attribute refers to, the submitted value is corresponding to the field which is in the form. In GET request mode, data is presented on protocol head of request in HTTP. The way of POST puts every fields and content in the HTML HEADER by HTTP POST mechanism, and then sent to URL which the action attribute points to, the user is not to see the whole process, in POST the submitted data is put in real data. GET is transmitted through the parameter in URL to convey some non-confidential data, so the security of POST is higher than GET. Data that is transmitted in GET is smaller and is not larger than 2KB. But the data that is transmitted in POST is generally larger and is not limit in default. The WEB server which the CGI components register in can work.

C. Design of serial component

In system, the serial communication interface is the bridge that connects the embedded WEB server and the programmable controller. When the data is transmitted from serial port of the embedded WEB server, the number of bytes of data is converted to a serial bit, when the data of lower machine is through the serial port to the host computer, the data by the serial bit transmission is changed as a number of bytes. in the use of serial communication, serial port must be open, when the communication is over, it is closure.

CGI process complete interaction of user’s dynamic web. The information of interaction is from the lower machine through the serial port, in this progress, the appropriate serial communication components need to be designed, so the status of controlled object is extracted and the action of object is controlled. In this system, the serial communication component is a series of functions that are developed for the serial data of lower machine, and gets the serial message to the CGI procedures, and gives CGI program to handle. In the serial port message, according to each of the control commands, the corresponding functions are designed, so commands are sent and data that is returned is received, and the corresponding structure is defined to store the received data. Command to check the state of the object is as an example, its design function follows.

Int set_opt(int fd,int nSpeed, int nBits, char nEvent, int nStop)

//set serial port attribute: fd:file descriptor nSpeed: Baud Rate nBits: Data bits nEvent: Parity nStop: Stop bits

Int open_port(int fd,int comport)

// open S3C2440 Serial device node

int dakai()

//send the command to PLC.

Int jianshi()

//read PLC’s the value of the corresponding channel, so to monitor the status of the second line of PLC devices.

In the system, submitting the command data or write data need to obtain information from the form or the buffer. So relevant functions that can extract data and obtain data requires redesign. These are very convenient to work with CGI serial function which are designed, also package the realization of the complex, so as to improve the efficiency.

Based on the design of the prototype:

cgiFormResultType cgiFormSelectSingle(char *name, char **choicesText, int choicesTotal, int *result, int defaultV)

// extract the data which was submitted in the form, and save the data to the buffer

cgiFormResultType

cgiFormSelectMultiple(char *name, char **choicesText, int choicesTotal, int *result, int *invalid)

//Get variable value from the buffer according to the variable name

cgiFormResultType

cgiFormCheckboxSingle(char *name)

// Get control commands which user input from the buffer according to the button name

D. Several Key Issues in System Design

In embedded remote monitoring system, when it is designed, the minimal overhead must be considered, so as to ensure the system’s real-time, safety, practicality and manageability. The methodology of component-based design provides an effective way to solve these problems, but several key issues as follow need to handle.

At any time, the security of system is a very important aspect. For embedded Web -based remote monitoring system that requires the system to be able to protect information security and to prevent vandalism; the users which have no permission cannot allow to observe the important information and carry out the operation. For the above requirements, you can use the following method: adding firewall between the creation of the internal network and external network to protect the internal LAN from security attacks. Embedded Web server as a node on an internal LAN is also protected by the firewall. In order to prevent unauthorized users to access, when using the Web browser to access the embedded Web server, remote monitoring computer need to authenticate. Username and login password are stored in external memory. When the embedded Web server is powered up or reset, the microprocessor put the username and login password which are read from the external memory to the RAM. After receiving the login connection of RMON host, the login information is validated by byte-by-byte, if the verification is correct, and successful login flag will be set, otherwise the remote monitoring host Web browser sends the Web page which is login fails.

In addition, establishing a reasonable system model and component model is the basis for component design. The function model of the system needs to break down reasonably, and each component which is based on the independent functional modules must have clear boundaries. And, the embedded control systems design and implementation must pay attention to the real-time. So, the redundant TCP/IP protocol implementation should be avoided for keeping the real-time, and the lean Web server is constructed, so as to reduce the occupancy of embedded system resources. Otherwise, if the real-time cannot be guaranteed, the remote monitoring will lose its significance. Standardization is a prerequisite to ensure component compatibility. The interfaces and operations of each component should be defined standardly and possibly. Also the operations and the access of component attributes are required to be standard.

VI. CONCLUSION

Remote control system which is based on Embedded WEB server controls the device of lower machine, and combines the data acquisition with network information technology. It also uses the embedded devices and combines with the WEB technology. In addition, it completes the real-time remote control by the Internet. Lastly, it implements that client browser directly accesses and controls equipment information of the lower machine. In system, the WEB Services is as an intermediate hub. It completes that the message is send to the client PC from the lower machine via Internet. Also, it implements that the control commands of PC are transferred to. The process which the controlled object of lower machine executes commands implements dynamic interaction between the controlled object and browser, so as to achieve remote control functions. Embedded monitoring system becomes the mainstream of development of remote monitoring technology in the future, because of its small size, long continuous working time, stable and reliable of performance and so on.

ACKNOWLEDGMENT

The authors wish to thank the cooperators. This research is partially funded by the Project funds in Shaanxi province Innovation and Entrepreneurship Training Programmer for university students (S202010702115X).

ABOUT THE AUTHOR

Biography: Xu shuping, (1974-05-07), female (the Han nationality), Shaanxi Province, Working in Xi’an technological university, professor, the research area is computer control.

References


  1. Wu Ying-nian, Zhang Jian-hua, Hou Guo-lian. Network Control System Research (I,II), Modern Power. Volume 5, Oct. 2018 Page(s):41 – 44
  2. Yueru Cai, Xiling LIU. Web Service Tutorial. Tsinghua University Press. 2015. In Chinese
  3. Zhuang Yan. Research and Development Based on the Network-based Robot Control Technology [J]. Robot. 2016(3):276-282.
  4. Kunlun Lu, Xudong Li, Huanjing Wu. Web Service programming - using C #. NET Developer Network Services. 2018 In Chinese
  5. ZHuang Yah, Wang Wei, Yun Wei-ming, The research and development of network based robot control technology[J], Robot, 2017, 24(3):276-282.
  6. Aoyama M, Weerawarana S, Maruyama H, Web Services Engineering: Promises and Challenges[C], International Conference on Software Engineering, Orlando, Florida, USA, 2017.
  7. Wang S W, Xie J L. Integrating building management system and facilities management on the Internet[J]. Automation in Construction, 2019, 11(6):707-715.
    [CROSSREF]
  8. Rajesh K, Sridharan K, Srinivasan K. The design and development of aweb-based data acquisition system[J]. IEEE Instruction and Measurement, 2017, 51(3):427-432.
    [CROSSREF]
  9. Auer C, Klimbacher A P. Embedded Web server technology for remoteon line labs[C]. Dubrovnik: ISIE, 2019.
  10. Ma Ya-na, Qian Huan-yan. The application of Cookie in web authentication[J]. Computer System, 2014, 25(2): 207-210.
  11. Shixu Xu, Shuzhen Gong, Tao Peng. Programmable Controller Application Guide: programming, communications, networking. 2017. In Chinese.
XML PDF Share

FIGURES & TABLES

Figure 1.

System’s overall structure

Full Size   |   Slide (.pptx)

Figure 2.

Driven circuit

Full Size   |   Slide (.pptx)

Figure 3.

Structure diagram of software system

Full Size   |   Slide (.pptx)

REFERENCES

  1. Wu Ying-nian, Zhang Jian-hua, Hou Guo-lian. Network Control System Research (I,II), Modern Power. Volume 5, Oct. 2018 Page(s):41 – 44
  2. Yueru Cai, Xiling LIU. Web Service Tutorial. Tsinghua University Press. 2015. In Chinese
  3. Zhuang Yan. Research and Development Based on the Network-based Robot Control Technology [J]. Robot. 2016(3):276-282.
  4. Kunlun Lu, Xudong Li, Huanjing Wu. Web Service programming - using C #. NET Developer Network Services. 2018 In Chinese
  5. ZHuang Yah, Wang Wei, Yun Wei-ming, The research and development of network based robot control technology[J], Robot, 2017, 24(3):276-282.
  6. Aoyama M, Weerawarana S, Maruyama H, Web Services Engineering: Promises and Challenges[C], International Conference on Software Engineering, Orlando, Florida, USA, 2017.
  7. Wang S W, Xie J L. Integrating building management system and facilities management on the Internet[J]. Automation in Construction, 2019, 11(6):707-715.
    [CROSSREF]
  8. Rajesh K, Sridharan K, Srinivasan K. The design and development of aweb-based data acquisition system[J]. IEEE Instruction and Measurement, 2017, 51(3):427-432.
    [CROSSREF]
  9. Auer C, Klimbacher A P. Embedded Web server technology for remoteon line labs[C]. Dubrovnik: ISIE, 2019.
  10. Ma Ya-na, Qian Huan-yan. The application of Cookie in web authentication[J]. Computer System, 2014, 25(2): 207-210.
  11. Shixu Xu, Shuzhen Gong, Tao Peng. Programmable Controller Application Guide: programming, communications, networking. 2017. In Chinese.

EXTRA FILES

COMMENTS