Sunteți pe pagina 1din 18

Lab Report On

Control system simulation using MATLAB and SIMULINK


(a) To plot closed loop frequency response of a unity feedback system from the open loop response using Nichol s plot and Nichols chart:We can draw closed loop frequency response of a unity feedback system from the open loop response using following methody

By superimposing open loop response on constant M and constant N circleIn this method we can get different magnitude with corresponding frequencies for close Loop system and also can get different phase with corresponding frequencies for close Loop system. By these data we can plot close loop frequency response of unity feedback system . Using Nichol s plot and Nichol s chartIn this method initial we draw Nichol s plot on Nichol s chart. Nichols plot represent Open loop gain (in db) Vs open loop phase plot. Point on this plot represents open Loop behaviour while Nichols chart grid shows the magnitude and phase corresponding To close loop system with unity feedback. Using these two plots we can get different Magnitude with corresponding frequencies and also can get different phase with Corresponding frequencies for close Loop system. By these data we can plot close loop frequency response of unity feedback system.

Magnitude plot

Phase plot

Ex.:- Take a system with open loop transfer function NICHOLS CHART & NICHOLS PLOT :

Nichols Chart 60

40 0 dB 0.25 dB 0.5 dB 20 1 dB 3 dB 6 dB 0 -1 dB -3 dB -6 dB -12 dB -20 O pen-Loop G ain (dB) -20 dB

-40

-40 dB

-60

-60 dB

-80

-80 dB

-100

-100 dB

-120 -360

-120 dB -315 -270 -225 -180 Open-Loop Phase (deg) -135 -90 -45 0

OBSERVATION TO DRAW CLOSE LOOP BODE PLOT :- - (A) For magnitude plotClose loop gain from plot (in db) -100 -80 -60 -40 -20 -12 -6 -3 -1 0 1 3 6 Close loop frequency From plot (rad./sec.) 79.7 36.9 16.8 7.81 3.5 2.59 2.13 1.92 1.83 1.78 1.74 1.66 1.57

S.No. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.

(B) For phase plot

S.No. 1 2 3 4

Close loop Phase from plot (deg.) 0 -10 -20 -30

Close loop frequency From plot (rad./sec.) 0.044 0.22 0.441 0.883

5 6 7

W= [79 7 36 9 16 8 7 81 3 5 2 59 2 13 1 92 1 83 1 78 1 74 1 66 1 57]; M= [-100 -80 -60 -40 -20 -12 -6 -3 -1 0 1 3 6] ; Figure 1 ; Plot(w,m); W= [5 26 2 04 1 4 .883 .441 .22 .044]; Phi= [-240 -210 -180 -30 -20 -10 0]; Figure (2); Plot(w,phi);

Plots fo clos loop s st


Magnitud plot

20

-20

close loop gain (db)

-40

-60

-80

-100

10

20

30

40 frequency w (rad/ sec)

50

MatLab Co

and to d aw bod plot f o

abov tabl

60

-240

5 26

-210

2 04

-180

14

70

80

Phase plot---

-50

close loop phase(deg)

-100

-150

-200

-250

3 frequency (rad/sec)

(b) Study of nonlinear systems using MATLAB/SIMULINK


Almost all systems are nonlinear. Modern approach in system engineering, state space approach, can deal with nonlinear systems also. Nonlinear systems exhibit many phenomena which are not seen in linear systems. 1. Simulating effect of saturation on the closed loop performance of a control system If we simulate the system given below then the closed loop system has two conjugate roots which lie on the right half of the plane hence the system has unstable response as shown in the diagram next to it.

Fig: Simulation block diagram and unstable output without saturation block

But when we add a saturation block which makes the system non linear since saturation is a non linear function the system different characteristic. It becomes marginally stable. The system remains marginally stable even if we change the value of saturation levels. The output of the saturation block after attaining saturation levels oscillates between two values hence the output of complete system is also confined and oscillates between two levels.

Fig: Simulation block diagram and unstable output with saturation block

2.

To draw the equilibrium points (singular points) of second order nonlinear system Linearization Of Non-Linear System (Equilibrium point)

Consider a system of n-state variable

The system is modeled in non linear mathematical equation as follows


 

In order to linearise the system, we need to find the equilibrium point. Equilibrium is a state of a system which does not change.

For example consider the system


 

For this n-state system, equilibrium point occurs when

Similarly,


. (1)

Now the Jacobian Matrix is evaluated, Jacobian Matrix for Linearisation at equilibrium point
    

.. (2)

The partial derivative are evaluated at equilibrium points found from solution of eq. (1). Now the system has been linearised in the vicinity of equilibrium point. This Jacobian matrix found in eq. (2) gives the state transition matrix [A] corresponding to the linearised system
 


Now the eigen value of the state transition matrix [A] are calculated


.. (3)

Solving (3) gives eigen values There are six possible Types of equilibrium points of second order linear systems corresponding to Eigen values:--

1. If both alue lies in left half plane at real axis:---

2. If both alue lies in left half plane at real axis:--

3. If alues are complex conjugate and lies in left half plane:--

4. If alues are complex conjugate and lies in right half plane:--

5. If alues are complex conjugate and lies on imaginary axis:--

6. If alue lies on real axis one in right half and other in left half plane:-

Example of FOCUS & SADDLE POINT :-Take a non linear system with following data

This system have 3 equilibrium point at (0,0),( For this system we get Jacobian

For linearizing this system across (0,0) ,we will get state transition matrix

Now find the eigen alue of matrix A (eig(A)) we will get So at (0,0) we will get Stable focus .

,0),(

,0)

function z = node(t,x) z = zeros(2,1); z(1) = x(2); z(2) = -x(1)-x(2);

t=[0 50]; x=[.01*i;.1];[t,x]=ode23('node',t,x); plot(x(:,1),x(:,2));hold on; t=[0 50]; x=[-.01*i;-.1];[t,x]=ode23('node',t,x); plot(x(:,1),x(:,2));hold on; end

0.15

0.1

0.05

-0.05

-0.1

-0.15

-0.2 -0.4

-0.3

-0.2

-0.1

For line rizing this system across (

,0) ,we will get same state transition matrix for both points

Now find th eigen value of mat ix A (eig(A we will get So at (0 0 we will get Saddle point .

MA LAB C MMAN :





for i=1 10

0.1

0.2

0.3

MA LAB C MMAN :
function z = node(t,x) z = zeros(2,1); z(1) = x(2); z(2) = 2*x(1)-x(2);

-1

-2

-3 -3 -2 -1 0 1 2 3

Example Of NODE:Take a linear 2nd order s stem Eigen value of s stem:-

eig(A) -1 -2
So we will get Stable node.

for i=1:50 t=[0 2]; x=[-2;.5*i];[t,x]=ode23('node',t,x); plot(x(:,1),x(:,2));hold on; end hold on; for i=1:50 t=[0 2]; x=[2;-.5*i];[t,x]=ode23('node',t,x); plot(x(:,1),x(:,2));hold on; end

  3 x  2 x ! 0. x 

0 1 A!  2  3

for i=1:50 t=[0 50]; MATLAB COMMAND:


function z = node(t,x) z = zeros(2,1); z(1) = x(2); z(2) = -2*x(1)-3*x(2);

x=[.01*i;.1*i];[t,x]=ode23('node',t,x); plot(x(:,1),x(:,2));hold on; t=[0 50]; x=[-.01*i;-.1*i];[t,x]=ode23('node',t,x); plot(x(:,1),x(:,2));hold on; end

0.2

0.1

-0.1

-0.2

-0.3 -0.1 -0.05 0 0.05 0.1

Example Of CENTER POINT:Take a linear 2nd order s stem Eigen value of s stem:-

 U si U ! 0  x1 ! x 2 ;  x 2 !  si x1

eig(A) -1 -2
So we will get CENTER POINT.

"

"

for i=1:10 MATLAB COMMAND: t=[0 50];


function z = node(t,x) z = zeros(2,1); z(1) = x(2); z(2) = -sin(x(1));

x=[.01*i;-.01*i];[t,x]=ode23('node',t,x); plot(x(:,1),x(:,2));hold on; end

0 15

01

0 05

-0 0 5

-0 1

-0 1 5

Input Dependent Stability St ilit li li t t t ilit i l t t t t t it l i ut l t t i t But

t i Si ul t t 75 226+ 7449i t t i ut

i t i t i li t t l l l 226 7449i t t i t l it t ilit i t t lue of i ut as r= 2 5 and 5 we get out uts as -

3. Simulation of various phenomena (input dependent stabilit limit cycles chaos..) exhibited by nonlinear systems

$#

-0 2 -0 2

%%

% %

% % % %

-0 1 5

-0 1

-0 0 5

0 05

01

0 15

r= 0.2

r=1.5

r=5

r=1.72

We always get stable output even if we change the input it is only function of system parameters. But for the non linear system the stability is also a function of input, not only the system poles. If we introduce squaring function in between as shown in the figure given below then the system becomes non linear and as we change the input the stability is also changing.

r=0.2

r=1.5

r=1.72

The system is stable for small input but as the input value increases the stability is decreasing. For r= . it is stable, r=1. it is critically stable and for r=1. it is unstable. For non linear system stability also dependent on input to the system but in non-linear system stability doesnt depend on input.

Limit Cycle The non linear systems are defined in terms of disturbed steady state coming back to its equilibrium position or at least lying within tolerable limits. Sometimes they may show strange behaviour, while in tolerance limits they follow a trajectory or limit cycle. So, the limit cycles decide the oscillations of non linear systems. Since we know that linear system ! A can have closed periodic orbits, but not an isolated orbit. This happens when eigen values are on the imaginary axis. Linearity requires that if (t ) is a solution, so is a (t ) , a { . Thus the amplitude of a periodic cycle in a linear system depends on the initial conditions. But in non linear systems we have isolated orbits and hence the amplitude and period of oscillations are independent of input. Since this is not a forced system, the oscillations are self-excited. Let us consider Van der Pol equation   ( x  1) x  x !   x

The system finally enters limit cycle. If |x|<<1, then the damping factor is negative, the energy is put in the system, so amplitude increases till the system state enters the limit cycle as shown. And if |x|>>1, then the damping is factor is large positive factor, the energy is taken out of the system behaves like an over damped system with consequent decrease in amplitude of x. Here the limit cycles are stable oscillations.

&

&

'

'

Limitcycle.m function dx= limitcycle(t,x) dx=zeros(2,1); dx(1)=x(2); dx(2)=(1-x(1)^2)*x(2) -x(1);

main window
for i=-30:30 x0=([.1*i,.1*i]); ts=[0 100]; [t,x]=ode23( 'limitcycle' ,ts,x0); plot(x(:,1),x(:,2)); hold on; x0=([.1*( -i),.1*i]); ts=[0 100]; [t,x]=ode23( 'limitcycle' ,ts,x0); plot(x(:,1),x(:,2)); hold on; end;

 x vs x for different input values Even if we change the input the system is entering into same oscillations. It has been shown with x vs t for two input values ( , ) and (- ,- ).

x0=([-2,-2]); ts=[0 40]; [t,x]=ode23( limitcycle' ,ts,x0); plot(t,x(:,1), 'color','red'); x0=([2,2]); ts=[0 40]; [t,x]=ode23( 'limitcycle' ,ts,x0); plot(t,x(:,1), 'color','blue');

(x vs t) for two different inputs

8  x3 ! x1 x  x3 3

The late Edward Lorenz (1 3) is justly famous for his butterfly effect, the most widely agreed upon characteristic of chaotically dynamic nonlinear system while studying computer simulations of a three equation model of climatic fluid dynamics. The Lorenz System is a system of differential equations which offers explanation to unpredictable behaviour of the weather.

0 0 0

Chaos

 x1 ! 1 x  1 x1  x ! x1 (  x3 )  x

21

x(0)= [0.1 0.1 0.1]

Lorenz had discovered that small changes in initial conditions produced large changes in the long term outcome. This effect came to be known as the butterfly effect.

Instead of starting the whole run over, even if a small approximation of fourth digit after decimal is taken in giving the initial condition the output shows completely different waveform as shown above. The practical consequence of the butterfly effect is that complex systems such as the weather (or stock market) are difficult to predict past a certain time range - approximately a week, in the case of weather. See in Fig, the behaviour of the system for shorter time is predictable, but not for longer time. The system though tries to move around the Equilibrium points also called fixed points or attractors.
18 16 14 12 30 10 25 8 20 6 15 4 2 0 0 5 10 15 20 25 30 10 5 0 -20 50 45 40 35

-15

-10

-5

10

15

20

Solution for shorter time (x1 vs x2)

Lorentz attractor(x1 vs x3)

Chaos.m
function dx= chaos(t,x) dx=zeros(3,1); dx(1)=10*x(2) -10*x(1); dx(2)= x(1)*(27 -x(3))-x(2); dx(3)=x(1)*x(2) -x(3)*8/3;

main window (Lorentz attractor )


x0=[.1,.1,.1]; ts=[0 100]; [t,x]=ode23(' chaos',ts,x0); plot(x(:,1),x(:,3 ));

short time predictability


ts=[0 .5]; [t,x]=ode23('dif',ts,x0); plot(x(:,2),x(:,1));

Chaotic processes are often confused with random processes. A truly random process is characterized by a large number of unrelated events, events without any pattern or regularity. The so-called randomness of chaotic processes is just their appearance to an observer. Chaotic processes involve related events expressed by a deeply embedded regularity. Chaos, in this modern view, is not to be thought of as complete disorganization and irregularity. Furthermore, chaotic processes are still constrained by the laws of physics. Even though two, nearly identical leaves will diverge chaotically during their fall, neither will fall like a rock or fall at 1 miles an hour. The fine details of their descent will differ, but their overall dynamics will remain typical of leaves in general under the influence of gravity and under normal wind. In case of chaos for long time we cant predict the behaviour of state and get a trajectory diagram as shown above this is also known as butterfly effect .

S-ar putea să vă placă și