0
\$\begingroup\$

Firstly, I'm a beginner at LT Spice. I wanted to learn how could you input a range of values for current. For example, let's say, I want my waveform to oscillate from 10uA to 10mA in the circuit below (instead of -10mA to +10mA since I've given 10mA as amplitude)-

enter image description here

enter image description here

So, I wanted to know how to change the amplitude for it according to the range I want. Any help would be appreciated, thanks in advance.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ clarify what you mean by 'oscillate from 10 uA to 10 mA'. Do you mean a sinewave whose +ve peak is +10 mA, and whose -ve peak is + 10 uA, so offset from zero mean? Or do you mean a zero mean sinewave with peaks of +/- 10 mA , whose amplitude can be changed to +/- 10 uA or other values during the simulation? \$\endgroup\$
    – Neil_UK
    Commented Apr 27, 2022 at 8:05
  • 1
    \$\begingroup\$ Are you asking for the .param and .step SPICE directives? \$\endgroup\$
    – winny
    Commented Apr 27, 2022 at 8:10

3 Answers 3

3
\$\begingroup\$

I want my waveform to oscillate from 10uA to 10mA

That's a peak-to-peak value of 9.99 mA or, a peak value of 4.995 mA.

So, use two current sources in parallel; one set to produce a peak current of 4.995 mA and the other set to deliver the offset current 5.005 mA DC.

Current sources in parallel add and you'll get what you require. Example of a 1 kHz sinewave: -

enter image description here

enter image description here

The composite current from the two sources flows into a 1 kΩ resistor and produces a peak of 10 volts and a valley of 10 mV.

\$\endgroup\$
2
\$\begingroup\$

I would use a behavioral current source (bi in the components library)

The amplitude could be driven by a voltage source in PWL mode :

PWL example configuration

and then, the arbitrary current source (or here voltage source) can be configured (you can use the inside variable "time" which is the current time of the simulation)

arbitrary voltage source configuration

And finally you obtain:

variable sinus voltage

If you want to modify it over several simulations, I would recommand to look at ".step param myVariable list listOfValue" in the help

\$\endgroup\$
1
\$\begingroup\$

If you're referring only to your current source then what you ened is a sine with offset. So calculate it based on your maximum and minimum values, (10m + 10u)/2 = 5005u = 5.005m. Then calculate the amplitude of the sine as (10m - 10u)/2 = 4995u = 4.995m, and introduce them in your SINE() expression:

SINE(5.005m 4.995m 25)

The parameters are described in the editor, too:

SINE(Ioffset Iamp Freq Td Theta Phi Ncycles)

Not all parameters need to be specified (e.g. you can omit Td and all the others, as you have it now).

Also, you have no ground on the primary side. That's a bad habit, even if LTspice tries to avoid you, shooting yourself in the foot, by adding a hidden Gmin to ground.

\$\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.