Design of single-chip computer system for car driving simulator

introduction

This article refers to the address: http://

The car driving simulator is a simulation system that can correctly simulate the driving behavior of the car and obtain the driving feeling of the real car. The current car driving simulator integrates sensors, computer 3D real-time animation, computer interface, artificial intelligence, data communication, network, multimedia and other advanced technologies, mainly for driver training, and can also simulate microscopic traffic. The control characteristics of the car are studied [1]. The car driving simulator has the characteristics of high safety and good reproducibility. Using the driving simulator for research and training, it is convenient to simulate various road environments and weather conditions, and analyze the technical performance indicators of the car, so that it can save a lot of natural resources and has high economic value [2].

In the car driving simulator, the performance of the sensing control system directly affects the interactivity and real-time performance of the entire car driving simulation system, and is an important indicator to measure the practical performance of the car driving simulator. The sensing control system is mainly composed of various sensors, data acquisition and processing systems, and interface circuits. Among them, the data acquisition and processing system is the core of the entire sensing control system. At present, many car driving simulators use data acquisition cards to realize the acquisition of manipulation data. The data acquisition and processing system based on data acquisition cards is relatively expensive, and the acquisition of analog quantities is not very stable. It must be used in the simulation program. The algorithm processes the analog quantity, and the number of interfaces is also limited, which brings some difficulties for subsequent development. The data acquisition system based on single-chip microcomputer has a long development cycle, but the cost is relatively low, and the interface has good scalability. At the same time, the pre-processing of analog quantity and switch quantity can also be completed by the single-chip microcomputer, which can fully satisfy the simulator system. Interactivity and real-time requirements. The following describes the design ideas of the car driving simulator single-chip system.

1 system works

In the simulation of automobile motion, the sensor collects the driver's manipulation data, amplifies and filters these signals through the interface circuit, and performs A/D conversion on the analog signals therein. Finally, the single-chip microcomputer system transmits the control signals to the RS-232 interface. Master computer. In the simulation program, the computer controls the visual system, the sound system, the instrument system, and the evaluation system according to the control signal, the motion state of the car, the driving operation rules, and the like. By using the corresponding function function in the single-chip system driver, the signal collected by the single-chip system can be converted into a parameter that controls the state and position of the vehicle. When the driver performs the simulated driving, the data collected by the MCU system changes in real time according to the driver's driving operation, thereby realizing the control of the state and position of the car in the driving simulator visual system, and the accuracy of the control system is simulated by the program. Internal algorithm guarantee.

System workflow

Figure 1 System workflow

The basic operating components of the car driving process are the steering wheel, throttle, clutch, brake and gear position, as well as auxiliary control components such as ignition switch and turn indicator. As with real-world driving, the collaborative work of these manipulating components can control the car model in the virtual view, and the changes in the driving trainer and the view are real-time and interactive. After the driving trainer senses the operation of the operating component through the sensor, the system processes and calculates the control parameters of the automobile model, and finally controls the rendering output of the visual system according to these parameters, and the driving trainer is in real time in the virtual visual view. Observe the operation of the vehicle being driven. The workflow of the system is shown in Figure 1.

2 design of single chip system

2.1 Sensor selection

The main control signals of the car driving simulator are shown in Table 1.

Main driving signal of the car driving simulator

The driving simulator mainly includes steering wheel, clutch, brake, throttle, 6 gears, handbrake and other signals to be collected. The sensors used include switch sensor, displacement sensor and angular displacement sensor [3]. The steering wheel adopts an angular displacement sensor; the clutch, the brake and the throttle adopt a displacement sensor; the ignition, the hand brake, the shifting, etc. adopt a switch sensor.

After comprehensive investigation and comparison, TWZ type DC displacement sensor, QXJ-BZ-V type angular displacement sensor and ITR8102 type of photoelectric photoelectric switch are selected as line displacement, angular displacement and switching quantity sensors respectively. Among them, the resolution of TWZ type DC displacement sensor is 10μm, the resolution of QXJ-BZ-V type angular displacement sensor is 0.01o, and the response time of ITR8102 type on-beam photoelectric switch is 20μs. Practice has proved that the selected sensor fully meets the control requirements of the car driving simulator and has achieved good results.

2.2 hardware circuit design

The car driving simulator sensing control system needs to complete the collection and processing of the switch quantity and analog quantity, the display control of the indicator light and the instrument, and the data transmission between the main control computer and the like. According to the above requirements, the main control chip selects AT89C52 produced by Atmel Company. AT89C52 is a low-voltage, high-performance CMOS 8-bit single-chip microcomputer, which is fully compatible with the pin and command system of standard MCS-51 products [4].

The AT89C52 contains 8K of Flash Programmable Erasable Read Only Memory (FPEROM) and 256 B of internal random data memory (RAM), which can meet the needs of the system programming, so no external program memory and data memory are required. Extension.

Since the number of switches and analogs that need to be processed in this system is large, the 8255 is used to expand the input and output interfaces. The P1 port of the AT89C52 is used as the A/D and D/A conversion interface for analog input and output. The A/D and D/A conversion chips select ADC0809 and DAC0832 respectively, and the chip select signal is provided by the high address line P2. . The 8255's expansion interface is used as a binary input and output. The 8255's port select and chip select signals are provided by the lower address lines latched by the 74LS373.

In addition, the AT89C52 provides a full-duplex serial interface with multi-level communication capabilities for communication with the host computer. Since the RS-232 serial communication port is the standard interface of the PC, and the wiring is very simple when RS-232 is used for two-way data communication, RS-232 is selected as the communication interface [4]. However, the RS-232 output signal not only has a positive voltage, but also a negative voltage, so the semiconductor company's RS-232 interface chip MAX232 is used for signal conversion. Figure 2 is a schematic diagram of the hardware circuit of the car driving simulator single chip system.

System hardware circuit diagram


Figure 2 System hardware circuit diagram

2.3 software system design

The car driving simulator MCU software system needs to complete the functions of analog quantity and switching quantity acquisition and processing, serial data transmission and reception, control signal output and display, fault monitoring and protection. The software adopts the modular design idea and is compiled by assembly language. It is mainly composed of main program, timer interrupt service program, serial port interrupt service program, data acquisition and processing program, signal output and display program.

Software system program flow chart

Figure 3 software system program flow chart

The main program mainly completes the initialization of the system; the timer interrupt service program mainly completes the watchdog function. When an abnormal situation occurs in the single chip microcomputer, the program can be reset in time to ensure that the single chip system can work normally; the serial port interrupt service program mainly realizes the single chip microcomputer. Communication with the main control computer; the data acquisition and processing program mainly completes the acquisition of analog quantity and switch quantity, and obtains the driver's control data; the signal output and display program transmits the control information of the master control computer to the single-chip microcomputer for Control indicator and meter display output. Figure 3 is a flow chart of the program of the car driving simulator microcontroller software system.

3 conclusions

The data acquisition system based on single-chip microcomputer has relatively low cost and good extensibility of the interface. At the same time, the pre-processing work of analog quantity and switch quantity can also be completed by single-chip microcomputer. The system can fully meet the interactivity and real-time requirements of the car driving simulator. It has been applied in the developed car driving simulator and achieved good results.