Source code coming soon. The GitHub repository is private for now and opens to everyone very soon.
BetterSPICE Beta 0.8.0 Join the beta Download soon
Part I  LearnTutorialContentsIndex
03

Tutorial 2: Measure it exactly

The live simulation shows what a circuit does. To measure it, run it with Simulate. You'll take the filter from Tutorial 1, run a transient, measure the delay with cursors, find the −3 dB point and sweep the resistor. About fifteen minutes.

You needThe circuit from Tutorial 1: Draw an RC filter and watch it run, open and running. Or open the example RC low-pass, 1.6 kHz (E): it has the same R and C.
You will learnSimulate (F5), the Analysis view, cursors, the AC sweep, the parameter step and saving.

03.1Run a transient

  1. In the toolbar, click Simulate for, type 5m and press Enter.You should seeThe field reads 5 ms: the run covers the first 5 ms of the circuit's life.
  2. Click max step, type 1u and press Enter.You should see1 µs: the solver never takes a longer step, so a 1 ms period gets at least 1000 points.
  3. Press F5.You should seeThe view splits. The schematic stays on top and the Analysis view below shows V IN and V OUT from 0 to 5 ms. V OUT starts at 0 V and settles within about 0.5 ms (five time constants of 100 µs).If you seea banner that starts Simulation failed:, read the reason in it, press Dismiss, and go to Troubleshooting by symptom.
Split view after F5: the schematic on top, the transient below.
Figure 3.1Split view after F5: the schematic on top, the transient below.

03.2Measure the delay with cursors

  1. Click Cursors in the plot toolbar.You should seeTwo vertical lines, A (solid) and B (dashed), and a readout on the right.
  2. Drag cursor A onto a peak of V IN, for example the one at 4.25 ms.
  3. Drag cursor B onto the next peak of V OUT.You should seeThe readout gives Δ of about 89 µs, and V OUT at B of about 0.85 V.
Cursors A and B on a peak of V IN and the next peak of V OUT.
Figure 3.2Cursors A and B on a peak of V IN and the next peak of V OUT.

03.3Find the corner frequency

  1. Press F7.You should seeSimulation setup opens on the AC sweep tab, because this circuit has no AC setup yet. Input source is already V1, from 1 Hz to 1 MHz. The header says "F7 runs it from now on · F6 opens this setup".
  2. Click Run AC sweep.You should seeA Bode plot: gain flat at 0 dB, then falling 20 dB per decade, and phase going from 0° to −90°. The strip above it reads −3 dB at 1.59 kHz. The window stays split. The setup is saved in the circuit, so the next F7 runs the sweep at once.
The AC sweep. The strip above the plot reads −3 dB at 1.59 kHz.
Figure 3.3The AC sweep. The strip above the plot reads −3 dB at 1.59 kHz.

03.4Sweep the resistor

  1. Press Shift+F7.You should seeThe Parameter step tab opens, as the circuit has no step setup yet. Parameter is already R1.r, the resistance of R1.
  2. In Values, type 500, 1k, 2k, 4k.
  3. In Analysis to repeat, choose AC sweep.
  4. Click Run parameter step.You should seeFour Bode curves named V OUT · R1.r = 500 and so on. Their corners are at about 3.18 kHz, 1.59 kHz, 796 Hz and 398 Hz: double R, half the frequency.
The parameter step: one Bode curve per value of R1.
Figure 3.4The parameter step: one Bode curve per value of R1.

03.5Save

  1. Press Ctrl+S.You should seeA Save dialog opens. The browser version asks for the name in the window, then downloads the file.
  2. Type rc-lowpass and press Enter.You should seeThe tab is named rc-lowpass.bsc and its unsaved dot is gone. The file keeps the parts, wires, probes and every analysis setting you used.
If your screen does not match
Save
If you seeDo this
A plot with no traces and No probesProbe IN and OUT first (Tutorial 1), or hold Alt and click a net in the schematic above the plot. A plain click only selects.
The cursors are missingClick Cursors in the toolbar of the plot, not in the dock.
A −3 dB point far from 1.59 kHzCheck R1 (1 kΩ) and C1 (100 nF) in the inspector, then press Ctrl+F5 to run the sweep again.
Only one curve after the parameter stepSeparate the values with commas: 500, 1k, 2k, 4k.

03.6What you did

You measured the filter three ways: a transient in time, an AC sweep in frequency, and a parameter step across four resistor values. How BetterSPICE thinks explains why BetterSPICE has both the live simulation and Simulate, and Simulate and measure has a page for each kind of measurement.