Professional Documents
Culture Documents
Module code:
Module name:
Date of submission
Author(s):
Student ID(s):
Degree:
Tutor/Project supervisor:
By submitting this report for assessment I confirm that this assignment is my own work, is not copied
from any other person's work (published or unpublished), and that it has not previously been
submitted for assessment on any other module or course.
I am aware of the University of Leicester’s policy on plagiarism, and have taken the online tutorial on
avoiding plagiarism. I am aware that plagiarism in this project report may result in the application of
severe penalties up to and including expulsion from the University without a degree.
Abstract
1
Control of a magnetic suspension system by modelling the mathematical expression in state
space representation form, we design the state feedback controller to control the vertical
position of ball by adjusting the current or power voltage source. We have to design the
controller with the help of pole placement and the LQR controller approach, this report deals
with the study of the design of controller of the magnetic system by computing the state space
matrix by linearizing the model at the equilibrium point. Using the Simulink model using
both pole placement and LQR controller, we found that the pole placement gives the better
and faster response with the permissible range of y is 0 to 10cm and the permissible range of
voltage is 0 to 50V, we also determine the largest range of initial disturbance from which ball
will return to the equilibrium position without violation of the constraints on y and v which
we found out the disturbance is 7.6cm. we also create the nonlinear closed-loop system
response to study the effect of 20% parameter variation from the nominal values for all the
parameters as well as the effect of the current protection circuit which will set the current
values to zero if the current goes beyond the 5A.
Table of Content
2
Content Page No.
1. Introduction 4
1.1 Background 4
2. Method 5
2.1 State space Model 5
2.2 State Feedback controller 6
2.3 Controller Design 7
2.4 Simulink Model 10
3. Result 12
4. Discussion 27
5. Conclusion 28
1. Introduction
3
In this project we are going to design and model the magnetic suspension system for the ball
which is controller by adjusting the current in the electromagnet which can be manipulated by
adjusting the power voltage source, the position of the ball is measure with the help of optical
sensor which help to maintain the desired position of the ball, to control the ball we develop
the state feedback controller to stabilize the ball within the permissible range of position of
ball and voltage which is from 0 to 50V. the typical diagram of the Magnetic suspension
system is shown below.
4
was designed using this approach [6]. For both analogue and digital controllers, the
application of PD control [5] and lead control has been extensively reported here we use the
state feedback control law approach to stabilize the ball for the desired position. With
uncertain dynamic systems, robust nonlinear control theory using the sliding mode technique
has been demonstrated to provide significant benefits. The problem appears to have begun
with the lack of a suitable nonlinear controller, rather than with the lack of a suitable
observer. Nonlinear control laws [2], in general, typically necessitate multi-state feedback.
This is typically a major impediment in real systems, as many of the states are difficult to
measure or do not have an intuitive physical meaning. As a result, the problem becomes one
of constructing an effective controller/observer combination [4], which linear control theory
simply provides. When the poles of the controller and observer are independently stable, the
well-known separation principle of linear systems ensures closed loop system stability.
2. Method
We have given the equation of motion of the ball and the differential equation of electrical
circuit which uses the Kirchhoff voltage law which drives the voltage in the circuit with the
help of manipulating the voltage the position of the ball is maintained for the steady state
values which we get by linearising the state space model of the magnetic suspension system.
The equation of motion of ball is given by
m ÿ=−k ẏ +mg+ F ( y ,i)
Whereas m is the mass of ball, y is the vertical position of ball measured for the reference
position, k is the viscous friction coefficient, g is the acceleration due to gravity, F is the
electromagnetic force, i is the electric current, the induction of the electromagnet depends on
the ball position which is given by
L0
L ( y )=L1+
y
1+
a
Whereas L1 , L0∧a are positive constants and the electromagnetic force is given by
∂E
F ( y , i )=
∂y
1 2
With E= L ( y ) i . The circuit is driven by a voltage source v. the Kirchhoff voltage law is
2
given by
v=∅˙ + Ri
Whereas ∅=L ( y ) i is the magnetic flux linkage and R is the series resistance of circuit.
2.1 State-Space Model
It is a mathematical description of a physical system as a set of input, output, and state
variables linked by first-order differential equations or difference equations is known as a
state-space representation. State variables are variables whose values change over time based
5
on the values they hold at any given time and the values of input variables imposed
externally. The values of output variables are determined by the values of state variables. The
order of the system's defining differential equation is usually equal to the lowest number of
state variables required to depict a given system, n. the general equation of the state-space
model for the linear system is given below
ẋ ( t )= A x ( t ) + B u (t )
ẏ ( t ) =C x ( t ) + Du ( t )
Whereas x is the state vector, y is the output vector and u are the control input signal, the
block representation of the control linear state-space system is shown below.
t0
6
The feedback control law that minimizes the value of cost is given by
u=−Kx
The block representation of the state space model with state feedback system is shown below
1 L0 2
E= L1 + i
2 y
1+
a
The electromagnetic force is given by
7
∂E
F ( y , i )=
∂y
∂E −L0 i2
F ( y , i )= =
∂y
( )
2
y
2a +1
a
Substituting the above expression into the equation of motion of ball we get,
m ÿ=−k ẏ +mg+ F ( y ,i)
2
L0 i
m ÿ=−k ẏ +mg−
( )
2
y
2 a +1
a
The circuit is driven by a voltage source v. the Kirchhoff voltage law is given by
v=∅˙ + Ri
Rearranging the terms we get,
˙
∅=v−Ri
Whereas ∅=L ( y ) i is the magnetic flux linkage and R is the series resistance of circuit. Now
we compute the derivative of the ϕ with respect to time, we get,
ϕ̇ =L ( y ) i' + L̇ ( y ) i
L0 L0 i̇ ẏ
ϕ̇ =L1+ i '−
y
( )
2
1+ y
a +1
a a
L0 ' L0 i̇ ẏ
v−Ri=L1+ i−
y
( )
2
1+ y
a +1
a a
L0 i̇ ẏ
v−Ri+
( )
2
y
a +1
a
i' =
L0
L1 +
y
1+
a
We get the final two final differential equation from which we have to obtain the state space
model for the magnetic suspension system which is given as,
L0 i2
m ÿ=−k ẏ +mg−
( )
2
y
2a +1
a
8
2
−k L0 i
ÿ= ẏ + g−
m
( )
2
y
2 a m +1
a
L0 a x 3 x 2
u−R x 3 + 2
( x 1+ a )
x 3=
L0
L1 +
x
1+ 1
a
From the above derived expression, we can see that we get the same equation as given in the
problem statement. so, we can show that the derived expression is correct, now we have to
linearize the model to get the steady state value of voltage and current using MATLAB, the
expression of the steady state value as a function of desired position r is given as
V ss =
√ 2 R ( a+r )
√ L0 a
gm
9
V ss √2 ( a+r )
I ss = =
√
R L0 a
gm
Now we have to determine the state space matrix using the above differential equation by
computing the derivative of each term by the x 1 , x 2∧x 3, the first row we get using the three
[ ]
differential equation is give
0 1 0
2
L0 a x 3 −k −L0 a x 3
m ( a+ x 1 ) 3
m m ( a+ x 1 )2
( ) ( )
L0 a x 2 x 3 L0 a x2
A= L0 u−R x 3+ 2
− R− 2
( a+ x 1 ) 2 L0 a x 2 x3 L0 a x3 ( a+ x1 )
−
( ))
( xa +1)
( )) ( )) ( ))
2 2
L0 1 3 L0 2 L0 L0
a L1 + ( a+ x 1 ) L1+ ( a+ x 1 ) L1 + L1 +
( x1
a
+1 ( x1
a
+1 ( x1
a
+1 ( x1
a
+1
And from the constants terms we get the matrix B which is given as
[( )]
0
0
1
B= L0
L1 +
( xa +1)
1
[ ]
0 1 0
A= 327 −0.1 −16.5076
0 5.8262 −352.9412
[ ]
0
B= 0
35.2941
C=[ 1 0 0 ]
D= [ 0 ]
Using the state space representation of the model we create the state model for which we
design the state feedback controller using the MATLAB command place and lqr, we place
10
the poles −20 ± 20i∧−300 to get the stabilize response of the system, the gain we get using
the place command
K=[−602.703 −22.307 −0.3695]
11
Figure 4. magnetic suspension model with disturbance
For the nonlinearities in the system, we add the constraints in the system for the permissible
range of position and voltage and we also add the current protection circuits for which the
current values go to zero if the current value goes beyond i max =±5 A , the Simulink model for
the system is shown below
3. Results
We simulate the model for the derived state space model and the designed state feedback
controller with the help of pole placement and the lqr approach, we compute gain using both
12
the methods and simulate the response of the model by plotting the position of ball from the
initial reference position, the MATLAB code with the result for the described task is shown
below.
Control of a magnetic suspension system
% Clear data and figures
clc
clear
close all
Finding the steady state value of Iss and Vss for the desired position of ball
% Define symbolic variables
syms m k g a L0 L1 R x1 x2 x3 u r
% Define state-space equation
eqn1=x2==0;
eqn2=g-k*x2/m-L0*a*x3^2/(2*m*(a+x1)^2)==0;
eqn3=(u-R*x3+(L0*a*x2*x3/(a+x1)^2))/(L1+L0/(x1/a+1))==0;
% Solve equation to compute x1 x2 x3
Soln=solve([eqn1;eqn2;eqn3],[x1 x2 x3]);
% Extract result
x1=Soln.x1;
x2=Soln.x2;
x3=Soln.x3;
% Compute Vss
Vss=solve(x1(2)==r,u);
disp('Vss=')
pretty(Vss)
% Compute Iss
Iss=Vss/R;
disp('Iss=')
pretty(Iss)
Vss=
sqrt(2) R (a + r)
-----------------
/ L0 a \
sqrt| ---- |
\ g m /
Iss=
sqrt(2) (a + r)
---------------
/ L0 a \
sqrt| ---- |
\ g m /
First, we have to find the state space equation of the system which we have derived in the
theory section, from that we find the state space representation of magnetic suspension
system, by solving the equation we find the steady state values of current and voltage as a
function of desired position, the steady state values are given above.
13
Compute the linearized Model
% Define Symbloic variable
syms m k g a L0 L1 x1 x2 x3 u r
% Compute State-space Matrix
gradient(x2,[x1 x2 x3])
gradient(g-k*x2/m-L0*a*x3^2/(2*m*(a+x1)^2),[x1 x2 x3])
gradient((u-R*x3+(L0*a*x2*x3/(a+x1)^2))/(L1+L0/(x1/a+1)),[x1 x2 x3])
% State variables
x1=r;
x2=0;
x3=(2^(1/2)*(a + r))/((L0*a)/(g*m))^(1/2);
Iss=x3;
Vss=(2^(1/2)*R*(a + r))/((L0*a)/(g*m))^(1/2);
u=Vss;
% Compute Matrix A
A(1,1)=0;
A(1,2)=1;
A(1,3)=0;
A(2,1)=(L0*a*x3^2)/(m*(a + x1)^3);
A(2,2)=-k/m;
A(2,3)=-(L0*a*x3)/(m*(a + x1)^2);
A(3,1)=(L0*(u - R*x3 + (L0*a*x2*x3)/(a + x1)^2))/(a*(L1 + L0/(x1/a + 1))^2*(x1/a + 1)^2) -
(2*L0*a*x2*x3)/((a + x1)^3*(L1 + L0/(x1/a + 1)));
A(3,2)=(L0*a*x3)/((a + x1)^2*(L1 + L0/(x1/a + 1)));
A(3,3)=-(R - (L0*a*x2)/(a + x1)^2)/(L1 + L0/(x1/a + 1));
B=[0;0;1/(L1+L0/(x1/a+1))];
ans =
0
1
0
ans =
14
(L0*a*x3^2)/(m*(a + x1)^3)
-k/m
-(L0*a*x3)/(m*(a + x1)^2)
ans =
we have to linearize the model by finding the gradient of the three-differential equation, from
the given system parameters we find the state space matrix, using that matrix A we have to
find the poles by finding the eigenvalues of the matrix, we found that one poles of the system
is positive which shows the system is unstable, so to make the system stable we have to
design the controller using the pole placement and lqr approach which is shown in the next
part.
State Feedback controller simulation to stabilize ball at 1cm, 5cm and 8cm
% Clear data and figures
clc
clear
close all
15
% Compute eigen values
disp('Eigen value of System')
eig(A)
% Place Poles
p1= -20+20i;
p2= -20-20i;
p3= -300;
% Pole placement
K=place(A,B,[p1 p2 p3]);
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
% Simulate Model
data=sim('Model1');
% Plot Result
figure
subplot(121)
plot(data.position)
grid on
ylabel('position (m)')
title('Position Vs time using place command')
Q=C'*C;
Rn=1;
% Compute gain lqr command
K=lqr(A,B,Q,Rn);
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
% Simualte Model
data=sim('Model1');
subplot(122)
plot(data.position)
grid on
ylabel('position (m)')
16
title('Position Vs time using lqr command')
sgtitle('Desired Position at 1cm')
ans =
17.9044
-18.2779
-352.6677
Rank of System
ans =
17
r=0.05;
% Initial position of ball
x0=0.1;
% Place Poles
p1= -20+20i;
p2= -20-20i;
p3= -300;
% Pole placement
K=place(A,B,[p1 p2 p3]);
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
% Simulate Model
data=sim('Model1');
% Plot Result
figure
subplot(121)
plot(data.position)
grid on
ylabel('position (m)')
title('Position Vs time using place command')
Q=C'*C;
Rn=1;
% Compute gain lqr command
K=lqr(A,B,Q,Rn);
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
18
% Simualte Model
data=sim('Model1');
subplot(122)
plot(data.position)
grid on
ylabel('position (m)')
title('Position Vs time using lqr command')
sgtitle('Desired Position at 5cm')
ans =
13.9101
-14.1083
-399.9017
Rank of System
ans =
19
k=0.001;
g=9.81;
a=0.05;
L0=0.01;
L1=0.02;
R=10;
% Reference position ball
r=0.08;
% Initial position of ball
x0=0.1;
% Place Poles
p1= -20+20i;
p2= -20-20i;
p3= -300;
% Pole placement
K=place(A,B,[p1 p2 p3]);
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
% Simulate Model
data=sim('Model1');
% Plot Result
figure
subplot(121)
plot(data.position)
grid on
ylabel('position (m)')
title('Position Vs time using place command')
Q=C'*C;
Rn=1;
% Compute gain lqr command
K=lqr(A,B,Q,Rn);
20
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
% Simualte Model
data=sim('Model1');
subplot(122)
plot(data.position)
grid on
ylabel('position (m)')
title('Position Vs time using lqr command')
sgtitle('Desired Position at 8cm')
ans =
12.2071
-12.3652
-419.2967
Rank of System
ans =
21
From the above response for the reference position of 1cm, 5cm and 8 cm we design the state
feedback controller using the place and lqr command from the result we can see that the pole
placement gives the best result among the both approaches. So, we have to use the gains for
the pole placement for the study and investigation of parameters.
22
% Initial Disturbance
xdist=0.076;
% Place Poles
p1= -20+20i;
p2= -20-20i;
p3= -300;
% Pole placement
K=place(A,B,[p1 p2 p3]);
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
% Simulate Model
data=sim('Model2');
% Plot Result
figure
subplot(121)
plot(data.position)
grid on
ylabel('position (m)')
title('Position Vs time')
subplot(122)
plot(data.voltage)
grid on
ylabel('Voltage (V)')
title('Voltage Vs time')
ans =
16.5966
-16.8974
-368.2203
23
The above result shows the addition of largest initial disturbance for which the ball will
return to the equilibrium position, for the above simulation we have given the initial
disturbance of 7.6cm from that we can visualize that the we can above to achieve the
equilibrium position of 2cm and the voltage is also in the permissible range of 0 to 50V. we
also model the nonlinear closed loop system for the investigation of effect of 20% parameters
variation from the nominal values for all parameters which is described in the next part.
State Feedback controller simulation (Current Protection circuit)
% Clear data and figures
clc
clear
close all
24
% Call function SS_para
[Iss,Vss,A,B,C,D]=SS_para(r);
% Place Poles
p1= -20+20i;
p2= -20-20i;
p3= -300;
% Pole placement
K=place(A,B,[p1 p2 p3]);
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
% Simulate Model
data=sim('Model3');
% Plot Result
figure
subplot(131)
plot(data.position)
grid on
ylabel('position (m)')
title('Position Vs time')
subplot(132)
plot(data.voltage)
grid on
ylabel('Voltage (V)')
title('Voltage Vs time')
subplot(133)
plot(data.current)
grid on
ylabel('Current (A)')
title('Current Vs time')
sgtitle('Without Activation of Current Protection')
ans =
15.5229
-15.8073
-363.4519
25
For Activation of Current Protection Circuit
% Define Numerical Data
m=0.01*1.2;
k=0.001*1.2;
g=9.81;
a=0.05*1.2;
L0=0.01*1.2;
L1=0.02*1.2;
R=10*1.2;
% Reference position ball
r=0.02;
% Initial position of ball
x0=0.05;
% Place Poles
p1= -20+20i;
p2= -20-20i;
p3= -300;
% Pole placement
K=place(A,B,[p1 p2 p3]);
26
% Scale Factor
s = size(A,1);
Z = [zeros([1,s]) 1];
N = inv([A,B;C,D])*Z';
Nx = N(1:s);
Nu = N(1+s);
Nbar=Nu + K*Nx;
% Simulate Model
data=sim('Model3');
% Plot Result
figure
subplot(131)
plot(data.position)
grid on
ylabel('position (m)')
title('Position Vs time')
subplot(132)
plot(data.voltage)
grid on
ylabel('Voltage (V)')
title('Voltage Vs time')
subplot(133)
plot(data.current)
grid on
ylabel('Current (A)')
title('Current Vs time')
sgtitle('With Activation of Current Protection')
ans =
15.5229
-15.8073
-363.4519
27
The above result shows the response of the nonlinear system for the effect of 20% of
variation from the nominal values of all the parameters, we also design the current protection
circuit which will makes the current values to zero if the current goes beyond the 5A, from
the result we can see that the system is able to get the steady state with reference value of
2cm and the current and voltage values are also within the limits.
4. Discussion
We design and model the magnetic suspension system for controlling the position of the ball
by adjusting the voltage and current in circuit. From the designed and modelled state
feedback controller we can see that we are able to maintain the desired position of ball at
various position as described in the problem statement, we design the feedback controller
using the pole placement and lqr method, we found that the given pole placement values give
the faster response than the lqr gains values, so we can consider the pole placement gain
values for your further investigation which gives the better response as we desired. The
model we use is the state space model which has three states and three outputs and one input
which is the voltage in the circuit, we can convert the state space system into the transfer
function model which has single input and multiple output which is the position, velocity of
ball and current flowing through the circuit. We found that the position of ball is getting into
the stable state within 0.5 seconds. We can also use the PID controller instead of the state
feedback control law to control the position of ball, for such type of controller maintain the
transfer function gains for the transfer function magnetic suspension system will be the
challenging part of the designing, We also study the model for the variation from the nominal
28
values from that we can see that we also get the stable response and we get the response as
we desired.
5. Conclusions
We derived the state space representation for the magnetic suspension system using the
differential equation that we derived in the theory section, form that state space matrix we
design the state feedback controller with the help of pole placement and lqr controller using
the place and lqr command in MATLAB, we simulate the model for different desired position
of ball from the result we can say that the pole placement method gives the better and faster
response than the lqr approach. For the further study we select the pole placement approach
for designing and nonlinear modelling of the system by providing the current protection
circuit. We can see that by adding the initial disturbance the system is able to get the
equilibrium position, adding the current protection circuit in the nonlinear model gives the
real-life scenario from that we can study the effect of over current and voltage is in the
described limits for the position of ball is limited from 0 to 10cm and voltage is from 0 to
50V.
29
References
[1] Nonlinear control of a rigid rotor magnetic bearing system: modeling and simulation with full
state feedback. “Nonlinear Control of a Rigid Rotor Magnetic Bearing System: Modeling and
Simulation with Full State Feedback.” ieeexplore.ieee.org. Accessed March 30, 2022.
[2] Design and analysis of the nonlinear feedback linearizing control for an electromagnetic
suspension system. “Design and Analysis of the Nonlinear Feedback Linearizing Control for an
Electromagnetic Suspension System.” ieeexplore.ieee.org. Accessed March 30, 2022.
[3] Improving Operational Performance of Active Magnetic Bearings Using Kalman Filter and State
Feedback Control. “Improving Operational Performance of Active Magnetic Bearings Using Kalman
Filter and State Feedback Control.” ieeexplore.ieee.org. Accessed March 30, 2022.
[4] Modeling and control of the magnetic suspension system - ScienceDirect. “Modeling and Control
of the Magnetic Suspension System - ScienceDirect.” www.sciencedirect.com, January 17, 2007.
[5] PID Control to Maglev Train System. “PID Control to Maglev Train System.” ieeexplore.ieee.org.
Accessed March 30, 2022.
[6] Application of composite fuzzy-PID algorithm to suspension system of Maglev train. “Application
of Composite Fuzzy-PID Algorithm to Suspension System of Maglev Train.” ieeexplore.ieee.org.
Accessed March 30, 2022.
30