You are on page 1of 25

Transfer Function

Extraction with SCILAB


from time domain result, using
deconvolution and FFT algorithms
(Patrick DUBUS Zaatar MAKNI)
Date: 28/06/2011
28/06/11I 2 I
Summary
Introduction
Proposed Method
Deconvolution Algorithm
FFT
Examples of use
Conclusion
2
28/06/11I 3 I
Introduction
Analog Electronic Designers are
accustomed to transfer function
description in frequency domain
using Bode plots.
Can be obtained from:
Tests by using dedicated test equipment (sinewave signal injected at
input, gain and phase shift measured then frequency is changed, )
Not always available
From simulation by using equivalent linear model to reduce simulation
time
In most of the case, this is not straight forward (hard job) and with risk of
errors
28/06/11I 4 I
New Method
Transfer function extraction rely on simulation or
test in time domain using signal with large
spectrum to cover quickly the entire frequency
domain.
Proposed method is to:
inject a step signal at function input,
extract the impulse response by deconvolution algorithm
use FFT to plot transfer function in frequency domain.
Benefits are:
No dedicated test tool needed
No equivalent AC model requested
Results are processed with SCILAB
28/06/11I 5 I
Deconvolution Algorithm
Remind on Convolution
Mathematical Expression:
Converted into discrete Algorithm:
du u t Tf u In Out t Out
t
+ =

0
) ( ) ( ) 0 ( ) (
) 1 (
2
) 1 ( ) (
) 0 ( ) (
1
0
k n Tf
k In k In
dt Out n Out
n
k

+ +
+ =

=
In
Out
Tf
28/06/11I 6 I
Deconvolution Algorithm
Application of the Convolution
When applied to the various terms gives:
) 0 (
2
) 1 ( ) 0 (
) 0 ( ) 1 ( Tf
In In
dt Out Out
+
+ =
) 0 (
2
) 2 ( ) 1 (
) 1 (
2
) 1 ( ) 0 (
) 0 ( ) 2 ( Tf
In In
dt Tf
In In
dt Out Out
+
+
+
+ =
) 1 (
2
) 1 ( ) (
) 0 ( ) (
1
0
k n Tf
k In k In
dt Out n Out
n
k

+ +
+ =

=
TF(0) can be
computed
Then TF(1)
Then TF(n-1)
28/06/11I 7 I
Deconvolution Algorithm
Final Algorithm
Final formulae:
[ ]
( ) ) 0 ( ) 1 (
) 1 ( ) 0 (
2
) 0 ( Out Out
In In dt
Tf
+
=
[ ]
( )


+ +
=

+
=

=
1
1
) 1 (
2
) 1 ( ) (
) 0 ( ) (
) 1 ( ) 0 (
2
) 1 (
n
k
k n Tf
k In k In
dt Outx
Outx Out n Out
In In dt
n Tf
28/06/11I 8 I
Deconvolution Algorithm
Remarks
DC values from the Input signal have to be
removed.
Deconvolution starts when input signal is applied
(synchronization to input signal is needed).
Due to sampling effect, input signal is factored by a
ZOH (Zero Order Hold). This will introduce a phase
shift in the extracted transfer function which must
be corrected.
ZOH t u t u t Ts
1 e
j Ts
j
Ts e
j Ts
2
sin
Ts
2
Ts
2
28/06/11I 9 I
FFT
Standard SCILAB algorithm used at the
beginning.
The following corrections/limitations apply:
Fs = 1/Ts
Spectrum starts at 1/(N.Ts) with N = number of points
Spectrum plotted up to Fs/10
Phase corrected to take into account sampling effect
Number of sample not limited to 2
n
28/06/11I 10 I
Simple Open Loop Case (1)
First Order XCos model
Case description:
TF is described by a Laplace Model
System is in open loop
Step signal is injected
Output and input are recorded
Hz T
s T
s TF
1
2
1
1
1
) (
0
0
=
+
=

28/06/11I 11 I
Simple Open Loop Case (2)
First Order XCos model
Input and output are plotted and recorded.
Time step is 0.01s
Duration is 10s to reach steady state conditions.
28/06/11I 12 I
Simple Open Loop Case (3)
First Order XCos model
Impulse response extracted by Deconvolution
28/06/11I 13 I
Simple Open Loop Case (4)
First Order XCos model
Transfer function in frequency domain computed
using FFT algorithm:
Extracted value in blue
Theoretical value in red
Good
Matching
Extraction is
correct
28/06/11I 14 I
Another Open Loop Case (1)
Second Order XCos model
Case description:
( ) ( )
Hz T
Hz T
s T s T
A
s TF
10
10 2
1
1
2
1
1 1
) (
0
0
1 0

=
=
+ +
=

28/06/11I 15 I
Another Open Loop Case (2)
Second Order XCos model
I
n
p
u
t

&

O
u
t
p
u
t
I
n
p
u
t

&

O
u
t
p
u
t
I
m
p
u
l
s
e

&

S
t
e
p

I
m
p
u
l
s
e

&

S
t
e
p

R
e
s
p
o
n
s
e
R
e
s
p
o
n
s
e
T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
Good
Matching
Extraction is
correct
28/06/11I 16 I
Last example in Open Loop Case (1)
First Order with Integrator (PI)
Case description:
( )
( )
Hz T
Hz T
s T
s T
s
A
s TF
10
10 2
1
1
2
1
1
1
) (
0
0
1
0

=
=
+
+
=

28/06/11I 17 I
Last example in Open Loop Case (2)
First Order with Integrator (PI)
T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
Integrator
function not
extracted !!!
I
m
p
u
l
s
e

&

S
t
e
p

I
m
p
u
l
s
e

&

S
t
e
p

R
e
s
p
o
n
s
e
R
e
s
p
o
n
s
e
I
n
p
u
t

&

O
u
t
p
u
t
I
n
p
u
t

&

O
u
t
p
u
t
28/06/11I 18 I
Last example in Open Loop Case (3)
First Order with Integrator (PI)
Problem comes from non convergence condition
when transfer function has an integrator
Fourier Transform doesnt exist
But thanks to its real part in the exponential term, Laplace
Transform exists
Current tested solution is to rewrite the Fourier
Transform algorithm with an additional negative
real part
j changed to a+j
This limit the integrator behavior to frequency higher than a/2
but a corrective factor is added to compensate for
Criteria selection for a to be investigated
28/06/11I 19 I
Last example in Open Loop Case (4)
First Order with Integrator (PI)
T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
Good
Matching
Now
Extracted Transfer Function with modified
algorithm
28/06/11I 20 I
Closed Loop Case (1)
First Order with Integrator (PI)
Now extraction is test for a closed loop
configuration:
( )
( )
Hz T
Hz T
s T
s T
s
A
s TF
10
10 2
1
1
2
1
1
1
) (
0
0
1
0

=
=
+
+
=

28/06/11I 21 I
Closed Loop Case (2)
First Order with Integrator (PI)
T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
Extraction is
working in
closed loop
I
m
p
u
l
s
e

&

S
t
e
p

I
m
p
u
l
s
e

&

S
t
e
p

R
e
s
p
o
n
s
e
R
e
s
p
o
n
s
e
I
n
p
u
t

&

O
u
t
p
u
t
I
n
p
u
t

&

O
u
t
p
u
t
28/06/11I 22 I
Motor Control Algorithm (1)
Real Use Case
PI controller for current control in the dq domain
Magnetic model of electric motor based on Lookup tables
Target: extraction of
the current control
loop transfer function
in order to perform
stability study
28/06/11I 23 I
Closed Loop Case (2)
First Order with Integrator (PI)
T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

T
r
a
n
s
f
e
r

F
u
n
c
t
i
o
n

i
n

F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
F
r
e
q
u
e
n
c
y

D
o
m
a
i
n
Fc = 460Hz
Ph margin > 90
I
m
p
u
l
s
e

&

S
t
e
p

I
m
p
u
l
s
e

&

S
t
e
p

R
e
s
p
o
n
s
e
R
e
s
p
o
n
s
e
I
n
p
u
t

&

O
u
t
p
u
t
I
n
p
u
t

&

O
u
t
p
u
t
28/06/11I 24 I
Conclusion
Quick and Relevant method for transfer function
extraction
Applicable to Open Loop or Closed Loop System
Proposed solution (addition of a real term) to solve non
convergence problems need to be further investigated
Have to be used on several use cases to confirm
applicability and accuracy
To be continued

You might also like