4
\$\begingroup\$

I want know if there is a certain formula that needs to be used to get the positive and negative slope of a square wave. Let Vn001 be the indication if its positive and negative? Or can I simply trust the measurement in LTspice :slope:?

enter image description here

Kindly use this image as a reference. From my knowledge you can calculate the slope with \$\frac{\Delta V}{\Delta T}\$.

Ideally, the \$\small\Delta V\$ is constant, or is this not the case and should I still get the difference between the two cursors?

So, from the values, the positive slope of this output is:

\$\frac{\Delta V}{\Delta T} = \frac{13.6\ \mathrm{V}}{2.12\ \mathrm{ms}} = 6415.09 \neq 53.75\$

\$\endgroup\$
5
  • \$\begingroup\$ Why don't you plot dv/dt? \$\endgroup\$
    – Andy aka
    Mar 21 at 8:56
  • \$\begingroup\$ @Andyaka how do you do that? \$\endgroup\$ Mar 21 at 9:02
  • \$\begingroup\$ I don't use LTspice but, I expect it has the facility. \$\endgroup\$
    – Andy aka
    Mar 21 at 9:03
  • \$\begingroup\$ im unfamiliar to it as well. This astable circuit was supposed to be done in a lab class however I'm unsure of the values I obtained from the oscilloscope so I'm hoping I could verify using LTspice as it the only program we are exposed to right now. \$\endgroup\$ Mar 21 at 9:07
  • \$\begingroup\$ You can check this thread. Here is a similar question: electronics.stackexchange.com/questions/410684/… \$\endgroup\$
    – liaifat85
    Mar 21 at 15:36

3 Answers 3

4
\$\begingroup\$

You used the voltage from the first cursor instead of from the difference. $$\frac{114.45~mV}{2.13~ms}=53.73~V/s $$

So taking rounding error into account the reported value is correct.

\$\endgroup\$
3
  • \$\begingroup\$ yes if you apply it like that however im not positive if thats the slope since when i probe it the value it too low. \$\endgroup\$ Mar 22 at 6:28
  • 1
    \$\begingroup\$ @jaxillrplusone Well it depends on where you put the cursors. You appear to have them on the flat part of the square wave, so it will give you the slope of that. If you want the slope of the rising edge of the square wave you have to position the cursors so cursor 1 is near the bottom of the edge and cursor 2 is near the top. \$\endgroup\$
    – GodJihyo
    Mar 22 at 14:15
  • \$\begingroup\$ OH now that's helpful! thanks! \$\endgroup\$ Mar 22 at 17:46
5
\$\begingroup\$

LTSPICE supports waveform arithmetic. Specifically, if you have a node X you can plot D(V(X)) to get the derivative of V(X) (which is its slope). In this case I created a waveform that rises/falls by 10V in 10us so the plot shows ±1MV/s during the rise times and zero while V(X) is flat.

enter image description here

enter image description here

To plot a formula, you can right click on the plot or press the "A" key to bring up a dialogue box where you can add a new trace. From there just type in the formula for what you want to plot.

enter image description here

\$\endgroup\$
3
\$\begingroup\$

The MEASURE facility in LTspice allows a TRANsient run to be post-processed for determining maximum slope. The result appears in SPICE ERROR LOG. You can add the MEASURE parameter with the .OP button:

.meas TRAN slope_V(out) MAX d(V(out))/d((time))

Note that a small time step is required for accuracy; a fast square wave rise time helps here as well (a one picosecond rise time improved slope accuracy slightly).

  • a time step of 1 microsecond yielded a slope of 996 V/s
  • a time step of 1 nanosecond yielded a slope of 999.767 V/s

LTspice TRAN example schematic, volt vs. time output.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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