Design of Line-finding Intelligent Vehicle Based on Linear CCD

Publisher:Xingfu6666Latest update time:2014-09-03 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

In the past, the smart car competition was divided into the photoelectric group, the camera group and the electromagnetic group. In this competition, the photoelectric group tried to make the car walk upright for the first time, and used the linear CCD as the image acquisition sensor for the first time. This article introduces how to use the Freescale Kinetis K10 as the main control chip, how to use the image collected by the linear CCD for data processing, and how to solve the problem of smart car passing obstacles from the perspective of speed control based on the original dual-speed control algorithm.

1 Design Principle

1.1 Data Collection Algorithm

A variety of sensors can be used to detect path parameters, such as photoelectric tube arrays, CCD image sensors, laser scanners, etc. Each detection method has its own advantages and disadvantages, among which the most commonly used methods are photoelectric tube arrays and CCD image sensors. How to effectively use the internal resources of the microcontroller to detect path parameters is the key to determining the detection solution.

CCD sensor is a new type of photoelectric conversion device that can store signal charges generated by light. When a pulse of a specific timing is applied to it, the stored signal charges can be transmitted in a direction within the CCD to achieve self-scanning. CCD is divided into area array and linear array. The area array is a device that arranges CCD pixels into a plane; while the linear array is a device that arranges CCD pixels into a straight line. In this design, linear CCD is used as the image sensor element.

In this design, the TSL1401CL linear CCD is selected. The TSL1401CL linear sensor array consists of a 128×1 photodiode array, a related charge amplifier circuit, and an internal pixel data holder. The array consists of 128 pixels, each of which has a photosensitive area of ​​3524.3μm2 and an interval of 8μm between pixels. The chip is easy to operate and only requires a serial input signal and a clock signal to read the data.

In CCD acquisition, the exposure time adaptive strategy adopted is shown in Figure 1.

Design of Line-finding Intelligent Vehicle Based on Linear CCD

As can be seen from Figure 1, the exposure time adaptive strategy is a typical closed-loop control. The control object is the exposure time of the linear CCD module, and the feedback is the exposure sensed by the linear CCD. The goal of the adjustment is to set the exposure. The working principle of the controller is to subtract the actual exposure from the set exposure. The difference is the deviation e of the exposure. The exposure regulator uses Kp multiplied by e and adds the last exposure time as the new exposure time for exposure. After the exposure time is adjusted, it directly affects the actual feedback exposure. Repeated adjustments can achieve the purpose of adapting to ambient light. Our approach is to take the average value of the 128 pixel voltages collected at one time as the exposure equivalent. The set exposure is the average voltage of the set 128 pixels.

1.2 Data Processing Algorithm

In image processing, edge detection is used to detect the track. Because the voltage values ​​of the images collected from the tracks are different, a groove of the image will appear at the junction of the edges of the white track and the black track, which is the falling edge of the image value. By marking the coordinates of the 128 image points of the CCD from 0 to 127, the left and right values ​​of the black lines on both sides can be determined.

After obtaining the left and right coordinates, the center line is extracted according to the formula "center line = (left coordinate + right coordinate)/2". Of course, we also need to consider the situation where the side line is lost. We adopt the strategy of filling the line. If the coordinate is lost at this moment, it will be replaced by the coordinate that was not lost at the previous moment. In this way, whether it is a cross bend, a straight road, a curve or a dotted line, it can achieve good recognition and control to adapt to various track requirements.

The traditional PID control algorithm is used to control the motor. PID control is one of the earliest developed control strategies. The PID controller integrates information about the past (I), present (P) and future (D) of the system, and the control effect is satisfactory. More than 95% of industrial control uses the PID structure, which has the advantages of simplicity, good robustness and high reliability.

The schematic diagram of the PID algorithm is shown in Figure 2.

Design of Line-finding Intelligent Vehicle Based on Linear CCD

Among them, the digital PID algorithm formula used is as follows:

Design of Line-finding Intelligent Vehicle Based on Linear CCD

To sum up, the traditional digital PID algorithm or the improved intelligent PID algorithm is used in the closed-loop part of the car control system.

2 Dual-speed control algorithm design

2.1 Traditional speed control algorithm

Since the entire driving process of the car model is constantly changing, the system response is required to be very fast when the track structure is complex and the car model is running at a high speed. Therefore, the speed control must be fast, accurate, and responsive. According to the PID principle, the hysteresis effect of I (integral term) will slow down the control system response. Therefore, in order to adapt to various types of tracks under the high-speed operation of the upright car model, the PI control recommended in the official design plan is abandoned, and the PD control with faster response and faster adjustment speed is adopted.

The upright car model uses dual motors to control the left and right wheels respectively, and turns through the differential speed of the left and right wheels. In the motor control of the upright car, the output of the PWM wave is composed of the upright control quantity, the speed control quantity and the steering control quantity, that is:

Motor output = upright control amount + speed control amount + steering control amount (1)

The control formula in the traditional speed control algorithm is:

Speed ​​control amount = speed setting value = speed measurement value = speed setting value - (left wheel speed + right wheel speed)/2 (2)

From the above formula, we can know that the actual value is the average of the left and right wheel speeds. The speed control amount is added to the left and right motors at the same time, that is, the speed control amount of the left and right motors is always the same. Therefore, we can know that the speed control amount of the left and right motors is always the same. Under the traditional speed control algorithm, the steering control amount is equivalent to a disturbance amount relative to the speed control amount. [page]

2.2 Dual speed control algorithm

The idea behind our dual speed control design is as follows:

Left motor output = upright control amount + left wheel speed control amount + steering control amount (3)

Right motor output = upright control amount + right wheel speed control amount - steering control amount (4)

Because the car remains upright during its driving, the upright value is a fixed value when the car is driving upright, so:

Left speed control value = unfixed value - left wheel speed measurement value (5)

Right speed control value = set value - right wheel speed measurement value (6)

The left and right wheel speed values ​​are given by the wheel speed control quantity and the steering control quantity at the same time.

From this we can see that:

Left wheel speed control value = set value - (speed control value measured value + steering control value measured value)

Right wheel speed control value = set value - (speed control value measurement value + steering control value measurement value)

In fact, the steering control quantity is part of the speed control closed loop. When implemented in C language, the two control quantities are calculated by the same control algorithm. The final output is:

Motor output = upright control + speed and steering control

From the principle, it can be seen that when driving on a straight road, because the steering control amount is close to zero, the traditional speed control is the same as the speed output under the dual-speed control we use. When turning, the PID control after image acquisition generates the turning control amount, forming the left and right wheel differential, so that the car model can turn. In the traditional speed control mode, the turning control amount is not adjusted by the speed control. The turning amount is a disturbance relative to the speed control parameter. Under the dual-speed control algorithm, the turning amount affects the current tire speed, so it is adjusted by the wheel speed control. Under dual-speed control, when the car model runs and turns, the dual-speed control will actually slow down the car model's cornering control speed and speed up the car model's cornering control speed. In terms of experimental results, because the dual-speed control slows down the car model's cornering control amount, it greatly reduces the side slip and rollover caused by the car model's rapid cornering. The rapid adjustment of the cornering allows the car model to adjust its position faster after the cornering, which is convenient for handling special track conditions such as obstacles, dotted lines, and starting lines after the cornering. Therefore, under dual-speed control, the speed control amount is not zero when turning, which is equivalent to that there is always a speed closed loop when the system turns, and the left and right differential speeds of the wheels are controlled by the speed closed loop.

3 Experimental data

The following are the shortest times that the system can pass under different road conditions, measured by the photoelectric gate, as listed in Table 1.

Design of Line-finding Intelligent Vehicle Based on Linear CCD

From the above data, it can be seen that the speed improvement brought by dual-speed control is more obvious when there are more curves, but the improvement is not significant in continuous small S curves.

In this smart car competition, the biggest test for the speed improvement of the photoelectric balance car is the obstacle section, which was added for the first time in this smart car competition. The biggest difficulty in the obstacle section is that when the car model passes the obstacle in an upright state, it is unpredictable whether the left wheel or the right wheel of the car model will pass the obstacle first. When the car model passes the obstacle at high speed, the car model will be in the air and the car model motor will stall. When the motor stalls, it is also uncontrollable which left or right wheel will land first when the car model lands. As a result, the speed of the car model returning to the ground is uncontrollable, causing the car model to fall to the ground or roll over.

Dual speed control can greatly reduce the stall of the car model when passing obstacles. When the car model passes an obstacle, no matter whether the left wheel or the right wheel passes the obstacle first, the wheels will stall. Under dual speed control, the speed control of the dual motors is independent. Since the motor control adopts PD control with a fast adjustment speed, the motor can be controlled to quickly adjust the body posture after the stall returns to the ground. Under the condition of a low center of gravity of the body, a single obstacle can be passed at high speed. After repeated tests, dual speed control under PD control can well overcome the impact on the car model when the car model passes obstacles, and the effect is very good.

Conclusion

In this competition, the organizing committee required the photoelectric group to stand upright for the first time. This design is based on the Freescale K10 chip and is the first attempt to use linear CCD as an image processing sensor. According to the image collected by the linear CCD, through the PID control principle, the dual-speed control algorithm is used to achieve good processing of highly complex road conditions, obstacles, etc., with good results.

Reference address:Design of Line-finding Intelligent Vehicle Based on Linear CCD

Previous article:Thoroughly understand the dual-core CPU Intel and AMD multi-core processor anatomy
Next article:Research on embedded industrial Ethernet control scheme

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号