2012
University of Dayton
Electrical and computer department
Nonlinear control system
ABDELBASET ELHANGARI
1011647470
Final project: Designing of Nonlinear Controllers[ ]
[Type the abstract of the document here. The abstract is typically a short summary of the contents of the
document. Type the abstract of the document here. The abstract is typically a short summary of the
contents of the document.]
Contents
1. Experiment #1:.................................................................................................................................... 2
Part A Experiment #1 (Feedback linearization): ................................................................................... 2
Part B of Experiment #1(Sliding Mode Control): .................................................................................. 8
2. Experiment #2:.................................................................................................................................. 12
3. Experiment #3:.................................................................................................................................. 14
Figures:
Figure 1: The System Phase Portrait ............................................................................................................ 4
Figure 2: The System is Open loop Stable .................................................................................................... 5
Figure 3: Regulation of the System States by the Controller ........................................................................ 6
Figure 4: Failure of the Same Controller in the Regulation Process .............................................................. 7
Figure 5: Sliding Mode Control with the Alternative Manifold ................................................................... 10
Figure 6: Sliding Mode Control with the Given Manifold ........................................................................... 11
Figure 7: The Pendulum States Being Regulated near the Zero .................................................................. 13
Figure 8: The phase Portrait of the Open Loop .......................................................................................... 15
Figure 9: Back Stepping Controller Succession........................................................................................... 18
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179239
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179240
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179241
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179242
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179243
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179244
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179246
1. Experiment #1:
The system is given by
̇
̇
With (.
1. 2012
University of Dayton
Electrical and computer department
Nonlinear control system
ABDELBASET ELHANGARI
1011647470
Final project: Designing of Nonlinear Controllers[ ]
[Type the abstract of the document here. The abstract is
typically a short summary of the contents of the
document. Type the abstract of the document here. The abstract
is typically a short summary of the
contents of the document.]
Contents
1. Experiment
#1:..........................................................................................
.......................................... 2
2. ................................................................................... 2
.................................................................................. 8
2. Experiment
#2:........................................................................... ...............
........................................ 12
3. Experiment
#3:..........................................................................................
........................................ 14
Figures:
Figure 1: The System Phase Portrait
...............................................................................................
............. 4
Figure 2: The System is Open loop Stable
............................................................................................. ..
..... 5
Figure 3: Regulation of the System States by the Controller
........................................................................ 6
Figure 4: Failure of the Same Controller in the Regulation
Process .............................................................. 7
Figure 5: Sliding Mode Control with the Alternative Manifold
................................................................... 10
Figure 6: Sliding Mode Control with the Given Manifold
3. ........................................................................... 11
Figure 7: The Pendulum States Being Regulated near the Zero
.................................................................. 13
Figure 8: The phase Portrait of the Open Loop
.......................................................................................... 15
Figure 9: Back Stepping Controller
Succession..............................................................................
............. 18
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179239
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179240
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179241
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179242
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179243
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179244
file:///C:/Users/abdu/Desktop/non_lin_proj%23_Toc343179246
1. Experiment #1:
The system is given by
̇
̇
With ( ) [
] , ( ) [
4. ]; in this experiment we will apply feedback
linearization approach to check the system convergence to zero;
and the second approach
sliding mode control will be applied as well.
I th ect o , we w ll de l w th the y tem’ p r meter , k
ow parameters
̂ and ̂. After that, nominal values will be plugged in for them
to come up with a
diffeomorphism and a controller such that the system converges
to zero. For the last two,
the system parameters will be changed to another nominal
values to check if the controller
still effective with system of not. Now to apply feedback
linearization, we need to find a
diffeomorphism such that the system will be on chain of
integral form.
The diffeomorphism is ( ) which will achieve the next three
conditions.
Conditions:
( )
6. ( , )
( )
[
] [
̂
̂
]
( ̂ )
From condition 1, force
then the condition is satisfied.
From condition 3,
7. ( ̂ ) apply the results from condition 1
( ̂ ), then the conditions ( ) ( ) are achieved.
Now, let’ apply for ( ) [
] [
̂
]
That implies ( ) [
] [
̂
]
Now, let’ find the system in the chain integral form
[
̇
̇
] [
̇
9. ̂ ̂ ̂
̂ ̂
]
Now, we can pick a controller on the form:
( )
( ( ) ), where ( ) ,
( ) ̂ ̂ ̂
̂ ̂ ,
Simulation & results
For simulation:
( ) ( ) ( ̂ ̂) ̂ ̂
̂
Where ̂ , ̂ , ,
10. Figure 1 illustrates the system behavior by the phase portrait
plot. There are saddle points at
( , ), and at ( , ). By analyzing the system we can notes that
there are certain positions if
they were picked as initial conditions the trajectories will go to
zero.
Figure 1: The System Phase Portrait
Saddle points
0 5 10 15 20 25 30 35 40 45 50
12. Regulation to Zero with zero input
x1
x2
From figure 2, the system is open-loop stable. Whereas u=0 the
origin is asymptotically stable.
Where the system has been tested for different initial conditions
which needed to be chosen
carefully such as ( ) and no restriction on ( )
13. Figure 2: The System is Open loop Stable
0 5 10 15 20 25 30 35 40 45 50
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
Time
S
y
s
14. te
m
S
ta
te
s
Regulation to Zero with the controller
x1
x2
Figure 3 shows how the states x1, x2 go to zero from different
initial conditions
As it’s shown in Figure 2, the controller has succeeded to
15. linearize the system and drive the
states to zero. We can easily see that the controller made a lot
of changes on the open loop system
such as much less ripple in the states. Whereas, the system’s
parameters a,b have been chosen
| | | | because they are unknown. Now, let’s change
them to other
arbitrary values and check whether the same controller is still
able to achieve the task.
Figure 3, shows the previous mentioned case where
It is clear that
the controller which has been designed for is not
able to regulate the states to
the zero anymore.
Figure 3: Regulation of the System States by the Controller
0 5 10 15 20 25 30 35 40 45 50
-3
-2
-1
17. Figure 4: Failure of the Same Controller in the Regulation
Process
In sliding mode control, we only consider a subsystem form the
original system. Then
18. the subsystem is ̇ , With x2 as the input for it. Pick a
,
where c is the slope of the manifold. Then ̇
that
means ( ) E.S.
The Manifold (alternative):
The manifold dynamics:
̇ ̇ ̇ ̇ co ̇
̇ ( ) ( ) co ( )
̇
co
co c
̇ ̇
̇ (
19. co
co c )
̇ | | | |
| | | |
̇ | |(
)
Now pick | |(
)
Where (
)
The Required Manifold (alternative):
Consider the at the origin s=0 that implies and
now lets check if x2
will work as an input for the subsystem and if it regulates the
states to zero?
20. The subsystem is ̇ to examine the stability of the
origin for this subsystem,
we consider the Lyaponouve candidate as
̇ ̇ ( )
, where it’s known that
0 | | and that leads to
̇ 2
̇ ( )
̇
Since, the Lyaponouve candidate is p.d. , and its derivative ̇
is n.d, that means the origin
is G.A.S. then the given manifold will do the job.
Computing the dynamics:
̇ ̇ ̇
( )
The Lyaponouve of this manifold,
23. | || |
( ⁄ )
Simulation & results:
All the initial conditions are similar to that were used in the
feedback linearization method.
Figure 5 shows that the states of the system being regulated to
the zero with some
ripples after about 8 seconds due to the swithcing between the
controllers.
Figure 5: Sliding Mode Control with the Alternative Manifold
24. figure 6 shows the regulation of the states by the given
manifold. There difference between
the performace of the two controllers. The first was smoother in
the trasition status
compared with the last controller where the transition statuse is
more aggrisive. In the other
hand, by the last controller the states went further without
ripples, around the zero, starts
about 13 seconds
25. 0 5 10 15 20 25 30 35 40 45 50
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
Time
S
y
s
te
m
S
ta
26. te
s
SMC with the Manifold s=3x
1
+x
2
x1
x2
Figure 6: Sliding Mode Control with the Given Manifold
2. Experiment #2:
In this experiment, a simple pendulum is shown Figure 7 which
has the differential equation
on the form:
̈ ̇
( ) ,
where h is the horizontal acceleration, T is the torque (control)
input, l is the lenth of the rod,
m is the mass of the bob and represent the system’s output,
27. which is the angle between the
motion of the rod with vertical axis. T is the torque as the input
for the system Figure 7
shows system.
It’s needed to achieve sliding mode controller to keep the angle
at zero.
With constraints:
, 1.5, and | ( )|
with the gravity g = 9:81.
Derivations:
First the system is needed to be converted to state space
format. By taking and
̇ the system can be written as
[
̇
̇
] {
29. Let’s consider the subsystem ̇ , with as the input and the
manifold will be
at the origin s=0 that implies . Let’s check with the
manifold
dynamics.
̇ ̇ ̇
( )
p ck
( )
Where ( ).
Simulation & results:
Figure 8 illustrates that for different initial conditions the
30. pendulum settled near the vertical
as the states do not totally regulated to zero by this controller.
Figure 7: The Pendulum States Being Regulated near the Zero
0 5 10 15 20 25 30 35 40 45 50
-2.5
-2
-1.5
-1
-0.5
0
32. 3. Experiment #3:
In this experiment, a wing rock phenomenon will be examined
for a delta wings aircraft such as
the concord aircraft. The wing rock is considered a limit cycling
in the roll angle and the roll rate ̇ when
the angles of attack take place in the high performance.
The objective is to stabilize by a back-stepping controller such
the limit cycling is eliminated.
The model is given on the form
̈ ̇ ̇
̇ ̇
Where the system parameters are , ,
and
. And the tunnel experiment parameters and
.
When the angle of attack v=25, the values of the parameters
are given in the following table:
v
33. 25 -0.05686 0.03254 0.07334 -0.3597 1.4681
Steps of derivation:
First, the system is needed to transform into state space
representations. In addition to, the consideration
that is a force applied on the wing by an actuator with linear
dynamics given by ̇
and
is constant, then the system states will be considered as the
follows:
Represents the Roll angle the output of the system,
̇ Represents the Roll velocity,
Represents the force applied.
With these states the system can be now represent on the state
space form
[
̇
̇
̇
35. x
2
Phase Proteriate of the System
Now, let’s check by simulation the system behavior at the open-
loop system by taking the control input as
and the initial conditions are taken as ( ) , ̇ ( )
, ̇
Figure 8 shows the open loop system has a limit cycle when
there is no input controller introduced. So,
system need a controller such that the states go to zero which
means eliminating the limit cycle behavior.
The states start at -4,0,0 as initial conditions, and the simulation
run for a relative long time 1000 second,
then we can observe that the trajectory attracted by the limit
cycle and stuck at there forever.
36. Figure 8: The phase Portrait of the Open Loop
Now, task is to design a controller for this system using back-
stepping that regulates the states to
zero, and then a simulation will be held for the closed loop
system for similar initial conditions above.
Back-Stepping Derivation:
as the system has three states, we need three steps to achieve
the this type of controllers.
Step #1:
Let
̇ ̇ = ( )
̇
Then let’s check the first Lyaponouve candidate:
37. ̇ ̇
Step #2:
̇ ̇ ̇
( ) ̇
(
̇ )
Plug in the value of
̇
+
̇
̇
38. ̇
Then let’s check the second Lyaponouve candidate:
̇ ̇ ̇
Step #3:
Finally choose
̇ ̇ ̇
̇
Pick the controller as (
̇ )
̇
39. Then let’s check the first Lyaponouve candidate:
̇ ̇ ̇ ̇
The system Lyaponouve function is P.d. and derivative of it is
N.d. that implies which
implies that because the system has been
transformed on chain of integral form.
[
̇
̇
̇
] {
̇
̇ ̇
̇ ̇
43. ̇
̇
̇
̇
̇
Simulation & Results:
The system has been simulated with the same initial condition
that been applied in the open loop system.
Figure 9: Back Stepping Controller Succession
44. -4 -3 -2 -1 0 1 2
-0.2
-0.15
-0.1
-0.05
0
0.05
0.1
0.15
0.2
x
1
x
2
Phase Proteriate of the System with Back Stepping Controller
Conclusion:
In this report different types of nonlinear design approaches
have been implemented on different
systems. Each controller has done the task as expected. For each
system, sometimes the parameter of the
45. system are unknown, so then the sliding mode controller is best
because it gives range of permittivity also
for some systems, the initial conditions plays important role in
the designing process according to the
physical system which being under considration
ECE 547 – Nonlinear Systems and Control
Final Project Due: 19-Dec-2014 by 11:55 p.m.
1. Sliding Mode Control Warm-Up
We will work on the system
ẋ1 = x2 + ax1 sin(x1)
ẋ2 = bx1x2 + u (1)
where a and b are unknown constants, but we know that 0 ≤ |a| ≤
2 and 1 ≤ |b| ≤ 3.
(a) Show that this system is state feedback linearizable. Assume
that â = 1 and b̂ = 1.5 are
nominal values of a and b that you will use for your feedback
linearizing controller; furthermore,
assume for now that a = â and b = b̂ . Simulate your controller
by regulating the states to
zero.
(b) Now suppose that a 6= â and b 6= b̂ , and that the real values
of a and b are a = −1, b = 2.
46. Using Matlab, plot the phase portrait of the open-loop system
(1), and identify the regions
where the system exhibits different behaviors.
(c) Explain why it is not possible anymore to use your
controller from (a) when a 6= â and b 6= b̂
and guarantee convergence to zero. In particular pay attention
to the diffeomorphism and
the controller itself. Verify by setting a = −1, b = 2 in your
simulation with the same u and
diffeomorphism you got in (a). Hint: be sure to use â = 1 and b̂
= 1.5 to do your coordinate
transformation and to compute your controller, since you
assume not to know the real values
for control design purposes! At the same time, use the real a =
−1 and b = 2 values in your
simulation.
(d) Instead of feedback linearization, you will now implement a
sliding mode controller. The
approach is to figure out what x2 should be if we considered it
as an input to the ẋ1 equation
so that x1 is driven to zero. Design a linear manifold of the
form s = cx1 + x2 that does the
job by considering what happens when s = 0. Next, analyze the
dynamics of s and determine
a sliding mode controller that drives s to zero (and consequently
x to zero).
(e) Simulate your sliding mode design. Note that if you use the
“sign” function in Matlab, ode45
will take a very long time to run. Instead, it is suggested that
you use the approximation
sgn(y) ≈ sat(y/�), where
sat(y) =
47. 1 if y ≥ 1
y if − 1 < y < 1
−1 if y ≤−1
Tune � to understand the trade-off involved.
2. Sliding Mode Control for the van der Pol Equation
The controlled van der Pol system is given by
ẋ1 = x2
ẋ2 = −ω2x1 + �ω(1 −µ2x21)x2u,
where ω, � and µ are positive constants, and u is the control
input.
(a) Pick values for ω, � and µ, and verify via simulation that
for u = 1 the van der Pol system
exhibits a stable limit cycle outside the surface x21 + x
2
2/ω
2 = 1/µ2, and that for u = −1
there exists an unstable limit cycle outside the same surface.
(b) Define the sliding manifold s = x21 + x
2
2/ω
48. 2 − r2, where r < 1/µ. Show analytically that if
we restrict the motion of the system to the surface s = 0 (that is,
we force s(t) ≡ 0), then
the resulting behavior is that of the linear harmonic oscillator
ẋ1 = x2
ẋ2 = −ω2x1,
which exhibits a sinusoidal oscillation of frequency ω and
amplitude r.
(c) Design a sliding mode controller that drives all trajectories
whose initial condition is within
the region {x ∈ R2 : |x1| < 1/µ} to the manifold s = 0, and then
has the states slide on that
manifold towards the origin. Simulate your controller and verify
that it is able to regulate the
state to zero. Show your plots of x vs time and x2 vs x1 to
demonstrate your design.
3. MIMO Control of a Two-Link Planar Arm
The robot arm in Figure 1 consists of two links. The first one
mounted on a rigid base by means
of a frictionless hinge and the second mounted at the end of link
one. The joint axes z0 and z1 are
normal to the page. We establish the base frame x0y0z0 as the
work space frame, which means
the arm moves within the x−y plane. The inputs to the system
are always the torques τ1 and τ2
applied at the joints.
Figure 1: Two-link planar manipulator.
49. A dynamic model of this system can be derived using
Lagrangian equations and is given by[
H11 H12
H21 H22
][
θ̈1
θ̈2
]
+
[
−hθ̇2 −hθ̇1 −hθ̇2
hθ̇1 0
][
θ̇1
θ̇2
]
+
[
g1
g2
]
=
[
τ1
τ2
]
,
50. where
H11 = I1 + I2 + m1l
2
c1 + m2[l
2
1 + l
2
c2 + 2l1lc2 cos(θ2)],
H22 = I2 + m2l
2
c2,
H12 = H21 = I2 + m2[l
2
c2 + l1lc2 cos(θ2)],
h = m2l1lc2 sin(θ2),
g1 = m1lc1g cos(θ1) + m2g[lc2 cos(θ1 + θ2) + l1 cos(θ1)],
g2 = m2lc2g cos(θ1 + θ2).
In this project, we use the following parameter values: m1 =
1.0kg, mass of link one; m2 = 1.0kg,
mass of link two; l1 = 1.0m, length of link one; l2 = 1.0m,
length of link two; lc1 = 0.5m, distance
from the joint of link one to its center of gravity; lc2g = 0.5m,
distance from the joint of link two
to its center of gravity; I1 = 0.2kgm
2, lengthwise centroidal inertia of link one; I2 = 0.2kgm
51. 2,
lengthwise centroidal inertia of link two; and g = 9.804m/s2,
acceleration of gravity.
2
(a) First, you will do joint space MIMO control of the arm,
where the inputs are the two torques
and the outputs are the joint angles θ1 and θ2. Write a MIMO
state space representation
of the system dynamics. Then design the MIMO state feedback
controllers (τ1 and τ2) for
this system that regulate all the states to zero, and simulate the
closed loop system for the
initial conditions θ1(0) =
π
2
, θ̇1(0) = 0, θ2(0) = −
π
2
, θ̇2(0) = 0. Make sure you tune well
the parameters of controllers, plot your controllers and all the
states versus time, and provide
an interpretation of your plot.
(b) Second, we want to control the end-effector of the arm to
generate a path in x − y plane.
The outputs are the position coordinates x and y (z is always
52. zero) of the end-effector.
One way to approach this problem is to formulate the system
directly into the end-effector
coordinates. Let f : Q → R2 be a smooth and invertible mapping
between the joint vector
Θ = [θ1,θ2]
> ∈ Q and the workspace variables X = [X0,Y0]> ∈ R2. The
space Q is a
suitably chosen range of angles for θ1 and θ2, and X = [X0,Y0]
> is the position of the
end-effector on the (x0 −y0) plane. In other words,
X = f(Θ),
so that the position of the end-effector can be computed from
the two joint angles.
The mapping f is known as the arm’s forward kinematics, and it
can lead us directly into
so-called work space control, which you will perform instead of
joint space control as done in
part (a). There exists a relationship between the vector of linear
velocities of the end-effector
Ẋ and the vector of velocities of joint variables Θ̇, given by Ẋ =
JΘ̇, where J is known as
the Jacobian matrix.
Derive the forward kinematic function f : Q → R2 using
trigonometry, and then show that
the Jacobian is given by
J =
[
53. −l1 sin(θ1) − l2 sin(θ1 + θ2) −l2 sin(θ1 + θ2)
l1 cos(θ1) + l2 cos(θ1 + θ2) l2 cos(θ1 + θ2)
]
.
Next, derive the new MIMO state space representation of the
system dynamics, where now
the state vector is X, instead of Θ. Design the MIMO state
feedback controllers (τ̂1 and τ̂2)
√
2 (m)
y = sin(
πt
30
) (m),
and verify your design with a simulation for the initial
conditions θ1(0) = 0, θ̇1(0) = 0, θ2(0) =
0.2, θ̇2(0) = 0. Plot your control signals and all the states versus
time, and demonstrate an
animation of the arm’s motion (use the example MATLAB code
provided on Isidore).
(c) Finally, consider that normally the two-link arm has two
configurations (i.e., elbow up and
elbow down) for a particular non-singularity position of the
end-effector. However, your
closed-loop system always picks one solution from the two
possible solutions. Why is this?
54. Warning: During your work space MIMO control, there exist
some singularity positions
when θ2 = kπ, where k = 0,±1,±2, · · · . The Jacobian matrix is
not invertible and the
controllers will be infinitely large at such positions. Please
avoid these positions when you
try to test your controllers!
General notes and hints:
• The report to be turned in should be typed. I expect a
professional-looking report, technically
sound and easy to read.
• Provide plots for all simulations that are requested. Make sure
your plots are clear (do not use jpg
files!), with relevant titles and axes labeled, and using a legend
whenever several signals are plotted
together. Any unclear or hard to read plot will cause you to lose
points.
3
• Keep your report succinct and to the point. Proofread it and
spell check it. Poor English in your
report will cause you to lose points.
• Turn in your report via Isidore as a PDF file (no other format
will be accepted), and upload your
code uncompressed.
4
55. The project is to solve the equations in a report with
details with giving plots from Matlab . also I need the Matlab
files that you will use during your solution
so please follow the instructions of the final project
See file final_project.pdf
I attach hear an example (of a different project) about how the
report should to look like & what have to include on it. as
solving each sliding, giving plots as simulation to support the
result, introduction and conclusion of all
the Matlab code have to be in file as part of the solution.
See example.pdf
VERY IMPORTANT
Please notice that problem 3. The distance from the joint of link
two to its center of gravity should be "lc2" not "lc2g", sorry.
Please report your confusion and comment ASAP to Dr. Raul,
so that you could finish your final project smoothly.
I got this massage from the Dr
Thanks.