# Modified Smith Input-Shaper Crane-Controller for Position Control and Sway Reduction
## 2 Dynamics of the Crane  
Figure 1 shows a bridge crane. It consists of the cart of mass \(m_{r}\), which is moved along the x-axis, and the cargo of mass \(m_{p}\) suspended by the ropes, which are modeled with an equivalent rope of length \(l\). The rope's mass and flexibility are neglected.  
In the Cartesian coordinate system, the position of the cargo's center of mass is described by the equation  
\[\mathbf{r}_{p}=\left[x+l\sin(\Phi)\quad l\cos(\Phi)\right]^{T} \tag{1}\]  
To obtain a mathematical model of the crane, the Lagrange function of the mechanical system shown in Figure 1 is formulated  
\[L_{l}\left(\mathbf{r}_{p},\frac{d\mathbf{r}_{p}}{dt},t\right)=W_{kin}-W_{pot} \tag{2}\]  
and the total potential energy of the crane is  
\[W_{pot}=-m_{p}gl\cos(\Phi) \tag{4}\]  
The functional that transforms \(L_{l}\) to scalar value is  
\[J_{l}(\mathbf{r}_{p},t)=\int_{t_{1}}^{t_{2}}L_{l}\bigg{(}\mathbf{r}_{p}(t), \frac{d}{dt}\mathbf{r}_{p}(t),t\bigg{)}dt \tag{5}\]  
By solving the Euler-Laguange equations:  
\[\frac{d}{dt}\frac{\partial L_{l}}{\partial x}-\frac{\partial L_{l}}{\partial x }=f \tag{6}\]  
\[\frac{d}{dt}\frac{\partial L_{l}}{\partial\Phi}-\frac{\partial L_{l}}{ \partial\Phi}=0 \tag{7}\]  
the cargo trajectory \(\mathbf{r}_{p}(t)\) is obtained which minimizes the functional (5). The cargo crane's dynamics is described by this trajectory.  
A mathematical model of a bridge crane with one degree of freedom is obtained by including Equation (2) in the Euler-Lagrange Equations (6) and (7)  
\[\big{(}m_{r}+m_{p}\big{)}\ddot{x}+lm_{p}\ddot{\Phi}=f \tag{8}\]  
\[\ddot{\Phi}+\omega^{2}\Phi=-\frac{1}{l}\ddot{x} \tag{9}\]  
The crane actuator (DC motor) additionally introduces  
\[f=\frac{\omega_{1}}{\omega_{2}}\frac{2K_{v,em}}{D_{cv}}i_{a}, \tag{10}\]  
\[\begin{split} L_{a,em}\frac{di_{a,em}}{dt}=& u_{a,em}-R_{a,em}i_{a,em}\\ &-\frac{\omega_{1}}{\omega_{2}}\frac{2K_{v,em}}{D_{cv}}\frac{dx} {dt},\end{split} \tag{11}\]  
Figure 1: Bridge crane.  
where \(\omega_{1}/\omega_{2}\) is the ratios of the gearboxes, \(L_{u,em}\) is the armature inductance, \(i_{a,em}\) is the armature current, \(u_{a,em}\) is the armature voltage, \(K_{v,em}\) is the voltage constant, \(R_{a,em}\) is the armature resistance, and \(D_{cw}\) is the diameter of cart wheels.  
By substituting Equations (10) and (11) in Equations (8) and (9) and neglecting the impact of the cargo sway on the cart position \(lm_{p}\Phi\), the equation which describes the cart speed dynamics is obtained:  
\[\begin{split}\frac{v_{r}(s)}{u_{em}(s)}=&\frac{ \frac{D_{m}}{2}\frac{\omega_{2}}{\omega_{1}}\frac{1}{K_{v,em}}}{s^{2}T_{a,em}T_ {m,em}+T_{m,em}s+1}\\ &\approx\frac{\frac{D_{m}}{2}\frac{\omega_{2}}{\omega_{1}}\frac{1 }{K_{v,em}}}{T_{m,em}s+1},T_{a,em}<<T_{m,em}\end{split} \tag{12}\]  
where \(T_{m,em}=\int\!R_{a,em}/K_{v,em}^{2}\) is the mechanical time constant, and \(T_{a,em}=L_{a,em}/R_{a,em}\) is the armature constant.  
The position dynamics of the cart is described by equation  
\[G_{PC}(s)=\frac{K_{sm}}{s(T_{m,em}s+1)} \tag{13}\]  
where \(K_{sm}\) is the proportional gain of the position of the cart.