## 3 Control Method
 \tag{5}\]  
where \(A_{11}\) and \(A_{22}\) are 2 \(\times\) 2 coefficient matrices; \(B\) is a 4 \(\times\) 2 coefficient matrix; \(C\) is a 2 \(\times\) 4 coefficient matrix. According to the mathematical expression of current stiffness coefficient and displacement stiffness coefficient, as the levitation gap increases, \(k_{81}\) and \(k_{82}\) decrease first and then increase. When \(\delta_{1}\) > 7.702 and \(\delta_{2}\) > 7.702 the values of \(k_{81}\) are always negative. When \(\delta_{1}\) > 0 and \(\delta_{2}\) > 0 the values of \(k_{i1}\) and \(k_{i2}\) are always positive. Furthermore, the values of \(k_{8}\) - \(k_{1}\) is always less than zero within the set levitating range. Due to the size of the ball, both \(\delta_{1}\) and \(\delta_{2}\) are greater than 8 mm. According to the Routh Stability Criterion, for the magnetic levitation actuation and motion control system, which is a natural open-loop unstable system, a first term (differential term) must be added to enable the system to achieve stable control. According to the control models and stability control requirements of the second-order system, neural network PID control is adopted by the magnetic levitation actuation and motion control system actuated, the principles of which are based on force imbalance control theory. The system control block diagram is shown in Figure 4. The proposed controller is a PID controller with adjustable parameters that are determined by neural network. The PID controller is formulated as:  
\[u(t)=k_{p}e(t)+k_{i}\int\limits_{0}^{t}e(t)dt+k_{d}\frac{de(t)}{dt} \tag{6}\]  
Figure 4: System control block diagram. The derivative is replaced by the backward difference, and the integral is replaced by the sum of the rectangular areas. The state model of the PID controller is:  
\[u(k)=k_{p}e(k)+k_{i}T\sum\limits_{j=0}^{k}e(j)+k_{d}[e(k)-e(k-1)] \tag{7}\]  
where \(e(k)=\delta-\delta_{\rm d}\), \(\delta\) is the current position value of ball, \(\delta_{\rm d}\) is the desired position value of ball; \(k\) denotes the current state; \(u(k)\) is the output of neural network PID controller, the physical meaning of which is current \(i(k)\) of electromagnetic actuator; \(k-1\) denotes the previous state; \(K_{\rm p}\), \(K_{\rm i}\) and \(K_{\rm d}\) represent the adjustment coefficients of the control system, that is, the proportional, integral, and differential coefficients of the neural network PID controller, respectively; \(T\) denotes time constant. According to the structure of the neural network PID controller, the input equation of controller [26; 27] is:  
\[ \begin{array}{l}x_{1}(k)=e(k)\\ x_{2}(k)=T\sum\limits_{j=0}^{k}e(j)\\ x_{3}(k)=\left[e(k)-e(k-1)\right]/T\end{array}  \tag{8}\]  
The simplified output equation is:  
\[u(k)=w_{1}(k)x_{1}(k)+w_{2}(k)x_{2}(k)+w_{3}(k)x_{3}(k) \tag{9}\]  
where \(w_{\rm i}(k)\) denotes the weighting coefficients of the neuron input \(x_{\rm i}(k)\), i.e., the proportional coefficient \(k_{\rm p}\), integral coefficient \(k_{\rm i}\) and differential coefficient \(k_{\rm d}\) in (7). These adjustment coefficients are adjusted by the gradient descent algorithm of neuron weight correction, and the adjustment law is:  
\[ \begin{array}{l}w_{1}(k)=w_{1}(k-1)+\eta e(k)x_{1}(k)\frac{\partial\delta(k+1 )}{\partial u(k)}\\ w_{2}(k)=w_{2}(k-1)+\eta e(k)x_{2}(k)\frac{\partial\delta(k+1)}{\partial u(k)} \\ w_{3}(k)=w_{3}(k-1)+\eta e(k)x_{3}(k)\frac{\partial\delta(k+1)}{\partial u(k)} \end{array}  \tag{10}\]  
where \(\eta\) denotes the learning rate, and \(0<\eta<1\); in general, \(\partial\delta(k+1)/\partial u(k)\approx(\delta(k+1)-\delta(k))/(u(k)-u(k-1))\) represents an important coefficient that determines the adjustment direction of the weighting coefficient.