1
\$\begingroup\$

I want to implement a voltage-controlled current source in LTSpice. The output current should be

$$I=a_{0}+a_{1}V+a_{2}V^{2}$$

I know I have to use the POLY element, but I can't figure out how to use it.

I am using LTSpice in macOS. Any help please?

Thanks in advanced!

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

The POLY source is old as SPICE itself (40+ years). The better choice is to use a behavioural source (voltage or current), not only because it makes things easier in terms of implementing a mathematical expression, but also because LTspice will replace it, behind the scene, with a behavioural source, anyway. This is how the expression would look like:

V = a0 + a1*V(x) + a2*V(x)**2

where I presumed to be V(x) instead of V. It's not necessary to use voltages, currents and other time-dependent quantities are allowed, with some conditions. Read more in the help, under LTspice > Circuit Elements > B. Arbitrary Behavioral Voltage or Current Sources.

Note the exponentiation, **, not ^ (which means XOR, unless it's a Laplace expression). If you're using a current source, then it would be I = ....

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I have implemented the function with the Arbitrary Behavioral Current Source. Thanks! \$\endgroup\$
    – dpalo
    Commented Oct 24, 2020 at 17:38
  • 2
    \$\begingroup\$ @dpalo If you accept the answer, then it'll help other people in the future who have the same problem. Thanks! \$\endgroup\$
    – Ste Kulov
    Commented Oct 24, 2020 at 17:49
0
\$\begingroup\$

If you intend to use the archaic POLY statement in a voltage controlled source, like Analog Devices does in OpAmp models, there is a 2 pin controlled source needed. You can find epoly (VCVC) and gpoly (VCCS) in the [Misc] symbol folder. In this case the POLY statement in the gpoly source is:

POLY(1) (V(x),0) a0 a1 a2

The current controlled sources F and H can use the POLY statement directly, because the input control sources are described in the value line.

(My thanks to "a concerned citizen" to get the complete overview of the answer)

\$\endgroup\$
3
  • \$\begingroup\$ I have deleted the previous posts, so the answer can be found quickly without scanning the posts. \$\endgroup\$ Commented Jul 2, 2022 at 10:33
  • 1
    \$\begingroup\$ Right, now try what I said in my last comment: use one of epoly or gpoly with the POLY syntax, then add .opt list to your schematic, and verify the error log. You'll see that they are silently converted to behavioural sources, which is exactly what I'm saying in my answer: "LTspice will replace it, behind the scene, with a behavioural source, anyway". \$\endgroup\$ Commented Jul 2, 2022 at 14:25
  • \$\begingroup\$ Nice!, in this way there is a POLY to formula converter via the error log. \$\endgroup\$ Commented Jul 3, 2022 at 10:52

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.