Control of Magnetic Levitation System
Control of Magnetic Levitation System
1. Objectives
Magnetic levitation (MAGLEV) system consists of the stabilization problem for a steel ball of
mass 𝑀𝑏 in a specific position 𝑥𝑏 under the gravitational and magnetic attraction forces. The
purpose of the MAGLEV experiment is to design a control system that levitates a solid steel
ball in air from the post using an electromagnet. The designed controller can then track the
ball position to a desired trajectory by providing the specified criteria. For this purpose, it is
required to obtain mathematical model of the system. Since the obtained model is not linear,
linearization process is required near an equilibrium point. After that it is expected to design a
state-feedback controller with integrator that provides desired performance. Besides, in order
to bring the steel ball to the equilibrium point, a feed-forward structure will be used and also
feed-forward gain will be calculated.
2. Prerequisites
• Modeling of electrical and mechanical systems
• Knowledge of linearization techniques
• State-space representation of dynamical systems
• Root-locus method
• Stability analysis in state-space
• State-feedback controller design
• Investigation of state-feedback controller with integrator
• Linearity, controllability, observability concepts
are prerequisites which are required to carry out the experiment successfully.
Each student should prepare a pre-report which is written in student’s own handwriting
and consists of the answers of following questions. It is required to deliver pre-reports to
the research assistant at least 1 day before the experiment. Students who did not prepare
a pre-report or prepared a poor report will not be able to attend the laboratory. Grade of
the pre-report must be at least 50/100 to attend the laboratory.
Pre-Report Questions:
2. Figure 2 shows the representation of magnetic levitation system. Using this figure,
write the differential equation for the electrical sub-system and obtain the transfer
𝐼 (𝑠)
function 𝑇𝑒 (𝑠) = 𝑉𝑐 (𝑠) with the help of the Laplace Transform.
𝑐
3. Write the equation of motion for the magnetic levitation system in 𝑥𝑏̈ = 𝑓(𝑥𝑏 , 𝑖𝑐 )
format by applying Newton's 2nd law of motion (∑ 𝐹 = 𝑚𝑎) to the steel ball.
6. Obtain the linear state space model of the MAGLEV system using the differential
equations related to electrical sub-system and motion of steel ball (Hint: Use ∆𝑥𝑏 ,
∆𝑥𝑏̇ and ∆𝑖𝑐 as state variables).
8. While the system is operating in an equilibrium point, response of the system to the
±1 mm square wave position reference is expected to provide performance criteria
given below. Calculate the state-feedback gain matrix (K) by using Ackermann
formula (Place the non-dominant pole of the system to the point of -200).
• Overshoot < 5%
• Settling Time < 2 seconds
9. What changes should be done in the classic state-feedback structure if the steady-
state error for the closed-loop system is expected to be 0? Draw the proposed block
diagram.
10. Calculate the feed-forward gain, which is added to the control system, by using the
formula (5.13).
NOTE: All system parameter are given in Table 2. However, value of the operating point
𝒙𝒃𝟎 should be taken as follows (Here 𝒏𝟎 is the last digit of the student number and 𝒏𝟏 is
the penultimate digit of the student number):
In the laboratory, MATLAB and Mathematica software packages will be used during both of
the modeling, analysis and controller design phases. Control of the MAGLEV system will be
carried out through MATLAB–Simulink. In order to collect the current and position data from
the system and to send the control signal to the system, Q2-USB data acquisition card (Figure
3) will be used.
Number Definition
Control signal cable from the data acquisition card to the
1
amplifier
Power cable from the amplifier to the MAGLEV coil to
2
supply power to the coil
Cable from the amplifier to the data acquisition card to
3
transmit current and position data
Cable from the MAGLEV system to the amplifier to
4
transmit position data
Cable from the MAGLEV system to the amplifier to
5
transmit current data
4. Modeling of the System
In this section, it is aimed to obtain state-space model of the MAGLEV system. Taylor series
expansion will be used to linearize the system to be able to obtain linear model since the
system consists of the terms which are not linear.
Firstly, if the differential equation for the electrical sub-system is written, we get:
𝑉𝑐 = ………………… (4.1)
If the Newton's 2nd law of motion is applied to the steel ball which stands balanced in the air
under the gravitational and magnetic attraction, we get:
∑ 𝐹 = 𝑀𝑏 𝑎𝑏 (4.2)
𝐹𝑔 − 𝐹𝑚 = 𝑀𝑏 𝑥𝑏̈ (4.3)
Equations for the forces of gravity and magnetic attraction are given as follows.
𝐹𝑔 = 𝑀𝑏 𝑔 (4.4)
1 𝐾𝑚 𝐼𝑐2
𝐹𝑚 = (4.5)
2 𝑥𝑏2
If these expressions are substituted in equation (4.3), we obtain the following equation.
As it is seen from the equation (4.6), magnetic levitation system has a nonlinear characteristic.
While the system is operating in an equilibrium point 𝑥𝑏0 , it is possible to calculate the coil
current 𝐼𝑐0 as follows.
In order to obtain linear model of the system, equation (4.6) can be linearized by using Taylor
series expansion. Formula for the Taylor series expansion is given below.
𝜕 𝜕
𝑓(∆𝑥𝑏 , ∆𝐼𝑐 ) = 𝑓(𝑥𝑏0 , 𝐼𝑐0 ) + 𝑓(𝑥𝑏0 , 𝐼𝑐0 )∆𝑥𝑏 + 𝑓(𝑥𝑏0 , 𝐼𝑐0 )∆𝐼𝑐 (4.9)
𝜕𝑥𝑏 𝜕𝐼𝑐
If the expression for 𝐼𝑐0 , which is found in (4.8), is substituted in the equation (4.10) and some
necessary simplifications are done, linearized expression for the equation of motion is
obtained as follows.
Lastly, state-space model of the system can be obtained using the differential equation for the
electrical sub-system and linearized equation of motion.
The standard state-space representation of a system given as follows.
𝒙̇ = 𝑨𝒙 + 𝑩𝒖
(4.12)
𝒚 = 𝑪𝒙 + 𝑫𝒖
Here, state variables can be chosen as deviation of the steel ball position (∆𝑥𝑏 ), deviation of
the steel ball velocity (∆𝑥𝑏̇ ) and deviation of the coil current (∆𝐼𝑐 ) for the state-space
representation of the system.
𝑥1 = ∆𝑥𝑏
𝑥2 = ∆𝑥̇ 𝑏
𝑥3 = ∆𝐼𝑐
If values of the system parameters are substituted in (4.13), we obtain the state-space model of
the system as below.
𝑥1̇ 𝑥1
(𝑥2̇ ) = (𝑥2 ) + 𝑉𝑐
𝑥3̇ 𝑥3
( ) ( )
(4.14)
𝑥1
𝑦= ( ) (𝑥2 )
𝑥3
It is possible to analyse system stability through the state-space model of the system. In order
to analyse a system, eigenvalues of the system matrix A (also means places of system poles in
s-domain) should be investigated. If real parts of the all eigenvalues are negative, then system
is said to be stable but if any of the eigenvalue has a positive real part, then system is said to
be unstable.
Eigenvalues of a matrix are expressed as 𝜆 values that provide the following equation.
|𝑨 − 𝜆𝑰| = 0 (5.1)
The system under consideration has 3 eigenvalues because the system order is also 3. If these
eigenvalues are calculated by MATLAB, we get:
𝝀𝟏 = …………………
𝝀𝟐 = …………………
𝝀𝟑 = …………………
After that it is possible to comment on the system stability with the help of the eigenvalues of
the system matrix.
Full state feedback or pole placement is a method employed in feedback control system
theory to place the closed-loop system poles in pre-determined locations. In this section, a
controller design will be performed to stabilize the system in a specified equilibrium point 𝑥𝑏0
and while the system is operating in this equilibrium point, to provide desired performance
criteria of response of the system to the ±1 mm square wave position reference.
State-feedback controller with integrator will be used as a controller. In the standard state-
feedback controller structure (Figure 5), all system poles (if all states of the system are
measurable) can be placed to the pre-determined locations which provide specified time-
domain criteria or if there exists states that cannot be measured but observable, by designing
an observer it is still possible to place system poles to the pre-determined locations.
The problem in this structure is that steady-state error may be observed in the closed-loop. In
order to avoid this situation, a pre-gain can be used so that the system will settle to the given
reference. However, it is clear that this structure is not robust under parametric uncertainties
and disturbance effects.
It is possible to add an integrator to the state-feedback controller structure to resolve the
mentioned negativity and even under disturbance effects; steady-state error can be prevented.
Number of the state will increase one because of the integrator in the structure. Figure 6
shows the state-feedback controller structure with integrator.
Figure 6: State-Feedback Controller with Integrator
A new state (𝜀) is appeared because of the integrator added to the structure. Therefore, system
model should be reform. System model which consists of the state-feedback controller with
integrator can be obtained as follows (𝐷 = 0):
𝒙̇ = 𝑨𝒙 + 𝑩𝑢 (5.2)
𝜀̇ = 𝑒 = 𝑟 − 𝑦 = 𝑟 − 𝑪𝒙 (5.3)
In matrix form,
𝒙̇ 𝑨 𝟎 𝒙 𝑩 𝟎
( )=( )( ) + ( )𝑢 + ( )𝑟 (5.4)
𝜀̇ −𝑪 𝟎 𝜀 0 1
𝒙
𝑢 = −(𝑲 𝑣) ( 𝜀 ) (5.6)
𝒙
𝑦 = (𝑪 0) ( 𝜀 ) (5.7)
𝒙∗̇ = 𝑨∗ 𝒙∗ + 𝑩∗ 𝑢 + 𝑭𝑟
𝑦 = 𝑪∗ 𝒙∗ (5.8)
𝑢 = −𝑲∗ 𝒙∗
After that dominant system poles can be placed to the specified locations and so system is
controlled. In this experiment, state-feedback matrix (K) will be calculated by using
Ackermann formula as follows.
Astar = [ ... ... ... ... ; ... ... ... ... ; ... ... ... ... ; ... ... ... ... ]; % A* matrix
Bstar = [ ... ; ... ; ... ; ... ]; % B* matrix
P = [ ... ; ... ; ... ; ... ]; % Desired closed-loop pole locations (4 poles)
Kstar = acker(Astar, Bstar, P); % Calculation of K* matrix
K = [Kstar(1) Kstar(2) Kstar(3)]; % State-feedback matrix
v = Kstar(4); % Integral gain
𝑥1̇ 𝑥1
𝑥2̇ 𝑥2
( )= (𝑥 ) + 𝑉𝑐 + 𝑟
𝑥3̇ 3
𝑥4̇ 𝑥4
( ) ( ) ( )
(5.10)
𝑥1
𝑥2
𝑦= ( ) (𝑥 )
3
𝑥4
Ackermann formula will be used to calculate the K* gain matrix. For this purpose, it is
required to determine the closed-loop system poles.
While the system is operating in an equilibrium point, response of the system to the ±1 mm
square wave position reference is expected to provide performance criteria given below.
• Overshoot < 5%
• Settling Time < 2 seconds
To provide these criteria, closed-loop dominant and non-dominant poles can be placed to the
locations given below.
𝑠1,2 = …………………
(5.11)
𝑠3,4 = …………………
Please note that non-dominant system poles should be placed to the locations where at least
20 – 30 times away from the dominant system poles.
In this case, state-feedback matrix K* which is calculated by MATLAB is given as follows,
𝑲∗ = ( … … … … ) (5.12)
Magnetic levitation system has a nonlinear characteristic and to be able to use linear control
methods, it is required to linearize the system near an equilibrium point. Consequently, it is
also required to operate the system near this equilibrium point so that performance of the
controller does not change much. Otherwise, the designed controller cannot work well or even
can cause the system to be unstable.
Since the steel ball is at the position of 𝑥𝑏 = 0 at the beginning, it is required to bring the steel
ball near the equilibrium point as soon as possible because of the reasons mentioned above.
Feed-forward structure is used to achieve this purpose. Reference signal (𝑥𝑏0 ) which is
applied to the system is multiplied by the feed-forward gain 𝐾𝑓𝑓 and this new signal is added
to the control signal. In this case, the steel ball is brought near the equilibrium point quickly
hence the system starts to operate in the expected region. Feed-forward gain is calculated by
using the following formula.
𝐼𝑐0
𝐾𝑓𝑓 = (𝑅 + 𝑅𝑠 ) (5.13)
𝑥𝑏0 𝑐
Figure 7 shows the state-feedback controller with integrator when the feed-forward structure
is also inserted to the block diagram in Figure 6.
Figure 7: General Block Diagram For the System and Controller Together.
In summary, the system is brought near the equilibrium point quickly with the feed-forward
gain and deviations of the system near this equilibrium point are controlled with the state-
feedback controller with integrator.
6. Real-Time Implementation
Figure 8 shows the Simulink environment to implement the designed state-feedback controller
to the physical system.
As it can be seen from the figure, both of the feed-forward structure, integrator and state-
feedback are used to control the system.
First of all, reference tracking will be OFF at the beginning of the experiment. In this case, it
will be tried to bring the steel ball near equilibrium point and then to stabilize the steel ball
there. After that, reference tracking will be ON so that the steel ball will track the given
square wave reference. It will be observed if the reference tracking of steel ball provides the
specified criteria earlier. If the performance criteria for reference tracking do not match,
reasons will also be discussed.
o Is the system brought to the equilibrium point successfully? ....................
o Is the system stabilized at this point successfully? ....................
o Observed performance criteria for the ±1 mm deviations;
➢ Overshoot: ................ %
➢ Settling Time: ................ seconds
7. Conclusions
At the end of the experiment, it is expected that students have an idea of how to model
magnetic levitation system which has nonlinear characteristics. In addition, the dynamics of
this new state-space control method applied for the system under consideration is expected to
be comprehended and it is also expected students to carry out the idea about other control
methods which can be used for such systems.
In the experiment report, students must explain the operating principles of the system,
catalogue information of system elements and specify all the analytical analysis (formulas
contained preliminary report) in a detailed way. It is required to interpret the results obtained
in each step of the experiment. Furthermore, comparison of the real-time results and
simulation results should be made. It is also required to specify the changes so that the system
can provide the expected criteria.