Design of Ethernet Control System for Actuators Based on VC

Publisher:bln898Latest update time:2011-05-10 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: This paper introduces the architecture of an industrial Ethernet monitoring system suitable for the field of process control. Through the main control computer and industrial Ethernet, various networked electric actuators designed can be easily connected to form a network according to our control needs to form a system. Through the customized communication protocol, the real-time and reliability of the system are guaranteed. Through the communication test, it is proved that the control system is feasible.
Keywords: Industrial Ethernet; Actuator; Communication protocol


1 Introduction

In the field of industrial control, with the continuous increase in the scale of control systems, centralized control systems can no longer meet the requirements, and control networks have been widely used in industrial control. Fieldbus is a technology that has developed in accordance with this form and has solved this problem to a certain extent. However, the openness of fieldbus is conditional and incomplete. When the development of fieldbus encountered obstacles, Ethernet technology has developed rapidly. If Ethernet technology can be successfully used in the underlying network of industrial control, it can break the traditional industrial control network system and realize the seamless combination of office automation and industrial automation.

This topic is proposed in this environment. In the design, we chose the industrial Ethernet with high transmission rate, good real-time performance and low cost. On the basis of inheriting the mature technology of the previous generation of products, we integrated the industrial Ethernet technology into the design of electric actuators, making them a new generation of digital products. In order to cooperate with the use of these networked electric actuators, we need to build an Ethernet monitoring system suitable for the field of process control. It connects the main control computer and multiple electric actuators through the industrial Ethernet, and performs various different controls on the bottom layer through the computer according to our needs, forming a complete control network.

2 Control System Architecture

2.1 Control System Ethernet Architecture

The structure of the entire control system is shown in Figure 1. Here, the Ethernet to serial port module is equivalent to completing the role of an actuator network card, which is used to complete the protocol conversion and communication between the actuator and Ethernet. The electric actuator communicates with the Ethernet to serial port module through serial TTL level, and then the level signal is transmitted to the Ethernet in the form of a network data frame through the module (here Ethernet can be replaced by HUB), and then further transmitted to the host computer, thus forming a reliable channel from the host computer to the actuator.

The Ethernet to serial port module used in this system is an embedded network module developed by a domestic company. It integrates the TCP/IP protocol stack, and users can use it to realize the network function of embedded devices. This product is used for data transmission between serial ports and Ethernet, and adds an Ethernet interface to serial devices. It can be used for remote communication between serial devices and the main control computer, or between multiple serial devices.


Figure 1 Overall structure of the control system

2.2 Implementation of communication between electric actuator and Ethernet to serial port module

Serial communication uses TTL level and occupies two I/O ports, namely the input port (RxD) and the output port (TxD). The actuator main control board needs to provide +5V power to the Ethernet to serial port module. The hardware connection is shown in Figure 2.


Figure 2 Schematic diagram of the underlying communication implementation

The main control chip used by the actuator in this system is Intel 80C196MC. In the figure, P2.0 is the serial output of 80C196MC, and P2.1 is the serial input of 80C196MC. The ground wire of the network card should be connected to the digital ground of the main control board, that is, the ground of the microcontroller. Asynchronous communication is used between 80C196MC and the Ethernet to serial port module. The length of a frame is 10 bits, including 8 bits of data, 1 parity bit and 1 end bit.

3. Software Implementation

This system uses WinSock programming based on VC++6.0. Socket has become the most popular network communication application program interface today. Socket was originally developed by the University of California, Berkeley for the Unix operating system. Later, it was ported to DOS and Windows systems. In particular, the widespread popularity of the Internet in recent years has further established its dominant position in the field of network communication program development.

The system adopts Client/Server mode. Through the configuration software of the Ethernet to serial port module, the module is set to server mode, and the control software part on the main control computer is the client. Each time it is started, the main control computer actively connects to the actuator. The client and server use a connection-oriented communication protocol: a virtual connection will be established between the control computer and the module. Once this connection is established, the client and server can exchange data as a bidirectional byte stream; if the connection is not established successfully, no data will be sent. In addition, each message transmitted in a connection-oriented manner needs to be confirmed by the receiving end, and unconfirmed messages are considered to be erroneous messages.

3.1 Communication Process

Socket can be used in two ways: synchronous blocking mode and asynchronous non-blocking mode. In this system application, a TestSocket class inherited from the CAsyncSocket class is created, which is an asynchronous non-blocking Socket encapsulation class.

Since the Ethernet to serial port module has been set to server mode, the program of the main control computer segment appears as a client. The writing of the program is roughly carried out according to the following steps:

1) First call the WSAStartup function to initialize the socket library.

2) Call the socket function to create a socket.

3) Call the connect function to connect to the server and send a connection request

4) After the server responds to the connection request, the client starts to interact with the server (receiving and sending data, etc.) until the request ends.

5) Call closesocket to close the socket and release the socket resources.

6) Call the WSACleanup function to release the corresponding resources.

The communication process between the client program and the server is shown in Figure 3:


Figure 3: Socket call model for connection-oriented services

In the Ethernet to Serial Port module, the server program calls the listen function to put the socket in the listening state, so that the socket can listen to the incoming connection and confirm the connection request. When the server listens to the connection request from the client, a listening socket will send a confirmation message to each request, and then call the accept function. Then, the connection-oriented client starts the network conversation by calling the connect function. After the client and server establish a connection, both parties can communicate on the network through send and recv or other connection-oriented Socket API functions.

3.2 Communication Protocol

The computer and the Ethernet to Serial Port Module communicate with each other using SOCKET, and the module and the actuator use TTL level communication, using a unified communication protocol. The computer is an active communication device, that is, all conversations are initiated by the control computer, and the actuator is just a passive response command.

There are two main types of information frames in the protocol: data frames and command frames. It implements general information communication functions. Data frames contain general I/O information, while command frames contain commands such as control, query, and setting. To ensure the accuracy of information transmission, each command must be verified (checksum 1). If there are command parameters after the command, it must be verified again (checksum 2). The information returned by the actuator must also be verified. The verification method can be a byte-by-byte XOR method.

The control computer command format is as follows:

Data Header

Command code

Checksum 1

Command Parameters

Checksum 2


Actuator returns:

Data Header

Command return code

Position/State/Parameters

Checksum


The data header is used as a mark to mark the beginning of a message and as a verification command. The command code and command return code should be consistent to ensure that the control computer can receive the correct command return information.

3.3 Preliminary Software Model

Figure 4 is a preliminary model of the client software currently used for system testing. Through debugging and verification, its functions can basically meet the current testing requirements:

(1) Each actuator has a corresponding Ethernet-to-serial port module, and each module has its own fixed IP address: input the IP address to connect to the specified actuator, and multiple actuators can be connected and controlled at the same time.

(2) Confirm whether the connection is successful through handshake instructions. If the connection is not normal, the system will receive an error report from the actuator during the handshake.

(3) The current operating position, operating status, and parameter settings of the actuator can be queried.

(4) Remote setting of actuator parameters: Before the actuator is put into use, its parameters must be set accordingly as required; this function can also be used to change the settings during use.

(5) The actuator can be moved to any desired position by specifying the opening percentage.

(6) The direction can be specified to make the actuator rotate forward, reverse, or stop, or it can also operate autonomously.


Figure 4: Preliminary model of client software

4 Summary and Outlook

The author's innovation: A design scheme for the Ethernet monitoring system of actuators based on VC is given, which realizes efficient and fast remote control. In the next step of development, the application software of this system is made compatible with the common industrial control configuration software on the market: for example, general configuration software will embed the ModBus/TCP protocol, and this software can complete the conversion of this protocol internally. That is, when the configuration software issues a control command, this software can recognize the command and convert it into a custom protocol that the actuator can recognize, so as to indirectly control the actuator. In this way, the system can achieve control compatibility with the configuration software and achieve the sharing of field data.

In short, with the continuous acceleration of Ethernet transmission speed and the continuous improvement of performance in terms of determinism, real-time and reliability, industrial Ethernet will undoubtedly play an increasingly important role in future control networks.

Reference address:Design of Ethernet Control System for Actuators Based on VC

Previous article:PLC Distributed Control System Based on GPRS Network
Next article:Design of sewage treatment monitoring system based on GPRS

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号