Design and implementation of real-time monitoring system for motion status of intelligent vehicles

Publisher:机械梦想家Latest update time:2011-05-16 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

System functions and applications

This system mainly completes the various status information of the smart car during driving (such as sensor on and off, vehicle speed, servo angle, battery power, etc.) in real time through wireless serial communication to the host computer for processing, and draws the curve of each part of the state value with respect to time. With these curves, it is not difficult to see the state of the smart car at various positions on the track, and the advantages and disadvantages of various control parameters will be clear at a glance. What is particularly important is the selection of motor control PID parameters. The differences between each set of PID parameters can be easily found through the speed-time curve. For teams using CCD sensors, the system becomes the eyes of the debugger, who can see what the smart car sees, which is believed to be of great help in writing line-following algorithms. Moreover, these data can be further processed, such as obtaining the first-order derivative, to obtain more information. Hardware and software design of the system

The design plan is mainly divided into three parts: vehicle-mounted data acquisition system, wireless data transmission system, and host computer data processing system.

Vehicle Data Acquisition System

The vehicle data acquisition system is mainly responsible for collecting information such as the speed, sensor status, battery voltage, steering gear angle, etc. during the driving process of the racing car by the single-chip microcomputer. In order to make the monitoring system not occupy the internal resources of the S12 single-chip microcomputer and support hot plugging, we separate the monitoring system from the intelligent vehicle control system except for the power supply. We choose the ATMEGA16 single-chip microcomputer of ATMEL as the processor of the data acquisition system. The binary photoelectric sensor signal is directly collected using the I/O port of the single-chip microcomputer, the continuous photoelectric sensor, battery voltage and CCD camera signal are collected using the A/D port of the single-chip microcomputer, and the speed information is collected through the photoelectric encoder and the counter of the single-chip microcomputer. The collected data is sent to the host computer every 20ms.

Wireless data transmission system

The lower computer transmits a set of data including the photoelectric encoder value (speed), battery voltage (battery), servo angle value (angle), and current state of the sensor (sensor) to the upper computer every 20ms. Under ideal conditions, the upper computer should receive periodic data of the above values. At this time, the upper computer only needs to load these data into their respective arrays in order and draw the graph. However, data loss may occur during the actual wireless transmission process. Therefore, it is necessary to add appropriate data verification, otherwise data loading errors will occur, causing confusion in drawing. In the actual process, we add a frame header of 0x00, 0xff to each set of data. When an error occurs in the data, the frame data is discarded.

The wireless data transmission and reception part adopts SUNRAY's QC96 wireless transceiver module, which can transmit and receive serial data with a baud rate of 9600bps and a distance of up to 100m.

Data reception and processing by the host computer

The host computer is mainly composed of four modules:

Data receiving module

Function: The upper computer collects the original data sent by the lower computer through the serial port.

Implementation: There are generally two ways to implement serial communication in VC++, namely MSComm control and Windows API function. MSComm is simple and easy to use, suitable for relatively simple systems, while Windows API function is widely used but relatively complex and cumbersome. Since the serial communication function of this module is relatively simple, this system adopts the former. In the actual process, the event-driven method is used, which has timely response, high reliability, and takes up less resources than the query method.

Storage module

Function: The collected raw data can be directly stored for further analysis and processing.

Implementation: After each OnComm event is triggered, the data received by the serial port is directly stored in the temp temporary file, and the value in the temp temporary file can be stored in the specified file at the user's request.

Data analysis and processing module

Function: Perform user-selected analysis and processing on the collected raw data, mainly including discarding erroneous data, removing frame headers and loading data. It can also analyze and process the saved data.

Implementation: Read and load the data of the temp file or the user-specified file. The following is the main program code:



Graphics display module

Function: Use a graphical interface to display the processed data so as to observe the operating status of the smart car more intuitively.


Implementation: Draw the data loaded into each array in the previous module in the mode selected by the user. You can view only one picture or put four pictures together for comparison. The actual operation interface and effect are shown in Figure 2.



Conclusion

By adding a wireless transceiver module, the system transmits the real-time status information of the smart car to the upper computer, and displays it intuitively and vividly with images through VC++ programming, which achieves the purpose of real-time monitoring of the smart car status. It greatly facilitates our adjustment of PID and other smart car parameters and provides great help in the research of track memory algorithm.

Reference address:Design and implementation of real-time monitoring system for motion status of intelligent vehicles

Previous article:Research and implementation of remote monitoring system for intelligent greenhouse
Next article:Design of AT056TN04 LCD screen driver controller

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号