# Minimum Time Trajectory Optimization of CNC Machining with Tracking Error Constraints

Authors: Qiang Zhang; Shurong Li; Jianxin Guo
Journal: Abstract and Applied Analysis
 (2014)

---

## Abstract

An off-line optimization approach of high precision minimum time feedrate for CNC machining is proposed. Besides the ordinary considered velocity, acceleration, and jerk constraints, dynamic performance constraint of each servo drive is also considered in this optimization problem to improve the tracking precision along the optimized feedrate trajectory. Tracking error is applied to indicate the servo dynamic performance of each axis. By using variable substitution, the tracking error constrained minimum time trajectory planning problem is formulated as a nonlinear path constrained optimal control problem. Bang-bang constraints structure of the optimal trajectory is proved in this paper; then a novel constraint handling method is proposed to realize a convex optimization based solution of the nonlinear constrained optimal control problem. A simple ellipse feedrate planning test is presented to demonstrate the effectiveness of the approach. Then the practicability and robustness of the trajectory generated by the proposed approach are demonstrated by a butterfly contour machining example.


---

## Body

## 1. Introduction

For the purpose of maximum productivity, minimum time trajectory planning (MTTP) problems along given path have been widely studied in CNC machining applications, such as Smith et al. [1], Timar and Farouki [2], Yuan et al. [3], and Zhou et al. [4]. However, the Acc/Dec structure of the common minimum time trajectory with acceleration or torque constraints has been proven to be discontinuous by Chen and Desrochers [5] and McCarthy and Bobrow [6], which means that direct execution of this discontinuous trajectory can induce tool vibrations and reduce machining accuracy.To make the minimum time trajectory more practical in applications, trajectory smoothing methods, which can generate continuous Acc/Dec structure, have been studied by several authors. One kind of methods is to solve optimization problem with time-jerk objective as mentioned in Gourdeau and Schwartz [7]. Or the common methods are to confine the change rate of acceleration by introducing jerk constraint into the problem. Dong et al. [8] obtained smooth minimum time trajectory by solving the jerk constrained problem with a bidirectional scan algorithm. Zhang et al. [9] proposed a greedy strategy to realize the smooth problem solution. Then another smoothing strategy was proposed by the same author in [10]. Zhang and Li [11] presented a convex optimization approach to solve the jerk constrained minimum time trajectory planning problem. Then a linear programming method was shown in Fan et al. [12] to obtain smooth trajectory.However, to achieve high precision machining in minimum time, only continous Acc/Dec of the trajectory is not enough. Actually, in the cases of high speed or highly varying loads machining, the servo system response will become weak [13–16]. At this moment, even smooth trajectory cannot maintain the machining precision.For the purpose of improving machining precision, one kind of approaches is to develop new advantage controllers, such as Srinivasan and Kulkarni [17], Chuang and Liu [18], and Takahashi and Bickel [19]. An alternative approach is to consider servo system performance in the trajectory planning process, which improves the performance of existing industrial systems without modifying the controllers.Ardeshiri et al. [16] considered a simplified motor dynamics and studied a speed dependent torque constrained minimum time trajectory planning. Tarkiainen and Shiller [14] ignored manipulator gravity and studied a rigid manipulator dynamics and motor dynamics governed minimum time trajectory planning. But the studies of Ardeshiri et al. [16] and Tarkiainen and Shiller [14] are all based on the open loop servo dynamics.Dong and Stori [20] discussed the necessity of introducing closed loop servo dynamics into the trajectory planning problem and claimed the advantage of including closed loop servo dynamics is no infeasible command, which may exceed the physical capabilities of the system, is generated for the axis drivers. Ernesto and Farouki [21] presented an inverse dynamics strategy to modify the trajectory according to the closed loop servo mode and then reduce the machining error. A similar work was also presented in Guo et al. [22]. Tsai et al. [23] proposed a look-ahead interpolate algorithm with closed loop servo dynamics constraints. Dong and Stori [20] constructed the closed loop servo dynamics constrained problem as an optimization problem and a two-pass method was used to solve the problem. Guo et al. [24] and Zhang et al. [25] applied tracking error as the indicator of the closed loop servo dynamics and corrasponding optimization problems were solved in their works.According to the model formulation of closed loop servo dynamics as in [24, 25], the introduced tracking error constraints make the minimum time trajectory planning problem become a complex nonconvex optimal control problem and no further reduction can be achieved.In this paper, to realize high precision machining in minimum execution time, the minimum time feedrate planning problem with considering limited servo dynamics performance is studied. Tracking error acts as the constraint function of the servo dynamics. Then a minimum time trajectory planning problem with confined velocity, acceleration, jerk, and tracking error constraints is constructed. Different from the works of Guo et al. [24] and Zhang et al. [25], in this paper we present a newly active set strategy to realize a convex optimization based solution of the complex constrained trajectory planning problem.The rest of this paper is organized as follows. In Section2, a closed loop system with PD controller is introduced. The minimum time trajectory planning problem with confined constraints is stated in Section 3, and the properties of the optimal trajectory are also presented in this section. In Section 4, a constraints handling strategy is present by which the nonconvex tracking error function is approximated by a linear function. In Section 5, the convex optimization based strategy is presented. The simulation tests are given in Section 6.


## 2. Servo Control System Model

In this paper, we consider that each axis of the CNC machine is driven by an electronic motor, which can be approximated by the following equations:(1)Jθ¨+bθ˙=kτI,RI+kεθ˙=U,
where I denotes the armature current, U denotes the control voltage and θ is the angular position of rotor, J is the inertial load, b is the viscous friction coefficient, R is the resistance of armature circuit, kτ is the torque constant of the motor, and kε is the voltage constant of the motor.In Laplace domain, the transfer function of the motor model can be of the following form:(2)G(s)=θ(s)U(s)=Kms(Tms+1),
where Km=kτ/(bR+kτkε) denotes the servo gain and Tm=JR/(bR+kτkε) is known as servo time constant.The PID controller is widely used in CNC control system. Here to simplify the presentation, PD controller is used to construct the closed loop control system for each axis, as shown in Figure1. In fact, the following analysis of tracking error approximation is also appropriate for other types of controllers.Figure 1
Closed loop control system model of a single axis with PD controller.In Figure1, Kp denotes the proportional gain of the controller and Kd is the differential gain. Define tracking error as the difference between reference command and actual axis location, E=R-X. Then we can obtain the output transfer function of the closed loop control system described as
(3)Φ(s)=X(s)R(s)=KGKm(Kds+Kp)Tms2+(KGKmKd+1)s+KGKmKp.The error transfer function is written as(4)Φe(s)=E(s)R(s)=b2s2+b1sa2s2+a1s+a0,
where b2=Tm, b1=1, a2=Tm, a1=(KGKmKd+1), and a0=KGKmKp.In time domain, the equivalent differential equation of (4) with zero initial conditions is
(5)a2e¨(t)+a1e˙(t)+a0e(t)=b2x¨(t)+b1x˙(t),
which is a second order differential equation system. Apparently, with the initial conditions, the tracking error of the CNC axis can be calculated by solving this equation.According to the classical control theory, the tracking error of system (5) is stable only when all the roots of the following homogeneous differential equation have negative real parts:
(6)a2e¨(t)+a1e˙(t)+a0e(t)=0.Further, the roots are allocated as underdamping form to improve the responsiveness of the control system; then we have(7)a12-4a2a0<0.


## 3. Minimum Time Trajectory Planning with Confined Tracking Error

Three-axisX-Y-Z CNC machine is studied here. In task space, we define given tool path having the following parametric formula:
(8)P(u)=[x(u),y(u),z(u)],
and we assume the path is at least C2. Then we have
(9)r′(u)=dr(u)du,r′′(u)=d2r(u)du2,r′′′(u)=d3r(u)du3,
where r=x,y,z denotes any one of the three axes.


### 3.1. Ordinary Considered Constraints

In trajectory planning problems, the velocity and acceleration are ordinarily considered constraint conditions. For the purpose of smoothing the trajectory, the jerk constraint of each axis is also considered. Mathematically, these constraint functions can be written as(10)vr(t)=r˙(t)=r′u˙(t),ar(t)=r¨(t)=r′′u˙2(t)+r′u¨(t),jr(t)=r…(t)=r′′′u˙3(t)+3r′′u˙(t)u¨(t)+r′u…(t),
where u˙(t), u¨(t), and u⃛(t) are the parameter velocity, acceleration, and jerk, respectively.Then we define variablesq=u˙2, qp=u¨, and qpp=u⃛/u˙, and they satisfy
(11)q′=dqdu=2u¨=2qp,qp′=u⃛u˙=qpp.The velocity, acceleration, and jerk constraints of each axis can be(12)|r′q(t)|≤vrB,|r′′q(t)+r′qp(t)|≤arB,|r′′′q(t)+3r′′qp(t)+r′qpp(t)|q(t)≤jrB.


### 3.2. Tracking Error Constraints

For commonly used controllers (e.g., PID controller) in industrial CNCs, the zero error response is impossible. Especially, the fast ACC/DEC commands of high speed machining can induce large tracking error. So in trajectory planning process, it is necessary to modify the generated trajectory to reduce tracking error.In parameter domain, the tracking error estimation can be realized by executing the following steps.According to the chain rule, we have(13)e˙r(t)=er′q(t),e¨r(t)=er′′q(t)+er′qp(t).
Then the error equation (5) of each axis becomes
(14)a2(er′′q(t)+er′qp(t))+a1er′q(t)+a0er(t)=b2(r′′q(t)+r′qp(t))+b1r′q(t).Definingerp=er′ and erpp=er′′, we have
(15)erpp=fr(q,qp,er,erp,u),
where
(16)fr(q,er,erp,u)=b2a2r′′(u)+b1r′(u)a2q-a1erpa2q-a0era2q+(b2r′(u)a2q-erpq)qp.Hence in parameter domain, the tracking error w.r.t the parameter commandsqp can be estimated by solving (15) numerically. And the tracking error constraint of the r axis is denoted by |er|≤erB.


### 3.3. Formulated as an Optimal Control Problem

The objective of our problem is to minimize machining time along given tool path; that is,min⁡T=∫t0tf1dt. In parameter domain, we have min⁡T=∫01(1/u˙)du.The axis velocity, acceleration, jerk constraints, and the tracking error constraints act as the constraint conditions; then the problem is stated as follows:(17)min⁡qppJ=∫011qdus.t.{q′=2qp,q(0)=q0,q(1)=qf,qp′=qpp,qp(0)=qp,0,qp(1)=qp,f,er′=erp,er(0)=0,erp′=fr(q,qp,er,erp,u),erp(0)=erp,0,|r′q(u)|≤vrB,|r′′q(u)+r′qp(u)|≤arB,|r′′′q(u)+3r′′qp(u)+r′qpp(u)|q(u)≤jrB,|er(u)|≤erB,r=x,y,z.In problem (17), we assume the initial tracking error of each axis is zero, the initial and final velocities are specified, denoted by q0, qf, and the initial and final accelerations are zeroes.


### 3.4. Bang-Bang Constraint Structure of the Optimal Trajectory

In this section, we will prove that the constraint structure of the optimal trajectory is “bang-bang,” which is the key to realize our optimization approach.In robotic manipulator applications, Chen and Desrochers [5] proved that the constraint structure of optimal motion is bang-bang for torque/acceleration constrained problem. The optimal constraint structure for tracking error constrained MTTP problem has not been proved yet.In optimal control problem (17), qpp acts as the control variable. The states of problem (17) are (q,qp) and (e,ep), where e=[ex,ey,ez], ep=[exp,eyp,ezp]. So the jerk constraints act as the mixed state-control constraints in this problem; the velocity, acceleration, and tracking error limits are the 2-order, 1-order, and 3-order pure state constraints, respectively.Here we define the mixed state-control constraints set asg(q,qp,qpp,u)≤0 and the pure state constraints set as h(q,qp,e,ep,u)≤0. The Hamiltonian function and the Lagrange function of problem (17) become
(18)H=1q+2λ1qp+λ2qpp+λ3Tep+λ4Tfr(q,qp,e,ep,u),L=H+μTg+γTh,
where λ1, λ2, λ3, and λ4 are the adjoint variables of the states q, qp, e, and ep, respectively. μ and γ are the multiplier vectors of the mixed constraints and pure state constraints, respectively.Based on the extended maximum principle [26], there exits the following theorem.Theorem 1.
For optimal control problem (17), assume that a feasible control qpp is optimal. Then there exists at least one of the process constraints (pure state constraints h≤0 and mixed constraints g≤0) which is active at almost all points of the parameter horizon [0,1].Proof.
We define symbolsx=[q,qp,eT,epT]T, λ=[λ1,λ2,λ3T,λ4T]T. Based on the extended maximum principle [26], the optimal solution of problem (17) satisfies the following conditions:
(19)λ′(u)=-∂L*∂x(u)=-∂H*∂x(u)-μT∂g*∂x(u)-γT∂h*∂x(u),λ(1)=υ*,υ*≥0,(20)∂L*∂qpp(u)=∂H*∂qpp(u)+μT∂g*∂qpp(u)=0,(21)qpp*(u)=argmin⁡qpp∈Ω(x*,u)⁡H(x*,λ,qpp,u),(22)μTg*(u)=0,μ≥0,γTh*(u)=0,γ≥0,(23)dH*du(u)=∂L*∂u(u),
where Ω(x,u)={qpp(u)∣g(x,qpp,u)≤0} is the state based control constraint set.
For optimal control problem with state constraints, the optimal control trajectory can have the following four possible control arcs: control upper limit, control lower limit, sensitivity arc, and path constrained arc. In this proof, we discuss all the four possible control arcs. In arbitrary small interval[ua,ub]⊂[0,1], the optimal solution can only have the following three cases.
Case (I). In small interval [ua,ub]⊂[0,1], at least one of the mixed constraints is active, denoted by gi*(x*,qpp*,u)=0, i∈Ic with Ic the set of active mixed constraints.
Case (II). In small interval [ua,ub]⊂[0,1], at least one of the pure state constraints is active, denoted by hj(x*,u)=0, j∈Jc with Jc the set of active pure state constraints.
Case (III). In small interval [ua,ub]⊂[0,1], none of the mixed or pure state constraints is active, denoted by g(x*,qpp*,u)<0, h(x*,u)<0.
Then we discuss the above possible cases one by one.
Case (I). In [ua,ub], the Lagrange function of the problem is rewritten as
(24)L*(u)=H*(u)+∑i∈Icμigi*(u).
And the optimal trajectory satisfies
(25)λ′(u)=-∂H*∂x(u)-∑i∈Icμi∂gi*(u)∂x,λ2+∑i∈Icμi∂gi*(u)∂qpp=0,
where u∈[ua,ub]. According to condition (22), in this case λ2≠0. Then the optimal control is determined by
(26)min⁡qppH(x*,λ,qpp,u),u∈[ua,ub].
So the optimal control qpp(s) is general bang-bang.
Case (II). Similar to Case (I), in [ua,ub] the Lagrange function is rewritten as
(27)L*(u)=H*(u)+∑j∈Jcγjhj*(u).
And the optimal trajectory satisfies(28)λ′(u)=-∂H*∂x(u)-∑j∈Jcγj∂hj*(u)∂x,(29)λ2(u)=0,u∈[ua,ub].
According to (29), the optimal control is determined by the active state constraints and
(30)qpp*(u)=(qp*)′(u),u∈[ua,ub].
Case (III). In this case, since none of the constraints is active, the problem can be treated as an unconstrained optimal control problem; the Lagrange function can be reduced to
(31)H*(u)=1q*+2λ1qp*+λ2qpp*,u∈[ua,ub].
And we have
(32)λ1′(u)=12(q*)3,λ2′(u)=-2λ1,λ2(u)=0.
In[ua,ub], according to (32), there exists q*=∞ which is impossible.
Then we consider the interval shrink to a point, which meansua=ub. Now we have λ2(ua)=0. If λ1(ua)≠0, we have λ2(ua+) and λ2(ua-) with opposite signs, which means that this point is a switch point. If λ1(ua)=0, the Hamiltonian function is reduced to H*(u)=1/q*. According to condition (21), the optimal state becomes q*=∞, which is impossible.
Above all, except the switch points, at almost all points of the parameter horizon[0,1], there exists at least one of the process constraints (pure state constraints h≤0 and mixed constraints g≤0) which is active.


### 3.5. Example

In this subsection, a simple example is solved to present the optimal constraint structure of the tracking error constrained minimum time trajectory planning problem.The test path is shown in Figure2 with its parametric equation:
(33)C=[50sin(2πu),25cos⁡(2πu)],u∈[0,1].Figure 2
An elliptical path.In this example, the parameters of the error transfer function (4) for each axis are
(34)a2=0.008,a1=1.99,a0=147.3,b2=0.008,b1=0.025.Since problem formulation (17) is a complex nonconvex optimal control problem, the direct parameterization solution is inefficient. However, by using proper initial guess, the solution of problem (17) for this simple path is possible.In this example, the axis acceleration constraints with bound 1000 mm/s2, jerk constraints with bound 10000 mm/s3, and tracking error constraints with bound 0.05 mm are considered. The optimized trajectories are shown in Figures 3(a), 3(b), 3(c), and 3(d).Bang-bang constraint structure of the minimum time trajectory for the ellispe path.
(a)
(b)
(c)
(d)From Figure3, we can see that the optimized constraint structure for the elliptical path is bang-bang. This is consistent with Theorem 1.


## 3.1. Ordinary Considered Constraints

In trajectory planning problems, the velocity and acceleration are ordinarily considered constraint conditions. For the purpose of smoothing the trajectory, the jerk constraint of each axis is also considered. Mathematically, these constraint functions can be written as(10)vr(t)=r˙(t)=r′u˙(t),ar(t)=r¨(t)=r′′u˙2(t)+r′u¨(t),jr(t)=r…(t)=r′′′u˙3(t)+3r′′u˙(t)u¨(t)+r′u…(t),
where u˙(t), u¨(t), and u⃛(t) are the parameter velocity, acceleration, and jerk, respectively.Then we define variablesq=u˙2, qp=u¨, and qpp=u⃛/u˙, and they satisfy
(11)q′=dqdu=2u¨=2qp,qp′=u⃛u˙=qpp.The velocity, acceleration, and jerk constraints of each axis can be(12)|r′q(t)|≤vrB,|r′′q(t)+r′qp(t)|≤arB,|r′′′q(t)+3r′′qp(t)+r′qpp(t)|q(t)≤jrB.


## 3.2. Tracking Error Constraints

For commonly used controllers (e.g., PID controller) in industrial CNCs, the zero error response is impossible. Especially, the fast ACC/DEC commands of high speed machining can induce large tracking error. So in trajectory planning process, it is necessary to modify the generated trajectory to reduce tracking error.In parameter domain, the tracking error estimation can be realized by executing the following steps.According to the chain rule, we have(13)e˙r(t)=er′q(t),e¨r(t)=er′′q(t)+er′qp(t).
Then the error equation (5) of each axis becomes
(14)a2(er′′q(t)+er′qp(t))+a1er′q(t)+a0er(t)=b2(r′′q(t)+r′qp(t))+b1r′q(t).Definingerp=er′ and erpp=er′′, we have
(15)erpp=fr(q,qp,er,erp,u),
where
(16)fr(q,er,erp,u)=b2a2r′′(u)+b1r′(u)a2q-a1erpa2q-a0era2q+(b2r′(u)a2q-erpq)qp.Hence in parameter domain, the tracking error w.r.t the parameter commandsqp can be estimated by solving (15) numerically. And the tracking error constraint of the r axis is denoted by |er|≤erB.


## 3.3. Formulated as an Optimal Control Problem

The objective of our problem is to minimize machining time along given tool path; that is,min⁡T=∫t0tf1dt. In parameter domain, we have min⁡T=∫01(1/u˙)du.The axis velocity, acceleration, jerk constraints, and the tracking error constraints act as the constraint conditions; then the problem is stated as follows:(17)min⁡qppJ=∫011qdus.t.{q′=2qp,q(0)=q0,q(1)=qf,qp′=qpp,qp(0)=qp,0,qp(1)=qp,f,er′=erp,er(0)=0,erp′=fr(q,qp,er,erp,u),erp(0)=erp,0,|r′q(u)|≤vrB,|r′′q(u)+r′qp(u)|≤arB,|r′′′q(u)+3r′′qp(u)+r′qpp(u)|q(u)≤jrB,|er(u)|≤erB,r=x,y,z.In problem (17), we assume the initial tracking error of each axis is zero, the initial and final velocities are specified, denoted by q0, qf, and the initial and final accelerations are zeroes.


## 3.4. Bang-Bang Constraint Structure of the Optimal Trajectory

In this section, we will prove that the constraint structure of the optimal trajectory is “bang-bang,” which is the key to realize our optimization approach.In robotic manipulator applications, Chen and Desrochers [5] proved that the constraint structure of optimal motion is bang-bang for torque/acceleration constrained problem. The optimal constraint structure for tracking error constrained MTTP problem has not been proved yet.In optimal control problem (17), qpp acts as the control variable. The states of problem (17) are (q,qp) and (e,ep), where e=[ex,ey,ez], ep=[exp,eyp,ezp]. So the jerk constraints act as the mixed state-control constraints in this problem; the velocity, acceleration, and tracking error limits are the 2-order, 1-order, and 3-order pure state constraints, respectively.Here we define the mixed state-control constraints set asg(q,qp,qpp,u)≤0 and the pure state constraints set as h(q,qp,e,ep,u)≤0. The Hamiltonian function and the Lagrange function of problem (17) become
(18)H=1q+2λ1qp+λ2qpp+λ3Tep+λ4Tfr(q,qp,e,ep,u),L=H+μTg+γTh,
where λ1, λ2, λ3, and λ4 are the adjoint variables of the states q, qp, e, and ep, respectively. μ and γ are the multiplier vectors of the mixed constraints and pure state constraints, respectively.Based on the extended maximum principle [26], there exits the following theorem.Theorem 1.
For optimal control problem (17), assume that a feasible control qpp is optimal. Then there exists at least one of the process constraints (pure state constraints h≤0 and mixed constraints g≤0) which is active at almost all points of the parameter horizon [0,1].Proof.
We define symbolsx=[q,qp,eT,epT]T, λ=[λ1,λ2,λ3T,λ4T]T. Based on the extended maximum principle [26], the optimal solution of problem (17) satisfies the following conditions:
(19)λ′(u)=-∂L*∂x(u)=-∂H*∂x(u)-μT∂g*∂x(u)-γT∂h*∂x(u),λ(1)=υ*,υ*≥0,(20)∂L*∂qpp(u)=∂H*∂qpp(u)+μT∂g*∂qpp(u)=0,(21)qpp*(u)=argmin⁡qpp∈Ω(x*,u)⁡H(x*,λ,qpp,u),(22)μTg*(u)=0,μ≥0,γTh*(u)=0,γ≥0,(23)dH*du(u)=∂L*∂u(u),
where Ω(x,u)={qpp(u)∣g(x,qpp,u)≤0} is the state based control constraint set.
For optimal control problem with state constraints, the optimal control trajectory can have the following four possible control arcs: control upper limit, control lower limit, sensitivity arc, and path constrained arc. In this proof, we discuss all the four possible control arcs. In arbitrary small interval[ua,ub]⊂[0,1], the optimal solution can only have the following three cases.
Case (I). In small interval [ua,ub]⊂[0,1], at least one of the mixed constraints is active, denoted by gi*(x*,qpp*,u)=0, i∈Ic with Ic the set of active mixed constraints.
Case (II). In small interval [ua,ub]⊂[0,1], at least one of the pure state constraints is active, denoted by hj(x*,u)=0, j∈Jc with Jc the set of active pure state constraints.
Case (III). In small interval [ua,ub]⊂[0,1], none of the mixed or pure state constraints is active, denoted by g(x*,qpp*,u)<0, h(x*,u)<0.
Then we discuss the above possible cases one by one.
Case (I). In [ua,ub], the Lagrange function of the problem is rewritten as
(24)L*(u)=H*(u)+∑i∈Icμigi*(u).
And the optimal trajectory satisfies
(25)λ′(u)=-∂H*∂x(u)-∑i∈Icμi∂gi*(u)∂x,λ2+∑i∈Icμi∂gi*(u)∂qpp=0,
where u∈[ua,ub]. According to condition (22), in this case λ2≠0. Then the optimal control is determined by
(26)min⁡qppH(x*,λ,qpp,u),u∈[ua,ub].
So the optimal control qpp(s) is general bang-bang.
Case (II). Similar to Case (I), in [ua,ub] the Lagrange function is rewritten as
(27)L*(u)=H*(u)+∑j∈Jcγjhj*(u).
And the optimal trajectory satisfies(28)λ′(u)=-∂H*∂x(u)-∑j∈Jcγj∂hj*(u)∂x,(29)λ2(u)=0,u∈[ua,ub].
According to (29), the optimal control is determined by the active state constraints and
(30)qpp*(u)=(qp*)′(u),u∈[ua,ub].
Case (III). In this case, since none of the constraints is active, the problem can be treated as an unconstrained optimal control problem; the Lagrange function can be reduced to
(31)H*(u)=1q*+2λ1qp*+λ2qpp*,u∈[ua,ub].
And we have
(32)λ1′(u)=12(q*)3,λ2′(u)=-2λ1,λ2(u)=0.
In[ua,ub], according to (32), there exists q*=∞ which is impossible.
Then we consider the interval shrink to a point, which meansua=ub. Now we have λ2(ua)=0. If λ1(ua)≠0, we have λ2(ua+) and λ2(ua-) with opposite signs, which means that this point is a switch point. If λ1(ua)=0, the Hamiltonian function is reduced to H*(u)=1/q*. According to condition (21), the optimal state becomes q*=∞, which is impossible.
Above all, except the switch points, at almost all points of the parameter horizon[0,1], there exists at least one of the process constraints (pure state constraints h≤0 and mixed constraints g≤0) which is active.


## 3.5. Example

In this subsection, a simple example is solved to present the optimal constraint structure of the tracking error constrained minimum time trajectory planning problem.The test path is shown in Figure2 with its parametric equation:
(33)C=[50sin(2πu),25cos⁡(2πu)],u∈[0,1].Figure 2
An elliptical path.In this example, the parameters of the error transfer function (4) for each axis are
(34)a2=0.008,a1=1.99,a0=147.3,b2=0.008,b1=0.025.Since problem formulation (17) is a complex nonconvex optimal control problem, the direct parameterization solution is inefficient. However, by using proper initial guess, the solution of problem (17) for this simple path is possible.In this example, the axis acceleration constraints with bound 1000 mm/s2, jerk constraints with bound 10000 mm/s3, and tracking error constraints with bound 0.05 mm are considered. The optimized trajectories are shown in Figures 3(a), 3(b), 3(c), and 3(d).Bang-bang constraint structure of the minimum time trajectory for the ellispe path.
(a)
(b)
(c)
(d)From Figure3, we can see that the optimized constraint structure for the elliptical path is bang-bang. This is consistent with Theorem 1.


## 4. Nonconvex Constraints Handling Strategy

In our previous paper [11], a constraint convexification strategy is proposed to realize a convex optimization solution of the jerk constrained minimum time trajectory planning problem which is proven to be nonconvex. In this paper, a new constraint convexification strategy called active set strategy is proposed to handle the complex nonconvex tracking error constraint.From Theorem1, we have known that the optimal constraint curves have the bang-bang structure, which means that if there exists a small interval [ua,ub] of the parameter domain in which none of the velocity, acceleration, and jerk constraints is active, then at least one of the tracking error constraints is active (denoted by er(u)=EB, u∈[ua,ub]). In this case, we have
(35)e¨r(u)=0,e˙r(u)=0foru∈(ua,ub),e¨r(u)≠0,e˙r(u)≠0foru=ua,u=ub.Now in(ua,ub) if we define a pseudo tracking error function as
(36)e~r(u)=1a0(b2ar(u)+b1vr(u)),
then we have e~r(u)=er(u)=EB for u∈(ua,ub).The pseudo function (36) can be further written as
(37)e~r(u)=1a0(b2(r′′q(u)+r′qp(u))+b1r′q(u)).
Since r′(u) is variable in [0,1], the function (37) can be nonconvex which is an inefficient formula.Here we define a typical problem named asoriginal P, which is described as minimum motion time along given path while the trajectory is only subjected to velocity and acceleration constraints. According to the works of Bobrow et al. [27], Zhang et al. [11], and Fan et al. [12], we have the fact that the optimal solution of theoriginal P is maximum among all feasible solutions for any u∈[0,1]. So let q(u) be any feasible solution of problem (17), which is also feasible for theoriginal P, and then we have
(38)q(u)≤qmax⁡(u),u∈[0,1]
with qmax⁡(u) the optimal solution of theoriginal P.According to (38), four subfunctions are constructed in this paper to handle the nonconvex constraint -erB≤e~r(u)≤erB, which are
(39)e~r(u)={1a0(b2ar(u)+b1r′qmax⁡(u)),ifr′≥01a0(b2ar(u)+b1r′q(u)qmax⁡(u)),ifr′<0hhhhhhhhhhhfortheconstrainte~r(u)≤erB,(40)e~r(u)={1a0(b2ar(u)+b1r′q(u)qmax⁡(u)),ifr′≥01a0(b2ar(u)+b1r′qmax⁡(u)),ifr′<0hhhhhhhhhfortheconstraint-erB≤e~r(u).
We can check that the four subfunctions are all linear w.r.t the states (q,qp). More importantly, the constructed four subfunctions are the overestimate of the constraint function (37).Remark. In our nonconvex constraints handling strategy, the pseudo function (36) is only defined in open interval (ua,ub), so possible constraint failure exists at the end points of the interval, ua, ub. However, since the closed loop control system is configured to underdamping stable as mentioned in (7), the tracking error governed by our constraints handling strategy is still bounded which is supported by Theorem 2.7 in Guo et al. [24]. The solution of the examples in Section 6 can also verify this conclusion.


## 5. A Convex Optimization Based Problem Solution Strategy

Problem (17) is a complex nonlinear optimal control problem with mixed and pure state constraints. Direct parameterization method is inefficient to solve this problem. According to our previous works in [11], the velocity, acceleration, and jerk constrained minimum time trajectory planning problem can be solved by a convex optimization method. So in this paper, the nonlinear tracking error constraint function is the key issue needed to be solved.In this paper, a novel solution strategy of problem (17) is proposed and named as active set approach which means only the active tracking error constraints are considered in the trajectory planning problem. And then linear pseudo tracking error constraint functions (39) and (40) are used to replace the real tracking error constraint functions to make the problem solution efficiently.Hence the following convex optimization subproblem can be constructed:(41)min⁡qppJ=∫011qdus.t.{q′=qp,q(0)=q0,q(1)=qf,qp′=qpp,qp(0)=qp,0,qp(1)=qp,f,(r′)2q(u)≤vrB2,u∈[0,1],|r′′q(u)+r′qp(u)|≤arB,u∈[0,1],|r′′′q(u)+3r′′qp(u)+r′qpp(u)|qmax⁡(u)≤jrB,mmmmmmmmmmmmmcccmmmmmu∈[0,1],|e~r(u)|≤erB,u∈S,r=x,y,z,
where S denotes the active constraints set of tracking error and e~r(u) is evaluated by (39) or (40) under different conditions.The solution of problem (41) can be realized by using the B spline based trajectory parameterization method as mentioned in Zhang et al. [28].LetK be a positive integer, and since the trajectory q(u) is fixed at the end points, written as q(0)=q0, q(1)=qf, the sequence of grid nodes must be clamped, written as
(42)un=[0,…,0︸p+1,u1,…,ui,…,uK-1,1,…,1︸p+1].In problem (41) the trajectory qpp needs to be estimated, and the three-order derivative information of trajectory q(u) should exist. Hence, let p=2 mean that 3-order B-spline is suitable for our problem. Then the trajectories q(u), qp(u), and qpp(u) can be approximated by the following B-spline curves in parameter interval [0,1]:
(43)q(u)≈q~(u)=∑i=0K+1Ni,p(u)q^i,qp(u)≈q~p(u)=12∑i=0K+1Ni,p′(u)q^i,qpp(u)≈q~pp(u)=12∑i=0K+1Ni,p′′(u)q^i,
where q^i is the ith decision variable and Ni,p(s) denotes the ith basis function defined as
(44)Ni,0(s)={1ifsn(i)≤s≤sn(i+1)0otherwise,Ni,p(s)=s-sn(i)sn(i+p)-sn(i)Ni,p-1(s)-sn(i+p+1)-ssn(i+p+1)-sn(i+1)Ni+1,p-1(s).
And the derivative information of basis function can be calculated by
(45)Ni,p′(s)=ddsNi,p(s)=psn(i+p)-sn(i)Ni,p-1(s)-psn(i+p+1)-sn(i+1)Ni+1,p-1(s).The vector forms of (43) are written as
(46)q~(u)=NpT(u)q^,q~p(u)=dNpT(u)q^,q~pp(u)=ddNpT(u)q^,
where
(47)q^=[q^0,q^1,…,q^K+1]T,Np=[N0,p,N1,p,…,NK+1,p]T,dNp=12Np′,ddNp=12Np′′.The pointwise discretization method is used to parameterize the path constraints and the convergence proof of this method can be found in Chen and Vassiliadis [29]. Let u-j denote the jth constraint reference node and
(48)u-j={12u1,j=112(uj-1+uj),j=2,…,K-112(uK-1+1),j=K.Then we can obtain the values of each trajectoryq(u), qp(u), and qpp(u) at node u-j, written as q(u-j), qp(u-j), and qpp(u-j), j=1,2,…,K. The minimum time objective can be approximated as
(49)min⁡J=∫011q(u)du≈∑j=1K(Δu-jq(u-j)).So the convex optimal control problem (41) can be approximated by the following convex optimization problem:
(50)min⁡q^J=∑j=1K(Δu-jNpT(u-j)q^)s.t.{q^0=q0,q^K+1=qf,dNpT(u-1)q^=qp,0,dNpT(u-K)q^=qp,f,(r′)2NpT(u-j)q^≤vrB2,|r′′NpT(u-j)+r′dNpT(u-j)|q^≤arB,qmax⁡(u-j)|r′′′NpT(u-j)+3r′′dNpT(u-j)mmmmmmm+r′ddNpT(u-j)|q^≤jrB,cmmmmmmmmmmccj=1,2,…,K,e~r(u-kur)≤erB,e~r(u-kdr)≥-erB,ku∈Sur,kd∈Sdr,r=x,y,z,
where Sur and Sdr denote the upper and lower active constraints sets of the r-axis tracking error, respectively. Consider
(51)e~r(u-k)={(qmax(u-k)b2(r′′NpT(u-k)+r′dNpT(u-k))q^cm+b1r′qmax⁡(u-k))(a0)-1,mmmmmcmmmmmifr′≥0(NpT(u-k)q^qmax⁡(u-k)b2(r′′NpT(u-k)+r′dNpT(u-k))q^cm+b1r′NpT(u-k)q^qmax⁡(u-k))(a0)-1,mmmmmmmmmmifr′<0
for e~r(u)≤erB, and
(52)e~r(u-k)={(NpT(u-k)q^qmax⁡(u-k)b2(r′′NpT(u-k)+r′dNpT(u-k))q^cm+b1r′NpT(u-k)q^qmax⁡(u-k))(a0)-1,mmmmmmcmmmmifr′≥0(qmax⁡(u-k)b2(r′′NpT(u-k)+r′dNpT(u-k))q^mc+b1r′qmax⁡(u-k))(a0)-1,mmmmmmmcmmmifr′<0
for -erB≤e~r(u).The proposed optimization strategy is achieved by executing the following steps.Step 1.
Theoriginal P is solved firstly by using the convex optimization as mentioned in [30] with the purpose of getting the actual maximum parameter velocity trajectory qmax⁡(u) with u∈[0,1].Step 2.
Initial the upper and lower active constraints sets of tracking errors for all 3 axes, denoted bySur={}, Sdr={}. Initial iteration k=1.Step 3.
By usingqmax⁡(u), (Sur)k, and (Sdr)k, we construct convex optimization subproblem (50). In the following, problem (50) is solved to obtain the optimal trajectory qopt(u).Step 4.
Theqopt(u) acts as reference command; the tracking error of each axis is estimated by solving equation (15). If no tracking error crosses the given bounds, algorithm stops. If the r-axis tracking error exceeds the upper limit at point u-j, then update the active set (Sur)k+1=(Sur)k∪{u-j}. If the r-axis tracking error exceeds the lower limit at point u-j, then update the active set (Sdr)k+1=(Sdr)k∪{u-j};Step 5.
If the updated active sets satisfy(Sur)k+1=(Sur)k and (Sdr)k+1=(Sdr)k for all r, the final solution is obtained and algorithm stops, else k=k+1, go to Step 3.


## 6. Illustrative Examples

In this section, we present two test examples to verify the effectiveness of the proposed approach. First, a simple ellipse path constrained minimum time trajectory planning problem mentioned in Section3.5 is solved to present the feasibility of the pseudo tracking error constrained trajectory. Then a NURBS type butterfly pattern manufacturing problem with practical high order control system is tested to show the practicability of the proposed approach.The numerical implement of the convex optimization problem (50) for the test paths is achieved by using the MATLAB SQP routinefmincon. All the numerical solutions are run on a laptop with windows 32 bit system, 2.5 GHz Core i3 processor, 2 GB RAM memory.For convenience, we use MTT, SMTT, TEC-SMTT, and RTEC-SMTT to denote the minimum time trajectory, the smooth minimum time trajectory, the proposed tracking error constrained SMTT, and the original real tracking error constrained SMTT, respectively.


### 6.1. An Ellipse Path Test

The path equation and constraint settings are mentioned in Section3.5. By executing the proposed strategy in Section 5, the TEC-SMTT is obtained for the ellipse path. The MTT and SMTT are also calculated for comparison.Figure4 shows the tracking error estimation at initial iteration of the proposed strategy. The corresponding active constraints indicator of tracking error trajectory is also shown. In the solution process, the final solution is achieved by only 2 iterations. The optimized velocity, acceleration, and jerk curves of the TEC-SMTT for all axes are shown in Figures 5(b), 6(b), and 7(b), respectively. The estimated tracking error curves corresponding to the optimized TEC-SMTT are shown in Figure 8(b). The optimized velocity, acceleration, jerk, and tracking error curves for the SMTT are shown in Figures 5(a), 6(a), 7(a), and 8(a) for comparison. From Figure 8(b), we can see that the proposed tracking error constrained trajectory optimization strategy is efficient to reduce tracking error in this example, which is consistent with our previous discussion in this paper. More details are shown in Table 1. The RTEC-SMTT has been calculated in Section 3.5, and the details are also shown in Table 1. In Table 1, the tracking error is estimated by simulating the control system in Matlab Simulink environment under the interpolation period T=1 ms.Table 1
Performance comparison among MTT, SMTT, TEC-SMMT, and RTEC-SMTT for the ellipse path.
Planning time*
Machining time (s)
Mean tracking error (μm)
Maximum tracking error (μm)
X-axis
Y-axis
X-axis
Y-axis
MTT
5.84 s
1.527
52.97
20.06
104.21
55.06
SMTT
8.69 s
1.900
39.19
16.04
102.18
49.91
TEC-SMTT
23.15 s
2.160
31.52
12.22
50.06
39.23
RTEC-SMTT
15 min♢
2.077
33.95
12.82
52.31
39.58
*Planning times in this table are obtained under the conditions of initial guess 0.001 and number of parameterized grids 200.
♢Since the RTEC-SMTT is hardly to be obtained, the planning time for this trajectory is only an estimate by repeated attempts.Figure 4
Tracking error estimation at initial iteration of the proposed strategy and the corresponding active constraints indicator of tracking error trajectory.Velocity trajectories of the (a) SMTT and (b) TEC-SMTT.
(a)
(b)Acceleration trajectories of the (a) SMTT and (b) TEC-SMTT.
(a)
(b)Jerk trajectories of the (a) SMTT and (b) TEC-SMTT.
(a)
(b)Tracking error trajectories of the (a) SMTT and (b) TEC-SMTT.
(a)
(b)By doing statistics of the data in Table1, the proposed TEC-SMTT can reduce maximum tracking errors 52% and 51% compared with the MTT and SMTT for the ellipse path; the corresponding time losses 41.5% and 13.7%, respectively. For comparison, the RTEC-SMTT reduces tracking errors 49.8% and 48.8% compared with the MTT and SMTT; the corresponding time losses 36% and 9.3%, respectively. The TEC-SMTT has similar dynamics performance with the RTEC-SMTT, but the computation cost of the proposed approach is much smaller.


### 6.2. A Butterfly Contour Test

For the purpose of testing the practicability and robustness of the proposed tracking error constrained minimum time trajectory planning method, in this subsection a butterfly contour test configured with practical high order control system is studied. The butterfly contour is shown in Figure9.Figure 9
A butterfly contour Tsai et al. [23].The 3-axis machining equipment is simulated by Matlab Simulink. Each axis is controlled by an independent PID controller from Tsai et al. [23]. Each closed loop control system includes position P control and velocity PI control loops, and a velocity feed forward path. The parameters of the control systems can be found in Tsai et al. [23]. The closed loop transfer function for each axis has the following structure:
(53)Φ(s)=X(s)R(s)=b-2s2+b-1s+b-0a-4s4+a-3s3+a-2s2+a-1s+a-0,
which is four-order. For x-axis of the simulated machine, the control parameters of (53) are
(54)b-2=1.4714e+005,b-1=3.4767e+007,b-0=1.9388e+009,a-4=1,a-3=698.4138,a-2=2.1351e+005,a-1=3.5388e+007,a-0=1.9388e+009.Fory-axis, the control parameters are
(55)b-2=1.4664e+005,b-1=3.4351e+007,b-0=1.9040e+009,a-4=1,a-3=694.8207,a-2=2.1210e+005,a-1=3.4964e+007,a-0=1.9040e+009.Here we ignore the influence of dipole and non-dominant pole to the closed loop system, and we can have the order reduced error transfer function, which has the structure of (4). For x-axis, the parameters of the reduced model (4) are
(56)a2=1,a1=289.3,a0=6.56e004,b2=1,b1=-159.7.Fory-axis, the parameters are
(57)a2=1,a1=290.5,a0=6.563e004,b2=1,b1=-164.5.In this example, the axis acceleration constraints with bound 2500 mm/s2, jerk constraints with bound 100,000 mm/s3, and tracking error constraints with bound 0.15 mm are considered.Based on the reduced control system model, the TEC-SMTT is generated by our proposed approach. Considering the influence of the reduced order model to the control system dynamics, the error bound for the reduced order model is relaxed to 0.25 mm. In this subsection, the mentioned tracking error estimation is based on the reduced control system model.Figure10 shows the tracking error curves which vary along with the iteration of the algorithm. The corresponding active constraints indicator of tracking error trajectory is also shown. The final TEC-SMTT solution is obtained by 2 iterations with time cost 37.64 s. For this butterfly contour, the RTEC-SMTT cannot be obtained efficiently, so no result for this trajectory is listed here. The feedrate trajectories of the optimized SMTT and TEC-SMTT are shown in Figure 11. The planning time costs are listed in Table 2.Table 2
Performance comparison among MTT, SMTT, and TEC-SMMT for the butterfly contour.
Planning time* (s)
Machining time (s)
Mean tracking error (μm)
Maximum tracking error (μm)
X
Y
X
Y
MTT
12.23
2.736
63.31
76.51
162.61
161.08
SMTT
18.01
3.051
52.65
63.34
158.84
156.52
TEC-SMTT
37.64
3.403
41.98
50.65
118.60
135.49
SMTT-T1
23.90
3.462
41.64
49.95
154.24
136.51
SMTT-T2
21.82
3.853
34.4
41.23
146.43
127.56
*Planning times in this table are obtained under the conditions of initial guess 0.001 and number of parameterized grids 250.Figure 10
Tracking error estimation based on the reduced control system model and the corresponding active constraints indicator.Figure 11
Planned feedrate trajectories of the SMTT (solid line) and TEC-SMTT (dash line).Because of the approximate operation for the problem, the tracking error curves of the planned butterfly trajectory exceed the setting bound slightly in some intervals as shown in Figure10. Even so, the planned trajectory is efficient for reducing the tracking error compared with the ordinary jerk constrained smooth trajectory. The data in Table 2 also confirm this.Then the optimized MTT, SMTT, and TEC-SMTT are interpolated into control commands with interpolation periodT=1 ms. The full four-order control system model for each axis is used to simulate the machining process. Figures 14(a) and 14(b) present the simulated tracking error curves for the optimized SMTT and TEC-SMTT commands, respectively. The corresponding execution velocity, acceleration and frequency curves are shown in Figures 12, 13, and 15, respectively. From these figures, we can see that the proposed TEC-SMTT can have smaller tracking error than the SMTT. More details are shown in Table 2. From Table 2, the TEC-SMTT can reduce maximum tracking errors 27.1% and 25.3% compared with the MTT and SMTT for the butterfly contour, the corresponding time losses 24.3% and 11.5%, respectively. The results indicate that the proposed TEC-SMTT is efficient for this practical high order controlled example implying that the proposed approach is practical and robust.Simulated execution velocity curves of the (a) SMTT and (b) TEC-SMTT commands.
(a)
(b)Simulated execution acceleration curves of the (a) SMTT and (b) TEC-SMTT commands.
(a)
(b)Simulated tracking error curves under the (a) SMTT and (b) TEC-SMTT commands.
(a)
(b)Execution frequency curves of the (a) SMTT and (b) TEC-SMTT commands.
(a)
(b)Since the common trajectory modification method for improving machining precision is to confine jerk, in this example the smooth minimum time trajectory planning problems with different jerk constraint settings are tested.The confined jerks are 60,000 mm/s3 and 45,000 mm/s3 and corresponding trajectories are labeled by SMTT-T1 and SMTT-T2. The test results are listed in Table 2.From the results in Tables1 and 2, we can see that the jerk constrained SMTTs are efficient for reducing the mean tracking error, but the effectiveness of reducing maximum tracking error is weak compared with the proposed TEC-SMTT. Figure 16 presented the machining contours under the MTT, SMTT, and TEC-SMTT commands, respectively. From this figure, we can see that the proposed method is also efficient for reducing contour error, especially in the case of high speed machining. Since the computation time of the TEC-SMTT is acceptable for off-line applications, replace SMTT with TEC-SMTT as the high precision minimum time command is reasonable in practical applications.Figure 16
Simulated machining contours under the MTT (dash line), SMTT (dot line), and TEC-SMTT (dash-dot line) commands for the butterfly pattern.


## 6.1. An Ellipse Path Test

The path equation and constraint settings are mentioned in Section3.5. By executing the proposed strategy in Section 5, the TEC-SMTT is obtained for the ellipse path. The MTT and SMTT are also calculated for comparison.Figure4 shows the tracking error estimation at initial iteration of the proposed strategy. The corresponding active constraints indicator of tracking error trajectory is also shown. In the solution process, the final solution is achieved by only 2 iterations. The optimized velocity, acceleration, and jerk curves of the TEC-SMTT for all axes are shown in Figures 5(b), 6(b), and 7(b), respectively. The estimated tracking error curves corresponding to the optimized TEC-SMTT are shown in Figure 8(b). The optimized velocity, acceleration, jerk, and tracking error curves for the SMTT are shown in Figures 5(a), 6(a), 7(a), and 8(a) for comparison. From Figure 8(b), we can see that the proposed tracking error constrained trajectory optimization strategy is efficient to reduce tracking error in this example, which is consistent with our previous discussion in this paper. More details are shown in Table 1. The RTEC-SMTT has been calculated in Section 3.5, and the details are also shown in Table 1. In Table 1, the tracking error is estimated by simulating the control system in Matlab Simulink environment under the interpolation period T=1 ms.Table 1
Performance comparison among MTT, SMTT, TEC-SMMT, and RTEC-SMTT for the ellipse path.
Planning time*
Machining time (s)
Mean tracking error (μm)
Maximum tracking error (μm)
X-axis
Y-axis
X-axis
Y-axis
MTT
5.84 s
1.527
52.97
20.06
104.21
55.06
SMTT
8.69 s
1.900
39.19
16.04
102.18
49.91
TEC-SMTT
23.15 s
2.160
31.52
12.22
50.06
39.23
RTEC-SMTT
15 min♢
2.077
33.95
12.82
52.31
39.58
*Planning times in this table are obtained under the conditions of initial guess 0.001 and number of parameterized grids 200.
♢Since the RTEC-SMTT is hardly to be obtained, the planning time for this trajectory is only an estimate by repeated attempts.Figure 4
Tracking error estimation at initial iteration of the proposed strategy and the corresponding active constraints indicator of tracking error trajectory.Velocity trajectories of the (a) SMTT and (b) TEC-SMTT.
(a)
(b)Acceleration trajectories of the (a) SMTT and (b) TEC-SMTT.
(a)
(b)Jerk trajectories of the (a) SMTT and (b) TEC-SMTT.
(a)
(b)Tracking error trajectories of the (a) SMTT and (b) TEC-SMTT.
(a)
(b)By doing statistics of the data in Table1, the proposed TEC-SMTT can reduce maximum tracking errors 52% and 51% compared with the MTT and SMTT for the ellipse path; the corresponding time losses 41.5% and 13.7%, respectively. For comparison, the RTEC-SMTT reduces tracking errors 49.8% and 48.8% compared with the MTT and SMTT; the corresponding time losses 36% and 9.3%, respectively. The TEC-SMTT has similar dynamics performance with the RTEC-SMTT, but the computation cost of the proposed approach is much smaller.


## 6.2. A Butterfly Contour Test

For the purpose of testing the practicability and robustness of the proposed tracking error constrained minimum time trajectory planning method, in this subsection a butterfly contour test configured with practical high order control system is studied. The butterfly contour is shown in Figure9.Figure 9
A butterfly contour Tsai et al. [23].The 3-axis machining equipment is simulated by Matlab Simulink. Each axis is controlled by an independent PID controller from Tsai et al. [23]. Each closed loop control system includes position P control and velocity PI control loops, and a velocity feed forward path. The parameters of the control systems can be found in Tsai et al. [23]. The closed loop transfer function for each axis has the following structure:
(53)Φ(s)=X(s)R(s)=b-2s2+b-1s+b-0a-4s4+a-3s3+a-2s2+a-1s+a-0,
which is four-order. For x-axis of the simulated machine, the control parameters of (53) are
(54)b-2=1.4714e+005,b-1=3.4767e+007,b-0=1.9388e+009,a-4=1,a-3=698.4138,a-2=2.1351e+005,a-1=3.5388e+007,a-0=1.9388e+009.Fory-axis, the control parameters are
(55)b-2=1.4664e+005,b-1=3.4351e+007,b-0=1.9040e+009,a-4=1,a-3=694.8207,a-2=2.1210e+005,a-1=3.4964e+007,a-0=1.9040e+009.Here we ignore the influence of dipole and non-dominant pole to the closed loop system, and we can have the order reduced error transfer function, which has the structure of (4). For x-axis, the parameters of the reduced model (4) are
(56)a2=1,a1=289.3,a0=6.56e004,b2=1,b1=-159.7.Fory-axis, the parameters are
(57)a2=1,a1=290.5,a0=6.563e004,b2=1,b1=-164.5.In this example, the axis acceleration constraints with bound 2500 mm/s2, jerk constraints with bound 100,000 mm/s3, and tracking error constraints with bound 0.15 mm are considered.Based on the reduced control system model, the TEC-SMTT is generated by our proposed approach. Considering the influence of the reduced order model to the control system dynamics, the error bound for the reduced order model is relaxed to 0.25 mm. In this subsection, the mentioned tracking error estimation is based on the reduced control system model.Figure10 shows the tracking error curves which vary along with the iteration of the algorithm. The corresponding active constraints indicator of tracking error trajectory is also shown. The final TEC-SMTT solution is obtained by 2 iterations with time cost 37.64 s. For this butterfly contour, the RTEC-SMTT cannot be obtained efficiently, so no result for this trajectory is listed here. The feedrate trajectories of the optimized SMTT and TEC-SMTT are shown in Figure 11. The planning time costs are listed in Table 2.Table 2
Performance comparison among MTT, SMTT, and TEC-SMMT for the butterfly contour.
Planning time* (s)
Machining time (s)
Mean tracking error (μm)
Maximum tracking error (μm)
X
Y
X
Y
MTT
12.23
2.736
63.31
76.51
162.61
161.08
SMTT
18.01
3.051
52.65
63.34
158.84
156.52
TEC-SMTT
37.64
3.403
41.98
50.65
118.60
135.49
SMTT-T1
23.90
3.462
41.64
49.95
154.24
136.51
SMTT-T2
21.82
3.853
34.4
41.23
146.43
127.56
*Planning times in this table are obtained under the conditions of initial guess 0.001 and number of parameterized grids 250.Figure 10
Tracking error estimation based on the reduced control system model and the corresponding active constraints indicator.Figure 11
Planned feedrate trajectories of the SMTT (solid line) and TEC-SMTT (dash line).Because of the approximate operation for the problem, the tracking error curves of the planned butterfly trajectory exceed the setting bound slightly in some intervals as shown in Figure10. Even so, the planned trajectory is efficient for reducing the tracking error compared with the ordinary jerk constrained smooth trajectory. The data in Table 2 also confirm this.Then the optimized MTT, SMTT, and TEC-SMTT are interpolated into control commands with interpolation periodT=1 ms. The full four-order control system model for each axis is used to simulate the machining process. Figures 14(a) and 14(b) present the simulated tracking error curves for the optimized SMTT and TEC-SMTT commands, respectively. The corresponding execution velocity, acceleration and frequency curves are shown in Figures 12, 13, and 15, respectively. From these figures, we can see that the proposed TEC-SMTT can have smaller tracking error than the SMTT. More details are shown in Table 2. From Table 2, the TEC-SMTT can reduce maximum tracking errors 27.1% and 25.3% compared with the MTT and SMTT for the butterfly contour, the corresponding time losses 24.3% and 11.5%, respectively. The results indicate that the proposed TEC-SMTT is efficient for this practical high order controlled example implying that the proposed approach is practical and robust.Simulated execution velocity curves of the (a) SMTT and (b) TEC-SMTT commands.
(a)
(b)Simulated execution acceleration curves of the (a) SMTT and (b) TEC-SMTT commands.
(a)
(b)Simulated tracking error curves under the (a) SMTT and (b) TEC-SMTT commands.
(a)
(b)Execution frequency curves of the (a) SMTT and (b) TEC-SMTT commands.
(a)
(b)Since the common trajectory modification method for improving machining precision is to confine jerk, in this example the smooth minimum time trajectory planning problems with different jerk constraint settings are tested.The confined jerks are 60,000 mm/s3 and 45,000 mm/s3 and corresponding trajectories are labeled by SMTT-T1 and SMTT-T2. The test results are listed in Table 2.From the results in Tables1 and 2, we can see that the jerk constrained SMTTs are efficient for reducing the mean tracking error, but the effectiveness of reducing maximum tracking error is weak compared with the proposed TEC-SMTT. Figure 16 presented the machining contours under the MTT, SMTT, and TEC-SMTT commands, respectively. From this figure, we can see that the proposed method is also efficient for reducing contour error, especially in the case of high speed machining. Since the computation time of the TEC-SMTT is acceptable for off-line applications, replace SMTT with TEC-SMTT as the high precision minimum time command is reasonable in practical applications.Figure 16
Simulated machining contours under the MTT (dash line), SMTT (dot line), and TEC-SMTT (dash-dot line) commands for the butterfly pattern.


## 7. Conclusions

In this paper, an efficient computation approach for solving tracking error constrained minimum time trajectory has been presented. The proved “bang-bang” constraint structure of the optimal trajectory induces a novel convex optimization based strategy to realize the solution of the complex tracking error constrained minimum time trajectory planning problem. Because of the convexity of the optimization strategy, the optimized value is unique and the solution process is efficient. The planning tests on the examples present the ability of the approach to generate optimized trajectory. The experiment results have also shown that the trajectory generated by the proposed approach is practical and robust.



---

*Source: 835098-2014-07-20.xml*