Non-uniform driving memory algorithm based on smart car

Hardware implementation principle

This article refers to the address: http://

According to some provisions of the competition, this paper designed the hardware block diagram shown in Figure 1. The infrared sensor adopts a row of 13 pairs of infrared transmitting and receiving tubes, and the level of the received level passes through the MCU's ADC, and the MCU determines the position of the current black line. In order to reduce power consumption, the MOS switch tube is also added in the system. When an infrared sensor is detected, the sensor is powered on and the rest is turned off. There is a crossroad in the track, and the start (ie the end line) must be judged. Therefore, the smart car can pre-configure the total number of crosses on the current track, and at the same time, it can be judged by software algorithm whether it passes through the century intersection (from the beginning The line can be used as a cross line). When the system is running, according to the information collected by the infrared sensor, the position of the current guide line can be determined, that is, how much is deviated from the left, middle or right side of the trolley. The MCU determines the current speed of the trolley according to the speed of the current trolley and the speed of the current speed sensor. Behavior, mainly controlling the steering gear, that is, the direction of the trolley and the speed of the motor, that is, the trolley.

Figure 1 system hardware block diagram

Software control algorithm

The system software control mainly consists of two parts, namely the two processes of the memory algorithm. The first and second laps are seen from the driving process, and the flow block diagram is shown in Figure 2.

Figure 2 system software control flow chart

Primary circle control and memory

The main purpose of the smart car in the first lap is to remember the track information characteristics and perform certain processing. According to the conventional method, the trolley needs to travel at a constant speed to memorize relevant road information at fixed time intervals or fixed distance intervals. In the data memory, 12 magnetic steel Hall sensors are used, and the wheel turns 12 times to obtain 12 counts. Even in the case of fast speed, the response time is us-level, and the accuracy is sufficient.

Under non-uniform conditions, a new data storage format was adopted. First, the current state is judged to be straight, and according to the corner value c_ang of the steering gear obtained by the confused control, it is judged that the current vehicle is straight. At the same time, because the car is driving at a non-uniform speed, and the time interval and the distance between the second lap are not necessarily the same as the first lap, only the straightening condition is judged. When cornering, the corner of each test point is memorized. Value, while in the straight, there is no need to store the corners, but also save a lot of storage space, so only the starting point and the end point of the straight road are memorized for the straight road, and the distance is the absolute distance of the trolley relative to the starting point, that is, the Hall sensor The number of detected magnetic steels ect_cnt.

The system performs data storage according to the different conditions of the previous state and the current state. The algorithm is as follows: the current state is a curve, and when the current state is a straight track, that is, a straight state, 0x7f, ect_cnt is written, where ect_cnt is current. Path count; when straight, no storage; when straight, write current ect_cnt, 0x7f, current c_ang; when bending, write c_ang. When the system is initialized, it is a curve. After starting to drive, it enters the starting line. At this time, it detects a straight road and enters the straight state. It writes 0x47 and the current ect_cnt. This is the starting storage data of the road.

Data analysis and processing

When the second round passes the running line, the system is configured to enter the straight state. At this time, the length of the straight track should be calculated according to the data recorded in the first circle, so that the car can be exercised at a high speed in a straight line, and can be decelerated in advance, safe. Into the bend, to achieve a good control effect.

When a straight line is made in a straight line, if a straight line appears in the curve and the length is calculated to be less than a certain value, it is considered that the small-scale straight line appearing during the bending process is still processed according to the curve. The core of the algorithm is also how to filter the straights that appear in the curve, and from the analysis of different corner forms. Divide the corners into the following categories:

(a) Sharp bend: The sharp bend mentioned here is the bend with the smallest curvature specified in the competition. In sharp corners, the number of corners is relatively small, the corner values ​​are relatively large, and under normal conditions all are in the same direction.

(b) Round curve: Compared with other track elements, the recognition of the circular track is relatively simple. When the corner of the same direction is larger than a certain value, and there is no commutation in the middle process, Think of the car entering the round track. Because of the angle control, the system uses fuzzy control, the car can quickly adjust the angle when entering the corner, and bend at a constant angle, the above data is to verify this result.

(c) Small S-bend: The characteristic of the small S-bend is that there are both left and right turns in the whole process of cornering, and the number of left-turning angles and the number of right-turning angles should be larger than one. value. In addition, the number of angles of a single left turn or right turn is less than a certain value. Considering that before and after the small S may follow other corners, the system walks according to its curve before the first commutation point, adopts the walking strategy of small S after the reversal point, and ends before the last reversal point. .

(d) Large S-bend: The big S is similar to the small S in terms of track characteristics, but the criteria for judgment are slightly different. First of all, there is a long distance between the big S, and the judgment range of the straight road must be increased to filter it out. Second, the number of angles for a single left turn or right turn should be greater than the number of small S.

For the above track analysis, the system first distinguishes the next track elements, and then controls the driving speed and direction of the second circle according to the driving strategy. The main idea is:

(a) Straight road driving: divide the straight road into short straight road and long straight road. The short straight road will be generally accelerated; the long straight road will accelerate at the beginning, and the end will be linearly decelerated, and the speed will be divided into high speed, medium speed and low speed. From high to medium to low. It has been found through experiments that when the car is turned from high speed to low speed, the car is unstable when it is cornering, and it is easy to measure the slip, which not only affects the speed but also slows the start. After the linear type is decelerated, the curve is smooth and can achieve good results. This avoids some of the limitations of the car itself, such as the servo response time, track friction coefficient, tire grip, sensor layout and other factors, the linear speed can not be added to the highest disadvantage.

(b) For a small S, ideally, the same effect as the CCD is achieved, and a high-speed straight cornering strategy is adopted. For safety reasons, it is also possible to adopt a hysteresis over-bending strategy to allow the smart car to take a small corner and turn it at a high speed.

(c) For the Big S track, the different curvature curves, the car has its optimal limit speed. Using the initial circle to get the radius of curvature of the curve and the length of the line between the S-channels, the speed of the vehicle is adjusted to its corresponding limit speed when the corners pass, which is theoretically the best result that it can run.

(d) For a circular curve, a trade-off is required between the curvature of the curve and the speed of the cornering. When the curvature of the travel is large, then the car can travel at a higher speed. When the inner ring is removed, due to the decrease of the radius and the increase of the centrifugal force, the car cannot be driven at a higher speed, but can be found between the two. The balance point.

Led Inground Light are using a famous led chip, CREE,OSRAM,Epistat, Bridgelux etc.,energy saving and environmental protection, long service life. Have RGB with DMX control or single color white, warm white, yellow, red, green, blue etc. for option. Die cast aluminum Lamp body, 304 stainless steel casting surface cover, high performance on corrosion resistance. With plastic embedded parts for convenient installation and maintenance. Widely used in School, hotel, parks, path, garden, roads, building square ground floor shopping malls, pedestrian streets, corridor lighting and other outdoor underground decorative places,ect..

Led Inground Light

Led Inground Light,Exterior Led Lighting,Outdoor Ground Lighting,Ground Lights For Driveways

Guangdong guangzhidian lighting Co., Ltd. , http://www.gzd-led.com