The application scheme of realizing the single chip system of automobile driving simulator based on AT89C52 single chip microcomputer and sensor

The cost of the data acquisition system based on single chip microcomputer is relatively low, and the expansibility of the interface is good. The system can fully meet the interactive and real-time requirements of the car driving simulator, and has been applied in the developed car driving simulator with good results.

The car driving simulator is a simulation system that can accurately simulate the driving action of the car and obtain the driving feeling of the real car. The current car driving simulator integrates a variety of advanced technologies such as sensors, computer three-dimensional real-time animation, computer interface, artificial intelligence, data communication, network, and multimedia. It is mainly used for driver training, and can also simulate microscopic traffic. The control characteristics of automobiles are studied. The car driving simulator has the characteristics of high safety and good reproducibility. Using driving simulators for research and training can easily simulate various road environments and weather conditions, and analyze the technical performance indicators of automobiles, thereby saving a lot of natural resources and having high economic value.

In the car driving simulator, the performance of the sensor 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 sensor 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 sensor control system. At present, many car driving simulators use data acquisition cards to collect manipulation data. This kind of data acquisition and processing system based on data acquisition cards has relatively high cost and is not very stable when collecting analog quantities. The algorithm processes the analog quantity, and the number of interfaces is also very limited, which brings some difficulties to the subsequent development. Although the data acquisition system based on single chip microcomputer has a long development cycle, the cost is relatively low, and the interface has good expansibility. interactive and real-time requirements. The following introduces the design ideas of the single-chip microcomputer system of the car driving simulator.

1 How the system works

When simulating the motion of the car, 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. master computer. In the simulation program, the computer controls the visual system, the audio system, the instrument system, and the evaluation system according to the control signal, the motion state of the car, and the driving operation rules. Using the corresponding function functions in the single-chip system driver, the signals collected by the single-chip system can be converted into parameters that control the motion state and position of the vehicle. When the driver simulates driving, the data collected by the single-chip microcomputer system will change in real time according to the driver’s driving operation, so as to realize the control of the motion state and position of the vehicle in the visual system of the driving simulator. The precision of the control system is determined by the simulation program. Internal algorithm guarantees.

The application scheme of realizing the single chip system of automobile driving simulator based on AT89C52 single chip microcomputer and sensor
Figure 1 Workflow of the system

The basic control components of the car driving process are the steering wheel, accelerator, clutch, brake and gear position, as well as auxiliary control components such as ignition switch and turn indicator. Similar to real car driving, the cooperative work of these manipulation components can control the car model in the virtual scene, and the changes of the driving trainer and the scene are real-time and interactive. After the driving trainer’s operation of the manipulation components is sensed by the system through the sensor, the system obtains the control parameters of the car model through processing and calculation, and finally controls the rendering output of the visual system according to these parameters, and the driving trainer is real-time in the virtual scene. Observe the behavior of the vehicle being driven. The workflow of the system is shown in Figure 1.

2 The design of the single-chip microcomputer system

2.1 Selection of sensors

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

The application scheme of realizing the single chip system of automobile driving simulator based on AT89C52 single chip microcomputer and sensor

The car driving simulator mainly needs to collect signals such as steering wheel, clutch, brake, accelerator, 6 gears, handbrake, etc. The sensors used include switch sensors, displacement sensors, and angular displacement sensors. The steering wheel adopts the angular displacement sensor; the clutch, brake and accelerator adopt the displacement sensor; the ignition, handbrake, gear shift, etc. adopt the switch sensor.

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

2.2 Design of hardware circuit

The sensor control system of the car driving simulator needs to complete the collection and processing of switch quantity and analog quantity, the Display control of indicator lights and instruments, and the data transmission between the main control computer and other functions. According to the above requirements, the main control chip is AT89C52 produced by Atmel Company. AT89C52 is a low-voltage, high-performance CMOS 8-bit microcontroller, which is fully compatible with the pins and command system of standard MCS-51 products.

The AT89C52 chip contains 8K flash programmable erasable read-only memory (FPEROM) and 256 B internal random access data memory (RAM), which can already meet the needs of the system programming, so there is no need for external program memory and data memory. extension.

Since there are many switch and analog quantities to be processed in this system, 8255 is selected to expand the input and output interfaces. The P1 port of 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 are ADC0809 and DAC0832 respectively, and the chip select signal is provided by the high address line P2 port. . The expansion interface of 8255 is used as the input and output of switch quantity, and the port selection and chip selection signal of 8255 are provided by the low-order address line after being latched by 74LS373.

In addition, AT89C52 also provides a full-duplex serial interface with multi-level communication function, which can be used to communicate 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. However, the output signal of RS-232 not only has positive voltage, but also negative voltage, so the RS-232 interface chip MAX232 of semiconductor company is used to realize signal conversion. Figure 2 is a schematic diagram of the hardware circuit of the single-chip microcomputer system of the car driving simulator.

The application scheme of realizing the single chip system of automobile driving simulator based on AT89C52 single chip microcomputer and sensor
Figure 2 System hardware circuit diagram

2.3 Design of the software system

The single-chip software system of the car driving simulator needs to complete the functions of the acquisition and processing of analog and switch values, the transmission and reception of serial data, the output and display of control signals, and the monitoring and protection of faults. The software adopts 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.

The application scheme of realizing the single chip system of automobile driving simulator based on AT89C52 single chip microcomputer and sensor
Figure 3 Flowchart of software system program

The main program mainly completes the initialization of the system; the timer interrupt service program mainly completes the watchdog function, which can reset the program in time when an abnormal situation occurs in the single-chip microcomputer to ensure the normal operation of the single-chip microcomputer system; 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 collection of analog and switch values, and obtains the driver’s control data; the signal output and display program transmits the control information of the main control computer to the single-chip microcomputer for use. Controls the display output of indicator lights and meters. Fig. 3 is the program flow chart of the one-chip computer software system of the car driving simulator.

3 Conclusion

The cost of the data acquisition system based on single chip microcomputer is relatively low, and the expansibility of the interface is good. The system can fully meet the interactive and real-time requirements of the car driving simulator, and has been applied in the developed car driving simulator with good results.

The Links:   AT070TN83-V1 G150XTN068 PM100RSE120

Bookmark the permalink.

Comments are closed.