Realize the control and diagnosis of equipment based on WEB technology and embedded technology
“The control and diagnosis of single-chip microcomputer equipment based on Ethernet combined with advanced WEB technology and embedded technology realizes the direct cross-platform information interaction between PC and equipment, so that PC can share equipment operation information and effectively realize the control of equipment And diagnosis.
“
introduction
The control and diagnosis of single-chip microcomputer equipment based on Ethernet combined with advanced WEB technology and embedded technology realizes the direct cross-platform information interaction between PC and equipment, so that PC can share equipment operation information and effectively realize the control of equipment And diagnosis.
1. Structure design of motor control and diagnosis based on Ethernet
The Ethernet-based single-chip device control and diagnosis is based on the three-phase motor at the industrial site as the research object, including the measurement and control of the motor running speed, the acquisition of the armature current, the acquisition of the motor potential parameters, and other analog-related quantities. collection. The main structure of this design is the organic combination of WEB technology, single-chip microcomputer and client computer to establish a diagnosis and control model of electrical equipment. The model is shown in Figure 1. The model is mainly composed of the client, the network and the process control bottom layer, namely the single-chip embedded system. Here, the TCP/IP protocol is used as the communication protocol of the embedded system. The WEB server of the embedded system interacts with the WEB server of the client and uploads Motor running parameters, so that customers or manufacturers can realize the control and online diagnosis of the motor through the network.
Realize the control and diagnosis of equipment based on WEB technology and embedded technology
2. Realization of system hardware circuit
The Ethernet-based motor control and diagnosis system uses C8051F020 single-chip microcomputer as the embedded system CPU, embedded TCP/IP protocol, and RTL8019AS as the network communication chip. It collects motor parameters and controls the speed of the motor by controlling the sampling switch, and passes the RTL8019AS network card Upload the collected temperature data, rotational speed data, current data, vibration data, and magnetic field data to the server. The client realizes data sharing through the interaction between the servers. The client uses the microcontroller itself to generate SPWM according to specific needs. Input the 0~10V or 4~20mA signal at the analog input terminal of the device, control the output frequency of the inverter by changing the size of the input analog, adjust the inverter, control the motor speed, and monitor the operation of the motor and diagnose the motor according to the value of the motor parameter. The hardware circuit block diagram is shown in Figure 2.
3. Ethernet frame format
There are two Ethernet protocols, one is IEEE802.2/IEEE802.3; the other is the encapsulation format of Ethernet. Modern operating systems can support these two types of protocol formats at the same time, so it is enough for us to understand only one of them, especially for single-chip microcomputers, it is impossible to support too many protocol formats. This system adopts the IEEE802.3 Ethernet protocol, and Table 1 shows the encapsulation form of the Ethernet frame format. ]
PR: synchronization bit.
SD: Separator.
DA: Destination address. The Ethernet address is a 48-bit (6 bytes) binary address, indicating which network card the frame is transmitted to.
SA: Source address, 48 bits, indicating which network card sent the data of the frame, that is, the network card address of the sender, which is also 6 bytes.
TYPE: Type field, indicating what type of data the data of the frame is.
DATA: Data segment, the data in this segment cannot exceed 1500 bytes.
FCS: 32-bit data parity bit.
4. System software design
The implementation of the system software includes the initialization of the system clock, timer, network card RTL8019AS, the initialization of ARP protocol, TCP protocol and HTTP protocol to complete the receiving and sending of motor parameters, and then the main program will cyclically query rtl8019as to see if there are new data packets. arrival. The system reads the parameters of the motor according to the sign of the judgment event, as shown in Figure 3. The execution of the judgment of the event is completed by the single-chip timer interrupt, which runs through the beginning and the end of the program. For example, if the TCP sequence number increases by 6250 every 20ms, the retransmission request during ARP address resolution will be retransmitted once every 0.5s. If there is no response to the two consecutive retransmission requests, the retransmission will be terminated, and the IP address will be considered to be non-existent.
ARP mapping table management, if the MAC address recorded in the ARP address mapping table is not used within 60s, the mapping record will be deleted from the mapping table and automatically updated. Finally, the WEBSERVER interface of this control system is shown in Figure 4.
5 Conclusion
The system realizes the transplantation of TCP/IP protocol based on 8-bit single-chip microcomputer, and realizes the web data transmission function and motor parameter query and motor control. The application here is only an example, and because of the low price of embedded Ethernet, It is believed that it will be widely used in the industrial field in the near future.
The Links: NL6448BC26-26 PD104SL5