1 Introduction
The continuous improvement of the technical level of vehicle-mounted electronic equipment has become one of the important signs of the development of modern automobiles, and vehicle-mounted navigation equipment is an important part of it. It should display the data communication system, audio and video entertainment system, positioning system, and electronic control system in real time, so that users can get sufficient driving information. The vehicle-mounted navigation system, which takes ARM and embedded operating system as the technical core and provides the vehicle driver with the necessary road conditions and geographic information for safe driving, is currently being used more and more widely around the world, greatly improving the user's driving experience and the safety of vehicle operation.
However, most of the in-vehicle navigation systems on the market currently use WinCE as the operating system. Not only is the software expensive to use, but it also has high hardware requirements and runs slowly. This paper proposes and designs an in-vehicle navigation system based on GPS and GPRS, using an embedded 32-bit processor and embedded Linux. The system uses S3C2440A: 32-bit ARM920T core processor, external expansion GPS receiver module and GPRS communication module, and the display part uses SAMSUNG 4.3-inch 480×272 resolution widescreen TFT true color LCD. The bottom layer uses an embedded Linux operating system, which has the advantages of open source, easy transplantation, modularization, and rich resources. The graphical user interface (GUI) is developed using Qt/Embedded software. This paper focuses on the reception and transmission of GPS and GPRS data, the overall architecture of embedded Linux, and the application of multi-threading technology in Qt.
2 System Overall Structure and Software Development Platform
The overall structure of the system is shown in Figure 1. This system uses SAMSUNG's S3C2440A embedded processor with a nominal operating frequency of 400MHz; the CPU has a built-in STN/CSTN/TFT LCD controller that supports various LCDs with a resolution of 1024ⅹ768 or less; Ethernet controller; 1-channel 5-wire serial port, 2-channel 3-wire serial port, CAN interface, SPI interface, RTC real-time clock, etc.; an external GPS receiver and GPRS module are connected via RS232; the system has an external 64NB SDRAM for operating system memory space, storing dynamic data and running programs; the system has an external 64MB Flash space for storing the Linux kernel, file system, application programs and user data.
Figure 1 System structure
The system software is based on the embedded Linux operating system, and Qt/Embedded is selected as the graphical user interface (GUI) development environment. Qt is a cross-platform application framework launched by Trolltech. Qt/Embedded is the version of Qt for embedded applications. Write once and compile anywhere. Qt's unique signal/slot mechanism enhances the flexibility of communication between objects; the size of the library file can be adjusted by cutting out irrelevant modules, which is suitable for embedded systems; QT supports OpenGL interface and vector graphics format SVG. It can fully meet the drawing needs of the navigation system. The system obtains the vehicle position (including latitude and longitude and time, etc.) and operation information (including speed and direction, etc.) from the GPS in real time, and displays the relevant navigation information on the electronic map. Users can operate through the touch screen to provide map roaming, map query and road information management functions. [page]
3. GPS/GPRS system composition principle and structure
(1) Basic principles of GPS positioning
The positioning principle of GPS is essentially the spatial ranging positioning of surveying. It uses 24 satellites evenly distributed in 6 orbits at an average altitude of 20,200 km to transmit ranging signal codes and carriers. Users receive these signals through receivers to measure the distance from the satellite to the receiver. Through a series of equations, the ground positioning coordinates can be obtained. The distance from the satellite measured by the user is called "pseudo-range", which is not the real distance from the user to the satellite. It also includes the deviation of the satellite clock, the deviation signal of the user clock, the ranging error caused by propagation delay, etc. Therefore, after receiving at least three satellites, the plane coordinate (latitude and longitude) value can be calculated, and the equation value can be calculated after receiving four satellites. This is the basic positioning principle of GPS.
Figure 2 GPS positioning principle diagram
The meaning of each parameter in the program is as follows:
x, y, z are the spatial rectangular coordinates of the coordinates of the point to be measured. xi, yi, zi (i=1, 2, 3, 4) are the spatial rectangular coordinates of the four satellites at time t, which can be obtained from the satellite navigation message. Vti (i=1, 2, 3, 4) are the clock errors of the satellite clocks of the four satellites, provided by the satellite ephemeris. Vt0 is the clock error of the receiver. The above equations can be used to solve the coordinates x, y, z of the point to be measured and the clock error Vt0 of the receiver.
(2) GPRS network structure and transmission principle
GPRS adds two nodes to the original GSM network: SGSN (Serving GPRS Support Node) and GGSN (Gateway GPRS Support Node). The main function of SGSN is to record the current location information of the vehicle and complete the sending and receiving of mobile packet data between the vehicle and GGSN. GGSN mainly acts as a gateway, which can be connected to many different data networks. GGSN provides an interface between the GPRS network and the Internet, while SGSN is responsible for contacting the mobile terminal and GGSN. Therefore, a complete GPRS communication process is that the data sent by the vehicle terminal is first transmitted to the BSS (Base Station System), then transmitted to the GGSN via the GPRS network, accessed to the Internet through the GGSN, and transmitted to the host computer on the Internet by relying on the TCP protocol. The process of terminal receiving data is the opposite. GPRS data transmission and reception uses the TCP/IP protocol at the network layer.
4. Design and Implementation of System Software
(1) System software structure
It is mainly composed of the following modules: user interface display module, GPRS communication module, GPS positioning module, map matching module, path planning module, electronic map module, underlying communication module, etc.
Figure 3 Overall block diagram of system software structure
User interface display module: a platform for users to interact with the vehicle navigation system, which plays a role in information exchange by calling other modules; GPRS communication module: transmits user driving information and vehicle condition information to the remote monitoring terminal in real time, which not only plays a role in recording vehicle conditions, but also can prevent theft; GPS positioning module: receives satellite positioning data in real time, including latitude and longitude, time, altitude, instant speed, etc.; map matching module: matches the data obtained from GPS positioning with the map information stored in the system to obtain geographic information around the vehicle and provide a reference for users; route planning module: the user enters the starting coordinates and the end coordinates, and the system automatically calculates the nearest road, thereby playing a role in vehicle navigation; bottom-level communication module: obtains various vehicle information through the CAN bus and 232 bus, and then displays it on the user display interface. [page]
(2) Linux porting on S3C2440
Embedded Linux manages the hardware devices of the entire navigation system and schedules all programs. It is the core of the software system. Since Linux is an operating system for PCs, it needs to be transplanted when used in the embedded field. It generally includes the transplantation of the boot loader code (Bootloader), kernel transplantation, driver writing, file system construction, etc. Compile the U-boot source code in the ADS environment, burn the successfully compiled binary code to the Flash of the development board, and then start it when powered on. The bootloader first completes the initialization of the hardware device, then sets the startup parameters of the Linux kernel, and finally calls the Liuux kernel to jump directly to the first instruction of the Linux kernel. From the Linux perspective, devices can be divided into three basic device types: character devices, block devices, or network devices. The device driver for the in-vehicle navigation system consists of the following three parts:
(1) Automatic configuration and initialization subroutine. The initialization subroutine runs first and is responsible for detecting whether the hardware device exists and whether it can run normally;
(2) Interrupt service subroutine. The embedded Liuux system receives the hardware interrupt and then calls the interrupt service subroutine through the system;
(3) A subroutine that serves I/O requests. It accesses I/O devices. It compiles the written device driver into the kernel and starts it together with the kernel when the system starts.
The file system forms the basis of all data on the Linux system. After comparison, the system design decided to use the Cramfs file system. When accessing files, the Cramfs file system automatically decompresses the files to be accessed into RAM, and will reserve RAM space for the actual executed application as much as possible, and can spare extra CPU cycles for runtime decompression. Use the mkcramfs command to generate a cramfs image file, and then download it to the system. When Linux starts, it automatically loads the root file system to complete the system startup.
(3) Application of multithreading technology in Qt
In a Qt application with a graphical user interface, the main thread is the GUI thread, which also has one or more non-GUI threads as worker threads to handle other time-consuming operations, such as constantly updated vehicle direction, speed, map matching, etc. In this way, the application can ensure the responsiveness of the graphical user interface even under heavy load. Relying on the multi-threading technology provided by Qt, multi-data interaction in the navigation system is possible. After calling the exec() function, the GUI thread either waits for an event or processes an event. Each thread can have its own event loop, as shown in Figure 4. The starting thread starts the event loop through QcoreApplication::exec(), and other non-GUI threads start their own event loops through Qthread::exec().
Figure 4 Qt thread event model
5 Conclusion
The author's innovations:
(1) Using the embedded Liux operating system for the in-vehicle navigation system is a major improvement over the traditional vehicle navigation system, which greatly reduces the cost. At the same time, the multi-threading technology of the Linux system can solve the problem of parallel processing of multiple tasks in the system, ensure the stability and reliability of the system, and improve the system's operating speed.
(2) The display system uses Qt/Embeded software for user display interface design. It can be written once and compiled anywhere, making it easy to port to various platforms. It only needs to be recompiled. Using the open source version saves a lot of software licensing fees. These are unmatched by traditional WinCE programs.
(3) Currently, this system has been installed in the vehicle for trial operation. Practice has proved that this system can display the current operating status of the vehicle in real time, respond quickly to user operations, and provide the driver with good navigation information.
Previous article:Design of vehicle-mounted supercapacitor test system based on single chip microcomputer
Next article:Application of MSP430 and GPS99808 module in automobile anti-theft system
Recommended ReadingLatest update time:2024-11-16 19:43
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- [Full cash back for orders, capped at 300 yuan] MPS Mall Power Design Products Recommendation, Huge Discount Experience Season!
- Crazy Shell AI open source drone GPIO (remote control indicator light control)
- Where can I get an evaluation board for Toshiba's rice-sized Bluetooth module?
- 16. Low-power intelligent TWS in-ear detection chip VK233DS, Shenzhen Yongjia Microelectronics is the first choice
- [Atria AT32WB415 Series Bluetooth BLE 5.0 MCU] PWM breathing light
- 30V8A stepper motor driver, step angle 1.8 degrees, required accuracy 0.1 degrees, should I choose chip or H bridge
- Can the 66AK2L06 SoC enable miniaturization of test and measurement equipment?
- Circuit diagram of leakage alarm automatic control socket
- How to detect mosquitoes using ultrasonic sensor circuit
- 2021 National College Student Electronics Competition Released