0% found this document useful (0 votes)
137 views

Funwork 4 Problem 1: A A I Eq 2 1 2 A

This document contains the solutions to two problems involving state space models of dynamical systems: 1) It constructs the state space model of an armature-controlled DC motor. It then finds the control input to bring the system states to zero. Plots of the system states and control input over time are provided. 2) It determines the system state x(t) over time for a dynamical system, given the input u(t)=1 and the output y(t)=t^2+2t. Formulas for solving for x(t) are established.

Uploaded by

Lilibet Reyes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views

Funwork 4 Problem 1: A A I Eq 2 1 2 A

This document contains the solutions to two problems involving state space models of dynamical systems: 1) It constructs the state space model of an armature-controlled DC motor. It then finds the control input to bring the system states to zero. Plots of the system states and control input over time are provided. 2) It determines the system state x(t) over time for a dynamical system, given the input u(t)=1 and the output y(t)=t^2+2t. Formulas for solving for x(t) are established.

Uploaded by

Lilibet Reyes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Karen Reyes ECE 602

FunWork 4 Tuesday, November 05, 2019

Problem 1
Consider the following diagram of an armature controlled DC motor, where the system
parameters are: Ra = 1, La ≈ 0H, Kb = 5V /rad/sec, Ki = 5N m/A, and the equivalent
rotational inertia, Ieq = 0.1kgm2 . The gear inertia and friction are negligible. Let x1 =
θ, x2 = θ̇, and u = ea .

Figure 1: Block diagram of a DC motor system for Problem 1.

1. Construct the state space model of the DC motor system


• Applying Kirchhoff’s voltage law to the armature circuit:
dia dθ
ea = Ra ∗ ia + La ∗ + kb ∗ (1)
dt dt
• Since La is approximate zero:

ea = Ra ∗ ia + kb ∗ (2)
dt
• Applying also Newton’s second law of motion:
d2 θ dθ
T = Ieq ∗ +f ∗ (3)
dt dt
• Since f is negligible:
d2 θ
T = Ieq ∗ (4)
dt
• Appliying Laplace transform in equations (2) and (4), and solving for I(s):
Ea − kb sθ(s)
I(s) = (5)
Ra
Ieq s2 θ(s)
I(s) = (6)
ki

1
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

θ(s)
• Putting together equation (5) and (6), and solving for Ea
:

θ̇(s) ki
= 2
(7)
Ea Ra Ieq s + ki kb s
ki
θ̇(s) R I
= 2 a keqi kb s (8)
Ea s + Ra Ieq

θ̇(s) 50
= 2 (9)
Ea s + 250s
• The state space model of the motor:
   
0 1 0
ẋ = x+ u (10)
0 −250 50
 
y = 10 x (11)

2. • Let x(0) = [10 1]T . Find a control u that brings the system to x(2) = [0 0]T :

• In order to find the control u, fist W (t0, t1) was calculated using MatLab and the
following formula: Z t1
0
W (t0 , t1 ) = eAt BB 0 eA τ dxτ (12)
t0

• The resulting matrix was :


 
0.0798 0.0200
W (t0 , t1 ) = (13)
0.0200 5.0000

• The control u was founded using Matlab and the result from equation (13).

u(t) = −B 0 eA(t1 −t) W −1 (t0 , t1 )[eAt1 x0 − x1 ] (14)


2495 ∗ e250t−500 5 e−500 2501 1250 ∗ e250t−500 625
u(t) = −e−500 ∗ ( − )−( − )( − )
249 498 250 250 249 249
(15)
• The Matlab script of the previous calculations:

2
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

3. Verify your calculations with simulations. Plot x1 , x2 , and u versus time:

• Plot x1 , x2 versus time:

Figure 2: Plot x1 , x2 versus time.

3
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

• Plot u versus time:

Figure 3: Plot u versus time

Problem 2
Consider a dynamical system modeled by
   
−1/2 1/2 −1
ẋ = x+ u (16)
−1/2 1/2 1
 
y= 1 1 x (17)

Determine x(t) over the time interval [0, 10] knowing that u(t) = 1 for t ≥ 0 and y(t) = t2 +2t
for t ≥ 0.

1. Establishing the formula to determine the solution for x(t)


Z t
A(t−t0 )
x(t) = e x(t0 ) + eA(t−τ ) Bu(τ )dτ (18)
t0

2. Calculate the parameters used in formula (14):


Z t1
At0 −1 AT t0 T (t−t )
x(t0 ) = e V (t0 , t1 )e eA 0
C T g(t)dt (19)
t0

4
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

Where: Z t1
−1 T (t)
V (t0 , t1 ) = eA C T CeAt dt (20)
t0

Using MatLab the equation was solve and the result was as follow:
 730 −970 
−1 3 3
V (t0 , t1 ) = −970 1330 (21)
3 3

and for g(t): Z t


g(t) = y(t) − C eA(t−τ ) bu(τ )dτ (22)
0

the answer for equation (18) using MatLab tools:

t2 − 2t t2 + 2t
g(t) = 2t − ( )−( ) + t2 (23)
2 2
g(t) = 2t (24)

3. Then, plogging the result from equation (17) and (20) into (15) the result is:
 
−1
x(t0 ) = (25)
1

4. Finally, using the obtained result in (21) into (14) and with the help of MatLab, the
final result was obtained:

t2 −2t
   t2 
t+ 2
−1 2
−1
x(t) = t2 +2t = t2 (26)
t+ 2
+1 2
+ 2t + 1

5. The MatLab scrip is in the follow picture, to show the process in the previous equations:

5
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

Problem 3
Transform the system into its controller form:
   
0 0 1 0 0
0 0 0 1 0
ẋ = 
2
x +  u (27)
1 0 0 1
1 1 0 0 0

1. In order to calculate the controller form, I first started calculating the controllability
matrix using the following formula and implementing it in Matlab.
 
0 1 0 −2
  0 0 0 1
b Ab A2 b A3 b =   (28)
1 0 −2 0 
0 0 1 0

2. Extract the last row of the controllability matrix which is equal to q1 and will be used
t calculate the transformation matrix in the following step:

 
q1 = 0 0 1 0 (29)

3. The transformation matrix was calculated using the results from equation (25) and the
following formula:
   
q1 0 1 0 0
 q1 A  0 0 0 1 
T =
q1 A2  = 1 −1 0 0 
   (30)
q1 A3 0 0 1 −1

4. Then, calculating the matrix A in its new coordinates:


 
0 1 0 0
0 0 1 0
à = T AT −1 =
0
 (31)
0 0 1
−1 0 −3 0

5. Calculating the matrix b in its new coordinates:


 
0
0
b̃ = T b =  
0 (32)
1

6
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

6. Putting together the matrix in controller form:


   
0 1 0 0 0
0 0 1 0 0
 
(Ã, b̃) = 
0 ,  (33)
0 0 1 0
−1 0 −3 0 1

7. The Matlab script used in order to find the solution to this problem:

Problem 4
For the system construct a state variable transformation so that in the new coordinates the
controllable part is separated and distinct from the uncontrollable part.
   
−1 1 0 1 1 1
1 1 0 0 0 0
ẋ = 
0
x +  u (34)
0 4 0 0 0
1 1 −1 2 0 1

1. The controllability matrix of the pair (A,B) is found knowing the formula ant applying
the Matlab command ctrb:

 
CM = U = B AB A2 BA3 B (35)
 
1 1 −1 0 3 4 −1 4
0 0 1 1 0 1 3 5
U =
0 0 0
 (36)
0 0 0 0 0
0 1 1 3 2 7 7 19

2. Then, applying the ”qr” command from MatLab in order to decompose the controlla-

7
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

bility matrix into an upper triangular form where U = Q ∗ R, therefore T = Q−1


 
1 0 0 0
0 0 −1 0
Q= 0 0
 (37)
0 1
0 −1 0 0
 
−1 1 0 0 00 0 0 −10 −1 0 00
T =Q = (38)
0 1 0

3. Finally, applying the formulas in order to find the pair (A,B) in its news coordinates:
 
−1 −1 −1 0
−1 2 1 1
à = T AT −1 = Q−1 AQ = 
−1 0
 (39)
1 0
0 0 0 4
 
1 1
0 −1
B̃ = T B = Q−1 B =  
0 0  (40)
0 0

4. Including the MatLab script with the used functions and process:

Problem 5
Transform the pairs into their multi-input controller forms.
Pair Number 1:    
0 0 1 0 1 0
1 0 2 0
 0 0
A1 = 
0 and B1 =   (41)
1 3 0 0 0
0 0 21 5 0 1

8
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

1. The controllability matrix of the pair (A,B) is found by applying the formula, where
b1 and b2 are the columns of the matrix B:
 
U = b1 Ab1 A 2 b1 b2 (42)
 
1 0 0 0
0 1 0 0
U =0 0
 (43)
1 0
0 0 0 1
2. Then, choosing the vectors q1 and q2 in order to be able to construct the transformation
matrix T , where q1 and q2 are the last rows of the inverse matrix U.
 
q1 = 0 0 1 0 (44)
 
q1 = 0 0 0 1 (45)
3. Calculating the transformation matrix T:
   
q1 0 0 1 0
 q1 A  0 1 3 0
T =
q1 A2  = 1
   (46)
3 11 0
q2 0 0 0 1
4. Finally, applying the formulas in order to find the pair (A,B) in its news coordinates:
 
0 1 0 0
0 0 1 0
à = T AT −1 = 

 1
 (47)
2 3 0
−21 0 0 5
 
0 0
0 0
B̃ = T B = 1
 (48)
0
0 1
5. Including the MatLab script with the used functions and process:

9
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

Pair Number 2:    
−1 1 0 1 1 1
1 1 0 0 2 0
A2 = 
0
 and B2 =   (49)
0 4 0 1 0
1 1 −1 2 0 1

1. The controllability matrix of the pair (A,B) is found using the formula in Matlab and
b1 and b2 are the columns of the matrix B:

 
CM = U = b1 Ab1 b2 Ab2 (50)
 
1 1 1 0
2 3 0 1
U =1 4
 (51)
0 0
0 2 1 3

2. Then, extracting the second and fourth rows of the inverse matrix U which will be the
row vectors q1 and q2 :  
q1 = −0.5 −0.15 0.35 0.05 (52)

 
q2 = −0.25 0.25 −0.25 0.25 (53)

3. Calculating T using the following formula:


   
q1 −0.05 −0.15 0.35 0.05
q1 A −0.05 −0.15 1.35 0.05
T =  q2  = −0.25 0.25 −0.25 0.25
   (54)
q2 A 0.75 0.25 −1.25 0.25

4. Finally, applying the formulas in order to find the pair (A,B) in its news coordinates:
 
0 1 0 0
−4 5 0 0
à = T AT −1 =
0
 (55)
0 0 1
3 −3 4 1
 
0 0
1 0
B̃ = T B = 
0
 (56)
0
0 1

10
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

5. Including the MatLab script with the used functions and process:

Problem 6
For the pair use its controller form to find the matrix K:
   
0 0 1 0 1 0
1 0 2 0 0 0
A= 0 1 3 and B =   (57)
0 0 0
0 0 21 5 0 1

1. The controller form of this matrix was found in a previous problem, and it is:
   
0 1 0 0 0 0
 0 0 1 0 0
  0
(Ã, B̃) = 
 1 ,  (58)
2 3 0 1 0
−21 0 0 5 0 1

2. Obtaining the characteristic polynomial by multiplying the given eigenvalues.

eig(A − BK) = {−2, −3 + j, −3 − j, −4} (59)

P (s) = s4 + 12s3 + 54s2 + 108s + 80 (60)

3. The realization matrix can be defined as follow, since the characteristic polinomial is
know:  
0 1 0 0
 0 0 1 0 
à − B̃ K̃ = 
 0
 (61)
0 0 1 
−80 −108 −54 −12

11
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

4. Calculate B̃ K̃ using the following formula:

B̃ K̃ = Ã − (Ã − B̃ K̃) (62)

   
0 1 0 0 0 1 0 0
 0 0 1 0
− 0 0 1 0 

B̃ K̃ = 
 1
 (63)
2 3 0  0 0 0 1 
−21 0 0 5 −80 −108 −54 −12
 
0 0 0 0
0 0 0 0
B̃ K̃ =   (64)
1 2 3 −1
59 108 54 17
 
1 2 3 −1
K̃ = (65)
59 108 54 17

5. Finally calculating K since K = K̃T , where T is the transformation matrix:


 
3 11 40 −1
K = K̃T = (66)
54 207 977 17

6. The MatLab script is attached:

12
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

Problem 7
Transform the pair into its observer form.
 
0 0 1 0  
1 0 2 0
A=  and C = 1 0 0 0
0 1 3 0 0 0 0 1
0 0 21 5

1. In order to compute the observer form of the pair (A,C), first the pair has to be
transformed to (AT , C T ), then follow the same process like the controller form

2. Find the controllability matrix of the pair (AT , C T ) using the following formula, and
MatLab:

 
U = cT1 AT cT1 (AT )2 cT1 cT2 (67)
 
1 0 0 0
0 0 1 0
U =
0 1 3 0
 (68)
0 0 0 1

3. Computing the U inverse U −1 :


 
1 0 0 0
0 −3 1 0
U −1 =
0 1 0 0
 (69)
0 0 0 1

4. Then, extracting the third and fourth row of the inverse matrix U which will be the
row vectors q1 and q2 :  
q1 = 0 1 0 0 (70)

 
q2 = 0 0 0 1 (71)

5. Calculating T using the following formula:


   
q1 0 1 0 05
 q1 AT  0 0 1 0 
T = q1 (AT )2  = 1
   (72)
2 3 −21
q2 0 0 0 1

13
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

6. Finally, applying the formulas in order to find the pair (A,B) in its news coordinates:
 
0 0 1 0
1 0 2 0
à = T −T AT T = 

0
 (73)
1 3 0
0 0 −105 5
 
T 0 0 1 0
C̃ = CT = (74)
0 0 −21 1

7. Including the MatLab script with the used functions and process:

Problem 8
For the pair use its observer form to find the matrix L:
 
0 0 1 0  
1 0 2 0
A=  and C = 1 0 0 0 (75)
0 1 3 0 0 0 0 1
0 0 21 5

1. The observer form of this matrix was found in a previous problem, and it is:
 
0 0 1 0  
1 0 2 0 0 0 1 0
(Ã, C̃) =  , (76)
0 1 3 0 0 0 −21 1
0 0 −105 5

14
Karen Reyes ECE 602
FunWork 4 Tuesday, November 05, 2019

2. Obtaining the characteristic polynomial by multiplying the given eigenvalues.


eig(A − LC) = {−2, −3 + j, −3 − j, −4} (77)
P (s) = s4 + 12s3 + 54s2 + 108s + 80 (78)
3. The realization matrix can be defined as follow, since the characteristic polynomial is
know:  
0 0 0 −80
1 0 0 −108
à − L̃C̃ = 
0 1 0 −54 
 (79)
0 0 1 −12

4. Calculate L̃C̃ using the following formula:


 
1681 80
2270 108
L̃ =  
1137 54  (80)
251 17

5. Finally calculating L since L = T T L̃, where T is the transformation matrix:


 
1137 54
 3955 108 
L = T T L̃ = 
 5681
 (81)
270 
−23626 −1117
6. The MatLab script is attached:

15

You might also like