ELEC273 Lecture Notes Set 1 The course web site is: http://users.encs.concordia.ca/~trueman/web_page_273.htm Lab manual: the lab manual is posted on the course web site. Text book: The bookstore has the sixth edition. Homework problems: chosen from the fifth edition. The homework problems and the “Advance Practice Problems” will be posted on the course web site. Tutorials start this week: Sept. 12 to 16 Do the “Advance Practice Problems” for tutorial #1: Homework assignment #1 is due on Wedesday September 21. 2 Labs start this week! Lab Coordinator: Joe Woods joe@ece.concordia.ca Information about labs: http://users.encs.concordia.ca/~joe/ The lab manual is posted on the course web site, and also on Joe Wood’s web site. The complete lab schedule is posted on the web site: http://users.encs.concordia.ca/~trueman/web_page_273.htm Labs RI and RK start this week, Sept 12 to 15. Labs RJ and RL start nest week, Sept 19 to 22. Topics in ELEC 273 • D.C. circuit analysis • How to solve circuits systematically • Transient analysis • What happens when the switch is turned on? • Solving differential equations systematically. • A.C. circuit analysis • Efficient methods for solving circuits with a cosine generator • Complex numbers D.C. Circuit Analysis • Voltage and current • Circuit components: R, L and C • Sources: voltage source and current source • Kirchoff’s Laws: KVL and KCL • Equations for the branch voltages and currents • Node equations • Mesh equations • Controlled sources • Operational Amplifiers Voltage • Voltage is defined between two points in space, say point A and point B. • The voltage at point A relative to point B is defined as the “work done to move one Coulomb of charge from point B to point A”. (See ELEC251) • “Work” in physics is force times distance ππ = πΉπΉπΉπΉ joules. • If we move a force πΉπΉ through a distance ππ then the work done is ππ = πΉπΉπΉπΉ joules • If the work done to move ππ coul of charge from B to A is ππ, then the voltage is ππ the “work per unit charge” V = joules per coulomb or “volts”. ππ • We can recover the “work” or energy by allowing the charge to move from point A back to point B through a circuit. Voltage Generator or Voltage Source • A “voltage source” maintains a constant voltage between the “+” and the “-” terminals no matter how much current flows. • So when we connect a voltage source to a circuit, the voltage across the circuit is π£π£ = πππ π for ANY value of current ππ from micro amps to mega amps. • Of course it is impossible to build such a voltage source! Hence we sometimes use the term “ideal voltage source”. • A battery is modelled as a voltage source in series with an “internal resistance”. • A battery behaves approximately as a voltage source provided that the “internal resistance” π π π π is small compared to the load resistance. Current • The current is defined as the number of Coulomb of charge transferred per second of time. βππ • If βππof charge is transferred in βπ‘π‘ seconds, then the current is πΌπΌ = coul/sec. βπ‘π‘ Current Generator or Current Source • A current generator or current source supplies a constant amount of current no matter how much voltage appears across the circuit. • We sometimes call this an “ideal” current source. • Of course it is impossible to build an ideal current source! Components • A general component imposes a relationship between the voltage and the current π£π£ = ππππππ(ππ) where ππππππ is a function such as proportional, derivative or integral. • The functional relationship can be non-linear such as that for a diode. Resistor Diode Power and the Sign Convention • The “sign convention” for a component is that the current flows into the “+” sign of the voltage and out of the “-” sign. • Then the power delivered to the component is ππ = π£π£π£π£ watts. • It is important to obey the sign convention in assigning voltages and currents to components in a circuit. • The energy delivered to a component is the time integral of the power: ππ = ∫ ππ π‘π‘ ππππ joules. Resistor • A resistor obeys Ohm’s Law, π£π£ = π π π π where π π is the resistance measured in Ohms. • Ohm’s Law is sometimes written as slope ππ = πΊπΊπΊπΊ where πΊπΊ is the conductance and is measured in Siemens. • The conductance is the reciprocal of the resistance 1 πΊπΊ = π π • The power delivered to the resistor is ππ = π£π£π£π£ = π π π π ππ = ππ 2 π π watts dv =R di Capacitor • A capacitor obeys ππππ ππ = πΆπΆ ππππ where πΆπΆ is the capacitance measured in Farads. • A capacitor stores energy in the electric field that exists in the space between the two “plates” of the capacitor. (ELEC251) • The power delivered to the capacitor is ππ = π£π£π£π£ = • The energy stored in the capacitor is ππππ π£π£π£π£ ππππ ππππ = ππππ πΆπΆπΆπΆ ππππ watts 1 ππ = ∫ ππ π‘π‘ ππππ = ∫ πΆπΆπΆπΆ ππππ = ∫ πΆπΆπΆπΆπΆπΆπΆπΆ = πΆπΆπ£π£ 2 joules. ππππ 2 Inductor • An inductor obeys ππππ π£π£ = πΏπΏ ππππ where πΏπΏ is the inductance measured in Henries. • An inductor stores energy in the magnetic field that exists inside the coil of the inductor. (ELEC251) • The power delivered to the inductor is ππππ ππππ ππ = π£π£π£π£ = πΏπΏ ππ = πΏπΏπΏπΏ watts ππππ ππππ • The energy stored in the inductor is ππππ 1 2 ππ = ∫ ππ π‘π‘ ππππ = ∫ πΏπΏπΏπΏ ππππ = ∫ πΏπΏπΏπΏπΏπΏπΏπΏ = πΏπΏππ joules. ππππ 2 Ideal Wire Equivalent circuit for a real wire. • We build a circuit by connecting sources and components with wires. • Real wires have • resistance. • Inductance • capacitance. • Real wires have time delay: the voltage “wave” travels along the wire at a finite speed π’π’ m/s, and if the length of the wire is πΏπΏ, then the time to travel πΏπΏ along the wire is ππ = seconds. (ELEC351) π’π’ • “Ideal wires” have zero resistance, zero inductance and zero capacitance. • There is no time delay for a voltage to travel along an ideal wire. Circuits and Circuit Analysis Notice that all the voltages and currents obey the sign convention! • A circuit is a collection of components and sources interconnected by “ideal wires”. • The objective of “circuit analysis” is to determine the voltage across each component and the current flowing through each component. • “Circuit analysis” is a systematic procedure for writing linear equations which can be solved for the voltages and the currents. • There is no guessing in circuit analysis. Follow the “systematic procedure” to get the equations. • The objective of ELEC273 is to learn various “systematic procedures” such as mesh analysis and node analysis. Faraday’s Law and Kirchoff’s Voltage Law • Faraday’s Law states that the sum of the voltages around a closed loop is equal to the rate-of-change-with-time of the magnetic flux penetrating the loop: (ELEC251) ππ οΏ½ οΏ½ πΈπΈοΏ½ οΏ½ ππππ = − οΏ½ π΅π΅οΏ½ οΏ½ ππππ ππππ • Applied to a circuit path, we have ππππ οΏ½ π£π£ππ = − ππππ where ππ = β¬ π΅π΅οΏ½ οΏ½ ππππ is the magnetic flux penetrating the loop. (ELEC251) • If π΅π΅ = 0, then the flux is zero, ππ = 0. • Then ∑ π£π£ππ = 0 • This relationship is called Kirchoff’s Voltage Law or KVL: “The algebraic sum of the voltages around a closed path is equal to zero”. Kirchoff’s Voltage Law or KVL +ππππ − π£π£1 − π£π£2 = 0 • Kirchoff’s Voltage Law: ∑ π£π£ππ = 0 “The algebraic sum of the voltages around a closed path is equal to zero.” • By “algebraic” is meant that we must account for the signs of the voltages as we go around the path. KVL : ∑ π£π£ππ = 0 “The algebraic sum of the voltages around a closed path is equal to zero.” Be careful about the signs: Reference polarity has “-” on the left and “+” on the right: Path ABCDA: +ππππ − π£π£1 − π£π£2 = 0 +π£π£2 + π£π£3 − π£π£4 = 0 The Continuity Equation and Kirchoff’s Current Law ππππ ππ1 + ππ2 − ππ3 = ππππ • The Continuity Equation expresses the principle that charge cannot be created or destroyed. • Continuity: the sum of the currents flowing into a closed surface is equal to the rate-of-increase-with-time of the charge stored within the surface: (ELEC251) ππππ οΏ½ ππππ = ππππ • If the charge inside the surface is zero, then ππ1 + ππ2 − ππ3 = 0 ∑ ππππ = 0 • This relationship is called Kirchoff’s Current Law or KCL: “The algebraic sum of the currents entering a closed surface is equal to zero.” KCL at a connection point: ∑ ππππ = 0 The algebraic sum of the currents entering a closed surface is equal to zero. KCL for a closed surface: ∑ ππππ = 0 The algebraic sum of the currents entering a closed surface is equal to zero. Series and Parallel Resistors Series Resistors “Series” means that the current flowing in both the resistors is the same. Find a resistor π π such that the current flowing from the generator is the same for both circuits. Solution: write KVL and KCL equations and solve for current ππ. Choose resistor π π so that the current the same for both circuits. Series Resistors: Let’s solve the circuit very formally using KVL and KCL. KVL around the path ABCDEA: πππ π − π£π£1 − π£π£2 = 0 KCL at the junction between the resistors (point D): ππ1 = ππ2 Ohm’s Law: π£π£1 = π π 1 ππ1 and π£π£2 = π π 2 ππ2 Four unknowns: π£π£1 , π£π£2 , ππ1 , ππ2 We have four equations! Solve the equations: Use ππ1 = ππ2 to eliminate ππ2 in π£π£2 = π π 2 ππ2 by replacing ππ2 with ππ1 : π£π£2 = π π 2 ππ1 Substitute the voltages into KVL: πππ π − π£π£1 − π£π£2 = 0 πππ π − π π 1 ππ1 − π π 2 ππ1 = 0 π π 1 ππ1 + π π 2 ππ1 = πππ π ππ1 = πππ π π π 1 +π π 2 For the equivalent circuit we have πππ π ππ1 = π π To make this current the same as πππ π ππ1 = choose π π 1 +π π 2 π π = π π 1 + π π 2 “Series resistors add.” Voltage Divider Rule What is the voltage across each individual resistor? ππ1 = πππ π π π 1 +π π 2 We have π£π£1 = π π 1 ππ1 so π π 1 π£π£1 = πππ π π π 1 + π π 2 The “voltage divider” rule is handy to remember! and π£π£2 = π π 2 ππ1 so π π 2 π£π£2 = πππ π π π 1 + π π 2 Parallel Resistors “Parallel” means that the voltage across both the resistors is the same. Find a resistor π π such that the current flowing from the generator is the same for both circuits. Solution: (same idea as the above) Write KVL and KCL equations and solve for current ππ. Choose resistor π π so that the current the same for both circuits. Parallel Resistors, continued KVL: πππ π − π£π£1 = 0 for ABCDA: π£π£1 − π£π£2 = 0 So KCL: Ohm’s Law: π£π£1 = π£π£2 = πππ π ππ = ππ1 + ππ2 π£π£1 = π π 1 ππ1 π£π£2 = π π 2 ππ2 Solve the equations: π£π£1 = π£π£2 = πππ π Hence π£π£1 = π π 1 ππ1 gives πππ π ππ1 = π π 1 And π£π£2 = π π 2 ππ2 gives πππ π ππ2 = π π 2 Substitute into KCL: ππ = ππ1 + ππ2 πππ π πππ π ππ = + π π 1 π π 2 1 1 ππ = πππ π + π π 1 π π 2 For the equivalent circuit we have πππ π ππ1 = π π To make this current the same as 1 1 ππ = πππ π + π π 1 π π 2 choose 1 π π = 1 π π 1 1 π π 2 so that 1 π π 1 + π π 2 = π π 1 π π 2 π π π π 1 π π 2 π π = + π π 1 +π π 2 “Parallel resistors combine as product over sum. “ In terms of conductance πΊπΊ π£π£ = π π π π πΊπΊ = 1 π π ππ = πΊπΊπΊπΊ Conductance = 1/resistance so πΊπΊ1 = π π 1 π π 2 π π = = π π 1 + π π 2 Since πΊπΊ = πΊπΊ = 1 1 πΊπΊ1 +πΊπΊ2 1 π π 1 π π 1 and πΊπΊ2 = 1 . π π 2 1 1 1 1 = = 1 π π 1 + π π 2 1 1 + πΊπΊ πΊπΊ 1 2 + π π 1 π π 2 π π 2 π π 1 we have =πΊπΊ1 + πΊπΊ2 πΊπΊ = πΊπΊ1 + πΊπΊ2 “Parallel conductances add.” Current Divider Rule in terms of conductance πΊπΊ ππ = ππ1 + ππ2 and ππ1 = πΊπΊ1 πππ π and ππ2 = πΊπΊ2 πππ π ππ = πΊπΊ1 πππ π + πΊπΊ2 πππ π = (πΊπΊ1 + πΊπΊ2 )πππ π = πΊπΊπΊπΊπ π πΊπΊ = πΊπΊ1 + πΊπΊ2 Parallel conductances add. So πππ π = ππ πΊπΊ and we can write πΊπΊ1 πΊπΊ1 ππ1 = πΊπΊ1 πππ π = ππ = ππ πΊπΊ πΊπΊ1 + πΊπΊ2 Current Divider Rule πΊπΊ1 ππ1 = ππ πΊπΊ1 + πΊπΊ2 πΊπΊ2 ππ2 = ππ πΊπΊ1 + πΊπΊ2 Introduction to SPICE SPICE = Simulation Program with Integrated Circuit Emphasis • In ELEC273, you will use SPICE to solve the circuits in the laboratory and to compare with your measured data. • There are many “free” versions of SPICE. • My preference is LTSpice: http://www.linear.com/designtools/software/ • LTSpice is easy to learn and use and has all the features we need for this course. • In later courses you will use Pspice, which is a full-featured ‘professional’ edition of Spice intended for integrated circuit design. Building a Circuit in LTSpice Start LTSpice to get the main menu. Choose File>new schematic to start a new circuit Choose File>save as and give your circuit a name such as “circuit1’, and choose a directory where you will save your circuit. Add a Resistor Left-click on the resistor at the top and drag the resistor down into the circuit schematic. Note that the reference direction for the current is top to bottom. Use control-R to rotate the resistor One “control-R” rotates the resistor clockwise by 90 degrees. Then the reference direction for the current is right to left. Use control-R to rotate the resistor Two “control-Rs ” rotates the resistor by 180 degrees. Then the reference direction for the current is bottom to top. Use control-R to rotate the resistor Three “control-Rs” rotates the resistor clockwise by 270 degrees. So the reference direction for the current is left to right, which is usually what we want! Add a voltage generator components Click the “components” symbol and type “vo” for “voltage” to get the voltage generator, then click OK Add a voltage generator Drag the voltage generator into place. Add a ground: Drag the symbol into place. Add wires to connect the generator, the resistor and the ground: We need component values and then we can solve the circuit. Add component values: Right-click on “V” and a popup lets you type the value of the voltage source. 1 means 1 volt 1m means 1 millivolt 1k means 1000 volts. You can drag the component value “text box” to a more convenient location: Right-click the hand tool, the right click the “1” text box and drag it to be near the voltage generator. We are ready to solve the circuit. Click on the “run” tool to get the simulation menu. We are expecting the current to be 1 kilohm / 1 volt = 1 milliamp, flowing from left to right. Choose “DC operating point” as the simulation we want: Then click OK to run the simulation. The program pops up a list of all the voltages and currents: We see that the current in R1, denoted as I(R1), is 0.001 amps or 1 mA as expected. Note that the current in the voltage source is I(V1)=-0.001 amps. Click the mouse on a wire to label the wire with its node voltage. The voltage at the top of the generator relative to ground is 1 volt. To label the current, click the mouse on a wire near the resistor: The Spice program produces a text box filled with question marks: ??? Click the mouse on the ???. Right-click on the question marks and a dialog box pops up letting you choose the value that you want to display: Type I(R1) into the dialog box, then OK. The program labels the current in the resistor as 1 mA. The reference direction for current flow is NOT shown so we have to know from setting up the circuit, that positive current is left-to-right for this resistor. The Netlist: • R1 is connected from node N001 to “0” or ground and has value 1k. • V1 is connected from N001 to ground and has value 1 volt. For more complicated circuits the Netlist is helpful in identifying which nodes are associated with each component. Click “View” then “SPICE Netlist” to get a list that shows how SPICE has built the circuit. To get a “wmf” file to paste into a lab report: Click “Tools > write to a wmf file”. Spice asks for a file name: You can paste the “wmf” file into a WORD doc or a PowerPoint presentation: R1 V1 1 1k • Easy and fast! • When you have constructed and solved 10 circuits, you will know every step without thinking. Spice and ELEC273 • You can solve the homework problems with Spice to check your answers – fun! • In the labs, you must use SPICE to simulation the circuits and compare the results with your measurements. • In class we will frequently use LTSpice to solve circuits to check the answers that we find by analysis. • In later courses you will use PSPICE to solve much more complex circuits.