With the continuous development of microelectronics technology, microprocessor chips are becoming more and more integrated. Microcontrollers can integrate CPU, memory, timers/counters, parallel and serial interfaces, watchdogs, and pre-processors on one chip. A variety of circuits such as amplifiers, A/D converters, D/A converters, etc. make it easy to combine computer technology with measurement control technology to form an intelligent measurement control system. This technology has led to rapid development of robot technology. At present, people can design and manufacture simple intelligent robots with certain special functions.
1 Design ideas and overall plan
1.1 Design ideas of simple intelligent robot
This robot can walk along the guide line in any area, automatically avoid obstacles, and can walk along the light source when guided by the light source. At the same time, it can detect metal pieces buried underground, send out audible and visual indication information, and can store and display the number of detected breakpoints and the distance between each breakpoint and the starting line in real time. Finally, it can stop at a designated location and display the entire run. process time.
1.2 Overall design plan and block diagram
This design uses AT89C5l microcontroller as the detection and control core. An infrared photoelectric sensor is used to detect black lines and obstacles on the road, a metal sensor is used to detect metal iron pieces under the road, a photoelectric encoder is used to measure distance, a photoresistor is used to detect and determine the location of the garage, and PWM (Pulse Width Modulation) technology is used to dynamically control the motor. Direction of rotation and speed. Through software programming, precise control of robot travel, obstacle avoidance, and stopping, as well as storage and display of detection data are achieved. Through the optimized combination of circuits, all resources of the 51 microcontroller can be utilized to the maximum extent.
Port P0 is used for digital tube display, port P1 is used for PWM drive control of the motor, and ports P2 and P3 are used for data collection and interrupt control of the sensor. The advantage of this is that it fully utilizes the internal resources of the microcontroller and reduces the overall design cost. The overall scheme of the program is shown in Figure 1.
2 System hardware composition and design principle
The hardware part of this system consists of a single-chip microcomputer unit, a sensor unit, a power supply unit, an audible and visual alarm unit, a keyboard input unit, a motor control unit and a display unit, as shown in Figure 2.
2.1 Microcontroller unit
This system uses AT89C51 microcontroller as the central processor. Its main task is to scan the signal input from the keyboard to start the robot, and continuously read the data collected by the sensor while the robot is walking. After processing the obtained data, it generates PWM pulses with different duty cycles according to different situations to control the motor. At the same time, the relevant data is sent to the display unit for dynamic display, and an audible and visual alarm signal is generated. Among them, P0 is used for dynamic display of the digital tube, P1.0 to P1.5 control 2 motors, P1.6 and P1.7 are independent keyboard interfaces, P2 is connected to the sensor, and P3.2 is connected to the photoelectric code plate for mileage measurement. P3.7 is connected to the sound and light alarm unit, and P3.4, P3.5, and P3.6 are connected to the light-emitting diodes used to display the number of breakpoints.
2.2 Motor control unit
This robot uses a dual-motor, two-wheel-driven car as its base. The two motors independently control the wheels on the left and right sides. The turning function is realized by the difference in the speed of the motors on both sides. It can also turn in place for easy control. The traditional car is driven by a power motor and a steering motor, and the turning angle is difficult to control and is inconvenient to use.
The motor control circuit adopts an H-type drive circuit composed of high-power pairs of tubes BDl39 and BDl40. The microcontroller generates PWM pulses with different duty cycles to accurately adjust the motor speed. Since this circuit works in the saturated or cut-off state of the transistor, it avoids the tube consumption of the transistor when working in the linear amplification area and can maximize efficiency; the H-type circuit ensures that the motor speed and direction can be simply controlled; electronic switch The speed and stability can fully meet the needs. The entire drive circuit is a widely used motor drive technology. See Figure 3 for the circuit.
2.3 Sensor unit
The entire robot uses a total of 9 sensors, which are distributed in different parts of the entire robot and play different roles in cooperation with each other, as shown in Figure 4.
The description of each sensor in Figure 4 is as follows:
Sensor 1 is a metal detection sensor placed directly in front of the robot and facing downward, for detecting metal.
Sensor 2 is a forward-facing ultrasonic sensor placed directly in front of the robot for detecting obstacles. The ultrasonic wave comes from the 40 kHz square wave signal generated by the 555, which is sent out through the ultrasonic transmitter. The transmitting head continuously sends out signals. When encountering an obstacle, the signal will be reflected back, so that the receiving head will receive the signal and send the signal to the microcontroller for corresponding judgment and processing.
Sensor 3 is an infrared photoelectric sensor placed directly in front of the robot and facing downward to detect the stop line. The infrared transmitting tube emits a signal, which is reflected by different reflective media, and a corresponding judgment is made based on whether the infrared receiving tube receives the signal.
Sensors 4 and 5 are infrared photoelectric sensors placed under the robot base and are used to detect guide lines on the ground. The principle is the same as sensor 3.
Sensors 6 and 7 are placed directly in front of the robot and are used to find the light source. When there is a light source in front of the robot, the size of the photoresistor will change. The changes of the two sensors will be compared and processed and sent to the microcontroller. The microcontroller will generate a corresponding adjustment signal to make the robot walk in the direction of the light intensity.
Sensor 8 is an ultrasonic sensor placed on both sides of the rear of the robot facing outward. It is used for turning when the robot encounters an obstacle and determines whether the robot has completely bypassed the obstacle. The principle is the same as sensor 2.
The sensor 9 is placed on the photoelectric code disk directly behind the robot for mileage calculation. With the help of the mouse principle, a plastic wheel with a diameter of 2.6 cm is used to make a homemade photoelectric code disk. After polishing, the circumference is 8 cm, and then Punch 8 holes at equal distances on the small wheel, as shown in Figure 5. The minimum distance measurement accuracy can reach 1 cm, which is enough to meet the requirements. Photoelectric sensors are installed on both sides and installed at the rear of the car to synchronize them with the driving of the car. According to the actual situation, the distance between the self-made holes cannot be exactly equal, but after specific measurement of the photoelectric code disk, it can ensure that 50 pulses are generated when traveling 50 cm, so it is used as the reference unit for calculating distance. In the straight area, the distance between the center line of the iron piece and the starting line can be calculated from the number of pulses generated by the circuit.
In addition, in order to clearly and intuitively observe the working status of each sensor, a working indicator light is specially designed for each sensor in the circuit to display the working status of each sensor in real time.
2.4 Keyboard input unit
The keyboard input unit adopts an independent keyboard and consists of 2 keys, one of which is the start key and the other is the display switching key. When the robot completes its walking process, press this key to display the entire walking process. time.
2.5 Display unit
The display unit consists of two 7-segment digital tubes. In order to reduce the power consumption of the entire system, it uses microcontroller software decoding, dynamic display, and real-time display of the distance from each breakpoint to the starting point and the entire running process. time.
2.6 The sound and light alarm unit
uses 555 as the oscillation source, and uses the microcontroller to trigger the oscillation source to drive the electromagnetic sounder as the sound indicator and a light-emitting diode as the light indicating device to form the sound and light alarm unit.
2.7 Power supply unit
This system uses 2 sets of power supplies to supply power to the motor and control circuit separately. The system control circuit uses the output power supply (5V) stabilized by 7805, and the motor uses 4 AA batteries to power the system.
3 System software design
The supporting software program of this system adopts a module structure and is written in C language. It mainly consists of initialization program, deviation adjustment program, deviation light source adjustment program, sound and light indication subroutine, reading sensor status, display program, timer 0 interrupt service program, timer 1 interrupt service program, external interrupt 0 service program , parking processing and other modules. The main flow of the system is shown in Figure 6.
4 Conclusion
The robot has gone through many experiments on the runway that was set and achieved the expected results, but its level of intelligence is far from enough. With the continuous research and deepening of artificial intelligence and neural network technology, the development prospects of intelligent robots will become increasingly broad.
Previous article:EM78P447S microcontroller and its application in DC motor infrared remote control system
Next article:Application of C8051F microcontroller in remote measurement and control devices
Recommended ReadingLatest update time:2024-11-16 16:36
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Intelligent Control Technology of Permanent Magnet Synchronous Motor (Written by Wang Jun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
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
- 【Smart Sports Watch】3. Build Development Environment 2
- Ginkgo USB-SPI host mode four data transmission mode timing diagram
- History of the Development of Microwave Circuits
- 6657Statically configure serial port general interrupt in sys/bios
- Understanding Nginx Architecture in One Article
- Highly recommended! ADI's latest Chinese information is here
- Urgently looking for expert advice AD15 can not open the PCB after cracking
- Difference between LPS22HH and LPS22HB
- How to collect multiple sensor signals through one RS485 interface of industrial computer?
- Altera SoC Architecture Excerpt - What is a SoC FPGA