Using P-Spice to Analyze the Charging of Capacitors

 

By

 

Jared L. Crum

Department of Electrical and

Computer Engineering

Youngstown State University

 

ECEGR 5879


 

ABSTRACT:  P-spice was used to graph the voltage verses time as RC and RLC circuits are charging and discharging.  The “Sw_tOpen” and “Sw_tClose” parts are used for this.  Also an oscillating circuit is analyzed using P-spice.

 

I.  Introduction

 

                              How does a capacitor charge?  The capacitor makes voltage change gradually.  During a charge or discharge of a capacitive circuit, the capacitor opposes a change in voltage, and this makes the current in the circuit much different from that of a typical open circuit.  During the transition time the current first jumps and then gradually goes to zero.  Finally after several time constants the circuit reaches a final state.  What is a time constant?  Starting with the most basic understanding of the charging of a capacitor the time constant (RC) must be introduced.  The time constant is the resistance multiplied by the capacitance.  Instead of finding the equivalent resistance and multiplying by the capacitance to find out how a capacitor charges or discharges, P-Spice can be used.  This is illustrated in this project.

 

II. Charging a Capacitor.

 

                              The circuit below is used to show how a capacitor charges and how P-Spice simulates this.

 

 

                              The switch marked U3 is a switch that closes at time T=0.  The P- Spice name for this part is “Sw_tClose”.  The switch marked U2 is a switch that opens at time T=0.  The P- Spice name for this part is “Sw_tOpen”.  At time T=0 the capacitor will start to charge. 

                              Using P- Spice a transient analysis of the voltage across the capacitor was run from Time T=0 to T=1s.  The default  value for the step ceiling was used the result is shown on the next page.

  

 

                              This graph shows how a capacitor charges.  It is clear to see that the capacitor charges from 0 to 6V in about 1s.  Also, notice the graph of the current through the capacitor below.

Notice that the current changes drastically at time T=0 and then the capacitor gradually starts to act like an open circuit.

 

 

III.  Discharging capacitors.

 

                              A similar simulation was run with the circuit below.  Notice that this circuit is similar to the last one.  However the capacitor will discharge instead of charge.

 

 

The transient analysis from time T=0 to time T=1s of this capacitor voltage for this circuit is shown below.

 

This graph shows how a capacitor discharges.  It is clear to see that the capacitor discharges from 6V to 0 in about 1s.  Also, notice the graph of the current through the capacitor on the next page.

Notice that the current changes drastically at time T=0 and then the capacitor gradually starts to act like an open circuit.

 

 

IV.  More Circuit Analysis.

 

                              Notice the circuit below.   How will the voltage of the capacitor act when the switches are thrown at time T=0.

A similar P-Spice simulation was done with this circuit the following graph resulted.

 

It is clear that the voltage of the capacitor goes from 200V to –300V in about 3s.

 

V.  An oscillator.

 

                              The following circuit was designed to be an oscillator.

                             

From this Schematic it is clear that before time T=0 the voltage at the node marked with the “V” is 5 volts.  However, when the switch opens the energy will oscillate between the inductor and the capacitor causing the voltage to act differently.  Notice that the 0.6W resistor was added to make the circuit more realistic since wire generally has some resistance.  Notice how P-spice simulates this.  This transient analysis is shown on the next page.

 

 

Next notice the current at the indicated point in the circuit below.

Next notice the current at the indicated point in the circuit below.

 

However, this is not a very practical oscillator.  The following oscillator is a more realistic oscillator.  The oscillator pictured below works easier on the lab bench then on P- Spice.  In order to make it oscillate an initial voltage has to be set at the emitter of Q1.  In the lab, this would be like having Cs be charged up with some voltage.  As shown by the voltage supply under the switch, there are –0.7V initially on the emitter.  My design for this oscillator is shown below.  Notice that the circuit is loaded with two 15kW loads separated by a coupling capacitor.    

 

 

 

The voltage output for this Simulation is shown below.  It makes a nice sinusoidal wave.

 

            At first, when I designed this the waveform continued to grow until it clipped off.  So I changed the inductor value and loaded it to get it to work right.  I learned much from this.

 

V1 Conclusion

 

                              In conclusion I found that P- Spice is extremely helpful with transient analysis in finding out how capacitors act.