4.0 Electrical Systems Now that we have learned to use transfer functions to model mechanical systems we will apply the approach to another important class of problems: electrical systems. Just as mechanical systems are composed of three elements: the mass, spring and damper; electrical systems are made of capacitors, inductors and resistors. These are assembled into circuits, which are drawn in a manner similar to the way we drew mechanical system diagrams. Circuit Elements We begin our study by showing models of the three major elements: the resistor, capacitor and inductor. The symbol for a resistor (a schematic of a heater wire) is shown below R v1 v2 i The voltage drop across a resistor is given by Ohm’s law 𝑣1 − 𝑣2 = 𝑖𝑅 A capacitor is composed of two parallel plates of metal that store electrical charge. The symbol (two parallel lines) is shown below C v1 v2 i The current that flows into a capacitor is 𝑖=𝐶 𝑑𝑣 𝑑𝑡 Where v = v1 – v2 is the voltage across the capacitor. More often, however, we are interested in the finding the voltage across the capacitor, and not its derivative. This is given by 𝑡 1 𝑣1 − 𝑣2 = ∫ 𝑖 𝑑𝑡 𝐶 0 What this equation really means is that the energy stored in a capacitor (in the form of a voltage across the plates) is proportional to the total amount of current that has flowed into the capacitor. 1 To put this another way, capacitors store energy by filling up with electrons, much like a water tower stores potential energy by filling up with water. The symbol for an inductor is a coil of wire. When current flows through a coil of wire a magnetic field is generated inside the coil. If we try to stop the flow of current suddenly (as by opening a switch, for example) the magnetic field will try to keep the current flowing, by setting up a voltage across the coil. L v1 v2 i The voltage generated across an inductor is 𝑣1 − 𝑣2 = 𝐿 𝑑𝑖 𝑑𝑡 As you can see, the voltage is proportional to the rate of change of the current. If you try to stop the current instantly (Δt = 0) the voltage generated will be infinite! For this reason you will often see arcing across a switch if you cut power to a DC motor suddenly. An inductor stores energy with the flow of electrons, much like a large pipe can store kinetic energy through the inertia of flowing water. Integrating the above expression gives the amount of current flowing through the inductor over a time t. 𝑡 1 𝑖 = ∫(𝑣1 − 𝑣2 )𝑑𝑡 𝐿 0 Electrical Circuits One of the easiest ways to analyze the behavior of circuits is to use Kirchhoff’s voltage and current laws. We will demonstrate these through a few examples. 2 R Vo + Vs C - Example 1 A simple RC circuit is shown above. The input is the voltage source Vs and the output is the voltage a the node between the capacitor and the resistor. Note that the resistor symbol is the “Eurostyle” type, a rectangular box. We’ll use Kirchhoff’s current law to solve for the transfer function, V0/Vs The current flowing through the capacitor into node vo is 𝑖𝑐 = −𝐶 𝑑𝑣0 𝑑𝑡 The minus sign comes about because we are calculating current flowing into the node (from ground to vo). The current flowing through the resistor is 𝑖𝑅 = 𝑣𝑠 − 𝑣0 𝑅 Since there is no outlet from this node the sum of currents flowing into the node must equal zero. 𝑖𝑐 + 𝑖𝑅 = 0 −𝐶 𝑑𝑣𝑜 𝑣𝑠 − 𝑣𝑜 + =0 𝑑𝑡 𝑅 Take the Laplace transform of this equation −𝐶𝑉𝑜 𝑠 + 1 (𝑉 − 𝑉𝑜 ) = 0 𝑅 𝑠 𝑉𝑠 = (𝑅𝐶𝑠 + 1)𝑉𝑜 The transfer function of the circuit is then 𝑉𝑜 1 = 𝑉𝑠 𝑅𝐶𝑠 + 1 3 Example 2 An LRC circuit is shown below. Find the transfer function Vo/Vs for the system. L R Vo + Vs C - Again, we’ll use Kirchhoff’s current law to find the transfer function. We have two nodes in this circuit, so we’ll need two equations. The sum of the currents entering the node between the resistor and inductor is 𝑡 1 𝑣𝑜 − 𝑣1 ∫(𝑣𝑠 − 𝑣1 )𝑑𝑡 + =0 𝐿 𝑅 0 And the sum of currents entering the node at vo is 𝑣1 − 𝑣𝑜 𝑑𝑣𝑜 −𝐶 =0 𝑅 𝑑𝑡 Taking the Laplace transform of both equations gives 1 1 (𝑉𝑠 − 𝑉1 ) + (𝑉𝑜 − 𝑉1 ) = 0 𝐿𝑠 𝑅 1 (𝑉 − 𝑉𝑜 ) − 𝐶𝑠𝑉𝑜 = 0 𝑅 1 Using MathCAD to solve for the output voltage gives: 𝑉𝑜 1 = 2 𝑉𝑠 𝐿𝐶𝑠 + 𝑅𝐶𝑠 + 1 4 Electrical Impedance You may have noticed that, with a little extra effort, we could have gone directly to the Laplace transforms of the “equations of motion” for the systems, instead of writing the differential equations. We do this by treating each element like a resistor. Recall that a resistor has a simple relationship between voltage and current 𝑅= 𝑣 𝑖 We can write a similar relationship for an inductor 𝑣=𝐿 𝑑𝑖 𝑑𝑡 Taking the Laplace transform of this equation gives 𝑉 = 𝐿𝐼𝑠 Or, rearranging slightly 𝑉 = 𝐿𝑠 𝐼 The Ls term is similar to a resistance in that it is the ratio of the voltage drop to the current, but it is complex. We denote the Laplace transform of the ratio of voltage to current the “electrical impedance”. The impedances of the three simple elements are 𝑍𝑅 = 𝑅 𝑍𝐶 = 1 𝐶𝑠 𝑍𝐿 = 𝐿𝑠 Now it will be a simple matter to write the Kirchhoff’s current law for a circuit. The current flowing through any element is given by 𝐼= 𝑉1 − 𝑉2 𝑍 where Z is the impedance of the element. 5 R Vo Vo + Vs - Vs C + C - R Example 3: Find the transfer function, Vo/Vs, for the circuits above. Solution: For the circuit on the left, write Kirchhoff’s current equation for the node at Vo. 𝑉𝑠 − 𝑉𝑜 −𝑉𝑜 + =0 1 𝑅 𝐶𝑠 𝑉𝑠 − 𝑉𝑜 − 𝑅𝐶𝑠𝑉𝑜 = 0 (𝑅𝐶𝑠 + 1)𝑉𝑜 = 𝑉𝑠 𝑉𝑜 1 = 𝑉𝑠 𝑅𝐶𝑠 + 1 For the circuit on the right, we have: 𝑉𝑠 − 𝑉𝑜 −𝑉𝑜 + 1/𝐶𝑠 𝑅 (𝑉𝑠 − 𝑉𝑜 )𝑅𝐶𝑠 − 𝑉𝑜 (𝑅𝐶𝑠 + 1)𝑉𝑜 𝑉𝑜 𝑉𝑠 =0 =0 = 𝑉𝑠 𝑅𝐶𝑠 𝑅𝐶𝑠 = 𝑅𝐶𝑠 + 1 We will discuss the function of each of these circuits in a subsequent section. 6 Example 4: L Vo Vs + - C Find the transfer function Vo/Vs of the circuit shown above Solution: Writing the Kirchhoff’s current law for the node at Vo, we have 𝑉𝑠 − 𝑉𝑜 −𝑉𝑜 + =0 𝐿𝑠 1/𝐶𝑠 𝑉𝑠 − 𝑉𝑜 − 𝐿𝐶𝑠 2 𝑉𝑜 = 0 𝑉𝑜 1 = 𝑉𝑠 𝐿𝐶𝑠 2 + 1 7 Example 5: Find the response of the system in Example 4 to a step input of 10V, if C = 10μF and L = 10mH Solution: Recall, the Laplace transform of a step input is 1/s, so that 10 10 𝐿𝐶 𝑉𝑜 = = 1 𝐿𝐶𝑠 2 + 1 𝑠 𝑠(𝑠 2 + 𝐿𝐶 ) 1 Using Row 25 of the Laplace transform table we have 1 𝑣𝑜 (𝑡) = 10 [1 − cos (√ 𝑡)] 𝐿𝐶 = 10[1 − cos(1000𝑡)] 20 15 v( t ) 10 5 0 0 0.002 0.004 0.006 0.008 t 8 R Vo + Vs C - Response to Sinusoidal Inputs Example 6: Find the steady-state response of the first circuit in Example 3 to a sinusoidal input with frequency ω. Solution: The Laplace transform of a sine function is 𝑉𝑜 = 𝜔 𝑠2 +𝜔2 , so that 1 𝜔 ∙ 2 𝑅𝐶𝑠 + 1 𝑠 + 𝜔 2 Using MathCAD to find the inverse Laplace transform gives vo (𝑡) = 𝑡 1 − 𝑅𝐶 + sin 𝜔𝑡 − 𝑅𝐶𝜔 cos 𝜔𝑡] [𝑅𝐶𝜔𝑒 (𝑅𝐶𝜔)2 + 1 In the steady-state, the exponential term will decay away, and we’ll be left with 𝑣𝑜 (𝑡) = sin 𝜔𝑡 − 𝑅𝐶𝜔 cos 𝜔𝑡 (𝑅𝐶𝜔)2 + 1 Factor the denominator into two separate terms (𝑅𝐶𝜔)2 + 1 = √(𝑅𝐶𝜔)2 + 1 ∙ √(𝑅𝐶𝜔)2 + 1 and bring the first outside the denominator 𝑣𝑜 (𝑡) + 1 1 −𝑅𝐶𝜔 [ sin 𝜔𝑡 + cos 𝜔𝑡] √(𝑅𝐶𝜔)2 + 1 √(𝑅𝐶𝜔)2 + 1 √(𝑅𝐶𝜔)2 + 1 9 1 -RC Examining the triangle above we see that sin 𝜑 = − 𝑅𝐶𝜔 cos 𝜑 = √(𝑅𝐶𝜔)2 +1 1 √(𝑅𝐶𝜔)2 +1 so that 𝑣𝑜 (𝑡) = 1 √(𝑅𝐶𝜔)2 + 1 [cos 𝜑 sin 𝜔𝑡 + sin 𝜑 cos 𝜔𝑡] Using the identity sin 𝐴 cos 𝐵 + cos 𝐴 sin 𝐵 = sin(𝐴 + 𝐵) we can write 𝑣𝑜 = 𝐴 sin(𝜔𝑡 + 𝜑) where 𝜑 = tan−1 (−𝑅𝐶𝜔) 𝐴= 1 √(𝑅𝐶𝜔)2 +1 As we might have expected, the response of the system to a sinusoidal input is a sinusoidal output. The output has a time delay relative to the input known as the phase shift, φ. Its amplitude, A, is a function of the circuit components and the driving frequency, ω. Now let us try an experiment: substitute the quantity jω for each instance of s in the transfer function. 1 1 𝐺(𝑠) = → 𝐺(𝑗𝜔) = 𝑅𝐶𝑠 + 1 1 + 𝑗𝜔𝑅𝐶 1 1 − 𝑗𝜔𝑅𝐶 ∙ 1 + 𝑗𝜔𝑅𝐶 1 − 𝑗𝜔𝑅𝐶 1 − 𝑗𝜔𝑅𝐶 = 1 + (𝑅𝐶𝜔)2 𝐺(𝑗𝜔) = The quantity G(jω) is a complex function. We can find its magnitude and angle using the following formulas 10 |𝐺(𝑗𝜔)| = √(𝑅𝑒{𝐺(𝑗𝜔)})2 + (𝐼𝑚{𝐺(𝑗𝜔)})2 1 (𝑅𝐶𝜔)2 √ = + [1 + (𝑅𝐶𝜔)2 ]2 [1 + (𝑅𝐶𝜔)2 ]2 1 + (𝑅𝐶𝜔)2 =√ [1 + (𝑅𝐶𝜔)2 ] 1 = √1 + (𝑅𝐶𝜔)2 The angle associated with the complex function is 𝐼𝑚{𝐺(𝑗𝜔)} ) 𝑅𝑒{𝐺(𝑗𝜔)} −𝑅𝐶𝜔 1 + (𝑅𝐶𝜔)2 = tan−1 [ ] 1 1 + (𝑅𝐶𝜔)2 −1 = tan (−𝑅𝐶𝜔) 𝜑 = tan−1 ( This is interesting! This means that (for this case, anyway) the response of a system to sinusoidal input can be found by substituting jω for s in the transfer function, then calculating the magnitude and phase of the result. The final result is 𝑣𝑜 (𝑡) = 𝐴 sin(𝜔𝑡 + 𝜑) where 𝐴 = |𝐺(𝑗𝜔)| 𝐼𝑚{𝐺(𝑗𝜔)} 𝜑 = tan−1 ( 𝑅𝑒{𝐺(𝑗𝜔)} ) We will not prove it here, but this result holds for all stable systems. Thus, we have found another very important use for the transfer function: namely, to find the steady-state response of systems to sinusoidal input. This is also known as frequency response analysis. 11 Example 6 R Vo Vo + Vs Vs C - + C R - Perform a frequency response analysis for the two circuits above. Plot the frequency response of each circuit if R = 1kΩ and C = 10μF. Solution: We have found the transfer functions for these two circuits already 1 1 + 𝑅𝐶𝑠 1 𝐺1 (𝑗𝜔) = 1 + 𝑗𝜔𝑅𝐶 𝐺1 (𝑠) = 𝑅𝐶𝑠 1 + 𝑅𝐶𝑠 𝑗𝜔𝑅𝐶 𝐺2 (𝑗𝑤) = 1 + 𝑗𝜔𝑅𝐶 𝐺2 (𝑠) = We can now plot the response functions in MathCAD, as shown below. It is very common to plot the response on a log-log scale, as this brings out the behavior of the filters most clearly. As can be seen, the first filter allows low frequencies through and attenuates high frequencies; thus, it is a lowpass filter. The second circuit attenuates low frequencies and passes high frequencies – this is a highpass filter. 1 A1( 2 f) A2( 2 f) 0.1 0.01 1 10 100 1 10 3 f 12