Repetitive Control Meets Continuous Zero Phase Error Tracking Controller for Precise Tracking of B-Spline Trajectories

In this paper, a novel repetitive control scheme is presented and discussed, based on the so-called B-spline filters. These dynamic filters are able to generate a B-spline trajectory if they are fed with the sequence of control points defining the curve. Therefore, they are ideal tools for generating online reference signals with the prescribed level of smoothness for driving dynamic systems, possibly together with a feedforward compensator. In particular, a continuous zero phase error tracking controller (ZPETC) can be used for tracking control of nonminimum phase systems but because of its open-loop nature it cannot guarantee the robustness with respect to modeling errors and exogenous disturbances. For this reason, ZPETC and trajectory generator have been embedded in a repetitive control scheme that allows to nullify interpolation errors even in nonideal conditions, provided that the desired reference trajectory and the disturbances are periodic. This paper is based on the results presented in the conference paper [L. Biagiotti, F. Califano, and C. Melchiorri, “Repetitive control of non-minimum phase systems along b-spline trajectories,” in Proc. IEEE 55th Conf. Decis. Control, 2016, pp. 5496–5501.], where asymptotic stability of the overall control scheme has been proved mathematically, but extends such results with an experimental validation based on a nonminimum phase system. Different models of the same physical system have been identified and used in the implementation of this model-based control scheme, allowing a real evaluation of the relationship between control system performance and model accuracy.


Repetitive Control Meets Continuous Zero Phase Error Tracking Controller for Precise
Tracking of B-Spline Trajectories repetitive control (RC) approach represents a quite standard and effective solution to achieve asymptotic perfect tracking, i.e., being able to cancel tracking errors over repetitions by learning from previous iterations [2]- [4]. On the basis of this consideration, and by observing that in practical applications complex reference signals are generated by means of tools, such as Spline, Bezier, Nurbs curves, and other similar functions [5]. In the seminal work [6], a scheme based on RC mechanism has been proposed in order to modify a B-spline reference trajectory with the purpose of improving the tracking accuracy. Note that in the recent literature, the use of B-spline functions combined with learning mechanisms, such as RC and iterative learning control (ILC) and similar, have been proposed in order to reduce the complexity of the resulting controller and increasing the robustness of the system. For instance, in [7] and [8] B-spline functions are used to parameterize a feedforward control term for improving the position control of robotic manipulators. The weights defining the spline are adapted on the basis of the tracking error with a learning algorithm, leading to the control scheme called desired compensation learning law [9]. Another type of feedforward control where the control action is decomposed as a linear combination of B-spline basis functions is proposed in [10] and [11]. In this case, the basis functions are forward filtered using the (model) dynamics of the plant, hence the name filtered basis function method, and the control points defining the B-spline curve are computed by solving an optimization problem which minimizes the tracking error with respect to the desired trajectory. This approach has been successfully applied also to nonminimum phase systems [10] as an alternative to other specially designed feedforward methods, such as, ZPETC, but it is worth highlighting that it is completely open-loop and therefore cannot compensate for model errors and external disturbances. In [12], a library of the basic output functions, parameterized as B-spline, for a nonminimum phase plant is first built and the ILC is used to determine the corresponding input signals. Then, the control is deduced by decomposing the desired output trajectory according to the function primitives of the library and by synthesizing the input signal via the superposition principle. Differently from the approach proposed in our paper, the learning mechanism is used offline, before the normal functioning of the controller.
In the approach initially proposed in [6] but described more in depth in [13] the (controlled) plant and an online B-spline trajectory planner, based on dynamic filters, have been inserted together in an external RC loop that modifies in real time the control points defining the B-spline curve so that the interpolation error at the desired via-points converges to zero. This technique offers great advantages in real applications in terms of low complexity and ease of parameters tuning, without the need of a deep knowledge of the plant model. Moreover, it can be applied to all those systems, like servo-motors or robotic manipulators, that equipped with an (unmodifiable) offthe-shelf controller, only admit an external reference signal. On the other hand, the proposed control scheme relies on the hypothesis that the plant P (s), already controlled, is characterized by an acceptable tracking capability within a certain frequency range, i.e., where ω m denotes the maximum frequency of the reference input. Since it is assumed that P (s) cannot be modified, this condition constraints the frequency spectrum of the B-spline reference trajectory, and consequently its duration, which cannot be made arbitrarily short. In order to cope with this limitation, a novel RC scheme has been presented [1], in which the realtime modification of the control points defining the reference B-spline trajectory is combined with a feed-forward compensation. In particular, in order to deal also with nonminimum phase plants, a technique that generalizes the standard inversion-based feedforward control has been considered, i.e., the zero phase error tracking controller (ZPETC) introduced in [14]. Note that among the different feedforward techniques for tracking control of nonminimum phase systems that are available in the literature [15], the ZPETC is the method that minimizes (ideally nullifies) the phase shift due to the plant, which is one the most critical aspect of RC, see [13]. Therefore, three technologies, i.e., B-spline trajectory generation, ZPETC, and RC, that are well-established not only in the literature but also in the industrial practice, have merged together for the first time. As a matter of fact, the possibility to modify online the control points that defines a B-spline with an RC mechanism in a unique discrete-time scheme has been made possible only by the particular way of generating the B-spline curve that we proposed in this paper [16], that is by means of a chain of dynamic filters. On the other hand, the B-spline generator, along with the reference trajectory profile, generates its time derivatives online that allows the implementation of the ZPETC, which is usually not causal, in its continuous time version called continous ZPETC (CZPETC). Note that the combination of RC and ZPETC has been proposed since the first publications on this subject, i.e., in [14], but only in the discrete-time domain to overcome causality problems. The major advantage of the scheme designed in the continuous-time domain is the possibility to design a plug-in RC for systems that, besides the reference trajectory, require a feedforward term. A notable example in the industrial field (even if minimum phase) is represented by the control of electrical motors, that, in order to assure a large bandwidth, is based on velocity/acceleration feedforward compensations in addition to the standard cascade control structure, see Fig. 1.
Because of the introduction of the CZPETC the control scheme strongly depends on the knowledge of the plant model. For this reason, it is of great interest to investigate how the accuracy of the model influences the performance of the overall algorithm. Accordingly, the theoretical results reported in the conference paper [1] are extended in this paper with a number of experimental results. A mechanical system based on variable stiffness actuators has been considered as a benchmark, in which the noncollocated placement of actuators and sensors produces nonminimum phase zeros [18].
Even if seemingly obvious, the integration of the CZPETC into the RC scheme, represents an important step forward with respect to the results reported in previous papers [6], [13] since, at least in nominal conditions, it allows to achieve the asymptotic stability of the RC scheme for any value of the time period T between via-points to be interpolated, even in case of nonminimum phase plants. This means that the stability of the control scheme does not depend anymore on the duration of the reference trajectory, as in [6], [13]. Note that in the latter works, the presence of the trajectory generator directly embedded in the RC scheme is not fully exploited, e.g., for a feedforward action; but the success of the overall RC scheme relies only on the capability of the plant to track the reference signal. The experimental results proposed in this paper demonstrate the superiority of the new approach (with respect to the case without CZPETC, i.e., R CZPETC (s) = 1) even if the plant model is affected by large uncertainties.
This paper is organized as follows. In Section II, a general overview of the basic tools used in the design of the proposed control algorithm is given. Then, in Section III the new RC scheme based on B-spline and ZPETC is presented and its properties are analyzed. Finally, in Section IV the performances in terms of convergency rate and robustness are evaluated experimentally. Section V concludes this paper.

II. OVERVIEW OF THE USED TECHNIQUES
As mentioned in the introduction, the design of the proposed control scheme descends from the integration of three different technologies, that are briefly summarized in this section.

A. Continuous Zero Phase Error Tracking Controller
The CZPETC is a feedforward compensator representing an extension of the complete dynamic inversion for systems characterized by unstable zeros. A generic stable SISO LTI system G(s) can be decomposed as where D(s), N s (s), and N u (s) denote respectively the factors corresponding to the n poles, the m s stable zeroes, and m u unstable zeroes of the plant. The CZPET controller assumes the form In this manner, if m u = 0, the cascade R(s)G(s) becomes This means that the residual dynamics of R(s)G(s) is represented by pairs of zeros ±z i , i = 1, . . . , m u . Obviously, if m u = 0, i.e., the system is minimum phase, R(s) is a standard feedforward controller that completely cancels the dynamics of the plant (R(s) = G −1 (s)) and R(s)G(s) = 1.
Since unstable zeros cannot be canceled or modified either with a feedforward regulator, for clear stability reasons, or with a feedback controller, the use of CZPETC represents a solution in those applications where phase shift is very critical. In fact, the function R(s)G(s) in (3) is characterized by the following properties.
Property 1: |G(jω)R(jω)| ≈ 1 for ω < ω , being ω the break frequency corresponding to the smallest unstable zero. The asymptotic slope of the Bode plot for magnitude is +2m u × 20 db/decade. Property 2: ∠G(jω)R(jω) = 0 rad ∀ω, since, for any unstable zero, the cascade R(s)G(s) contains also its opposite, and therefore their phase contributions compensate each other. The major drawback of CZPETC, and in general of inversionbased feedforward approaches, concerns the practical implementation of the controller, which is generally noncausal. In fact, if γ is the (nonnegative) relative degree of the plant G(s), the relative degree of R(s) is ρ = m s − (n + m u ) = −γ − 2m u which is strictly negative, unless γ = m u = 0. A way to cope with this problem is based on the precognition of the reference signal. By diving numerator and denominator, R(s) can be rewritten as where W (s) is a strictly proper transfer function. Consequently, the control action of the CZPETC will result in where Y r (s) denotes the Laplace transform of the reference input, and in time domain Therefore, in order to compute the control signal u(t) the knowledge of y r (t) and its first |ρ| derivatives is necessary. Obviously, in order to guarantee the feasibility of u(t), the |ρ| derivatives must be limited and consequently y r (t) ∈ C |ρ|−1 .

B. Reference Trajectory Generation Via B-Spline Filters and Integration With the CZPETC
In many practical applications, smooth reference signals are defined using spline functions interpolating a set of desired via-points q k , i = 0, . . . , n − 1. In the following uniform B-spline curves are considered, i.e., splines in the so-called B-form characterized by an equally-spaced distribution of the knots, defined as where the constants p k are the control points, which determine the shape of the curve and are generally computed by solving a linear system obtained by imposing the interpolation condition on q k [5], B d (t) is the uniform B-spline basis function of degree d and T is the knot span, that is the distance between knots. While the usual way of computing the function q(t) for a given value of the time is based on the definition (7) and the computation of the basis functions, a novel way to generate spline curves was developed by the authors in [16], where it is proven that a uniform B-spline trajectory of degree d can be obtained by means of the chain M d (s), composed by d dynamic filters defined as fed by the staircase signal p(t) obtained by maintaining the value of each control point p k for the entire period kT ≤ t < (k + 1)T , by means of a zero-order hold H 0 (s) applied to the sequence of impulses p k of period T . The degree d of the spline and therefore the number of filters composing the B-spline generator determines the smoothness of the output trajectory. In fact the resulting spline is a function of class C d−1 . Note that, because of numerical reasons [5], the degree d is generally assumed to be an odd number (d = 3 for cubic B-splines, d = 5 for quintic B-splines, etc.). A fundamental property of the filter for B-spline generation, is the possibility to compute online the profiles of all the time derivatives of the trajectory up to the order d, as shown in Fig. 2. For this reason the implementation of (6) by means of the B-spline generator of Fig. 2 is straightforward provided that the order of the B-spline meets the condition In order to guarantee a good tracking of the B-spline function defined by the control points p k , it is necessary that the frequency spectrum of the trajectory is included in the bandwidth of P (s).
Since, the B-spline is obtained by applying a train of impulses to the cascade of filters  its spectrum can be deduced by considering the frequency response of (9), i.e., The B-spline filter/signal is characterized by a pure delay of (d+1)T 2 seconds, while the magnitude decreases as 1/ω d+1 . By looking at the frequency spectra of cubic and quintic Bsplines that are shown in Fig. 3, it can be seen that spectral components for ω ≥ ω 0 = 2π T can be neglected, in particular for higher values of d. This means that good tracking performances can be achieved if ω > ω 0 , where ω denotes the break frequency of the smallest unstable zero of the CZPETC controlled plant P (s). Finally, it is worth noting that the slope of |B d (jω)| for ω → ∞ is −(d + 1) × 20 db/decade. As a consequence, being d ≥ 2m u (see property 1 in Subsection II-A) the cascade of the trajectory generator and P (s) will have a negative slope for high frequency values and will be always limited in magnitude.

C. Discrete-Time RC
Discrete-time RC is a technique used to achieve output regulation for discrete-time periodic signals of known and fixed period, whose success is based on the internal model principle.
The basic scheme of RC in the discrete-time domain is shown in Fig. 4. It is composed by:

1) a linear time invariant controlled plant P (z);
2) an internal model based controller C(z), that guarantees asymptotically zero tracking error of any discrete-time periodic reference signal of period n, i.e., y r (k + nT ) = y r (k). Here T is the sampling time of the digital system. All the poles of the marginally stable system C(z) are located on the unit circle, and the linear combination of the corresponding modes is able to generate any digital periodic signal of period n. Thus, using internal-model-based arguments, the main issue of this control approach consists in the choice of P (z) that assures the stability of the closed-loop system. Stability condition for the RC scheme can be easily derived by means of a classical Nyquist analysis Once this condition is satisfied, asymptotic perfect tracking for any reference signal of period n is achieved. Notice that, differently from continuous-time RC schemes [4], the scheme in Fig. 4 can be stabilized also if the plant P (z) is not strictly proper. This follows because in the digital framework a periodic reference signal contains a finite number of harmonics, making the internal model based controller C(z) finite-dimensional.

III. B-SPLINE CZPET REPETITIVE CONTROLLER
In order to eliminate the tracking error due to the open-loop structure of CZPETC, the overall system shown in Fig. 2, including a block for the computation of the control points from the desired via-points, has been embedded in the RC scheme, as shown in Fig. 5. The sequence of the desired via-points q k becomes the desired reference signal, that in the general discrete-time RC scheme of Fig. 4 is denoted by y r (k). The  sampling time T of the new scheme equals the knot span of the spline, that is the temporal distance among the via-points.
The proposed RC mechanism operates by changing the actual reference trajectory q m od (t) provided to the plant via a control points modification with the purpose of nullifying the tracking errorq k at the discrete-time instant kT . The switch inserted just before the internal model loop allows the activation/deactivation of the RC mechanism at any time instant. When the switch is OFF, the value of the control points saved in the delay element is kept constant, while when the switch is ON their value is updated on the basis of the tracking error and the RC mechanism starts working. Parameter K p is an adjustable gain. Finally, the filter H(z) = P (z ) Q (z ) = r n =−r h(n) z −n is a FIR filter that approximates the relationship between the via-points q k to be interpolated and the control points p k that should guarantee such an interpolation. This filter is necessary in the control scheme since the RC mechanism acts on the control points defining the the B-spline on the basis of the interpolation error on the viapoints. Details about this filter can be found in [19] and [6] while in the following the properties of the filter that will be used in the stability analysis of the RC scheme are summarized.
1) As shown in Fig. 6, the filter H(z) is characterized by h(n) = h(−n). Accordingly, its frequency response H(e j ω T ) is a positive real function of ω and, in particular, its argument is null for any frequency value. 2) Since H(z) is a noncausal filter, it is delayed by r samples in order to make it feasible. The precision of approximation between via-points and control points is arbitrarily high and depends on the chosen r (note, in Fig. 6, that the magnitude of the impulses h(n) becomes less and less significant as n grows). The following proposition shows asymptotic stability of the RC scheme in Fig. 5 in nominal condition. As consequence, perfect asymptotic tracking for periodic signals composed by the sequence of desired via-points is achieved at the sampling time-instants. Proposition 3.1: Consider the RC scheme in Fig. 5. For any sampling time T , there always exists a value of the gain K p ∈ R + such that the closed-loop system is asymptotically stable.
Proof: The scheme of Fig. 5 is equivalent to the basic discrete-time RC scheme reported in Fig. 4, with P (z) = K p · H(z) · z m · HMRG(z) (11) where HMRG(z) = Z{H 0 (s)M d (s)R CZPETC (s)G(s)} denotes the z-transform of the "extended plant", i.e., the continuous time system composed by B-spline generator H 0 (s)M d (s), CZPET controller R CZPETC (s), and physical plant G(s). Note that the time-anticipation (of m samples) z m , which appears in (11), is only due to analysis purposes and is not present in the original scheme of Fig. 5. In order to prove the stability of the overall control scheme it suffices to show that P (z) complies with (10) for some K p . Since the B-spline trajectory generator causes a pure delay of m = d+1 2 sample periods T (see Section II-B), while the phase contribution of R CZPETC (jω)G(jω) is null (property 2 reported in Section II-A), it follows that: The corresponding discrete-time system HMRG(z) is characterized by the same pure delay and consequently can be written as  where L(z) is a zero-phase filter. 1 By substituting (12) in (11) the expression is obtained. Therefore, by considering the property 1 of H(z), it descends that also P (z) is a zero-phase filter, i.e., ∠P (e j ω T ) = 0 ∀ω, see Fig. 8(a). Consequently, the stability condition (10) becomes Since 0 < |H(e j ω T )| ≤ γ H < ∞ and 0 < |L(e j ω T )| ≤ γ L < ∞ ∀ω ∈ [0, π/T ], the value of K p = 1 γ H ·γ L makes condition (13) true.
Remark 3.1: If the plant is minimum phase, and therefore its dynamics is fully cancelled by the CZPET controller, i.e., z −m L(z) = Z{H 0 (s)M d (s)}, it follows that H(e j ω T ) · L(e j ω T ) = 1 in the overall frequency range, see Fig. 8(b). Even in case of nonminimum phase plants, when ω > ω 0 and accordingly R CZPETC (s)G(s) ≈ 1, H(e j ω T ) · L(e j ω T ) ≈ 1 ∀ω ∈ [0, π/T ]. In these cases, the value K p = 1 represents the best tradeoff between robustness of the control scheme with respect to gain errors and convergency rate. As a matter of fact, ifq k,j denotes the tracking error with respect to the generic kth via-point at the jth cycle, with simple algebraic manipulation, the expressioñ relating the (z-transforms of the) errors between two successive iterations can be found. Therefore, ideally the condition K p H(z) L(z) = 1 assures that the (initial) error becomes null in one cycle. The stability analysis performed in Proposition 3.1, is based on the assumption of perfect matching between plant system and model used for the design of the CZPETC. In fact, this feedforward action plays a central role in the demonstration, since it nullify the phase shift caused by the plant. Note that the stability condition (10) can be true only if Accordingly, phase shifts are particularly critical for the feasibility of the proposed approach. If in the nominal case, the CZPETC guarantees ∠P (e j ω T ) = 0 ∀ω ≤ π T , model uncertainties may cause a violation of condition (15). While gain errors can be easily compensated by acting on (reducing) the gain K p , phase shifts can be reduced only by deducing a precise model of the plant without the possibility of further compensations, except a possible variation on T that does not act directly on the argument of P (e j ω T ) but modifies the range of frequencies in which (15) must be true.
It is worth noting that, because of the matching between the knot span of the B-spline trajectory and the sampling period of the RC scheme, the parameter T assumes quite large values, at least in comparison with the typical sampling period of discrete-time systems. Accordingly, the frequency range for which condition (10) must be valid is very narrow while unmodeled dynamics that may affect the plant P (z) are generally located at high frequencies and have therefore only a little influence in this range. In conclusion, because of the limited sampling rate, the stability of the RC scheme is expected to be inherently robust with respect to uncertainty of the system, without the need of special solutions, such as the insertion in the internal model loop of a low-pass q-filter [4].

IV. EXPERIMENTAL EVALUATION
One of the goals of this paper is to answer to a simple but fundamental question arising when a new control algorithm is proposed, i.e., "What modeling information is needed to design and tune the controller?" [20]. For this reason, an extensive experimental activity, based on a nonminimum phase system, has been performed.

A. System Description and Modeling
As shown in Fig. 9, the experimental setup is basically a two-dof robotic manipulator with elastic joints built with QBMove -Maker Pro Variable Stiffness Actuators (VSA) by QBRobotics [21]. These actuators implement the concept of variable stiffness servo-motors, i.e., motor units that allow the user to command both the position and the stiffness of the output shaft with external signals [22]. QBMove VSAs are provided with a convenient MATLAB/Simulink toolbox that can run without particular restrictions even on standard operating system and communicates with the actuators via USB. In the experiments reported in this section MATLAB was running with a fixed step size T s = 2 ms. Therefore, since the actuators are digitally controlled, the conceptual scheme of RC based on the continuous-time subsystem composed by trajectory generator, feed-forward action and plant, which is shown in Fig. 5, becomes a dual rate system in which the discrete-time part with sampling time T remains unaltered, while the "extended" plant is composed by the discretized versions of the B-spline trajectory generator and CZPETC in addition to the physical setup based on QBMove actuators. In Fig. 10 the dual-rate RC scheme is shown. As already mentioned, M d (z s ) denotes the discretetime B-spline filter, whose expression is explained in detail in [6], and R CZPETC (z s ) is the discrete-time approximation of the CZPETC in (4). Being the feed-forward control produced by the CZPETC a linear combination of reference trajectory derivatives plus the output of the causal filter W (s) [see (5)], it can be approximated in the discrete-time domain as where q i = q(i T s ) is the sequence of the samples of the Bspline trajectory (obtained with period T s ) whose z-transform is Q(z s ), q (j ) i is the sequence of the jth time derivative of q i , and W (z s ) denotes a filter obtained by discretization from W (s), e.g., with the Tustin method. Note that all the transfer functions of the elements composing this subsystem, which is called fast discrete-time subsystem, depend on the variable z s , which is related to the sampling time T s , while the remaining components of the RC scheme are functions of z related to time period T , with T T s . As usually assumed, e.g., in the robotic field, where the controllers are designed in the continuous-time domain but implemented with digital controllers [23], it is supposed that the sampling time T s is so small (compared with the other time-constants of the systems) that the discretized control behaves like the continuous one. Indeed, the fast discrete-time subsystem in place of the continuous-time subsystem introduces nonidealities that can be assimilated to modeling errors in the design of the CZPETC. In particular, since the stability of the RC is strictly related to the phase shift of the plant P (z) which cannot exceed ±π/2 as shown in (15), the most critical issue related to the digital implementation of trajectory generator and CZPETC is the presence of the zero-order hold (ZOH) that causes a delay equal to T s /2. For this reason, it is necessary that T s T , in order to limit the phase shift caused by the ZOH in the frequency range to be considered for the stability of the RC, i.e., [0, π/T ].
The design of the CZPETC, which is the most critical component of the overall control scheme, descends from the model of the plant. The system of Fig. 9 can be modeled as a standard manipulator with elastic joints commanded in position, i.e., and C(θ,θ) are the inertia and centrifugal/Coriolis forces matrices, g(θ) represents the gravity term, K = diag{k i }, B = diag{b i }, i = 1, 2 are the matrices of the transmission stiffness and viscous friction, θ and θ m denote the vectors of the joint positions at the link side and at the motor side, respectively [24]. Because of the planar structure of the device, which is disposed in the horizontal plane, g(θ) = 0. Moreover, it is imposed that the second joint behaves passively, by assuming that θ m ,2 ≡ 0. In this manner, the system emulates the dynamics of a planar flexible link in which the driven torque is τ = k 1 (θ 1 − θ m ,1 ), see Fig. 11(a). As a matter of fact,  the simplest lumped-parameters model of a flexible link, that takes into account only the first elastic mode, is the two-link system with an elastic hinge shown in Fig. 11(b). By assuming the tip angular position seen from the base as output variable, i.e., y = θ 1 + θ 2 2 , it has been proved in [25] that the model of this system is nonminimum phase, characterized by order four and relative degree two. Therefore, by considering an additional pole which takes into account the dynamics of the actuator at the base joint, it is reasonable to assume that the linearized system has a structure characterized by five poles and two zeros. The system, identified with the help of the MATLAB identification toolbox, is The step responses of the actual system and of the identified model, which are compared in Fig. 12(a), reveal the nonminimum phase nature of the plant that causes the initial undershoot of the response. In order to investigate the role played by the system model in the controller design, models with a different structure in terms of number of poles/zeros have been considered. In particular, reduced order transfer functions with three poles and two zeros and two poles and one zero, respectively have been taken into account G 3p2z (s) = −17.6(s − 6.9)(s + 2.5) (s + 16.75)(s 2 + 1.68s + 17.8) G 2p1z (s) = 12.1(s + 3.1) (s 2 + 1.81s + 37. 6) .
Notice that only models G 5p2z (s) and G 3p2z (s) capture the nonminimum phase nature of the plant, while G 2p1z (s) does not. In Fig. 12(b) the bode plot of the three transfer functions are shown.

B. Experimental Results
Four sets of experiments have been performed in which the control scheme without CZPETC (R CZPETC (s) = 1), that basically coincides with the approach proposed in [6], is compared with the RC with the CZPETC obtained on the basis of the the three above-mentioned transfer functions. The reference trajectory is obtained by interpolating with a cyclic uniform B-spline 10 via-points ranging from 0 to 60º. In each test, four cycles without RC are initially performed (in the plots they are highlighted with a grey background) and then the RC scheme is activated. Since R CZPETC (s) is designed on the basis of the plant model, the only free parameters of the scheme remain the gain K p and the knot span T , which determines the duration of the cyclic trajectory. In the experiments, it is initially assumed K p = 1, being the value that guarantees the minimum duration of the transient, while the knot span/sampling time T has been progressively reduced.
The scheme without CZPETC shows a stable behaviour for slow reference trajectories, e.g., with T = 1 s, because the dynamics of the plant in the range of frequencies involved in this case (0 ≤ ω ≤ π/T ) is de facto negligible, but, as soon as the reference trajectory becomes faster (T = 0.5 s), the overall system becomes unstable, being condition (10) is no more satisfied. In Fig. 13(a) and (b) the tracking errorq k = q − y(kT ) in the two cases is shown.
The introduction in the scheme of the CZPETC greatly enhances its performances in terms of maximum velocity of the reference trajectory to be tracked. This is demonstrated by the results reported in Fig. 14, which shows the tracking errors obtained with the CZPETC-RC designed on the basis of G 5p2z (s) and G 3p2z (s) for different values of T . In both cases, it is possible to reduce T down to 0.3 s, while preserving stability of the overall scheme. Note that the performances of the two schemes based on G 5p2z (s) and G 3p2z (s) respectively are very similar, with the transient of the former that in case T = 0.3 s is slightly shorter. This is due to the fact that the high frequency poles that have been neglected by reducing the order of the model have only a little influence on the system dynamics. Both schemes becomes unstable when it is assumed T = 0.2 s. In this case, by considering the model G 5p2z (s) it is possible to recover the  stability of the system by reducing the gain K p , while by taking into account G 3p2z (s) for small values of K p , e.g. K p = 0.1, the error remains limited but does not converge to zero, see Fig. 15.
Although nonminimum phase, also the use of model G 2p1z (s) for the CZPETC design improves the performance of the RC scheme with respect to the control without CZPETC. In this case the overall control algorithm remains stable for T = 0.5 s, but becomes unstable when T = 0.4 s is selected. Table I summarizes the experimental process qualitatively, where the single experiment is labeled with "S" in case of stability and consequent convergence of the interpolation error, and with "U" in case of unstable behavior. The conclusion is straightforward: even a simple feedforward compensation, that requires a modest increase of the control scheme complexity, 2 improves the performance of the RC in terms of stability, by enlarging the bandwidth of the controlled plant. Finally, by observing the tracking error during a single trajectory cycle before and after   the activation of the RC mechanism, see Figs. 16 and 17, it is evident that the proposed approach, that from a theoretical point of view guarantees perfect tracking only at the via-points, actually promotes an effective reduction of the error along the entire trajectory, that is during also the intersample periods. By comparing Figs. 16(b) and 17(b), it can be observed that the design of the CZPETC based on a more accurate model slightly improves the overall tracking capabilities of the controlled plant while, if the RC is stable, the error at the via points goes to zero in any case.

C. Guidelines for Parameters Selection
On the basis of the experimental results described in this section, a straightforward procedure for the selection of the parameters can be derived in order to assure a proper operation of the proposed scheme. For a given knot span T , that together with the set of via-points is generally assigned by the desired trajectory, and a given plant model, the following steps must be performed.
1) By assuming the value K p = 1, that minimizes the duration of the transient, verify the stability of the scheme. 2) If the scheme is unstable, progressively reduce the value of K p until a stability condition reached. 3) If the scheme remain unstable (the instability is caused by the excessive phase shift), make the plant model more accurate, e.g., by increasing the model order, or increase the duration T . Repeat from step #1, until the stability is achieved.

V. CONCLUSION
In this paper, a novel control scheme which is able to obtain perfect asymptotic tracking of a set of desired via-points (used for generating an interpolation B-spline trajectory) by a nonminimum phase system was presented. The proposed approach, based on dynamic filters for B-spline trajectories generation together with a feedforward technique, named CZPETC, and the RC scheme, combined the performance of feedforward control in nominal conditions with the robustness of internal model control.
The validity of the overall control scheme was first proved analytically and then evaluated experimentally by applying the proposed approach to a nonminimum phase plant, represented by a two-link robotic system with a passive elastic joint. The experimental tests led to the conclusion that even a rough model of the plant, used to design the CZPETC, contributed to increase the robustness of the control scheme and allowed to reduce the time duration of the reference trajectory that can be tracked (via a reduction of the knot span T ). Obviously, the more accurate the model was, the more robust and efficient the overall control scheme became. In principle, if the plant was perfectly known, the scheme was stable for any value of T . Moreover, even if, from a theoretical point of view, the repetitive controller guaranteed a perfect tracking only at the given via-points, the experiments proved that the error during the entire trajectory was considerably reduced, especially when an accurate model of the plant is used. Finally, it is worth highlighting that, besides the model of the plant, the proposed approach did not require any tuning operation since the unique free parameters of the control scheme are the sampling time T , that depended on the specific application being related to the duration of the trajectory, and the gain K p which was usually unitary and was reduced only if the system was initially unstable. For this reason the proposed control architecture was particularly attractive in those industrial application where B-spline functions were adopted as reference trajectories.