1 Introduction
In the post-PC era of the rapid development of information technology, computers, communications, and consumer electronics are integrated. Although computers and networks have fully penetrated into every corner of daily life, various new embedded access devices have become the current mainstream products. Any ordinary person may have dozens of electronic products with embedded technology, ranging from small digital products such as watches, mobile phones, mp3 players, PDAs, to large smart home appliances, network home appliances, and vehicle-mounted electronic devices. Embedded technology is indispensable. As an important research branch of embedded technology, robotics technology is currently in full swing at home and abroad. Various industrial robots and service robots have begun to be applied to people's production and life. The advantages of using robots have been widely recognized by people and are becoming a part of our daily work and life. This paper uses AT89S52 to design an embedded intelligent tracking robot. Under the control of sensors, motor drives and software, it can intelligently complete the task of detecting maze walking routes. Compared with traditional remote control toy cars, it has certain independence and intelligence, and is a prototype of future intelligent toy cars.
2 System Hardware Architecture and Working Principle
The hardware architecture of the embedded intelligent tracking robot is shown in Figure 1. With the single-chip microcomputer AT89S52 as the core, the periphery consists of a motor drive module, a motor power module, a mainboard power module, a communication module, an obstacle avoidance module, and an online programming module. The infrared photoelectric sensor is connected to the P0.5, P0.6, and P0.7 ports of the AT89S52 through the P8, P9, and P10 interfaces of the mainboard, where P0.5 = 0 means there is an obstacle in front; P0.6 = 0 means there is an obstacle on the left; P0.7 = 0 means there is an obstacle on the right. The left and right motors are connected to the mainboard motor drive module through the P5 interface of the mainboard.
After power-on, the sensor collects the signal from the maze baffle to control the lower five bits of port P0, realizing the forward/reverse rotation of the left and right motors, so that the robot can turn left, turn right, move forward in a straight line, etc., and complete the process of moving from the entrance to the exit in the maze.
3 System Interface Circuit Design
3.1 Microcontroller Module
AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller. It has an 8KB ISP Flash read-only program memory that can be repeatedly erased and written 1000 times. The device is manufactured using high-density, non-volatile storage technology and is compatible with the standard MCS-51 instruction system and 80C51 pin structure. The chip integrates a general-purpose 8-bit central processing unit and ISP Flash storage unit, which can provide cost-effective solutions for many embedded control application systems.
AT89S52 has 40 pins, 8KB Flash program memory, 256B RAM, 32 external bidirectional input/output ports, 5 interrupt priority levels, 2 levels of interrupt nesting, 2 16-bit programmable timers and counters, 2 full-duplex serial communication ports, watchdog (WDT) circuit, on-chip clock oscillator, etc.
A development board is used during the development process to facilitate program debugging and whole machine testing. After the system debugging is completed, the microcontroller is removed from the development board and installed in the microcontroller holder of the robot system board. Since the tasks that the robot in the design needs to complete are relatively simple, only the crystal oscillator and reset circuit are retained in the microcontroller system of the robot system board, and redundant circuits such as the JTAG programming port are cancelled.
3.2 Sensor Module
The working principle of the photoelectric sensor is that the infrared transmitting tube of the sensor emits infrared light, and the receiving tube counts according to the intensity of the reflected infrared light. Therefore, the surface of the detected component or object must have black and white parts to absorb and reflect infrared light, so that the receiving tube can be in the effective cutoff and saturation zone to achieve the purpose of counting. The detection and adjustment circuit of the sensor is shown in Figure 2. R3 in the figure is used to adjust the threshold voltage of the comparator. After observation by the oscilloscope, the output waveform is quite regular and can be directly used for query by the microcontroller. It has been verified that the voltage drop of the battery powering this circuit is small. The infrared photoelectric sensor is connected to the P0.5, P0.6 and P0.7 ports of AT89S52 through the P8, P9 and P10 interfaces of the motherboard. Among them, P0.5 = 0 means there is an obstacle in front; P0.6 = 0 means there is an obstacle on the left; P0.7 = 0 means there is an obstacle on the right.
3.3 DC motor drive circuit and power module
The DC motor is connected to the driver module of the motherboard through the P5 interface of the motherboard. This article uses L298 as the driver chip of the motor. The four pins 5, 7, 10, and 12 of L298 are connected to the microcontroller. By programming the microcontroller, the forward and reverse functions of the two sets of DC motors can be realized. Since the voltage of the microcontroller is about 4.8V, a VFM boost power chip is used to provide a voltage of about 5V for the microcontroller and peripheral circuits. [page]
4 Software Design Module
4.1 Software Development Environment and Search Algorithm
This paper uses Keil U Version2 as the system development environment, and uses a mixture of C language and assembly language in program design. In terms of software algorithms, considering that the time and space efficiency of the depth-first search algorithm is proportional to the complexity of the maze terrain, that is, the more complex the maze, the longer it takes to search for the exit. This paper adopts a maze path search strategy called the left-hand (or right-hand) rule, that is, in the maze, you can find the exit by searching along the left (or right) wall.
Compared with the depth-first search method, the space occupied by the left-hand (or right-hand) rule has nothing to do with the complexity of the maze. The choice of the robot's search path is only related to the current node, and there is no need to backtrack. At the same time, the manufacturing accuracy of the hardware is not high, and there is no need to accurately control the robot's moving distance and direction, which facilitates the drive design. To facilitate the implementation of the algorithm, this article sets the following constraints:
1. In the algorithm, no matter how complex the maze terrain is, it is composed of seven basic terrains: straight line, dead end, T-shaped, cross, corner and end point.
2. According to the number of forks, the fork is divided into a two-way fork and a three-way fork (generally there is no four-way fork), and the forks in front of the fork are called the first fork, the second fork, and the third fork from right to left (only for the cross type). There are three different forms of two-way forks. The first is that a fork appears on the right side of the route (the fork on the right is called the first fork, and the fork in front is called the second fork); the second is that a fork appears on the left side of the route (the fork in front is called the first fork, and the fork on the left is called the second fork); the third is a T-junction (the fork on the right is called the first fork, and the fork on the left is called the second fork). For these three situations, the corresponding program of the algorithm consists of the main program, the straight line subroutine, the left subroutine, the right subroutine, and the correction subroutine. The main program plays the role of guidance and decision-making, deciding what the robot should do and when. The other functions of the robot are realized by calling specific subroutines.
4.2 Algorithm Flowchart Description
The maze search algorithm used in this paper is shown in Figure 3. After the motor and sensor power are turned on, the microcontroller, under the control of the program, determines the forward and reverse rotation of the motor according to the value detected by the sensor. When P0.7=1, it means there is no obstacle on the left. According to the "right hand" traversal algorithm, the robot will call the right rotor program; when P0.7=0 and P0.5=0, the robot will call the left rotor program; otherwise, the robot moves in a straight line, repeatedly detecting and adjusting the robot's movements until the robot walks out of the maze.
5 Conclusion and innovation
This paper discusses the hardware architecture of the embedded intelligent tracking robot based on AT89S52, applies the left-hand (or right-hand) rule to the tracking robot's walking route search, and focuses on the circuit implementation technology of the photoelectric sensor module, DC motor drive module, power supply module, etc. based on AT89S52. After repeated tests, the robot can intelligently complete the tracking task from the entrance to the exit of the maze under the control of software without any external force. The innovation lies in the automatic perception of obstacles through photoelectric sensors, and the use of software to control the robot to turn left/right and walk in a straight line. It is an attempt to detect complex paths, especially suitable for path detection in environments that people cannot reach. The system has low cost, high reliability, and sensitive response. It also has certain reference value for the design and development of intelligent toys.
Previous article:Design of Battery Four Parameters Detection System Based on AT89C52 Control
Next article:Using the parallel port to realize the ISP function of AT89S series microcontroller
Recommended ReadingLatest update time:2024-11-17 01:56
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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Date in spring - go to the beach and relax
- Sub-library: BlueCoin Development Platform
- [Atria AT32WB415 Review] 4. Implementation of printf under AT32 IDE (printf redirection)
- Power amplifier driving capacitive load case sharing
- Power supply zero and live wire detection
- RSL1 Bluetooth characteristic value reading and writing
- Sapphire on PCB---DFM about optical positioning points
- How to choose between different chips in TI's Sub-1GHz product line?
- Design of optimal horn antenna based on HFSS
- How to connect several cameras to a 100M switch