4.1. Problem Description of Time-Optimal Trajectory Planning
In the process of trajectory planning, if only the constraint condition of the angular acceleration of joint
i is considered, then a time
t can be found such that when the manipulator is running along the trajectory, the maximum angular acceleration of joint
i reaches the angular acceleration constraint condition of joint
i;
t at this time is the shortest time that only considers the constraint condition of the angular acceleration of joint
i. A block diagram of TOTP is shown in
Figure 6. The joint parameters (
) after each trajectory planning and inverse kinematic were compared with the joint constraints, and a time search was performed.
The joint constraints of the manipulator are listed in
Table 2;
represents the joint angular velocity constraint,
represents the joint angular acceleration constraint. There were 12 constraints corresponding to the 12 shortest times. Using the minimum–maximum rule, the maximum value of the 12 shortest times is the shortest time of the trajectory.
If
or
satisfies Equations (45) and (46), joint
i is considered to have reached the angular velocity or angular acceleration constraint.
Among them,
,
and
are the maximum angular velocity and maximum angular acceleration generated by the
-th joint during operation, respectively.
Let
be the shortest time that only considers the angular velocity constraint of joint
i,
is the shortest time that only considers the angular acceleration constraint of joint
i, and
is the shortest time that the manipulator runs along the Cartesian space trajectory. The problem of TOTP can be described by Equations (47)–(49).
where
.
are the position, velocity, and acceleration of the trajectory planner to plan the trajectory of the end of the manipulator in Cartesian space, respectively, and
represents the inverse position-level kinematic.
It can be seen from Equations (47)–(49) that, to solve the shortest time, Equation (48) or Equation (49) needs to be calculated at least once. To solve
, Equations (48) and (49) must be calculated at least 12 times. Therefore, to reduce the amount of calculation, let
be the shortest time of the trajectory satisfying the angular velocity constraints of the six joints of the manipulator, and
be the shortest time of the trajectory satisfying the angular acceleration constraints of the six joints of the manipulator. The shortest time
of the Cartesian space trajectory can be expressed as Equations (50)–(52).
Solving
requires calculating Equations (51) and (52) at least once, which reduces the amount of computation to 1/6 compared with using Equations (48) and (49). Considering the 12 constraints of the manipulator joints, the shortest time
of the Cartesian space trajectory can be further expressed by Equation (53).
The
can be obtained by computing Equation (53) at least once. The condition for determining whether the trajectory is time-optimal is shown in Equation (54).
Equation (53) describes the TOTP problem for the Cartesian spatial. Next, it is necessary to use a nonlinear search algorithm to determine the shortest time t of the trajectory, such that the trajectory of the joint space of the manipulator satisfies Equation (54).
4.2. Time-Search Algorithm
This section introduces three kinds of time-search algorithms, which are BA, GDM-CPC, and ATSA-FC. By judging whether the joint trajectory corresponding to the shortest time satisfies Equation (54), the validity of the trajectory is verified. By comparing the execution times of the three algorithms, the efficiency of the ATSA-FC algorithm is verified.
The BA is a widely used search method. Its computational complexity is O(
log(
n)). Therefore, despite the large amount of data, this search method ensures high computational efficiency [
23]. The premise of using BA is that the data must be an ordered sequence, and the time series is exactly an ordered sequence, which makes it suitable for using BA. In this paper, the BA method was used to search for the shortest time of the trajectory in the time interval
. The input time for the initial trajectory planner is
. The flowchart of BA is shown in
Figure 7.
The algorithm first uses
as the running time to plan the trajectory. If the planning result does not satisfy the conditions of the time-optimal trajectory, it is necessary to determine whether the maximum angular velocity and maximum angular acceleration of all joints are within the constraints of the angular velocity and angular acceleration of the joints. The judgment condition is shown in Equation (55).
If the joint trajectory satisfies Equation (55), then let , otherwise, let . Then, let , input it into the trajectory planner as the running time of the trajectory, iterate continuously, and finally determine the shortest time .
However, these algorithms have limitations. When the shortest time of the trajectory is not in the given time interval, the algorithm will fail and enter an infinite loop, and the time of each planning will be infinitely close to the boundary of the given time interval.
Therefore, this paper uses GDM-CPC to solve this problem. GDM-CPC is a first-order optimization algorithm that can search for a local minimum of the function. Because this paper uses Equation (54) as the judgment condition of time-optimal trajectory, there is only one joint to reach its maximum constraint, and the angular velocity and angular acceleration of the other joints are less than their maximum constraint. Therefore, the use of GDM-CPC here will not fall into the local optimal situation, and must be able to obtain a shortest time of trajectory that satisfies all joint constraints. GDM-CPC first provides an initial trajectory running time , and then determines whether the joint trajectory satisfies Equation (54) after obtaining the joint trajectory of the manipulator through trajectory planning and inverse kinematics. If Equation (54) is not satisfied, then searching for a new trajectory running time, and the shortest running time of the trajectory, will finally be obtained. The advantage of this algorithm is that it only needs to provide a time value greater than 0 to converge to the shortest time of the trajectory, thereby avoiding the limitations of BA.
The flowchart of GDM-CPC is shown in
Figure 8.
Among them,
is shown in Equation (56) and
is shown in Equation (57).
where
is the time at which joint
i is optimized with
each time and
is the time at which joint
i is optimized with
each time.
If , the current input time is small, and the maximum angular velocity of joint i exceeds its angular velocity constraint during the trajectory planning process. The time change is , which increases the input time to reduce the maximum angular velocity of joint i. If , the current input time is large, and the maximum angular velocity of joint i is less than its angular velocity constraint during the trajectory planning process. The time change is , reducing the input time to increase the maximum angular velocity of joint i. The joint angular acceleration has the same adjustment process. Take the maximum value of and and assign it to t as the input of the trajectory planner. In the continuous iterative process, the shortest time of the trajectory will be obtained.
Because must be adjusted many times, the algorithm will have fewer convergence steps. Therefore, this paper proposes an ATSA-FC. This method adaptively adjusts according to and by using fuzzy control.
Fuzzy control is a control method that combines an expert system, fuzzy set theory, and control theory, and is very different from traditional control theory based on the mathematical model of the controlled process [
29]. The behavior and experience of human experts can be added to fuzzy control. Fuzzy control is practical when establishing a mathematical model for a controlled process is difficult.
This paper considers a design for a first-order fuzzy controller to adjust the value of
. First, the input linguistic variable is fuzzified. Let the input linguistic variable be
, where
is the smallest absolute value between
and
. Let the domain of
be
,
, and divide it into five fuzzy sets, which are
NB,
N,
ZE,
P, and
PB, respectively.
NB stands for negative big,
N for negative,
ZE for zero,
P for positive,
PB for positive big. The membership function corresponding to each fuzzy set is a Gaussian distribution function, as shown in
Figure 9.
The expression of the membership function for each fuzzy set is shown in Equation (58).
where −
a <
x <
a.
Second, the output linguistic variable is fuzzified. Let the output linguistic variable be
, and let the domain of
be
,
, and divided into three fuzzy sets, which are
S, M, L.
S represents small
values,
M represents medium
values, and
L represents large
values. The membership function corresponding to each fuzzy set is a Gaussian distribution curve, as shown in
Figure 10.
The expression of the function corresponding to each fuzzy set is shown in Equation (59).
where
b < y < c.
Fuzzy control rules are then established and fuzzy reasoning is performed. After determining the fuzzy sets of the input and output linguistic variables, fuzzy conditional statements in the form of an
IF–THEN are used to establish fuzzy control rules. The fuzzy rules are as follows:
When is NB or PB, it indicates that the difference between the maximum joint angular velocity or maximum angular acceleration and the constraints is large. At this time, a larger value should be output and the convergence step should be increased. When is N or P, it indicates that the difference is medium, and a medium value should be output at this time. When is Z, it indicates that the difference is small. A small value should be output to reduce the convergence step and avoid repeated oscillations.
The flowchart of ATSA-FC is shown in
Figure 11.
The
FC is the fuzzy control function, and the
FR is the fuzzy control rule, and Δ
ϑ is shown in Equation (60).
Take the maximum value of and and assign it to t as the input of the trajectory planner. In the continuous iterative process, the shortest time t of the trajectory will be obtained.