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
Summary

Introduction

Proposed Method

Deconvolution Algorithm
2
FFT

Examples of use

Conclusion

28/06/11I 2 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 3 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 4 I
Deconvolution Algorithm
Remind on Convolution

Mathematical Expression:
t
Out (t ) = Out (0) + ∫ In(u ) ⋅ Tf (t − u ) ⋅ du
0
Converted into discrete Algorithm:

n −1
In( k ) + In(k + 1)
Out ( n) = Out (0) + dt ⋅ ∑ ⋅ Tf ( n − 1 − k )
k =0 2

In Tf
Out

28/06/11I 5 I
Deconvolution Algorithm
Application of the Convolution

When applied to the various terms gives:

TF(0) can be
In(0) + In(1)
Out (1) = Out (0) + dt ⋅ ⋅ Tf (0)
computed

2 Then TF(1)

In(0) + In(1) In(1) + In( 2)


Out (2) = Out (0) + dt ⋅ ⋅ Tf (1) + dt ⋅ ⋅ Tf (0)
2 2

In( k ) + In( k + 1)
n −1
Out (n) = Out (0) + dt ⋅ ∑ ⋅ Tf ( n − 1 − k )
k =0 2
Then TF(n-1)

28/06/11I 6 I
Deconvolution Algorithm
Final Algorithm

Final formulae:

⋅ (Out (1) − Out (0) )


2
Tf (0) =
dt ⋅ [In(0) + In(1)]


Tf (n − 1) = dt ⋅ [In(0) + In(1)] ⋅ (Out (n) − Out (0) − Outx )
2


Outx = dt ⋅ In(k ) + In(k + 1) ⋅ Tf (n − 1 − k )
n −1

 ∑k =1 2

28/06/11I 7 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.
Ts
j Ts j Ts sin
1 e 2 2
ZOH t ut u t Ts Ts e
j Ts
2

28/06/11I 8 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 2n

28/06/11I 9 I
Simple Open Loop Case (1)
First Order XCos model

Case description:
1
TF is described by a Laplace Model TF ( s ) =
System is in open loop
1 + T0 ⋅ s
Step signal is injected 1
T0 = → 1Hz
Output and input are recorded 2π

28/06/11I 10 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 11 I
Simple Open Loop Case (3)
First Order XCos model

Impulse response extracted by Deconvolution

28/06/11I 12 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 13 I
Another Open Loop Case (1)
Second Order XCos model

Case description:

A
TF ( s ) =
(1 + T0 ⋅ s ) ⋅ (1 + T1 ⋅ s )
1
T0 = → 1Hz

1
T0 = → 10 Hz
2π ⋅10

28/06/11I 14 I
Another Open Loop Case (2)
Second Order XCos model

Impulse & Step


Input & Output

Response
Transfer Function in
Frequency Domain

Good
Matching
Extraction is
correct

28/06/11I 15 I
Last example in Open Loop Case (1)
First Order with Integrator (PI)

Case description:

A (1 + T0 ⋅ s )
TF ( s ) = ⋅
s (1 + T1 ⋅ s )
1
T0 = → 1Hz

1
T0 = → 10 Hz
2π ⋅10

28/06/11I 16 I
Last example in Open Loop Case (2)
First Order with Integrator (PI)

Impulse & Step


Input & Output

Response
Transfer Function in
Frequency Domain

Integrator
function not
extracted !!!

28/06/11I 17 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 doesn’t 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 18 I
Last example in Open Loop Case (4)
First Order with Integrator (PI)

Extracted Transfer Function with modified


algorithm
Transfer Function in
Frequency Domain

Good
Matching
Now

28/06/11I 19 I
Closed Loop Case (1)
First Order with Integrator (PI)

Now extraction is test for a closed loop


configuration:

A (1 + T0 ⋅ s )
TF ( s ) = ⋅
s (1 + T1 ⋅ s )
1
T0 = → 1Hz

1
T0 = → 10 Hz
2π ⋅10

28/06/11I 20 I
Closed Loop Case (2)
First Order with Integrator (PI)

Impulse & Step


Input & Output

Response
Transfer Function in
Frequency Domain

Extraction is
working in
closed loop

28/06/11I 21 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 22 I
Closed Loop Case (2)
First Order with Integrator (PI)

Impulse & Step


Input & Output

Response
Transfer Function in
Frequency Domain

Fc = 460Hz
Ph margin > 90 °

28/06/11I 23 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

28/06/11I 24 I

You might also like