1 Introduction

Sharp input commands inevitably lead to undesirable oscillations in the response of flexible systems. These oscillations arise in numerous applications, such as in positioning of industrial cranes, movement of microelectromechanical systems (MEMS), and operation of hybrid electric vehicles (HEVs) [1,2,3,4,5,6,7]. Various methods have been proposed for mitigating such oscillations, including feedback control, digital filtering, and command shaping. Feedback control is a common starting point when developing any controller due to its established design procedures and broad applicability. However, feedback control requires accurate, delay-sensitive sensor feedback and tuning of controller gains for adequate performance. In addition, feedback controllers act on an error signal instead of the input; therefore, feedback results in a slower control response than what is possible with a feedforward controller [2].

Feedforward controllers represent an attractive alternative to feedback controllers due to their minimal sensor requirements, decreased cost, lower control effort, and reduced packaging requirements, especially in micro- and nanoscaled systems [3, 4]. Both input shaping and digital filtering are widely applied feedforward control methods that tailor input commands to reduce residual oscillations. Singhose and Vaughan showed that input shapers were easier to design and implement than digital filters due to closed-form expressions that exist for input shapers, which cannot be derived for the analogous digital filters [8,9,10,11]. In addition, the solution space for the input shaping impulse sequences includes the solution spaces for notch and low-pass filters; therefore, these filtering techniques can never be shorter in duration than input shapers [11].

The shaping of reference commands to reduce system residual vibration dates back to the work of Smith [12, 13] in the mid-twentieth century. Smith [12] demonstrated the application of step inputs divided into two or three excitations, and spaced by one-half or one-eighth, respectively, of the natural period of the system. He termed his method ‘Posicast control.’ When incorporating Posicast control, the system moves with minimal residual vibration in either one-half or one-fourth of the natural period of the system, depending on whether the input is broken into two positive excitations or three excitations (two positive and one negative), respectively [12]. The application of subsequent excitations cancels residual oscillations caused by the first excitation.

With the advent of digital computing, Singer et al. [8, 10, 14] further developed and extended Smith’s approach, terming it ‘input shaping.’ Specifically, they generalized the two excitation formulation of Posicast control into a closed-form expression now commonly termed a zero vibration (ZV) input shaper [8, 10, 14]. A ZV input shaper consists of two impulses convolved with an input command to produce a response that results in zero residual vibration in a linear system because the principle of superposition is used explicitly in its development. Singer, Singhose, and Seering [8, 10] explored various explicit formulations of input shaping with varying levels of robustness to parameter variations by introducing the zero vibration and derivative (ZVD) and extra-insensitive (EI) input shapers. Both the ZVD and EI shapers provide robustness at the cost of an increased impulse sequence duration (a full damped period) in comparison to the one-half period required for the ZV input shaper [9]. By altering the constraint equations used to derive an input shaper, the detrimental effect of variations in the damping and natural frequency of a system are mitigated. The robustness gained from altering the constraint equations of an input shaper alleviates several shortcomings presented by Smith in his development of Posicast control [12, 13].

Singhose et al. also developed formal definitions for input shapers with positive and negative impulses, which were also first introduced with Smith’s Posicast control [12, 15]. Admitting negative impulses creates input shapers that result in significantly faster response times than possible with only positive impulses. In fact, some negative input shapers result in time-optimal control of flexible systems [15, 16]. However, the shorter duration of these shapers comes at the cost of larger energy usage and increased likelihood of exciting higher-order modes, which exacerbates the effect of nonlinearities [15].

Since its inception, use of command shaping for crane positioning has been a motivating application due to large sway oscillations commonly induced during maneuvers. As such, Smith [12] used an undamped pendulum to introduce the idea of Posicast control in the 1950s. Several years later Alsop et al. [17] explored a form of input shaping by controlling the acceleration of a crane’s trolley in several steps of constant acceleration until zero oscillation angle is reached in a multiple of a full period, at which point the trolley continues forward at constant velocity. Once the trolley has approached its final position, a deceleration profile symmetric to the acceleration of the trolley is used to bring the crane to rest. In his development, Alsop [17] used a linear approximation to the frequency of a simple crane model. The input shaping solutions developed by Singhose, Singer, and Seering were applied to various industrial crane configurations, such as bridge, gantry, and tower cranes [18,19,20]. These studies include applying a multi-mode ZV input shaper to a double-pendulum bridge crane. The impulse sequence developed based on ZV input shaping was able to mitigate both modes of the double-pendulum payload with up to 10 and 20% variations in the low and high modes, respectively [18]. Singhose et al. [19] also explored the impact of payload hoisting on the efficacy of robust input shaping applied to a gantry crane with the payload hoisted during motion. Vaughan et al. [20] applied specified insensitivity (SI) input shapers to mitigate the two vibration modes of a tower crane with a double-pendulum payload traversing an obstacle course. The SI input shapers allowed Vaughan et al. to specify frequency ranges over which residual vibrations are suppressed.

The application of command shaping is clearly not limited to cranes. Popa et al. [21] applied a ZVD input shaper to the voltage input of a MEMS actuator. A discrete model was used to define the impulse sequence of the ZVD input shaper, which was applied to a third-order nonlinear model based on finite element analysis displacement data. Residual oscillations persisted, however, due to the significant influence of the MEMS actuator nonlinearities. In vehicle applications, Togai and Platten [22] applied command shaping to a driver torque request in the form of a notch filter designed with resonant frequencies obtained from a linearized powertrain model. Residual oscillations persisted in the driveline, again due to the significant nonlinearities and changes in operating conditions of the powertrain. Singhose et al. [23] applied ZVD and EI input shapers to reduce the residual vibrations of a flexible spacecraft resulting in a commanded position or velocity. The shapers were designed to eliminate multiple known vibration modes of the spacecraft, but as in other studies, residual oscillations remained due to the nonlinearities present in the spacecraft model.

Since design of an input shaper only requires estimates of the natural frequency and damping ratio of the undesired vibration mode, most studies elect to linearize otherwise nonlinear system models to obtain the requisite frequencies. When a system exhibits a large nonlinearity, the efficacy of an input shaper designed through linearization degrades, which was observed in the works of several researchers including Singhose et al., Vaughan et al., and Popa et al. [20, 21, 23]. The cause of the degradation depends on the type of nonlinearity, but primarily occurs due to the tailoring of the impulse sequence assuming the system is governed by a linear, time-invariant second-order differential equation [2]. Several researchers have proposed methods to mitigate the impact of nonlinearities on the efficacy of input shaping. Sorensen [24] presented multiple methods for treating nonlinearities arising in the operation of bridge and gantry cranes, such as saturation, dead-zone, rate limiting, finite-state actuation, and backlash. Bradley et al. [25] explored using input shaping on a system with a nonlinearity arising from asymmetrical acceleration of the actuator of a bridge crane. Minimizing the effect of a nonlinear actuator on the implementation of a unity-magnitude (UM) ZV input shaper was accomplished by updating the temporal locations of the impulses of the shaper to minimize crane residual vibrations. Blackburn et al. [26] addressed the nonlinearities arising from gyroscopic effects in rotational motion of a tower crane. They updated their impulse sequence to account for the nonlinear dynamics of the tower crane undergoing a rotational or slewing motion. Smith et al. [27] minimized the nonlinear effect of position dependency in a natural frequency. The natural frequency for the impulse sequence was based on either the final frequency of the undesired vibration mode, the average frequency for the undesired vibration mode, or through an optimization process that minimizes the residual vibration based on the potential and kinetic energy within the system. Updating the impulse sequence with these methods significantly improved the input shaping efficacy.

More recently, Daqaq et al. explored using nonlinear analysis techniques and input shaping on cranes and MEMS devices [1, 3]. The method of multiple scales was used in place of linearization to arrive at a frequency estimate. In the case of a crane, following obtainment of an estimated nonlinear frequency, the acceleration profile for the crane trolley was defined to minimize residual oscillations through a less explicit form of input shaping called bang-coast-bang control [1]. In a MEMS system, Daqaq et al. [3] again used the method of multiple of scales to define a first-order nonlinear approximate solution, which was then employed to redefine the impulse sequence of a ZV input shaper to minimize residual oscillation in a torsional micromirror [3]. The first-order nonlinear approximate solution was used alongside an expression of the total energy to recursively solve for the amplitude of the first impulse and temporal location of the second impulse. This is similar to the approach taken by Smith et al. [27] in their exploration of input shaping applied to a tower crane.

Two-scale command shaping (TSCS) is the most recent approach for extending feedforward command shaping to nonlinear systems. It was originally developed for mitigating unwanted vibrations during internal combustion engine restart in hybrid electric vehicles [7]. Unlike the approaches proposed by Daqaq et al. [1, 3] and Smith et al. [27], which effectively implement the linear input shaping technique using nonlinear frequency estimates, TSCS decomposes the fully nonlinear system and commanded forcing into two scales, with the zeroth-order scale governing the linear portion of the system, and the remaining scale governing the nonlinearity of the system. The nonlinear response, in an asymptotic sense, is canceled by the accompanying force component at the same scale, while input shaping is applied to the zeroth-order linear problem to mitigate residual vibrations. The ease and effectiveness of the approach mainly arises from (i) applying input shaping to a linear problem, vis-à-vis a nonlinear problem as in other approaches, and (ii) cancelation of a generally nonlinear problem at a separate scale. The latter enables the technique, in principle, to be applied to generally nonlinear systems of analytic form, either weak or strong.

While TSCS first appeared in [7] and proved effective in limiting oscillations associated with engine restart, little critical analysis of the method appeared alongside it. To address this deficiency, herein the TSCS method is critically assessed through its application and effectiveness in mitigating residual oscillations of a Duffing nonlinear system, and through comparisons of its performance to other methods, including that developed in [1]. TSCS’s effectiveness is assessed with respect to its ability to reduce residual vibrations in the response of an undamped Duffing oscillator with varying degrees of nonlinearity, as well as a Duffing oscillator damped by a strongly nonlinear Coulomb friction. Finally, robust extensions to TSCS are also detailed and critically assessed. Through this assessment, the benefits of TSCS over direct implementation of input shaping is also evaluated.

The article is structured as follows. Section 2 briefly introduces the Duffing oscillator and its amplitude-dependent nonlinear frequency based on (i) a closed-form exact solution and (ii) the method of multiple scales. Section 3 presents the development of TSCS for an undamped Duffing oscillator. Section 4 explores TSCS as applied to an undamped Duffing oscillator with cubic and quadratic nonlinear terms, in addition to Coulomb friction and compares these results to direct implementation of ZV input shaping in various forms used by other researchers. Section 5 presents TSCS formulations which incorporate robust command shaping and parameter estimation techniques, effectively treating uncertainty. The article then ends with pertinent conclusions.

2 Introduction of the Duffing oscillator

The Duffing oscillator serves as the main system for assessing the TSCS technique and comparing it to existing feedforward control methods. Georg Duffing introduced his namesake equation in a book published in 1918 [28, 29]. Since, it has been the focus of numerous studies due to its rich behavior and wide applicability [29]. For these reasons, and owing to its sufficient simplicity, it is chosen herein for applying and critically assessing TSCS.

The equation of motion for an undamped Duffing oscillator is given by,

$$\begin{aligned}&\ddot{x} + \omega _\mathrm{n} ^{2} x + \varepsilon x^{3} = \frac{{F\left( t \right) }}{m}\nonumber \\&x\left( 0 \right) = x_{\mathrm{IC}}, \quad \dot{x}\left( 0 \right) = \dot{x}_{\mathrm{IC}} \end{aligned}$$
(1)

where x(t) denotes the dependent variable (e.g., position), t the independent time variable, \(x_\mathrm{IC} \) the initial position, \(\dot{x}_\mathrm{IC}\) the initial velocity, \(\omega _\mathrm{n}\) the linear natural frequency, \(\varepsilon \) the coefficient of the cubic nonlinear term, \(F\left( t \right) \) the forcing function, m the mass, and \({(\dot{ })}=\frac{\mathrm{d}}{\mathrm{d}t}\) [29, 30]. In all results presented, m is defined to be of unit value. The oscillator exhibits hardening when \(\varepsilon >0\) and softening when \(\varepsilon <0\). This work puts primary focus on systems exhibiting hardening.

When \(F\left( t \right) =0\), an exact solution exists for Eq. (1). The solution has the following forms [29],

$$\begin{aligned}&\varepsilon >0: \quad x=X\hbox {cn}\left( {\omega t-\theta ,k^{2}} \right) \nonumber \\&\varepsilon <0: \quad x=X\hbox {sn}\left( {\omega t-\theta ,k^{2}} \right) \end{aligned}$$
(2)

where \(\hbox {cn}\) is the Jacobi cosine function, \(\hbox {sn}\) is the Jacobi sine function, X is the amplitude of the response, \(\theta \) is the phase, and

$$\begin{aligned}&\varepsilon >0: \quad \omega ^{2}=\omega _\mathrm{n} ^{2}+\varepsilon X^{2}, \quad k^{2}=\frac{\varepsilon X^{2}}{2\left( {\omega _\mathrm{n} ^{2}+\varepsilon X^{2}} \right) }\nonumber \\&\varepsilon <0: \quad \omega ^{2}=\omega _\mathrm{n} ^{2}-\frac{\varepsilon X^{2}}{2}, \quad k^{2}=\frac{\varepsilon X^{2}}{2\left( {\omega _\mathrm{n} ^{2}-\frac{\varepsilon X^{2}}{2}} \right) }.\nonumber \\ \end{aligned}$$
(3)

The response amplitude X is expressed as,

$$\begin{aligned} X=\left( -\frac{\omega _\mathrm{n} ^{2}}{\varepsilon }+\frac{\omega _\mathrm{n} ^{2}+\varepsilon x_\mathrm{IC ^{2}}}{\varepsilon }\sqrt{1+\frac{2\varepsilon \dot{x}_\mathrm{IC}}{{\omega _\mathrm{n}}^2}} \right) ^{\frac{1}{2}} \end{aligned}$$
(4)

while the phase satisfies,

$$\begin{aligned} \frac{\hbox {sn}\left( {\theta ,k^{2}} \right) }{\hbox {cn}\left( {\theta ,k^{2}} \right) }\hbox {dn}\left( \theta ,k^{2} \right) =-\frac{\dot{x}_\mathrm{IC}}{{\omega }x_\mathrm{IC}} \end{aligned}$$
(5)

where \(\hbox {dn}\) is the Jacobi delta function.

Without loss of generality (the system is autonomous), initial conditions can identify zero time with zero position,

$$\begin{aligned} x\left( 0 \right) = 0 ,\quad \dot{x}\left( 0 \right) = \dot{x}_{\mathrm{IC}} \end{aligned}$$
(6)

and then the phase is given by,

$$\begin{aligned} \theta =K\left( {k^{2}} \right) \end{aligned}$$
(7)

where K is the complete elliptic integral of the first kind [29].

The response frequency follows from the solution, as shown in Eq. (2) [29]. For the hardening case, the exact nonlinear frequency, \(\omega _\mathrm{NL} \), is given by,

$$\begin{aligned} \omega _\mathrm{NL,exact} =\frac{\pi \sqrt{\omega _\mathrm{n} ^{2}+\varepsilon X^{2}}}{2K\left( {\frac{\varepsilon X^{2}}{2\left( {\omega _\mathrm{n} ^{2}+\varepsilon X^{2}} \right) }} \right) } \end{aligned}$$
(8)

while for softening, it is given by,

$$\begin{aligned} \omega _\mathrm{NL,exact} =\frac{\pi \sqrt{\omega _\mathrm{n} ^{2}-\frac{1}{2}\varepsilon X^{2}}}{2K\left( {\frac{\varepsilon X^{2}}{2\left( {\omega _\mathrm{n} ^{2}-\frac{1}{2}\varepsilon X^{2}} \right) }} \right) }. \end{aligned}$$
(9)

The exact frequencies in Eqs. (8)–(9) will later be used with direct application of ZV and UM input shapers, and then compared to TSCS.

The method of multiple scales provides an approximation to the nonlinear frequency [30,31,32] and is commonly employed in place of, or in the absence of, an exact solution. Daqaq et al. integrated multiple scales with input shaping in their analysis of a container crane. They applied the method to a base-excited simple pendulum governed by,

$$\begin{aligned} \ddot{x} + \omega _\mathrm{n} ^{2} \sin \left( x \right) = \frac{1}{m}F_{0} {\text {cos}}\left( x \right) H\left( t \right) \end{aligned}$$
(10)

where \(H\left( t \right) \) denotes the Heaviside function. \(F_0 \) is proportional to the commanded base acceleration, and notably, is included in the multiple scales-derived expression for the nonlinear response frequency. Here, their method is adopted, but instead applied to an undamped Duffing equation subjected to a constant force,

$$\begin{aligned} {\ddot{x}} + \omega _\mathrm{n} ^{2} \left( {1 + \gamma x^{2} } \right) x = \frac{1}{m}F_{0} H\left( t \right) \end{aligned}$$
(11)

where \(\gamma \) is equal to \(\varepsilon /\omega _\mathrm{n} ^{2}\) and the system is subjected to zero initial conditions. Implementing the approach described in [1], time t and the state x are expanded as,

$$\begin{aligned}&t=T_0 +\gamma T_1 +O\left( {\gamma ^{2}} \right) \end{aligned}$$
(12)
$$\begin{aligned}&x\left( {T_0 ,T_1 ,\ldots } \right) =x_0 \left( {T_0 ,T_1 ,\ldots } \right) \nonumber \\&\quad \qquad \quad \qquad \quad +\,\gamma x_1 \left( {T_0 ,T_1 ,\ldots } \right) +O\left( {\gamma ^{2}} \right) \end{aligned}$$
(13)

such that,

$$\begin{aligned}&\frac{\hbox {d}}{\hbox {d}t}=D_0 +\gamma D_1 +O\left( {\gamma ^{2}} \right) \end{aligned}$$
(14)
$$\begin{aligned}&\frac{\hbox {d}^{2}}{\hbox {d}t^{2}}=D_0 ^{2}+2\gamma D_0 D_1 +O\left( {\gamma ^{2}} \right) \end{aligned}$$
(15)

where \(D _\mathrm{n}\) denotes a time derivative with respect to \(T _\mathrm{n}\).

Introducing Eqs. (12)–(15) in Eq. (11), and separating orders of \(\gamma \), results in the following expressions,

$$\begin{aligned}&{O}\left( {\gamma ^{0}} \right) : \quad D_0 ^{2}x_0 +\omega _\mathrm{n} ^{2}x_0 =\frac{1}{m}F_0 H\left( t \right) \end{aligned}$$
(16)
$$\begin{aligned}&{O}\left( {\gamma ^{1}} \right) : \quad D_0 ^{2}x_1 +\omega _\mathrm{n} ^{2}x_1 =-\omega _\mathrm{n} ^{2}x_0 ^{3}-2D_0 D_1 x_0.\nonumber \\ \end{aligned}$$
(17)

Solving sequentially Eqs. (16) and (17) while eliminating secular terms yields the desired approximation to the nonlinear frequency,

$$\begin{aligned} \omega _\mathrm{NL,forced} =\left( {1+\frac{3\gamma X_0 ^{2}}{8}+\frac{3\gamma F_0 ^{2}}{2m^{2}\omega _\mathrm{n} ^{4}}} \right) \omega _\mathrm{n} \end{aligned}$$
(18)

where \(X_{0}\) is the amplitude of the general solution to Eq. (16) with zero initial conditions. The forcing-informed multiple scales frequency, Eq. (18), will also be used with direct application of ZV input shapers and then compared to TSCS.

Since input shaping requires the system response between inputs, it is reasonable to apply the multiple scales procedure to the unforced system to obtain a frequency estimate. This small change to Daqaq et al.’s method is also assessed herein. Applying the method of multiple scales to the unforced system results in the approximation to the nonlinear frequency given by,

$$\begin{aligned} \omega _\mathrm{NL,unforced} =\left( {1+\frac{3\gamma X_0 ^{2}}{8}} \right) \omega _\mathrm{n}. \end{aligned}$$
(19)

3 Two-scale command shaping development

3.1 Scale separation

The TSCS strategy decomposes the input forcing into linear and nonlinear terms,

$$\begin{aligned} F_\mathrm{TSCS} \left( t \right) =F_{0_\mathrm{Shaped} } \left( t \right) +\varepsilon F_1 \left( t \right) \end{aligned}$$
(20)

where \(F_{0_\mathrm{Shaped} } \) denotes the linear component of the input later specified using command shaping with the zeroth-order problem, \(F_{1}\) the time-varying component used to mitigate oscillations arising from nonlinear behavior, and \(\varepsilon \) is either a parameter appearing with the nonlinearity, or a bookkeeping parameter used to order linear and nonlinear effects [30,31,32].

An undamped Duffing oscillator (and other nonlinear systems) employing the TSCS strategy can be written as,

$$\begin{aligned} \ddot{x} + \omega _\mathrm{n}^{2} x + \varepsilon f_{\mathrm{NL}} \left( {x,\dot{x}} \right) = \frac{1}{m}F_{\mathrm{TSCS}} \left( t \right) \end{aligned}$$
(21)

where \(f_\mathrm{NL} \) denotes the nonlinear component of the differential equation, \(\omega _\mathrm{n}\) the linear natural frequency, and \(\varepsilon \) denotes the (small) strength of the nonlinearity [30]. An asymptotic approximation is introduced for x using \(\varepsilon \),

$$\begin{aligned} x\left( t \right) =x_0 \left( t \right) +\varepsilon x_1 \left( t \right) +\varepsilon ^{2}x_2 \left( t \right) ++O\left( {\varepsilon ^{3}} \right) \end{aligned}$$
(22)

where Eq. (22) is used within Eq. (21) to isolate the zeroth- and first-order expressions required for TSCS. Separating orders of \(\varepsilon \) in Eq. (21) via Eq. (22), the zeroth-order expression follows as,

$$\begin{aligned} \ddot{x}_{0} + \omega _\mathrm{n}^{2} x_{0} = \frac{1}{m}F_{{0_{\mathrm{Shaped}} }} \left( t \right) \end{aligned}$$
(23)

and the first-order expression as,

$$\begin{aligned} \ddot{x}_{1} + \omega _\mathrm{n}^{2} x_{1} + f_{\mathrm{NL}} \left( {x_{o} ,\dot{x}_{0} } \right) = \frac{1}{m}F_{1} \left( t \right) . \end{aligned}$$
(24)

It is desired for residual oscillations appearing with \(x_1 \) to be eliminated—thus \(x_1 \) is set to zero, effectively specifying the requisite form for \(F_1 \left( t \right) \),

$$\begin{aligned} F_1 \left( t \right) =mf_\mathrm{NL} \left( {x_o ,\dot{x}_0} \right) . \end{aligned}$$
(25)

The second, linear component of the input, \(F_{0_\mathrm{Shaped} } \left( t \right) \), is specified next using command shaping, ultimately providing the response quantities \(x_o ,\dot{x}_0\) required to complete the specification of \(F_1 \left( t \right) \) and the first-order expression.

3.2 Command shaping

Command shaping addresses the linear forcing component appearing in Eq. (23) under the assumption that a discontinuous step-like command input would otherwise be applied to the system. The residual vibration amplitude at the time of the last impulse of a sequence of impulses applied to a linear mass-spring-damper is given by,

$$\begin{aligned}&A= \frac{\omega _\mathrm{n} }{\sqrt{1-\zeta ^{2}}}e^{-\zeta \omega _\mathrm{n} t_m }\nonumber \\&\quad *\sqrt{{\begin{array}{l} {\left[ {\mathop \sum \limits _{i=1}^m A_i e^{\zeta \omega _\mathrm{n} t_i }\left( {\cos \omega _\mathrm{d} t_i } \right) } \right] ^{2}+\left[ {\mathop \sum \limits _{i=1}^m A_i e^{\zeta \omega _\mathrm{n} t_i }\left( {\sin \omega _\mathrm{d} t_i } \right) } \right] ^{2}} \\ \end{array} }}\nonumber \\ \end{aligned}$$
(26)

where \(\omega _\mathrm{n }\) denotes the linear natural frequency, \(t_{m}\) the time of application of the last impulse, and \(A_{i}\) the amplitude of the ith impulse that occurs at time \(t_{i}\) [2]. When the command shaping strategy is correctly implemented, the amplitude A in Eq. (26) will be zero or below a user-defined tolerance value.

A ZV input shaper has a simple formulation that eliminates residual vibrations at a single frequency, which represents one vibration mode for a system. A ZV input shaper impulse sequence is defined as,

$$\begin{aligned}&\left[ {{\begin{array}{ll} {A_1 }&{}\quad {A_2 } \\ {t_1 }&{} \quad {t_2 } \\ \end{array} }} \right] =\left[ {{\begin{array}{ll} {\frac{1}{1+K}}&{}\quad {\frac{K}{1+K}} \\ 0&{}\quad {\frac{\pi }{\omega _\mathrm{d} }} \\ \end{array} }} \right] \end{aligned}$$
(27)
$$\begin{aligned}&K = e^{{\frac{{ - \zeta \pi }}{{\sqrt{1 - \zeta ^{2} } }}}} \end{aligned}$$
(28)

where \(\omega _\mathrm{d}\) and \(\zeta \) are the damped natural frequency and damping ratio, respectively. Two constraints yield Eq. (27): the amplitudes must sum to one and the second impulse must occur at the half-period, i.e., the smallest possible time guaranteeing zero residual vibration.

Fig. 1
figure 1

Impulse response sequence and system response for zero vibration of an ideal mass-spring-damper, and (inset) ZV input shaper represented as pole-zero cancelation

Figure 1 presents the results of using a ZV approach to shape a unity impulse, which is then applied to an ideal linear mass-spring-damper system. The solid line denotes the system response from the two-impulse sequence of a ZV shaper; the dashed line denotes system response of the stationary system excited by the second impulse at time \(t_{2}\); and the dotted line denotes the system response from the first impulse applied at time zero (and absent of second impulse). For this ideal case, it is possible to eliminate all residual vibrations using the ZV approach. Note that a ZV input shaper is equivalent to defining a zero at the flexible poles associated with the design frequency, as shown in the inset of Fig. 1. Shaper robustness to error in the design frequency may be increased by including additional zeros and (optionally) changing their location relative to the flexible poles. This has been explored by several researchers through the development of follow-on command shaping strategies, such as ZVD and EI input shapers [9,10,11, 33, 34].

ZVD input shapers are an extension of the ZV shapers introduced above. The impulse sequence requires three impulses and a full damped period of the pole. It is derived using the constraints presented for the ZV shaper in addition to the requirement that the partial derivative of the residual vibration amplitude, Eq. (26), with respect to frequency is zero at the design frequency [2, 9, 10]. Using the additional constraint, the impulse sequence for the ZVD shaper is,

$$\begin{aligned} \left[ {{\begin{array}{lll} {A_1 }&{}\quad {A_2 }&{} \quad {A_3 } \\ {t_1 }&{} \quad {t_2 }&{}\quad {t_3 } \\ \end{array} }} \right] =\left[ {{\begin{array}{lll} {\frac{1}{\left( {1+K} \right) ^{2}}}&{}\quad {\frac{2K}{\left( {1+K} \right) ^{2}}}&{}\quad {\frac{K^{2}}{\left( {1+K} \right) ^{2}}} \\ 0&{} \quad {\frac{\pi }{\omega _\mathrm{d} }}&{}\quad {\frac{2\pi }{\omega _\mathrm{d} }} \\ \end{array} }} \right] \end{aligned}$$
(29)

where K is defined with Eq. (28) [10]. Imposing that the partial derivative must be zero increases the robustness of the input shaper while increasing the duration to a full damped period. A ZVD input shaper is represented as placing repeated zeros on a flexible pole, as shown in Fig. 2.

Fig. 2
figure 2

ZVD input shaper represented as pole-zero cancelation

Fig. 3
figure 3

Residual vibration comparison of TSCS to direct implementation of a ZV input shaper, designed for various frequency values, on an undamped Duffing oscillator with a a small positive cubic nonlinearity (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =1.6\hbox { }1/(\hbox {m}^{2}\,\hbox {s}^{2})\), \(F_{0}=1~\hbox {N}\)) and b a small negative cubic nonlinearity (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =-1.6\hbox { }1/(\hbox {m}^{2}\,\hbox {s}^{2})\), \(F_{0}=1~\hbox {N}\))

In addition to robust input shaping, negative input shapers increase the speed at which a system moves [15]. A simple form is a unity-magnitude (UM) ZV input shaper. In place of the constraint requiring the sum of the amplitudes must equal one, the amplitudes of the negative input shaper must satisfy,

$$\begin{aligned} A_i =\left( {-1} \right) ^{i+1}, \quad i=1,\ldots ,n \end{aligned}$$
(30)

where n denotes the number of impulses in the sequence. Using the constraint defined in Eq. (30) prevents actuator saturation from occurring, which is a concern with negative input shapers [15]. Combining the constraint in Eq. (30) with the constraints of a traditional ZV input shaper provides the following impulse sequence for an undamped system,

$$\begin{aligned} \left[ {{\begin{array}{lll} {A_1 }&{} \quad {A_2 }&{}\quad {A_3 } \\ {t_1 }&{} \quad {t_2 }&{} \quad {t_3 } \\ \end{array} }} \right] =\left[ {{\begin{array}{lll} 1&{} \quad {-\,1}&{}\quad 1 \\ 0&{} \quad {\frac{\cos ^{-1}\left( {0.5} \right) }{\omega _\mathrm{n} }}&{}\quad {\frac{\cos ^{-1}\left( {-0.5} \right) }{\omega _\mathrm{n} }} \\ \end{array} }} \right] \end{aligned}$$
(31)

where \(\omega _\mathrm{n} \) is the linear natural frequency [15]. For a damped system, the temporal locations for the impulses are complex functions. Note that the time required to execute the impulse sequence for a UM ZV input shaper is one-third the period of the system’s oscillations, which is 33% faster than a traditional ZV shaper [15]. Increasing the system response speed requires more actuator effort, excites higher-order modes, and may accentuate the effect of nonlinearities.

After the correct sequence of impulses has been determined, inputs of any general form (stepped up and down inputs in this paper) can be convolved with the impulse sequence to generate a shaped command function that minimizes residual oscillations,

$$\begin{aligned} F_{0_\mathrm{Shaped} } \left( t \right) =F_0 \left( t \right) *I_1 \left( t \right) *I_2 \left( t \right) *\cdots \end{aligned}$$
(32)

where \(I_{i}(t)\) is the ZV, ZVD, or UM ZV input shaper defined to mitigate one of the n vibration modes of the system. Note that if a combination of ZV input shapers must cancel n vibration modes, the number of shaper impulses increases to 2n impulses [2].

Fig. 4
figure 4

Comparison of TSCS to direct implementation of a ZV input shaper, designed for various frequency values, on an undamped Duffing oscillator with a large positive cubic nonlinearity and multi-step input profile (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =8\hbox { 1/(m}^{2}\,\hbox {s}^{2})\), \(F_{0}=1~\hbox {N}\))

4 Two-scale command shaping efficacy

4.1 Comparison of TSCS to direct implementations of ZV input shaping

A Duffing oscillator with a small cubic nonlinearity is used to compare TSCS to methods of direct input shaping. Figure 3a, b compares the methods for Duffing oscillators exhibiting hardening and softening, respectively. The nonlinearity in the cases presented in Fig. 3 is weak since the ratio \(\varepsilon /\omega _\mathrm{n}^2 \) was chosen to have a magnitude of 0.4. With a change of variables for non-dimensional time, \(\tau =\omega _\mathrm{n} t\), it can be shown that only one system parameter needs definition, which is the ratio \(\varepsilon /\omega _\mathrm{n}^2 \). A ratio of less than 1 results in a weak nonlinearity, where a ratio greater than 1 is typically considered a strong nonlinearity [29]. A multi-step, unit magnitude input is applied to observe the transient and steady-state performance of the methods. The direct methods use the standard ZV input shaping approach with estimates of the natural frequency based on either \(\omega _\mathrm{n} \), \(\omega _\mathrm{NL, exact} \), \(\omega _\mathrm{NL, forced} \), or \(\omega _\mathrm{NL, unforced} \). In Fig. 3, the dashed blue line denotes the response with a shaper based on \(\omega _\mathrm{n} \), dotted purple line \(\omega _\mathrm{NL, exact} \), dashed red line \(\omega _\mathrm{NL, forced} \), and dash-dotted yellow line \(\omega _\mathrm{NL, unforced}\).

Fig. 5
figure 5

Undamped Duffing oscillator normalized residual vibration amplitude comparison for TSCS and direct implementations of a ZV input shaper as a function of a unshaped input amplitude (with \(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =0.5\) 1/(\(\hbox {m}^{2}\,\hbox {s}^{2})\)) and b nonlinear coefficient (with \(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(F_{0}=1~\hbox {N}\))

Figure 3 indicates that TSCS results in less residual vibrations than all direct ZV input shaping implementations. TSCS reduces the steady-state residual oscillation to 25 and 76% of the best direct input shaping implementation in the hardening and softening cases, respectively. Including the forcing term in the multiple scales-informed nonlinear frequency estimate decreases the efficacy of the ZV input shaping; however, without the forcing term, the direct approach with a multiple scales-informed nonlinear frequency performs as well as the direct method using an exact nonlinear frequency. This can be expected as the design of the ZV impulse sequence minimizes oscillations associated with free response, and the multiple scales’ estimate of the nonlinear frequency is known to be accurate for small to moderate motions. Note also that, for the small cubic nonlinearity and amplitudes considered, the direct ZV method based on the linear natural frequency still performs satisfactorily in comparison to the other direct methods.

As the nonlinearity and motion amplitude increases, differences between the methods become more evident. Figure 4 illustrates the effect of increasing the nonlinear coefficient on the performance of TSCS and the direct ZV input shaping methods. The ratio \(\varepsilon /\omega _\mathrm{n}^2 \) was chosen to have a magnitude of 2, resulting in a strong nonlinearity. It can be expected that the direct methods’ performance will decrease as the nonlinear coefficient increases due to the superposition assumption underlying the impulse sequence design. TSCS is expected to avoid this issue as it applies command shaping to a strictly linear subproblem. The direct methods using nonlinear frequency estimates now significantly outperform the direct method employing a linear frequency estimate, except for the case where forcing is used in the nonlinear frequency estimate. Figure 4 documents that TSCS continues to be highly effective, resulting in residual oscillations on the order of 10% of the best direct input shaping method.

The results of Figs. 3 and 4 demonstrate that the best direct method employs the exact nonlinear frequency. Therefore, for the remainder of the paper, only this nonlinear direct method will be retained. The direct method with the linear natural frequency is also retained for ultimately assessing the improvements possible with TSCS and nonlinearly informed direct input shaping methods.

Figure 5a, b compares the effectiveness of the remaining command shaping strategies as a function of unshaped input amplitude and nonlinear coefficient, respectively. In these analyses, \(\omega _\mathrm{n}\) is fixed at a value of 2 rad/s for direct comparison with the systems in Figs. 3 and 4. Both standard ZV input shapers perform near-equivalently for amplitudes, \(F_{0}\), less than approximately 0.5 N when the nonlinear coefficient, \(\varepsilon \), equals 0.5 \(\hbox {1/(m}^{2}\,\hbox {s}^{2})\), which results in a weak nonlinearity since the ratio \(\varepsilon /\omega _\mathrm{n}^2 \) has a magnitude of 0.125 (Fig. 5a). At an unshaped input amplitude of 1.0 N (Fig. 5b), the two direct methods deviate in their performance at even small values of \(\varepsilon \). Both subfigures clearly demonstrate that TSCS performs better than the direct implementations regardless of input amplitude or nonlinear coefficient.

Although Figs. 3, 4, and 5 clearly demonstrate very good TSCS performance with respect to residual oscillations, the approach has one disadvantage in comparison to the direct methods. Due to the scale separation and feeding back of the zeroth-order response into the first-order shaped input, the response amplitude following two-scale shaping can differ from that desired. Direct implementations do not change the amplitude of the response. This disadvantage can be rectified by a feedback element, which can effectively eliminate the offset. Figure 6 depicts the application of the TSCS with an integral controller designed iteratively with the Zeigler–Nichols method for a system with significant nonlinearity, the magnitude of \(\varepsilon /\omega _\mathrm{n}^2 \) is 2.5. Iteratively designing the integral control provides a choice between overshoot and response time. The feedback controller can be either applied in conjunction with TSCS (dash-dotted orange line) or used offline to determine the unshaped input amplitude required (dashed blue line). Applying the controller offline, informed by previous applications of TSCS, enables the strategy to remain feedforward.

Fig. 6
figure 6

Application of TSCS on an undamped Duffing oscillator with a large cubic nonlinearity (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =10\hbox { 1/(m}^{2}\,\hbox {s}^{2}\)), \(F_{0}=1~\hbox {N}\)) and an integral feedback controller used to update the original input amplitude

4.2 Undamped Duffing oscillator considering negative input shapers

This section explores UM input shaping with the TSCS strategy and the two remaining direct methods. Figure 7a compares the unshaped response to TSCS response results generated using ZV and UM ZV input shaping, and Fig. 7b provides the corresponding input forces applied to the system. The ratio \(\varepsilon /\omega _\mathrm{n}^2 \) is defined to have a magnitude of 0.125 to result in a system with a weak nonlinearity for an effective comparison of the methods. Both TSCS strategies mitigate the residual vibration amplitude, but the TSCS strategy with a UM ZV input shaper reduces the response time by 0.5 s. The faster response time comes at the cost of a larger and more complex input profile, as documented in Fig. 7b.

Fig. 7
figure 7

a Comparison of TSCS with ZV and UM ZV input shapers on an undamped Duffing oscillator with a small cubic nonlinearity ( \(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =0.5 1/(\hbox {m}^{2}\,\hbox {s}^{2}\)), \(F_{0}=1~\hbox {N}\)) and b the corresponding input force required. Normalized residual vibration amplitude comparison for TSCS and direct implementations of a UM ZV input shaper as a function of c unshaped input amplitude (with \(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =0.5 1/(\hbox {m}^{2}\,\hbox {s}^{2})\)) and d nonlinear coefficient (with \(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(F_{0}=1~\hbox {N}\))

Figure 7c, d compares the effectiveness of the TSCS strategy with a UM ZV input shaper to the two direct implementations of UM ZV input shaping with variations in the force amplitude and nonlinear coefficient, respectively. Figure 7c demonstrates that direct implementations of UM ZV input shaping results in equivalent vibration reduction in TSCS at inputs smaller than approximately 0.5 N for a system with weak nonlinearity, the magnitude of \(\varepsilon /\omega _\mathrm{n}^2 \) is 0.125. Beyond 0.5 N, the UM ZV shaper designed with the nonlinear frequency performs better than the shaper designed with the linear frequency. For amplitudes greater than 0.5 N, Fig. 7c clearly demonstrates that TSCS performs better than both direct methods. Figure 7d demonstrates that under a nonlinear coefficient of \(0.3\hbox { }1/(\hbox {m}^{2}\,\hbox {s}^{2})\), the UM ZV input shaper designed with the nonlinear frequency performs near-equivalently to TSCS. Beyond a coefficient of \(0.3\hbox { }1/(\hbox {m}^{2}\,\hbox {s}^{2})\), TSCS performs better than the direct shapers designed with linear and nonlinear frequencies.

4.3 Non-traditional duffing systems

Figure 8 displays the efficacy of TSCS when applied to an undamped Duffing oscillator with cubic and quadratic nonlinearities. Both the cubic and quadratic nonlinearities are ordered at the same scale such that \(f_\mathrm{NL}\) is given as \(x^{3}+ \varepsilon _\mathrm{UC}x^{2}\) in Eq. (21), where \(\varepsilon _\mathrm{UC}\) is for unit consistency and has unity magnitude with units of meters for these cases.

Fig. 8
figure 8

Comparison of TSCS to direct implementation of a ZV input shaper for an undamped Duffing oscillator with moderate cubic and quadratic nonlinearities (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =4 1/(\hbox {m}^{2}\,\hbox {s}^{2}\)), \(F_{0}=1~\hbox {N}\))

Figure 8 demonstrates that a linear ZV input shaper’s effectiveness decreases further by adding the quadratic nonlinearity. Adding the quadratic term effectively increases the nonlinear coefficient. In the case presented in Fig. 8, the ratio \(\varepsilon /\omega _\mathrm{n}^2 \) was defined to have a magnitude of 1 to result in a moderate nonlinearity. Direct application of a ZV input shaper designed with the linear natural frequency reduces the residual vibration amplitude to 13.9% of its unshaped value compared to the reduction to 0.07% with TSCS. Note that the exact and approximate nonlinear frequencies given by Eqs. (8) and (19) no longer apply due to the addition of the quadratic nonlinearity. An approximate frequency for both quadratic and cubic nonlinearities can be obtained using multiple scales, but this is not pursued herein.

The presence of Coulomb (nonlinear) damping also does not degrade TSCS’s effectiveness. Coulomb friction is added to the undamped Duffing oscillator,

$$\begin{aligned}&\ddot{x}_{0} + \omega _\mathrm{n}^{2} x_{0} + \varepsilon \left( {x^{3} + \varepsilon _{\mathrm{UC}} x^{2} } \right) + \frac{1}{m}F_\mathrm{F} {\text {sgn}}\left( {\dot{x}} \right) \nonumber \\&\quad = \frac{1}{m}F_{\mathrm{TSCS}} \left( t \right) \end{aligned}$$
(33)

where \(F_\mathrm{F}\) is the friction magnitude. Note that the Coulomb friction is not ordered with the other nonlinearities; this reduces the nonlinear forcing, \(F_{1}\), and serves to increase system stability. Thus, the nonlinear forcing \(f_\mathrm{NL}\) remains as \(x^{3}+\varepsilon _\mathrm{UC}x^{2}\) in Eq. (25), where \(\varepsilon _\mathrm{UC}\) is for consistency of units since x is associated with a unit of length.

Fig. 9
figure 9

Application of TSCS on a damped Duffing oscillator with small cubic and quadratic nonlinearities, Coulomb friction, and large input amplitude (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =0.5 1/(\hbox {m}^{2}\,\hbox {s}^{2})\), \(F_{0}=20~\hbox {N}\))

Figure 9 presents the results of applying TSCS to the modified Duffing oscillator with Coulomb friction, input amplitude large enough to overcome frictional effects, and a small nonlinearity, magnitude of \(\varepsilon /\omega _\mathrm{n}^2 \) is 0.125. TSCS eliminates the residual vibrations in the system, but requires an additional 1.59 s compared to the undamped system with cubic and quadratic nonlinearities. Additionally, the offset in amplitude remains unchanged relative to the undamped system.

5 Robust two-scale command shaping strategy

5.1 Robust command shaping

As with any of the methods discussed, variations in the natural frequency and nonlinear coefficient impact TSCS’s effectiveness. Robust command shaping strategies, such as ZVD input shaping, reduce the detrimental impact of variations in natural frequency. Figure 10a, b presents the performance of TSCS, with and without robust command shaping, in an undamped Duffing system with cubic and quadratic nonlinearities, with a 10% (Fig. 10a) and 20% (Fig. 10b) mismatch between the actual and expected linear natural frequency. As documented in Fig. 10a, TSCS with only ZV input shaping reduces the residual amplitude to 19.7% of the unshaped case, whereas TSCS with ZVD input shaping reduces the residual vibration’s amplitude to 3.1% of the unshaped value. When the variation is increased to 20% (Fig. 10b), TSCS with only ZV input shaping reduces the residual vibration to 13.5% of the unshaped value, whereas TSCS with ZVD input shaping reduces the residual vibration’s amplitude to 5.7% of its unshaped value. Thus, for 10 and 20% mismatch in the expected and actual linear natural frequency, TSCS with ZVD input shaping reduces oscillations by 84.3 and 57.7%, respectively, of the values obtained using TSCS with only ZV shaping.

Fig. 10
figure 10

Application of TSCS with ZV and ZVD input shaping on an undamped Duffing oscillator with small cubic and quadratic nonlinearities (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =0.5\hbox { }1/(\hbox {m}^{2}\,\hbox {s}^{2})\), \(F_{0}=10~\hbox {N}\)) and a a 10% or b 20% mismatch between expected and actual natural frequency

5.2 Extended Kalman filtering with two-scale command shaping

Unlike mismatch in the expected linear natural frequency, variations in the nonlinear coefficients cannot be addressed with robust command shaping. Therefore, an alternate approach is required to mitigate these variations. Figure 11 shows the extent to which variations in the nonlinear coefficient lead to residual vibrations using TSCS. To overcome these residual artifacts, extended Kalman filtering (EKF) is next combined with TSCS to mitigate variations in the nonlinear coefficient and other system parameters.

Fig. 11
figure 11

Effect of variation in the nonlinear coefficient on the effectiveness of TSCS on an undamped Duffing oscillator with small cubic and quadratic nonlinearities (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =0.01\hbox { }1/(\hbox {m}^{2}\,\hbox {s}^{2})\), \(F_{0}=50~\hbox {N}\))

EKF provides a means for estimating the nonlinear coefficients of the undamped Duffing oscillator, as well as its linear natural frequency. EKF is essentially Kalman filtering (KF) implemented for nonlinear systems [36]. Further documentation of the EKF algorithm is given in [35,36,37]. In the present application, EKF requires multiple cycles of the TSCS procedure to iteratively infer the correct coefficients. To do so, an augmented system parameter estimation with EKF is defined herein as,

$$\begin{aligned}&\dot{\varvec{x}}_{\varvec{A}} \left( t \right) = \varvec{f}_{\varvec{A}} \left( {\varvec{x}\left( t \right) ,\varvec{u}\left( t \right) } \right) + \varvec{F}_{\varvec{A}} \varvec{W}_{\varvec{A}} \left( t \right) \nonumber \\&\quad = \left[ {\begin{array}{*{20}c} {\varvec{f}\left( {\varvec{x}\left( t \right) ,\varvec{u}\left( t \right) ,{\mathbf {\Theta }}} \right) } \\ 0 \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} \varvec{F} &{} 0 \\ 0 &{} 0 \\ \end{array} } \right] \left[ {\begin{array}{*{20}c} {\varvec{w}\left( t \right) } \\ 0 \\ \end{array} } \right] \end{aligned}$$
(34)
$$\begin{aligned}&\varvec{y}\left( t \right) = \varvec{g}_{\varvec{A}} \left( {\varvec{x}_{\varvec{A}} \left( t \right) ,~\varvec{u}\left( t \right) } \right) \end{aligned}$$
(35)
$$\begin{aligned}&\varvec{z}\left( k \right) = \varvec{y}\left( k \right) + \varvec{Gv}\left( k \right) \end{aligned}$$
(36)

where \({\varvec{x_A}}\) denotes the augmented state vector (more details below), x the unaugmented state vector, \({\varvec{f_{A}}}\) the augmented function containing the dynamics of the system and parameters being inferred, f the original expression for the dynamics of the analyzed system, u the input vector, \({\varvec{F_A}}\) the additive process noise matrix for the augmented system, F the additive process noise matrix for the original system, \({{\varvec{w}}}(t)\) the independent, zero-mean additive white Gaussian noise (AWGN) in the process, \({{\varvec{W}}}_{A}(t)\) the augmented process noise vector, \(\mathbf{\Theta }\) a vector of parameters to be estimated with EKF, y the defined system output, and \({\varvec{g_A}}\) the expression representing the observed output variables. The zeros in Eq. (34) appear because the parameters being estimated are assumed not to be time-varying,

$$\begin{aligned} {\dot{{\varvec{\Theta }}}}=0. \end{aligned}$$
(37)

Equation (36) provides the measurement vector, z, populated by sampling y with a sampling time of \(T_{S}\) at N discrete time steps where \({{\varvec{v}}}(k)\) is the independent, zero-mean AWGN in the measurements and G is the additive measurement noise matrix [35].

The augmented system is a representation of the original dynamical system with the parameters being estimated included in the system’s state vector. The vector of estimated parameters used is,

$$\begin{aligned} {{\varvec{\Theta }}}=\left[ {{\begin{array}{l} {\theta _1 } \\ {\theta _2 } \\ \end{array} }} \right] =\left[ {{\begin{array}{l} \varepsilon \\ {\omega _\mathrm{n} } \\ \end{array} }} \right] \end{aligned}$$
(38)

where Eq. (37) implies that the estimated parameters are not time-varying in a single data set. Therefore, the complete state vector for the analysis with EKF is,

$$\begin{aligned} {\varvec{x_A}} \left( t \right) =\left[ {\begin{array}{l} x_1 \\ x_2 \\ \theta _1 \\ \theta _2 \\ \end{array} } \right] =\left[ \begin{array}{l} x \\ \dot{x} \\ \varepsilon \\ \omega _\mathrm{n} \\ \end{array} \right] \end{aligned}$$
(39)

The EKF algorithm is implemented for parameter estimation using the augmented system defined in Eqs. (34) through (36) and the corresponding state vector provided in Eq. (39). The control input vector, u(t), in Eqs. (34) and (35) is the input force being applied to the undamped Duffing oscillator.

EKF consists of two steps, prediction and update. The development followed for the undamped Duffing oscillator is taken from [35, 38, 39]. A hat accent denotes a corrected value in the update step, and a tilde accent denotes a predicted value in the extrapolation stage. The extrapolation stage is defined with the following calculations,

$$\begin{aligned} {\varvec{\tilde{x}_A }}\left( k \right)= & {} {\varvec{\hat{x}_A }}\left( {k-1} \right) + \int \nolimits _{t({k-1})}^{t(k)} {\varvec{f_A}} \left( {{\varvec{\hat{x}_A}} \left( t \right) ,{\varvec{\bar{u}}} \left( k \right) } \right) dt\nonumber \\ \end{aligned}$$
(40)
$$\begin{aligned} {\varvec{\tilde{P}_A}} \left( k \right)\approx & {} {\varvec{\Phi _A}} \left( k \right) {\varvec{\hat{P}_A}} \left( {k-1} \right) {\varvec{\Phi _A^T}} \left( k \right) +{\varvec{T_s F_A F_A^T}}\nonumber \\ \end{aligned}$$
(41)

where \({\varvec{\Phi _A}} \left( k \right) \) denotes a discrete time state-transition matrix for the system at the discrete time step k, \({\varvec{P_A }}\) the error covariance matrix, and \(\bar{\mathbf{u}}\) the input value interpolated between \(t(k-1)\) and t(k) [35, 38, 39]. The predicted state of the system is calculated with Eq. (40) by using the corrected state estimation from the previous time step and extending it to the next time step through integration of the known dynamics from the previous time step to the current. Equation (41) is a linear approximation of the error covariance matrix for small \(T_{S}\), which neglects higher-order terms and implies the EKF is a non-optimal approximation of KF for a nonlinear system [35, 40]. The discrete time state-transition matrix of the augmented system is defined as,

$$\begin{aligned} {\varvec{\Phi _A}} \left( k \right) ={\varvec{e}}^{{{\varvec{A}}_{{\varvec{A}}}} \left( k \right) T_s} \end{aligned}$$
(42)

where \({\varvec{A_A}}(k)\) is the linearized state matrix for the augmented system,

$$\begin{aligned} {\varvec{A_A}} \left( k \right) =\left. {\frac{\partial {\varvec{f_A}} }{\partial {\varvec{x_a}} }} \right| _{{\varvec{x_A}} ={\varvec{\hat{x}_A}} \left( {k-1} \right) } =\left. {\left[ {{\begin{array}{ll} {\frac{\partial {\varvec{f}}}{\partial {\varvec{x}}}}&{}\quad {\frac{\partial {\varvec{f}}}{\partial {{\varvec{\Theta }}}}} \\ 0&{}\quad 0 \\ \end{array} }} \right] } \right| _{{\varvec{x_A}} ={\varvec{\hat{x}_A}} \left( {k-1} \right) } \end{aligned}$$
(43)

The complete expression for the linearized state matrix of the augmented system consisting of the undamped Duffing oscillator and associated parameters is found in Eq. (A1) in Appendix.

Fig. 12
figure 12

Approximation of a the nonlinear coefficient and b linear natural frequency of an undamped Duffing oscillator with EKF (\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =0.01\hbox { }1/(\hbox {m}^{2}\,\hbox {s}^{2})\), \(F_{0}=50~\hbox {N}\))

The update stage is defined with the following calculations,

$$\begin{aligned} {\varvec{\tilde{y} }}\left( k \right)= & {} {\varvec{g_A}} \left( {\varvec{\tilde{x}_A} \left( k \right) ,{\varvec{u}}\left( k \right) } \right) \end{aligned}$$
(44)
$$\begin{aligned} {\varvec{K_A}} \left( k \right)= & {} {\varvec{\tilde{P}_A}} \left( k \right) {\varvec{C_A^T}} \left( k \right) [ {\varvec{C_A}} \left( k \right) {\varvec{\tilde{P}_A}} \left( k \right) {\varvec{C_A^T}} \left( k \right) \nonumber \\&+{\varvec{GG}}^{T} ]^{-1} \end{aligned}$$
(45)
$$\begin{aligned} {\varvec{\hat{x}_A}} \left( k \right)= & {} {\varvec{\tilde{x}_A}} \left( k \right) + {\varvec{K_A}} \left( k \right) \left[ {{\varvec{z}}\left( k \right) -{\varvec{\tilde{y}}}\left( k \right) } \right] \end{aligned}$$
(46)
$$\begin{aligned} {\varvec{\hat{P}_A }}\left( k \right)= & {} \left[ {{\varvec{I-K_A}} \left( k \right) {\varvec{C_A}} \left( k \right) } \right] {\varvec{\tilde{P}_A }}\left( k \right) [ {\varvec{I}}\nonumber \\&-{\varvec{K_A}} \left( k \right) {\varvec{C_A}} \left( k \right) ]^{T}+{\varvec{K_A}} \left( k \right) {\varvec{GG}}^{T}{\varvec{K_A}}^T \left( k \right) \nonumber \\ \end{aligned}$$
(47)

where the output of the undamped Duffing oscillator model is defined as the position and velocity [35]. Equation (44) is used to calculate the predicted output variables that are compared to measurements. The Kalman gain in Eq. (45) is the linear filter gain that minimizes the mean square error between the predicted output and measured data using Eq. (46) to arrive at the corrected state values [41]. Equation (47) updates the value of the error covariance matrix for the extrapolation stage in the next time step based on the current Kalman gain. The \({\varvec{C_A}}\) in Eqs. (45) and (47) is the linearized output matrix,

Fig. 13
figure 13

EKF mitigation of severe parameter variations on TSCS effectiveness [\(\omega _\mathrm{n}=2~\hbox {rad/s}\), \(\varepsilon =0.01\hbox { }1/(\hbox {m}^{2}\,\hbox {s}^{2})\), \(F_{0}=50~\hbox {N}\)]

$$\begin{aligned} {\varvec{C_A}} \left( k \right) =\left. {\frac{\partial {\varvec{g_A}} }{\partial {\varvec{x_a}} }} \right| _{x_A ={\varvec{\tilde{x}_A}} \left( k \right) } =\left[ {{\begin{array}{llll} 1&{}\quad 0&{}\quad 0&{}\quad 0 \\ 0&{}\quad 1&{}\quad 0&{}\quad 0 \\ \end{array} }} \right] \end{aligned}$$
(48)

where \({\varvec{C_A}}\) has the simple representation given because the output vector is defined as the position and velocity of the oscillator. To implement this approach, several values must be defined, such as the initial value for \({\varvec{P_A}}\) as well as the values for F and G. The initial definition of \({\varvec{P_A}}\) is a representation of the confidence in initial state estimates. \({{\varvec{FF}}}^{T}\) and \({{\varvec{GG}}}^{T}\) are the process and measurement covariance matrices, respectively. The measurement covariance matrix is calibrated based on the sensors and measurements taken, but trial and error or an adaptive filtering technique may be required to define the process covariance matrix [35].

Figure 12a, b shows the result of applying EKF for parameter estimation with the output and input case representing an unshaped input before the application of TSCS. Defining an original error of 200% on both the nonlinear coefficient and linear natural frequency, EKF converges to values that are adequate to implement with TSCS. Figure 12a shows the convergence of the nonlinear coefficient of the Duffing oscillator, where the converged value is 0.0095. The converged value for the nonlinear coefficient has an error of less than 4.5%. The initial value of \({\varvec{P_A}}\) offers the user a choice between the competing goals of convergence speed and overshoot of the parameters from initial values. If the estimates converge, the final values obtained from applying EKF to data set are satisfactory for TSCS implementation.

Figure 12b shows the convergence of the linear natural frequency. In addition to the convergence of the nonlinear coefficient, the linear natural frequency converged to 1.991, which gives the estimate an error of 0.4%. Using EKF to estimate the linear natural frequency of the oscillator serves as an alternative to robust command shaping. Applying TSCS with the converged parameter values significantly improves the strategy’s effectiveness. Figure 13 presents the effect of mitigating a variation in the natural frequency and nonlinear coefficient with EKF. TSCS applied with EKF reduces the residual vibration to 3.92% of the value observed with a 100% increase in the nonlinear coefficient and natural frequency.

6 Conclusions

The present paper has demonstrated the effectiveness of TSCS for reducing residual vibrations in a commanded nonlinear system. Specifically, the TSCS strategy was applied to several variants of the Duffing equation and compared to direct command shaping approaches employing linear and nonlinear response frequencies. In all cases considered, TSCS outperforms the direct input shaping methods. Due to the use of scale separation and command shaping of a linear subsystem, TSCS avoids large residual vibrations observed in the direct approaches, these vibrations being exacerbated by large input commands, strong nonlinearities, and negative command impulses. A small drawback to the TSCS strategy is a noticeable discrepancy between the desired and achieved response amplitude, especially for highly nonlinear systems. This can be effectively mitigated, however, through either online or offline feedback control. Finally, in nonlinear systems with uncertainties, robust input shaping and the extended Kalman filtering technique have been shown to effectively mitigate residual vibrations resulting in mismatches in expected and actual system parameters (e.g., linear natural frequency and nonlinear coefficients).