Time-Optimal Asymmetric S-Curve Trajectory Planning of Redundant Manipulators under Kinematic Constraints

This paper proposes a novel trajectory planning algorithm to design an end-effector motion profile along a specified path. An optimization model based on the whale optimization algorithm (WOA) is established for time-optimal asymmetrical S-curve velocity scheduling. Trajectories designed by end-effector limits may violate kinematic constraints due to the non-linear relationship between the operation and joint space of redundant manipulators. A constraints conversion approach is proposed to update end-effector limits. The path can be divided into segments at the minimum of the updated limitations. On each path segment, the jerk-limited S-shaped velocity profile is generated within the updated limitations. The proposed method aims to generate end-effector trajectory by kinematic constraints which are imposed on joints, resulting in efficient robot motion performance. The WOA-based asymmetrical S-curve velocity scheduling algorithm can be automatically adjusted for different path lengths and start/end velocities, allowing flexibility in finding the time-optimal solution under complex constraints. Simulations and experiments on a redundant manipulator prove the effect and superiority of the proposed method.


Introduction
Trajectory planning is a pivotal technique for motion control, determining the efficiency and quality of task execution in electromechanical systems using robots, computerized numerical control (CNC) machine tools, and automatic machines.Interpolation and velocity scheduling can be performed separately in trajectory planning when the task specifies a path.The non-uniform rational B-spline (NURBS) interpolation technique has emerged as a research trend owing to its excellent ability to shape expression and local modification [1][2][3][4], compensating for the shortage of linear and circular interpolation adopted in robots and CNC machines [5,6].
Various velocity-scheduling approaches, also called acceleration and deceleration (Acc/Dec) control algorithms, have been explored to cooperate with interpolation modules and generate feasible trajectories for electromechanical systems along specified paths [7].From an industrial application perspective, boosting productivity increases economic benefits, making time optimality a major research goal in motion planning.A constant velocity profile with a controlled start-stop phase is recognized as the time-optimal trajectory within the velocity and acceleration limitations of the end-effector.The trapezoidal velocity profile, a linear segment (constant velocity) with parabolic blends, is a common time-optimal trajectory in industrial robots owing to its computational simplicity [8].However, residual vibrations in mechanical systems cause a conflict between the speed and smoothness of the robot's motion.The inherent acceleration discontinuity of the trapezoidal velocity profile brings infinite jerks, causing undesired vibrations.
Based on the simplification of Assumption 1, the symmetrical S-shaped motion profile can be derived, which is critical in the smooth trajectory planning method.FIR filters are widely used in the motion control of automation equipment owing to the ease of hardware implementation.Based on FIR filters, the acceleration continuous motion profile was generalized to a generic model with high-order continuity [24], and a time-optimal characteristic of the reference signal was injected [25].The S-curve of a cubic polynomial can contribute to a tradeoff between motion smoothness and computational complexity.In [26], a time-optimal S-curve trajectory planning approach based on a third-order polynomial model was reported.The motion will be smoother if the snap (the first-order derivative of jerks) or high-order derivative of jerk is limited.Thus, a high-order continuous trajectory is realized by increasing the degree of the polynomial model [27] but causes the Runge phenomenon.The trigonometric function is also an alternative for generating fast movements with low vibration [28], where the jerk can be designed as a sine [29] or cosine waveform [30].In [22], comparisons between the polynomial and trigonometric S-curve models were presented, and a modified sigmoid function was proposed as jerks to derive the infinite-order continuous motion profile.
Researchers have recently focused on asymmetric S-curves to reduce overshoot and suppress residual vibrations.For the seven-phase symmetrical S-curve, a jerk ratio is added to the deceleration block, differentiating it from the acceleration block; however, the jerk of each block remains equal [31].Without Assumption 1, the derivation of the AS motion profile that empowers different jerks in each phase becomes more complicated.Some researchers have adopted Assumption 2 for simplification, resulting in a five-phase S-shaped motion profile.The velocity scheduling process is a constrained optimization problem handled by a non-linear programming solver to minimize the execution time [32].The metaheuristic algorithm can also be applied because of its high computational efficiency and fast convergence.The time-optimal Acc/Dec method for multiple segments with the particle swarm optimization algorithm was introduced in [23] and applied to five-axis machining in [33].As shown in Figure 1, though the five-phase S-curve is easier to derive formulas than the seven-phase profile, it expends more time when a constant acceleration phase is required to reach the maximum velocity.In [34], based on Assumptions 3 and 4, the rest-to-rest seven-phase freeform S-curve velocity planning method was developed to balance execution efficiency and accuracy for a single-segment path.
dundant manipulators with infinite sets of inverse kinematics solutions.A bidirectional look-ahead (BLA) trajectory planning approach was advocated in [35] to reduce the endeffector velocity based on the velocity and acceleration constraints of the joint actuators but with increased execution time.BLA is a conservative strategy.It concentrates on the dangerous paths where constraint violations occur.However, BLA neglects to explore the potential of robots when joint actuators are far from the kinematic constraints.There is an extended execution time due to the conservative joint movements.This study proposes a kinematic constraint conversion method from joint to operation space, reshaping the end-effector velocity-limit curve along the specified path.The optimization-based asymmetric S-curve velocity scheduling is performed on each path segment which is divided at the minimum of the velocity-limit curve.The WOA proposed in [36] is adopted to find the optimal traveling time of the motion profile.The advantages of the proposed method are summarized as follows.

•
The end-effector trajectory is essentially designed by the kinematic constraints of joint actuators rather than the operational-space constraints, which are used for the velocity scheduling of CNC machines [37].

•
This study provides an exact velocity-limit curve of the end-effector, not conservative as BLA described in [35].It helps to explore the maximum capabilities within the kinematic constraints of robots, generating time-optimal trajectories to improve productivity.

•
The meta-heuristic WOA is adopted to find the time-optimal solution.The optimization-based trajectory planning method can flexibly handle complex constraints of the redundant manipulator and avoid solving the deceleration point.

•
The jerk-limited S-shaped velocity profile is categorized into four types depending on the existence of acceleration of deceleration blocks.The WOA-based asymmetric S-curve velocity Acc/Dec can be automatically adjusted for different arc lengths and the starting and ending velocities of a path.
The generated end-effector trajectory is smooth and time-optimal, enabling the maximum capabilities of robots to be unleashed while satisfying both end-effector limits and joint kinematic constraints.
The remainder of this paper is organized as follows.Section 2 proposes the sevenphase asymmetric S-curve Acc/Dec algorithm with the optimization objective of minimizing time.The NURBS trajectory model and time-optimal S-curve trajectory generation method under constraints kinematic are presented in Section 3. The simulation and Figure 1.Comparison between the seven-phase and five-phase S-curves.Solid red line: seven-phase S-curve; dashed blue line: five-phase S-curve.vs. and v e are the velocity at the start and end points, respectively.v max is the maximum velocity.
In addition, unlike CNC machines with simple kinematics, the relationship between the end effector and joint actuators in serial manipulators is non-linear.The smooth motion profile of the end-effector may lead to infeasible joint trajectories, particularly for redundant manipulators with infinite sets of inverse kinematics solutions.A bidirectional look-ahead (BLA) trajectory planning approach was advocated in [35] to reduce the endeffector velocity based on the velocity and acceleration constraints of the joint actuators but with increased execution time.BLA is a conservative strategy.It concentrates on the dangerous paths where constraint violations occur.However, BLA neglects to explore the potential of robots when joint actuators are far from the kinematic constraints.There is an extended execution time due to the conservative joint movements.
This study proposes a kinematic constraint conversion method from joint to operation space, reshaping the end-effector velocity-limit curve along the specified path.The optimization-based asymmetric S-curve velocity scheduling is performed on each path segment which is divided at the minimum of the velocity-limit curve.The WOA proposed in [36] is adopted to find the optimal traveling time of the motion profile.The advantages of the proposed method are summarized as follows.

•
The end-effector trajectory is essentially designed by the kinematic constraints of joint actuators rather than the operational-space constraints, which are used for the velocity scheduling of CNC machines [37].

•
This study provides an exact velocity-limit curve of the end-effector, not conservative as BLA described in [35].It helps to explore the maximum capabilities within the kinematic constraints of robots, generating time-optimal trajectories to improve productivity.

•
The meta-heuristic WOA is adopted to find the time-optimal solution.The optimizationbased trajectory planning method can flexibly handle complex constraints of the redundant manipulator and avoid solving the deceleration point.

•
The jerk-limited S-shaped velocity profile is categorized into four types depending on the existence of acceleration of deceleration blocks.The WOA-based asymmetric S-curve velocity Acc/Dec can be automatically adjusted for different arc lengths and the starting and ending velocities of a path.
The generated end-effector trajectory is smooth and time-optimal, enabling the maximum capabilities of robots to be unleashed while satisfying both end-effector limits and joint kinematic constraints.
The remainder of this paper is organized as follows.Section 2 proposes the sevenphase asymmetric S-curve Acc/Dec algorithm with the optimization objective of minimizing time.The NURBS trajectory model and time-optimal S-curve trajectory generation method under constraints kinematic are presented in Section 3. The simulation and experimental results in Sections 4 and 5, respectively, on the self-developed redundant manipulator demonstrate the performance of the proposed trajectory planning approach.Finally, Section 6 concludes the paper.

Optimization of the Seven-Phase Asymmetrical S-Curve Acc/Dec Algorithm
This section introduces the minimum-time velocity scheduling method under the end-effector limit.The possible S-shaped velocity distribution of the end-effector can be classified into four categories by the path information given in the operation space.For each case, an optimization model with respect to the time parameter is derived which involves formulas of the seven-phase asymmetrical S-curve Acc/Dec algorithm.The meta-heuristic WOA was adopted to find the optimal solution.

Basis of the Seven-Phase Asymmetrical S-Curve
The motion profile of the complete asymmetrical Acc/Dec, comprising seven phases, is shown in Figure 2. Phases 1-3 belong to the acceleration block, phase 4 is a constant velocity block, and phases 5-7 belong to the deceleration block.The total displacement x(τ 7 ) should be equal to the path length L. The velocity at the last instant should be equal to the ending velocity.Thus, the following constraints at the last point are formed: Moreover, the velocity and acceleration at an arbitrary instant should be less than the end-effector motion limits, which gives the constraints of the design parameters as follows: ( ) where amax and vmax are the maximum acceleration and velocity of the end effector, respectively.

Parameters Design of the Seven-Phase Asymmetrical S-Curve Acc/Dec
If the given path length L is sufficiently long, an S-curve motion profile with seven full phases can be obtained.However, one or more of these seven phases probably has zero duration.The S-curve may not simultaneously have acceleration, constant velocity, or deceleration blocks if the distance between the start and end points is short.Thus, the first step is to check the travel distance by defining the reference length L ref =L Acc +L Dec , where: T j (j = 1, 2, . . . , 7)represents the execution time of the jth phase and τ ϕ = ∑ ϕ j=1 T j (ϕ = 1, 2, . . ., 7).J j (j = 1, 2, . . ., 7) denotes the jerk magnitude of the jth phase.L is the path length.vs. and v e are the velocity at the start and end points, respectively.a Acc and a Dec are the maximum accelerations in the acceleration and deceleration blocks, respectively: According to the acceleration-time curve in Figure 2, a(t) can be formulated as follows: The velocity-time relationship v(t) can be derived from its integral relationship with acceleration.The equations for v(t), written as design parameters, are given in Equation (A1) in Appendix A. The integration of the velocity yields the displacement-time relationship x(t), and the corresponding equations are derived in Equation (A2) in Appendix A.
The total displacement x(τ 7 ) should be equal to the path length L. The velocity at the last instant should be equal to the ending velocity.Thus, the following constraints at the last point are formed: Moreover, the velocity and acceleration at an arbitrary instant should be less than the end-effector motion limits, which gives the constraints of the design parameters as follows: where a max and v max are the maximum acceleration and velocity of the end effector, respectively.

Parameters Design of the Seven-Phase Asymmetrical S-Curve Acc/Dec
If the given path length L is sufficiently long, an S-curve motion profile with seven full phases can be obtained.However, one or more of these seven phases probably has zero duration.The S-curve may not simultaneously have acceleration, constant velocity, or deceleration blocks if the distance between the start and end points is short.Thus, the first step is to check the travel distance by defining the reference length L ref = L Acc + L Dec , where: J max (8) in which, J max , A max , and v max are the end-effector jerk, acceleration, and velocity limits, respectively.L Acc and L Dec represent the reference length of the acceleration and deceleration block, respectively, which are calculated by trapezoidal approximation to the corresponding area of the velocity-time curve in Figure 2.For more details, please refer to [37].Type 1.If L ≥ L ref , a long distance is identified.Setting v(ø 7 ) = v e , x(ø 7 ) = L based on Equation (4), the jerk of each phase can be derived as follows: where: According to the jerk-time curve in Figure 2, J 2 , J 4 , and J 6 are always zero.From Equations ( 1) and (2), J 3 and J 7 are related to J 1 and J 5 , respectively.Thus, there are two unknowns, J 1 and J 5 , which can be uniquely determined by Equation ( 4) of velocity and path length constraints.
Type 2. If L < L ref , the travel length is recognized as short.We further determine if an acceleration or deceleration block exists through the relationship between the starting and ending velocities as follows.Type 2.1 does not contain a deceleration block, so there is an unknown J 1 .If acceleration is absent, the only unknown is J 5 , which corresponds to Type 2.2.The constraints (4) are impossible to satisfy simultaneously.The path length should be guaranteed primarily.Thus, a relaxed velocity constraint is proposed in that the calculated velocity should be less than the given one at the ending point.Moreover, neither acceleration nor deceleration blocks exist in Type 2.3.The motion profile of the constant velocity block is exclusive once the path length and start velocity are determined.
Type 2.1.If v s < v e , there is no deceleration block, that is 4), the jerk of each phase can be expressed as follows: Accordingly, the resulting velocity of the end point v e,r can be derived, which cannot be higher than v e .Thus, the constraints on the design parameters are specified as follows: Type 2.2.If v s >v e , the acceleration block is nonexistent, that is, 4), the jerk of each phase can be denoted as The resulting end velocity should be less than v e .The corresponding constraint imposed on the design parameters is given as: Type 2.3.If v s = v e , the motion profile contains only the constant velocity block and all jerks are zero.In addition, the execution time of the fourth phase is expressed as T 4 = L/v s based on Equation ( 4), and for other phases, the execution times are zero.
The jerk obtained at each phase of the S-curve should not be less than zero in all cases.The direction is reflected in the signs in Equations ( 15) and ( 16), which ensures nonzero jerks.

Principle of the WOA Algorithm
The WOA is a swarm-based meta-heuristic algorithm [36] that is competitive in industrial applications, especially for engineering optimization problems [38].It mimics the hunting behavior of humpback whales, comprising encircling, attacking, and searching for prey.The mathematical model is described below, and a detailed description can be found in [36].
The WOA assumes that the current best-search agent is the target prey.The position of other search agents is updated towards the best search agent just as humpback whales encircle their prey and it is formulated as: where • denotes element-wise multiplication and | | denotes the absolute value.δ denotes the current iteration, → X is the position vector, and → X * is the position vector of the best-search agent.

→
A and → C are the coefficient vectors, defined as: where → a decreases linearly from 2 to 0 during the iterations and → r is a random vector defined in [0,1].
The WOA simulates the attack behavior using two options with equal probabilities: a shrinking encircling mechanism and a spiral updating position.The related mathematical model is as follows: where p r is a random number [0,1].If p r < 0.5, the search agent performs the shrinking encircling mechanism.The enclosed circle gradually shrinks as the value of → a decreases.
Otherwise, the spiral model updates the position.
distance from an arbitrary search agent to the best one, b is a constant that determines the shape of the logarithmic spiral, l is a random number in [0,1], and • denotes the elementwise multiplication.
The new position of the search agent was located between its original and prey positions when → A < 1.The restricted but promising search space contributes to the exploitation capability of the WOA.

Search for prey (exploration).
Inspired by the random prey-seeking behavior of humpback whales, the WOA can accomplish global search by setting The search agent is forced away from a randomly selected reference agent, which differs from the exploitation period having the best agent as the reference.The search behavior is modeled as: where → X rand represents the position vector of a random search agent.

WOA-Based Asymmetrical S-Curve Acc/Dec
WOA is adopted to find the best duration (T j , j = 1,2, . . ., 7) for each phase of the S-curve and to minimize the execution time of a single NURBS segment.The related pseudocode is presented in Algorithm 1 and is described in detail below.Set the swarm size N s , maximum iterations N iter , and the weight factor ϑ 2: Initialize the population X r of whales based on the S-curve type 3: Evaluate the fitness of each search agent using Equation ( 25 end while 25: return X*

1.
Initialize the population of whales based on the S-curve type.
where X r = {T 1 , T 2 , T 3 , T 4 , T 5 , T 6 , T 7 } (r = 1,2, . . ., N s ) represents a potential solution, N s is the swarm size, and T j (j = 1,2, . . ., 7) is the duration of the jth phase of the S-shaped motion profile.If the path is recognized as a short distance, determine whether the S-curve velocity profile contains the acceleration and deceleration blocks by comparing the velocities at the start and end points and set the corresponding duration T j (j = 1,2, . . ., 7) as zero.

2.
Evaluate the fitness value of each search agent.
The optimization problem is formulated as a maximal problem.For minimizing the motion time, the fitness function can be specified as: Sensors 2023, 23, 3074 where ϑ j is a weight factor imposed on the jth duration T j (j = 1,2, . . ., 7) of the S-curve.The best search agent, X*, is determined by comparing the fitness values.A higher value indicates a better search agent.

3.
Determine whether the constraints are satisfied.
Check that the new position of search agent X r respects the maximum acceleration limits (5), maximum velocity limits (6), and jerk constraints (15) and (16).It is also necessary to judge whether the ending velocity constraint (12) or ( 14) is met if the S-curve is Type 2.2 or Type 2.3.The path and velocity constraints (4) do not need to be checked again since they are already considered when the designing parameters.The agent is updated to the new position if all constraints are satisfied; otherwise, no update is performed.
The WOA-based asymmetric S-curve Acc/Dec can automatically recognize the absence of acceleration, constant velocity, and deceleration blocks, depending on the path requirements.The duration of each phase of the S-curve can be different and even zero if necessary.The proposed algorithm is applicable to any cases with arbitrary path length and start-stop velocity because it depends on no assumption.
In addition, the optimization methods used to determine the optimal time for each Scurve phase are not specific to the WOA.Other global search algorithms, such as the particle swarm optimization algorithm, grey wolf optimizer, and genetic algorithm, were also suitable.The WOA offers fast computation, good convergence, flexibility, and robustness.Moreover, it has been tested in numerous engineering problems [38]; therefore, it was adopted in this study.

Trajectory Model Based on the NURBS Interpolation Technique
The NURBS path C(u) can be expressed as: where p denotes the degree of the NURBS curve; d i (i = 0,1, . . ., m) are the control points, a total of m + 1; ω i is the weights corresponding to the control points that determine the influence on the parametric curve; and N i,p (u) is the B-spline basis functions on a non-uniform knot vector U = [u 0 , u 1 , . . . ,u m+p+1 ].The ith basis function is recursively expressed as follows: It is stipulated that 0/0 = 0.The interpolation parameter u can be discretized as u k = u(kT s ) and calculated iteratively as follows: where T denotes the time interval, which is initially set as the sampling time T s , and v c,k is the trial motion profile of the end-effector at the kth time instant.
The arc length of an interval [u a , u b ] on curve C(u) is defined as: where C'(u) = dC(u)/du is the first-order derivative of Equation (26).
The solution of Equation ( 29) can be calculated using the composite Simpson formula if the interval is sufficiently small as follows: where:

Kinematic Constraint Handling
In general, the kinematic constraints of a redundant manipulator refer to the joint position, velocity, and acceleration limits, prescribed as follows: where q max,i (q min,i ), qmax,i q min,i ), and q max,i ( q min,i are the maximum (minimum) joint position, velocity, and acceleration of the ith joint, respectively; i = 1, . . ., n, n is the number of joints.
As is well known that the kinematic mapping of a manipulator is non-linear between the configuration and operation spaces.The S-shaped motion profile which schedules in operation space based on end-effector limits, that is, the end-effector trial motion profile, may lead to constraint violations in the configuration space.Assuming all joints are successfully confined within the maximum feasible position using the redundancy property, joint actuators may still violate the velocity and acceleration constraints.Thus, the S-curve trajectory designed by end-effector limits yields a set of trial joint trajectories that may be infeasible.
Although the trial joint trajectories cannot be directly used as input to control joint servos, it can be treated as a priori to derive the trial velocity and acceleration values of the ith joint as follows: . ..
According to the last two inequation constraints in Equation (33), the scaling time interval, indicating the minimum allowed time to move from q k to q k+1 when satisfying all joint velocity and acceleration constraints, can be derived by solving the following optimization problem: q max,i , ∀i = 1, ..., n ..
in which T k is the kth scaling time interval; q k and q k+1 are the joint position at the kth and (k + 1)th time instant, respectively; and n is the degree of freedom, which is equal to the number of joints of the redundant manipulator.The angle of joint motion from q k to q k+1 is certain.If the joint velocity or acceleration exceeds the corresponding limit, the time interval T k should be increased which is determined by the joint that exceeds the limit the most.Otherwise, T k can be decreased.It means the joint actuators are allowed to improve motion capabilities before reaching the acceleration or velocity boundary.
The joint motor has the same motion capability in both directions, and the joint velocity and acceleration limits can be rewritten as qmin = − qlim , qmax = qlim and q min = − q lim , q max = q lim , respectively.By setting Γ k = 1/T k , Equation ( 36) can be converted into the following non-linear optimization form: An interior-point algorithm for non-linear programming [39] was adopted to solve Equation (37).Based on the calculated kth time interval T k , the end-effector velocity was updated as follows: If the kth time interval T k is greater than the sampling time T s , implying constraint violations from q k to q k+1 , the end-effector velocity should be reduced to comply with the kinematic constraints of the joint actuators.In contrast, the robot has not released its full potential if T k < T s .
The velocity-limit curve (VLC) as a function of the path, which represents the maximum tolerable velocity of the end-effector under the kinematic bounds of the joint actuators, can be treated as a constraint to performing velocity scheduling.Thus, the end-effector maximum velocity constraint (6) can be rewritten as:

Time-Optimal Asymmetric S-Curve for Multiple NURBS Segments
Based on the VLC of the end-effector, the critical points where the kinematic constraints of the joint actuators exceed the maximum can be found.The NURBS path is split at these critical points, and velocity scheduling is performed for each segment using the asymmetric S-curve Acc/Dec based on WOA.The pseudocode in Algorithm 2 summarizes this process.
The minimum execution time along the desired path minimizes the execution time for each NURBS segment.If the NURBS curve is divided into N γ segments, the arc length L γ (γ = 1,2, . . ., N γ ) of each segment can be recursively calculated using Equations ( 29)- (32).The start and end velocities of each segment were determined using the VLC of the endeffector in Equation (38).Based on the method presented in Section 2.2, the S-curve type along the γth NURBS segment can be determined.Thus, each segment can be viewed as a single path to schedule the velocity.The WOA-based asymmetric S-curve Acc/Dec algorithm generates a time-optimal velocity profile for each segment.The timeoptimal asymmetric S-curve trajectory for the end-effector which respects all constraints is generated eventually.Calculate the reference length using Equations ( 7) and (8) 7: if Call Algorithm 1 9: Calculate the jerk of each phase of the S-curve using Equation (9) 10: Determine whether the acceleration and deceleration blocks exist 12 if v s,γ < v e,γ 13: The deceleration block does not exist 14: Set T 5,γ = T 6,γ = T 7,γ = 0 15: Call Algorithm 1 16: Calculate the jerk of each phase of the S-curve using Equation (11) 17: otherwise v s,γ > v e,γ 18: The acceleration block does not exist 19: Set T 1,γ = T 2,γ = T 3,γ = 0 20: Call Algorithm 1 21: Calculate the jerk of each phase of the S-curve using Equation (13) 22: otherwise v s,γ = v e,γ 23: Acceleration and deceleration blocks do not exist 24: Set T 1,γ = T 2,γ = T 3,γ = T 5,γ = T 6,γ = T 7,γ = 0 and T 4,γ = L γ /v s,γ 25: Set the jerk of each phase of the S-curve as zero 26: end if 27: end if 28: Calculate the acceleration of each phase using Equation (3) 29: Calculate the velocity of the γth NURBS segment by integrating acceleration 30: Determine the interpolation parameter u using Equation (28) 31: Determine the NURBS path using Equations ( 26) and (27) 32: end for 33: Derive the asymmetric S-curve trajectory

Simulation
Simulations were performed to confirm the feasibility and effectiveness of the proposed time-optimal asymmetric S-curve (TOAS) trajectory planning approach.A comparison with BLA [35] and TSS Acc/Dec control algorithm [37] also demonstrated the efficiency of the proposed method.Moreover, the trajectories generated by the end-effector trial motion profile (TMP) method are analyzed to illustrate the effect of kinematic constraint handling.
A 9-DOF redundant manipulator, self-developed in our laboratory, was employed for simulation.Figure 3 shows the mechanical structure and kinematic model.The representation of forward kinematics depends on the product of the exponential equations, and the related parameters are recorded in Table 1.
Moreover, a virtual model of the robot is used in the simulation without considering the actual control loop performance.For better illustration, the limits of each joint were set to: rad 0.8, 0.8, 0.9, 0.9, 0.9, 0.9, 1, 1, 1 rad s 2, 2, 3, 3, 3, 3, 5, 5, 5 rad s   The end-effector path employed a diamond-shaped curve constructed from the NURBS curve, as shown in Figure 4.The orientation of the end-effector holds along the entire path.The knot vector, control points, and weight of each control point are listed in Table A1    The end-effector path employed a diamond-shaped curve constructed from NURBS curve, as shown in Figure 4.The orientation of the end-effector holds along entire path.The knot vector, control points, and weight of each control point are list Table A1 in Appendix B. The closed-loop inverse kinematics algorithm is used to achieve kinematic map from end-effector to joints; more details can be found in [40].When the end-effector motion profile is designed based on constraints in operational space, as shown in Fi 5, the joint trajectories in Figure 6 can be derived.The closed-loop inverse kinematics algorithm is used to achieve kinematic mapping from end-effector to joints; more details can be found in [40].When the end-effector trial motion profile is designed based on constraints in operational space, as shown in Figure 5, the joint trajectories in Figure 6 can be derived.The closed-loop inverse kinematics algorithm is used to achieve kinematic m from end-effector to joints; more details can be found in [40].When the end-effe motion profile is designed based on constraints in operational space, as shown i 5, the joint trajectories in Figure 6 can be derived.The joint positions are bounded within limits owing to redundancy.Although most of the joint velocities are less than the maximum allowed value, joint acceleration overruns occur in the start-stop phase and the four corners of the diamond curve with a large centripetal acceleration, as shown in Figure 6c.Hence, velocity scheduling based only on the end-effector limitations is infeasible for a robot with complicated kinematics.Robotic capabilities are underutilized in some potential places, whereas the possibility of joint constraint violations exists in dangerous places.
In this study, the joint motion shown in Figure 6 is a priori for deriving the endeffector velocity-limit curve.The diamond curve was divided into six segments at the local minimum of the velocity-limit curve.Velocity scheduling was performed for each segment, and the results are shown in Figure 7.The joint positions are bounded within limits owing to redundancy.Although most of the joint velocities are less than the maximum allowed value, joint acceleration overruns occur in the start-stop phase and the four corners of the diamond curve with a large centripetal acceleration, as shown in Figure 6c.Hence, velocity scheduling based only on the end-effector limitations is infeasible for a robot with complicated kinematics.Robotic capabilities are underutilized in some potential places, whereas the possibility of joint constraint violations exists in dangerous places.
In this study, the joint motion shown in Figure 6 is a priori for deriving the endeffector velocity-limit curve.The diamond curve was divided into six segments at the local minimum of the velocity-limit curve.Velocity scheduling was performed for each segment, and the results are shown in Figure 7.
straint violations exists in dangerous places.
In this study, the joint motion shown in Figure 6 is a priori for der effector velocity-limit curve.The diamond curve was divided into six segm minimum of the velocity-limit curve.Velocity scheduling was performed ment, and the results are shown in Figure 7.The proposed TOAS method can flexibly deal with the complex constr dant robots, while BLA and TSS require bidirectional scanning from the lo locity to satisfy the constraints.Moreover, TSS derives the velocity profile o from the end-effector velocity, acceleration, and jerk limits in the operation the TOAS and BLA are guided by the kinematic constraints of the joint actu the end-effector limitation is related to the configuration of the serial manip motors drive it, a motion profile based on joint mobility can be designed.emphasizes velocity scale-down when joint constraints are violated.In c allows increasing the end-effector velocity when the joint velocity and acc not reached limits.Moreover, TOAS also considers path constraints.Th The proposed TOAS method can flexibly deal with the complex constraints of redundant robots, while BLA and TSS require bidirectional scanning from the local minima velocity to satisfy the constraints.Moreover, TSS derives the velocity profile of each segment from the end-effector velocity, acceleration, and jerk limits in the operation space, whereas the TOAS and BLA are guided by the kinematic constraints of the joint actuators.Because the end-effector limitation is related to the configuration of the serial manipulator, as joint motors drive it, a motion profile based on joint mobility can be designed.However, BLA emphasizes velocity scale-down when joint constraints are violated.In contrast, TOAS allows increasing the end-effector velocity when the joint velocity and acceleration have not reached limits.Moreover, TOAS also considers path constraints.The end-effector velocity of the TOAS may not achieve the maximum tolerable velocity if the arc length is not long enough, such as in the motion profiles of the first and sixth segments in Figure 7.
The joint velocity and acceleration curves for the three methods are plotted in Figure 8.The TOAS and BLA consider the joint velocity and acceleration limits during velocity planning.The movements of all joints were confined to the permissible range.TSS provides a similar end-effector motion profile but causes joint constraint violation because only limits in the operation space are considered.Joints 1, 2, and 6 exhibit different degrees of joint acceleration overrun, as observed from the dashed red line in the partial enlargements of Figure 8a,b,f, respectively.Owing to the prior, the velocity scheduling for each segment starts from the local minimum of the end-effector velocity-limit curve.Consequently, the TSS has no serious limit exceedance as TMP, which also only pays attention to the bounds imposed on the end-effector.In addition, TOAS can provide more efficient planning results than BLA and TSS.For a visual comparison, bar charts of the average joint velocity and acceleration are displayed in Figure 9.
TOAS adopts a metaheuristic algorithm to search for time-optimal kinematic parameters within the acceleration and velocity limits of joint actuators to reduce the execution time along the path.As shown in Table 2, when enforcing the same geometric path, BLA and TSS require similar amounts of time, whereas TOAS takes less time and even less time than the TMP situation.The joint velocity and acceleration curves for the three methods are plotted in Figure 8.The TOAS and BLA consider the joint velocity and acceleration limits during velocity planning.The movements of all joints were confined to the permissible range.TSS provides a similar end-effector motion profile but causes joint constraint violation because only limits in the operation space are considered.Joints 1, 2, and 6 exhibit different degrees of joint acceleration overrun, as observed from the dashed red line in the partial enlargements of Figure 8a,b,f, respectively.Owing to the prior, the velocity scheduling for each segment starts from the local minimum of the end-effector velocity-limit curve.Consequently, the TSS has no serious limit exceedance as TMP, which also only pays attention to the bounds imposed on the end-effector.In addition, TOAS can provide more efficient planning results than BLA and TSS.For a visual comparison, bar charts of the average joint velocity and acceleration are displayed in Figure 9.  TOAS adopts a metaheuristic algorithm to search for time-optimal kinematic parameters within the acceleration and velocity limits of joint actuators to reduce the execution time along the path.As shown in Table 2, when enforcing the same geometric path, BLA and TSS require similar amounts of time, whereas TOAS takes less time and even less time than the TMP situation.
Tables 3 and 4 enumerate the position and orientation errors of the end-effector.The position error indicates the Euclidean metric between the designed and measured positions of the end effector, which is described in Cartesian coordinates.The orientation error  TOAS adopts a metaheuristic algorithm to search for time-optimal kinematic pa eters within the acceleration and velocity limits of joint actuators to reduce the execu time along the path.As shown in Table 2, when enforcing the same geometric path, and TSS require similar amounts of time, whereas TOAS takes less time and even less than the TMP situation.
Tables 3 and 4 enumerate the position and orientation errors of the end-effector position error indicates the Euclidean metric between the designed and measured p tions of the end effector, which is described in Cartesian coordinates.The orientation e Tables 3 and 4 enumerate the position and orientation errors of the end-effector.The position error indicates the Euclidean metric between the designed and measured positions of the end effector, which is described in Cartesian coordinates.The orientation error represents the difference in the Euler angles between the measured attitude and the specified one, which must be perpendicular to the yz-plane.TMP suffers from large trajectory-following errors as the kinematic constraints are violated.TSS can maintain a high tracking performance overall but causes large errors when the joint accelerations are slightly out of bounds.TOAS exhibits similar precision to BLA and TSS while providing faster planning results.

Experimental Results
Experiments were carried out on the nine-DOF redundant manipulator to illustrate the practicability of the proposed TOAS trajectory planning approach.As shown in Figure 3, the robot features two types of vertical and horizontal joints with nine revolute joints.Each joint consists of a measuring module, driving unit, joint motor, and brake unit.The joint motor is controlled by the driving unit, which communicates with the PC-based control system using the EtherCAT protocol.The control system delivers commands to the robot via TwinCAT automation software at a sampling rate of 200 HZ.Joint information can be collected by a measuring module including two built-in encoders, with a 1000 Hz measurement frequency, which is higher than the control-signal transmission frequency.The absolute encoder collects position information, whereas the incremental encoder returns changes in position, indicating joint velocities.The acceleration values were calculated using numerical differentiation.
The motion system was restricted by the robotic mechanical structure and bandwidth of the control loop.The bandwidth of the velocity loop was 18 Hz.For security purposes, the velocity and acceleration limitations of each joint are set to 0.1 rad/s and 0.5 rad/s 2 , respectively.
The end-effector path is defined as a butterfly-shaped NURBS curve, as shown in Figure 10.The relevant parameters are listed in Table A2 of Appendix B. The total length of the geometric path is 1.62 m.Specifying the tangential velocity of the end effector as 15 mm/s; the TMP trajectory required 108.885 s to execute.The trial joint trajectories can be obtained as the prior using the closed-loop inverse kinematics algorithm.The designed trajectory of the end effector is located on the yz-plane, 0.7 m a positive x-axis of the base frame {S}, where the whiteboard should be placed.F shows the results of the trajectory-tracking experiment.The path was divided into thirteen segments based on the velocity limits along the butterfly-shaped NURBS curve.The end-effector velocity of each segment was designed using the WOA-based S-curve velocity-scheduling algorithm, and the motion profile along the path is depicted in Figure 11.The design velocity decreases if the joint constraint is violated at a specified constant velocity.If possible, an increase in the design velocity is allowed under the updated velocity limit, which is the maximum allowed end-effector velocity along the path within the joint motion constraints.The designed trajectory of the end effector is located on the yz-plane, 0.7 m a positive x-axis of the base frame {S}, where the whiteboard should be placed.F shows the results of the trajectory-tracking experiment.The designed trajectory of the end effector is located on the yz-plane, 0.7 m along the positive x-axis of the base frame {S}, where the whiteboard should be placed.Figure 12 shows the results of the trajectory-tracking experiment.The designed trajectory of the end effector is located on the yz-plane, 0.7 m a positive x-axis of the base frame {S}, where the whiteboard should be placed.F shows the results of the trajectory-tracking experiment.The position, velocity, and acceleration profiles of each joint derived using the inverse kinematics are shown in Figure 13.The proposed method provides a reasonable joint motion within the allowable range.In addition, TOAS takes 96.755 s to complete the butterfly curve, while TSS and BLA require 113.055 s and 113.195 s, respectively.However, the motion accuracy of the experiment is worse than that simulated on an ideal model because of the influence of the actual controller and intrinsic mechanical structure.The trajectory tracking errors, including the mean position and orientation errors, are listed in Table 5.The TMP causes large path deformations, where the planning result violates the kinematic constraints, saturating the joint motors.The tracking error of the TOAS is of the same magnitude as that of the BLA and TSS.The results illustrate that TOAS provides faster motion than the other two methods while guaranteeing high trajectory tracking performance.joint motion within the allowable range.In addition, TOAS takes 96.755 s to complete the butterfly curve, while TSS and BLA require 113.055 s and 113.195 s, respectively.However, the motion accuracy of the experiment is worse than that simulated on an ideal model because of the influence of the actual controller and intrinsic mechanical structure.The trajectory tracking errors, including the mean position and orientation errors, are listed in Table 5.The TMP causes large path deformations, where the planning result violates the kinematic constraints, saturating the joint motors.The tracking error of the TOAS is of the same magnitude as that of the BLA and TSS.The results illustrate that TOAS provides faster motion than the other two methods while guaranteeing high trajectory tracking performance.

Conclusions
We have introduced a TOAS trajectory planning approach to achieve the fast and smooth motion requirements of a specified end-effector path within the kinematic constraints.According to a velocity-limit curve along the specified path, asymmetric S-curve velocity scheduling is performed in segments.The WOA finds the optimal S-shape motion profile.Moreover, it requires no assumption to generate a TOAS for paths with arbitrary arc length and start-end velocity.The metaheuristic WOA improves the flexibility of constraint processing and avoids deciding the deceleration block onset.The feasibility and effectiveness of the method were verified through suitable simulations and experiments on a redundant manipulator.The task execution time along the same NURBS path of the TOAS was approximately 14.5% less than that with BLA and TSS.The time-optimal motion profile with high-accuracy trajectory tracking is designed based on the kinematic constraints of the joint actuators, unlocking the robotic capabilities.The proposed approach can be applied to serial manipulators adopting a numerical method to solve inverse kinematic problems, generating smooth trajectories, and reducing task execution time.However, the TOAS method is offline-based and requires a set of trial joint trajectories as priors to impose joint constraints on the end-effector.In the future, we will explore a real-time approach to address joint velocity and acceleration bounds when designing trajectories in the operation space.
(−J 5 τ 5 + J 5 τ 4 )t + The position-time equation x(t) is deduced from its integral relationships with velocity, which can be written in the following form:

Appendix B
Table A1 lists the parameters of the diamond-shaped NURBS curve in Figure 4, including the degree, knot vector, control points, and weight of each control point.

Figure 1 .
Figure 1.Comparison between the seven-phase and five-phase S-curves.Solid red line: seven-phase S-curve; dashed blue line: five-phase S-curve.vs. and ve are the velocity at the start and end points, respectively.vmax is the maximum velocity.

Figure 2 .
Figure 2. Motion profile of seven-phase asymmetric S-curve Acc/Dec.

Algorithm 1 .
Pseudo-code of WOA-based asymmetrical S-curve Acc/Dec Input: (1) Arc length L, start velocity v s , and end velocity v e ; (2) S-curve type.Output: The best search agent X*. 1:

Algorithm 2 .
Time-optimal asymmetric S-curve trajectory generationInput: VLC of the end-effector along the specified path.Output: The end-effector desired motion profile.1: Identify the critical points at local minimum points of VLC in Equation(38) 2: Split the NURBS curve into N γ segments at critical points 3: Estimate the arc length of each NURBS segment using Equations (29)-(32) 4: Derive the start and end velocities of each segment using the VLC in Equation (38) 5: for each NURBS segment 6:

Figure 3 .
Figure 3. Mechanical structure and kinematic model of the 9-DOF manipulator.{S} is the base frame and {B} is the frame fixed on the end−effector.

Figure 3 .
Figure 3. Mechanical structure and kinematic model of the 9-DOF manipulator.{S} is the base frame and {B} is the frame fixed on the end−effector.

Figure 4 .
Figure 4. Diamond-shaped curve constructed from the NURBS curve.

Figure 4 .
Figure 4. Diamond-shaped curve constructed from the NURBS curve.

Figure 4 .
Figure 4. Diamond-shaped curve constructed from the NURBS curve.

Figure 5 .
Figure 5. End-effector (EE) trial motion profile along the diamond-shaped NURBS path.Th black lines divide the arc length at the four corners of the diamond-shaped NURBS path.

Figure 5 .Figure 6 .
Figure 5. End-effector (EE) trial motion profile along the diamond-shaped NURBS path.The dashed black lines divide the arc length at the four corners of the diamond-shaped NURBS path.Sensors 2023, 23, x FOR PEER REVIEW 15 of 26

Figure 6 .
Figure 6.Nine-DOF joint trajectories of the trial motion profile: (a) joint positions; (b) joint velocities; (c) joint accelerations.Dotted grey line: the limits of joint position, velocity, and acceleration.

Figure 7 .
Figure 7. End-effector (EE) velocity profile for different velocity scheduling metho yellow line); BLA (dotted blue line); TSS (dashed red line).The dotted grey line i the diamond path.The dashed black lines divide the NURBS path into six segme the VLC.

Figure 7 .
Figure 7. End-effector (EE) velocity profile for different velocity scheduling methods: TOAS (solid yellow line); BLA (dotted blue line); TSS (dashed red line).The dotted grey line is the VLC along the diamond path.The dashed black lines divide the NURBS path into six segments according to the VLC.

Figure 8 .Figure 9 .
Figure 8. Nine-DOF joint velocity and acceleration profile for different velocity scheduling methods, and (a-i) correspond to joints 1-9.Solid yellow line: TOAS; dotted blue line: BLA; dashed red line: TSS; dotted grey line: the limits of the joint velocity and acceleration.* represents the motion curves of TOAS nearing limits.Δ represents the motion curves of TSS violating limits.

Figure 8 .
Figure 8. Nine-DOF joint velocity and acceleration profile for different velocity scheduling methods, and (a-i) correspond to joints 1-9.Solid yellow line: TOAS; dotted blue line: BLA; dashed red line: TSS; dotted grey line: the limits of the joint velocity and acceleration.* represents the motion curves of TOAS nearing limits.∆ represents the motion curves of TSS violating limits.

Figure 8 .Figure 9 .
Figure 8. Nine-DOF joint velocity and acceleration profile for different velocity scheduling meth and (a-i) correspond to joints 1-9.Solid yellow line: TOAS; dotted blue line: BLA; dashed red TSS; dotted grey line: the limits of the joint velocity and acceleration.* represents the motion cu of TOAS nearing limits.Δ represents the motion curves of TSS violating limits.

Figure 9 .
Figure 9. Average values of joint velocity and acceleration for the different velocity scheduling methods.(a) Average velocity of each joint; (b) average acceleration of each joint.

Figure 10 .
Figure 10.Butterfly-shaped curve constructed from the NURBS curve.

Figure 10 .
Figure 10.Butterfly-shaped curve constructed from the NURBS curve.

Figure 11 .
Figure 11.End-effector (EE) motion profile based on the time-optimal S-curve trajectory method.The dotted gray line is the VLC along the butterfly path.The dashed black lines d NURBS path into thirteen segments according to the VLC.

Figure 10 .
Figure 10.Butterfly-shaped curve constructed from the NURBS curve.

Figure 11 .
Figure 11.End-effector (EE) motion profile based on the time-optimal S-curve trajectory method.The dotted gray line is the VLC along the butterfly path.The dashed black lines d NURBS path into thirteen segments according to the VLC.

Figure 13 .
Figure 13.Nine-DOF joint motion profiles for the proposed time-optimal asymmetric S-curve trajectory planning method.Dotted grey line: the limits of the joint position, velocity, and acceleration in (a) joint position; (b) joint velocity; and (c) joint acceleration.

Figure 13 .
Figure 13.Nine-DOF joint motion profiles for the proposed time-optimal asymmetric S-curve trajectory planning method.Dotted grey line: the limits of the joint position, velocity, and acceleration in (a) joint position; (b) joint velocity; and (c) joint acceleration.

Table 1 .
in Appendix B. Kinematics parameters of the 9-DOF manipulator.

Table 2 .
Execution time for different velocity scheduling methods.

Table 3 .
Position errors for different velocity scheduling methods.

Table 4 .
Orientation errors for different velocity scheduling methods.

Table 5 .
Trajectory tracking errors for different velocity scheduling methods.

Table 5 .
Trajectory tracking errors for different velocity scheduling methods.

Table A1 .
Parameters of t diamond-shaped curve.

Table A2 .
Parameters of a butterfly-shaped curve.