Remote reset control of front-end equipment implemented by microcontroller in scientific research experiments

Publisher:科技驿站Latest update time:2012-01-19 Source: 微计算机信息 Keywords:AT89C51  RS232  Relay  Socket Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

During the debugging phase of the Lanzhou Heavy Ion Accelerator Cooling Storage Ring Project (HIRFL-CSR), the beam obtained by the HIRFL heavy ion accelerator needs to be injected into the cooling storage ring (CSR). During the beam adjustment process, because the control system operation is ordinary and the real-time requirements are high, the amount of data on the network increases greatly, causing the front-end gateway to handle a large amount of data from the power control module; in addition, the front-end gateway and the power control module are connected to the strong power control system on the electrical appliances, and the front-end gateway and the power control module microsystem are sometimes affected by the strong power control system, which increases the possibility of the front-end gateway crashing. If the beam adjuster in the central control room finds that the front-end gateway is dead during the beam adjustment process, he must go to the site to reset the gateway before the beam adjustment work can proceed smoothly. This is time-consuming and laborious for the adjuster, and the work efficiency is affected. In order to improve the efficiency of beam adjustment and reduce the physical labor of the adjuster, we designed and implemented the remote reset system of the HIRFL-CSR beam injection line gateway, so that the beam adjuster can quickly reset the front-end gateway with a mouse on the computer in the central control room, improving the efficiency of beam adjustment.

Figure 1

The gateway remote reset system is mainly composed of AT89C51 single-chip microcomputer hardware circuit, reset gateway, AT89C51 single-chip microcomputer signal processing program, and control room interface application program. The system structure diagram is shown in Figure 1.

1 Hardware structure and principle

1.1 MCU Hardware Circuit

The hardware circuit of the single chip microcomputer is divided into: signal conversion circuit, AT89C51 single chip microcomputer, isolation circuit, relay circuit

Road, etc.

The signal conversion circuit works in full-duplex mode and has two main functions: one is to convert the MAX485 signal sent by the reset gateway into an RS232 signal that can be received by the P3 port of the AT89C51 microcontroller. The AT89C51 then processes the signal and selects the corresponding relay through the P2 port to reset the corresponding gateway. The other is to use another MAX485 to convert the signal sent from the P3 port of the AT89C51 into a MAX485 bus signal received by the reset gateway.

AT89C51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of flash memory and programmable erasable memory. The microcontroller uses Atmel's high-density, non-volatile memory manufacturing technology, and is compatible with the industry-standard MSC-51 instruction set and I/O pins. Its programming development software can be Keil uVision2, which is convenient and efficient to program. AT89C51 provides a very flexible and inexpensive solution for many embedded control applications. Its main features include: 4K bytes of flash memory, 128 bytes of RAM, 32 I/O ports, 2 16-bit timers, 5 bipolar interrupt source structures, 1 full-duplex serial port, on-chip oscillator and clock circuit. Due to the high cost performance of AT89C51, we use AT89C51 to implement the microprocessor of the reset hardware circuit.

The AT89C51 microcontroller in this system mainly implements intelligent processing of the received signal, and then selects the relay to complete the reset operation by transmitting a signal to the P2 port. Because the external output isolation circuit of the P2 port of the microcontroller uses an open collector photoelectric isolation device, and the relay circuit uses a pull-up resistor and a photoelectric isolation device in series, when a certain position of the internal P2 port register is 0, the external corresponding relay circuit is not turned on, and the front-end gateway is in normal working condition. When a certain position of the internal P2 port register is 1, the external corresponding relay circuit is turned on, the relay is turned on for 3 seconds, and the corresponding gateway is powered off for 3 seconds to reset. After the reset is successful, the microcontroller returns the reset success information to the network through the P3 port.

1.2 Reset the Gateway

The main function of the reset gateway is to complete the connection between the central control room application and the AT89C51 single-chip microcomputer hardware circuit module. Because the data throughput between the gateway and the AT89C51 circuit module is very small, and there is no electrical connection between the AT89C51 circuit module and the power supply, the serious interference of the strong power control circuit on the single-chip microcomputer system is avoided, so the stability and reliability of the reset circuit are guaranteed. A reset gateway can fan out several reset circuits, and a reset circuit can reset at least 8 gateways, so a reset gateway can manage the reset work of dozens of front-end gateways. At the same time, the MAX485 bus is used between the reset gateway and the AT89C51 circuit, so the AT89C51 single-chip microcomputer hardware circuit can be distributed in a large range of locations to reset the decentralized gateways.

2 Software Description

2.1 AT89C51 MCU Program

The signal processing program of AT89C51 microcontroller is written in Keil uVision2. The program mainly works in the query mode, which can eliminate the jumble. The number of jumble bits to be eliminated can be defined by yourself. When the input command is wrong, it can be re-entered. After the microcontroller operation is successful, it can return a success message. The flowchart of the whole program is shown in Figure 2.

The program of this microcontroller first adds the "stdio.h" and "at89x51.h" header files, which are mainly used to define the registers of AT89C51 and call system library functions. Secondly, a delay function and an addressing function are declared. The delay function is mainly used to control the length of the reset time, and the addressing function is mainly used to identify the microcontroller circuit block number on the network. When the AT89C51 program detects that its own commands appear on the network, it continues to execute the program to perform the corresponding reset operation. Otherwise, when it recognizes that it is not its own command one by one, it will immediately eliminate the characters in the buffer and re-acquire the commands on the network. When garbled data appears on the bus, the microcontroller that adopts this query mode will not make wrong operation, because the command can only be successfully input and the corresponding reset operation can be completed when the characters and order of the input command conform to the defined command format. If one character is wrong, it must be re-entered. Compared with simple query input, such program structure can not only eliminate the garbled characters transmitted over the network, but also can re-enter the command immediately when the input command is wrong, avoiding the situation in which the input command of the simple query mode must be input with all the specified characters before re-entering, thereby improving operating efficiency.

Figure 2

2.2 Control Room Interface Application

The control room interface application is mainly written by VC++, and the core is Socket programming. Socket is a socket specification based on the transport layer protocol (mainly TCP and UDP). It was originally proposed by the University of California, Berkeley, and it defines the specification for communication between two computers (also a programming specification). The two computers communicate using a "channel", which is composed of sockets at both ends of the communication. Socket shields the differences between the underlying communication software and the specific operating system, making it possible for any two computers that have installed the TCP protocol software and implemented the socket specification to communicate.

Most network communication programs can be divided into two categories: server side and client side. Since the reset gateway is a server side based on the Linux operating system, this application uses Stream Socket to create a central control room client service application based on Windows. Stream Socket is a connection-oriented programming method that provides a series of data error correction functions to ensure that the data transmitted on the network reaches the other party in a timely and correct manner. The Socket programming model of this interface client application is shown in Figure 3.

Figure 3

This application first uses MFCAppWizard to create a single text dialog box, then adds an IP edit box, a port edit box, and a connect button to the dialog box to connect to the reset gateway; adds some radio buttons to select the front-end gateway to be reset; adds an edit dialog box to display the received return information; adds a reset button to send a reset command to AT89C51. Then, add the corresponding CSocket class, function, and variable to the application. After the program is compiled, you can generate a Win32 Release executable file and then install it to the central control room to implement the reset operation. The application operation steps are very simple. When the staff finds that the front-end gateway is frozen, open this application, enter the IP and port number of the reset gateway, and connect. After the reset gateway is successfully connected, you can select the front-end gateway number and click the reset button. If the reset is successful, the reset success message will appear in the edit dialog box, and the staff can continue to adjust the bundle quickly.

3 Conclusion

The innovation of this paper is to use a microprocessor to realize the intelligent reset control of the front-end gateway in scientific research experiments, eliminating the phenomenon that the front-end gateway crashes during the HIRFL-CSR test phase for several years, forcing scientific research staff to manually reset the front-end gateway on site, which greatly facilitates the beam adjustment personnel and improves the work efficiency of scientific researchers. The front-end intelligent circuit module implemented by the microprocessor realizes the remote control of the front-end equipment in the scientific research experiment through the operation of the network communication application program in the central control room. Since the system has been used in the HIRFL-CSR beam injection line since October 2005, it has been stable, has strong anti-interference, and has not occurred any misoperation. Practice has proved that this system can still reset the front-end gateway when the communication port of the front-end control gateway is blocked, and has the advantages of reliable reset and strong real-time performance. Through the implementation of this remote reset system in the scientific research control system, we can also apply this control method to many links of scientific research experiment control, such as: remote power switch, remote control solenoid valve, and status acquisition of front-end equipment. Therefore, our physics researchers should consciously apply microcomputer control technology to all aspects of scientific research experiments, and try to let computers complete some time-consuming and laborious work to improve the degree of automation in scientific research, so as to help researchers achieve results in their professional fields. This requires our physics researchers to first learn some computer-related knowledge, and secondly, to have the awareness of using microcomputers to help themselves do scientific research, and finally, to use the knowledge of microcomputer control to realize automatic control in scientific research and help themselves do scientific research well.

References:

He Limin, Microcontroller Application System Design, Beijing University of Aeronautics and Astronautics Press, 1990.

Li Dayou, Jiang Xiufang. Single-chip microcomputer hardware, software and applications, Higher Education Press, 1992

Zhou Heqin, Wu Xiuqing, Microcomputer Principles and Interface Technology (2nd Edition), University of Science and Technology of China Press, 2001

Zhang Shuocheng, et al., Application of optical fiber communication in HIRFL-CSR control system, Microcomputer Information, 2005-9-1, 25~26

Keywords:AT89C51  RS232  Relay  Socket Reference address:Remote reset control of front-end equipment implemented by microcontroller in scientific research experiments

Previous article:A robot tracking algorithm
Next article:Design and implementation of real-time communication system between PC and multiple single-chip microcomputers

Recommended ReadingLatest update time:2024-11-16 15:48

At89c51 MCU keyboard scanning and display program
;****************************************************** ;* Name: kbd ;* Function: Read key value from keyboard and store it in register A: r*4+c ;* Input: ;* Output: A=key value ;**********************************************************   org 0000h   ljmp main   org 0200h main: init:   MOV 60H,#10h   MO
[Microcontroller]
Design of home security alarm system based on AT89C51 microcontroller and sensors
Home security alarm system The home security alarm function is an important function of the smart home system. Together with various sensors, function keys, detectors and actuators in the home, it constitutes the home security system and is the "brain" of the home security system. Alarm functions include fire preventi
[Microcontroller]
Design of home security alarm system based on AT89C51 microcontroller and sensors
Design of CAN-LIN Gateway Based on AT89C51CC01 Microcontroller
introduction Fieldbus technology has been widely used in industrial control, especially CAN (Control Area Network) bus, which has the advantages of high reliability, low cost and easy implementation, and occupies a large share in the actual engineering application of fieldbus. With the development of bus techno
[Industrial Control]
Design of CAN-LIN Gateway Based on AT89C51CC01 Microcontroller
How to Design with Capacitive Digital Isolators
Currently, safety regulations regarding the use and design of electronic equipment have emerged in an endless stream, making galvanic isolators a necessity in almost all data acquisition and transmission systems. One way to protect the low-voltage circuits of the control system from potential high voltage damage to se
[Power Management]
How to Design with Capacitive Digital Isolators
51 microcontroller principle and application
  The 51 microcontroller is an 8-bit microcontroller designed based on the Harvard structure, also called AT89C51. It was launched by Intel in the early 1980s and became one of the most popular microcontrollers at the time. It is still widely used in various embedded systems.   The architecture of the 51 microcontro
[Microcontroller]
AT89C51 Multi-channel Digital Control DC Regulated Power Supply
  In today's society, people greatly enjoy the convenience brought by electronic devices, but any electronic device has a common circuit-the power supply circuit. DC power supplies tend to be multifunctional and digital. The power supply of DC regulated power supplies is mostly AC power supply. When the voltage or loa
[Microcontroller]
AT89C51 Multi-channel Digital Control DC Regulated Power Supply
Design of Laser Code Controller Based on AT89C51 Single Chip Microcomputer
This password controller is a photoelectric remote control type, which combines the above two advanced technologies. A specific password is arranged with illumination or no illumination as the basic code, and laser is used as the carrier, and then it is recognized by the receiver, analyzed and judged by the single-chip
[Microcontroller]
Design of Laser Code Controller Based on AT89C51 Single Chip Microcomputer
Application Guide for USB Reader/Writer with RS232 Interface
1. Hardware Description : The hardware interface diagram is shown below: Interface and indicator light description: Accessories: one serial cable, one USB interface cable 2. Hardware Installation : 1. Use a serial cable to connect the RS232 serial port of the reader a
[Analog Electronics]
Application Guide for USB Reader/Writer with RS232 Interface
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号