Design of automatic tracking intelligent car based on Renesas microcontroller

Publisher:AsawenLatest update time:2013-05-02 Source: 电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
    With the development of computer, communication, sensor and other technologies, smart cars have become the trend of automobile development. Sensor technology is increasingly widely used in smart cars, such as driving at night, in foggy days, in high-risk and high-pollution environments. Smart cars will become a part of people's lives. Based on the Renesas smart car competition, this paper designs an electric car that uses a 16-bit microcontroller H8/3048F as the control core of the car, uses an infrared reflection sensor to detect the road guide line, and can drive according to given parameters. The working principle and design method of the smart car are elaborated in detail from the hardware and software aspects. The designed car has the advantages of simple circuit design and efficient software control.

1 Overall design plan of the system
   
This smart car uses the photoelectric sensor in front of the car body to collect track information and the photoelectric encoder on the rear axle to collect the pulse signal of the wheel speed. These signals are conditioned by the single-chip microcomputer and used to control the movement of the car. At the same time, the PWM wave generated by the internal module drives the DC motor to control the speed and angle of the smart car, so that the car can drive automatically and smoothly on the track and complete the course in the shortest time and at the fastest speed. In addition, this system also adds buttons and display devices for easy debugging. The overall module diagram of the intelligent vehicle system is shown in Figure 1.

a.JPG



2 Hardware Design
   
Hardware design is the basis of design, including the design of the power management circuit of the whole vehicle power supply, the design of the motor drive circuit, and the connection design of each interface circuit of the single-chip microcomputer.
2.1 Controller Module
   
The H8/3048F single-chip microcomputer is a 16-bit high-performance microcontroller produced by Hitachi. The H8/3048F has 16 16-bit general registers. Its maximum clock frequency can reach 18 MHz, and the addressing space is 16 MByte. The chip includes: 9 I/O ports, 32 kByte Flash, 2 kByte RAM, 16-bit integrated timing unit (ITU), programmable timing pattern controller (TPC), watchdog timer (WDT), serial communication interface (SCI) and A/D, D/A converters, etc. The controller I/O port is allocated as follows: P70~P77 is used for the input of photoelectric sensor signals; PB is used for the input of vehicle speed detection signals; PA is used for the input of the start sensor board signal. The controller controls the steering servo and DC drive motor according to the detected road conditions and vehicle speed information, and adjusts the driving direction and speed of the car accordingly, so that the smart car can travel stably and quickly along the given route.
2.2 Power module
   
8 1.2 V nickel-hydrogen batteries are selected to power the DC motor, and after voltage reduction and voltage stabilization, they are used to power the single-chip microcomputer system and other chips. The battery has strong current driving capability and stable voltage output performance, and is cost-effective. The power supply part uses the LM2940CT chip. The chip can provide a maximum current output of 3 A, which fully meets the system requirements. The module uses two 2940 chips, one for powering the MCU alone and one for powering other components.
2.3 Tracking sensor module
   
The module uses an integrated reflective photoelectric tube RPR22D. Its transmitter is a gallium arsenide infrared light-emitting diode, and the receiver is a highly sensitive silicon planar photoelectric transistor. RPR220 has the following characteristics: compact structure, strong anti-interference ability, and fast response speed. The built-in visible light filter can reduce the influence of discrete light. When the light emitted by the LED is reflected back, the transistor is turned on and outputs a low level. The photoelectric transistor conditioning circuit is simple and has stable working performance. The sensor detection and conditioning circuit is shown in Figure 2. After observation by the oscilloscope, the output waveform is regular and can be directly used for single-chip microcomputer query.

b.JPG


    The car detects the white line using 9 equally spaced infrared tubes to collect the path and identify the road information. It starts with the left photoelectric tube to collect data in a loop to detect whether it is on the white line. If it is on the white line, it then detects whether the photoelectric tube on its right is also on the white line, and moves to the right in sequence. When more than 3 photoelectric tubes are above the white line at the same time, the current sampling data is filtered out and the historical value is used. [page]

2.4 Motor drive module The
   
motor drive board is a reversible bipolar bridge driver made of discrete components. Its power components are composed of 4 n-channel power MOSFET tubes, which greatly improves the working torque and speed of the motor. The driver mainly consists of the following parts: PWM signal input interface, logic commutation circuit, dead zone control circuit, power supply circuit, upper bridge arm power MOSFET tube gate drive voltage pump circuit, power MOSFET tube gate drive circuit, bridge power drive circuit, buffer protection circuit, etc. By setting the duty cycle of the PWM wave output by HS/3048F, the forward and reverse rotation of the motor can be controlled. When the output duty cycle is 50%, the motor does not rotate. When the duty cycle is >50%, the motor rotates forward; <50%, it reverses.
2.5 Speed ​​measurement module
   
In order to improve the detection accuracy, this module was finally determined to use a photoelectric encoder with higher accuracy. The photoelectric encoder uses a 5 V power supply and outputs a square wave signal. It has the advantages of light weight, high reliability, and simple installation.

3 Algorithms and software design
3.1 Direction control algorithm The
   
direction control of the intelligent vehicle adopts closed-loop control of the predetermined track, that is, the output direction and the measured white line position are in a segmented proportional relationship. The formula for the steering angle of the servo is
    θ=arctan(e/b) (1)
    In formula (1), θ is the steering angle of the servo; e is the offset; b is the distance from the front axle to the sensor.
    Through experiments, it can be obtained that the steering angle of the servo is linearly related to the PWM pulse width, and the steering formula is
    PWM=θ×K+M (2)
    In the formula, K is the proportional coefficient; M corresponds to the PWM control pulse width when the servo position is not deflected. Experiments have shown that adjusting K within a certain range can achieve a good control effect.
    There are 16 states of road conditions detected by the intelligent vehicle, and each state has a corresponding servo angle. In this way, the relationship between the white line deviation e and the servo angle θ corresponding to each sensor state can be created in the program, as shown in Table 1.

c.JPG

[page]

3.2 Speed ​​Control Algorithm
   
The control algorithm of the intelligent vehicle adopts the PID algorithm, which includes three parts: measurement, comparison and execution, that is, comparing the measured quantity with the expected value, and then using the qualified error to correct the response of the control system. The PID control algorithm is a control strategy based on classical control theory. The PID control algorithm can improve the stability of the system and improve the dynamic performance of the system without affecting the stability accuracy of the system. According to the experimental situation and on-site debugging experience, the car does not perform PID control when it moves in a straight line, but moves at the maximum speed. When it is in a general curve state, the PID algorithm is introduced, so that the speed can be adjusted according to the actual situation, so that the car has good controllability. The principle block diagram of the PID controller is shown in Figure 3.

d.JPG


    The system mainly consists of a PID controller and a controlled object. It forms a control deviation based on the given value r(t) and the actual output value m(t), and forms a control quantity through linear combination of the deviation according to proportion, integration and differentiation to control the controlled object. In
    the graphical expression of PID
e.JPG
    (4), T is the sampling period, which must be small enough to ensure that the system has a certain accuracy; Ti is the integral time of the regulator; Td is the differential time of the regulator; Kp is the proportional coefficient of the regulator; e(k) is the deviation at the kth sampling; u(k) is the control quantity.
    Incremental PID control is adopted. From △u(kT)=u(kT)-u(kT-T), we can get
    △u(kT)=Kp[e(kT)-e(kT-T)]+Kie(kT)+Kd[e(kT)-2e(kT-T)+e(kT-2T)] (5)
    In the formula, e(kT) is the degree of deviation from the center position for the kth time; e(kT-T) and e(KT-2T) are the k-1 and k-2 error terms respectively. Based on this algorithm, the control algorithm program is written in C language.
3.3 Program design
   
The main program adopts the idea of ​​periodic detection control. The guide line, vehicle speed and acceleration data are detected once every 20ms. According to the program processing results, the steering gear control program and the drive motor control program are called to control the running state of the intelligent vehicle in real time to meet the requirements of line-following operation. The main flow chart is shown in Figure 4.

h.JPG



4 Conclusion
   
The design of intelligent vehicles covers multiple disciplines such as automatic control and electronics. Its technology can be applied to the fields of intelligent robots and automated operation platforms, and has strong practicality. Combining practical design experience, this paper discusses the design of intelligent vehicles from the aspects of hardware design and software design. Experiments have shown that the PID algorithm can better ensure that the intelligent vehicle moves in the right direction and runs smoothly even when the road guide line is complex.

Reference address:Design of automatic tracking intelligent car based on Renesas microcontroller

Previous article:Application technology of STC series single chip computer without power failure program download
Next article:Design of Universal Programmer for Freescale HCS12 Series MCU

Recommended ReadingLatest update time:2024-11-16 17:44

Renesas Launches RA8 MCU with High Performance for Motor Control Applications
The RA8T1 MCU family, based on the Arm® Cortex®-M85 processor, offers low-power operation and dedicated analog features for industrial, building and home automation applications Beijing, China, January 30, 2024 - Renesas Electronics, a global supplier of semiconductor solutions, today announ
[Industrial Control]
Renesas Launches RA8 MCU with High Performance for Motor Control Applications
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号