0 Preface
In order to meet the requirements of processing accuracy and processing speed. Today's machine tool processing equipment is equipped with a large number of electronic devices, so the communication between processing equipment has become the basis of processing automation, which puts forward higher requirements on the real-time, stability, and security of the communication network. At present, the commonly used information transmission methods between processing equipment are RS-232, RS-422, etc., but these can no longer meet the needs of processing automation. CAN is a field bus. It has outstanding reliability, real-time and flexibility. It can complete multi-point digital communication between field automation equipment and realize information exchange between the bottom equipment and the outside world. It is an ideal communication means for mechanical processing equipment. This paper is based on the research of CAN bus control system. The application of CAN bus control system in machine tool processing is introduced, and a machine tool processing control system based on CAN bus is designed, which has the characteristics of high degree of automation, strong real-time performance and high processing accuracy.
1 Overview of CAN bus characteristics
In the early 1980s, in order to solve the data exchange between numerous control and measurement devices in automobiles, the German Bosch company developed a serial data communication bus, which was the original CAN (Controller Area Network) bus. The CAN bus is a serial communication network that effectively supports distributed control systems or real-time control, and through this network, reliable transmission of long-distance real-time data can be achieved.
CAN bus works in multi-master mode and supports hot plugging. It increases the flexibility of communication. All nodes on the network can send information to other nodes on the network in real time, in parallel and actively. It adopts non-destructive bus arbitration. When multiple nodes send information messages to the bus at the same time, the nodes with low priority will actively stop sending data, while the nodes with high priority can continue to send data without being affected. It has the functions of point-to-point, point-to-multipoint and global broadcast data transmission. The communication distance is long, up to 10km. The communication speed is high, up to 1Mb/s. It has a high cost performance.
Simple structure. Devices are easy to purchase, and the price of each node is low: the communication medium can be twisted pair, coaxial cable or optical fiber. Flexible selection; the business data is packaged into messages for transmission, and the number of valid bytes of each information message is 8. This method has short transmission time, high real-time performance, strong anti-interference, and can reduce the probability of retransmitting information messages; bit check, fill bit check, cyclic redundancy check (CRC) and data frame format check are used. The probability of data error is less than 10% of 5. At the same time, if the number of CAN node errors is greater than a certain number, it can automatically exit the bus to minimize the interference of the error node on the bus.
In summary, CAN bus has many excellent characteristics. Connecting on-site processing equipment through CAN bus has advantages that other communication methods cannot match, which greatly improves the degree of automation of machine tool processing.
2 CAN control system composition and principle design
The system communication network topology adopts a bus structure (see Figure 1), with multiple nodes sharing one transmission line. The entire system can be divided into two layers: the upper layer is the control computer and CAN adapter card, and the lower layer is composed of several control units.
The upper control computer is a high-performance PC, whose main functions are to provide users with a human-computer interaction interface, store field data, control the processing process, etc. The control computer can remotely monitor and control each field control unit, and report the data to the user in real time. One end of the CAN adapter card is connected to the bus, and the other end is connected to the control computer. It transmits the control computer's operating signals and control parameters to the designated field control unit, and at the same time, transmits the control unit's data to the control computer for further processing.
The lower-level field control unit is composed of embedded modules with CAN interfaces. According to their functions, they are mainly divided into: data acquisition module, control module, transmission module, input/output module, etc. Its main functions are as follows:
(1) Data transmission: The on-site control unit is responsible for transmitting the processing parameters such as feed speed and cutting depth to the control computer in real time, and transmitting the processing instructions of the control computer to the lower-level equipment.
(2) Monitoring and management: Complete the basic data processing, fault diagnosis and alarm, parameter setting, clock calibration and other monitoring and management tasks of the machine tool.
The process of machining control is as follows: the control computer selects the control mode and actuator according to the relevant parameters set by the user. The field control unit sends the collected data to the control computer in real time through the CAN bus. The decision software of the control computer performs calculations based on the reported data and the parameters set by the user, and then transmits the control quantity to the lower layer to instruct the relevant agencies to perform actions. The whole process does not require human intervention, achieving high precision and intelligence.
3 CAN control system hardware design
As shown in the system structure of Figure 1, the system hardware mainly includes: control computer, CAN adapter card, CAN bus and field control unit. The control computer adopts a high-performance industrial control computer. It is responsible for system initialization, communication management, processing control, etc. The selection of CAN adapter card should be conducive to the connection with the industrial computer. It is conducive to interface design. At present, there are products from many companies available on the market. For example, Sanxingda Company. It can map the dual-port RAM into the physical memory of the PC through software and hardware settings. So that sending and receiving data is equivalent to directly reading and writing data to the memory, thereby increasing the rate of data exchange.
The control unit is the physical carrier of real-time data, processing instructions and other tasks. It is mainly composed of embedded processing unit, CAN controller, CAN transceiver, optoelectronic isolation circuit, storage unit, I/O, etc. Figure 2 is the hardware structure diagram of the control unit.
The embedded processing unit is generally a single-chip microcomputer with a program storage capacity of more than 4 kB. The storage unit stores initialization parameters, user-defined data, some simple processing programs, and relevant data of the microprocessor during calculation, measurement, and control.
There are two main categories of CAN bus: independent CAN controller combined with microcontroller and microprocessor with CAN controller. According to the system requirements and development environment, CAN controller should be able to complete all the functions of physical layer and data link layer specified by CAN protocol, and have all the characteristics required to complete high-performance communication protocol. Optoelectronic isolation circuit can enhance the anti-interference ability of control node and prevent crosstalk between lines. Isolation is achieved between each CAN node on the bus to protect CAN controller. In addition. 120Q matching resistors should be connected to both ends of the bus to improve the reliability and anti-interference ability of the whole system communication; the clock of single-chip computer in the system should be synchronized with the clock of CAN controller. I/O devices are realized by small numeric keyboard and LCD digital tube. Interface circuit realizes connection with various data acquisition equipment and sensors. [page]
4 Software Design
4.1 Control computer software design
The control computer software can be developed by programming the interface functions provided by the CAN adapter card. The program flow is shown in Figure 3. First, the CAN bus is initialized. This mainly includes the setting of the working mode, basic parameters, receiving shield registers and receiving mask registers. Secondly, it is connected with the lower control unit to establish a transmission path. The user selects the processing program, transmits a signal to the lower control unit, controls the computer to receive data, generates processing instructions and transmits them to the lower end for execution. Finally, when the processing is completed, an end signal is sent to the control unit, and the program ends. The entire processing process is completely controlled by the program and completed automatically.
4.2 Control unit software design
The lower-level control unit completes data transmission and monitoring and management of the lower-level equipment. The basic process is shown in Figure 4.
4.3 Hardware initialization and implementation of receiving and sending programs
4.3.1 Initialization Procedure
The initialization procedure mainly includes the setting of working mode, receiving filter mode, receiving mask register and receiving code register, baud rate parameter and interrupt enable register, etc. After completing the hardware initialization setting, you can return to the working state and perform normal communication tasks.
4.3.2 Implementation of receiving and sending programs
After the initialization work is completed, the CAN bus can be read and written. For the reception and transmission of data, it can be implemented in two ways: query and interrupt. The interrupt processing principle is: when the receiving buffer is full, an interrupt request is sent to the CPU to notify the CPU to take away the data; and when the data written to the buffer is sent, the CPU is also informed through the interrupt method that the data has been sent, the sending buffer is empty, and other data can be written. The CPU responds to the interrupt request of the CAN controller through the interrupt service program.
5 Conclusion
CAN bus has many excellent characteristics. Connecting on-site processing equipment through CAN bus has advantages that other communication methods cannot match, which greatly improves the degree of automation of machine tool processing. This article is an application of CAN bus in the field of mechanical manufacturing. It shows the advantages of CAN bus in the field of mechanical manufacturing. With the continuous deepening of people's research on CAN bus, CAN bus control system will be more widely used in the field of mechanical manufacturing.
Previous article:Human-computer interaction design of intelligent monitoring system using CAN bus
Next article:My experience of transplanting ucosii on 51
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- I am a beginner who just learned 51. I would like to ask the experts to see if there is any problem with the program of the water lamp.
- How to convert MAX31865
- What does the diode in this picture mean?
- After uploading the picture, it doesn't show up in the post when I refresh it. What's going on?
- 【GD32307E-START】04-Project establishment and LED lighting
- Design and implementation of ZigBee technology voice and image wireless monitoring system
- TIDA-00961 FAQ for GaN-based High Efficiency 1.6kW CrM Totem Pole PFC Reference Design
- [National Technology N32G457 Review] RT_Thread Studio SPI Filling the Pit
- LSM6DSRX iNEMO inertial module related information
- GD32E231 Keil development environment setup problem [solved! ]