# Modeling magnetic levitation system with current as the input signal

I am exploring magnetic levitation system as a part of studying control system. The height of the ball levitating in a magnetic field is described by the following differential equation

$$m\frac{d^2H}{dt^2} = mg-K\frac{I^2}{H^2}$$

And I got the following non-linear state-space equations for the system

$$\begin{bmatrix}\dot{x_1} \\ \dot{x_2} \\ \dot{x_3}\end{bmatrix} = \begin{bmatrix}x_2 \\ g-\frac{K}{m}(\frac{x_3}{x_1})^2 \\ -\frac{R}{L}x_3+\frac{2K}{L}\frac{x_2x_3}{x_1^2}\end{bmatrix}$$

And upon linearization, I got the following state-space paramters.

$$A = \begin{bmatrix}0 & 1 & 0\\\frac{Kx_{03}^2}{mx_{01}^3} & 0 & \frac{-2Kx_{03}}{mx_{01}^2}\\0 & \frac{2Kx_{03}}{Lx_{01}^3} & -\frac{R}{L}\end{bmatrix}$$

$$B = \begin{bmatrix}0 \\ 0 \\ \frac{1}{L}\end{bmatrix}$$

$$C = \begin{bmatrix}1 & 0 & 0 \\ \end{bmatrix}$$

$$D = \begin{bmatrix}0 \end{bmatrix}$$

In the above equation $$x_{01},x_{02},x_{03} = H, v, I$$ at equilibrium. H is the height of the ball and v is the velocity and I is the current.

However, in the above equations, current is not treated as the input signal but the voltage provided to electromagnet is taken as the input signal and the inductance and resistance of the electromagnets are also taken into account.

My doubt is how do I find the state-space equations and A, B, C, D when parameters like input voltage, inductance and resistance are ignored and the current is taken as input signal. How will each of the above steps change in such a case?

The above values of A, B, C, D will result in a transfer function with a cubic polynomial in denominator. What I basically want is a simplified one with transfer function of the form $$\frac{A}{s^2-b^2}$$

Well, if your system is described by $$m\frac{d^2H}{dt^2} = mg-K\frac{I^2}{H^2}.$$

With the state $$x := \begin{bmatrix}H \\ \dot{H}\end{bmatrix}$$ we have that $$\dot{x} = \begin{bmatrix}\dot{H} \\ g-K\frac{I^2}{mH^2}\end{bmatrix}.$$

For any $$\h>0\$$ the point $$\x_{eq} = \begin{bmatrix} h \\ 0\end{bmatrix}\$$ will be an equillibrium, since $$\\forall h>0 \$$ we can have $$\ I_{eq} := \sqrt{\frac{mgh^2}{K}}\$$ to make $$\\dot{x}=0\$$. So we have the following description for small perturbations $$\z\$$ around that equilibrium, and small inputs $$\v\$$ that are added to $$\I\$$ as $$I := \sqrt{\frac{m(gh^2+v)}{K}},$$ then we will have $$\dot{z} = \begin{bmatrix} z_2 \\ g-K \frac{m(gh^2+v)}{K} \frac{1}{m(h+z_1)^2}\end{bmatrix},$$ $$\dot{z} = \begin{bmatrix} z_2 \\ g- \frac{gh^2+v}{(h+z_1)^2}\end{bmatrix}.$$

Now, linearize around that: \begin{align} A &:= \frac{\partial \dot{z}}{\partial z} \Big\vert_{z_1=0,\, v = 0 } = \begin{bmatrix} 0 & 1 \\ \frac{2 \left(g h^{2} + v\right)}{\left(h + z_{1}\right)^{3}} & 0\end{bmatrix}\Big\vert_{z_1=0,\, v = 0 } = \begin{bmatrix} 0 & 1 \\ \frac{2 g h^{2}}{h^{3}} & 0 \end{bmatrix}= \begin{bmatrix} 0 & 1 \\ \frac{2 g}{h} & 0 \end{bmatrix}. \\ B&:= \frac{\partial \dot{z}}{\partial v}\Big\vert_{z_1=0,\, v = 0 } = \begin{bmatrix} 0 \\ -\frac{1}{\left(h + z_{1}\right)^{2}} \end{bmatrix}\Big\vert_{z_1=0,\, v = 0 } = \begin{bmatrix} 0 \\ -\frac{1}{h^2} \end{bmatrix}. \end{align}

The output matrix $$\C\$$ will depend on your sensors, but I will assume that you are measuring the height. And changes to the input current will not affect instantaneously the output, so

\begin{align} C&:= \begin{bmatrix} 1 & 0 \end{bmatrix},\\ D&:= 0. \end{align} And that way you get the linearized system

\begin{align} \dot{z} &= Az +Bv, \\ Y &= Cz. \end{align}