
Network operation and remote control have become the research directions of many enterprises and scientific research institutions. To realize the management and control of field equipment, it is necessary to communicate with these equipment and exchange relevant data to achieve the purpose of management, control and monitoring. In the same embedded field, in order to achieve remote monitoring, it must also be based on the network. Manipulators operating underwater or in harsh environments require remote control at certain times. It is possible to remotely control the robot to perform operations through the network.
In remote control, communication is a technical issue worth discussing. The traditional communication is only limited to the communication that is separated from the network, such as the communication between two PCs, or the upper computer is a PC, and the lower computer is a single-chip microcomputer. In the remote control manipulator system, the remote serial communication based on the Internet is used. The remote serial communication refers to the long-distance communication between the client and the lower computer or the communication object through the serial port, and the traditional remote communication is only one of them. In part, the client sends instructions to the lower computer to the control unit, so as to realize remote monitoring.
1. The basic structure and implementation of the remote serial communication system
(1) Overview of the basic structure
In the software system architecture, C/S and B/S are the two mainstream technologies of the development mode technology architecture in the world today.
The C/S mode adopts a two-tier architecture, namely the client and the server. Through this architecture, the advantages of the hardware environment at both ends can be fully utilized, and the tasks can be reasonably allocated to the client and the server. Transaction processing, the server performs data processing and response request processing. Client software needs to be installed on the client to access the server. Not only is it inconvenient to upgrade the software, but it also increases the load and investment cost of the client.
B/S (Browser/Server) structure is the structure of browser and server. It is a change or improvement of the C/S structure with the rise of Internet technology. Under this structure, the user interface is realized through the browser, and a very small part of the transaction logic is realized in the front end (Browser), but the main transaction logic is realized in the server end (Server), and the data processing is carried out by the database server, forming the so-called so-called Three-tier structure. This greatly simplifies the client computer load, reduces the cost and workload of system maintenance and upgrades, and reduces the overall cost of users, but only in B/S mode can not directly communicate with the controlled object.
Based on the B/S mode, the remote serial communication for data communication with the controlled object adopts a four-layer architecture and adds a control layer. The browser side is the presentation layer, the WEB server is the function layer, the database server is the data layer, and the control layer is the The layer is to transmit instructions to the control server through the WEB server. The control server acts as the upper computer and controls the lower computer through the serial port until the control execution components. Not only the control layer is added here, but also the functional layer and the data layer are expanded. This architecture not only has the excellent characteristics of B/S mode, but also increases the control service function, makes full use of the existing network resources and industrial field resources, and organically combines the two to achieve the integration with the controlled equipment. The purpose of remote communication through serial port. The presentation layer, the function layer, the data layer and the control layer have certain interrelations and relative independence. Each layer is connected through the Internet, and information communication is carried out through the HTTP protocol and the serial communication protocol.As shown in Figure 1
(2) Function and realization of each component of remote serial communication
(1) Browser side: The user logs in to the web server through the browser, enters the user name and password, compares with the data in the database and passes the verification, becomes a legal user, and then enters the control data in the corresponding form. After pressing the submit button, the data is sent to the web server. The browser side is then used as a Display side, which can Display the feedback position of the remote execution components.
(2) WEB server: It can receive the control data sent by the browser, and after processing the corresponding data, send the data to the control server, or directly as the control server, send the data to the execution component through the serial port.
(3) The database server side: store the username and password of the legitimate user for verification. At the same time, when sending execution data, if specific conversion data is required, it can also be obtained directly from the database. Realize the data processing of the system, and feed back the running results to the web server.
(4) Control server: as the host computer that directly sends commands to the execution components through the serial port, or directly by the web server itself. Receive the data received by the web server from the browser. Through the serial communication protocol and handshake signal, the data is sent to the lower computer.
(5) Lower computer: It receives the execution data of the control server (upper computer) through the serial communication protocol, and then drives the execution components to work through the corresponding driving circuit.
(6) Execution component: work according to the transmitted instructions, and convert the current position and posture of the execution component into data through the sensor, and then send it back to the control server through the serial port until it reaches the browser side, so that the user is not at the scene of the execution component. Can be controlled remotely and get the effect after the part is executed
In the browser, after the login verification, the data is transmitted to the web server through the HTTP protocol, and then to the control server. The control server acts as the upper computer, opens the serial port, and sends the data to the lower computer through the communication protocol. According to the communication protocol, the lower computer receives the data sent by the upper computer, and starts the D/A converter to control the execution components. At the same time, the posture of the executive component is fed back to the host computer through the sensor. The lower computer can be microprocessors such as single-chip microcomputer, DSP, and ARM.
2. Realization of remote control operation manipulator system
The remote control of the web-based manipulator requires remote control of the manipulator to operate in harsh working environments such as high temperature and underwater. Input the manipulation data remotely through the browser, and transmit it to the main control machine through the network. The main control machine adopts a general PC, and the main control machine sends the data to the lower computer through the serial port. In this operation manipulator system, 89C51 single-chip microcomputer is used as the direct control computer. . The posture of the working manipulator is fed back to the remote control machine through the monitoring equipment on site, and the field data is collected by the sensor and returned to the control machine. Figure 2 is a schematic diagram of the system for remote control of the working manipulator.
On the browser side, log in to the server served by the host computer, and after obtaining legal authentication, send data. After the main control machine receives the information, it sends the data to the direct control machine 89C51 through the serial port.
(1) The hardware components of the single-chip system
(1) Take 89C51 as the core of microprocessor, expand RAM6254, latch, clock circuit, reset circuit and so on.
(2) Serial communication circuit: When the main control machine transmits data to 89C51, it adopts serial communication. The commonly used serial communication bus interface is RS-232C formulated by the American Electrical Association EIA. Considering that the serial ports TXD and RXD of the single-chip microcomputer are all TTL level, and the PC is configured with the RS-232C standard serial interface, the level conversion must be carried out during application. In the working manipulator control system, MAX232 is used as the interface conversion chip.
(3) Digital-to-analog conversion circuit: through the serial port, the master computer sends the action command data of the manipulator to the 89C51, and the 89C51 sends the data to the D/A conversion circuit data port through the bus. In this system, the DA0832 digital-to-analog conversion chip is used to accomplish.
(4) Drive circuit: The working power of the manipulator comes from the hydraulic system, and the servo valve is used to realize the loop control of the manipulator. In order to drive the servo valve, the corresponding drive circuit is designed
(5) Analog-to-digital conversion circuit: use the angle potentiometer and displacement sensor to collect the actual operation data of the manipulator. After the sensor is calibrated, the collected displacement and angle analog signals should be converted to digital signals and sent to 89C51, and then sent upwards. AD0809 analog-to-digital conversion chip to achieve.
(2) Realization of main control computer and single chip software system
(1) Main controller program
The main control machine is a PC, the control interface is developed with VC++, the serial port communication protocol is initialized through the serial port control MSComm, the data sent from the WEB to control the manipulator is proposed from the background database SQLServer, and the angle of execution of each joint of the manipulator is controlled. , while waiting to receive the data returned by 89C51. The flow chart of the software system is shown in Figure 3.
(2) 89C51 MCU main program
As a direct control computer, 89C51 uses C language to write the main program, initializes the serial port, allocates memory buffers to store the received data, opens interrupts, and waits for the external data to be sent and received in the form of interrupts. The main program flow chart of 89C51 is shown in Figure 4.
(3) 89C51 interrupt processing subroutine
In the interrupt subroutine, first clear the interrupt flag, and then judge whether the interrupt is caused by reception or transmission, and process it according to the corresponding interrupt source. The flow chart of the 89C51 interrupt processing subroutine is shown in Figure 5.
3. Conclusion
The innovation of the author of this paper is to connect the 89C51 single chip microcomputer with the operation of the manipulator, and achieve the realization of the remote control manipulator laboratory through the network remote communication, which provides a specific example reference for the research of remote control operation. At present, the system realizes online sending The data is sent to the main control machine and stored in the database. It is necessary to manually mobilize the data in the main control machine to realize the control of the manipulator. It is still under further research to be able to control the operation directly through the network without human intervention. The experimental application and the market have proved that in the present and future of network modernization, telecommunication will definitely appear in the future human life, which has considerable research significance and practical value.
The Links: NL8048BC19-02C SKM600GA124D