O Introduction
Since the industrial revolution, with the development of electricity, mankind has entered a new stage of civilization. Robots have been widely used in industry, agriculture, service industry, military, machinery, transportation, aerospace and other fields. The continuous improvement of the level of intelligent robots has greatly improved labor efficiency and reduced labor intensity. Robots fight side by side with humans and play an important role in conquering nature and transforming nature.
The intelligent car is a comprehensive system integrating multiple disciplines such as theoretical mechanics, mechanical structure, digital circuit, analog circuit, sensor, single-chip microcomputer, control theory and algorithm. Its content covers multiple disciplines and fields such as machinery, electronics, automatic control principles, computers, and sensor technology.
The intelligent car based on ATmagel6L designed in this paper requires it to start from the starting line, and then automatically adjust the angle and speed by itself to make it automatically drive along a black guide line.
1 Hardware Design of Smart Car
The structure of the control system of this smart car is shown in Figure 1. The Atmegal6L microcontroller is the control module of the smart car. It is a high-performance, low-power 8-bit AVR microprocessor with advanced RISC structure, 16K bytes of in-system programmable Flash and 512 bytes of EEPROM. When working at 16 MHz, its performance is as high as 16 MIPS, and it has 32 programmable general I/0 ports and a JTAG interface for boundary scanning, which can basically meet the design requirements. The circuit voltage regulator module inputs 12 V voltage. After the voltage regulator circuit, two voltages of 9 V and 5 V can be obtained, of which 9 V voltage is used for the working voltage of the motor drive module, and 5 V voltage is used for the work of the microcontroller. Figure 2 shows the circuit diagram of the RPR220 photoelectric sensor module. The photoelectric sensor is composed of 10 RPR220 photoelectric pairs. RPR220 is an integrated reflective photodetector, whose transmitter is a gallium arsenide infrared light-emitting diode, and the receiver is a high-sensitivity silicon planar phototransistor. The INPUT and OUTPUT ports of L298N are used to provide a stable voltage to make the motor rotate.
1.1 Photoelectric sensor module
Figure 2 shows the circuit diagram of the photoelectric sensor module in this system. The line-finding path is generally a 3 cm black line engraved on a white plane. The car follows the black line. When the white line is detected, that is, the light emitted by the diode is reflected back by the white line, the triode in the photoelectric pair tube is turned on, and the input of port 6 of the comparator is low level. After passing through the comparator, the output of port 7 is high level. When the black line is detected, the light is absorbed, the light intensity is weakened, the triode in the photoelectric pair tube is not turned on, the input of port 6 of the comparator is high level, and the output of port 7 is low level. After the high and low levels (1 and 0) are fed back to the microcontroller through the PC port, they can be used to adjust the steering of the car head after processing by the microcontroller so that the black line is just in the middle of the 10 photoelectric probes, so that the car can move forward smoothly. A 0.1μF capacitor is connected in series at port 7 and then grounded. In this way, the square wave entering the microcontroller after filtering is very perfect. Connect this photoelectric tube to the code disk, and use the photoelectric tube to continuously scan the number of code disk grids. In this way, when the code disk rotates and the speed is low, the signal at terminal 6 can be changed into a square wave with a frequency corresponding to the speed. However, when the code disk is very fast, the signal at terminal 6 will become a sinusoidal signal with a frequency corresponding to the speed. The amplifier LM324 can be used as a comparator. After comparing the sinusoidal signal at terminal 6 with the reference voltage, a square wave with a frequency corresponding to the speed will be generated at terminal 7. After the microcontroller collects this signal, the various parameters of the DC motor can be calculated according to the formula, thereby accurately controlling the steering and displacement of the car.
1.2 Motor drive module
Figure 3 shows the circuit connection diagram of the L298N drive module. As a motor drive chip, L298N is a high-voltage and high-current full-bridge drive chip. It has a high frequency and can control two DC motors. It also has a control enable terminal. The working voltage can be input through pins 4 and 9, respectively, with 9 V and 5 V voltages. ENA and ENB pins are two enable ports, while INT and OUT are motor drive pins. By changing the logic level of the OUT terminal, the forward, reverse and stop states of the motor can be controlled. Table 1 lists the DC motor control logic. The six pins 5, 6, 7, 10, 11 and 12 of L298N can be directly connected to the PD port of the microcontroller, and the DC motor PWM speed regulation can be realized by programming the microcontroller.
[page]
1. 3 Single-chip microcomputer control module
The Atmegal6L single-chip microcomputer of Atmel Company can be used to control the car. The single-chip microcomputer has 32 powerful programmable I/O interfaces and 4 PWM channels, and has eight 10-bit ADCs, which can control the car in real time. The eight ports PC0~PC7 of the single-chip microcomputer can be connected to the eight photoelectric probes of the photoelectric sensor module. Assume that the actual logical value detected by the probe is P, the assumed value is N, and the movement states of the wheels are forward-move, right-move, leftmove, hard-right-move, and hard-left-move. By comparing the actual value P with the assumed value N (0b0011-1100), the control module parameter table of the Atmegal6L single-chip microcomputer listed in Table 2 can be obtained, where x is an irrelevant item. During design, PD2~PD3 of Atmegal6L can be connected to two photoelectric pairs with code discs to accurately measure the steering and displacement of the wheel; PD5 and PD4 can be connected to the enable terminals ENA and ENB of the motor drive module respectively. PD1, PD0, PD6 and PD7 are connected to IN1, IN2, IN3 and IN4 of the motor drive module respectively. IN1 and IN2 ports are generally used for PWM input to use PWM speed regulation method, that is, the microcontroller outputs a series of square waves with fixed frequency, and drives the motor through the power amplifier, and then changes the duty cycle of the output square wave through microcontroller programming, so that the average voltage applied to the motor can be changed, thereby changing the speed of the motor.
2 Software design of smart car
The system software flow chart based on AVR microcontroller and C language programming is shown in Figure 4.
3 Conclusion
This paper focuses on the discussion of the principles of photoelectric sensors, single-chip microcomputer control and voltage regulators, as well as the mutual communication and coordination between these modules. This system uses cheap infrared tubes and a powerful ATmagel6L single-chip microcomputer as the main controller. At the same time, the debugging software is written in C language using the L298N driver chip, thus completing the design of an intelligent car that can track intelligently, avoid obstacles automatically, has modular structure, and has strong anti-interference ability. Through the debugging of the car, the system can enable the car to successfully and smoothly drive on any given black line, and the tracking effect is very good, the operation is very stable, and the speed is also very fast, and there will be no centrifugal phenomenon at the corners due to the high speed.
Intelligent cars have been widely used in military, civil, scientific research, and aerospace exploration fields. Its development is closely related to automatic control, single-chip microcomputer development, optimization of control algorithms, and microcomputer storage processing speed, and it is worth further research and exploration.
Previous article:Radio Telemetry System Based on AVR Microcontroller
Next article:Design of a Presettable Programmable Broadband DC Power Amplifier Circuit Based on ATmegal28
Recommended ReadingLatest update time:2024-11-16 23:48
- 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
- ESP32 SD/MMC hardware connection method
- Domestic chips are amazing. I just applied for a board. CH579 is so small but it integrates network, USB, and Bluetooth.
- Gallium nitride substrate production technology and equipment
- Safety temperature standards for main components of switching power supplies
- Auxiliary trainer for plank and push-up exercises
- MicroPython will add serial port interrupt function
- MOS tube
- C6678 on-chip storage space allocation mechanism
- Game: Help Blinka get out of various difficulties
- The difference between IAR and Keil development tools