ET3-7: Modelling II(V) Electrical, Mechanical and Thermal Systems
Agenda of the Day 1. Resume of lesson I 2. Basic system models. 3. Models of basic electrical system elements 4. Application of Matlab/Simulink to the simulation of the behaviour of electrical dynamic systems
1.1(14) An example dynamic system An electrical dynamic system Moves the coil and cone A mechanical system Which drives the air A thermodynamic system We want a method to predict what will happen during operation
1.2(14) What do we need? Theory that works for many different physical processes Solves electrical, magnetic, mechanical and thermal problems Steady state characteristics; capacity; efficiency; losses; sizing Transient response; steady state errors; stability; settling time; etc. System behaviour during faults? Theory must account for the past history of the system and enable us to predict future behaviour under known applied conditions
1.3(14) Example - Concept of a cruise control system for a car A cruise control system in a car comprises several sub-systems.
1.4(14) Example - Coupling between mechanical and electrical systems concept of a battery powered vehicle
1.5(14) Force Balance The equation of motion Various mechanical forces oppose movement Acceleration of the mass Various frictional forces Gravity (not shown) Wind (not shown) F = m x + B x + f e F e Bx + f mx dx m
1.6(14) Simple Linear Mechanical system = + + F mx Bx f
1.7(14) Simple Rotating Mechanical system T = J + θ Bθ + f T = J ω + Bω + f
1.8(14) More Complicated Mechanical system Break it down to a set of free body diagrams Write the differential equations And solve them (integrate them)
1.9(14) Needs a Free Body Diagram for Each Mass We arrive at a set of simultaneous differential equations
1.10(14) Needs a Free Body Diagram for Each Mass In this way, we arrive at a set of simultaneous differential equations ( ) ( ) 2 1 2 2 1 1 1 1 1 ( ) ( ) ( ) B x x + K x x Mx K x = f t Mx B x x K x x = a 2 2 2 1 2 2 1 0 0
1.11(14) The State-Space formulation Convenient to solve using Matlab/Simulink Manipulate the differential equations a set of first order ordinary differential equations Isolate the differential term The standard form q = aq+ aq + aq + bu+ bu 1 11 1 12 2 13 3 11 1 12 2 q = a q + a q + a q + b u + b u 2 21 1 22 2 23 3 21 1 22 2 q = a q + a q + a q + b u + b u 3 31 1 32 2 33 3 31 1 32 2 y = cq+ cq + cq + du+ du 1 11 1 12 2 13 3 11 1 12 2 y = c q + c q + c q + d u + d u 2 21 1 22 2 23 3 21 1 22 2
1.12(14) The State-Space formulation in Matrix Form The standard form In Matrix Form Q = + A Q B U = + Y C Q D U
1.13(14) Steps When Modelling a System Physics and topology Select the model Simplifying assumptions Draw the Free Body Diagram(s) Write the equations of motion Differential equations Values of system coefficients Mass; moment of inertia; inductance; resistance etc. Solve the equations of motion Integrate them
1.14(14) Cruise Control for a Car So the State-Space Matrices are 0 1 0 A = = = = b, B 1, C 1 0, D 0 0 m m
2. Basic System Models
2.1(33) System models A system usually comprises several subsystems They may be a mix of types Electrical Mechanical Thermal Like our cruise control system
2.2(33) A cruise control system for a car A cruise control system in a car comprises several sub-systems.
2.3(33) Example: A Translational Electro-mechanical Actuator Loudspeaker
2.4(33) Notional Model of a Consider the electrical and mechanical sub-systems of the moving coil loudspeaker. The electrical and mechanical subsystems of the loudspeaker are coupled by the Lorentz force and by the back emf acting on the circuit. The Lorentz force caused by current flowing in the coil reacting with the magnetic field acts on the mass, causing it to move The motion of the coil in the magnetic field induces Faraday s Law voltage in the coil, opposing the current Loudspeaker
2.5(33) Model of the electrical sub-system of the loudspeaker Modelling the electrical subsystem uses a circuit diagram comprising: the supply voltage source, a resistor, an inductor, and a velocity dependent voltage source. The resistor represents the resistance of the coil The inductor is the inductance of the coil. The velocity dependent voltage source represents the effect of the back emf. (Faraday s Law)
2.6(33) Model of the mechanical sub-system of the loudspeaker Modelling the mechanical sub-system employs a free body diagram in which a spring force, a damping force, An inertial force, and the Lorentz force act on the mass. The Lorentz force is the current dependent actuating force.
2.7(33)Model of the electrical sub-system of the loudspeaker The arrow indicates the direction of positive current flow The the plusses and minuses indicate the direction of voltage drop. Kirchhoff's current law around the loop yields ei - e R - e B - e L = 0
2.8(33) Model of the electrical sub-system of the loudspeaker The voltages are denoted by: Voltage Source e i (t) Resistor e R = Ri Back EMF e = qx' Inductor L b e = Li' Leading to: e i (t) - Ri - qx' - Li' = 0
2.9(33) Model of the mechanical sub-system of the loudspeaker Four forces act on the mass representing the voice coil and cone. Spring Force kx Toward the Left Damper Force bx' Toward the Left Inertial Force mx" Toward the Left Lorentz Force qi Toward the Right D'Alembert's Law states that the sum of all forces acting on a body including the inertial force is equal to zero: -mx" - bx' - kx + qi = 0
2.10(33) Concept Of Transfer Function The transfer function is an alternative model to the State Space formulation It takes a single input and yields a single output It is useful because there are techniques to analyse system performance These techniques are very useful for system design
2.11(33) Transfer function The equation of motion of the free body diagram and the voltage equation of the electric circuit are in the time domain. Together, these determine the transfer function of the electromechanical system from the voltage input to the displacement output.
2.12(33) The Time Domain Differential Equations are: -mx" - bx' - kx + qi = 0 e (t) - Ri - qx' - Li' = 0 i
2.13(33) The Laplace Transform relations for a variable and its first and second derivatives are as follows: L L L { x ( t) } = X ( s) { ' x ( t) } = sx ( s) x ( 0) { '' x ( t) } 2 s X ( s) sx ( ) ' = 0 x ( 0) The initial conditions are assumed to be zero x(0) = 0, x'(0) = 0
2.14(33) Laplace Transform of Equations of Motion i 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) = 0 ms X s bsx s kx s + qi s = E s RI s qsx s LsI s 0 i or 2 ms bs k X ( s ) + qi ( s ) = 0 E s Ls + R I s qsx s = ( ) [ ] ( ) ( ) 0
2.15(33) The transfer function is the ratio of the Laplace transform of the output to the Laplace transform of the input tf = X ( s )/ E ( s ) i We need to eliminate I(s) 1 I s = ms 2 bs k + + X s q ( ) ( )
2.16(33) The transfer function is the ratio of the Laplace transform of the output to the Laplace transform of the input Substituting to eliminate I(s) 1 Ei ( s) Ls + R ms + bs + k qs X s q ( ) 2 [ ] ( ) X s q = 2 2 Ei ( s) [ Ls + R ] ms + bs + k q s
2.17(33) To write a Matlab script for the transfer function >> R = 5; L = 5e-5; k = 2e5; b = 50; m = 4e-3; q = pi; >> s = tf('s'); >> electromech_tf = q/((l*s+r)*(m*s^2+b*s+k)-q^2*s) Transfer function: 3.142 ----------------------------------------- 2e-007 s^3 + 0.0225 s^2 + 250.1 s + 1e006 >> bode(electromech_tf); grid >> impulse(electromech_tf);grid >> step(electromech_tf);grid DEMO00.m
2.18(33) Transfer function is a model limited to the relationship between a single input and a single output We may require to know the transient behaviour of the current variable as well The State Space formulation can help us here We can make a model with several inputs and several outputs
2.19(33) The state-space formulation x' = A x + B u y = C x + D u y is the output and x is the state variable Both x and y may be a vector In the case of vector variables, ABCD become vectors or matrices
2.20(33) Steps required to determine the state-space model Identify the energy storage elements Select the state variables Identify any trivial state equations Determine other necessary state equations using element laws and interconnections Write the model in vector-matrix form
2.21(33) Energy storage elements Electrical The only electrical element in this system that can store energy is the inductor.
2.22(33) Energy storage elements Mechanical Two mechanical elements in this system can store energy One is the spring
2.23(33) Energy storage elements Mechanical Two mechanical elements in this system can store energy The other is the mass
2.24(33) Stored Energy and State Variables Energy Storage Element Inductor Energy Storage Relationship ½Li 2 State Variable i Spring ½kx 2 x Mass ½mv 2 v
2.25(33) Selecting States From the table, the three candidate state variables in our system are i, the current passing through the coil; x, the position of the speaker diaphragm; and v, the velocity of the speaker diaphragm. At this point these are only candidate state variables It may be necessary to define new state variables, if the derivative of the input appears in one or more of the equations.
2.26(33) Identifying Trivial State Equations Trivial state equations are those state equations defined by mathematics rather than physics. In this example there is only one trivial state equation, namely: x ' = v
2.28(33) Determining Other State Equations Using Element Laws And Interconnections Equations of motion e i (t) is the input voltage Substitute state variables -mx" - bx' - kx + qi = 0 e (t) - Ri - qx' - Li' = 0 i -mv'- bv - kx + qi = 0 e (t) - Ri - qv - Li' = 0 i Manipulate to solve for derivative as a function of the states and the input Output equation 1 v'= bv kx qi m 1 i'= e t Ri qv L [ + ] [ i ( ) ] y = x
2.29(33) Manipulate the Equations of Motion Manipluate the equations to give the first derivatives as a function of the states and the inputs This is a form suitable for numerical integration Include the trivial state equations if you need them x'= v k b q v' = - x - v + i m m m q R e(t) i i' = - v - i + L L L
2.30(33)Towards Matrix Form a) Define the State Vector x'= v k b q v' = - x - v + i m m m q R e(t) i i' = - v - i + L L L x' = A x + B u y = C x + D u x x' x = v x' = v' i i'
2.31(33) Towards Matrix Form a) Define the Input Vector x'= v k b q v' = - x - v + i m m m q R e(t) i i' = - v - i + L L L 0 = u 0 e i x' = A x + B u y = C x + D u
2.32(33) Towards Matrix Form a) Define the Coefficient Matrices x'= v k b q v' = - x - v + i m m m q R e(t) i i' = - v - i + L L L x' = A x + B u y = C x + D u 0 1 0 k b q A = B = 0 0 1 m m m q R 0 L L C = 1 0 0 D = 0 0 0
2.33(33) The Finished Matrix Form x'= v k b q v' = - x - v + i m m m q R e(t) i i' = - v - i + L L L x' = A x + B u y = C x + D u 0 1 0 x 0 k b q x' = + v 0 0 1 0 m m m i ei ( t) q R 0 L L x 0 y = + 1 0 0 v 0 0 0 0 i e ( ) i t
3. Models of basic electrical system elements Frequency response, impulse/step response, working with Matlab.
3.1(3)Frequency response Consider an RL circuit supplied with an alternating voltage V is the input quantity AC v f R I e L I is the output quantity If f is variable, I becomes I(f) The circuit response to a pure sinusoidal signal is governed by the transfer function
3.2(3) Example of Frequency response RLC filter Kirchhoff s laws 2nd order equation E i Apply Laplace transform transform the differential equation to an algebraic equation This is an initial value problem R i L C E ir L di 1 dt C idt i = + + 1 z E C idt o = z E o
3.3 (3) Transfer function for an RLC filter E ir L di 1 dt C idt E 1 C idt i = + + o = a f a ff HG I Ei s = I s R + sl + E o s I s sc K J F = H G I 1 a f a f 1 sc K J F HG F HG F I I s E s H G I 1 sc K J o ( ) a fkj E i s = aff 1 I s R + sl + sc E o ( s) KJ E s = 1 a f 2 s LC + scr + 1 i I HG z a f I K J z
4.Application of Matlab/ Simulink to the simulation of the behaviour of electrical dynamic systems
4.1(5) The equation of motion Bridged Tee circuit Node 4 is the voltage reference node 1 v 1 = v node 2 1 2 2 3 2 1 1 2 node 3 3 2 2 i v v v v dv + + C = R R dt v ( v 3 1) v d v + C = 0 2 R dt 0
4.2(5) Use of MATLAB function ss Use of the Matlab function ss Creates a Matlab system object from the A,B,C,D matrices The response of the system may then be analysed in several ways We need to select the State Variables and create the ABCD Matrices State variables are usually related to the energy stored in system elements Here the energy storing elements are the two capacitances
4.3(5) Selection of State Variables The stored energy is given by: WC = ½Cv 2 This leads us to select the voltage across each capacitor as state variables
4.4(5) We need first order differential equations in these How do they look? dv 1 1 1 1 1 1 1 1 1 C = v v v C 1 C 2 i dt C + R R C R + C + R R 1 1 2 1 2 1 1 2 dv v v v C 2 C 1 C 2 i = + dt CR CR CR 2 2 2 2 2 2
4.5(5) In Matrix form A 1 1 1 1 1 C + R R C R 1 1 CR CR 2 2 2 2 1 1 2 1 2 = B 1 1 1 C + R R 1 CR 2 2 1 1 2 =
Exercises Using. Matlab construct a bode plot for this Bridged Tee Circuit.
Exercises Lit.[1] Problem 6.1 Problem 6.3 In each case writ a Matlab script to find the output as a function of the applied frequency and plot a Bode plot of the output.