Advanced Control System Notes
Advanced Control System Notes
Solutions provided by
Prof Mrs. Deepti Khimani
Instrumentation Engineering
Mumbai University/V. E. S. Institute of Technology
2
12 To demonstrate model reference adaptive control system. 38
3
List of Experiments
4
List of Figures
1.1 Lab01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 Lab01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1 Lab02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 Lab02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1 Lab03 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Lab03 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1 Lab04 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 Lab04 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1 Lab05 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.1 Lab06 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.2 Lab06 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
7.1 Lab07 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.1 Lab09 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
10.1 Lab10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
11.1 Lab11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
11.2 Lab11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
12.1 Lab12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5
Experiment: 1
1 // Lab . 0 1 : To p l o t t h e p h a s e p o r t r a i t o f s y s t e m s
h a v i n g s t a b l e and u n s t a b l e n o d e s .
2
3 // s c i l a b − 5 . 5 . 0
4 // O p e r a t i n g System : Windows 7 , 32− b i t
5
6 clc ;
7 clear all ;
8 clf ;
9
10 // System t r a n s f e r f u n c t i o n
11 s = poly (0 , ’ s ’ ) ;
12 g =1/( s ^2+3* s +2) ;
13
14 // Draw p o l e z e r o map o f t h e s y s t e m
15 plzr ( g ) ;
16 title ( ’ P o l e −z e r o map o f t h e s y s t e m w i t h r e a l s t a b l e
6
e i g e n v a l u e s ’ , ’ f o n t s i z e ’ ,3)
17 // C o n v e r t t h e g i v e n t r a n s f e r f u n c t i o n i n t o s t a t e
s p a c e form
18 sys = tf2ss ( g ) ;
19
20 // P l o t o f s y s t e m p h a s e t r a j e c t o r y
21 sys . c =[1 ,0;0 ,1];
22 sys . d =[0 0] ’;
23
24 t =0:0.2:10;
25 a1 = size ( t ) ;
26 u = zeros ( a1 (1) , a1 (2) ) ;
27 figure
28 for i = -2.0:0.5:2;
29 for j = -2:0.5:2;
30 y1 = csim (u ,t , sys ,[ i , j ] ’) ;
31 plot ( y1 (1 ,:) , y1 (2 ,:) ) ;
32 end
33 end
34
35 set ( gca () ,” g r i d ” ,[0.3 0.3])
36 title ( ’ Phase p o r t r a i t o f t h e s y s t e m w i t h s t a b l e node
’ , ’ f o n t s i z e ’ ,3)
37 xlabel ( ’ x1 ( t ) ’ , ’ f o n t s i z e ’ ,2)
38 ylabel ( ’ x2 ( t ) ’ , ’ f o n t s i z e ’ ,2)
39 f = get ( ” c u r r e n t f i g u r e ” ) // C u r r e n t f i g u r e h a n d l e
40 f . background =8
41 // System t r a n s f e r f u n c t i o n
42 s = poly (0 , ’ s ’ ) ;
43 g =1/( s ^2 -3* s +2) ;
44
45 // Draw p o l e z e r o map o f t h e s y s t e m
46 figure ;
47 plzr ( g ) ;
48 title ( ’ P o l e −z e r o map o f t h e s y s t e m w i t h r e a l
u n s t a b l e e i g e n v a l u e s ’ , ’ f o n t s i z e ’ ,3)
49 f = get ( ” c u r r e n t f i g u r e ” ) // C u r r e n t f i g u r e h a n d l e
50 f . background =8
7
51 // C o n v e r t t h e g i v e n t r a n s f e r f u n c t i o n i n t o s t a t e
s p a c e form
52 sys = tf2ss ( g ) ;
53
54 // P l o t o f s y s t e m p h a s e t r a j e c t o r y
55 sys . c =[1 ,0;0 ,1];
56 sys . d =[0 0] ’;
57
58 a1 = size ( t ) ;
59 u = zeros ( a1 (1) , a1 (2) ) ;
60 figure
61 for i = -2.0:0.5:2;
62 for j = -2:0.5:2;
63 y1 = csim (u ,t , sys ,[ i , j ] ’) ;
64 plot ( y1 (1 ,:) , y1 (2 ,:) ) ;
65 end
66 end
67 set ( gca () ,” g r i d ” ,[0.3 0.3])
68 f = get ( ” c u r r e n t f i g u r e ” ) // C u r r e n t f i g u r e h a n d l e
69 f . background =8
70 zoom_rect ([ -5 , -5 ,5 ,5])
71 title ( ’ Phase p o r t r a i t o f t h e s y s t e m w i t h u n s t a b l e
node ’ , ’ f o n t s i z e ’ ,3)
72 xlabel ( ’ x1 ( t ) ’ , ’ f o n t s i z e ’ ,2)
73 ylabel ( ’ x2 ( t ) ’ , ’ f o n t s i z e ’ ,2)
8
Figure 1.1: Lab01
9
Figure 1.2: Lab01
10
Experiment: 2
1 // Lab . 0 2 : To p l o t t h e p h a s e p o r t r a i t o f s y s t e m s
h a v i n g s t a b l e and u n s t a b l e f o c u s p o i n t .
2
3 // s c i l a b − 5 . 5 . 0
4 // O p e r a t i n g System : Windows 7 , 32− b i t
5
6 clc ;
7 clear all ;
8 clf ;
9
10 // System t r a n s f e r f u n c t i o n
11 s = poly (0 , ’ s ’ ) ;
12 g =1/( s ^2+ s +1) ;
13
14 // Draw p o l e z e r o map o f t h e s y s t e m
15 plzr ( g ) ;
16 title ( ’ P o l e −z e r o map o f t h e s y s t e m w i t h s t a b l e
11
underdamped e i g e n v a l u e s ’ , ’ f o n t s i z e ’ ,3)
17 // C o n v e r t t h e g i v e n t r a n s f e r f u n c t i o n i n t o s t a t e
s p a c e form
18 sys = tf2ss ( g ) ;
19
20 // P l o t o f s y s t e m p h a s e t r a j e c t o r y
21 sys . c =[1 ,0;0 ,1];
22 sys . d =[0 0] ’;
23
24 t =0:0.2:10;
25 a1 = size ( t ) ;
26 u = zeros ( a1 (1) , a1 (2) ) ;
27 figure
28 for i = -2.0:0.5:2;
29 for j = -2:0.5:2;
30 y1 = csim (u ,t , sys ,[ i , j ] ’) ;
31 plot ( y1 (1 ,:) , y1 (2 ,:) ) ;
32 end
33 end
34 set ( gca () ,” g r i d ” ,[0.3 0.3])
35 f = get ( ” c u r r e n t f i g u r e ” ) // C u r r e n t f i g u r e h a n d l e
36 f . background =8
37 title ( ’ Phase p o r t r a i t o f t h e s y s t e m w i t h s t a b l e
f o c u s ’ , ’ f o n t s i z e ’ ,3)
38 xlabel ( ’ x1 ( t ) ’ , ’ f o n t s i z e ’ ,2)
39 ylabel ( ’ x2 ( t ) ’ , ’ f o n t s i z e ’ ,2)
40
41 // System t r a n s f e r f u n c t i o n
42 s = poly (0 , ’ s ’ ) ;
43 g =1/( s ^2 - s +1) ;
44
45 // C o n v e r t t h e g i v e n t r a n s f e r function into state
s p a c e form
46 sys = tf2ss ( g ) ;
47
48 // Draw p o l e z e r o map o f t h e s y s t e m
49 figure ;
50 plzr ( g ) ;
12
51 f = get ( ” c u r r e n t f i g u r e ” ) // C u r r e n t f i g u r e h a n d l e
52 f . background =8
53 title ( ’ P o l e −z e r o map o f t h e s y s t e m w i t h n e g a t i v e l y
damped e i g e n v a l u e s ’ , ’ f o n t s i z e ’ ,3)
54 // P l o t o f s y s t e m p h a s e t r a j e c t o r y
55 sys . c =[1 ,0;0 ,1];
56 sys . d =[0 0] ’;
57
58 a1 = size ( t ) ;
59 u = zeros ( a1 (1) , a1 (2) ) ;
60 figure
61 for i = -2.0:0.5:2;
62 for j = -2:0.5:2;
63 y1 = csim (u ,t , sys ,[ i , j ] ’) ;
64 plot ( y1 (1 ,:) , y1 (2 ,:) ) ;
65 end
66 end
67 set ( gca () ,” g r i d ” ,[0.3 0.3])
68 f = get ( ” c u r r e n t f i g u r e ” ) // C u r r e n t f i g u r e h a n d l e
69 f . background =8
70 zoom_rect ([ -5 , -5 ,5 ,5])
71 title ( ’ Phase p o r t r a i t o f t h e s y s t e m w i t h u n s t a b l e
f o c u s ’ , ’ f o n t s i z e ’ ,3)
72 xlabel ( ’ x1 ( t ) ’ , ’ f o n t s i z e ’ ,2)
73 ylabel ( ’ x2 ( t ) ’ , ’ f o n t s i z e ’ ,2)
13
Figure 2.1: Lab02
14
Experiment: 3
1 // Lab . 0 3 : To p l o t t h e p h a s e p o r t r a i t o f s y s t e m s
having vortex point .
2
3 // s c i l a b − 5 . 5 . 0
4 // O p e r a t i n g System : Windows 7 , 32− b i t
5
6 clc ;
7 clear all ;
8 clf ;
9
10 // System t r a n s f e r f u n c t i o n
11 s = poly (0 , ’ s ’ ) ;
12 g =1/( s ^2+4) ;
13
14 // Draw p o l e z e r o map o f t h e s y s t e m
15 plzr ( g ) ;
16 title ( ’ P o l e −z e r o map o f t h e s y s t e m w i t h c r i t i c a l l y
damped e i g e n v a l u e s ’ , ’ f o n t s i z e ’ ,3)
17 // C o n v e r t t h e g i v e n t r a n s f e r f u n c t i o n i n t o s t a t e
15
s p a c e form
18 sys = tf2ss ( g ) ;
19
20 // P l o t o f s y s t e m p h a s e t r a j e c t o r y
21 sys . c =[1 ,0;0 ,1];
22 sys . d =[0 0] ’;
23
24 t =0:0.2:10;
25 a1 = size ( t ) ;
26 u = zeros ( a1 (1) , a1 (2) ) ;
27 figure
28 for i = -2.0:0.5:2;
29 for j = -2:0.5:2;
30 y1 = csim (u ,t , sys ,[ i , j ] ’) ;
31 plot ( y1 (1 ,:) , y1 (2 ,:) ) ;
32 end
33 end
34 set ( gca () ,” g r i d ” ,[0.3 0.3])
35 f = get ( ” c u r r e n t f i g u r e ” ) // C u r r e n t f i g u r e h a n d l e
36 f . background =8
37 title ( ’ Phase p o r t r a i t o f t h e s y s t e m w i t h v o r t e x
p o i n t ’ , ’ f o n t s i z e ’ ,3)
38 xlabel ( ’ x1 ( t ) ’ , ’ f o n t s i z e ’ ,2)
39 ylabel ( ’ x2 ( t ) ’ , ’ f o n t s i z e ’ ,2)
16
Figure 3.1: Lab03
17
Figure 3.2: Lab03
18
Experiment: 4
1 // Lab . 0 4 : To p l o t t h e Phase p o r t r a i t o f s y s t e m s
having saddle point .
2
3 // s c i l a b − 5 . 5 . 0
4 // O p e r a t i n g System : Windows 7 , 32− b i t
5
6 clc ;
7 clear all ;
8 clf ;
9
10 // System t r a n s f e r f u n c t i o n
11 s = poly (0 , ’ s ’ ) ;
12 g =1/( s ^2+1* s -2) ;
13
14 // C o n v e r t t h e g i v e n t r a n s f e r f u n c t i o n i n t o s t a t e
s p a c e form
15 sys = tf2ss ( g ) ;
16
17 // Draw p o l e z e r o map o f t h e s y s t e m
19
18 plzr ( sys ) ;
19 title ( ’ P o l e −z e r o map o f t h e s y s t e m w i t h r e a l s t a b l e
and u n s t a b l e e i g e n v a l u e s ’ , ’ f o n t s i z e ’ ,3)
20 // P l o t o f s y s t e m p h a s e t r a j e c t o r y
21 sys . c =[1 ,0;0 ,1];
22 sys . d =[0 0] ’;
23
24 t =0:0.2:5;
25 a1 = size ( t ) ;
26 u = zeros ( a1 (1) , a1 (2) ) ;
27 figure ;
28 for i = -2.0:0.5:2;
29 for j = -2:0.5:2;
30 y1 = csim (u ,t , sys ,[ i , j ] ’) ;
31 plot ( y1 (1 ,:) , y1 (2 ,:) ) ;
32 end
33 end
34 set ( gca () ,” g r i d ” ,[0.3 0.3])
35 f = get ( ” c u r r e n t f i g u r e ” ) // C u r r e n t f i g u r e h a n d l e
36 f . background =8
37 zoom_rect ([ -3 , -3 ,3 ,3])
38 title ( ’ Phase p o r t r a i t o f t h e s y s t e m w i t h s a d d l e
p o i n t ’ , ’ f o n t s i z e ’ ,3)
39 xlabel ( ’ x1 ( t ) ’ , ’ f o n t s i z e ’ ,2)
40 ylabel ( ’ x2 ( t ) ’ , ’ f o n t s i z e ’ ,2)
20
Figure 4.1: Lab04
21
Figure 4.2: Lab04
22
Experiment: 5
23
Figure 5.1: Lab05
24
Experiment: 6
25
Figure 6.1: Lab06
26
Experiment: 7
1 // Lab . 0 8 : To c h e c k t h e s t a b i l i t y o f t h e s y s t e m
using Describing Functions .
2
3 // s c i l a b − 5 . 5 . 0
4 // O p e r a t i n g System : Windows 7 , 32− b i t
5
6 clc ;
7 clear all ;
8
9 // F r e q u e n c y Bounds
10
11 wmin =1;
12 wmax =100;
13 fmin = wmin /2/ %pi ;
14 fmax = wmax /2/ %pi ;
15
16 // System Model
27
17
18 s = poly (0 , ’ s ’ ) ;
19 g1 = syslin ( ’ c ’ ,10/(0.5* s ^3+1.5* s ^2+ s ) )
20
21 // N y q u i s t P l o t
22
23 nyquist ( g1 , fmin , fmax )
24
25
26 // P l o t o f D e s c r i b i n g F u n c t i o n o f R e l a y w i t h
Deadzone N o n l i n e a r i t y
27 x =1:0.5:10;
28 n =(2/ %pi ) *( asin (1 ./ x ) +(1 ./ x ) .* sqrt (1 -(1 ./ x )
.^2) ) ;
29 n1 = -1 ./ n ;
30 z = size ( n1 ) ;
31 plot2d ( n1 , zeros (1 , z (2) ) ,2)
32
33 h = legend ([ ’DF Contour ’ ; ’ System Contour ’ ])
28
Figure 7.1: Lab07
29
Experiment: 8
1 // Lab . 0 8 : To c h e c k t h e s t a b i l i t y o f t h e s y s t e m
u s i n g Lyapunov e q u a t i o n .
2
3 // s c i l a b − 5 . 5 . 0
4 // O p e r a t i n g System : Windows 7 , 32− b i t
5
6 clc ;
7 clear all ;
8
9 // System model
10
11 a =[0 1 0;0 0 1; -2 -3 -2];
12 q = - eye (3 ,3) ;
13 p = lyap (a ,q , ’ c ’ ) ;
14
15 // For a s t a b l e s y s t e m m a t r i x p s h o u l d be p o s i t i v e
definite for
30
16 // which a l l t h e p r i n c i p l e m i n o r s o r a l l e i g e n v a l u e s
o f t h e m a t r i x p s h o u l d be p o s i t i v e
17 eig_val = spec ( p ) ;
18 m = length ( eig_val ) ;
19 stable =0;
20 for i =1: m ;
21 if real ( eig_val ( i ) ) >0 then
22 stable = stable +1;
23 end
24 end
25 if stable == m then
26 disp ( ’ The s y s t e m i s a s y m p t o t i c a l l y s t a b l e ’ )
27 else
28 disp ( ’ The s y s t e m i s u n s t a b l e o r c r i t i c a l l y
stable ’)
29 end
31
Experiment: 9
Stabilization of double
integrator system using
variable structure control.
32
Figure 9.1: Lab09
33
Experiment: 10
34
Figure 10.1: Lab10
35
Experiment: 11
36
Figure 11.1: Lab11
37
Experiment: 12
To demonstrate model
reference adaptive control
system.
38
Figure 12.1: Lab12
39