• 沒有找到結果。

Chapter 4 Path Analysis Using Ultrasonic Signals

4.4 Algorithm of Proposed Method for Path Analysis

In this section, an integral algorithm of the proposed procedure of path analysis is described. As mentioned previously, a learned path is separated into segments by the turning nodes. Each segment is given a record with five kinds of information by path analysis in this study. The path data for navigation is a collection of these records. The integral algorithm of the proposed method for path analysis is shown in Algorithm 4.6.

Algorithm 4.6 Path analysis.

Input: A learned path data with n turning nodes.

Output: A path data for navigation in the form of an array R with n elements with each element being a record including the five kinds of information as mentioned in Section 4.2.

Steps:

Step 1. Separate the learned path data into n segments by the turning nodes, where n is the number of turning nodes.

Step 2. For every segment k from the start segment 1 to the final segment n, use the data of segment k as the inputs and perform Algorithms 4.1, 4.2, 4.3, 4.4, 4.5, and combine their output information into an array R.

Step 3. Save the information of R as output.

Chapter 5

ALV Navigation by Ultrasonic Signal Sequence and Fuzzy Logic Control

5.1 Introduction

After the vehicle finishes the learning work and obtains the path data for navigation by path analysis, it will utilize them to act as a guide. In this chapter, we introduce the details of the proposed navigation procedure. In Section 5.2, we describe how to use fuzzy logic control techniques in the proposed method. Furthermore, we also describe how to combine the path data for navigation with the proposed fuzzy controller.

In Section 5.3, we describe how to use the path data for navigation to detect whether the vehicle arrives at a turning node or not. The path data for navigation includes five kinds of information and these five kinds are described in Section 4.2. We also describe how to use other kinds of information during navigation in this section. These kinds of information include intolerable distances between the vehicle and obstacles in front of the vehicle, when to introduce objects or places as a guide, and when to stop.

Finally, we summarize the above-mentioned techniques and describe an algorithm of the proposed navigation procedure in Section 5.4. An illustration of the navigation procedure is shown in Figure 5.1.

Figure 5.1 Illustration of proposed navigation procedure.

5.2 Proposed Fuzzy Logic Control Techniques for Navigation

5.2.1 Proposed method for controlling vehicle direction

When the vehicle navigates on an environment like a corridor, etc, we desire that it can go straight and does not hit walls. However, the vehicle may go on a curve path because of incremental mechanic errors. Therefore, it needs to correct its direction by some other information during navigation. The environmental feature used to correct the vehicle’s direction is walls. If an environment includes both walls on its left- and right-hand sides, we desire that the vehicle can navigate in the middle of the walls in the environment.

However, the vehicle may go across some environments like an entrance hall, etc. These environments may not include walls continuously. For example, an elevator, an opened door, a sofa, a potted flower, etc, may be in these environments. The vehicle can detect some information of walls in such environments, but the information is not very much. In this situation, if the information is enough to some degree, we desire that the vehicle can also navigate almost in the middle of them in the environments. These are the main ideas to design the fuzzy controller for use in this study.

If the vehicle cannot detect any information of walls in an environment or if an environment includes too many objects so that the vehicle cannot detect any useful information of walls in the environment, these situations are out of our assumptions in this study.

In the proposed fuzzy controller for controlling the vehicle’s direction, some situations are handled. The first is that if the vehicle is on or close to the left- or the right-hand side of an environment, then it has to conduct fine tuning. In this situation, wall distances in

both on its left- and right-hand sides, we desire that the vehicle can navigate in the middle of the walls in the environment. Therefore, the vehicle needs the information of the wall distances in the environment to decide whether it is in the middle of the walls in the environment or not. However, if the environment includes only a wall on its left- or right-hand side, the vehicle has to keep the same distance as it learned from the wall.

Therefore, the information of wall distances obtained from path analysis is used to denote the membership functions of the designed fuzzy controller.

The second is that if a deviation from the vehicle’s direction is large, then it should not turn to the same direction again, because it may hit walls or objects and cannot conduct fine tuning by ultrasonic sensors. In order to deal with this situation, the system uses two kinds of features, which are distances obtained from ultrasonic sensors and an accumulated angle from the system’s commands issued so far. Distances obtained from ultrasonic sensors can used to estimate the relative directions between walls and the vehicle. However, they are not always credible. For example, if the vehicle goes across an edge of a door, the estimated relative direction between the wall and the vehicle may be very large because of the depth of the door.

In this situation, the vehicle should keep going straight and not turn. Therefore, a variable is used to record whether the estimated relative direction is credible or not.

Furthermore, if the vehicle is in a wide environment, it may turn to the same direction many times so that the estimated relative direction is not correct. The accumulated angle from the system’s commands is another feature to deal with such a situation. However, the accumulated angle may not always be correct because the vehicle has mechanical errors.

Therefore, a method is proposed to correct the accumulated angle. The idea of this method is that if the vehicle finds out that it is almost parallel to the walls, then it resets the accumulated angle to be zero.

5.2.2 Proposed fuzzy controller

According to the just-mentioned idea, the input variables for the proposed fuzzy controller are DL, DR, and DIR. DL and DR are represent as the distances between the vehicle and the respective walls of the left- and right-hand sides of the vehicle. The values of DL and DR are measured from ultrasonic sensors Nos. 0 and 7.

Five fuzzy terms are denoted for each of the input variables, DL and DR. They are nearer (NE), near (N), middle (MI), far (F), and farther (FE). The membership functions of these fuzzy terms are illustrated in Figure 5.2.

Figure 5.2 The membership functions of the five fuzzy terms, NE, N, MI, F, and FE, where d is the distance obtained by ultrasonic sensor No. 0 or 7, and w is the distance between walls.

DIR represents the deviation from the vehicle’s direction. The value of DIR is obtained from combining with the detected values of ultrasonic sensors Nos. 0, 7, 8, 15, and an

The degree that d belongs to NE, N, MI, F, FE.

μ

NE

(

d

)

0.2w 0.4w 0.5w cm

μ

N

(

d-

)

0.5w-10 0.5w+10 0.8w

μ

MI

(

d

) μ

F

(

d

) μ

FE

(

d

)

1.1w

for the input variable, DIR. They are very left (VL), left (LE), parallel (PA), right (RI), very right (VR), and unbelieving (UB).

Each of the fuzzy terms of the input variable DIR is obtained from operating several fuzzy sets. These fuzzy sets can be separated into three groups. The first is the estimated angle from ultrasonic signals on the left-hand side of the vehicle. The second is the estimated angle from ultrasonic signals on the right-hand side of the vehicle. The third is the accumulated angle from the system.

Using distances obtained from two parallel ultrasonic sensors can compute an estimated relative angle between the vehicle and a wall on its left- or right-hand side. Assume that the distance between ultrasonic sensors Nos. 0 and 15 is DUS, which is the same as the distance between ultrasonic sensors Nos. 7 and 8. An illustration of DUS is shown in Figure 5.3.

According to DUS and the distances detected by ultrasonic sensors Nos. 0 and 15, the system can compute the deviation from the vehicle’s direction. Similarly, according to DUS and the distances detected by ultrasonic sensors Nos. 7 and 8, the system can obtain another value of the deviation. The former is represented as θL and the latter is represented as θR. They are obtained as follows:

tan θL = (V0, i − V15, i) / DUS;

tan θR = (V8, i − V7, i) / DUS, (5.1)

where Vm, i is the value detected from ultrasonic sensor No. m on position i. A minus value of θL or θR means that the direction of the vehicle is left. In order to avoid computing “/ DUS”

repeatedly, two variables, VEL and VER, are denoted as follows:

VEL = (V0, i − V15, i) = tan θL × DUS;

VER = (V8, i − V7, i) = tan θR × DUS. (5.2)

autonomous vehicle

Figure 5.3 An illustration of DUS, the distance between ultrasonic sensors Nos. 0 and 15.

Five fuzzy sets are used to decide whether the estimated relative angle, VEL or VER, is very left (D1), left (D2), straight (D3), right (D4), or very right (D5). The membership functions of these five fuzzy sets are shown in Figure 5.4. However, as mentioned previously, if the vehicle goes across an edge of a door, the estimated relative angle between the wall and the vehicle may be very large because of the depth of the door. In other words, if an environment changes suddenly, the vehicle may not obtain a correct estimated relative angle between the wall and itself. Therefore, two more fuzzy sets, CRL and CRR, are used for deciding whether the estimated relative angle from ultrasonic signals on the left- or right-hand side of the vehicle is credible or not respectively.

The just-mentioned two fuzzy sets are both obtained from five fuzzy sets respectively.

The main idea for designing these five fuzzy sets can be categorized into three situations. The first is whether the distance detected from ultrasonic sensors Nos. 0, 7, 8, or 15 is too large or not. If the answer is yes, then the estimated relative angle is not credible, because the vehicle cannot detect any wall. The second is comparing the values of the ultrasonic signals on the current node with the values on the last node. If the differences between these two kinds of values are not small, then the estimated relative angle is not credible, because the environment

may change suddenly. The third is comparing the values from two parallel ultrasonic sensors on the current node. If the differences between the values from the two parallel ultrasonic sensors are not small, then the estimated relative angle is not credible, because the environment may change suddenly, too. Two fuzzy sets are used to deal with the above-mentioned three kinds of situations and their membership functions are shown in Figure 5.5. The membership function in Figure 5.5(a) is for the second and third situations, and the membership function in Figure 5.5(b) is for the first situation.

Figure 5.4 Membership functions of the estimated relative angle, VEL or VER, and represented as very left (D1), left (D2), straight (D3), right (D4), or very right (D5).

The degree that s belongs to D1, D2, D3, D4, or D5.

μ

D1

(

ve

)

ve : the different distance obtained by the above-mentioned way.

tan(-10°)×DUS

cm

μ

D2

(

ve

)

μ

D3

(

ve

)

μ

D4

(

ve

) μ

D5

(

ve

)

tan(-5°)×DUS

tan(-2.5°)×DUS

tan(0°)×DUS

tan(2.5°)×DUS

tan(5°)×DUS

tan(10°)×DUS

Figure 5.5 Membership functions of credibility CRL and CRR.

In addition, as mentioned previously, if the vehicle is in a wide environment, it may turn to the same direction many times so that the estimated relative direction is not correct. The accumulated angle from the system’s commands is another feature to deal with such a situation. Five fuzzy sets are used to decide whether the accumulated angle is very left (AC1), left (AC2), straight (AC3), right (AC4), or very right (AC5). The membership functions of these five fuzzy sets are shown in Figure 5.6(a). However, the accumulated angle may not always be correct because the vehicle has mechanical errors. Therefore, a fuzzy set CRA is used to decide whether the accumulated angle is credible or not. The membership function of CRA is shown in Figure 5.6(b).

VL (very left) is one fuzzy term of the input variable DIR (the deviation from the vehicle’s direction). The main steps which are used to obtain the degree of an input value which belongs to VL from the above-mentioned fuzzy sets and the idea are shown in Algorithm 5.1. The other fuzzy terms of DIR are denoted in a similar way except the fuzzy term UB (unbelieving).

The main idea in defining the fuzzy term UB is that if an input value satisfies the constraint that the estimated relative angle is not credible and the accumulated angle is not

4 6 cm 480 500 cm

AND

(a) (b)

= CRL or CRR

AND

(a) The membership function of CRA.

(b) The membership functions of the fuzzy sets, AC1, AC2, AC3, AC4, and AC5.

Figure 5.6 The membership functions of the just-mentioned fuzzy sets.

In Algorithm 5.1, FL, FR, and FA are three fuzzy sets preselected to decide three situations: whether the estimated relative angle from ultrasonic sensors Nos. 0 and 15 is very left or not, whether the estimated relative angle from ultrasonic sensors Nos. 7 and 8 is very

The degree that a belongs to AC1, AC2, AC3, AC4, or AC5.

μ

AC1

(

a

)

a : the accumulated angle.

-89.9999°

μ

AC3

(

a

)

μ

AC4

(

a

) μ

AC5

(

a

) μ

AC2

(

a

)

-5° -2.5° 0° 2.5° 5° -89.9999°

The degree that a belongs to CRA.

a : the accumulated angle.

μCRA(a)

-10° 0° 10°

left or not, and whether the accumulated angle from the system’s commands before is very left or not. CRL, CRR, and CRA are three fuzzy sets preselected to decide whether the above-mentioned three kinds of detected values are credible or not, respectively.

Algorithm 5.1 Obtaining a degree of an input value which belongs to VL (very left).

Input: the value of the input variable DIR (the deviation from the vehicle’s direction), which includes the detected values of ultrasonic sensors Nos. 0, 7, 8, 15, and the accumulated angle from the system’s commands issued before; the just-mentioned three fuzzy sets, FL, FR, and FA, preselected for decide whether the estimated relative angles or the accumulated angle is very left or not; the three fuzzy sets, CRL, CRR, and CRA, preselected to decide whether the above-mentioned three kinds of detected values are credible or not, respectively.

Output: The degree of the input value belonging to VL.

Step 1. Decide whether the ultrasonic signals from ultrasonic sensors Nos. 0 and 15 are credible or not by using the fuzzy set CRL.

Step 2. Decide whether the ultrasonic signals from ultrasonic sensors Nos. 7 and 8 are credible or not by using the fuzzy set CRR.

Step 3. Combine the above-mentioned six fuzzy sets to be the fuzzy set VL according to one of the following rules.

3.1 If the ultrasonic signals on the left-hand side of the vehicle are credible, set VL as VL = CRL ⋅FL + CRA ⋅FA.

3.2 If the ultrasonic signals on the right-hand side of the vehicle are credible, set VL as VL = CRR ⋅FR + CRA ⋅FA.

3.3 If the ultrasonic signals on both sides of the vehicle are credible, set VL as VL = (CR ⋅FR + CR ⋅FL) + CR ⋅FA.

3.4 If the ultrasonic signals on both sides of the vehicle are credible, set VL as VL = CRA ⋅FA.

Step 4. Use the input value of the input variable DIR into VL and output the degree of the input value which belongs to VL.

In Algorithm 5.1, the operator “ + “ is the operator of the algebraic sum operation on fuzzy sets, and the operator “ ⋅ ” is the operator of the algebraic product operation on fuzzy sets.

The output linguistic variable is denoted as ANGLE, which represents the angle and direction used to adjust the vehicle’s direction. Eight fuzzy terms are denoted for the controlled linguistic variable. The first seven fuzzy terms are from negative large to positive large. The negative large means that the vehicle turns a large angle to the left. Similarly, the positive large means that the vehicle turns a large angle to the right. The membership functions of the seven fuzzy terms of the linguistic variable ANGLE are illustrated in Figure 5.7. The last fuzzy term means that the vehicle should stop.

A total of 150 fuzzy rules are represented as a fuzzy rule matrix which is shown in Table 5.1, and the fuzzy terms of the output variable ANGLE is represented as eight numbers which are described in Table 5.2. The form of each fuzzy rule is:

Ri : IF DL is Ak, DR is Bk, AND DIR is Ck, THEN ANGLE is Fj. (5.3) where Ak and Bk represent the linguistic values of the five fuzzy terms NE, N, MI, F, FE,

respectively; Ck represent the linguistic values of the six fuzzy terms VL, LE, PA, RI, VR, and UB; and Fj represents the linguistic values of the eight fuzzy terms of the output variable.

Finally, the method used to defuzzify the fuzzy output is the discrete fuzzy centroid defuzzification.

5.3 Vehicle Turning Technique

A learned path is segmented into several pieces by the turning nodes before being analyzed, and each segment is given a record, which includes the five kinds of information, as mentioned in Section 4.2. In other words, if the learned path includes n turning nodes, and then the path data for navigation includes n+1 records. Furthermore, each record includes five kinds of information. These five kinds of information are listed again in Table 5.3.

Figure 5.7 The membership functions of the seven fuzzy terms of the output linguistic variable ANGLE where θ is the angle which the vehicle needs to turn.

The vehicle can know when to turn by using the information TTURN of the path data for navigation. Therefore, if the system’s running time is less than BEFORE, the vehicle uses the designed fuzzy controller to adjust its direction. If the system’s running time is over BEFORE, the vehicle detects whether walls on its left- or right-hand side or not by ultrasonic sensors. If

-5 -4 -3 -2 -1 0 1 2 3 4 5

μ

0

(

θ

)

μ

1

(

θ

) μ

2

(

θ

)

μ

3

(

θ

) μ

4

(

θ

)

μ

5

(

θ

) μ

6

(

θ

)

0 1

The degree thatθbelongs to the fuzzy terms

the vehicle cannot detect any wall on the side as recorded in TDIRECT for a period of time continuously and this period of time is over NDETECT, then it turns to the direction as TDIRECT and read the information of the next segment. The detail of the turning technique is described in Algorithm 5.2.

Table 5.1 The fuzzy rule matrix for controlling the vehicle direction.

DL DIR \ DR NE N MI F FE

In addition, if the vehicle detects any obstacle to be in front of it by ultrasonic sensors and the information IDIS, then it stops for a period of time for the obstacle, which may be a person or a moving object in this case, to move away. Afterward, the vehicle restarts to navigate.

Table 5.2 The fuzzy terms of the output variable ANGLE.

ANGLE

Left-hand rotation--- straight --- Right-hand rotation Large angle of rotation ---zero--- Large angle of rotation Stop

0 1 2 3 4 5 6 7

Table 5.3 All kinds of the information of the path data for navigation.

Type Items (if exist) Meaning

TDIRECT This is the turning direction obtained from the learned path data directly.

NDETECT This is a period of time from arriving at a turning corner to arriving at the turning node.

TTURN

BEFORE The period of time before which the vehicle cannot turn.

WNUM The number of the wall distances.

WVALUE This records each value of the wall distances.

WDIS

WTIME This records when to use the respective wall distances of

WTIME This records when to use the respective wall distances of