# Levitating Control System of Maglev Ruler Based on Active Disturbance Rejection Controller
## 3 A Levitating Control System Based on Active Disturbance Rejection
### Design of Active Disturbance Rejection Controller for Levitating Control System
\(b_{z}\) and \(b_{p}\) in Equation (55) are the control parameters of control variables \(i_{a}\) and \(i_{b}\). \(i_{a}=i_{3}-i_{1}\), \(i_{b}=i_{4}-i_{2}\). \(i_{1}\), \(i_{2}\), \(i_{3}\), \(i_{4}\) are the currents of the four levitating coils. Let \(\Delta i_{a}\) and \(\Delta i_{b}\) be the changes of \(i_{a}\) and \(i_{b}\), respectively, then:  
\[\left\{ \begin{array}{l}i_{a}+\Delta i_{a}=(i_{3}+\frac{\Delta i_{a}}{2})-(i_ {1}-\frac{\Delta i_{a}}{2})\\ i_{b}+\Delta i_{b}=(i_{4}+\frac{\Delta i_{b}}{2})-(i_{2}-\frac{\Delta i_{b}}{2} )\end{array} \right. \tag{57}\]  
After compensation, Equation (55) can be rewritten as:  
\[\left\{ \begin{array}{l}\frac{\partial^{2}z_{a}}{\partial t^{2}}=i_{a}^{*}\\ \frac{\partial^{2}w}{\partial t^{2}}=i_{b}^{*}\end{array} \right. \tag{58}\]  
After compensation, \(z_{a}\) and \(\psi\) are decoupled and controllable. Taking \(z_{a}\) as an example, it can be seen from Equation (53) that the system controls \(z_{a}\) through \(i_{a}\). However, changes in \(i_{a}\) also cause changes in \(\psi\), resulting in coupling. In Equation (55), after parameter adjustment, \(i_{a}\) becomes part of the equivalent disturbance of \(w_{p}(t)\), which is then observed and compensated by ESO. Similarly, controlling the other degree of freedom, \(i_{b}\), also causes changes in \(z_{a}\). In Equation (55), after parameter adjustment, \(i_{b}\) becomes part of the equivalent disturbance of \(w_{z}(t)\), and then ESO observes and compensates it. The ESO of the levitating system is as follows [2]:  
\[\left\{ \begin{array}{l}e(n)=z_{1}(n)-y_{z}(n)\\ z_{1}(n+1)=z_{1}(n)+h[z_{2}(n)-\beta_{c1}e(n)]\\ z_{2}(n+1)=z_{2}(n)+h\{z_{3}(n)-\beta_{c2}fal[e(n),a_{1},\delta]+\\ b_{0}u_{z}(n)\}\\ z_{3}(n+1)=z_{3}(n)-h\beta_{c3}fal[e(n),a_{2},\delta]\end{array} \right. \tag{59}\]In the equation:  
\[fal(e,a_{j},\delta)=\left\{ \begin{array}{ll}|e|^{a_{j}}sign(e)&|e|>\delta\\ \frac{e}{\delta^{-1}-j}&|e|\leq\delta\end{array} \right.\]  
In the equation: \(z_{1}(n)\), \(z_{2}(n)\), and \(z_{3}(n)\) are the state variables of the ESO, \(z_{1}(n)\) and \(z_{2}(n)\) are used to trace the state variables of the levitating system, and \(z_{3}(n)\) is used to trace the state variables of the total disturbance; \(\beta_{e1}\), \(\beta_{e2}\), and \(\beta_{e3}\) are the gains of the ESO. \(a_{1}\) and \(\delta\) are undetermined parameters. If \(a_{j}\) is less than 1, the function has nonlinear characteristics; \(\delta\) represents the linear range, aiming to avoid oscillation caused by large gain with minimal error. 3. Nonlinear error feedback control law (NLSEF)  
In this paper, the levitating control system adopts the following form of NLSEF [2]:  
\[\left\{ \begin{array}{ll}e_{1}(n+1)=w_{1}(n+1)-z_{1}(n+1)\\ e_{2}(n+1)=w_{2}(n+1)-z_{2}(n+1)\\ u_{0}(n+1)=\beta_{f1}fal[e_{1}(n+1),a_{3},\delta_{f1}]+\\ \beta_{f2}fal[e_{2}(n+1),a_{4},\delta_{f1}]\end{array} \right. \tag{60}\]  
In the equation, \(e_{1}(n)\) and \(e_{2}(n)\) are the deviations and derivatives between the expected transition process and the estimated value of the system output; \(a_{2}\), \(a_{3}\), and \(\delta_{f1}\) are the relevant parameters of _full_; \(u_{0}\) is the output of NLSEF; \(b_{0}\) is the compensation coefficient. 4. Interference compensation [2]  
Use ESO to track the variable \(z_{3}(n)\) expanded from the original system. Use the control variable to compensate for the disturbance. The control variable is:  
\[u(n+1)=\frac{u_{0}(n+1)-z_{3}(n+1)}{b_{0}} \tag{61}\]  
After a large number of simulation experiments and prototype testing experiments [2], this paper summarizes the parameter tuning method for the levitating control system:  
1. Parameter tuning of TD. There are three parameters in TD that need to be tuned, namely \(r\), \(h_{0}\), and \(h\). \(r\) is the tracking factor. The tracking factor determines the speed at which \(w_{1}(n)\) and \(w_{2}(n)\) track the \(z_{4}\) given signal. The larger the tracking factor, the faster the tracing speed and the steeper the tracking curve.