0 Introduction
The wheeled car is the main part of the mechanical structure of the intelligent car, which consists of structural components such as the body, wheels, speed sensors, and rotating shafts. It also includes modules such as a driver that provides power and a camera that collects environmental information, which comprehensively collects the car's own state information or external environment information, analyzes and integrates the sensor data, dynamically adjusts the car's motion state, and realizes autonomous tracking under certain conditions.
This intelligent car adopts PID control algorithm and uses CCD linear camera as the detection device of black guide line. After comparison by LM393, it is used for data acquisition and image recognition by single chip microcomputer, so as to identify the path. The motor drive adopts PC33886, and uses direct photoelectric sensor to measure speed, and displays the relevant information on LCD screen. It also uses 4 buttons to set parameters, providing a friendly human-computer interaction interface for on-site debugging.
1 System framework design
The whole car model system can be divided into three parts: environmental image acquisition part, motor and servo drive part, central data processing part, and uses 16-bit microcontroller MC9S12DGl28B as the core control unit. The system block diagram is shown in Figure 1.
Figure 1 System Block Diagram
The power part of the smart car uses a common small permanent magnet DC motor. The drive circuit of this motor is very mature, with both drivers composed of separate components and integrated power integrated driver chips available for selection.
The most important component of a smart car is the central processing system, which is also the brain of the smart car. It is not only responsible for processing the image data sent by the environmental image acquisition part, but also for converting this information into the driving control signal of the motor so that the whole car can move forward according to the predetermined rules. This requires the system to have a huge data processing capacity.
2 Road Detection Module
2.1 Comparison and feasibility analysis of road surface inspection schemes
The environmental image acquisition part can be realized by array infrared probes and CCD or CMOS image sensors. The former is characterized by low price, simple circuit and convenient application, but has the disadvantages of limited performance, weak adaptability to complex environments and poor effect. CCD or COMS image sensors (cameras) can make up for the various shortcomings of array infrared probes.
In order to quickly collect image data and take into account the difficulty of development, a black and white surveillance camera that outputs standard TV video signals will be used in this design. This camera can cooperate with the line and field synchronization signal separation circuit and the A/D conversion circuit of the microcontroller itself to easily collect images, thereby avoiding the complex bus protocol and data processing process of digital cameras.
2.2 Hardware Design
The LM1881 video synchronization signal separation chip can extract the timing information of the signal from the camera signal. The synchronization separation circuit of LM1881 is shown in Figure 2.
Figure 2 LM1881 synchronous separation circuit diagram
Pin 2 is the video signal input terminal, where the camera signal is input into LM1881. Pin 3 is the field synchronization signal output terminal. When the field synchronization pulse of the camera signal arrives, this terminal will become low level, generally maintained for 230μs, and then return to high level. Pin 7 is the odd-even field synchronization signal output terminal. When the camera signal is in the odd field, this terminal is high level, and when it is in the even field, it is low level. The alternation of odd-even field is synchronized with the falling edge of the field synchronization signal, that is, synchronized with the rising edge after the field synchronization pulse.
3 Speed sensor
3.1 Solution selection
(1) Hall sensor with rare earth magnet
Advantages: accurate information acquisition, small size, and no increase in rear wheel load.
Disadvantages: The gear is close to the main drive motor and is easily disturbed by the magnetic field. Drilling holes in the gear can easily damage the gear.
(2) Photoelectric sensor
Advantages: small size, no increase in rear wheel load, and the reflective solution does not require reprocessing of existing devices.
Disadvantages: Accuracy is limited by the size of the phototube. [page]
(3) Photoelectric encoder
Advantages: Accurate information acquisition with high precision.
Disadvantages: Increased load on rear wheels and large size.
Comparing the above three solutions, considering the reliability of the system, the main rear wheel rotating gear is made of plastic, drilling is dangerous, and any increase in vehicle weight may affect the vehicle speed, we finally decided to use a direct-type photoelectric sensor.
3.2 Hardware Circuit Design
The sensor circuit structure diagram is shown in Figure 3.
Figure 3 Sensor circuit structure diagram
4. Drive part
4.1 Motor Driver Selection
According to the theory of electromechanics and electric drive, the motor driver must have sufficient current output capacity to ensure sufficient driving force. Taking all factors into consideration, the motor driver is designed with an integrated dedicated power drive integrated circuit and a driver composed of discrete components (field effect transistors).
According to electromechanics, the expression for the DC motor speed, n, is:
In the formula: U is the armature terminal voltage; I is the armature current; R is the resistance in the armature circuit; φ is the magnetic flux per level; K is the motor structural parameter.
From formula (1), we can see that the speed control methods of DC motors can be divided into two categories: the excitation control method that controls the excitation flux and the armature control method that controls the armature voltage. At present, most applications use the armature voltage control method. This design uses PWM to achieve the speed regulation method of the DC motor while ensuring that the excitation is constant.
The average voltage U across the motor's armature winding is:
Where: Duty cycle D represents the ratio of the switch conduction time to the period in a period T, and the range of D is 0≤D≤1. From formula (2), it can be seen that when the power supply voltage Us remains unchanged, the average value of the voltage across the armature Uo depends on the size of the duty cycle D. Changing the D value also changes the average value of the voltage across the armature, thereby achieving the purpose of controlling the motor speed, that is, realizing PWM modulation.
In order to facilitate the acquisition of materials and design, the PC33886 from Freescale Semiconductor was selected for this design. The PC33886 can accept a 20 kHz operating frequency when driven in PWM speed regulation mode; it has overheating, overcurrent, and short circuit protection, and feeds back the device's operating status to the microcontroller through a feedback line.
4.2 Servo control
The flow chart of the steering gear control program is shown in Figure 4.
Figure 4 Flowchart of the steering gear control program
The car model continuously samples road condition information during driving, and determines the road condition of the car model by analyzing the relative position of the car model and the track, and calculates the turning radius. The standard PWM cycle of all servos is 20 ms, and the maximum rotation angle is 90°. When the pulse width input to the servo is 0.5 ms, that is, the duty cycle is 0.5/20=2.5% of the modulation wave, the servo turns right 90°. The relationship between the rotation angle and the pulse width can be derived as follows:
t=1.5±θ/90
Where: t is the positive pulse width, unit: ms; θ is the rotation angle; when turning left, addition is used, and when turning right, subtraction is used.
In specific operations, the period of the PWM modulation wave can be set within a certain range of about 20 ms to enable the servo to rotate normally. After repeated tests, the output PWM modulation wave period is finally set to 13 ms.
The speed of the running motor and the angle of the servo are controlled accordingly in the software by setting the PWM wave duty cycle.
5 Power Module
The motor drive system requires a high-power power supply: low internal resistance, high current, and insensitive to power ripple; the microcontroller and image acquisition system have higher requirements for power quality: low internal resistance, small ripple, and low power consumption, but it is necessary to prevent interference generated by the motor during operation. The power supply system block diagram is shown in Figure 5. [page]
Figure 5 Power supply system block diagram
Since the camera needs a voltage of 9 to 12 V to work properly, and the voltage of the rechargeable battery is only 6 to 7.2 V, a DC-DC boost circuit becomes necessary.
The DC-DC voltage conversion uses the MC34063A integrated circuit, which integrates a temperature compensator, a comparator, a dynamic current band-limited duty cycle controllable oscillator and a high current output driver. The output voltage is directly controlled by two external resistors with an error of 2%. The circuit can be easily applied to both boost and buck applications. The circuit schematic is shown in Figure 6.
Figure 6 Power supply circuit diagram
6 Software Design
The software structure diagram is shown in Figure 7.
Figure 7 Software program structure diagram
The entire process of automatic identification and control of the car is completed through the program control on the main control microcontroller chip. After the car is turned on, it will automatically run along a black line track with a certain width. During the driving, the continuously detected black line position information will be fed back to the main control chip. After being processed by the main control chip, the execution result will be fed back to the controller, thereby controlling the direction of the car. The software detects the car speed and the change information of the button, and finally displays the result on the LCD display.
7 Conclusion
Smart car design involves control, pattern recognition, sensor technology, automotive electronics, electrical, computer, mechanics and other professional fields. The entire design does not use overly complex detection methods or control algorithms, but uses camera image processing technology and classic PID control algorithms, which not only ensures the reliability, stability and speed of the system, but also saves costs and workload. In terms of control algorithms, PID control ensures the speed and stability of the system; in terms of detection methods, the design of continuous camera detection ensures no jitter during high-speed straight-line driving, and the application of photoelectric tube speed measurement method ensures the simplicity and reliability of the speed measurement system.
References:
[1]. LM393 datasheet http://www.dzsc.com/datasheet/LM393_1059532.html.
[2]. PC33886 datasheet http://www.dzsc.com/datasheet/PC33886_1077293.html.
[3]. LM1881 datasheet http://www.dzsc.com/datasheet/LM1881_1060868.html.
[4]. MC34063A datasheet http://www.dzsc.com/datasheet/MC34063A_5067.html.
Previous article:Design of automobile taillight controller based on AT89S52 single chip microcomputer
Next article:A Design Scheme for Embedded Automotive Digital Instruments
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
- MSP430F5529 generates PWM waves with CCS
- When communicating in 485 network, sometimes the slave does not return data after the host asks
- Detailed explanation of the working principle of linear regulated power supply
- Detailed explanation of MSP430F149 serial port receiving and sending program
- Embedded Development Electronic Technology Classic Data 12G
- The new TMS320F28377S cannot connect to the emulator, what should I do?
- 【EasyARM-RT1052 Review】 + cJSON transplantation and use
- EEWORLD University ---- FPGA-based SOPC development process (Intel official tutorial)
- The difference between the input and output voltages of the voltage follower is so large that I was confused for several days. Please help me.
- Use of Inductor