O Introduction
Intelligent vehicles, as one of the key technologies of intelligent transportation systems, are the carriers of many high-tech integrated technologies. It embodies the integrated technology of vehicle engineering, artificial intelligence, automatic control and computer technology, and is the trend of future automobile development. This automatic tracking car system uses a digital camera 0V6620 to collect road information, and the core controller MC9S12XSl28 can analyze and process image data to identify the black guide line in the center of the road. In addition, the controller can also send control signals to the steering servo and motor drive module MC33886 according to the deviation between the black guide line in front of the road and the center line of the vehicle body, and then control the car to achieve fast and stable tracking driving.
1 System hardware overall architecture
The whole system can constitute a speed closed-loop control system, and its overall block diagram is shown in Figure 1.
In the figure, the RS232 module is used to upload image acquisition data to the PC, and the vehicle speed detection uses Omron's E6A2CS3C rotary encoder to detect the speed of the rear wheel drive motor.
2 Core control board design
The core control board of this system is essentially the minimum hardware system of MC9S12XSl28. It consists of clock crystal circuit, BDM interface circuit, reset circuit, MC9S12XSl28 chip, filter inductor, capacitor and connector.
In addition, BDM (background debugging module) can be used to download programs to the target board. This is the programming function of BDM to erase the program in the 128KBFLASH inside MC9S12XSl28. Through the microcontroller, only a 6-pin plug is needed to lead out the information and connect it to the BDM debugger. Among them, BKGD is the background debugging pin. It can use a custom protocol and perform single-line two-way communication through the BDM debugging tool, so as to perform real-time online debugging. [page]
3 Peripheral interface and driver circuit board design
3.1 Power management module
The voltage distribution of each module in the whole system is shown in Figure 2. The 7.2 V voltage of the rechargeable battery can be converted by the LM2940-5.0 module to generate a 5 V voltage to supply the MC9S12XSl28 microcontroller and RS232 level conversion chip, OV6620 camera module and optocoupler 6N137 respectively. At the same time, the MC9S12XSl28 microcontroller of the core controller is separately powered by 5 V to prevent interference. The microcontroller and the MC33886 motor drive module are connected through an optocoupler. The 7.2 V voltage of the battery is directly supplied to the E6A2CS3C photoelectric encoder, servo and MC33886 drive module. The power management module circuit is shown in Figure 3.
3.2 OV6620 image acquisition module
The OV6620 camera module uses the OV6620 color digital CMOS image sensor, whose image is in NAL format, one frame of image is 356x292 pixels, and the data format is YCrCb4:2:2, GRB4:2:2 and raw GRB. The internal I2C can be programmed to adjust the parameters of the camera (such as maximum grayscale, contrast, exposure control, etc.), which is essentially the register write of the SCCB protocol. This design adopts the default mode, and the pin connection diagram of the OV6620 camera module and the MC9S12XSl28 microcontroller is shown in Figure 4. Among them: Y0-Y7 is the grayscale signal output pin. Since this system only needs to identify the black line in the road, it only needs to extract the brightness signal Y in the data format of YCrCb4:2:2. The grayscale signal Y0-Y7 can be sent to the B port of the MC9S12XSl28 microcontroller.
The data signal pin SDA and data clock pin SCL written by the SCCB protocol are connected to the PS0 and PS1 pins of the SCI interface of the MC9S12XS128 microcontroller respectively.
The clock control signals FODD (odd field synchronization signal), HREF (line interrupt signal), and VSYN (field interrupt signal) for collecting image data are connected to the PT1, PT2, and PT6 pins in the ECT (enhanced capture timer) module of the microcontroller respectively. Using the input capture function of the enhanced capture timer module, each channel can have a separate interrupt vector, and each channel is set to a different trigger polarity to meet the requirements that HREF (line interrupt signal) must be captured through the falling edge and VSYN (field interrupt signal) must be captured through the rising edge. The pixel synchronization signal PCLK is ignored because the speed of the MC9S12XS128 microcontroller to collect images is slower than the image output of CMOS.
The VTO analog image output pin can be connected to an external monitor to check the quality of the collected image.
[page]
3.3 Motor drive module
The MC33886 H-bridge motor drive chip is used for the motor control, and its entire drive circuit is shown in Figure 5. In this application, the role of MC33886 is to modulate the constant DC power supply voltage (battery voltage) into a PWM pulse voltage sequence with a certain frequency and variable width, thereby changing the output average voltage. In order to enhance the ability to drive the motor, two MC33886 chips can be connected in parallel. In order to improve the control accuracy, the 8-bit registers of the two channels PWM2 and PWM3 in the MC9S12XSl28 microcontroller can be cascaded into a 16-bit register, and pulses can be output from the PWM3 channel. Similarly. The 8-bit registers of the two channels PWM4 and PWM5 can also be cascaded into a 16-bit register, and pulses can also be output from the PWM5 channel. The PWM2 and PWM3 channels are multiplexed with pins PP3 and PP5. The PWM pulses output by the PP3 and PP5 pins of the MC9S12XSl28 microcontroller are isolated by the 6N137 optocoupler device and enter the MC33886 H-bridge input through signals INl and IN2. The MC33886 H-bridge output terminals OUTl and OUT2 are respectively connected to the two ends of the motor armature, thereby controlling the four-quadrant operation of the motor.
3.4 Vehicle speed detection module
In order to form a closed-loop system, the vehicle speed needs to be detected. The feedback channel of this system uses the incremental rotary encoder E6A2CS3C of Omron, and adopts a five-wire system (three pulse lines, two power lines) with a resolution of 200P/R. Since only the vehicle speed is measured, only three wires are required, namely the brown wire (7.2 V voltage), the black wire (A phase output pulse) and the blue wire (ground). The black wire (A phase output pulse) is introduced into the PT0 pin of the microcontroller to count the number of pulses and obtain the motor speed. The wiring of the vehicle speed detection module is shown in Figure 6.
3.5 Servo module
This design uses the Futaba S3010 servo, and its wiring is shown in Figure 7. The servo is essentially a position follow-up system, which consists of a steering wheel, a reduction gear set, a position feedback potentiometer, a DC motor and a control circuit. Through internal position feedback, its steering wheel output angle can be proportional to the given control signal. In this way, when the load torque is less than its maximum output torque, its output angle will be proportional to the given pulse width. The interface of the Futaba S3010 servo is three wires, black wire (ground), red wire (power line) and white wire (control signal line). In order to improve the response speed of the servo, the maximum operating voltage of 7.2 V is generally selected, and the two 8-bit outputs of PWM0 and PWM1 inside the single-chip microcomputer are cascaded into a 16-bit PWM output, and then the pulse is output from the PWM1 channel. At the same time, since the PWM1 channel and pin PPl are multiplexed, pin PPl can output control pulses to the servo.
4 Conclusion
This paper introduces the hardware system implementation method of the black line tracking intelligent car. Practice has proved that the car has good automatic tracking effect and fast response speed. It can run a good time of 20 seconds on the specified track, which proves the correctness of the hardware design of the system.
Previous article:Application of MCU + CPLD in electronic design
Next article:Design and implementation of intelligent vehicle control system based on MC9S12DG128
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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- EEWORLD University Hall ---- EMC pre-test environment construction
- Restraining the complexity of embedded system design
- Device Basics - The Impact of Capacitor Self-resonance Frequency on Selection
- CC3200 wireless wifi processor full voice interactive control smart home system
- Pre-registration for the prize live broadcast | ON Semiconductor's advanced image sensor solutions for the Internet of Things
- Specific steps to implement bit fields and register file structures
- Excuse me, how does the electric meter with both steps and peaks and valleys work?
- Free | VIP tickets to EDI CON, the annual RF conference (Beijing, April 1-3)
- Year-end benefits! 2019 TI Industrial Applications Selected Courses Summary, Grab the Building to Win Gifts
- Fujitsu Live Today|FRAM Authenticity Verification Solution without Encryption Algorithm (Spectrum)