Transfer functions
Let’s revisit the cruise control example from the previous section on Laplace transforms. In many practical situations, we mainly care about the relationship between the input and output of a system. In this case, the applied force and velocity . Although the initial velocity does matter, its effect is transient, meaning that it fades over time. Recall the differential equation for this system:
Let’s assume is no longer constant, but rather it is some complicated function of time. Taking Laplace transforms, as before, we now obtain:
This time, the two components of the response are:
zero-state response: , where is the inverse Laplace transform. This will of course depend on the applied force .
zero-input response: , which is the same as before.
The zero-input response is unchanged, and still dies out exponentially. For this reason, it is often called a transient response. When simulated for long periods of time, this transient response has little effect. We demonstrate this below by simulating the cruise control example with and below for a particular choice of .
Figure 1:Simulation of Eq. (1) with zero-state and zero-input responses plotted separately.
The transfer function¶
When a system is running for a long time, it often makes sense to ignore the transient zero-input response and just focus on the zero-state response. In other words, we assume and Eq. (2) becomes:
Eq. (3) shows us something interesting. The ratio is always equal to , no matter what we pick for our input . This is true for any LTI system, which motivates the following definition.
Since transfer function is always the same for all input-output pairs, we can use it to determine how the system will react to any input. Once we know , if we apply a different input to our system, the output will satisfy
so the Laplace transforms of the input and output are related via ordinary multiplication by the transfer function! We can view this diagramatically.
Figure 2:Diagram comparing time-domain and -domain paths for solving a system.
As far as representing a dynamical system, a transfer function encodes the same information as a differential equation. We can use them interchangeably:
Why transfer functions?¶
Why not just use differential equations to represent systems? Several reasons.
It is more convenient to manipulate and simplify transfer functions rather than differential equations because transfer functions are algebraic objects. We can add them, multiply them, factor them, etc. For example, we can simplify by canceling common factors: . Another example is eliminating intermediate variables (see quarter-car example below). These sorts of simplification are much more difficult to perform when working with differential equations.
We will link properties of a system to properties of its transfer function, so that we will be able to know how a system will perform without ever having to solve the associated differential equation. For example: “I know the system response will oscillate this much because the transfer function looks like this”.
We will work with systems that consist of several interconnected components (a system, a sensor, a controller, etc.). In such cases, we can easily combine them into a single transfer function and reason about the properties of the aggregated system as a function of changes in the individual components. For example: “what happens if I change my controller in this way?”
The DC gain¶
The DC gain of a system is the value of its transfer function at . For example, the DC gain of the cruise control system (6) is
When a system is stable[1], the DC gain of a system tells us how it responds to a unit step input after a long time has passed, i.e., after the transient response has died out (the “steady-state” output).
“DC” stands for “direct current” in electrical engineering, but it has been adopted as a general term for the steady-state output of any system when the input is a unit step.
To find this from the ODE, we set all derivatives equal to zero and set the input equal to 1. For example, for the cruise control system, we had:
At steady-state, all derivatives are zero, so . If we apply a unit step input, then . The ODE simplifies to , so , which is exactly the DC gain.
Since we are dealing with LTI systems, if we used a different (but constant) input, say , then the steady-state response would be . This is exactly what we find in our time-response of the cruise control system in Eq. (20) when we take the limit as .
Example: spring-mass-damper¶
Consider a simple spring-mass-damper system, shown below.
Figure 3:Standard spring-mass-damper system.
Let’s calculate the transfer function relating input force to displacement . First, we start with the differential equation:
Next, we take the Laplace transform (see Table 1) using zero initial conditions. This is easy to do; derivatives simply become multiplication by :
In the future, we will often omit the “” and just write or since we know upper-case letters are Laplace transforms and therefore functions of . Factoring, obtain:
Now write the transfer function, remembering it’s the ratio of “output over input”.
We use the name because traditionally in control systems, we label transfer functions using the letters , , or .
We wrote out all the steps above, but it’s worth practicing going directly from Eq. (9) to Eq. (12) in your head. The Laplace transform turns the derivatives into powers of , so it’s a straightforward transformation. From now on, we will not write all the steps.
Example: quarter-car model¶
The model below is a quarter-car model, which captures the vertical dynamics of a car for a single wheel. The car chassis and the wheel are treated as separate masses connected by springs and dampers. models the car’s suspension, while models the springiness of the tires. The input is , the vertical position of the ground.
Figure 4:Quarter-car model.
Our goal is to produce a differential equation relating to the position of the car . We are not interested , the position of the wheel. We will skip the free-body diagram and jump straight to the equations of motion for the chassis and the wheel.
Let’s rearrange to group like terms:
Both the input and its derivative appear in these equations. This happens because our input is a position rather than a force, and it’s not a problem.
However, we were asked to eliminate and produce a single equation in terms of and . It’s not immediately apparent how one can do this. When we encountered problems like this in the past, such as springs connected in series, we could solve for in one equation and substitute the result into the other. But both equations in (14) contain and . It’s not clear how to eliminate !
The key is to take Laplace transforms. This converts (14) from differential equations into algebraic equations and we obtain:
We can now proceed as we did with the springs in series. Solve for in one equation and plug it into the other. From the first equation, we have:
Substitute this into the second equation, and obtain:
This equation only involves and . We have eliminated ! To convert this into a differential equation, we need both sides to look like polynomials in multiplying either or . This way, we can take inverse Laplace transforms. This will require a bit of algebra. Multiply both sides by to clear the fractions, and obtain:
Now expand both sides and simplify:
Now we can do the step (14) (15) in reverse, taking inverse Laplace transforms, and we obtain a single differential equation relating to :
Although the solution is rather long to write out, the steps are straightforward:
Take Laplace transforms of the equations of motion
Eliminate the unwanted variables via substitution
Take inverse Laplace transforms to recover a differential equation
Test your knowledge¶
Solution to Exercise 1 #
For each system, we take Laplace transforms and solve for . Here are the separate solutions:
So amazingly, all four systems have the same transfer function. This goes to show that differential equation representations of a system are not unique.
This also means each of these systems has the same DC gain, which is
The DC gain can be positive, negative, zero, or even infinite depending on the values of and .
Roughly, a LTI system is stable if it eventually settles to zero no matter how it is initialized. This includes spring-mass-damper systems, (non-inverted) pendulums, and more. We will give a more precise definition of stability later in the class.