LTSpice Simulation – How to Simulate Pulses in RC Circuits
ltspicesimulation
I'm trying to simulate the circuit below, with values R = 2.2 kΩ and C = 47 μF.
My simulation is like this, but the results are not correct.
What am I doing wrong?
Best Answer
You need to setup the pulse parameters properly.
The first parameter is initial voltage, this is usually 0 for a positive going pulse.
The second is the ON voltage, in your case it would be 20.
The third is delay time, this is 0 unless you want to delay the start of the pulses.
The forth and fifth are rise and fall times, make these some small value such as 1n for sharp pulse edges, or if you know the rise and fall times you want set them to that.
The sixth is ON time, for a square wave this will be half of your pulse period, 0.1666 for 3 Hz.
Seventh is the period, 0.333 for 3 Hz.
And the last one is the number of cycles, leave it blank for free running, or set it to some number if you want to limit the number of pulses.
When done yours should look something like this:
PULSE(0 20 0 1n 1n 0.1666 0.333)
If you want the pulse train to start high and go low you switch the first two parameters.
If you want something other than 50% duty cycle you need to adjust the ON time and period. For example if you use an ON time of 0.0833 with 0.333 period you get 3 Hz pulses with a 25% duty cycle.
The default initial conditions for time domain simulations is almost always the "steady-state" condition assuming all sources were at their \$t=0\$ state since \$t=-\infty\$.
There are a few different fixes for this:
Switch to a time dependent source (like what Jim did with a square wave source)
Disable the "initial condition" solve step, which usually initializes all nodal voltages/branch currents to 0 (when applicable).
Manually specify the initial conditions. Unfortunately, CircuitLab doesn't appear to allow you to do this (other than disabling the "skip initial" step). However, for SPICE-like simulators you can add an .ic command to manually specify the value to use. For example, here I've set the initial conditions V(out)=4V in LTSPICE.
You can use that in LTSpice. If you want to just be simple about it, click on the schematic to make sure it is active and type the letter S and you will get a spice dialog. Paste the above model into that and then put it onto the schematic. Go into the opamps sections (using F2 and selecting the opamp folder) and scroll to the end of the list to see "opamp2" as a selection. Grab that and put it on the schematic. Carefully hover over the word "opamp2" on the symbol and right-click that name. A dialog showing "opamp2" in a box will pop up. Change it to TL074 and hit ENTER.
Use that symbol.
Your circuit will simulate similarly, I believe.
I don't use ORCAD and do not have access to it, so I can't help on that score. It's likely that there are some simulation controls you need to adjust to help it out in finding a solution. It could be that it is selecting a poor choice for the simulation step time, for example. But there are a number of other options in spice that could affect the outcome, too.
Best Answer
You need to setup the pulse parameters properly.
The first parameter is initial voltage, this is usually 0 for a positive going pulse.
The second is the ON voltage, in your case it would be 20.
The third is delay time, this is 0 unless you want to delay the start of the pulses.
The forth and fifth are rise and fall times, make these some small value such as 1n for sharp pulse edges, or if you know the rise and fall times you want set them to that.
The sixth is ON time, for a square wave this will be half of your pulse period, 0.1666 for 3 Hz.
Seventh is the period, 0.333 for 3 Hz.
And the last one is the number of cycles, leave it blank for free running, or set it to some number if you want to limit the number of pulses.
When done yours should look something like this:
If you want the pulse train to start high and go low you switch the first two parameters.
If you want something other than 50% duty cycle you need to adjust the ON time and period. For example if you use an ON time of 0.0833 with 0.333 period you get 3 Hz pulses with a 25% duty cycle.