ENGR 110 Engineering Modelling and Design Control Systems Modelling II
Lecture Plan 1. Braitenberg Vehicles Open and Closed Loop Systems Feedback Why use control? 2. Transfer functions Transfer functions to Time response Methods to integrate 3. Control PID control
System Modelling System to Model Simplify Plant Input Output Start with a single input - single output model O(t)= I(t).G(t)
Modelling In order to model a system: 1.We identify input signals [variables] 2.Identify components [things that manipulate variables] – Add/subtract them – Multiply/divide – Integrate/differentiate – Duplicate/merge – … 3.We combine internal signals [modified variables] 4.Produce the output signal [another variable]. The Input-Output relationship may then be determined
Components of a model:
Convenience of ‘s’
Simplify Combine into single system linking input force to output distance: Or Time domain s domain Can leave (s) off as implied when we see an ‘s’ term rearrange
Transfer Function
note single input, single output Linear Time Invariant Systems Plant Input Output
Transfer Function Describe how the system is changing in an instant. f(t) t
Transfer Function Can be spatial: Or temporal: [ most systems we model are temporal - both input and output variables vary with time] f(x) x f(t) t
Transfer Function to Time Response Have how a system changes in an instant Want how the system changes over time: Must sum up each of these instantaneous changes Integrate! f(t) t f(t) t
Input Function Sketch s-domain Ramp tu(t) Sinusoid sin t Input Function Sketch s-domain Impulse (t) Step u(t) Types of Input f(t) t f(t) t 1 1/s f(t) t f(t) t 1/s 2
Can be a unit step input e.g. 1V Can be multiple-unit step input e.g. 2.5V 2.5 [What would you used to model an input from an Arduino port?] Input Function Sketch s-domain Step u(t) Very common input to systems: switch being closed (on) new value being set DC signal... Step Input f(t) time t 1/s f(t) 1 time t 1/s f(t) 1 time t 2.5/s
We know that V=IR where R is a constant value Let us set R to 400 ohms then connect the 5 V signal from the Arduino What happens? Input voltage from the Arduino Step Input – Example 1 f(t) 5 time t 5/s f(t) 5 time t Input Output???
Integration! I=V/R Step Input - Example f(t) 5 t = 1 f(t) 5 time t Input Output??? I=V/R f(t) 5 t = 2 I=V/R f(t) 5 t = 3 I=V/R f(t) 5 t = 4 I=V/R f(t) 5 t = 5 I=V/R f(t) 5 t = 6
Input force on the mass Step Input – Example 2 f(t) 5 time t 5/s f(t) 5 time t Input Output??? f(t) 5 t = 1
How to integrate? Numerically Graphically Mathematically Look up table
clf; %clear all graphs K = 10 %Spring constant C = 3 %Damping constant m = 1 %mass (constant) t = [0: 0.01: 20];%set up the time increments stept = 1 + 0*t; %graph to show step response plot(t,stept,'m'); xlabel('Time t (s)') ylabel('Distance x (m)') hold on % put each graph on top of each other for C = 1.0: 1: 10.0 d = tf(9,[m C K]) [y,t]=step(d,T);%step response over one second plot(t,y,'k'); pause(2) end Numerical in Matlab