1
\$\begingroup\$

Problem

How does one increase the resolution of a SPICE plot? My sinusoidal signal doesn't look continuous, it looks very 'pointy'. I am using MACSPICE3 to simulate a non-inverting op-amp by using a dependent source (VCVS). Changing the step parameter of the tran command has not helped.

I understand that results data is stored in a construct called a plot, which is comprised of vectors. Is this pointy phenomena linked to the data in these constructs, or the graphical representation?

Example of a pointy plot

Pointy SPICE plot

Netlist

Basic Non-Inverting OpAmp

V1 2 0 AC sin(0 10 50 0 0) DC 0

RBogus 2 0 10K

e 3 0 2 1 999K

R1 3 1 10K

R2 1 0 10K

.control

delete all

tran 1.0ns 100ms

plot v(1) v(2) v(3)

op

display

print all

show all

.endc

.end

Note:

RBogus exists to create a closed loop for the ac source.

\$\endgroup\$
  • \$\begingroup\$ If it's generic SPICE syntax, try .tran 0 100m 0 10u. 1u is the timestep. \$\endgroup\$ – a concerned citizen Jun 23 '17 at 4:56
  • \$\begingroup\$ @A Concerned Citizen, Thanks for your input. Macspice uses the syntax: .TRAN TSTEP TSTOP [ [ TSTART ] TMAX ] [ UIC ] So my analysis should step at increments of one nanosecond, for 100 milliseconds. I have just learned that TMAX and the TSTEP work in conjunction with each other. I will post an answer \$\endgroup\$ – DWD Jun 23 '17 at 7:47
  • \$\begingroup\$ @aconcernedcitizen, which version(s) of spice would you recommend? Macspice doesn't seem to have the support that LTSpice or PSpice have for instance. Would appreciate your thoughts. \$\endgroup\$ – DWD Jun 23 '17 at 8:02
  • \$\begingroup\$ Glad it worked out, but I wouldn't recommend one SPICE over another simply because that works for me. De gustibus... The best tool in the world is the one that suits you best. \$\endgroup\$ – a concerned citizen Jun 24 '17 at 6:10
2
\$\begingroup\$

The syntax is

.TRAN TSTEP TSTOP [ [ TSTART ] TMAX ] [ UIC ]

Changing

tran 1.0ns 100ms

To

tran 1us 100ms 0 1us

has solved the issue. In the user guide, note that the TSTEP doesn't exclusively control the step size. TMAX must also be set. The boldface text explains why.

  • TSTEP is the printing or plotting increment for line-printer output. For use with the post-processor, TSTEP is the suggested computing increment.
  • TSTOP is the final time
  • TSTART is the initial time. If TSTART is omitted, it is assumed to be zero. The transient analysis always begins at time zero. In the interval , the circuit is analyzed (to reach a steady state), but no outputs are stored. In the interval , the circuit is analyzed and outputs are stored.
  • TMAX is the maximum step-size that SPICE uses; for default, the program chooses either TSTEP or (TSTOP-TSTART)/50.0, whichever is larger. TMAX is useful when one wishes to guarantee a computing interval which is smaller than the printer increment, TSTEP. enter image description here http://www.macspice.com/ug/sec4.html#s4.3.9
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.