Hardware design of intelligent tracking car based on MC9S12XS128 single chip microcomputer

Publisher:BlossomBeautyLatest update time:2012-10-23 Source: 现代电子技术 Keywords:MC9S12XSl28 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:MC9S12XSl28 Reference address:Hardware design of intelligent tracking car based on MC9S12XS128 single chip microcomputer

Previous article:Application of MCU + CPLD in electronic design
Next article:Design and implementation of intelligent vehicle control system based on MC9S12DG128

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号