Module Name and Code : ENG60803 Real Time Instrumentation Semester and Year : Semester 5/6, Year 3 Lecture Number/ Week : Lecture 3, Week 3 Learning Outcome (s) : LO5 Module Co-ordinator/Tutor : Dr. Phang Swee King Contact Email : sweeking.phang@taylors.edu.my School of Engineering Faculty of Built Environment, Engineering, Technology & Design
What you have learned last week Sensors & transduces and various examples Types of electrical sensors: resistive, capacitive, inductive Accuracy, precision and error of measurements Sensitivity of measurements (significant figures) Signals and its components: Analog: level, shape, frequency; Digital: state, rate Signal conditioning 2
DAQ Overview 3
Sensor vs Transducer Sensor is a device that detects or measures a physical property and records, indicates, or otherwise responds to it. Example: thermocouple Transducer is a device that converts one form of energy into another. Example: microphone, loudspeaker, thermometer, thermocouple, position and pressure sensor, and antenna Sensors are almost always transducer but transducers are not necessarily sensor. Example: Electrical heater/cooler is a transducer but it is not a sensor 4
Static Characteristic of Sensors Dynamic range Min and max range of the measured physical quantity Min and max range for electric output Accuracy/precision Sensitivity/Resolution Smallest change to be detected Power requirements Passive or active Power consumption/requirements Bandwidth and frequency response Linearity 5
Signal The appropriate transducers convert physical phenomena into measurable signals. However, different signals need to be measured in different ways. For this reason, it is important to understand different types of signals and their corresponding attributes. Signals can be categorized into two groups: Analog Digital 6
ENG60803 Real Time Instrumentation Continuous Time Systems Phang Swee King sweeking.phang@taylors.edu.my SoE, Taylor s University
Learning Outcomes LO Description Lecture 1 Explain the basic concept of instrumentation and measurements, including interrupts and data acquisition. 2 Analyse the phenomenon of sensors, industrial devices including different flow and level measuring techniques. 3 Make use of appropriate software for real time system simulations. 4 Analyse a suitable A/D and D/A converters, for realtime instrumentation systems. 5 Evaluate transfer functions, state-space, and/or block diagrams to describe and manipulate continuous time systems. 6 Design a suitable PID controller for process. 4 1, 2 6 Lab 5 3 8
Outline 1. Classification of Systems 2. Definition of Transfer Function 3. Solutions to Electrical Systems 4. Solutions to Mechanical Systems 5. Block Diagram Reduction for System Simplification 9
Classification of Systems Static Systems Non-causal Non-linear Dynamic Causal Linear We focus only on linear time invariant (LTI) causal dynamic systems, which is easy to analyse Time varying Time invariant 10
Static vs. Dynamic A static system is also called a memoryless system. The output signal y(t) at time t only depends on the input signal at time t. The response of the system is instantaneous, i.e., no transient response. Example: resistor A dynamic system has non-zero memory. Output of the dynamic system y t depends not just on the input signal at time t, but also in the past or future values of the input signals, e.g.: t 1, t, t + 1, Example: capacitor, inductor 11
Causal vs. Non-Causal A causal system is a system where the output depends only on the inputs at present time and in the past. y t = f{u t, u t 1,, u t k } All real-time physical systems are causal because time can only move forward. All memoryless system (static) is causal because the output only depends on input at current time. Example: RC circuit is causal. The capacitor voltage responds to only the past and the present voltage source. A non-causal system depends on inputs at present time, in the past, and also in the future. 12
Linear vs. Non-Linear A linear system holds the following two properties: 1. Homogeneity: if u is any signal, and a is any scalar: F au = af(u) 2. Additivity: if u 1 and u 2 are any two signals: F u 1 + u 2 = F u 1 + F(u 2 ) Our focus in this module is linear system. Why? A non-linear system is the system that does not satisfy the two properties above. Example: y t = 5 sin u(t), y t = 3u 2 (t) Most physical systems are non-linear. However they can be linearized or approximated linear for analysis 13
Linear vs. Non-Linear A non-linear system example: Consider the pendulum oscillator, the torque on the mass is given by T(t) = MgL sin θ(t) We all know that the pendulum swings only at small and limited angle where θ 0 o. With small angle approximation sin θ θ, we have a linear system T t = MgLθ(t) Note: the linearized result is the same if you take the first Taylor s expansion at θ = 0 o. Try it at home! 14
Time Varying vs. Time Invariant A time invariant system has outputs remain the same regardless of when the inputs are applied, as long as the inputs are identical Such a system can be described by differential equation with constant coefficients A time varying system has different outputs when the same inputs apply to the system at different time Figures from Tay, Feedback Control Systems, NUS 15
Transfer Function The transfer function (TF) of a system, G(s), is the transfer gain from input, U(s), to the output of the system, Y(s). U(s) G(s) Y(s) It is the ratio of the Laplace Transform of the output Y(s) to the input U(s). G s = Y s U(s) Important assumption 1: all initial conditions are zero! Important assumption 2: only work in LTI systems! 16
Transfer Function Most linear systems can be described by a linear constant coefficient o.d.e: a n y (n) + + a 1 y + a 0 y = b m u m + + b 1 u + b 0 u By taking the LT on both side with zero initial conditions, we have (a n s n + + a 1 s + a 0 )Y(s) = (b m s m + + b 1 s + b 0 )U(s) G s = Y s U(s) = b ms m + + b 1 s + b 0 a n s n + + a 1 s + a 0 We can easily find the outputs of the system given the transfer function of it and the input signals. 17
Example 1: Transfer Function Find the transfer function represented by yሶ t + 2y t = u(t) Solution: Taking the LT on both sides, with zero initial conditions Transfer function, sy s + 2Y s = U(s) s + 2 Y s = U s G s = Y s U s = 1 s + 2 18
Modeling Electrical Systems We apply the transfer function to the mathematical modeling of electrical circuits so that we could analyse the response of the circuits corresponds to different input. Electrical circuits consist of three passive linear components: resistors, capacitors, and inductors. 19
Example 2: RC Circuit Consider the following circuit: Input is the applied voltage, v(t) Output is the voltage across the capacitor, v c (t) Initial voltage, v c (0) Solution: Kirchhoff voltage law (KVL): v r t + v c t = v t Ri t + v c t = v t Since i t = C dv c(t), we have dt RC dv c(t) + v dt c t = v(t) 20
Example 2: RC Circuit To get the transfer function from v to v c RC dv c(t) dt we apply LT on both side + v c t = v t RCsV c s + V c s = V s G s = V c s V s = 1 RCs + 1 21
Impedance Now let us develop a technique to simplify the solution for circuits. First, take the LT of the individual elements of the circuit: Capacitor: V s = 1 Cs I(s) Resistor: V s = RI(s) Inductor: V s = LsI(s) Now we define the transfer function Z s = V s I s transfer function for each individual component, we can obtain the Notice that this transfer function is similar to the definition of resistance (i.e., ratio of voltage to current). But, unlike resistance, it is also applicable to capacitors and inductors with the information on the dynamic behavior of the components. We call this particular transfer function as impedance. 22
Impedance We can redraw the circuit by replacing each element with its impedance. We call this altered circuit the transformed circuit. Rather than writing the d.e. then taking the LT, we can now obtain the LT of the d.e. by simply applying KVL to the transformed circuit: Ls + R + 1 Cs I s = V(s) Relates the output of the system to I(s). In this case: V c s = 1 Cs I(s). 23
Example 3: RC Circuit Same example, but use impedance method Solution: By using the impedance of the element, we obtain R + 1 Cs I s = V(s) We also know that V c s = 1 Cs I(s) Thus RCsV c s + V c (s) = V s V c s V s = 1 RCs + 1 24
Modeling Complex Circuits For complex electrical circuits with multiple loops, we can perform the following steps: 1. Replace passive element values with their impedances 2. Replace all sources and time variables with their LT 3. Assume a transform current and direction in each loop/mesh 4. Write KVL around each mesh 5. Solve the simultaneous equations 6. Form the transfer function This is called loop/mesh analysis 25
Example 4: Multiple Loops Given the network of the following figure, find the transfer function I 2 (s)/v(s). Solution: redraw the transformed circuit with the TF of each signals and components: 26
Example 4: Multiple Loops Around mesh 1: Around mesh 2: R 1 I 1 s + LsI 1 s LsI 2 s = V(s) LsI 2 s LsI 1 s + R 2 I 2 s + 1 Cs I 2 s = 0 Rearranging them, we get: R 1 + Ls I 1 s LsI 2 s = V s LsI 1 s + Ls + R 2 + 1 Cs I 2 s = 0 Solve simultaneous equations! 27
Example 4: Multiple Loops R 1 + Ls I 1 s LsI 2 s = V s LsI 1 s + Ls + R 2 + 1 Cs I 2 s = 0 Solve simultaneous equations! How to solve simultaneous equations? Solve it with algebra Solve it with matrix Solve it by using Cramer s Rule More information about Cramer s Rule go to http://www.coolmath.com/algebra/14-determinants-cramers-rule/01- determinants-cramers-rule-2x2-01 28
Modeling Mechanical Systems A mechanical system is basically a system of elements that interact based on fundamental mechanical principles There are two types of mechanical system Translation system: the motion is linear, we consider the force and mass of the system Rotational system: the motion is revolution, we consider the torque and moments of inertia of the system In this lecture, we will only discuss about translational (linear) mechanical system. 29
Mechanical Motion Time derivatives of displacement are used to describe a motion, for example: Displacement: a vector quantity representing the length of separation between two objects Velocity: rate of change of displacement Acceleration: rate of change of velocity Higher derivatives? 30
Mechanical Motion Differentiate Displacement Velocity Acceleration Integrate 31
Newton s Law of Motion Law 1: Mass (inertia) An object will stay at rest until there is an external force applied to it Law 2: Acceleration (gravity) F = ma Law 3: Action-reaction For every action, there will always be an equal and opposite reaction. 32
Modeling Mechanical Systems Linear motions Mathematics model Symbols Spring f t = Kx(t) Damper f t = f v dx(t) dt Mass f t = M d2 x(t) dt 2 Figures from Nise, Control Systems Engineering, Wiley. 33
Spring Systems Spring constant: 1 k eq = 1 k 1 + 1 k 2 n 1 1 = k eq k i i=1 Spring constant: k eq = k 1 + k 2 n k eq = i=1 k i 34
Damper Systems Damping constant: 1 b eq = 1 b 1 + 1 b 2 n 1 1 = b eq b i i=1 Damping constant: b eq = b 1 + b 2 n b eq = i=1 b i 35
Modeling Mechanical Systems Step 1: Sketch free body diagram (FBD) with all forces acting on the body, relating them to displacement according to the formula table Step 2: Obtain a set of differential equation by Newton s Law and conserve all forces, i.e., F in = F out Step 3: Represent the d.e. in transfer function with F as input and x as output 36
Example 5: Simple System Find the transfer function, X s F s, for the following system. Step 1: draw a FBD Step 2: obtain d.e. by equating forces F m + F d + F s = F f Mxሷ t + f v xሶ t + Kx t = f(t) 37
Example 5: Simple System Step 3: apply Laplace Transform Form transfer function Ms 2 X s + f v sx s + KX s = F s G s = X s F s = 1 Ms 2 + f v s + K 38
Impedance Similar to electric circuit, we can define impedances for mechanical components: Spring: F s = KX(s) Viscous damper: F s = f v sx(s) Mass: F s = Ms 2 X(s) Now we define the transfer function Z m s = transfer function for each individual component With this we can write F s X s, we can obtain the sum of impedances X s = [sum of applied forces] 39
Degree of Freedom Many mechanical systems are similar to multiple-loop electrical networks, where more than one simultaneous d.e. is required to describe the system In mechanical systems, the number of equations of motion required is equal to the number of linearly independent motions Linear independences implies that a point of motion in a system can still move if all other points of motion are held still. The number of such points in a system is the number of degrees of freedom (d.o.f) Since we only use linear components, we can obtain the total forces acting on each point by superposition method 40
Complex Mechanical Systems To solve complex mechanical systems (more than 1 d.o.f), we draw the free-body diagram for each point of motion. For each free-body diagram we apply superposition method: hold all other points still (as if a wall), and find all forces acting on the body due to only its own motion. Then we hold the body still, and activate the other points of motion one at a time. Find all forces acting on the still body due to motion of other points. Finally, we sum the forces on each body and set the sum to zero, we will get a system of simultaneous d.e. Apply Laplace Transform to find Transfer Function from each input to output. 41
Example 6: Complex System Find the transfer function from f(t) to x 2 (t): Solution: We analyse the moving parts 1 by 1, first start with M 1. Draw the FBD of M 1 M 1 moves while M 2 is still M 2 moves while M 1 is still 42
Example 6: Complex System Superimpose the 2 diagrams Similarly for M 2, 43
Example 6: Complex System Now write the Laplace Transform for M 1 and M 2 K 1 + K 2 + f v1 s + f v3 s + M 1 s 2 X 1 s K 2 + f v3 s X 2 s = F s K 2 + f v3 s X 1 s K 2 + K 3 + f v2 s + f v3 s + M 2 s 2 X 2 s = 0 Solve the simultaneous equations for X 2 (s) and we can find the transfer function X 2 s F s. 44
Block Diagrams Block diagrams provide a pictorial representation of a system Unidirectional operational block representing individual transfer functions. Every block is a system by itself!!! Four basic elements used in block diagrams: 1. Rectangles systems 2. Lines signals 3. Circles summing points 4. Signal Distribution pickoff points 45
Basic Elements Components of a block diagram for an LTI system 46
Common Signal Flows y = Ax e = r c y = Ax Bz 47
Cascaded Subsystems Blocks are arranged in series, we can also called it cascaded systems It can be represented by an equivalent block 48
Parallel Subsystems Blocks are arranged in parallel It can be represented by an equivalent block 49
Closed-Loop Systems Typical closed-loop control system consists of several blocks that includes sensors, plant (system), and controller. 50
Closed-Loop Systems How? 51
Design of Feedback Systems Most of the time, the output of the block diagram is feedback to create a closed-loop system An immediate application of the principles of block diagram reduction is the analysis and design of feedback systems Percent overshoot, settling time, peak time, and rise time can then be found from the equivalent transfer function 52
Example 7 Consider a feedback system shown in figure below. 2 R(s) 3s 1 s + 1 Y(s) 1/s Answer: H s = Y s R s = 3s2 + 2s + 1 4s 2 + 3s + 1 53
Summary Definition of Transfer Function, form TF from LT 3 basic linear element for electrical circuit Solve complex circuit with KVL and apply superposition method 3 basic linear element for mechanical system Solve complex mechanical system using FBD and apply superposition method Simplify complex block diagram to find equivalent block, or the transfer function 54
Coming up next Time Domain Analysis Zeros, poles System response, impulse, step First and second order system parameters 55