LTspice  polarise resistor shock - Page 1
Forum section: electronics / general

author: robint
author_rank: Regular Contributor
timestamp: February 20, 2023, 10:30:02 am
content: I am now revisiting the LTS tool for a little potboiler of mine and see that the latest ver (from LTS IV) is now jumped to LTS 7. I am having to relearn here so its a bit of a slog. FWIW its an indispensable tool and forces design thinking rather than the dirty suck-it-and-see approach by rank amateurs.I hope Im in the right place for my discussion here - pls mods re-direct as necessary as there's no obvious forum category here.enough introThere are many little quirks and inherent bugs? to learn workarounds which LTS users are fully aware.One that completely floored me was that resistor models have an inherent POLARITY. Fell off my stool back then. In a word it makes a difference which way round you insert the resistor to your circuit - just like a battery. GO FIGURESadly there is no obvious tag to show polarity on the schematic or any dropdown info (like +/-). This can so easily catch you out especially if its not obvious which polarity you have with applied voltage - like a wheatstone bridge type cct)I have a simple solution, but its so obvious that the 10^6 users over 20 years must have thought of it. It involve putting a simple dot on the symbol to show positive end. I can post the trivial .asc file here to help anyone else but I fear that there must be a fatal flaw to such a simple method.Would any experiences users here please deflate my hypothesis - its bothering me.

author: Zero999
author_rank: Super Contributor
timestamp: February 20, 2023, 12:57:01 pm
content: SPICE is just a glorified calculator. All currents and voltages are differential, thus have a sign, so every component has a positive and negative terminal. Normally it doesn't make any difference, but seeing a negative current when one would normally expect it to be positive is a bit confusing. I agree, it would be nice, if there was a way to make it show the positive and negative on non-polarised components.

author: Ian.M
author_rank: Super Contributor
timestamp: February 20, 2023, 01:03:03 pm
content: Pin order for two pin components in a SPICE netlist is significant. <shock><horror>Film at 11!<horror></shock>Its no different to choosing the 'wrong' direction for one of the current loops in a mesh analysis - it all comes out 'in the wash' with the only difference being the sign of the numerical result for that loop current, or in the case of SPICE, for that component current. It only becomes important when that component current is used in other calculations not directly related to the nodes it is connected between. (e.g. behavioural sources), where the convention for formally laid out schematics is to insert a 0V voltage source as a current probe point which has indicated polarity.However, after you've run a LTspice analysis, when selecting nodes or currents to plot the cursor shows a red arrow indicating the direction of positive current when hovering over a two pin component, so redefining resistor symbols to add polarity symbols is unnecessary, and will cause problems if you want to share your schematics.For further entertainment, look at the currents through the four identical capacitors in series in the attached sim!

author: iMo
author_rank: Super Contributor
timestamp: February 20, 2023, 02:52:12 pm
content: The icon shows always the same direction (thus indicating the node 1 and 2), current direction regardless..

author: exe
author_rank: Unknown
timestamp: February 20, 2023, 02:56:13 pm
content: Quote from: robint on February 20, 2023, 10:30:02 amHa-ha-ha, you don't know how I (ab)use LTSpice)

author: Ian.M
author_rank: Super Contributor
timestamp: February 20, 2023, 07:03:58 pm
content: Quote from: imo on February 20, 2023, 02:52:12 pmYes. To elaborate on both your answer and my comment that it indicates the direction of positive current: For two pin components, the 'plot current' mouse cursor arrow always points from the first pin (node) to the second pin in the corresponding SPICE netlist line, and that direction of current flow is defined as positive.

author: TimFox
author_rank: Super Contributor
timestamp: February 20, 2023, 07:15:03 pm
content: Personally, I use SPICE itself (with the original line-oriented syntax).The SPICE models for two-pin devices always specify the two nodes in order of polarity.It can be tricky to keep track of current-flow direction, but the software is self-consistent.

author: Benta
author_rank: Super Contributor
timestamp: February 20, 2023, 08:45:53 pm
content: I'm totally unable to reproduce this issue (mind you, I'm using ngspice).Running a simulation, and then running the simulation again after rotating a resistor 180 degrees give 100% the same result.Never seen this before, never heard of this before, cannot confirm.

author: iMo
author_rank: Super Contributor
timestamp: February 20, 2023, 09:00:05 pm
content: A depiction

author: Ian.M
author_rank: Super Contributor
timestamp: February 20, 2023, 09:00:47 pm
content: Quote from: Benta on February 20, 2023, 08:45:53 pm... except that the simulated current through the resistor (e.g. I(R1) ) will have the opposite sign (but same magnitude).As I commented earlier, this makes a difference if you use I(R1) in the expression controlling a behavioural source.