# Passivity-Based Control Design for Magnetic Levitation System
## 4 Passivity-Based Control for Magnetic Levitation System
Then the inductance of the system is \(L(z)=k/2z\), the magnetic energy is \(\lambda^{2}/2L(z)=\lambda^{2}z/k\), so the total energy \(H(\lambda,\,z,\,\dot{z})\) of the system can be written as  
\[H(\lambda,\,z,\,\dot{z})=\frac{\lambda^{2}z}{k}-mgz+\frac{1}{2}m\dot{z}^{2}\]  
where the second term in the formula is potential energy, in this example, the positive direction of \(z\) points downward. The third term in the formula is kinetic energy. Taking the state variable \(x=(\lambda,\,z,\,\dot{z})^{T}\), the energy function can be written as  
\[H(\mathbf{x})=\frac{x_{1}^{2}x_{2}}{k}-mgx_{2}+\frac{1}{2}mx_{3}^{2} \tag{27}\]  
The partial derivative of Equation (27) is as follows  
\[\frac{\partial H}{\partial\mathbf{x}}(\mathbf{x})=\left[\frac{2x_{1}x_{2}}{k},\frac{{x_{1}}^{2}}{k}-mg,mx_{3}\right]^{T} \tag{28}\]  
According to Equation (28), Equation (26) can be organized into a port-controllable Hamilton model, as shown in Equation (7)\[\dot{\mathbf{x}} =[\mathbf{J}(\mathbf{x})-\mathbf{R}(\mathbf{x})]\frac{\partial H}{\partial\mathbf{x}}(\mathbf{ x})+\mathbf{g}(\mathbf{x})\mathbf{u} \tag{29}\] \[= \left( \begin{array}{ccc}0&0&0\\ 0&0&1/m\\ 0&-1/m&0\end{array} \right)-\left( \begin{array}{ccc}R_{0}&0&0\\ 0&0&0\\ 0&0&0\end{array} \right)\right)\frac{\partial H}{\partial\mathbf{x}}(\mathbf{x})+\left( \begin{array}{c}1\\ 0\\ 0\end{array} \right)u\]  
Note that the original system Equation (29) is not a passive system, so the interconnection matrix needs to be configured into  
\[\mathbf{J}_{d}(\mathbf{x})=\mathbf{J}(\mathbf{x})+\mathbf{J}_{a}(\mathbf{x})=\left( \begin{array}{ccc }0&0&\alpha\\ 0&0&1/m\\ -\alpha&-1/m&0\end{array} \right) \tag{30}\]  
where \(\alpha\) provides the coupling of displacement and velocity to the flux linkage, making it a passive system, as discussed in Figure 3 below. In addition, it is also necessary to add \(R_{\alpha}\) to the dissipative matrix to increase the dissipation of energy and improve the response speed, that is  
\[\mathbf{R}_{d}(\mathbf{x})=\mathbf{R}(\mathbf{x})+\mathbf{R}_{a}(\mathbf{x})=\left( \begin{array}{ ccc}R_{0}&0&0\\ 0&R_{\alpha}&0\\ 0&0&0\end{array} \right) \tag{31}\]  
Substituting Equations (30) and (31) into Equation (12) to obtain the partial differential equation of this example is  
\[ \begin{array}{l}\left(\begin{array}{ccc}-R_{0}&0&\alpha\\ 0&-R_{\alpha}&1/m\\ -\alpha&-1/m&0\end{array}\right)\frac{\partial H_{a}}{\partial\mathbf{x}}(\mathbf{x}) \\ =-\left(\begin{array}{ccc}0&0&\alpha\\ 0&-R_{\alpha}&0\\ -\alpha&0&0\end{array}\right)\left(\begin{array}{c}\frac{2x_{1}x_{2}}{k}\\ \frac{x_{1}^{2}-m}{k}-mg\\ mx_{3}\end{array}\right)+\left(\begin{array}{c}1\\ 0\\ 0\end{array}\right)\beta(\mathbf{x})\end{array}  \tag{32}\]  
After Equation (32) is expanded, we obtain  
\[-R_{0}\frac{\partial H_{a}}{\partial x_{1}}+\alpha\frac{\partial H_{a}}{ \partial x_{3}}=-\alpha mx_{3}+\beta(\mathbf{x}) \tag{33}\]  
\[-R_{\alpha}\frac{\partial H_{a}}{\partial x_{2}}+\frac{1}{m}\frac{\partial H_ {a}}{\partial x_{3}}=R_{\alpha}\left(\frac{{x_{1}}^{2}}{k}-mg\right) \tag{34}\]  
\[-\alpha\frac{\partial H_{a}}{\partial x_{1}}-\frac{1}{m}\frac{\partial H_{a}}{ \partial x_{2}}=\frac{2\alpha}{k}x_{1}x_{2} \tag{35}\]  
where Equation (33) can be used to determine the control action \(u=\beta(\mathbf{x})\), Equation (34) and (35) are the partial differential equations that need to be solved. Note that the energy function \(H_{d}(\mathbf{x})\) of the final closed-loop system is a Lyapunov function and there should be no totals for \(x_{1}\) (flux linkage) and \(x_{2}\)(distance), so according to Equation (5), we should use \(H_{a}\) to subtract these two terms of \(H(\mathbf{x})\) [Equation (27)]. According to Equations (34) and (35), it can be known that \(H_{a}(\mathbf{x})\) should also have the following function term \(\Phi\), and use the equality of the left and right terms to solve this system of equations.