Transfer Functions are a popular way to
represent linear time-invariant systems.
In this video, we will show how to
create and analyze transfer functions,
and use them to design a
controller for a given system.
Let’s start by looking at an
example of how we can define
transfer functions in MATLAB.
Here we have two separate
transfer functions that define our system.
The first describes our actuator dynamics
and the second, our engine dynamics.
These two transfer functions are connected in series.
There are two ways of defining
transfer functions in MATLAB.
The first is using the “tf" function.
Define the actuator’s transfer function
as shown, with the the “tf" function
accepting the numerator and denominator
of the actuator’s transfer function
as its inputs.
You can also define a transfer function
directly in terms of ‘s’.
Here, we define the engine’s
transfer function using this method.
In both cases, we see that the
result is a transfer function object.
You can define the system
by multiplying the
two transfer functions as they
are connected in series.
Alternatively,
you can use the “series" function as well.
Now, let’s design a controller for our system.
In this case, the controller
is a pure integrator,
which eliminates steady state error.
The gain ‘k’ of this integrator is
what we need to define according
to the characteristics we would
like our system to have.
Let’s start by assuming that k=1.
The transfer function for the
controller in that case can be
defined as follows
The overall transfer function
of the system so far is now given by
"tf_open_loop" which represents the
open loop transfer function.
Use the “feedback" function to add
a negative feedback loop which tries
to reduce error, that is the
difference between the input and output signals.
Now that our system has a feedback loop,
let’s see what the step response looks like.
Our system is clearly stable,
but the step response is slow.
We can make the
response faster by modifying
the gain ‘k’ of the controller.
This can be done by analyzing
the root locus of the
open loop transfer function.
Create the root locus using the
“rlocus" function. The lines indicate
the location of the poles of the
closed loop transfer function for
different values of the gain ‘k’.
We want to adjust 'k' such that
our system has a fast response
with minimal overshoot.
In this case, let’s assume that
for a gain ‘k’ approximately equal to 5,
our system’s performance
meets our requirements.
Using the new gain value,
we can now update our
controller’s transfer function
and the closed loop
transfer function of the
entire system as shown.
Let's analyze the performance
of our system with its
new controller using the
Linear System Analyzer App.
The first thing we see is that the
step response is faster than before
and also has very little overshoot.
The app also allows us to examine
many of the frequency and time
domain characteristics in a single figure.
We can visualize key characteristics
such as the peak overshoot and
stability margins as shown.
In summary, this video showed how
to create transfer functions,
analyze them in the time and
frequency domains and use them for
designing controllers.
This concludes the video.