Fundamentals
Housekeeping
close all; clear; clc; s = tf('s');
DERIVATION:
Beginning with a differential equation describing the plant to be controlled, the Laplace Transform may be used to move the equation from the time-domain into the s-domain. Because transfer functions do not account for initial conditions, this process allows us to ”separate” the input-output dynamics from the inputs and outputs themselves. A transfer function is represents the relationship of the system. Roots of the numerator are called ”zeros” (they drive the transfer function to 0) and roots of the denominator are called ”poles” (they drive the transfer function to ∞). For example, consider the equation for a simple spring-mass-damper:
m = 1;
b = 3;
k = 2;
G = (2)/(m*s^2 + b*s + k)
Keep in mind that that the transfer function takes the form of dynamics demonstrating that the numerator accounts for the input dynamics and the denominator accounts for the output dynamics. This means that poles (roots of the denominator) will manifest in a system response regardless of what input is applied!
PROPER VS IMPROPER:
A proper transfer function is one in which the order of the numerator is equal-to or less-than the order of the denominator. A transfer function wherein the numerator’s order is less than the denominator is called ”strictly proper” and one in which it is equal is ”bi-proper”.
A simple explanation for an improper transfer function being unrealistic is that by substituting jω for s in the transfer function, we can see that an improper transfer function would have gain simply increase with increasing frequency (ω) wherein a real system will have a cutoff frequency at which it will no longer respond.
Consider the simplest improper transfer function . It is straightforward to see that replacing s with jω leads to a system, , whose gain will only increase with increasing frequency without bound. This can be generalized to any system where is a bi-proper or strictly proper transfer function.
MODEL GAIN & FINAL-VALUE-THEOREM + STEADY-STATE GAIN:
Model Gain:
The model gain of a transfer function is simply the "coefficient" of the transfer function after being transformed into the ZPK form. It can be thought of as a sort of proportional gain baked directly into the transfer function.
STEADY STATE GAIN:
The steady-state gain however is derived from the Final Value Theorem.
Unit Step Response:
Ramp Response:
Parabolic Response:
[~,~,model_gain] = zpkdata(G);
steady_state_gain = dcgain(G);
fprintf('model gain = %g \nsteady state gain(step) = %g', model_gain, steady_state_gain)
FORMS (STANDARD):
The standard form of the transfer function is the one formed directly from the differential equation through the use of the Laplace Transform. This form is most useful for entering into software like MATLAB, as well as using the Routh-Hurwitz stability criterion to determine stability.
G_std = G
FORMS (EXPANDED):
The expanded form of the transfer function is formed via partial-fraction-decomposition of the standard form. are each poles and are called the ”residuals”, which may or may not contain zeros.
A convenient method for calculating the residuals, assuming there are no repeated poles, is to remove the factor from the denominator and compute only considering the other terms. In this manner we can see that the residuals are influenced by the zeros while the exponential terms in system response will be influenced by the poles.
[N D] = tfdata(G, 'v');
[r, p, k] = residue(N,D)
G_fact = [];
for i = 1:length(r)
[num,den] = tfdata(r(i)/(s-p(i)), 'v');
G_fact = [G_fact; tf(num,den)];
end
G_fact
FORMS (ZPK / ROOT-LOCUS):
The factored, or root-locus, form is formed by factoring the standard form into first order polynomials.
G_zpk = zpk(G) %NOTE: this may not work well if your transfer function does not factor "cleanly"
FORMS (BODE):
The Bode form is formed by dividing first-order polynomial in the factored form by its pole’s or zero’s value.
G_bode = G_zpk;
G_bode.DisplayFormat='frequency'