Answer HW02

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

‫کنترل خودکار پیشرفته‬

‫امید عاقب‬

‫مهیار نراقی‬
1. Companion + Jordan forms:
a.
𝑠+2 Eq.1.1
𝐻(𝑠) =
𝑠 3 +2𝑠 2 +5𝑠
0 1 0 0
̇
=> 𝑐𝑜𝑛𝑡𝑟𝑜𝑙𝑙𝑎𝑏𝑙𝑒 𝑓𝑜𝑟𝑚: 𝑥⃗ = [0 0 1 ] 𝑥⃗ + [0] 𝑢
Eq.1.2
0 −5 −2 1
𝑦 = [2 1 0]𝑥⃗
0 0 0 2
̇
=> 𝑜𝑏𝑠𝑒𝑟𝑣𝑎𝑏𝑙𝑒 𝑓𝑜𝑟𝑚: 𝑥⃗ = [1 0 −5] 𝑥⃗ + [1] 𝑢
Eq.1.3
0 1 −2 0
[
𝑦= 0 0 1 ⃗ ]𝑥
Jordan form:
𝑠+2 𝑟1 𝜆+𝑗𝛾 𝜆−𝑗𝛾 𝑎𝑓𝑡𝑒𝑟 𝑓𝑖𝑛𝑑𝑖𝑛𝑔 𝑟1 ,𝜆 𝑎𝑛𝑑 𝛾
𝐻(𝑠) = = + + ⇒ 𝑟1 = 0.4, 𝜆 = −0.2, 𝛾 =
𝑠((𝑠+1)2 +4) 𝑠 𝑠+1+𝑗2 𝑠+1−𝑗2 Eq.1.4
0.15, 𝜎 = 1, 𝜔 = −2
In which 𝜎 and 𝜔 are used as follows:
0 0 0 1 0 0 0 1
̇
=> 𝑥⃗ = [0 0 1 ] 𝑥⃗ + [0] 𝑢 = [0 0 1 ] 𝑥⃗ + [0] 𝑢
2 2) Eq.1.5
0 −(𝜎 + 𝜔 −2𝜎 1 0 −5 −2 1
𝑦 = [𝑟1 2(𝜆𝜎 − 𝛾𝜔) 2𝜆]𝑥⃗ = [0.4 0.2 −0.4]𝑥⃗
b.
𝑠+3 𝑟1 𝑟21 𝑟
22
𝑎𝑓𝑡𝑒𝑟 𝑓𝑖𝑛𝑑𝑖𝑛𝑔 𝑟1 ,𝑟21 𝑎𝑛𝑑 𝑟22 Eq.1.6
𝐻(𝑠) = (𝑠+1)2(𝑠+2) = + + (𝑠+1) 2
⇒ 𝑟1 = 1, 𝑟21 = −1 , 𝑟22 = 2
𝑠+2 𝑠+1
1 −1 2
=> 𝐻(𝑠) = + + (𝑠+1)2 Eq.1.7
𝑠+2 𝑠+1
−2 0 0 1
̇
=> 𝐽𝑜𝑟𝑑𝑎𝑛 𝑓𝑜𝑟𝑚: 𝑥⃗ = [ 0 −1 0 ] 𝑥⃗ + [0] 𝑢 ; 𝑦 = [1 −1 2]𝑥⃗ Eq.1.8
0 1 −1 0

2. According to figure1:

figure 1 inverted pendulum system.


So the equations of motion of this 2 DOF system can be easily derived using Lagrange's
method:
1 1
𝑇 = 𝑀𝑥̇ 2 + 𝑚(𝑥̇ 2 + 𝑙 2 𝜃̇ 2 + 2𝑙𝑥̇ 𝜃̇ cos(𝜃)) Eq.2.1
2 2

𝑃 = 𝑚𝑔𝑙𝑐𝑜𝑠(𝜃) Eq.2.2

ℒ =𝑇−𝑃 Eq.2.3
𝑑 𝜕ℒ 𝜕ℒ 𝑘𝑒 𝑘2𝜔 𝑘𝑒 𝑘 2𝜔
( ) − 𝜕𝑥 = 𝑓 = 𝑅𝑟 − => (𝑀 + 𝑚)𝑥̈ + 𝑚𝑙𝜃̈ cos(𝜃) − 𝑚𝑙𝜃̇ 2 sin(𝜃) = − Eq.2.4
𝑑𝑡 𝜕𝑥̇ 𝑅𝑟 𝑅𝑟 𝑅𝑟
𝑑 𝜕ℒ 𝜕ℒ
( ) − = 0 => 𝑚𝑙𝜃̈ + 𝑚𝑥̈ cos(𝜃) 𝑚𝑔𝑠𝑖𝑛(𝜃) = 0 Eq.2.5
𝑑𝑡 𝜕𝜃̇ 𝜕𝜃
If the pendulum is stabilized, eqs.2.4,5 can be simplified more to finally deal with a pair of
linear ODEs. On the other hand:
𝑥̇ = 𝑟𝜔 Eq.2.6

So after linearization and substituting eq.2.6 in eqs.2.5,6:


𝑘2 𝑚𝑔 𝑘
𝑥̈ + 𝑥̇ + 𝜃 = 𝑒 *
𝑀𝑟 2 𝑅 𝑀 𝑀𝑅𝑟
𝑀+𝑚 𝑘2 𝑘
̈𝜃 − ( ) 𝑔𝜃 − 𝑥̇ = − 𝑒 **
𝑀𝑙 𝑀𝑟 2 𝑅𝑙 𝑀𝑅𝑟𝑙
a. State-Space representation:
𝑥1 = 𝑥 𝑥1 0 1 0 0 0
𝑥̇ 1 = 𝑥2 = 𝑥̇ 𝑥2
=> 𝑥
⃗ = [ ] => 𝑥⃗ ̇ = [0 −12.5 −0.49 0
] 𝑥⃗ + [
0.25
]𝑢
𝑥3 = 𝜃 𝑥3 0 0 0 1 0
𝑥̇ 3 = 𝑥4 = 𝜃 ̇ 𝑥 4 0 12.5 10.29 0 −0.25
𝑥 𝑥1 1 0 0 0 0
𝑦 = [ ] = [𝑥 ] = [ ] 𝑥⃗ + [ ] 𝑢 Eq.2.7
𝜃 3 0 0 1 0 0
0 1 0 0 0
0 −12.5 −0.49 0 0.25 1 0 0 0 0
=> 𝐴 = [ ] & 𝐵= [ ] & 𝐶 = [ ] & 𝐷=[ ]
0 0 0 1 0 0 0 1 0 0
0 12.5 10.29 0 −0.25
b. Block diagram of the system is shown in figure2:

figure 2 block diagram of the system.


c. Transfer Function:
𝑌1 (𝑠) 0.25𝑠 2 − 2.45
𝑈(𝑠) 4 3 2 − 122.5𝑠
= 𝐻(𝑠) = 𝐶(𝑠𝐼 − 𝐴)−1 𝐵 + 𝐷 = 𝑠 + 12.5𝑠 − 10.29𝑠 2 Eq.2.8
𝑌2 (𝑠) 0.25𝑠

[ 𝑠 4 + 12.5𝑠 3 − 10.29𝑠 2 − 122.5𝑠]
[ 𝑈(𝑠)]
d. Controllable and Observable forms (Companion forms):

𝑌1 (𝑠) 0.25𝑠 2 − 2.45


= Eq.2.9
𝑈(𝑠) 𝑠 4 + 12.5𝑠 3 − 10.29𝑠 2 − 122.5𝑠
0 1 0 0 0
0 0 1 0 0
− 𝑐𝑜𝑛𝑡𝑟𝑜𝑙𝑙𝑎𝑏𝑙𝑒 𝑓𝑜𝑟𝑚: 𝐴1 = [ ] & 𝐵1 = [ ]
0 0 0 1 0
0 122.5 10.29 −12.5 1

𝐶1 = [−2.45 0 0.25 0] & 𝐷1 = [0]

0 0 0 Eqs.2.10
0
1 0 0 122.5
− 𝑜𝑏𝑠𝑒𝑟𝑣𝑎𝑏𝑙𝑒 𝑓𝑜𝑟𝑚: 𝐴2 = [ ] & 𝐵2 = [−2.45 0 0.25 0]′
0 1 0 10.29
0 0 1 −12.5

𝐶2 = [0 0 0 1] & 𝐷2 = [0]

𝑌2 (𝑠) 0.25𝑠 2
=− 4
𝑈(𝑠) 𝑠 + 12.5𝑠 3 − 10.29𝑠 2 − 122.5𝑠

0 1 0 0 0
0 0 1 0 0
− 𝑐𝑜𝑛𝑡𝑟𝑜𝑙𝑙𝑎𝑏𝑙𝑒 𝑓𝑜𝑟𝑚: 𝐴1 = [ ] & 𝐵1 = [ ]
0 0 0 1 0
0 122.5 10.29 −12.5 1
Eqs.2.11
𝐶1 = [0 0 0.25 0] & 𝐷1 = [0]

0 0 0 0 0
1 0 0 122.5 0
− 𝑜𝑏𝑠𝑒𝑟𝑣𝑎𝑏𝑙𝑒 𝑓𝑜𝑟𝑚: 𝐴2 = [ ] & 𝐵2 = [ ] & 𝐶2 = [0 0 0 1] & 𝐷2
0 1 0 10.29 0.25
0 0 1 −12.5 0
= [0]

PART.2: SIMULATION
1. Refer to the first problem of PART.1: (file: Part2_p1.m)
Which results in the same answer as PART.1.

2. Using the 'state-space' block in Simulink, the system can be easily shown as:

figure 3 Created model in Simulink.


To check the result of Part.1.Q2.c:


Which confirms the answer in c.
And for the observable and controllable forms, the code written below leads to the same answer as part d:

o Files: 'Part2_P2.slx' and 'Part2_p2.m'

3.
o Files: 'Part2_p3.mlx'

You might also like