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.
Previous article:Research and implementation of remote monitoring system for intelligent greenhouse
Next article:Design of AT056TN04 LCD screen driver controller
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [AT-START-F403A Review] IV. "EEPROM" Test
- Analysis of the Difficulty of Question G in the 2019 National Competition
- Is there any book specifically about op amp time domain?
- Why does it prompt me that the download frequency is too high? Please try again later.
- [Shanghai Hangxin ACM32F070 development board + touch function evaluation board] 05. How to configure the CAN communication baud rate
- How to start power supply design
- When learning high-speed circuit design, you must know these things!
- June 4 live broadcast review: TI wireless training live broadcast (including video, PPT)
- What is the difference between TI's DSP2812 and 28335?
- Ended -- Microchip Live Broadcast [Implementing MultiZone Security in RISC-V Applications]