Design of intelligent robot maze car control system

Publisher:innovator8Latest update time:2013-01-23 Source: dzsc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  Robots should have several features: mobile function, execution function, feeling and intelligence. At present, there are more than 20 types of robot competitions involving hardware and software simulation held in various countries around the world. Various robot competitions have a common purpose: to cultivate scientific and innovative spirit, stimulate imagination of thinking, and encourage the combination of theory and practice. In addition, more and more automatic control products have been involved in production and are widely used in agriculture and industry. The new working method will greatly shorten the time of manual work and reduce the expenditure of physical labor. The micro robot mouse walking through the maze is mainly based on the principle of automatic guided vehicle (AGV), which enables the robot mouse to identify the route, judge and automatically avoid obstacles, and choose the correct route to get out of the maze. Here we choose to make a simple traveling device so that it can smoothly avoid obstacles or mazes. In order to realize the recognition of the route by the car, judge and automatically avoid obstacles, and choose the correct route, the obstacle judgment adopts a single-beam reflection sampling infrared sensor, the drive motor adopts a DC motor, and the control core adopts an MCS-51 single-chip microcomputer. The control adopts time-division multiplexing technology, and only one single-chip microcomputer is used to realize functions such as signal acquisition, line judgment, and motor control. The maze consists of 16×16 areas. The starting point is set at the corner and the end point is set in the center, occupying 4 areas. Each area is 180 mm×180 mm in size, with a partition wall height of 50 mm and a thickness of 12 mm. The sides are painted white and the bottom is painted black, as shown in Figure 1.

Overall design plan

  1 Overall design of the maze car control system

  The maze car is composed of wall sensors, a single-chip control board, a power system and a steering system. The control block diagram is shown in Figure 2.

  The maze car uses a wheeled movement method. The advantages are: simple structure and control and mature technology. The speed of the car can be simply calculated by selecting the motor speed and tire diameter. However, the resistance of the road surface or the driving torque uphill becomes an important factor. Considering this, plastic tires of wireless remote control cars are used on the tires. As shown in Figure 3, the front wheel 1 is a universal caster or a ball wheel, and the rear wheel 2 and the rear wheel 3 are independent drive wheels, and the speed difference between them is used to achieve steering. The characteristics of this combination are that the pivot combination is easy, and when the two drive wheels rotate at the same speed and in opposite directions, the body can rotate around the midpoint of the line connecting the two drive wheels. It is worth noting that the center of rotation is inconsistent with the center of the body.

  The choice of materials for the body of the maze car. Most of the materials used in the maze car are used for the structure, and metal materials should generally be used. The maze car should not cause serious deformation and fracture during load and movement, which means it has sufficient strength from a mechanical point of view. The maze car has a small load, light weight, and low requirements for life. Therefore, iron sheets are selected.

  1.1 Design of maze car control circuit

  The control circuit is mainly composed of motor drive circuit, single chip microcomputer interface circuit, power supply circuit and sensor circuit. The control block diagram is shown in Figure 4.

The control block diagram is shown in Figure 4

  (1) The infrared light sensing circuit sensor emits infrared light through a light-emitting diode. If there is an obstacle in front, the infrared light will be reflected back and received by the photosensitive transistor. The microcontroller program compares and processes the signal and sends control commands to the two motors of the rear wheels according to the set action requirements to control the movement of the car.

  (2) The motor drive circuit uses the 89S51 single-chip microcomputer, which controls the movement of the two drive motors through the L293D chip. The 89S51 determines the direction of the maze car according to the signal fed back by the infrared sensor after detecting the outside world, and according to the maze car pathfinding algorithm, it sends control instructions to the left and right drive motors respectively. After being driven by the L293D chip, the signal directly controls the movement of the corresponding motors, so that the maze car moves forward, backward, and turns according to the predetermined action. [page]

1.2 Maze car control program design

  Control algorithm:

  There are generally four control algorithms for maze cars:

  (1) Left Algorithm

  ① The default left-hand walking method is to walk along the left wall all the time. When there is a wall on the left, keep moving along the left wall. When there is no wall on the left, turn left and continue to move along the left wall. This algorithm is used for the simplest maze walking method. As shown in Figure 5, the dotted line represents the route of the car.

Left Algorithm

  ②The algorithm flow chart is shown in Figure 6.

The algorithm flow chart is shown in Figure 6

  ③ Disadvantages of the left-leaning algorithm. According to this algorithm, the car can get out of the maze in one go when it walks through the maze for the second time, but this path is not necessarily the shortest path; if there is an "island" in the maze itself, the car is likely to not get out of the maze. As shown in Figure 7. The two dots in Figure 7 represent the entrance and exit respectively. If the car enters the maze from the entrance and moves forward to the left, it will cause the car to keep circulating in the maze along the route drawn by the dotted line, and will eventually not get out of the maze.

Disadvantages of the Left Algorithm

  (2) Front Algorithm

  ① The forward algorithm is to keep moving forward along the road ahead (keep moving forward when there is no obstacle ahead). If there is no wall ahead, turn left. If there is no wall on the left, turn left. If there is a wall on the left, turn right. Then repeat the cycle. This algorithm is used for the simplest maze walking method.

  ②The algorithm flow chart is shown in Figure 8.

Front Algorithm

  ③ Program idea: If there is no wall in front, go forward. If there is a wall in front, judge the left side. If there is no wall on the left, turn left. If there are walls in front of the left and right, judge the right side. If there is no wall on the right, turn right. If there are walls on three sides, turn back 180° and continue to go forward. 0 means there is a wall, 1 means there is no wall, p3.0 ​​means the left sensor; p3.1 means the front sensor; p3.2 means the right sensor.

  The idea of ​​turning angle control is to calculate the rotation speed of the wheels, measure the distance traveled by each wheel when the car turns 90°, divide the speed by the distance, and calculate a time as the delay time when the car turns, and then further refine the turning angle through debugging.

[page]

(3) Flooding algorithm

  The flooding algorithm uses 256 B of additional memory, which greatly improves performance. This algorithm is 20 to 50 times more efficient than the general maze algorithm. At the same time, an area can be established in the memory, which corresponds to the number of maze cells in the actual maze. The algorithm is not too complicated in actual use. The additional memory area is called the "wave head", which will be reflected in the actual situation of the memory area as shown in Figure 9. When the maze is flooded, the front of a wave expands outward from the target cell. This cell in the memory area is the only one that needs to be processed. When the wave head reaches the starting cell, the robot has been flooded. Generally speaking, the starting cell can be any cell. However, for convenience, the starting point is set at the first cell of the maze, and the end point is arbitrary. Conversely, the exit can be placed in the first cell and the starting point can be set in the middle or the desired position. Once the starting point is reached, the search is completed. The shortest path allows the robot mouse to move to the cell with a smaller value among the surrounding cells, and so on. The robot mouse can reach the end point.

Flooding Algorithm

  Advantages and disadvantages of flooding algorithm:

  ① According to this algorithm, when the car walks through the maze for the first time, it must walk through all the roads in the maze. However, this algorithm allows the car to walk through any maze, even if the maze itself has "isolated islands" and the car can still walk out of the maze smoothly.

  ② When the car goes through the maze for the second time, it can take the correct route out of the maze once and for all, and this route must be the shortest route.

  (4) Paving algorithm

  Create an area in memory that corresponds to the actual number of maze grids, and memorize all the paths you have walked. If you find a dead end ahead or a path you have walked, turn back to the previous fork in the road; when you encounter a fork in the road during walking, keep left by default. Because of the memory function, you can walk a second time.

  Advantages and disadvantages of the paving algorithm:

  ① This algorithm can be used to walk through complex mazes without the problem of being unable to get out.

  ② Using this algorithm, the car can get out of the maze in one go when it goes through the maze for the second time, but it cannot guarantee that this road is the shortest route.

  These algorithms have their own advantages and disadvantages. After weighing and comparing, the top algorithm was finally selected.

  1.3 System operation and debugging

  Problems encountered during program operation and their solutions:

  (1) The shell and wheels of the car are installed purely by hand, and the precision is not very high. The car cannot always go straight during driving, and it is easy to cause a wall collision accident, which affects the car's maze. If it is caused by hand-made, it can be solved by wrapping some tape around the wheel that lags behind during driving to increase the circumference of the wheel. It can also be solved by adding an A/D converter to the circuit, making relative improvements to the program, and constantly measuring the distance between the car and the surrounding walls to keep the car at a certain distance from the surrounding walls.

  (2) The ST188 infrared sensor is susceptible to external interference and cannot accurately detect wall signals, especially under strong light. It cannot receive light reflected by certain materials and is easily interfered by sunlight, resulting in the car being unable to get out of the maze correctly. The reason for the interference is that the infrared rays emitted by sunlight are the same as those emitted by the infrared sensor. They are both continuous and cannot be distinguished, so they are easily interfered by surrounding light. The solution to this problem is to use the basic principle of wireless remote control to make the infrared emitted by the infrared sensor a signal with a fixed frequency that is different from the surrounding infrared. The receiver is also processed by circuit processing to enable it to directly receive infrared signals with a fixed frequency. Both improvements are achieved by improving the circuit. If it is caused by a reflective surface, it can be solved by limiting the material of the reflective surface. According to the principle of the 555 timer, the improved sensor circuit is shown in Figure 10. Its working principle is that the 555 circuit emits a square wave with a frequency of 100 Hz, driving the light-emitting diode at the radiation end of ST188 to flash at a frequency of 100 Hz, emitting flashing light waves. When an obstacle approaches, the reflected light causes the photoresistor at the receiving end of ST188 to change at the same frequency, causing the voltage value VA at point A in Figure 10 to change accordingly. VA contains a DC component V and an AC component V with a frequency of 100 Hz, the latter of which reflects the approach of the obstacle. In order to retain the useful AC signal V and remove the DC component V, the DC isolation capacitor C1 is used to complete the function of isolating DC and passing AC, and the first operational amplifier circuit completes the amplification of V, and the second operational amplifier realizes the conversion from DC to AC. Specifically, when far away from the obstacle, the output VO of the operational amplifier is high; when the sensor approaches the obstacle, VO outputs a low level.

The improved sensor circuit is shown in Figure 10

  (3) The speed of the car is difficult to control. It is difficult to grasp the rotation time of the car through program control. When the car turns 90° and 180°, it often turns beyond the specified angle, which affects the car's inability to walk out of the maze in a straight line. One solution is to connect a voltage regulating circuit, and adjust the voltage on the motor to change the wheel speed when the car has a certain turning time, and practice continuously until the predetermined standard is reached. Another solution is to keep the car's speed constant and constantly change the car's turning angle by changing the car's turning angle time in the program, and practice repeatedly to achieve the predetermined goal. Through actual debugging, it was found that these two methods are difficult to achieve the predetermined goal when used alone. Therefore, combining the two methods and debugging can easily achieve the goal.

  2 Conclusion

  The robot maze car is a common electronic production project for college students. It is a comprehensive application of various knowledge such as electronic circuits, mechanical transmission and automatic control. The steering control of the car involves motor speed regulation. You can first build a control model for the car, and then apply the knowledge of automatic control principles to give a specific control algorithm, so that the steering control and path selection of the car can be more accurate.

Reference address:Design of intelligent robot maze car control system

Previous article:Design and implementation of large program and data space based on single chip microcomputer
Next article:Design of dynamic digital display circuit based on single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号