0% found this document useful (0 votes)
35 views56 pages

4.1 - Analysis Based On Transfer Function

This document discusses transfer function approaches for analyzing and designing mechatronic systems using microcontrollers. It covers: 1. Converting continuous-time models to discrete-time models using sampling periods. 2. Choosing appropriate sampling periods based on system time constants and bandwidth. 3. Using the z-transform to analyze sampled systems similarly to using the Laplace transform for continuous systems. 4. Methods for computing the inverse z-transform including partial fraction expansion and residues.

Uploaded by

Marcelo
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)
35 views56 pages

4.1 - Analysis Based On Transfer Function

This document discusses transfer function approaches for analyzing and designing mechatronic systems using microcontrollers. It covers: 1. Converting continuous-time models to discrete-time models using sampling periods. 2. Choosing appropriate sampling periods based on system time constants and bandwidth. 3. Using the z-transform to analyze sampled systems similarly to using the Laplace transform for continuous systems. 4. Methods for computing the inverse z-transform including partial fraction expansion and residues.

Uploaded by

Marcelo
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/ 56

Diseño Mecatrónico

Transfer function Approaches


MCTG1013

Marcelo Fajardo-Pruna, PhD Francisco Yumbla, PhD


[email protected] [email protected]
ORCID ID: 0000-0002-5348-4032 ORCID ID: 0000-0003-4220-010X
SCOPUS ID: 57195539927 SCOPUS ID: 57201852791
Objectives

1. Master the concept of the transfer function concept

2. Be able to perform the analysis of any LTI system and determine


the specifications that the system has

3. Be able to compute any time response of LTI system for a given


input

4. Be able to check the stability of any dynamical system

5. Plot the root locus of any LTI system and use it for analysis and
design purpose

6. Plot the Bode diagram of any LTI system and use it for analysis and
design purpose
Introduction

• The microcontrollers are more powerful and their prices are


affordable

• They are used either for On/Off or continuous-time controls

• The microcontroller is the hearth of the mechatronic system.

• In practice when controlling real processes using microcontrollers


two structures can be adopted.
• In the first one, the error between the output and the reference is
done in continuous-time and then sent to the microcontroller via
analog-digital converter (A/D) and the control action is computed
following the chosen algorithm.
• In the second case, the output is converted to a digital value via a
A/D. The reference in this case is fed in a digital form. The control
action is computed in a similar way as for the first case.

• In the structure of the figure, we have sampled signals that have the
following advantages: 1. easy modulated, 2. easy to code, 3. easy to
transmit and to regenerate.
• The second structure is more often used in practice and therefore,
it is the one that we will use in the rest of the course.

• Mainly we will show for a given practical system:


1. How to determine the sampling period

2. How to convert the continuous-timemodel to discrete-time one


using the chosen sampling period

3. How to determine the performances of such system such as the


stability, the overshoot, the settling time, etc.

4. How to use the root-locus and the Bode-plot techniques for


discrete-time case
Sampling Process

• We will always need to convert the dynamics of such systems to a


discrete-time corresponding one to analyze and proceed with the
design of the controller.

• The choice of the sampling period is a critical problem.


• A small sampling period will result with huge amount of data that the
microcontroller will not be able to handle
• A large one will give poor results and may be the system will not be
controlled properly

• It can be chosen smaller than the smallest time constant in the


dynamics of the process.

• The bandwidth is also used for the choice of the sampling period.
• The Shannon theorem is used for the choice of the sampling
period.
A signal 𝑦 𝑡 which contains no frequency components greater than 𝑓ℎ
1
is uniquely reconstructed by a set of sampled from 𝑦 𝑡 spaced by 2𝑓 .

A proper choice for the sampling frequency should satisfy:


𝑓𝑠 ≥ 2𝑓ℎ

• In practice the factor two is not enough and generally we choose


the number more greater than two. A good choice consists of
taking the sampling rate greater than 30𝑤𝑏 , where 𝑤𝑏 is the
bandwidth of the closed-loop system.
• It is important to notice that we have the following relations
between the period, T, the frequency, f and the pulsation, w:

1
𝑇=
𝑓
𝑤 = 2𝜋𝑓

• Which implies

2𝜋
𝑤=
𝑇
Example

• Let us consider a dynamical system with the following transfer


function:

10
𝐺 𝑠 =
𝑠+1 𝑠+2 𝑠+5

• Notice that there exist an infinite number of sampling of periods


that can be chosen for this system.

• We define the sampling period using two approaches.


• From the transfer function of the system we conclude that the
highest frequency in the system is 𝑤𝑏 = 5𝑟𝑎𝑑/𝑠.

• Notice that we have 𝑤𝑠 𝑇 = 2𝜋. Now if we sample thirty times of


the highest frequency in the system, we have 𝑤𝑠 = 30 × 5 =
150𝑟𝑎𝑑/sec . This gives:

2𝜋
𝑇= = 0.021𝑠
150
• From the other side, the constant times of the system are
respectively 𝜏1 = 1𝑠, 𝜏2 = 0.5𝑠 and 𝜏3 = 0.2𝑠.

• This implies that fast dynamics in the system has a time constant
equal to 0.2s.

• A rule to select the sampling period consists of using the following


formula:

0.2
𝑇=
𝑎

• Where a is positive real number to be selected between 7 and 14.


A proper choice is 10. Using this rule we get 𝑇 = 0.02𝑠.
• The next step is to convert the continuous time dynamics to an
equivalent discrete-time one.

• The conversion from continuous-time system to sampled system


passes through two devices:
• sampler

• zero-order-hold (ZOH)
• The number of bits of the used microcontroller to process this
signal has a significant effect on the quantization and therefore on
the result.

• If a microcontroller with 16 bits is used, we will have 216 = 65536


possible values per sample.
• Let 𝑦 𝑡 be an analog signal whose maximum frequency that a
sampler should take into account is 𝑓ℎ (bandwidth). Assume 𝑦 𝑡
is sampled at frequency 𝑓𝑠 . Shannon theorem states that it is
possible to reconstruct the signal 𝑦 𝑡 from 𝑦 ∗ 𝑡 = 𝑦(𝑘𝑇) if and
only if 𝑓𝑠 ≥ 2𝑓ℎ .

• Mathematically, the sampling process of an analog signal can be


seen as a mathematical product between the signal 𝑦 𝑡 and a
train of impulses. This is given by the following expression:

𝑦 𝑘𝑇 = ෍ 𝑦 ∗ 𝑡 𝛿 𝑡 − 𝑘𝑇
𝑘=0
• For the continuous-time systems,

• the Laplace transform has been used to transform the set of


linear differential equations that describes the dynamics into
an algebraic one.

• For sampled systems we will use the same approach since their
dynamics are equivalent and the transformation used for the
analysis and design called the Z-transform is obtained from the
Laplace transform.
• Let 𝑓 ∗ 𝑡 be a sampled signal, such as:

ℒ 𝑓∗ 𝑡 = 𝐹 ∗ 𝑠 = න 𝑓 ∗ 𝑡 𝑒 −𝑠𝑡 𝑑𝑡
0

• where 𝑓 ∗ 𝑡 is equal to zero everywhere except at instants 𝑡 = 𝑘𝑇,


where 𝑘 = 0, 1, 2, 3, ⋯
• As an example of the signal f (t) we give the step signal defined as
follows:

1 ∀𝑡 ≥ 0
𝑓 𝑡 =ቊ
0 otherwise

• The Laplace transform of 𝑓 ∗ 𝑡 , yields:

∞ ∞ ∞

න 𝑓 ∗ 𝑡 𝑒 −𝑠𝑡 𝑑𝑡 = ෍ 𝑓 𝑘𝑇 𝑒 −𝑠𝑘𝑇 = ෍ 𝑓 𝑘𝑇 𝑒 𝑠𝑇 −𝑘 =𝐹 𝑠
0 𝑘=0 𝑘=0

• The Z-transform of 𝑓 𝑡 is defined as equal to Laplace transform


of 𝑓 ∗ 𝑡 : 𝒵 𝑓 𝑡 = ℒ[𝑓 ∗ 𝑡 ]
• Now, if we define 𝑧 = 𝑒 𝑠𝑇 , then we have:

𝐹 𝑧 = ෍ 𝑓 𝑘𝑇 𝑧 −𝑘
𝑘=0

• This expression can be used to compute the Z -transform of any


signal.
• From basic course on control system, the Laplace transform has
interesting properties like linearity, homogeneity, etc.

• Since the Z -transform is obtained from this transform, the


properties of the Z -transform are directly obtained:

• Linearity

• Initial value theorem

• Final value theorem

• Shift property

• Back-shift property
Exercise

1 𝑤ℎ𝑒𝑛 𝑘 = 0
𝑓 𝑘 =ቊ
0 otherwise

1 𝑤ℎ𝑒𝑛 𝑘 ≥ 0
𝑓 𝑘 =ቊ
0 otherwise

𝑎 𝑘 𝑤ℎ𝑒𝑛 𝑘 = 0
𝑓 𝑘 =ቊ
0 otherwise
• Z-transform

𝑒 −𝛼𝑡 cos 𝑤𝑡 + 𝑒 −𝛼𝑡 sin 𝑤𝑡 𝑤ℎ𝑒𝑛 𝑡 ≥ 0


𝑓 𝑡 =ቊ
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
• Previously we were able to compute the Z-transform of a signal
that may represent the output system that corresponds to a given
input.

• Sometimes we are interested by knowing its expression in time.

• To perform the inverse Z -transform we can use the following


methods:

• expansion into partial fraction

• polynomial division

• residues method
• The inverse Z -transform consists of finding the expression of f (k)
that corresponds to a given function F(z).

• A very useful method to find the inverse transform of the function


F(z) is the expansion into partial fractions whose inverse
transforms can be found in the table.

• The idea behind this method is firstly write the expression of the
function in term of z−1, then perform the expansion into partial
fraction as usually done for the continuous-time case.
• Let us consider the following function F(z)

• and determine the expression of f (k).

• To answer this question, let us first of all divide the numerator and
the denominator simultaneously by 2𝑧 2 . This gives:

• It is not obvious how an inverse transform looks like, but if we


factorize the denominator of F(z), then partial expansion gives:
• As for Laplace transform, the residues are:

• Finally, we obtain:

• and its inverse transform is


• The second method that can be used to compute the inverse Z -
transform is the polynomial division method.

• let us continue the same expression for F(z) as for the previous
example.

• Dividing the numerator by the denominator, we obtain :

• Since 𝑍[𝛿(𝑡 − 𝑘𝑇)] = 𝑧 − 𝑘, we then obtain:


• As another example of how to compute the residue for an
expression that contains multiple poles, let us consider the
following expression:

• and compute the corresponding f (kT).

• The inverse transform f (kT) of the function F(z) is:


• In order to understand well the Z-transform, let us see how the
complex s-plane is transformed. Based on the definition of the Z-
transform, the main relationship between the s-plane and the z-
plane is given by 𝑧 = 𝑒 𝑠𝑇

• This expression gives the mapping, called M of the s-plane into


the z-plane.
• Therefore for any s in the s-plane we get the following point in the
z-plane:

1
• Let 𝑀−1 be the inverse transform, such as 𝑠 = ln 𝑧. Usually, 𝑠 =
𝑇

2𝜋
𝜎 ± 𝑗𝜔 and 𝑇 = is the sampling period. Using these relations we
𝜔𝑠

get:
• Let us assume that 𝜎 = 0, i.e. all the roots are on the imaginary
𝜔𝑠
axis in the s-plane, and let us change ω from 0 to . The
2

corresponding roots in the z-plane are given by:


𝜔𝑠
• When σ is fixed, 𝜎 = 0, and making varying ω from 0 to , we
2

notice that the corresponding variable follows a half-circle of


radius 1.
• When σ is fixed but not equal to zero, i.e.: 𝜎 ≠ 0, then the radius
of the circle is 𝑅 = 𝑒 𝜎𝑇 . All the roots belong to the straight line 𝜔 =
0 corresponding to an aperiodic response or oscillatory response.
For all the other roots on the circle, the response is oscillatory.
• For the resolution purposes, we will be interested to get the
solution of a given difference equation for a fixed input. To obtain
such solution we proceed as follows:
• we find the Z -transform
• we take the inverse Z -transform to find y(kT)

• The transformation s = 1 T ln z is exact, but it is also difficult to


implement in practice. That’s the reason why we use two
approximation methods:
• Numerical Integration
• Poles/zeros transforms
• For numerical integration method care should taken when using it
since we may get an unstable system after transformation.

• Let us consider the following transfer function that represents a


first order system:

• which gives in time domain:

• that gives in turn:


• Integrating between 2 consecutive samples, i.e. from (𝑘 − 1)𝑇 to
𝑘𝑇, we obtain:

• where 𝑓(𝑡) = −𝑎𝑦 𝑡 + 𝑎𝑢 𝑡 .

• In this last equation, the major problem is how to integrate the


right-hand term?
• First numerical integration method: The approximation of the
integral is taken equal to the one of the area shown in the figure.

• we get

• that gives in turn:


• Using now the Z-transform, we obtain:

• Finally we get:

• Now if we compare the two transfer functions (in the s-domain and
in the z-domain), we conclude that the expression in z-domain is
obtained from the one in the s-domain by using the following
transformation:
• Second numerical integration method: The approximation of the
integral is taken equal to the one of the area shown in the Figure.

• Following the same steps as before, we obtain

• that gives in turn in the z-domain:


• From which we have:

• Comparing again the two transfer functions as we did previously,


we obtain the following transformation:
• Third numerical integration method: In the two previous schemas,
we have either underestimate or overestimate the area of the
curve. Another alternate consists of computing the average of
these two approaches.

• We obtain the following for the approximation of the integral is that


of the area shown in the figure.
• From this expression we get:

• Using now the expression of F(z), we obtain:

• that gives finally

• Proceeding as before we get the following transformation:


Workshop

1. Consider the following expression and compute the


corresponding 𝑓 𝑘𝑇 .

0.3𝑧
𝐹 𝑧 =
𝑧 − 1 𝑧 − 0.7

2. Consider the Fibonacci equation:


𝑦(𝑘 + 2) = 𝑦(𝑘 + 1) + 𝑦(𝑘) 𝑤𝑖𝑡ℎ 𝑦(0) = 𝑦(1) = 1
• find the Z -transform

• take the inverse Z-transform to find 𝑦(𝑘𝑇)


Stability and Steady-State Error

• For systems in the continuous-time domain, the stability implies


that all the poles must have negative real parts.

• With the transform 𝑧 = 𝑒 𝑇𝑠 , with T is the sampling period, we saw


that the left half plane of the s-domain corresponds to the inside
unit circle.

• in the z-domain, the system will be stable if all the poles are inside
this unit circle.

• To analyze the stability of discrete-time systems, let us consider


the system of the figure.
Block diagram of the closed-loop

𝑌 𝑧 𝐶 𝑧 𝐺 𝑧
𝐹 𝑧 = =
𝑅 𝑧 1+𝐶 𝑧 𝐺 𝑧

• The poles of the system are the solution of the following


characteristic equation:
1+𝐶 𝑧 𝐺 𝑧 =0

• The study of stability requires the computation of these roots.


• For small order system we can always solve the characteristic
equation by hand and then obtain the poles.

• For high order this approach is not recommended and an alternate


is needed.

• Among these criterions we quote the one of Jury and the one of
Raible.
• Let 𝑧 = 𝑒 𝑠𝑇 with 𝑠 = 𝜎 ± 𝑗𝜔. Therefore,

• if 𝜎 < 0 then |𝑧| < 1 and the system is stable

• if 𝜎 > 0 then |𝑧| > 1 and the system is unstable

• if 𝜎 = 0 then |𝑧| = 1 and the system is at the limit of stability


Root Locus Technique

• The technique gives an idea on how the poles of the closed-loop


dynamics behave when a gain or more (a parameter or more) are
changed.

• The direct conclusion is that we know immediately how the


stability and the other performances of the system are affected by
the parameters changes.

• As for the continuous case, the root locus for the discrete system
is described by the characteristic equation that we write in the
following form:
1 + 𝐾𝐺 𝑧 = 0

• where K is the parameter that varies and

𝑧 − 𝑛1 𝑧 − 𝑛2 … 𝑧 − 𝑛𝑚
𝐺 𝑧 =
𝑧 − 𝑧1 𝑧 − 𝑧2 … 𝑧 − 𝑧𝑚

• with 𝑧1 , 𝑧2 ,···, 𝑧𝑛 are the poles and 𝑛1 , 𝑛2 ,···, 𝑛𝑚 are the zeros of
the open loop transfer function.
• From the characteristic equation, we get the following conditions:

1 ς𝑚
𝑖=1 𝑧 − 𝑛𝑖
=
𝐾 ς𝑛𝑖=1 𝑧 − 𝑧𝑖

𝑚 𝑚

෍ arg 𝑧 − 𝑛𝑖 − ෍ arg 𝑧 − 𝑧𝑖 = 2𝑘 + 1 𝜋, 𝑘 = 0,1,2, … ,


𝑖=1 𝑖=1
• If this point is 𝑧0 , then we have:

1 ς𝑚
𝑖=1 𝑧0 − 𝑛𝑖
=
𝐾𝑧𝑜 ς𝑛𝑖=1 𝑧0 − 𝑧𝑖

𝑚 𝑚

෍ arg 𝑧0 − 𝑛𝑖 − ෍ arg 𝑧0 − 𝑧𝑖 = 𝜃0
𝑖=1 𝑖=1

• where 𝜃0 is the corresponding angle of this point.

• A point of the z-plane will belong to the root locus, if it satisfies


these two conditions.
• More often a sketch of this root locus can be easily obtained using
some simple rules. Some of these rules are:

1. the number of branches is equal to the order of the system,


i.e.: 𝑛;

2. the root locus is symmetric with respect to the real axis. This is
due to the fact that the roots of the characteristic equation are
either real or complex. And if there is a complex root, we have
automatically its conjugate.

3. The loci originate from the poles of the open loop transfer
function and terminate on the zeros of the this transfer function.
4. the number of asymptotes is equal to the difference between the
number of poles, n, and the number of zeros, m, of the open
loop transfer function.

5. for the breakpoints of the root locus, firstly we determine the


expression of the varying parameters K

6. the intersection of the imaginary axis in the z-plane can be


determined by replacing 𝑧 by 𝑗𝜈 in the characteristic equation.

7. the angle of departure from a complex pole or the angle of


arrival to a complex zero is computed using the angle condition.
Bode Plot Technique

1.9909 1−0.05𝑤
Bode diagram of 1+𝑤
Diseño Mecatrónico
Transfer function Approaches
MCTG1013

You might also like