Design of a CAN bus-based simulated shooting training system
2026-04-06 07:59:11··#1
Abstract: Military laser target systems are important equipment for modern military training. This paper designs a laser target based on a microcontroller and an infrared receiver array, according to the needs of simulated shooting training in the armed forces. A CAN bus is used to connect multiple laser targets to a monitoring computer, forming a laser target network training system. Keywords: Laser target, Simulation training, CAN bus 1 Introduction In military training programs, field shooting posture training is an important part. Trainees are required to quickly judge the distance and size of targets that suddenly appear in complex environments and hit them with the correct posture. If such training is conducted with live ammunition, the environmental requirements are high, and it is difficult to find a closed training ground; when conducting group training, the personnel are at greater risk; moreover, manual statistics of shooting results are required, which is not conducive to horizontal and vertical comparison and training effect analysis. Therefore, this paper designs a laser target simulation training system based on an infrared receiver and a laser emitter. In this system, an optoelectronic target with an infrared photosensitive receiver mounted on its surface replaces the traditional target. An infrared exciter is mounted on the rifle head, and a laser emission switch is mounted on the bolt. Pulling the bolt emits a laser pulse instead of a bullet. When this laser pulse hits the optoelectronic target, it is detected by a detector on the target composed of a microcontroller. The microcontroller calculates the row and column coordinates of the hit and sends them to a monitoring computer via a CAN fieldbus. The computer displays the shooting score and performs statistical analysis and management of the training results, thus forming a complete simulated shooting training system. 2 System Functions and Hardware Design The laser simulation training system mainly consists of three parts: a monitoring computer or laptop, a communication module, and an optoelectronic target. The computer is placed at the starting point or center of the training area and operated and controlled by the training commander. The optoelectronic target has been scaled down to 70% of its actual size and is randomly arranged on the training area according to training requirements, within a range of 40 to 100 meters in front of or to the sides of the shooter's path. It is mounted on a traditional target-tilting bracket and controlled by the bracket. The system structure is shown in Figure 1. The computer serves as the main control unit, monitoring shooting within a 100m range and communicating with the intelligent units on the photoelectric target via a communication bus. The application program is written in VB, a visual programming language known for its ease of learning, powerful functionality, and ability to quickly develop user-friendly applications. VB also has dedicated communication controls for reliable communication. The communication module facilitates CAN bus communication for the computer. The photoelectric target consists of two main parts: a communication board and a detection board. Due to the varying sizes and shapes of targets required in actual training, several standard-shaped detection boards were designed and assembled according to the different shapes of each photoelectric target to meet training needs. The largest photoelectric target requires four detection boards of different shapes. A schematic diagram of the detection board structure is shown in Figure 2. A photodiode is placed every 2cm on the front of the detection board. If a photodiode is hit, it conducts. After the microcontroller detects the coordinates of the hit point, it sends the information to the communication board via a 485 serial bus. The communication board is responsible for transmitting the hit information and operational status of the entire photoelectric target to the communication module. Each photoelectric target consists of multiple detection boards. To improve system efficiency, a communication board is added to organize the information of the photoelectric target and exchange data with the host computer. The communication board mainly calculates the coordinates of the hit point of the target and sends them to the host computer. After receiving messages from the host computer, it transmits them to the detection boards, enabling multiple detection boards on the same target to operate synchronously. It also has a fault detection function. The communication board and the detection boards are required to communicate instantly and reliably, using a 485 serial bus. This structure allows each photoelectric target to work relatively independently, facilitating future expansion of system nodes. The structural diagram of the communication board is shown in Figure 3. 3 System Software Design 3.1 CAN Bus Communication Design 3.1.1 Introduction to CAN Bus Controller Area Network (CAN) is a fieldbus that is an effective serial communication network supporting distributed or real-time control. It operates in half-duplex mode, where only one node can send information at a time, while multiple nodes receive information. This enables a fully distributed multi-machine system, improving the reliability of data transmission in the network. Among various fieldbuses, the CAN bus is widely used in industrial control and vehicles due to its simple structure and flexible application. The CAN bus uses a broadcast access method for information access, allowing information to be sent from any node to an idle bus at any time. Each node's CAN bus interface must accept all information appearing on the bus; therefore, each node is equipped with a receive register. The receive register first receives the information and then determines whether to read the data in the information packet based on the identifier of the received information, i.e., whether to use the information. A major feature of the CAN bus protocol is that it abolishes traditional address encoding, replacing it with encoding of communication data blocks. The CAN bus is data-oriented rather than node-oriented. The advantage of this method is that the number of nodes in the network is theoretically unlimited, and adding or removing devices does not affect the system's operation. Therefore, a CAN bus-based shooting simulation training system can increase or decrease the number of photoelectric targets according to actual requirements. The CAN bus transmits and receives data in frames up to 8 bytes long, thus avoiding excessive bus time occupation and ensuring real-time communication. The maximum communication rate is 1 Mb/s (at a communication distance of 40 m), and the maximum communication distance is 10 km (at a transmission rate of 5 kb/s). The communication medium can be twisted pair, coaxial cable, or optical fiber. 3.1.2 Implementation of CAN Bus Communication In this system, the PHILIPS SJA1000 chip is used. Different communication baud rates are achieved by setting the bit timing register of the SJA1000. The CAN bus baud rate is closely related to the communication distance; the shorter the distance, the higher the allowed baud rate, and vice versa. The system operates in a multi-master mode, where any node can send information to the bus at any time. Each node performs message filtering through ACR and AMR. The monitoring computer can perform the following two operations on each photoelectric target: query whether the photoelectric target is working properly; and reply to confirm receipt of the photoelectric target's detection data. The monitoring computer checks the photoelectric target's operation at fixed intervals to ensure it is online and functioning correctly. Upon receiving a hit notification from the target, the monitoring computer sends a confirmation message to the target, acknowledging receipt of the detection data. The target's communication board then deletes the hit point coordinates to prevent data loss during communication and ensure reliability. The target needs to send the following three types of data to the monitoring computer: all target boards are functioning correctly and have not been hit; the hit signal and the horizontal and vertical coordinates of the hit point; and the error signal and the board number of the faulty board. The program flowchart is shown in Figure 4. The CAN technical specification defines the standards for CAN at the data link layer and physical layer. When designing communication software, users must design a suitable CAN bus communication protocol according to their requirements to achieve accurate and reliable transmission. In this system, the communication protocol is defined as follows: addr+cmnd+data…+data+chkxor; where: addr—sender's address code; cmnd—command code; data—data; chkxor—XOR checksum; In this system, the data area only has the sender's address code, not the receiver's address code, which is determined by the characteristics of this system. Each photoelectric target only needs to communicate with the monitoring computer and has no communication with each other. Therefore, the monitoring computer receives all information on the bus, and other nodes filter out useless information through their respective acceptance filters. 3.2 System Detection and 485 Communication Software Design The communication board and detection board on the photoelectric target communicate in a master-slave mode via the 485 bus. The communication board is the master and the detection board is the slave, and they communicate through a polling method. The communication block diagram between the communication board and the detection board is shown in Figure 5. After the system initialization is completed, the communication board first queries the status of one detection board. After receiving the query information, the detection board sends the coordinates of the hit point back to the communication board. If it is not hit, it responds with a signal indicating that it is working normally and has not been hit. After receiving a response signal from the detection board, the communication board first analyzes the information type. If the response signal indicates that the detection board is working normally and has not been hit, the communication board directly queries the next detection board. If the response signal is the coordinates of the hit point, the communication board queries other detection boards based on this, calculates the center point coordinates of the hit area, and sends them to the host computer. If the communication board does not receive a response from the detection board 100ms after sending the query signal, it indicates that the detection board is malfunctioning, and the communication board queries the next detection board. If a detection board fails to respond to the communication board's query signal three times consecutively, the communication board sends a message to the host computer indicating that the detection board is malfunctioning. 4 Conclusion The military shooting simulation training system has been put into operation in actual training. The results show that the system is simple to operate, has high real-time performance, accurate measurement points, and reliable operation, achieving good training results and showing broad application prospects. References [1] Wu Mingkuan. CAN bus principle and application system design [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 1996; [2] Hu Hancai. Microcontroller principle and its interface technology Beijing: Tsinghua University Press, 1996; [3] Wang Guirong, Qian Jianmin. CAN bus and high-level protocols based on CAN bus, Computer Measurement and Control, 2003.11. [4] Han Zhaofu, Wang Ping, Chen Zunyin, Ge Yinmao. Application of microcontroller in shooting ordnance integrated testing system, Computer Automatic Measurement and Control, 2000, No. 4.