Damped Harmonic Smoother for Trajectory Planning and Vibration Suppression

In this brief, a novel filter for online trajectory generation is presented. The filter can be categorized as an input smoother since it acts on the input signal by increasing its continuity level. When fed with simple signals, as, e.g., a step input, it behaves like a trajectory generator that produces harmonic motions. Moreover, it can be combined with other filters, and in particular, with smoothers having a rectangular impulse response, in order to generate (online) more complex trajectories compliant with several kinematic constraints. On the other hand, being a filter, it possesses the capability of shaping the frequency spectrum of the output signal. This possibility can be profitably exploited to suppress residual vibration by imposing that the zeros of the filter cancel the oscillatory dynamics of the plant. For this purpose, the standard harmonic filter has been generalized in order to consider not only the natural frequency but also the damping coefficient of the plant. In this manner, the so-called “damped harmonic filter” and the related “damped harmonic trajectory” have been defined. By means of theoretical considerations, supported by experimental tests, the novel approach has been compared with the existing methods, and the advantages of its use have been proved.

trajectories with constraints on the first n derivatives are equivalent to the outputs of a chain of n moving average filters, also known as rectangular smoothers (see Section II for a brief overview). On the other hand, in many contributions, mainly focused on a trajectory design via analytic expression optimization, the adoption of trigonometric functions is proposed with the purpose of planning motions with smoother acceleration or jerk profiles that reduce residual vibrations when applied to resonant systems (see [9]). In particular, in [10], polynomial multisegment trajectories (with constant jerk) and multisegment trajectories with square sine jerk have been experimentally compared in this respect, showing that the sine-based trajectories outperform the standard constantjerk trajectories at the price of a noticeable increase of the motion duration.
The use of trigonometric functions has also been investigated in the input shaping framework, where filters similarbut not identical-to the one studied in this brief have been presented formerly (see [11]- [14]). However, these works only focus on the problem of residual vibration suppression, while a thorough analysis of the motion profiles obtained when used alone or with other filters has not been performed.
In this brief, we start from the results presented in the conference papers [15], [16], concerning the generation of trajectories by means of dynamic filters with trigonometric (and in particular sinusoidal) velocity, acceleration, or jerk profiles. These results are summarized in Sections II and III. Then, in Section IV, it has been shown that the main advantages of sinusoidal filters consist in the reduction of residual vibrations, since kinematic constraints can be more profitably satisfied with the use of rectangular smoothers. For this reason, a deep analysis of the performance achievable in vibrations suppression with this type of filter has been carried out, along with a comparison with some well-settled techniques available in the literature that involve the same motion duration. In this manner, the pros and cons of the use of sinusoidal motion profiles have been definitely proved. And, more importantly, in order to improve its performance, the harmonic smoother has been generalized, considering not only the natural frequency of the resonant plant but also its damping ratio. In this way, in Section V, the "damped harmonic smoother" and the novel "damped harmonic trajectory" have been defined. Finally, in Section VI, the experimental tests performed with the proposed filter are reported, and the achieved results have been summarized in Section VII.

II. MULTISEGMENT TRAJECTORIES AND SMOOTHERS
In [8], it has been shown that a multisegment trajectory q n (t) of order n, i.e., a trajectory with the first n derivatives bounded (and, in particular, compliant with the symmetric constraints q . . , n), can be obtained by filtering a step input with a cascade of n dynamic filters (see Fig. 1), each one characterized by the transfer function where the parameter T i (in general, different for each filter) is a time length. As described in [8], the resulting trajectory q n (t) is composed of several polynomial segments q n,k (t) defined as a linear combination of the basis functions t i , i = 0, . . . , n, i.e., the kth segment is defined as q n,k (t) = n i=0 a i,k t i . The smoothness of the trajectory, that is the number of continuous derivatives, is strictly tied to the number of filters composing the chain. If n filters are considered, the resulting trajectory will be of class C n−1 . For this reason, the filters (1) are also called smoothers since they increase the smoothness of the input signal, while the name "rectangular," used to denotes M i (s), refers to the shape of their impulse response.
The generic j th derivative q ( j ) n (t) of the output trajectory is composed of polynomial functions, which are the linear combination of t i , i = 0, . . . , n − j , and accordingly, the nth derivative q (n) n (t) is composed of constant tracts. For instance, the classical constant-jerk trajectory is obtained with three smoothers M i (s). Note that by increasing the smoothness of the trajectory adding extra filters in the chain, its duration augments as well. As a matter of fact, the total duration of a trajectory generated in this manner is simply given by the sum of the lengths of the impulse response of each filter, i.e., T tot = T 1 + T 2 + · · · + T n . With the purpose of imposing desired bounds on velocity, acceleration, jerk, and higher derivatives, given a desired displacement h, the parameters T i are set as with the constraints Inequalities (3) are necessary and sufficient conditions for assuring the time optimality of the output trajectory and the compliance with the bounds q (i) max , i = 1, . . . , n. For more details, refer to [8].
Alternatively, the parameter T i of each filter of the chain can be determined with the purpose of properly shaping its frequency response. As a matter of fact, the magnitude of the frequency response of a generic filter M i ( j ω) is where sinc(·) denotes the normalized sinc function defined as sinc(x) = (sin(π x)/π x) and ω i = (2π/T i ). Note that function |M i ( j ω)| has a low-pass characteristic and is equal to zero for ω = k ω i .

III. SINUSOIDAL SMOOTHERS FOR THE GENERATION OF MULTISEGMENT TRAJECTORIES
The step response of the trajectory generator obtained by inserting, in the chain of n rectangular smoothers of Fig. 1, m filters characterized by the impulse response is a multisegment trajectory, in which each tract is linear combinations of the basis functions t i , i = 0, . . . , n and sin((π/T j )t + ϕ j ), j = 1, . . . , m, where ϕ j are proper constants and it is supposed that all the parameters T j are distinct. The transfer function of the filters can be readily obtained by Laplace transforming (4) Since the impulse response of S i (s) is described by a sine function, the filter is called sinusoidal smoother. Each sinusoidal smoother increases of two the continuity level of the output signal with respect to the input, and therefore, a generic trajectory generator based on n filters M i (s) and m filters S i (s) produces trajectories that are at least of class C n+2m−1 . For instance, if a step input of amplitude h is applied to a trajectory generator composed of a single sinusoidal smoother, the standard harmonic trajectory is obtained where q 0 is the initial position and T 1 is the duration of the trajectory. For this reason, S i (s) is also called "harmonic filter." The harmonic trajectory q h (t) is of class C 1 , being the step is a discontinuous function, i.e., of class C −1 . More, in general, it is possible to obtain trajectories characterized by velocity, acceleration, jerk, or higher derivatives, depending on the order of the trajectory, composed only of sinusoidal functions by adding the sinusoidal filter S 1 (s) at the end of a chain of n filters M i (s). For instance, the profile q 1,h (t) obtained with one rectangular filter and one sinusoidal filter is the modified trapezoidal velocity of class C 2 , while q 2,h (t) generated by means of the cascade of two rectangular filters and one sinusoidal filter is the modified double-S velocity of class C 3 (see Fig. 2). Also, in this case, the time optimality of the trajectory subject to kinematic constraints is guaranteed only if the time constants T i of all the filters, including the harmonic smoother, satisfy the condition (3).
Note that the analytical expressions of composite trajectories q n,h (t) tend to become very complex and may be intractable even for small values of n, e.g., for q 2,h (t), which is characterized by seven different tracts. In these cases, the filters, which are suitable for the online computation of the trajectory, are also preferable for off-line generation.
Considering that the filter S 1 (s) increases the continuity level of the trajectory q n (t) by two, the time constant T n+1 can be computed by taking into account the constraints on the (n + 1)th and (n + 2)th derivatives of the trajectory by assuming Remark: The additional duration T n+1 caused by the sinusoidal filter, computed according to (6), is certainly higher than the duration of a cascade of two rectangular filters designed according the same constraints, i.e., For this reason, when a task imposes only kinematic constraints, the use of rectangular filters M i (s) only is preferable, while sinusoidal smoothers can be helpful to fulfill different requirements, such as the suppression of residual vibrations.

IV. VIBRATIONS SUPPRESSION WITH SINUSOIDAL FILTERS
In order to evaluate the capabilities of the sinusoidal filter in canceling residual vibrations, the motion system of Fig. 3, already considered in [8], has been assumed as a benchmark. It is composed of two inertias with a lightly damped elastic transmission. An ideal control system is supposed to impose the desired motion profile to the (rotor) inertia J m , that is q m (t) = q ref (t), being q ref (t) the reference trajectory obtained with the proposed filter. In this case, the dynamic relation between the reference trajectory q ref (t) and the tracking error where Note that the tracking error ε(t) at the end of the reference trajectory coincides with the definition of residual vibration [17]. It is possible to prove that when the plant is fully undamped, i.e., δ = 0, the residual vibration is completely suppressed by a sinusoidal smoother S i (s), inserted in the chain of filters for reference generation, if whereω n denotes the nominal value of the natural frequency of the plant andT 0 is the (nominal value of the) period of the free oscillation. Since the magnitude of frequency response of the sinusoidal smoother is (8) assures that |S i ( jω n )| = 0 and, accordingly, the oscillating component at the resonant frequency ω r =ω n is completely canceled. It is worth noting that the function |S i ( j ω n )| represents the sensitivity of the filter in residual vibration suppression to the variation of ω n with respect to its nominal value. Usually, this function is expressed as a percentage-called for this reason percent residual vibration (PRV)-to quantify the robustness of the filter [18]. In Fig. 4(a), the PRVs of the sinusoidal smoother S i (s) and of rectangular smoother M i (s) are compared. It is evident that the sinusoidal filter (black line) outperforms the rectangular filter (red line) since the PRV is considerably smaller over the entire range of frequencies. On the other hand, it is worth noting that the value of T i , which determines the time length of the impulse response of the smoothers, is rather different in the two cases, being T 1 =T 0 for the rectangular filter and T 1 = 1.5T 0 for the sinusoidal one (+50%). To perform a fair analysis, the harmonic filter S 1 (s) is therefore compared with a chain of two rectangular smoothers M 1 (s)M 2 (s) (blue line), with T 1 =T 0 and T 2 = 0.5T 0 , in order to match the time durations of the impulse response. Also, in this case, the sinusoidal filter S 1 (s) is more robust than the chain M 1 (s)M 2 (s) with respect to resonance frequency variations since its PRV profile is smaller over the entire range of  ω n and especially for high frequencies. Therefore, while for the compliance with kinematic constraints, two rectangular filters are preferable, for vibrations suppression, the harmonic smoother is the best option in terms of robustness. By observing the trajectory profiles obtained by applying a simple step input to the two kinds of filters, as shown in Fig. 4(b), it results that both output trajectories have continuous velocity and limited acceleration, but their maximum values are slightly higher in the case of the harmonic motion.
Going forward, taking into account input shapers [12], the sinusoidal smoother is compared with different feedforward techniques for vibration suppression that are characterized by the same time duration, namely the combination of a rectangular filter with T 1 =T 0 and a zero vibration input shaper Z V (s) [19] with time constant T zv = 0.5T 0 and a third-order input shaper Z V 3 (s) with T zv = 0.5T 0 , also known as zero vibration double derivative (or ZVDD) input shaper [19]. As shown in Fig. 5(b), the PRV profiles of the filters that include an input shaper are considerably lower than the PRV obtained with the sinusoidal smoother, at least in the neighborhood ofω n . However, the filter S 1 (s) possesses two features that can make it preferable in many applications as follows. 1) The PRV of the sinusoidal smoother has a low-pass characteristic, and as a consequence, the effects of additional resonant modes that may affect the plant at higher frequencies are better mitigated. 2) As already mentioned, when fed with a step signal, the trajectory produced by S 1 (s) is of class C 1 (with limited acceleration), while the output of the combination M 1 (s) + Z V (s) is a signal of class C 0 , and the response of Z V 3 (s) remains of class C −1 and therefore discontinuous [see Fig. 5(b)].

V. DAMPED SINUSOIDAL FILTER
If damping δ of the oscillating plant is not negligible, the filter S i (s) is unable to suppress the residual vibration even in the nominal conditions. In fact, when a step input filtered by S 1 (s) is applied to the system in Fig. 3, the tracking error between the load position and the motor position can be computed as By inverse Laplace transforming E(s) and assuming t ≥ T 1 , the analytic expression of residual vibrations descends where A is a constant depending on T 1 , ω n , and δ and = ω n √ 1 − δ 2 . From the analytical expression of ε(t), it is clear that, even if it is assumed T 1 = 3(π/) because of the presence of e δω n T 1 , the two terms cos(t) + e δω n T 1 cos((t − T 1 ) and sin(t) + e δω n T 1 sin((t − T 1 )) are not null if δ = 0, and therefore, the residual vibration is reduced but not suppressed. In Fig. 6, the residual vibrations produced by resonant systems with δ = 0 and δ = 0.1, respectively, tracking a properly tuned harmonic trajectory q h (t), are compared in order to highlight this behavior. The impossibility of canceling residual vibration with a sinusoidal filter if applied to a damped system has a straightforward explanation by analyzing the function S 1 (s)G ε (s) in the S-plane. As a matter of fact, the filter S 1 (s) introduces an infinite number of zeros z k = ± j (2k + 1)(π/T 1 ) located along the imaginary axis. The first pair of zeros is canceled by the poles of the filter itself p = ± j (π/T 1 ), while the remaining ones can be used to cancel the oscillating poles of the plant in order to suppress the vibrations. As shown in Fig. 7(a), if δ = 0, a perfect cancelation occurs since also the poles of the plant lie on the imaginary axis. Conversely, if δ = 0, this cancelation does not take place [see Fig. 7(b)], and the zeroing effect, which is responsible for the vibration reduction, decreases as the oscillating mode moves away from the imaginary axis, that is as δ grows. In order to obtain a perfect cancelation even for damped plants, a possible solution consists of translating zeros (and poles) of S 1 (s) along a line parallel to the imaginary axis whose abscissa is equal to the real part of the poles of G ε (s). The procedure used in [20] for rectangular filters, based on a frequency shift of the real quantity σ i and on a modification of the gain in order to assure unitary static gain, has been followed, and the transfer function of the new smoother has been derived: By defining a perfect cancelation of the damped poles of the plant is achieved by the zeros of S σ,i (s) [see Fig. 8(a)]. As a consequence, the application to the system of a trajectory, generated by feeding the filter with a step input, does not cause residual vibrations, as highlighted in Fig. 8(b). From an analytical point of view, the expression of residual vibrations considering a damped sinusoidal smoother S σ,1 (s) filtering a step input becomes ε(t) = Ae −δω n t [B(cos(t) + e (σ 1 +δω n )T 1 cos((t − T 1 ))) + C(sin(t) + e (σ 1 +δω n )T 1 sin((t − T 1 )))] (12) where = ω n √ 1 − δ 2 , and A, B, and C are the constant parameters that depend on σ 1 , T 1 , δ, and ω n . Therefore, the necessary and sufficient condition that guarantees ε(t) = 0, ∀t ≥ T 1 , is (13) Note that the condition (11) is a particular case of (13), leading to the minimum duration of the trajectory. By inverse Laplace transforming S σ,i (s), its impulse response is obtained, i.e., Since s σ,i (t) is given by the product of a sine function and an exponential function with σ i < 0 (the plant is supposed to be asymptotically stable), S σ,i (s) is called the damped sinusoidal filter. When fed with a step input, it provides a damped harmonic trajectory, which generalizes the standard harmonic motion and whose analytical expression is where q 0 is the initial position, h is the desired displacement, T 1 is the duration of the trajectory, and σ 1 is the decay rate coefficient. Note that the impulse response of the filter s σ,i (t) coincides with the velocity of the damped harmonic trajectory. In Fig. 9, the shape of s σ,i (t) for different values of σ i is shown, and it is possible to appreciate that s σ,i (t) becomes more and more asymmetric, as the magnitude of σ i grows and its peak value tends to increase as well. This means that, for a given value of T i , the velocity of the damped harmonic motion, i.e., the first derivative of the filter step response, grows with |σ i |.

A. Parameter Identification and Sensitivity to Errors
The filter parameters σ i and T i can be readily determined by applying (13) once the nominal values of the damping coefficientδ and of natural frequencyω n of the resonant plant are known. Alternatively, as for the other smoothing filters or input shapers, it is possible to experimentally estimate their values. As a matter of fact, condition (13) that assures  residual vibration suppression for the second-order system with poles p 1,2 =σ ± j = −δω n ± jω n 1 −δ 2 can be rewritten as As a consequence, the two parameters can be obtained by analyzing the vibrations induced on the plant by a generic input signal or nonnull initial conditions, vibrations characterized by a periodT 0 = (2π/) and an exponential decay rateσ . With reference to Fig. 10, their numerical values are where the parameters t 1 , t 2 , p 1 , and p 2 are defined. For more details, see [20]. As for the undamped sinusoidal filter, the choice of the parameters of S σ,i (s) is critical to the level of residual vibration, but in this case, there are two independent variables. For this reason, the 3-D surface describing the PRV as a function of δ and ω n has been computed. In particular, since the PRV of S σ,i (s) depends on the nominal value of the plant damping coefficientδ, two different values have been considered in order to analyze the performance of the filter for small (δ = 0.05) and large (δ = 0.5) damping values. Conversely, the nominal value of the natural frequency does not affect the PRV, and therefore, a generic valueω n has been assumed. In Fig. 11, the two surfaces are shown. For small values ofδ, see Fig. 11(a), the PRV of the filter strongly depends on the correct estimation of ω n , while it is practically not sensitive to errors on δ. On the other hand, for large values ofδ, both parameters may be critical, and it seems that for ω n ω n and δ δ , the presence of the filter S σ,i (s) increases the level of vibrations. However, it is worth noting that in this case, the apparent high level of residual vibrations is due to the definition of PRV as the ratio between the maximum amplitude of vibrations with and without a filter. Since the vibrations for large values ofδ are very small, the denominator of the function for the computation of PRV is small as well and may lead to large values even if the numerator is limited. These considerations are very clear if the absolute value of the residual vibration (with a unit step input) is considered in place of the percentage, as in Fig. 12. Ifδ is small, the contribution of the filter is very important, and accordingly, the estimation of the parameters is a critical issue, while for larger values of δ, the role played by S σ,i (s) is less significant since, in any case, the level of the vibration is very limited [see Fig. 12(b)].
Similar to the undamped case, the results obtained with the filter S σ,i (s), in terms of PRV, are compared with those produced by a chain of two exponential filters M σ,1 (s)M σ,2 (s), which represent the generalization of the rectangular smoothers M 1 (s)M 2 (s) to consider the damping coefficient of the plant [20] (see Fig. 13). The (damped) sinusoidal smoother continues to outperform the chain of "rectangular" filters since the PRV value is smaller.
Finally, since the two characteristic parameters of S σ,i (s) are often directly obtained, it is worth considering the sensitivity of the filter with respect to errors on T i and σ i , as in Fig. 14. In this case, even considering two different values ofδ, the conclusion is quite straightforward: errors on σ i have a   little influence on the PRV, while the estimation of T i is very critical for an effective vibration reduction.

VI. COMPARATIVE EXPERIMENTAL EVALUATION
OF THE DAMPED SINUSOIDAL FILTER In order to experimentally test the proposed method, the setup shown in Fig. 15 has been arranged. It is composed of a linear motor, LinMot PS01-37x120, whose slider is connected to an inertial load by means an elastic transmission obtained with a coil spring. The setup can be modeled as an ideal two-mass system with the elastic transmission, characterized by the second-order oscillatory dynamics as the one reported in Fig. 3. The control system is based on the servo controller LinMot E2010-VF that performs the basic current control, while the position control (based on a proportional-integral-differential controller and a feedforward action) has been implemented on a standard PC with a Pentium IV 3-GHz processor equipped with a Sensoray 626 I/O board, used to both communicate with the servo controller and acquire the sensors signals. The real-time operating system RTAI-Linux allows the position controller to run with a sampling period T s = 500 μs. Obviously, a digital implementation of all the filters tested in the experiments has been used. For the damped harmonic smoother, the expression of the discretetime transfer function, obtained by Z-transforming (10) and imposing a unitary static gain, is where In order to evaluate the residual vibrations ε, a load cell is placed between the slider and the elastic transmission. As a matter of fact, the force f k exerted by the spring is related to the error between the motor and the load position, and if the inherent damping of the transmission is considered, the force f k is simply a scaled low-pass filtered version of ε.
The parameters of the plant have been identified according to the procedure reported in Section V-A, by applying to the motor the trapezoidal velocity trajectory of Fig. 16 and analyzing the response of the system, in terms of force f k (t) transmitted via the coil spring. The poles, p 1,2 =σ ± j, of the second-order system are characterized bŷ σ = −15.6539 1/s and = 122.7185 rad/s and, consequently,T 0 = (2π/) = 0.0512 s. The values ofσ andT 0 have been used for designing the damped sinusoidal smoother and the other filtering methods mentioned in Section IV in order to make a comparative analysis. The reference trajectories obtained by filtering a step input of amplitude 30 mm and the corresponding profiles of the force f k (t) induced on the plant are reported in Fig. 17. By observing the column on the right, that shows the vibration at the end of the motion, the experimental results confirm the theoretical analysis discussed in Sections IV and V. First of all, the comparison of Fig. 17(e) and (d) highlights that the damped sinusoidal filter S σ,1 (s) outperforms the standard sinusoidal filter S 1 (s) in terms of residual vibration level and produces a response that is very similar to the cascade of two exponential smoothers M σ,1 (s)M σ,2 (s) shown in Fig. 17(a). The peak values of the residual vibration, measured via the transmission force, are 3.634 and 4.718 N for S σ,1 (s) and S 1 (s), respectively, while f MAX k = 3.701 N for M σ,1 (s)M σ,2 (s). The use of input shapers may enhance the vibration reduction but only if they are used in conjunction with the smoothers filters. In fact, despite the fact that, according to the sensitivity function reported in Fig. 5, the ZVDD input shapers are accounted for as the most robust filtering method with respect to errors in the parameters estimation, it produces a very high level of oscillations ( f MAX k = 4.092 N) and, in particular, greater than the level obtained by sinusoidal filters. This result can be ascribed to the large tracking error of the linear motor that is very fast but cannot follow discontinuous steps [see Fig. 17(c) (left)]. On the contrary, the combination M σ,1 (s)Z V (s) generates a level of the residual vibration smaller than the one produced by the other filtering methods involving the same time delay. Therefore, if the goal of the filter only consists of the residual vibration suppression, the combination M σ,1 (s)Z V (s) is the optimal choice. However, if other features of the resulting motion trajectories, such as smoothness level, velocity/acceleration peak values, and tracking error, are considered, different filters should be preferred. In Fig. 18, it is shown that the filter M σ,1 (s)Z V (s) fed with a step input produces a motion profile characterized by discontinuous velocity and, consequently, infinite acceleration. Correspondingly, the tracking errorq(t) = q ref (t) − q m (t) between the desired and actual motion profiles of the motor has the largest value (q MAX = 7.8581 mm) among all the tested trajectory filters (in this case, the ZVDD input shaper is not considered because it is not a trajectory filter). On the contrary, the trajectory of class C 1 produced by the (undamped) sinusoidal smoother S 1 (s) exhibits the smallest velocity and acceleration values and the smallest tracking error (q MAX = 4.5664 mm). The damped harmonic smoother S σ,1 (s) and the cascade of two exponential smoothers M σ,1 (s)M σ,2 (s) lead to similar performances, with a slight superiority of S σ,1 (s), which is characterized by a lower velocity and a smaller tracking error (q MAX = 6.0902 mm).

VII. CONCLUSION
The aim of this brief is to prove advantages and disadvantages of trajectories based on the trigonometric functions, starting from the initial consideration that this kind of motion profiles can be obtained by a cascade of smoothers with the rectangular and sinusoidal impulse response. After having remarked that in those applications that involve only kinematic constraints, the use of harmonic smoothers is useless, since, for given bounds, a cascade of two rectangular smoothers leads to trajectories with the same continuity level but lower duration, it has been shown, with both theoretical considerations and experimental tests, that harmonic smoothers are preferable for vibration suppression. In this respect, the generalization of the harmonic smoother to consider not only the natural frequency but also the damping coefficient of the vibrating plant appears a significant improvement. The damped harmonic smoother further enhances the capability of the harmonic smoother of reducing the residual vibration without a significant increase of the complexity.