LT Spice resistor vs time

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Is there a way to run a transient response and have a resistor value
be a function of time?

I tried setting a resistor value to and it doesn't like
that.

I can set a bv to  V=TIME  and get a voltage ramp. I want a br
component.

I guess I could program Ohm's Law into a bi or something ugly like
that.



--  

John Larkin         Highland Technology, Inc

Science teaches us to doubt.

We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
On Friday, May 29, 2020 at 9:12:33 PM UTC-4, snipped-for-privacy@highlandsniptechnology.com wrote:
Quoted text here. Click to load it

You will have to do something funky like that because parameters are only evaluated before a simulation run.  Measure statements are evaluated after a simulation.  

I think a resistor would be a voltage dependent current source, g or g2.  If you can set that relation to a function of time, it might work.  

--  

  Rick C.

  - Get 1,000 miles of free Supercharging
We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time

Quoted text here. Click to load it




Yes... Just create a voltage controlled resister in a behavioural subckt,  
and ramp the control voltage.

This one creates a linear resistance with control voltage. vmin is arbitrary  
to avoid a divide by zero at a control voltage of zero. The passed in  
paramter sets the v=1V resistance

.SUBCKT VCR cp cn ra rb res=1k
*
.param vmin=1e-4
*
B1 ra rb i=v(ra,rb)/(v(cp,cn) + )/
.ends


-- Kevin Aylward
http://www.anasoft.co.uk - SuperSpice
http://www.kevinaylward.co.uk/ee/index.html


Re: LT Spice resistor vs time
On Sat, 30 May 2020 08:38:55 +0100, "Kevin Aylward"

Quoted text here. Click to load it


Way back in DOS days, I used a netlist-based non-Spice simulator
called ECA. It was of course slow and clumsy, but the documentation
was superb, and it executed any expression that you could type. A
resistor, cap, voltage, or inductor value could be a function of
anything else in the circuit. That was very cool. I suppose it
violated conservation of energy, and maybe causality, but nobody's
perfect.

And it always converged. It might occasionally toss a warning (divide
by zero!) but it kept going.





--  

John Larkin         Highland Technology, Inc

Science teaches us to doubt.

We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
Am 30.05.2020 um 03:12 schrieb snipped-for-privacy@highlandsniptechnology.com:
Quoted text here. Click to load it


Hello John,

A resistor varying over time can be specified by replacing the value of  
the resistor with a formuala as shown below.

R10%+time/1000

LTspice will internally replace this "resistor" with a B-source.

Best regards,
Helmut

Re: LT Spice resistor vs time
On Sat, 30 May 2020 14:15:18 +0200, Helmut Sennewald

Quoted text here. Click to load it

That works! Thanks. I never understand the LT Spice syntax.  

A resistor value    

10K      works

time     doesn't

   doesn't

R=time   does!



--  

John Larkin         Highland Technology, Inc

Science teaches us to doubt.

We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
On Sat, 30 May 2020 07:34:30 -0700, snipped-for-privacy@highlandsniptechnology.com
wrote:

Quoted text here. Click to load it


But

R20%0k*time    doesn't work

R=+200k*time   doesn't work

whereas

R=1+200k*time   does!

So, I still don't understand the syntax.



--  

John Larkin         Highland Technology, Inc

Science teaches us to doubt.

We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
Am 30.05.20 um 17:31 schrieb snipped-for-privacy@highlandsniptechnology.com:

Quoted text here. Click to load it

So this might be nothing about syntax, more about the value of R. The
simulator can not cope with R=0 and 200k * time is at the very beginning
zero ...



Re: LT Spice resistor vs time
On Sat, 30 May 2020 19:06:15 +0200, Ingolf Pohl

Quoted text here. Click to load it

Good point. The sim appears to run but nothing can be plotted. A
polite pop-up warning wouldn't hurt.

Oops, not quite. R=0 is a legit current limiter value for the OPA547,
so as a value for the current limit resistor...

0         works

R=0       works

R=time    doesn't

R=2*time  doesn't

R=1+time  works.

R=time+1  works

R=1u+2*time  works

so it really wants an add in the expression.


R=1-1+time  doesn't work. The add probably gets optimized out.

LT Spice is an x86 compiler, with a few bugs. I managed to form an
expression once that crashed it hard. I told Mike and he fixed it.






--  

John Larkin         Highland Technology, Inc

Science teaches us to doubt.

We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
On Saturday, May 30, 2020 at 1:06:20 PM UTC-4, Ingolf Pohl wrote:
Quoted text here. Click to load it
g

I have set resistors to 0 value.  Are you saying it won't respond to the sy
ntax "R=0" while "0" works ok?  If no one is typing the "R=" and it's j
ust "200K+TIME" the reason it's not working isn't because it evaluates to 0
.  I just changed the 2 ohm resistor in John's circuit to 0 ohms and it sti
ll works.  It runs very slowly, but it works.  

--  

  Rick C.

  + Get 1,000 miles of free Supercharging
We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
On 2020-05-30 11:31, snipped-for-privacy@highlandsniptechnology.com wrote:
Quoted text here. Click to load it
Resistances aren't allowed to be zero.

Cheers

Phil Hobbs

--  
Dr Philip C D Hobbs
Principal Consultant
We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
On Sat, 30 May 2020 15:40:33 -0400, Phil Hobbs

Quoted text here. Click to load it

But I do that all the time.

Take a grounded 1 volt source and drive a string of three 1 ohm
resistors to ground. You'll get 1/3 and 2/3 volts. Now sort of
randomly change some of the resistors to zero. The number of nodes
changes! But the divider works.

A two-resistor 1-ohm divider of course gives 0.5 volts, but if you
change the lower resistor to 0, the mid node gets named 'ground' and
can't be probed. But the current is 1 amp.

Maybe the explanation is that both nodes of a 0 ohm resistor get
called the same node. LT treats a 0 ohm resistor as a piece of wire.
You can't probe its current.

Numerical nodes must be assigned at compile time, when you hit 'run'.











--  

John Larkin         Highland Technology, Inc

Science teaches us to doubt.

We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
On Sat, 30 May 2020 15:40:33 -0400, Phil Hobbs

Quoted text here. Click to load it


In LTspice at least, there is a very small resistance even if you say
0 Ohms IIRC....    This may be adjustable in the settings ?





Quoted text here. Click to load it

Re: LT Spice resistor vs time

Quoted text here. Click to load it

LT screams "zero ohm resistor not allowed" and refuses to run.
Sometimes.



--  

John Larkin         Highland Technology, Inc

Science teaches us to doubt.

We've slightly trimmed the long signature. Click to see the full one.
Re: LT Spice resistor vs time
On Monday, June 1, 2020 at 3:59:12 AM UTC-4, boB wrote:
Quoted text here. Click to load it
e
e
 of
Quoted text here. Click to load it


You might be thinking of some devices that if you don't specify a resistanc
e will include a small amount.  I added a voltage source to a schematic, se
t the resistance to zero, put a small resistor in series with it and it see
ms the voltage source has literally no resistance.  I can measure the volta
ge on that net and it is the voltage source setting to how many decimal pla
ces that are used in LTspice?  I think it is using zero ohms internally bec
ause I set it to zero.  

--  

  Rick C.

  -- Get 1,000 miles of free Supercharging
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline