# Optimization-Based Input-Shaping Swing Control of Overhead Cranes
## 4 Design of Adaptive Input Shaper
### Adaptive Adjustment of Shaper Parameters  
Assume that the original output shaper \(H\) is a sequence of \(K+1\) pulses, expressed as \(\mathbf{h}=[h_{0}h_{1}\cdots h_{K}]^{\mathrm{T}}=[h(0)h(1)\cdots h(K)]^{\mathrm{T}}\), and the corresponding time is an integral multiple of the sampling time \(T_{s}\). Among these pulses, there are only \(D\) nonzero pulses, denoted as \(\mathbf{A}=\{A_{1},A_{2},\cdots,A_{D}\}\) and \(\mathbf{t}=\{t_{1},t_{2},\cdots,t_{D}\}\). Hence, the discrete expression of \(H\) can be expressed as (19):  
\[H(z)=\sum\limits_{k=0}^{K}h_{k}z^{-k}=\sum\limits_{d=0}^{D}A_{d}z^{-t_{d}} \tag{19}\]  
Let the transfer function of the swing dynamics be \(G(z)=\sum\limits_{k=1}^{\infty}g(kT_{s})z^{-k}=g(1)z^{-1}+g(2)z^{-2}+\cdots\), so the control \(u\) at time \(m\) and the system output \(y=\theta\) at time \(n\) can be obtained using (20) and (21), respectively:  
\[u(m)=\sum\limits_{l=m-K}^{m}h(m-l)r_{a}(l) \tag{20}\]  
\[y(n)=\sum\limits_{m=0}^{n}g(n-m)u(m) \tag{21}\]  
As shown in Figure 9, the shaper \(H^{\prime}\) shapes the output \(\theta\) to obtain \(z=uGH^{\prime}\). In addition, the equation \(HG=GH^{\prime}\) holds (the output residual vibrations are expected to be zero after \(K\) iterations), and then the parameter optimization of the shaper \(H\) can be transformed into an iterative optimization of the shaper \(H^{\prime}\). The residual vibration of the output \(z\) at time \(l\) is shown in (22):  
\[z(l)=\sum\limits_{n=l-K}^{l}\sum\limits_{m=0}^{n}h(l-n)g(n-m)u(m) \tag{22}\]  
According to the response of the control action, \(z(l)\) can be divided into two parts. The first part \(z_{0}(l)\) is the response accumulation of \(GH\) from 0 to \(K\), and the second part  
Figure 9: Structure of adaptive input-shaping control system. \(z_{r}(l)\) is the response accumulation from \(K\) to \(l\), that is, the residual vibration of the system. Concretely, \(z_{0}(l)\) and \(z_{r}(l)\) are shown in (23) and (24):  
\[z_{0}(l)=[u(l)u(l-1)\cdots u(l-K)]\boldsymbol{f}^{\boldsymbol{\rho}} \tag{23}\]  
\[z_{r}(l)=[u(l-K+1)u(l-K+2)\cdots u(0)]\boldsymbol{f}^{\boldsymbol{\epsilon}} \tag{24}\]  
where  
\[\boldsymbol{f}^{\boldsymbol{\rho}}= \begin{bmatrix}g(0)&0&\cdots&0\\ g(1)&g(0)&\cdots&0\\ \vdots&\vdots&\vdots&\vdots\\ g(K)&g(K-1)&\cdots&g(0)\end{bmatrix} \boldsymbol{h} \tag{25}\]  
\[\boldsymbol{f}= \begin{bmatrix}g(K+1)&g(K)&\cdots&g(1)\\ g(K+2)&g(K+1)&\cdots&g(2)\\ \vdots&\vdots&\vdots&\vdots\\ g(l)&g(l-1)&\cdots&g(l-K)\end{bmatrix} \boldsymbol{h} \tag{26}\]  
In (24), if \(z_{r}(l)=0\), no matter what \(u\) is, \(\boldsymbol{f}^{\prime}\) must be a zero vector. Denote \(\mathbf{Z}_{r}=[z_{r}(K+1)\cdots z_{r}(N)]\), and then it can be given as  
\[\mathbf{Z}_{r}=\mathbf{Q}_{N}\boldsymbol{f}^{\boldsymbol{\epsilon}}=\mathbf{ Y}_{N}\boldsymbol{h}-\boldsymbol{U}_{N}\boldsymbol{f}^{\boldsymbol{\rho}}=0 \tag{27}\]  
where  
\[\mathbf{Q}_{N}= \begin{bmatrix}u(0)&0&\cdots&0\\ u(1)&u(0)&\cdots&0\\ \vdots&\vdots&\vdots&\vdots\\ u(N-K-1)&u(N-K-2)&\cdots&u(0)\end{bmatrix}  \tag{28}\]  
\[\mathbf{Y}_{N}= \begin{bmatrix}y(K+1)&y(K)&\cdots&y(1)\\ y(K+2)&y(K+1)&\cdots&y(2)\\ \vdots&\vdots&\vdots&\vdots\\ y(N)&y(N-1)&\cdots&y(N-K)\end{bmatrix}  \tag{29}\]  
\[\mathbf{U}_{N}= \begin{bmatrix}u(K+1)&u(K)&\cdots&u(1)\\ u(K+2)&u(K+1)&\cdots&u(2)\\ \vdots&\vdots&\vdots&\vdots\\ u(N)&u(N-1)&\cdots&u(N-K)\end{bmatrix}  \tag{30}\]  
In (27), \(\mathbf{Q}_{N}\), \(\mathbf{Y}_{N}\), and \(\mathbf{U}_{N}\) can be measured, while \(\boldsymbol{f}^{\boldsymbol{\rho}}\) cannot be measured, so the following deformation needs to be performed:  
\[