SlideShare a Scribd company logo
4
Most read
5
Most read
7
Most read
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
Faculty of Technology, Postboks 203, Kjølnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01
	
  
Exercise	
  1a:	
  Transfer	
  functions	
  (Solutions)	
  
Transfer	
  functions	
  
Transfer	
  functions	
  are	
  a	
  model	
  form	
  based	
  on	
  the	
  Laplace	
  transform.	
  Transfer	
  functions	
  are	
  very	
  
useful	
  in	
  analysis	
  and	
  design	
  of	
  linear	
  dynamic	
  systems.	
  
A	
  general	
  Transfer	
  function	
  is	
  on	
  the	
  form:	
  
𝐻 𝑆 =
𝑦(𝑠)
𝑢(𝑠)
	
  
Where	
   𝑦	
  is	
  the	
  output	
  and	
   𝑢	
  is	
  the	
  input.	
  
A	
  general	
  transfer	
  function	
  can	
  be	
  written	
  on	
  the	
  following	
  general	
  form:	
  
𝐻 𝑠 =
𝑛𝑢𝑚𝑒𝑟𝑎𝑡𝑜𝑟(𝑠)
𝑑𝑒𝑛𝑜𝑚𝑖𝑛𝑎𝑡𝑜𝑟(𝑠)
=
𝑏! 𝑠! + 𝑏!!! 𝑠!!! + ⋯ +  𝑏! 𝑠 + 𝑏!
𝑎! 𝑠! + 𝑎!!! 𝑠!!! + ⋯ +  𝑎! 𝑠 + 𝑎!
	
  
The	
  Numerators	
  of	
  transfer	
  function	
  models	
  describe	
  the	
  locations	
  of	
  the	
  zeros	
  of	
  the	
  system,	
  while	
  
the	
  Denominators	
  of	
  transfer	
  function	
  models	
  describe	
  the	
  locations	
  of	
  the	
  poles	
  of	
  the	
  system.	
  
Differential	
  Equations	
  
While	
  the	
  transfer	
  function	
  gives	
  an	
  external	
  in-­‐out	
  representation	
  of	
  a	
  system,	
  will	
  the	
  differential	
  
equations	
  of	
  a	
  system	
  give	
  an	
  internal	
  representation	
  of	
  a	
  system.	
  
We	
  can	
  find	
  the	
  transfer	
  function	
  from	
  the	
  differential	
  equation	
  by	
  using	
  Laplace	
  and	
  Laplace	
  
transformation	
  pairs.	
  Likewise,	
  we	
  can	
  find	
  the	
  differential	
  equation	
  from	
  the	
  transfer	
  function	
  
using	
  inverse	
  Laplace.	
  
The	
  following	
  transformation	
  pair	
  is	
  much	
  used:	
  
Differentiation:	
  
1.order	
  systems:	
  
𝑥 ⟺ 𝑠𝑥(𝑠) 	
  
For	
  higher	
  order	
  systems:	
  
𝑥(!)
⟺ 𝑠!
𝑥(𝑠)	
  
2	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
Integration:	
  
𝑥 ⟺
1
𝑠
𝑥(𝑠) 	
  
Time-­‐delay:	
  
𝑢 𝑡 − 𝜏 ⟺ 𝑢(𝑠)𝑒!!"
	
  
Static	
  Time-­‐response	
  
In	
  some	
  cases	
  we	
  want	
  to	
  find	
  the	
  constant	
  value	
   𝑦!	
  of	
  the	
  time	
  response	
  when	
  the	
  time	
   𝑡 → ∞.	
  
We	
  can	
  then	
  use	
  the	
  final	
  value	
  theorem	
  (sluttverditeoremet):	
  
𝑦! = lim
!→!
𝑦 𝑡 = lim
!→!
𝑠 ∙ 𝑦(𝑠)	
  
MathScript	
  
MathScript	
  has	
  several	
  functions	
  for	
  creating	
  transfer	
  functions:	
  
Function	
   Description	
   Example	
  
tf	
   Creates	
  system	
  model	
  in	
  transfer	
  function	
  form.	
  You	
  also	
  can	
  
use	
  this	
  function	
  to	
  state-­‐space	
  models	
  to	
  transfer	
  function	
  
form.	
  
>num=[1];
>den=[1, 1, 1];
>H = tf(num, den)
Sys_order1	
   Constructs	
  the	
  components	
  of	
  a	
  first-­‐order	
  system	
  model	
  based	
  
on	
  a	
  gain,	
  time	
  constant,	
  and	
  delay	
  that	
  you	
  specify.	
  You	
  can	
  use	
  
this	
  function	
  to	
  create	
  either	
  a	
  state-­‐space	
  model	
  or	
  a	
  transfer	
  
function	
  model,	
  depending	
  on	
  the	
  output	
  parameters	
  you	
  
specify.	
  
>K = 1;
>tau = 1;
>H = sys_order1(K, tau)
Sys_order2	
   Constructs	
  the	
  components	
  of	
  a	
  second-­‐order	
  system	
  model	
  
based	
  on	
  a	
  damping	
  ratio	
  and	
  natural	
  frequency	
  you	
  specify.	
  You	
  
can	
  use	
  this	
  function	
  to	
  create	
  either	
  a	
  state-­‐space	
  model	
  or	
  a	
  
transfer	
  function	
  model,	
  depending	
  on	
  the	
  output	
  parameters	
  
you	
  specify.	
  
>dr = 0.5
>wn = 20
>[num, den] = sys_order2(wn, dr)
>SysTF = tf(num, den)
step	
   Creates	
  a	
  step	
  response	
  plot	
  of	
  the	
  system	
  model.	
  You	
  also	
  can	
  
use	
  this	
  function	
  to	
  return	
  the	
  step	
  response	
  of	
  the	
  model	
  
outputs.	
  If	
  the	
  model	
  is	
  in	
  state-­‐space	
  form,	
  you	
  also	
  can	
  use	
  this	
  
function	
  to	
  return	
  the	
  step	
  response	
  of	
  the	
  model	
  states.	
  This	
  
function	
  assumes	
  the	
  initial	
  model	
  states	
  are	
  zero.	
  If	
  you	
  do	
  not	
  
specify	
  an	
  output,	
  this	
  function	
  creates	
  a	
  plot.	
  
>num=[1,1];
>den=[1,-1,3];
>H=tf(num,den);
>t=[0:0.01:10];
>step(H,t);
Example:	
  
Given	
  the	
  following	
  transfer	
  function:	
  
𝐻 𝑠 =
1
𝑠 + 1
	
  
In	
  MathScript	
  we	
  will	
  use	
  the	
  following	
  code:	
  
% Define Transfer function
3	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
num = [1];
den = [1, 1];
H = tf(num, den)
% Step Response
step(H)
This	
  gives	
  the	
  following	
  step	
  response:	
  
	
  
A	
  general	
  transfer	
  function	
  can	
  be	
  written	
  on	
  the	
  following	
  general	
  form:	
  
𝐻 𝑠 =
𝑛𝑢𝑚𝑒𝑟𝑎𝑡𝑜𝑟(𝑠)
𝑑𝑒𝑛𝑜𝑚𝑖𝑛𝑎𝑡𝑜𝑟(𝑠)
=
𝑏! 𝑠! + 𝑏!!! 𝑠!!! + ⋯ +  𝑏! 𝑠 + 𝑏!
𝑎! 𝑠! + 𝑎!!! 𝑠!!! + ⋯ +  𝑎! 𝑠 + 𝑎!
	
  
The	
  Numerators	
  of	
  transfer	
  function	
  models	
  describe	
  the	
  locations	
  of	
  the	
  zeros	
  of	
  the	
  system,	
  while	
  
the	
  Denominators	
  of	
  transfer	
  function	
  models	
  describe	
  the	
  locations	
  of	
  the	
  poles	
  of	
  the	
  system.	
  
In	
  MathScript	
  we	
  can	
  define	
  such	
  a	
  transfer	
  function	
  using	
  the	
  built-­‐in	
  tf	
  function	
  as	
  follows:	
  
num = [bm, bm_1, bm_2, … , b1, b0];
den = [an, an_1, an_2, … , a1, a0];
H = tf(num, den)
Task	
  1:	
  Differential	
  equations	
  to	
  Transfer	
  functions	
  
Task	
  1.1	
  
Given	
  the	
  following	
  differential	
  equation:	
  
𝑥 = −0.5𝑥 + 2𝑢	
  
Find	
  the	
  following	
  transfer	
  function:	
  
4	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
𝐻 𝑠 =
𝑥(𝑠)
𝑢(𝑠)
	
  
Solution:	
  
Laplace	
  gives:	
  
𝑠𝑥(𝑠) = −0.5𝑥(𝑠) + 2𝑢(𝑠)	
  
Further:	
  
𝑠𝑥 𝑠 + 0.5𝑥(𝑠) = 2𝑢(𝑠)	
  
Further:	
  
𝑥 𝑠 (𝑠 + 0.5) = 2𝑢(𝑠)	
  
Further:	
  
𝑥 𝑠
𝑢(𝑠)
=
2
𝑠 + 0.5
=
4
2𝑠 + 1
	
  
This	
  gives:	
  
𝐻 𝑠 =
𝑥 𝑠
𝑢(𝑠)
=
4
2𝑠 + 1
	
  
Task	
  1.2	
  
Given	
  the	
  following	
  2.order	
  differential	
  equation:	
  
𝑦 + 𝑦 + 5𝑦 = 5𝑥	
  
Find	
  the	
  following	
  transfer	
  function:	
  
𝐻 𝑠 =
𝑦(𝑠)
𝑥(𝑠)
	
  
Solution:	
  
We	
  get:	
  
𝑠!
𝑦 𝑠 + 𝑠𝑦 𝑠 + 5𝑦 𝑠 = 5𝑠𝑥(𝑠)	
  
Further:	
  
𝑦 𝑠 [𝑠!
+ 𝑠 + 5] = 5𝑠𝑥(𝑠)	
  
This	
  gives	
  the	
  following	
  transfer	
  function:	
  
𝑦 𝑠
𝑥(𝑠)
=
5𝑠
𝑠! + 𝑠 + 5
	
  
5	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
	
  
Task	
  2:	
  Transfer	
  functions	
  to	
  differential	
  equatons	
  
Given	
  the	
  following	
  system:	
  
𝐻 𝑠 =
𝑥(𝑠)
𝑢(𝑠)
=
3
0.5𝑠 + 1
	
  
Task	
  2.1	
  
Find	
  the	
  differential	
  equation	
  from	
  the	
  transfer	
  function	
  above.	
  
Solution:	
  
We	
  get:	
  
𝑥(𝑠) 0.5𝑠 + 1 = 3𝑢(𝑠)	
  
Further:  
0.5𝑠𝑥 𝑠 + 𝑥(𝑠) = 3𝑢(𝑠)	
  
Inverse	
  Laplace	
  gives:	
  
0.5𝑥 + 𝑥 = 3𝑢	
  
This	
  gives	
  the	
  following	
  differential	
  equation:	
  
𝑥 = −2𝑥 + 6𝑢	
  
Task	
  2.2	
  
Draw	
  a	
  block	
  diagram	
  of	
  the	
  system.	
  
Solution:	
  
We	
  can	
  draw	
  the	
  following	
  block	
  diagram:	
  
	
  
6	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
Note!	
  Even	
  when	
  the	
  system	
  is	
  in	
  the	
  time	
  plane	
  we	
  normally	
  use	
  the	
  symbol	
   .	
  Other	
  symbols	
  that	
  
are	
  commonly	
  used	
  for	
  the	
  integrator	
  are:	
   	
  or	
   	
  
Task	
  3:	
  2.order	
  system	
  
Given	
  the	
  following	
  transfer	
  function:	
  
𝐻 𝑠 =
𝑦(𝑠)
𝑢(𝑠)
=
2𝑠 + 3
𝑠! + 4𝑠 + 3
	
  
Task	
  3.1	
  
Find	
  the	
  differential	
  equation	
  for	
  the	
  system.	
  
Solution:	
  
We	
  do	
  as	
  follows:	
  
𝑦 𝑠 𝑠!
+ 4𝑠 + 3 = 𝑢 𝑠 [2𝑠 + 3]	
  
This	
  gives:	
  
𝑠!
𝑦 𝑠 + 4𝑠𝑦 𝑠 + 3𝑦 𝑠 = 2𝑠𝑢 𝑠 + 3𝑢(𝑠)	
  
This	
  gives	
  the	
  following	
  differential	
  equation:	
  
𝑦 + 4𝑦 + 3𝑦 = 2𝑢 + 3𝑢	
  
Note!	
  We	
  have	
  used	
  the	
  rule:	
  
𝑥(!)
⟺ 𝑠!
𝑥(𝑠)	
  
Task	
  4:	
  Static	
  Time-­‐response	
  
Task	
  4.1	
  
Given	
  the	
  following	
  system:	
  
𝐻(𝑠) =
𝑦(𝑠)
𝑢(𝑠)
=
3
2𝑠 + 1
	
  
Find	
  the	
  static	
  time-­‐response.	
  
We	
  will	
  use	
  a	
  step	
  for	
  the	
  control	
  signal	
  ( 𝑢 𝑡 = 1).	
  
Note!	
  The	
  Laplace	
  Transformation	
  pair	
  for	
  a	
  step	
  is	
  as	
  follows:	
  
7	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
1
𝑠
⇔ 1 	
  
Solution:	
  
We	
  have:	
  
𝐻(𝑠) =
𝑦(𝑠)
𝑢(𝑠)
=
3
2𝑠 + 1
	
  
Meaning	
  that:	
  
𝑦(𝑠) =
3
2𝑠 + 1
𝑢(𝑠)	
  
where	
   𝑢 𝑠 =
!
!
	
  
This	
  means:	
  
𝑦 𝑠 =
3
2𝑠 + 1
∙
1
𝑠
=
3
2𝑠 + 1 𝑠
	
  
Then	
  we	
  use	
  the	
  final	
  value	
  theorem	
  (sluttverditeoremet):	
  
𝑦! = lim
!→!
𝑦 𝑡 = lim
!→!
𝑠 ∙ 𝑦 𝑠 = lim
!→!
  𝑠
3
2𝑠 + 1 𝑠
= lim
!→!
  
3
2𝑠 + 1
=
3
2 ∙ 0 + 1
= 3	
  
Task	
  4.2	
  
Given	
  the	
  following	
  system:	
  
𝐻(𝑠) =
𝑦(𝑠)
𝑢(𝑠)
=
6(𝑠 + 1)
9𝑠 + 0.25
	
  
Find	
  the	
  static	
  time-­‐response.	
  
We	
  will	
  use	
  a	
  step	
  for	
  the	
  control	
  signal	
  ( 𝑢 𝑡 = 1).	
  
Solution:	
  
We	
  get:	
  
𝑦(𝑠) =
6(𝑠 + 1)
9𝑠 + 0.25
𝑢(𝑠)	
  
where	
   𝑢 𝑠 =
!
!
	
  
This	
  means:	
  
𝑦 𝑠 =
6(𝑠 + 1)
9𝑠 + 0.25 𝑠
	
  
8	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
Then	
  we	
  get	
  using	
  the	
  final	
  value	
  theorem:	
  
𝑦! = lim
!→!
𝑦 𝑡 = lim
!→!
𝑠 ∙ 𝑦 𝑠 = lim
!→!
  𝑠
6 𝑠 + 1
9𝑠 + 0.25 𝑠
= lim
!→!
  
6(𝑠 + 1)
9𝑠 + 0.25
=
6(0 + 1)
9 ∙ 0 + 0.25
=
6
0.25
= 24	
  
Task	
  5:	
  1.order	
  transfer	
  functions	
  
Given	
  the	
  following	
  system:	
  
𝐻(𝑠) =
𝑦(𝑠)
𝑢(𝑠)
=
2
4𝑠 + 1
	
  
Task	
  5.1	
  
What	
  are	
  the	
  values	
  for	
  the	
  gain	
   𝐾	
  and	
  the	
  time	
  constant	
   𝑇	
  for	
  this	
  system?	
  
Sketch	
  the	
  step	
  response	
  for	
  the	
  system	
  using	
  “pen	
  and	
  paper”.	
  	
  
Find	
  the	
  step	
  response	
  using	
  MathScript	
  and	
  compare	
  the	
  result	
  with	
  your	
  sketch.	
  
Solutions:	
  
Gain	
   𝐾	
  and	
  the	
  time-­‐constant	
   𝑇:	
  
𝐾 = 2	
  
𝑇 = 4	
  
Step	
  response	
  for	
  a	
  1.order	
  system:	
  
	
  
MathScript:	
  
clear
9	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
clc
K=2;
T=4;
num=[K];
den=[T, 1];
H = tf(num, den);
step(H)
This	
  gives	
  the	
  following	
  plot:	
  
	
  
For	
  a	
  1.order	
  system	
  with	
  time-­‐delay	
  we	
  have:	
  
	
  
Task	
  5.2	
  
10	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
Find	
  the	
  differential	
  equation	
  from	
  the	
  transfer	
  function	
  above	
  and	
  draw	
  a	
  block	
  diagram	
  of	
  the	
  
system	
  (“pen	
  and	
  paper”).	
  
Solutions:	
  
For	
  a	
  1.order	
  system	
  in	
  general	
  we	
  have:	
  
𝐻(𝑠) =
𝑦(𝑠)
𝑢(𝑠)
=
𝐾
𝑇𝑠 + 1
	
  
or:	
  
𝑦 𝑠 =
𝐾
𝑇𝑠 + 1
𝑢(𝑠)	
  
Which	
  gives:	
  
𝑦 𝑠 (𝑇𝑠 + 1) = 𝐾𝑢(𝑠)	
  
𝑇𝑠𝑦 𝑠 + 𝑦(𝑠) = 𝐾𝑢(𝑠)	
  
In	
  the	
  time	
  domain	
  we	
  get	
  the	
  following	
  differential	
  equation	
  (using	
  Inverse	
  Laplace):	
  
𝑦 =
1
𝑇
(−𝑦 + 𝐾𝑢)	
  
We	
  can	
  draw	
  the	
  following	
  block	
  diagram	
  of	
  the	
  system:	
  
	
  
Where	
   𝐾 = 2	
  and	
   𝑇 = 4	
  for	
  our	
  system:	
  
	
  
Note!	
  Even	
  when	
  the	
  system	
  is	
  in	
  the	
  time	
  plane	
  we	
  normally	
  use	
  the	
  symbol	
   .	
  Other	
  symbols	
  that	
  
are	
  commonly	
  used	
  for	
  the	
  integrator	
  are:	
   	
  or	
   .	
  
Task	
  5.3	
  
11	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
From	
  the	
  block	
  diagram	
  in	
  Task	
  1.2,	
  find	
  the	
  transfer	
  function	
   𝐻(𝑠) =
!(!)
!(!)
	
  
(The	
  answer	
  shall	
  of	
  course	
  be	
   𝐻(𝑠) =
!(!)
!(!)
=
!
!!!!
)	
  
Solutions:	
  
From	
  the	
  block	
  diagram	
  in	
  the	
  previous	
  task	
  we	
  get	
  the	
  following	
  transfer	
  function:	
  
𝐻 𝑠 =
𝑦 𝑠
𝑢 𝑠
= 2 ∙
0.25 ∙
1
𝑠
1 + 0.25 ∙
1
𝑠
=
0.5
𝑠 + 0.25
=
2
4𝑠 + 1
	
  
As	
  expected,	
  the	
  result	
  is	
  the	
  same	
  as	
  the	
  transfer	
  function	
  given	
  in	
  Task	
  1.1.	
  
Note!	
  We	
  have	
  used	
  both	
  the	
  serial	
  and	
  feedback	
  rules	
  that	
  yield	
  for	
  block	
  diagram	
  reduction.	
  
	
  
	
  
Task	
  5.4	
  
Find	
  the	
  solution	
  for	
  the	
  differential	
  equation	
  and	
  plot	
  it	
  (“pen	
  and	
  paper”).	
  
We	
  will	
  use	
  a	
  step	
  for	
  the	
  control	
  signal	
  ( 𝑢 𝑡 = 1).	
  
Note!	
  The	
  Laplace	
  Transformation	
  pair	
  for	
  a	
  step	
  is	
  as	
  follows:	
  
1
𝑠
⇔ 1 	
  
Tip!	
  You	
  also	
  need	
  to	
  use	
  the	
  following	
  Laplace	
  transform	
  pair:	
  
𝐾
𝑇𝑠 + 1 𝑠
  ⇔ 𝐾(1 − 𝑒!!/!
) 	
  
Compare	
  to	
  the	
  results	
  from	
  Task	
  1.1.	
  
Solutions:	
  
12	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
For	
  a	
  1.order	
  system	
  in	
  general	
  we	
  have:	
  
𝐻(𝑠) =
𝑦(𝑠)
𝑢(𝑠)
=
𝐾
𝑇𝑠 + 1
	
  
Here	
  we	
  will	
  find	
  the	
  mathematical	
  expression	
  for	
  the	
  step	
  response	
  ( 𝑦(𝑡)):	
  
𝑦 𝑠 = 𝐻 𝑠 𝑢(𝑠)	
  
Where	
  	
  
𝑢 𝑠 =
𝑈
𝑠
	
  
We	
  use	
  inverse	
  Laplace	
  and	
  find	
  the	
  corresponding	
  transformation	
  pair	
  in	
  order	
  to	
  find	
   𝑦(𝑡)).	
  	
  
𝑦 𝑠 =
𝐾
𝑇𝑠 + 1
∙
𝑈
𝑠
	
  
We	
  use	
  the	
  following	
  Laplace	
  transform	
  pair:	
  
𝐾
𝑇𝑠 + 1 𝑠
  ⇔ 𝐾(1 − 𝑒!!/!
) 	
  
This	
  gives:	
  
𝑦 𝑡 = 𝐾𝑈(1 − 𝑒!!/!
)	
  
Setting	
   𝐾 = 2,	
   𝑇 = 4	
  and	
   𝑈 = 1	
  gives:	
  
𝑦 𝑡 = 2(1 − 𝑒
!
!
! !
)	
  
We	
  can	
  plot	
  this	
  in	
  MathScript:	
  
clear
clc
K=2;
T=4;
U=1;
t=0:0.1:20;
% Method 1 - Transfer Function
num=[K];
den=[T, 1];
H = tf(num, den);
figure(1)
step(H, t)
13	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
% Method 2 - Plot the solution of the differential equation
y = K*U*(1-exp(-t/T));
figure(2)
plot(t,y)
We	
  get	
  the	
  same	
  results	
  (of	
  course).	
  
Task	
  6:	
  Transfer	
  functions	
  in	
  MathScript	
  
Define	
  the	
  following	
  transfer	
  functions	
  in	
  MathScript.	
  
Task	
  6.1	
  
	
  Given	
  the	
  following	
  transfer	
  function:	
  
𝐻(𝑠) =
2𝑠! + 3𝑠 + 4
5𝑠 + 9
	
  
Solutions:	
  
MathScript	
  Code:	
  
num = [2, 3, 4];
den = [5, 9];
H = tf(num, den)
Task	
  6.2	
  
	
  Given	
  the	
  following	
  transfer	
  function:	
  
𝐻(𝑠) =
4𝑠! + 3𝑠 + 4
5𝑠! + 9
	
  
Solutions:	
  
MathScript	
  Code:	
  
num = [4, 0, 0, 3, 4];
den = [5, 0, 9];
H = tf(num, den)
Note!	
  If	
  some	
  of	
  the	
  orders	
  are	
  missing,	
  we	
  just	
  put	
  in	
  zeros.	
  The	
  transfer	
  function	
  above	
  can	
  be	
  
rewritten	
  as:	
  
𝐻(𝑠) =
4𝑠! + 0 ∙ 𝑠! + 0 ∙ 𝑠! + 3𝑠 + 4
5𝑠! + 0 ∙ 𝑠 + 9
	
  
Task	
  6.3	
  
	
  Given	
  the	
  following	
  transfer	
  function:	
  
14	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
𝐻(𝑠) =
7 + 3𝑠 + 2𝑠!
5𝑠 + 6𝑠!
	
  
Solutions:	
  
We	
  need	
  to	
  rewrite	
  the	
  transfer	
  function	
  to	
  get	
  it	
  in	
  correct	
  orders:	
  
𝐻(𝑠) =
2𝑠! + 3𝑠 + 7
6𝑠! + 5𝑠
	
  
MathScript	
  Code:	
  
num = [2, 3, 7];
den = [6, 5, 0];
H = tf(num, den)
Task	
  7:	
  Differential	
  equations	
  to	
  Transfer	
  functions	
  
Task	
  7.1	
  
Given	
  the	
  following	
  differential	
  equation:	
  
𝑥 = −0.5𝑥 + 2𝑢	
  
Find	
  the	
  following	
  transfer	
  function:	
  
𝐻 𝑠 =
𝑥(𝑠)
𝑢(𝑠)
	
  
Solution:	
  
Laplace	
  gives:	
  
𝑠𝑥(𝑠) = −0.5𝑥(𝑠) + 2𝑢(𝑠)	
  
Further:	
  
𝑠𝑥 𝑠 + 0.5𝑥(𝑠) = 2𝑢(𝑠)	
  
Further:	
  
𝑥 𝑠 (𝑠 + 0.5) = 2𝑢(𝑠)	
  
Further:	
  
𝑥 𝑠
𝑢(𝑠)
=
2
𝑠 + 0.5
=
4
2𝑠 + 1
	
  
This	
  gives:	
  
𝐻 𝑠 =
𝑥 𝑠
𝑢(𝑠)
=
4
2𝑠 + 1
	
  
15	
  
EE4107	
  -­‐	
  Cybernetics	
  Advanced	
  
	
  
Task	
  8:	
  PI	
  Controller	
  
A	
  PI	
  controller	
  is	
  defined	
  as:	
  
𝑢(𝑡) = 𝐾! 𝑒 +
𝐾!
𝑇!
𝑒𝑑𝜏
!
!
	
  
Where	
  u	
  is	
  the	
  controller	
  output	
  and	
   𝑒  is	
  the	
  control	
  error:	
  
𝑒 𝑡 = 𝑟 𝑡 − 𝑦(𝑡)	
  
Task	
  8.1	
  
Find	
  the	
  transfer	
  function	
  for	
  the	
  PI	
  Controller:	
  
𝐻! 𝑠 =
𝑢(𝑠)
𝑒(𝑠)
	
  
Solutions:	
  
Using	
  Laplace	
  gives:	
  
𝑢 𝑠 = 𝐾! 𝑒 𝑠 +
𝐾!
𝑇!
∙
1
𝑠
𝑒 𝑠 	
  
Then	
  we	
  get:	
  
𝐻! 𝑠 =
𝑢(𝑠)
𝑒(𝑠)
= 𝐾! +
𝐾!
𝑇! 𝑠
=
𝐾! 𝑇! 𝑠
𝑇! 𝑠
+
𝐾!
𝑇! 𝑠
=
𝐾! 𝑇! 𝑠 + 𝐾!
𝑇! 𝑠
=
𝐾!(𝑇! 𝑠 + 1)
𝑇! 𝑠
	
  
This	
  gives	
  the	
  following	
  transfer	
  function	
  for	
  the	
  PI	
  controller:	
  
𝐻! 𝑠 =
𝑢(𝑠)
𝑒(𝑠)
=
𝐾!(𝑇! 𝑠 + 1)
𝑇! 𝑠
	
  
Additional	
  Resources	
  
• http://home.hit.no/~hansha/?lab=mathscript
Here you will find tutorials, additional exercises, etc. 	
  
	
  

More Related Content

PPTX
ME-314- Control Engineering - Week 03-04
Dr. Bilal Siddiqui, C.Eng., MIMechE, FRAeS
 
PPTX
Block diagram
Sagar Kuntumal
 
PPTX
02 physical.system.modelling mechanical.systems.
Mahmoud Hussein
 
PPT
Transfer function and mathematical modeling
vishalgohel12195
 
PPTX
Transfer function, determination of transfer function in mechanical and elect...
Saad Mohammad Araf
 
PDF
Two ports
Selomon birhane
 
PDF
Control system Lab record
Yuvraj Singh
 
PPTX
Chapter 3 mathematical modeling of dynamic system
LenchoDuguma
 
ME-314- Control Engineering - Week 03-04
Dr. Bilal Siddiqui, C.Eng., MIMechE, FRAeS
 
Block diagram
Sagar Kuntumal
 
02 physical.system.modelling mechanical.systems.
Mahmoud Hussein
 
Transfer function and mathematical modeling
vishalgohel12195
 
Transfer function, determination of transfer function in mechanical and elect...
Saad Mohammad Araf
 
Two ports
Selomon birhane
 
Control system Lab record
Yuvraj Singh
 
Chapter 3 mathematical modeling of dynamic system
LenchoDuguma
 

What's hot (20)

PPT
Control chap2
Mohd Ashraf Shabarshah
 
PDF
Frequency Response Analysis
Hussain K
 
PPT
Control chap3
Mohd Ashraf Shabarshah
 
PDF
6. steady state error
shurjeel amjad
 
PDF
Modern Control - Lec 05 - Analysis and Design of Control Systems using Freque...
Amr E. Mohamed
 
PPTX
Me314 week08-stability and steady state errors
Dr. Bilal Siddiqui, C.Eng., MIMechE, FRAeS
 
PDF
Time domain specifications of second order system
Syed Saeed
 
PPT
STate Space Analysis
Hussain K
 
PPT
Control chap5
Mohd Ashraf Shabarshah
 
PPTX
Block diagram
yash patel
 
PPTX
Time Response Analysis
Manthan Kanani
 
PPT
State space analysis, eign values and eign vectors
Shilpa Shukla
 
PPT
ppt on Time Domain and Frequency Domain Analysis
sagar_kamble
 
PPTX
Control system lectures
Naqqash Sajid
 
PPTX
Control System Design
Hitesh Sharma
 
PDF
Chap1see4113
Shaiful Nubairi
 
PPTX
block diagram representation of control systems
Ahmed Elmorsy
 
PPT
Frequency response analysis
SATHEESH C S
 
PDF
Modern Control - Lec 01 - Introduction to Control System
Amr E. Mohamed
 
Control chap2
Mohd Ashraf Shabarshah
 
Frequency Response Analysis
Hussain K
 
Control chap3
Mohd Ashraf Shabarshah
 
6. steady state error
shurjeel amjad
 
Modern Control - Lec 05 - Analysis and Design of Control Systems using Freque...
Amr E. Mohamed
 
Me314 week08-stability and steady state errors
Dr. Bilal Siddiqui, C.Eng., MIMechE, FRAeS
 
Time domain specifications of second order system
Syed Saeed
 
STate Space Analysis
Hussain K
 
Control chap5
Mohd Ashraf Shabarshah
 
Block diagram
yash patel
 
Time Response Analysis
Manthan Kanani
 
State space analysis, eign values and eign vectors
Shilpa Shukla
 
ppt on Time Domain and Frequency Domain Analysis
sagar_kamble
 
Control system lectures
Naqqash Sajid
 
Control System Design
Hitesh Sharma
 
Chap1see4113
Shaiful Nubairi
 
block diagram representation of control systems
Ahmed Elmorsy
 
Frequency response analysis
SATHEESH C S
 
Modern Control - Lec 01 - Introduction to Control System
Amr E. Mohamed
 
Ad

Similar to Exercise 1a transfer functions - solutions (20)

PPTX
Electrical Network Transfer Functions.pptx
KyleEmperado
 
PPTX
Electrical Network Transfer Functions.pptx
KyleEmperado
 
PPT
Meeting w3 chapter 2 part 1
Hattori Sidek
 
PPT
Meeting w3 chapter 2 part 1
mkazree
 
PPTX
Transfer Functions-Feedback and Control System
imhaneuloh02
 
DOC
Basic Control System unit6
Asraf Malik
 
PDF
Lec9
Rishit Shah
 
PDF
Fourier and Laplace transforms in analysis of CT systems PDf.pdf
Dr.SHANTHI K.G
 
PDF
Modern Control System (BE)
PRABHAHARAN429
 
PPTX
ppt on Control system engineering (1).pptx
SangeetaTripathi8
 
PPTX
Gmit cse presentation
Chauhan Vishal
 
PDF
Tutorials questions
mohammed mahmood
 
PDF
Modern Control - Lec 02 - Mathematical Modeling of Systems
Amr E. Mohamed
 
PDF
Unit-1 & 2_EE-321_Control Engineering_PPT.pdf
HemlataDevra
 
PPTX
Lecture_03_EEE 363_Control System.pptx
TasnimAhmad14
 
PPTX
TRANSFER FUNCTION (4).pptx
ankit317032
 
PPTX
Control System - Laplase transform, Transfer function
Dinesh Silva
 
PPTX
Lecture 2 transfer-function
Saifullah Memon
 
PDF
LCE-UNIT 2 PPT.pdf
HODECE21
 
PDF
EC2255-_Control_System_Notes_solved_prob.pdf
Mahamad Jawhar
 
Electrical Network Transfer Functions.pptx
KyleEmperado
 
Electrical Network Transfer Functions.pptx
KyleEmperado
 
Meeting w3 chapter 2 part 1
Hattori Sidek
 
Meeting w3 chapter 2 part 1
mkazree
 
Transfer Functions-Feedback and Control System
imhaneuloh02
 
Basic Control System unit6
Asraf Malik
 
Fourier and Laplace transforms in analysis of CT systems PDf.pdf
Dr.SHANTHI K.G
 
Modern Control System (BE)
PRABHAHARAN429
 
ppt on Control system engineering (1).pptx
SangeetaTripathi8
 
Gmit cse presentation
Chauhan Vishal
 
Tutorials questions
mohammed mahmood
 
Modern Control - Lec 02 - Mathematical Modeling of Systems
Amr E. Mohamed
 
Unit-1 & 2_EE-321_Control Engineering_PPT.pdf
HemlataDevra
 
Lecture_03_EEE 363_Control System.pptx
TasnimAhmad14
 
TRANSFER FUNCTION (4).pptx
ankit317032
 
Control System - Laplase transform, Transfer function
Dinesh Silva
 
Lecture 2 transfer-function
Saifullah Memon
 
LCE-UNIT 2 PPT.pdf
HODECE21
 
EC2255-_Control_System_Notes_solved_prob.pdf
Mahamad Jawhar
 
Ad

Recently uploaded (20)

PDF
Introduction to Data Science: data science process
ShivarkarSandip
 
PPTX
easa module 3 funtamental electronics.pptx
tryanothert7
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
DOCX
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PPTX
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
Introduction to Data Science: data science process
ShivarkarSandip
 
easa module 3 funtamental electronics.pptx
tryanothert7
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 

Exercise 1a transfer functions - solutions

  • 1. EE4107  -­‐  Cybernetics  Advanced     Faculty of Technology, Postboks 203, Kjølnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01   Exercise  1a:  Transfer  functions  (Solutions)   Transfer  functions   Transfer  functions  are  a  model  form  based  on  the  Laplace  transform.  Transfer  functions  are  very   useful  in  analysis  and  design  of  linear  dynamic  systems.   A  general  Transfer  function  is  on  the  form:   𝐻 𝑆 = 𝑦(𝑠) 𝑢(𝑠)   Where   𝑦  is  the  output  and   𝑢  is  the  input.   A  general  transfer  function  can  be  written  on  the  following  general  form:   𝐻 𝑠 = 𝑛𝑢𝑚𝑒𝑟𝑎𝑡𝑜𝑟(𝑠) 𝑑𝑒𝑛𝑜𝑚𝑖𝑛𝑎𝑡𝑜𝑟(𝑠) = 𝑏! 𝑠! + 𝑏!!! 𝑠!!! + ⋯ +  𝑏! 𝑠 + 𝑏! 𝑎! 𝑠! + 𝑎!!! 𝑠!!! + ⋯ +  𝑎! 𝑠 + 𝑎!   The  Numerators  of  transfer  function  models  describe  the  locations  of  the  zeros  of  the  system,  while   the  Denominators  of  transfer  function  models  describe  the  locations  of  the  poles  of  the  system.   Differential  Equations   While  the  transfer  function  gives  an  external  in-­‐out  representation  of  a  system,  will  the  differential   equations  of  a  system  give  an  internal  representation  of  a  system.   We  can  find  the  transfer  function  from  the  differential  equation  by  using  Laplace  and  Laplace   transformation  pairs.  Likewise,  we  can  find  the  differential  equation  from  the  transfer  function   using  inverse  Laplace.   The  following  transformation  pair  is  much  used:   Differentiation:   1.order  systems:   𝑥 ⟺ 𝑠𝑥(𝑠)   For  higher  order  systems:   𝑥(!) ⟺ 𝑠! 𝑥(𝑠)  
  • 2. 2   EE4107  -­‐  Cybernetics  Advanced     Integration:   𝑥 ⟺ 1 𝑠 𝑥(𝑠)   Time-­‐delay:   𝑢 𝑡 − 𝜏 ⟺ 𝑢(𝑠)𝑒!!"   Static  Time-­‐response   In  some  cases  we  want  to  find  the  constant  value   𝑦!  of  the  time  response  when  the  time   𝑡 → ∞.   We  can  then  use  the  final  value  theorem  (sluttverditeoremet):   𝑦! = lim !→! 𝑦 𝑡 = lim !→! 𝑠 ∙ 𝑦(𝑠)   MathScript   MathScript  has  several  functions  for  creating  transfer  functions:   Function   Description   Example   tf   Creates  system  model  in  transfer  function  form.  You  also  can   use  this  function  to  state-­‐space  models  to  transfer  function   form.   >num=[1]; >den=[1, 1, 1]; >H = tf(num, den) Sys_order1   Constructs  the  components  of  a  first-­‐order  system  model  based   on  a  gain,  time  constant,  and  delay  that  you  specify.  You  can  use   this  function  to  create  either  a  state-­‐space  model  or  a  transfer   function  model,  depending  on  the  output  parameters  you   specify.   >K = 1; >tau = 1; >H = sys_order1(K, tau) Sys_order2   Constructs  the  components  of  a  second-­‐order  system  model   based  on  a  damping  ratio  and  natural  frequency  you  specify.  You   can  use  this  function  to  create  either  a  state-­‐space  model  or  a   transfer  function  model,  depending  on  the  output  parameters   you  specify.   >dr = 0.5 >wn = 20 >[num, den] = sys_order2(wn, dr) >SysTF = tf(num, den) step   Creates  a  step  response  plot  of  the  system  model.  You  also  can   use  this  function  to  return  the  step  response  of  the  model   outputs.  If  the  model  is  in  state-­‐space  form,  you  also  can  use  this   function  to  return  the  step  response  of  the  model  states.  This   function  assumes  the  initial  model  states  are  zero.  If  you  do  not   specify  an  output,  this  function  creates  a  plot.   >num=[1,1]; >den=[1,-1,3]; >H=tf(num,den); >t=[0:0.01:10]; >step(H,t); Example:   Given  the  following  transfer  function:   𝐻 𝑠 = 1 𝑠 + 1   In  MathScript  we  will  use  the  following  code:   % Define Transfer function
  • 3. 3   EE4107  -­‐  Cybernetics  Advanced     num = [1]; den = [1, 1]; H = tf(num, den) % Step Response step(H) This  gives  the  following  step  response:     A  general  transfer  function  can  be  written  on  the  following  general  form:   𝐻 𝑠 = 𝑛𝑢𝑚𝑒𝑟𝑎𝑡𝑜𝑟(𝑠) 𝑑𝑒𝑛𝑜𝑚𝑖𝑛𝑎𝑡𝑜𝑟(𝑠) = 𝑏! 𝑠! + 𝑏!!! 𝑠!!! + ⋯ +  𝑏! 𝑠 + 𝑏! 𝑎! 𝑠! + 𝑎!!! 𝑠!!! + ⋯ +  𝑎! 𝑠 + 𝑎!   The  Numerators  of  transfer  function  models  describe  the  locations  of  the  zeros  of  the  system,  while   the  Denominators  of  transfer  function  models  describe  the  locations  of  the  poles  of  the  system.   In  MathScript  we  can  define  such  a  transfer  function  using  the  built-­‐in  tf  function  as  follows:   num = [bm, bm_1, bm_2, … , b1, b0]; den = [an, an_1, an_2, … , a1, a0]; H = tf(num, den) Task  1:  Differential  equations  to  Transfer  functions   Task  1.1   Given  the  following  differential  equation:   𝑥 = −0.5𝑥 + 2𝑢   Find  the  following  transfer  function:  
  • 4. 4   EE4107  -­‐  Cybernetics  Advanced     𝐻 𝑠 = 𝑥(𝑠) 𝑢(𝑠)   Solution:   Laplace  gives:   𝑠𝑥(𝑠) = −0.5𝑥(𝑠) + 2𝑢(𝑠)   Further:   𝑠𝑥 𝑠 + 0.5𝑥(𝑠) = 2𝑢(𝑠)   Further:   𝑥 𝑠 (𝑠 + 0.5) = 2𝑢(𝑠)   Further:   𝑥 𝑠 𝑢(𝑠) = 2 𝑠 + 0.5 = 4 2𝑠 + 1   This  gives:   𝐻 𝑠 = 𝑥 𝑠 𝑢(𝑠) = 4 2𝑠 + 1   Task  1.2   Given  the  following  2.order  differential  equation:   𝑦 + 𝑦 + 5𝑦 = 5𝑥   Find  the  following  transfer  function:   𝐻 𝑠 = 𝑦(𝑠) 𝑥(𝑠)   Solution:   We  get:   𝑠! 𝑦 𝑠 + 𝑠𝑦 𝑠 + 5𝑦 𝑠 = 5𝑠𝑥(𝑠)   Further:   𝑦 𝑠 [𝑠! + 𝑠 + 5] = 5𝑠𝑥(𝑠)   This  gives  the  following  transfer  function:   𝑦 𝑠 𝑥(𝑠) = 5𝑠 𝑠! + 𝑠 + 5  
  • 5. 5   EE4107  -­‐  Cybernetics  Advanced       Task  2:  Transfer  functions  to  differential  equatons   Given  the  following  system:   𝐻 𝑠 = 𝑥(𝑠) 𝑢(𝑠) = 3 0.5𝑠 + 1   Task  2.1   Find  the  differential  equation  from  the  transfer  function  above.   Solution:   We  get:   𝑥(𝑠) 0.5𝑠 + 1 = 3𝑢(𝑠)   Further:   0.5𝑠𝑥 𝑠 + 𝑥(𝑠) = 3𝑢(𝑠)   Inverse  Laplace  gives:   0.5𝑥 + 𝑥 = 3𝑢   This  gives  the  following  differential  equation:   𝑥 = −2𝑥 + 6𝑢   Task  2.2   Draw  a  block  diagram  of  the  system.   Solution:   We  can  draw  the  following  block  diagram:    
  • 6. 6   EE4107  -­‐  Cybernetics  Advanced     Note!  Even  when  the  system  is  in  the  time  plane  we  normally  use  the  symbol   .  Other  symbols  that   are  commonly  used  for  the  integrator  are:    or     Task  3:  2.order  system   Given  the  following  transfer  function:   𝐻 𝑠 = 𝑦(𝑠) 𝑢(𝑠) = 2𝑠 + 3 𝑠! + 4𝑠 + 3   Task  3.1   Find  the  differential  equation  for  the  system.   Solution:   We  do  as  follows:   𝑦 𝑠 𝑠! + 4𝑠 + 3 = 𝑢 𝑠 [2𝑠 + 3]   This  gives:   𝑠! 𝑦 𝑠 + 4𝑠𝑦 𝑠 + 3𝑦 𝑠 = 2𝑠𝑢 𝑠 + 3𝑢(𝑠)   This  gives  the  following  differential  equation:   𝑦 + 4𝑦 + 3𝑦 = 2𝑢 + 3𝑢   Note!  We  have  used  the  rule:   𝑥(!) ⟺ 𝑠! 𝑥(𝑠)   Task  4:  Static  Time-­‐response   Task  4.1   Given  the  following  system:   𝐻(𝑠) = 𝑦(𝑠) 𝑢(𝑠) = 3 2𝑠 + 1   Find  the  static  time-­‐response.   We  will  use  a  step  for  the  control  signal  ( 𝑢 𝑡 = 1).   Note!  The  Laplace  Transformation  pair  for  a  step  is  as  follows:  
  • 7. 7   EE4107  -­‐  Cybernetics  Advanced     1 𝑠 ⇔ 1   Solution:   We  have:   𝐻(𝑠) = 𝑦(𝑠) 𝑢(𝑠) = 3 2𝑠 + 1   Meaning  that:   𝑦(𝑠) = 3 2𝑠 + 1 𝑢(𝑠)   where   𝑢 𝑠 = ! !   This  means:   𝑦 𝑠 = 3 2𝑠 + 1 ∙ 1 𝑠 = 3 2𝑠 + 1 𝑠   Then  we  use  the  final  value  theorem  (sluttverditeoremet):   𝑦! = lim !→! 𝑦 𝑡 = lim !→! 𝑠 ∙ 𝑦 𝑠 = lim !→!  𝑠 3 2𝑠 + 1 𝑠 = lim !→!   3 2𝑠 + 1 = 3 2 ∙ 0 + 1 = 3   Task  4.2   Given  the  following  system:   𝐻(𝑠) = 𝑦(𝑠) 𝑢(𝑠) = 6(𝑠 + 1) 9𝑠 + 0.25   Find  the  static  time-­‐response.   We  will  use  a  step  for  the  control  signal  ( 𝑢 𝑡 = 1).   Solution:   We  get:   𝑦(𝑠) = 6(𝑠 + 1) 9𝑠 + 0.25 𝑢(𝑠)   where   𝑢 𝑠 = ! !   This  means:   𝑦 𝑠 = 6(𝑠 + 1) 9𝑠 + 0.25 𝑠  
  • 8. 8   EE4107  -­‐  Cybernetics  Advanced     Then  we  get  using  the  final  value  theorem:   𝑦! = lim !→! 𝑦 𝑡 = lim !→! 𝑠 ∙ 𝑦 𝑠 = lim !→!  𝑠 6 𝑠 + 1 9𝑠 + 0.25 𝑠 = lim !→!   6(𝑠 + 1) 9𝑠 + 0.25 = 6(0 + 1) 9 ∙ 0 + 0.25 = 6 0.25 = 24   Task  5:  1.order  transfer  functions   Given  the  following  system:   𝐻(𝑠) = 𝑦(𝑠) 𝑢(𝑠) = 2 4𝑠 + 1   Task  5.1   What  are  the  values  for  the  gain   𝐾  and  the  time  constant   𝑇  for  this  system?   Sketch  the  step  response  for  the  system  using  “pen  and  paper”.     Find  the  step  response  using  MathScript  and  compare  the  result  with  your  sketch.   Solutions:   Gain   𝐾  and  the  time-­‐constant   𝑇:   𝐾 = 2   𝑇 = 4   Step  response  for  a  1.order  system:     MathScript:   clear
  • 9. 9   EE4107  -­‐  Cybernetics  Advanced     clc K=2; T=4; num=[K]; den=[T, 1]; H = tf(num, den); step(H) This  gives  the  following  plot:     For  a  1.order  system  with  time-­‐delay  we  have:     Task  5.2  
  • 10. 10   EE4107  -­‐  Cybernetics  Advanced     Find  the  differential  equation  from  the  transfer  function  above  and  draw  a  block  diagram  of  the   system  (“pen  and  paper”).   Solutions:   For  a  1.order  system  in  general  we  have:   𝐻(𝑠) = 𝑦(𝑠) 𝑢(𝑠) = 𝐾 𝑇𝑠 + 1   or:   𝑦 𝑠 = 𝐾 𝑇𝑠 + 1 𝑢(𝑠)   Which  gives:   𝑦 𝑠 (𝑇𝑠 + 1) = 𝐾𝑢(𝑠)   𝑇𝑠𝑦 𝑠 + 𝑦(𝑠) = 𝐾𝑢(𝑠)   In  the  time  domain  we  get  the  following  differential  equation  (using  Inverse  Laplace):   𝑦 = 1 𝑇 (−𝑦 + 𝐾𝑢)   We  can  draw  the  following  block  diagram  of  the  system:     Where   𝐾 = 2  and   𝑇 = 4  for  our  system:     Note!  Even  when  the  system  is  in  the  time  plane  we  normally  use  the  symbol   .  Other  symbols  that   are  commonly  used  for  the  integrator  are:    or   .   Task  5.3  
  • 11. 11   EE4107  -­‐  Cybernetics  Advanced     From  the  block  diagram  in  Task  1.2,  find  the  transfer  function   𝐻(𝑠) = !(!) !(!)   (The  answer  shall  of  course  be   𝐻(𝑠) = !(!) !(!) = ! !!!! )   Solutions:   From  the  block  diagram  in  the  previous  task  we  get  the  following  transfer  function:   𝐻 𝑠 = 𝑦 𝑠 𝑢 𝑠 = 2 ∙ 0.25 ∙ 1 𝑠 1 + 0.25 ∙ 1 𝑠 = 0.5 𝑠 + 0.25 = 2 4𝑠 + 1   As  expected,  the  result  is  the  same  as  the  transfer  function  given  in  Task  1.1.   Note!  We  have  used  both  the  serial  and  feedback  rules  that  yield  for  block  diagram  reduction.       Task  5.4   Find  the  solution  for  the  differential  equation  and  plot  it  (“pen  and  paper”).   We  will  use  a  step  for  the  control  signal  ( 𝑢 𝑡 = 1).   Note!  The  Laplace  Transformation  pair  for  a  step  is  as  follows:   1 𝑠 ⇔ 1   Tip!  You  also  need  to  use  the  following  Laplace  transform  pair:   𝐾 𝑇𝑠 + 1 𝑠  ⇔ 𝐾(1 − 𝑒!!/! )   Compare  to  the  results  from  Task  1.1.   Solutions:  
  • 12. 12   EE4107  -­‐  Cybernetics  Advanced     For  a  1.order  system  in  general  we  have:   𝐻(𝑠) = 𝑦(𝑠) 𝑢(𝑠) = 𝐾 𝑇𝑠 + 1   Here  we  will  find  the  mathematical  expression  for  the  step  response  ( 𝑦(𝑡)):   𝑦 𝑠 = 𝐻 𝑠 𝑢(𝑠)   Where     𝑢 𝑠 = 𝑈 𝑠   We  use  inverse  Laplace  and  find  the  corresponding  transformation  pair  in  order  to  find   𝑦(𝑡)).     𝑦 𝑠 = 𝐾 𝑇𝑠 + 1 ∙ 𝑈 𝑠   We  use  the  following  Laplace  transform  pair:   𝐾 𝑇𝑠 + 1 𝑠  ⇔ 𝐾(1 − 𝑒!!/! )   This  gives:   𝑦 𝑡 = 𝐾𝑈(1 − 𝑒!!/! )   Setting   𝐾 = 2,   𝑇 = 4  and   𝑈 = 1  gives:   𝑦 𝑡 = 2(1 − 𝑒 ! ! ! ! )   We  can  plot  this  in  MathScript:   clear clc K=2; T=4; U=1; t=0:0.1:20; % Method 1 - Transfer Function num=[K]; den=[T, 1]; H = tf(num, den); figure(1) step(H, t)
  • 13. 13   EE4107  -­‐  Cybernetics  Advanced     % Method 2 - Plot the solution of the differential equation y = K*U*(1-exp(-t/T)); figure(2) plot(t,y) We  get  the  same  results  (of  course).   Task  6:  Transfer  functions  in  MathScript   Define  the  following  transfer  functions  in  MathScript.   Task  6.1    Given  the  following  transfer  function:   𝐻(𝑠) = 2𝑠! + 3𝑠 + 4 5𝑠 + 9   Solutions:   MathScript  Code:   num = [2, 3, 4]; den = [5, 9]; H = tf(num, den) Task  6.2    Given  the  following  transfer  function:   𝐻(𝑠) = 4𝑠! + 3𝑠 + 4 5𝑠! + 9   Solutions:   MathScript  Code:   num = [4, 0, 0, 3, 4]; den = [5, 0, 9]; H = tf(num, den) Note!  If  some  of  the  orders  are  missing,  we  just  put  in  zeros.  The  transfer  function  above  can  be   rewritten  as:   𝐻(𝑠) = 4𝑠! + 0 ∙ 𝑠! + 0 ∙ 𝑠! + 3𝑠 + 4 5𝑠! + 0 ∙ 𝑠 + 9   Task  6.3    Given  the  following  transfer  function:  
  • 14. 14   EE4107  -­‐  Cybernetics  Advanced     𝐻(𝑠) = 7 + 3𝑠 + 2𝑠! 5𝑠 + 6𝑠!   Solutions:   We  need  to  rewrite  the  transfer  function  to  get  it  in  correct  orders:   𝐻(𝑠) = 2𝑠! + 3𝑠 + 7 6𝑠! + 5𝑠   MathScript  Code:   num = [2, 3, 7]; den = [6, 5, 0]; H = tf(num, den) Task  7:  Differential  equations  to  Transfer  functions   Task  7.1   Given  the  following  differential  equation:   𝑥 = −0.5𝑥 + 2𝑢   Find  the  following  transfer  function:   𝐻 𝑠 = 𝑥(𝑠) 𝑢(𝑠)   Solution:   Laplace  gives:   𝑠𝑥(𝑠) = −0.5𝑥(𝑠) + 2𝑢(𝑠)   Further:   𝑠𝑥 𝑠 + 0.5𝑥(𝑠) = 2𝑢(𝑠)   Further:   𝑥 𝑠 (𝑠 + 0.5) = 2𝑢(𝑠)   Further:   𝑥 𝑠 𝑢(𝑠) = 2 𝑠 + 0.5 = 4 2𝑠 + 1   This  gives:   𝐻 𝑠 = 𝑥 𝑠 𝑢(𝑠) = 4 2𝑠 + 1  
  • 15. 15   EE4107  -­‐  Cybernetics  Advanced     Task  8:  PI  Controller   A  PI  controller  is  defined  as:   𝑢(𝑡) = 𝐾! 𝑒 + 𝐾! 𝑇! 𝑒𝑑𝜏 ! !   Where  u  is  the  controller  output  and   𝑒  is  the  control  error:   𝑒 𝑡 = 𝑟 𝑡 − 𝑦(𝑡)   Task  8.1   Find  the  transfer  function  for  the  PI  Controller:   𝐻! 𝑠 = 𝑢(𝑠) 𝑒(𝑠)   Solutions:   Using  Laplace  gives:   𝑢 𝑠 = 𝐾! 𝑒 𝑠 + 𝐾! 𝑇! ∙ 1 𝑠 𝑒 𝑠   Then  we  get:   𝐻! 𝑠 = 𝑢(𝑠) 𝑒(𝑠) = 𝐾! + 𝐾! 𝑇! 𝑠 = 𝐾! 𝑇! 𝑠 𝑇! 𝑠 + 𝐾! 𝑇! 𝑠 = 𝐾! 𝑇! 𝑠 + 𝐾! 𝑇! 𝑠 = 𝐾!(𝑇! 𝑠 + 1) 𝑇! 𝑠   This  gives  the  following  transfer  function  for  the  PI  controller:   𝐻! 𝑠 = 𝑢(𝑠) 𝑒(𝑠) = 𝐾!(𝑇! 𝑠 + 1) 𝑇! 𝑠   Additional  Resources   • http://home.hit.no/~hansha/?lab=mathscript Here you will find tutorials, additional exercises, etc.