Always free. For everyone.
Course outline
Module 04 of 20 · Foundations

Use transfer functions

Work with Laplace models, block diagrams, and disturbance paths. This module has 3 lessons and takes about 2h 25m. Each lesson has a practice exercise that runs real Python in your browser and a short quiz.

Start module 04 in the Learning Lab
LESSON 1 OF 3

From differential equation to transfer function

35 minControl engineering
WHAT YOU WILL DO

Build a transfer function and calculate its step response.

The Laplace transform turns differentiation into multiplication by s when initial conditions are zero. For tau*dy/dt+y=K*u, (tau*s+1)*Y=K*U, so G(s)=Y/U=K/(tau*s+1).

A unit step has U(s)=1/s. The response is Y(s)=K/[s*(tau*s+1)], giving y(t)=K*(1-exp(-t/tau)). The pole is -1/tau and the DC gain is G(0)=K.

SciPy stores numerator and denominator coefficients in descending powers of s. The constant numerator [K] and denominator [tau,1] are enough here. Choose an explicit time vector so the simulation covers the important time scales.

See it in action

example.pyPython 3
import numpy as np
from scipy import signal
system = signal.TransferFunction([3.], [2.,1.])
t, y = signal.step(system, T=np.linspace(0,12,121))
print('At t=2:', y[20], 'Final sample:', y[-1])
Keep this in mind

A transfer function is an input-output model with stated initial conditions.

LESSON 2 OF 3

Combine blocks and close the loop

35 minControl engineering
WHAT YOU WILL DO

Derive negative feedback rather than guessing the denominator sign.

Series blocks multiply: P1(s)*P2(s). Parallel blocks add when their outputs are summed. For negative feedback with controller C, plant P, and sensor H, write Y=P*C*(R-H*Y), then solve: Y/R=P*C/(1+P*C*H).

For unity feedback and P=1/(s+2), C=3, the closed loop is 3/(s+5). Its pole moves from -2 to -5 and its final response to a unit reference is 3/5. Positive feedback would instead subtract the loop term in the denominator.

Polynomial multiplication combines series denominators. Polynomial addition combines aligned powers. Hidden unstable pole-zero cancellations can make an input-output expression look stable while internal states grow, so inspect the physical realisation too.

See it in action

example.pyPython 3
import numpy as np
plant_num, plant_den = [1.], [1.,2.]
kp = 3.
closed_num = np.polymul([kp],plant_num)
closed_den = np.polyadd(plant_den,closed_num)
print(closed_num, closed_den, np.roots(closed_den))
Keep this in mind

Derive the loop equation once to avoid a feedback sign error.

LESSON 3 OF 3

Practical: trace a disturbance

75 minControl engineering
WHAT YOU WILL DO

Compare plant input and output disturbances in the same loop.

Let a disturbance d enter at the plant input: y=P*(C*(r-y)+d). Then y/r=P*C/(1+P*C) and y/d=P/(1+P*C). If d enters at the output instead, y/d=1/(1+P*C). The location matters.

For P=1/(s+1) and C=4, reference transfer is 4/(s+5), input disturbance transfer is 1/(s+5), and output disturbance transfer is (s+1)/(s+5). Their DC gains are 0.8, 0.2, and 0.2, but the transient shapes differ.

An output disturbance has a direct path into the output and can jump immediately in this ideal model. A disturbance entering a strictly proper plant changes its state over time instead. Use separate simulations and superposition only for linear models.

GUIDED PRACTICAL · 75 MIN

Your experiment plan

Use the browser editor or the downloadable notebook. All plant data are simulated. Keep a notebook with parameters, predictions, results, and units.

  1. Draw the loop with both possible disturbance locations.
  2. Predict initial and final values for each step response.
  3. Run and overlay the three paths.
  4. Simulate a reference step plus a delayed disturbance with signal.lsim and compare with superposition.

What to hand in

  • A labelled loop sketch.
  • Three response curves with initial and final values.
  • An explanation of the direct output disturbance jump.
Reflect on your results

Which assumption matters most? Describe one result that surprised you and one experiment that would test your explanation.

The automatic exercise checks the core code behaviour. Review observations and written deliverables yourself or with a mentor.

See it in action

example.pyPython 3
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
t = np.linspace(0,3,301)
for name, num in [('Reference',[4]),('Input disturbance',[1]),('Output disturbance',[1,1])]:
    _, y = signal.step((num,[1,5]), T=t)
    plt.plot(t,y,label=name)
plt.xlabel('Time (s)'); plt.ylabel('Output'); plt.legend(); plt.show()
Keep this in mind

Draw the disturbance entry point before choosing a transfer function.

ABOUT THE LEARNING LAB

Free, open and run by a nonprofit.

This page is part of Control Engineering, a free course of 20 modules and 60 lessons in the engineering.fit( ) Learning Lab. The Learning Lab is built and run by engineering.fit( ), a nonprofit founded by Abdullateef Opeyemi Bakare that helps African engineering students gain research experience. You do not need an account or pay a fee to learn.

Course outline · Project lab · Visit engineering-fit.org