Download 9. Using PSPICE for 1st Order Circuits

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Schmitt trigger wikipedia , lookup

Power electronics wikipedia , lookup

Multimeter wikipedia , lookup

Operational amplifier wikipedia , lookup

Ohm's law wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Surge protector wikipedia , lookup

Valve RF amplifier wikipedia , lookup

TRIAC wikipedia , lookup

Charlieplexing wikipedia , lookup

Crossbar switch wikipedia , lookup

Current source wikipedia , lookup

Power MOSFET wikipedia , lookup

Bode plot wikipedia , lookup

Opto-isolator wikipedia , lookup

Switched-mode power supply wikipedia , lookup

RLC circuit wikipedia , lookup

Test probe wikipedia , lookup

Network analysis (electrical circuits) wikipedia , lookup

Two-port network wikipedia , lookup

Rectiverter wikipedia , lookup

Current mirror wikipedia , lookup

Transcript
EXPERIMENT 9
Problem Solving:
First-order Transient Circuits
I.
Introduction
In transient analyses, we determine voltages and currents as functions of time. Typically, the
time dependence is demonstrated by plotting the waveforms using time as the independent
variable. PSPICE can perform this kind of analysis, called a Transient simulation, in which all
voltages and currents are determined over a specified time duration. To facilitate plotting,
PSPICE uses what is known as the PROBE utility, which will be described later. As an
introduction to transient analysis, let us simulate the circuit in Figure 1, plot the voltage vC(t) and
the current i(t).
Figure 1.
The inductor and capacitor parts are called L and C, respectively, and are in the ANALOG
library. The switch, called SW_TCLOSE, is in the EVAL library. There is also a SW_TOPEN
part that models an opening switch. After placing and wiring the switch along with the other
parts, the Schematics circuit appears as that shown in Figure 2.
Figure 2. PSPICE schematic
To edit the switch’s attributes, double-click on the switch symbol and the ATTRIBUTES box in
Figure 3 will appear. Deselecting the Include Non-changeable Attributes and Include
ELEC 2110
Experiment 9
1 of 9
System-defined Attributes fields limits the attribute list to those we can edit and is highly
recommended. The attribute tClose is the time at which the switch begins to close, and ttran is
the time required to complete the closure. Switch attributes Rclosed and Ropen are the switch’s
resistance in the closed and open positions, respectively. During simulations, the resistance of
the switch changes linearly from Ropen at t = tClose to Rclosed at t = tClose+ttran. When
using the SW_TCLOSE and SW_TOPEN parts to simulate ideal switches, care should be taken
to ensure that the values for ttran, Rclosed, and Ropen are appropriate for valid simulation
results. In this example, we see that the switch and R1 are in series; thus, their resistances add.
Using the default values listed in Figure 3, we find that when the switch is closed, the switch
resistance, Rclosed, is 0.01 Ω, 100,000 times smaller than that of the resistor. The resulting
series-equivalent resistance is essentially that of the resistor. Alternatively, when the switch is
open, the switch resistance is 1 MΩ, 1,000 times larger than that of the resistor. Now, the
equivalent resistance is much larger than that of the resistor in Figure 1.
Figure 3. Switch ATTRIBUTE box
Each component within the various Parts libraries in PSPICE has two or more terminals. Within
PSPICE, these terminals are called pins and are numbered sequentially starting with pin 1, as
shown in Figure 4 for several two-terminal parts. The significance of the pin numbers is their
effect on currents plotted using the PROBE utility. PROBE always plots the current entering pin
1 and exiting pin 2. Thus, if the current through an element is to be plotted, the part should be
oriented in the Schematics diagram such that the defined current direction enters the part at pin 1.
This can be done by using the ROTATE command in the EDIT menu. ROTATE causes the part
to spin 90° counterclockwise. In our example, we will plot the current i(t) by plotting the current
through the capacitor, I(C1). Therefore, when the Schematics circuit in Figure 2 was created, the
capacitor was rotated 270°. As a result, pin 1 is at the top of the diagram and the assigned
current direction in Figure 1 matches the direction presumed by PROBE. If a component’s
current direction in PROBE is opposite the desired direction, simply go to the Schematics circuit,
rotate the part in question 180°, and re-simulate.
ELEC 2110
Experiment 9
2 of 9
Figure 4. Pin numbers for common PSPICE parts.
To set the initial condition of the capacitor voltage, double-click on the capacitor symbol in
Figure 2 to open its ATTRIBUTE box, as shown in Figure 5. Click on the IC field and set the
value to the desired voltage, 0 V in this example. Setting the initial condition on an inductor
current is done in a similar fashion. Be forewarned that the initial condition for a capacitor
voltage is positive at pin 1 versus pin 2. Similarly, the initial condition for an inductor’s current
will flow into pin 1 and out of pin 2.
Figure 5. Setting the capacitor initial condition.
The simulation duration is selected using SETUP from the ANALYSIS menu. When the
SETUP window shown in Figure 6 appears, double-click on the text TRANSIENT and the
TRANSIENT window in Figure 7 will appear. The simulation period described by Final time is
selected as 6 milliseconds. All simulations start at t=0. The No-Print Delay field sets the time
the simulation runs before data collection begins. Print Step is the interval used for printing
data to the output file and has no effect on the data used to create PROBE plots. The Detailed
Bias Pt. option is useful when simulating circuits containing transistors and diodes, and thus will
not be used here. When Skip initial transient solution is enabled, all capacitors and inductors
that do not have specific initial condition values in their ATTRIBUTES boxes will use zero
initial conditions.
ELEC 2110
Experiment 9
3 of 9
Sometimes, plots created in PROBE are not smooth. This is caused by an insufficient number of
data points. More data points can be requested by entering a Step Ceiling value. A reasonable
first guess would be a hundredth of the Final Time. If the resulting PROBE plots are still
unsatisfactory, reduce the Step Ceiling further. As soon as the TRANSIENT window is
complete, simulate the circuit by selecting Simulate from the Analysis menu.
Figure 6. The ANALYSIS SETUP window.
Figure 7. The TRANSIENT window.
When the PSPICE simulation is finished, the PROBE window shown in Figure 8 will open. If
not, select Run Probe from the Analysis menu. In Figure 8, we see three sub-windows: the
main display window, the output window, and the simulation status window. The waveforms we
choose to plot appear in the main display window. The output window shows messages from
ELEC 2110
Experiment 9
4 of 9
PSPICE about the success or failure of the simulation. Run-time information about the
simulation appears in the simulation status window. Here we will focus on the main display
window.
To plot the voltage, vC(t), select Add Trace from the Trace menu. The ADD TRACES window
is shown in Fig. 9. Note that the options Alias Names and Subcircuit Nodes have been
deselected, which greatly simplifies the ADD TRACES window. The capacitor voltage is
obtained by clicking on V(Vc) in the left column. The PROBE window should look like that
shown in Figure 10.
Before adding the current i(t) to the plot, we note that the dc source is 10 V and the resistance is
1 kΩ, which results in a loop current of a few milliamps. Since the capacitor voltage span is
much greater, we will plot the current on a second y axis. From the Plot menu, select Add Y
Axis. To add the current to the plot, select Add Trace from the Trace menu, then select I(C1).
Figure 11 shows the PROBE plot for vC(t) and i(t).
Figure 8. The PROBE window.
ELEC 2110
Experiment 9
5 of 9
Figure 9. The ADD Traces window.
Figure 10. PROBE plot of the capacitor voltage.
ELEC 2110
Experiment 9
6 of 9
Figure 11. PROBE plot of vC(t) and i(t).
Exercises
Your report must include ALL circuit diagrams, with all variables clearly labeled, and ALL
calculations must be clearly shown. In addition, you will need to capture plots for the various
exercises and include them in your lab report.
1) The switch in the circuit below has been opened for a long time and is closed at t = 0.
Calculate i0(t) for t > 0. Plot i0(t) versus time using Matlab and include the plot in your report.
Now simulate this circuit using PSPICE and plot i0(t) versus time. Include this plot in your
report as well.
ELEC 2110
Experiment 9
7 of 9
2) The switch in the circuit below has been closed for a long time and is opened at t = 0.
Calculate i0(t) for t > 0. Plot i0(t) versus time using Matlab and include the plot in your report.
Now simulate this circuit using PSPICE and plot i0(t) versus time. Include this plot in your
report as well.
3) The switch in the circuit below has been closed for a long time and is opened at t = 0.
Calculate v0(t) for t > 0. Plot v0(t) versus time using Matlab and include the plot in your report.
Now simulate this circuit using PSPICE and plot v0(t) versus time. Include this plot in your
report as well.
ELEC 2110
Experiment 9
8 of 9
4) The switch in the circuit below has been opened for a long time and is closed at t = 0.
Calculate vC(t) for t > 0. Plot vC(t) versus time using Matlab and include the plot in your report.
Now simulate this circuit using PSPICE and plot vC(t) versus time. Include this plot in your
report as well.
ELEC 2110
Experiment 9
9 of 9