1 Introduction
With the development of informatization, intelligence and networking, embedded system technology has gained a broad space for development. The field of industrial control is also undergoing a huge transformation. Real-time embedded software and hardware technology based on 32-bit high-end processors will be applied in every corner of industrial control. Embedded controllers have many advantages such as small size, high reliability, powerful functions, flexibility and convenience. Their application has penetrated into various fields such as industry, agriculture, education, national defense, scientific research and daily life, playing an extremely important role in promoting technological transformation, product upgrading, accelerating the automation process and improving productivity in various industries [1].
Nowadays, although some vehicles at home and abroad are equipped with ultrasonic reversing anti-collision alarm devices, DSP-based intelligent vehicle anti-collision systems, and image processing technology-based car rear-end collision warning systems, there is no obstacle monitoring and warning system for construction machinery such as loaders, which are widely used in urban construction, mining, highways and other projects. Therefore, establishing a system to monitor and warn of obstacles and provide danger signals to drivers in advance so that drivers can take effective measures in time is an effective way to reduce accidents [2-5].
2 System Hardware Design
This system takes the loader as the research object, and aims to realize signal acquisition, conditioning, transmission, display and early warning. The system is divided into four parts: obstacle distance signal acquisition module, LCD display module, sound and light alarm module and processor module. The processor is the core, and the signal input and output are connected through the bus and interface circuit. The system block diagram is shown in Figure 1.
Figure 1 System composition block diagram
The Mini ARM module integrates a C2290 microcontroller minimum system, a USB host controller, a 10M Ethernet communication controller, and a NAND FLASH electronic disk. Its hardware resources mainly include: 2M NOR FLASH, 16K SRAM, 2M/8M Bytes PSRAM, 10M Ethernet interface, 2-way USB-Host controller, integrated electronic disk, 2-way CAN controller, and RTC [6].
The LCD display module uses a liquid crystal display module with a built-in T6963C, on which the interface between the T6963C and the row and column drivers and the display buffer RAM has been implemented.
2.1 Design of obstacle distance detection circuit
There are many methods for detecting obstacles, such as ultrasonic ranging, image processing, laser ranging, etc. However, since ultrasonic sensors have the advantages of simple information processing, low price, and easy production, this system uses ultrasonic ranging to detect the distance of obstacles.
(1) Principle of ultrasonic ranging
The ultrasonic transmitter emits ultrasonic waves in a certain direction and starts timing at the moment of emission. The ultrasonic waves propagate in the air and immediately return when they encounter an obstacle. The ultrasonic receiver stops timing as soon as it receives the reflected wave. The propagation speed of ultrasonic waves in the air is c. Based on the time t recorded by the timer, the distance s from the emission point to the obstacle can be calculated [7], that is, s = ct/2 (1).
(2) Ultrasonic ranging circuit
In this system, the ultrasonic distance measurement circuit is designed by MICROCHIP's PIC16C57, and the ultrasonic sensor selected is the T/R40-16 piezoelectric ceramic sensor. During operation, the main controller PIC16C57 sends a signal to make the ultrasonic transducer at the transmitting end send out voltage excitation. After being excited, it emits ultrasonic waves in the form of pulses. When the ultrasonic receiver receives the echo signal, it is transmitted back to the main controller. The timer in the main controller starts timing when the pulse signal starts to be emitted, and stops timing when the echo signal is received. The time interval multiplied by the speed of sound is twice the distance value. Thus, the distance from the obstacle to the transmitting point is calculated. Its circuit diagram is shown in Figure 2.
Figure 2 Ultrasonic distance measurement circuit diagram
The distance value is serially output through pin 10 of PIC16C57 and connected to the serial port of ARM after passing through the MAX232 chip. The MAX232 chip is an interface circuit designed for the RS232 standard serial port, which completes the conversion between TTL level and RS232 level[8].
2.2 Sound and light alarm circuit design
This system requires a three-level alarm for dangerous conditions based on the critical value of the distance to obstacles that affect the stability of the loader. When in a low-risk situation, only the green indicator light is lit to remind the driver to pay attention; when the danger level increases, the yellow indicator light is lit, accompanied by a soothing buzzer, reminding the driver to take measures; when the highest danger level is reached, the red indicator light is lit, and the buzzer sound changes from soothing to urgent, reminding the driver to brake quickly.
In the design, P2.20 (GPIOA4) of LPC2290 is used to drive the green LED, P2.21 (GPIOA5) to drive the yellow LED, P2.22 (GPIOA6) to drive the red LED, and P2.23 (GPIOA7) to drive the buzzer. The designed alarm circuit is shown in Figure 3.
Figure 3 Alarm circuit diagram
3 System Software Design
Commonly used embedded operating systems include VxWorks, Windows CE, embedded Linux and μC/OS-Ⅱ. Since the μC/OS-Ⅱ embedded system has open source code and a real-time multi-tasking kernel for multi-tasking scheduling [9], this system uses the μC/OS-Ⅱ embedded operating system.
Due to the use of modular programming, the division of system tasks under μC/OS-II is also based on different functional modules. Each module is decomposed into one or more tasks, and each task is assigned a priority. In this way, once these tasks are established, the scheduling between them is completely completed by μC/OS-II. Combined with the design requirements of this system, serial communication tasks, alarm tasks, and LCD display tasks are created in the program. Its software flow chart is shown in Figure 4.
Figure 4 Software flow chart
After power-on, the hardware is initialized first, then the μC/OS-II operating system is initialized, tasks are established, and multi-task scheduling is performed. The task scheduling of μC/OS-II is preemptive, so when setting the task priority, the real-time requirements of the task should be considered as much as possible. Even if the importance of two tasks is the same, they must have a difference in priority, which means that the high-priority task must enter a waiting or suspended state after processing, otherwise the low-priority task will never be executed. In this system, the priority of the serial communication task is set higher than the LCD display task, and the priority of the LCD display task is higher than the alarm task.
1. The serial communication task completes the data transmission between the ultrasonic ranging part and the ARM processor. The serial communication part mainly includes two parts: user interface function and task function. The serial port has 5 user interface functions, namely deopen(), dclose(), dread(), dwrite() and diocontrol().
The following is part of the program code for the communication between the ultrasonic ranging device and LPC2290:
diocontrol(Uart0_Handles,UART0_SET_MODE, (void *)&Mode0); // Set the UART mode
diocontrol(Uart0_Handles,UART0_SET_TIMEROUT,(void *)5); // Set the receive timeout factor, if parameter = 0, the timeout is turned off
diocontrol(Uart0_Handles, UART0_CLR_FIFO, (void *)0); // Clear the receive soft FIFO
while (1)
{Rece_Count=dread(Uart0_Handles, UART_Rece
_Buff,1); // Read the first start byte sent by the ultrasonic wave and put it into the buffer
if((Rece_Count>0)&&(UART_Rece_Buff[0]==
'
@')) // If the read is successful and the first byte is '@'
{dread(Uart0_Handles,&UART_Rece_Buff[1],3); //Receive the last three bytes, which are hundreds, tens and ones respectivelyfor
(i=1;i<4;i++)
UART_Rece_Buff[i]=UART_Rece_Buff[i]+48; //Convert the hexadecimal number to ASCII code valuefor
(i=0;i<3;i++)
sbuff[i]=UART_Rece_Buff[i+1]; //The received data is cached in the array for the LCD display part to call
}
}
2. The LCD display task is mainly to display the data transmitted by the ultrasonic wave in the ARM processor on the LCD screen, so that the driver can see the distance value of the obstacle in real time.
Part of the program code that displays text is as follows:
{ uint32 addr;
uint8 i;
for (i=0;i<24;i++)
/* find out the target address*/
{ addr = (y+i)*(GUI_LCM_XMAX>>3) + (x>>3);
LCD_WriteTCommand3(LCD_ADR_POS, addr&0xFF, addr>>8); // set address pointer
/* output data*/
LCD_WriteTCommand2(LCD_INC_WR, *Buff);
Buff++;
LCD_WriteTCommand2(LCD_INC_WR, *
Buff);
Buff
++; LCD_WriteTCommand2(LCD_INC_WR,
*Buff);
Buff++;
LCD_WriteTCommand2(LCD_NOC_WR,*Buff);
Buff++; }
LCD_WriteTCommand3(LCD_ADR_POS, 0x00, 0x00);
// Reset address pointer
}
3. The alarm task is mainly to compare the distance value of the obstacle with the critical value under different alarm conditions through the ARM processor, and complete the corresponding alarm display.
4 Debugging and Results
The system debugging uses the ADS integrated development environment and the EasyJTAG-H emulator. After the program is written and the JTAG interface of the EasyJTAG-H emulator is connected to the MiniARM product, the debugging software can be used to download the program to the ARM board for testing.
Each time the ultrasonic wave detects, the serial port outputs a set of data. The baud rate of data transmission is 9600, including a start bit and three data bits. The results show that the microprocessor does not respond to data frames that do not conform to the set format, does not receive the data sent, and only processes the data that meets the requirements.
The debugging results show that the data of ultrasonic detection can be accurately displayed on the LCD screen in a timely manner, with high communication stability. At the same time, it can accurately display the corresponding alarm phenomena for various dangerous situations.
For the accuracy analysis of this system, we compared the measured values of the ultrasonic sensor with the actual values and plotted them in Table 1.
Table 1 Comparison table of obstacle distance measurement and actual value
When the obstacle distance is greater than 10m, it is found that the ultrasonic sensor measurement data is seriously distorted. After analysis and experiments, it is found that the maximum value of obstacle distance detection by this system is 9.99m. At the same time, from the data in Table 1, it can be seen through analysis and calculation that the measurement error is ≤0.01m.
5 Conclusion
The designed monitoring and early warning system for the obstacle distance of the loader is based on Mini ARM as the processor, considering the working site of the loader and the distance signal that needs to be monitored. Through experimental verification, the system has completed the required functional requirements, with the maximum measurement value of 9.99m and an error of ≤0.01m. It is very convenient to install and easy to use. However, there is a shortcoming of the system, that is, when using ultrasonic sensors to detect road information in front of the vehicle, if it is a raised obstacle, it can be effectively detected, but if it is a pit in front, it cannot be detected, so further research is needed.
Previous article:Design and implementation of intelligent parking lot vehicle detection system
Next article:Camera Smart Car Hardware Design Solution
Recommended ReadingLatest update time:2024-11-16 20:58
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
- CES 2021 Complement Event Activity Recognition on IMU with Machine Learning Core
- Free shape LED ball
- Internet of Things vs Industrial Internet of Things: 10 Differences That Matter
- The stm32f030c8t6 chip crashes as long as it fetches data during an interrupt
- 【Arduino】168 sensor module series experiments (219) --- INMP441 omnidirectional microphone
- Technology Live: LPC55S69, designed to prevent hackers, helps you build secure edge nodes at low cost (share and win 20E coins)
- The upcoming nrf52840 metro express development board
- Electronic Instrumentation and Electrical Measurement
- Analysis of EMI radiation signal strength
- Research on the Development of Radio Frequency Filter Materials Industry