Design and implementation of robot based on MCU an

2022-10-22
  • Detail

Design and implementation of robots based on single chip computers and sensors

domestic power batteries continue to grow this year

robot technology is a combination of machinery, electronics, sensors, computers, artificial intelligence and many other disciplines, involving many cutting-edge technologies today. Some developed countries have taken robot making competitions as a strategic means of innovative education. For example, Japan holds various types of robot making competitions every year, such as the NHK Cup Undergraduate robot competition, the all Japan robot sumo conference, and the robot football match. The participants are mostly students, aiming to comprehensively cultivate students' hands-on ability, creativity, cooperation ability and enterprising spirit through the competition, and also popularize the knowledge of intelligent robots [1]

carrying out robot production activities is one of the best practical activities to cultivate college students' innovative spirit and practical ability, especially the best platform for electromechanical students to carry out comprehensive knowledge training. Aiming at the hot issue of path tracking in the environment with guide line, based on the principle of single chip microcomputer control and sensor, a robot is made through hardware circuit making and software programming, which realizes the function of path tracking and automatic deviation correction of the robot, and can detect metal and display the distance in real time

2 functions to be completed by the robot

select a smooth floor or wood board, lay white paper on it, and draw any black lines on the white paper (the lines should not be crossed) as the trajectory of the robot, which has introduced a variety of mature technologies into the market to guide the robot to walk independently. Several thin iron sheets with a thickness of 0.5 ~ 1.0mm are randomly buried under the paper along the black line track. The robot walks along the track for a week, detects the iron sheet buried under the paper, sends an audible and visual alarm, and displays the position of the iron sheet from the starting point

3 hardware design scheme

overall composition of the robot

Figure 1 overall composition of the robot

as shown in Figure 1, with the microprocessor as the core, it receives external information from sensors, processes it, and controls the operation of the robot

the power supply part of the system

because the robot motor, sensor and system CPU are powered by +5v, considering the power of the electric vehicle, on-board mass and friction resistance, we use the dry battery pack of the electric vehicle, which has small power consumption, small volume, light weight and convenient installation

motor drive and PWM speed regulation part

the robot needs to be controlled to drive at a suitable speed. The speed is too fast. Because the single chip microcomputer has a response and processing time to the signals sent by each sensor, the car is very easy to deviate from the track. The speed of the trolley is controlled by the speed of the DC motor of the rear wheel. Changing the speed of the DC motor is usually achieved by voltage regulation, magnetic regulation and other methods. Among them, the principle of voltage regulation is simple and easy to realize

adopt H-type PWM modulation circuit composed of transistors. Through the PWM modulation circuit shown in Figure 2, the transistor is controlled by a single chip microcomputer to work in the state of adjustable duty cycle to realize speed regulation

Figure 2 motor drive circuit

make P1.7 port of single chip microcomputer low level and P1.6 port high level. At this time, Q1 and Q4 are on, Q2 and Q3 are off, and the motor works normally. Changing the high-level cycle of P1.6 port, that is, changing the duty cycle of PWM modulation pulse, can realize accurate speed regulation. The pulse frequency has an effect on the motor speed. The pulse frequency is high and the continuity is good, but the load capacity is poor; If the pulse frequency is low, the opposite is true [2]. The experiment found that when the pulse frequency is above 30Hz, the motor rotates smoothly, but when the car is running, the motor speed decreases quickly due to friction, or even stops rotating; When the pulse frequency is below 10Hz, the motor rotates with jumping phenomenon. The experiment shows that the effect is the best when the pulse frequency is 25 ~ 35Hz. We choose the pulse frequency as 30Hz

guide line detection module

according to the different reflection coefficients of white paper and black line, the two colors of the road surface are distinguished through the photoelectric detection circuit with photoelectric sensor as the core, which is converted into different level signals, which are sent to the single chip microcomputer, and the single chip microcomputer controls the steering motor to make the corresponding steering, so as to ensure that the car travels along the guide line. Considering the relative position between the car and the road, reflective photoelectric detection circuit is adopted

infrared photoelectric sensor tcrt1000 is a device for photoelectric scanning, photodiode emission, triode receiving and output It is characterized by small size, easy to use, high signal output and little influence of temperature on its working state. Its peripheral circuit is simple (as shown in Figure 3). The C end of the diode is grounded with the e end of the triode, and the a end of the diode is connected with the power supply through a resistor to form a bias current circuit; The C end of the triode is also connected with the power supply through a resistor to form an output circuit. When the detector detects white, its vernier caliper outputs low level; When black is detected, a high level is output

in order to improve the detection accuracy, multi-sensor information fusion technology is adopted. In the design, three photoelectric sensors are evenly arranged in the front of the car, of which the middle one (Q1) is installed in the center of the car. The output of Q1 is connected to the p1.3 pin of the single-chip

photoelectric detection conversion circuit

machine through the primary comparator and non gate A sensor is respectively arranged at the left and right ends of Q1, which is also connected to the P1 port of the single chip microcomputer through the same circuit as Figure 3. If a black line is detected by a sensor on both sides, it indicates that the car is out of track. After fusing the results of the three detection points, Shandong Province, as a single-chip microcomputer, ranks among the top in the technical range of many fields such as carbon fiber, aramid and other advanced high molecular materials and new thermal insulation materials in the country. The robot judges and adjusts according to the P1 port information of the single-chip microcomputer to realize path tracking and automatic deviation correction [3]

metal detection part

Figure 4 metal detection circuit

as shown in Figure 4, the metal detector uses a proximity switch, the effective detection distance is about 4mm, and it is fixed on the robot. When a metal sheet is detected, the detector output end outputs a low level, which is connected with a light-emitting diode and a buzzer after the reverser to send out an audible and visual indication signal. At the same time, the output is reversed and then connected to the MCU to count the number of detected metal sheets

Hall element ranging design

the interior of the hall integrated sheet is composed of three Hall metal plates. When the magnet is facing the metal plate, according to the Hall effect, the metal plate has transverse conduction [4]. Therefore, the magnetic sheet can be installed on the wheel, while the hall integrated sheet can be installed on the fixed shaft, and the distance measurement can be carried out by pulse counting. Every time the rear wheel of the car rotates, the pulse generated by the hall element is sent to the t0 port of the single chip microcomputer for counting, and the single chip microcomputer completes the conversion from pulse number to distance. Install a magnetic pole on the rear wheel, and the measurement error is the circumference of a wheel, which can be compensated in the software

lcd display

liquid crystal display is more and more widely used in pocket instruments and low-power application systems because of its many advantages of low power consumption, small volume, rich display content, ultra-thin and lightweight. Here, dm-162 liquid crystal module with 2 lines and 16 words is used to complete the display function by connecting with MCU and programming

4 system software flow

system software flow is shown in Figure 5

Figure 5 system software flow chart

5 conclusion

based on the principle of single chip microcomputer and sensor, this paper takes single chip microcomputer as the core of the controller, small DC motor as the driving element, configures different types of sensors, and through software programming, makes a small robot with low price and modular structure. A large number of walking experiments have proved that the robot can successfully track the path, automatically correct the deviation and walk autonomously, and complete the functions of detection and display

the author's Innovation: Aiming at the hot issue of path tracking in the environment with guide line, this paper adopts multi-sensor information fusion technology and single-chip microcomputer control to realize the function of path tracking and automatic deviation correction of the robot. The method is simple, easy to implement, low cost and good effect

Copyright © 2011 JIN SHI