Measure time response
Turn rise time, overshoot, settling, and error into measurable requirements. 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 05 in the Learning LabFirst order response specifications
Calculate rise and settling time for a stable first order plant.
For y=K*(1-exp(-t/tau)), the 10% crossing is -tau*ln(0.9) and the 90% crossing is -tau*ln(0.1). Their difference is tau*ln(9), about 2.197*tau. Always say which rise-time definition you use.
A 2% settling band around the final value requires exp(-t/tau)<=0.02, so settling time is -tau*ln(0.02), about 3.912*tau. These formulas assume a monotonic first order response, zero initial output, and a nonzero step.
Settling around the final value is different from tracking the reference. A loop that settles at 0.8 can be fast but still have 20% reference error. Report both settling performance and final tracking error.
See it in action
import math
tau = 2.0
rise = tau*math.log(9)
settling = -tau*math.log(0.02)
print('10-90% rise:', rise, 's')
print('2% settling:', settling, 's')
Define each metric before judging a controller.
Second order damping and overshoot
Relate damping ratio and natural frequency to a step response.
A standard second order transfer function is wn^2/(s^2+2*zeta*wn*s+wn^2). For 0<zeta<1 its poles are -zeta*wn +/- j*wn*sqrt(1-zeta^2). The decay rate is zeta*wn.
The ideal overshoot fraction is exp(-pi*zeta/sqrt(1-zeta^2)). Peak time is pi/(wn*sqrt(1-zeta^2)). The commonly used 2% settling estimate 4/(zeta*wn) is approximate and does not replace measuring a real response.
Zeros, extra poles, delays, and saturation can invalidate these simple predictions. For zeta>=1 there is no oscillatory peak in the standard zero-free step response. Do not evaluate the underdamped square-root formulas outside their domain.
See it in action
import math
zeta, wn = 0.5, 4.
overshoot = 100*math.exp(-math.pi*zeta/math.sqrt(1-zeta*zeta))
peak_time = math.pi/(wn*math.sqrt(1-zeta*zeta))
print('Overshoot (%):', overshoot, 'Peak time (s):', peak_time)
Second order formulas are useful design estimates with explicit assumptions.
Practical: build a response scorecard
Measure settling correctly and compare controller candidates.
Settling time is the earliest time after which all remaining samples stay inside the chosen band. The first time a curve enters the band is not enough because an oscillatory response can leave it again.
For sampled data, find the last sample outside the band. The next sample is the estimated settling time. Return None when the final sample is still outside. A finite record cannot prove the response stays settled forever.
Use a known target or analytical final value for the band, not the last sample of an unfinished simulation. Include overshoot, integral absolute error (IAE), and peak actuator demand in a design comparison.
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.
- Run second order responses with zeta=0.2, 0.5, and 0.8 at wn=3.
- Measure overshoot, settling, and IAE using the same time vector.
- Shorten the record to one second and observe which metrics cannot be established.
- Choose a candidate for overshoot below 10% and settling below 5 s, and explain your evidence.
What to hand in
- A response comparison plot.
- A scorecard with definitions and units.
- A choice justified by the stated requirements.
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
import numpy as np
from scipy import signal
t = np.linspace(0,12,1201)
_, y = signal.step(([9],[1,2.4,9]),T=t)
outside = np.flatnonzero(np.abs(y-1)>0.02)
settling = None if outside[-1]==len(t)-1 else t[outside[-1]+1]
print('Settling (s):', settling)
print('Overshoot (%):', max(0.,(y.max()-1)*100))
A metric should report missing evidence rather than invent a successful result.
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.