Electronic – Print voltage from ground node in LTSpice

ltspicespice

I can't reverse the node voltage in LTSpice. Take this simple circuit as an example. Ground is node 0 and the other node is labeled as 1. I would expect .PRINT DC V(0,1) (from node 0 to node 1) gives -1V whereas .PRINT DC V(1,0) (from node 1 to node 0) gives +1V, but the simulation always prints a positive +1V.

How can I print the voltage from the ground node (i.e. voltage from ground node to node 1 = -1V )?

enter image description here

Best Answer

In a typical multi data point analysis (e.g. .ac or .tran), the waveform viewer pops up and you can do all sorts of waveform arithmetic using the various node voltages and branch currents which were calculated during the simulation. You can actually do the same thing with a single data point analysis, but it's not as intuitive.

First, your method of doing a single DC data point is a little goofy. You're doing a DC sweep with one data point, and as mentioned in the comments the .print commands don't do anything. A typical single DC data point simulation is done using the .op command:

enter image description here


Now, there are a couple ways to get to the arithmetic/expression commands after the simulation runs. First is to right-click in a blank area on the sheet and select the Draft --> .op Data Label button.

enter image description here


After doing so, you'll get a triple question mark thingy you can put somewhere on the schematic. If you put it on a node, it will display that node voltage's to ground. Instead of doing that we will put it off to the side in the middle of nowhere.

enter image description here


If we right-click that ??? label we can now edit the expression to say anything we want. If we replace the $ that's there with -V(1) and hit OK that label will now display the negative of V(1).

enter image description here


The alternative way to generate .op labels is to click on any non-ground node to automatically generate a label, and simply edit it...or even better to move it off to the side before editing it so it's not ambiguous. Either way of generating the label is equivalent. These methods are also used to display branch currents and power dissipation on the schematic during an .op simulation, as shown below:

enter image description here