Author Topic: Seeking help with LTspice simulation of Variable Power Supply  (Read 3767 times)

0 Members and 1 Guest are viewing this topic.

Offline ChanceMcCranceTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Seeking help with LTspice simulation of Variable Power Supply
« on: August 15, 2018, 11:22:24 pm »
Hello,

I am trying to create an LTspice (version XVII) simulation  of a variable power supply.  When I try to run the simulation, I get an error saying "Unknown subcircuit called in: xr1 n004 n003 5000."  Based on what I have read, the software cannot find the subcircuit for R1 (5k, variable resistor).  The component was taken directly from the LTspice library, so I was not sure why I encountered this error.  Any insight as to how I can correct the issue?  Is there something I should add to the simulation command? 

Any help would be super appreciated.  The file is attached if you would like to test it for yourself.

Best,

Chance


 

Offline hugo

  • Regular Contributor
  • *
  • Posts: 165
  • Country: ca
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #1 on: August 15, 2018, 11:58:13 pm »
Why don't you try this one instead?  ;)
 
The following users thanked this post: ChanceMcCrance

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #2 on: August 16, 2018, 12:03:59 am »
The description of 'xvaristor.asy' that you used for R1 says:
Quote
Generic varistor symbol for use with a model that you supply.
If you simply want to patch it to run with the default fixed resistor model, Ctrl-click R1 to open the component attribute editor and change the prefix line from X to R
 
 
The following users thanked this post: ChanceMcCrance

Offline mdszy

  • Supporter
  • ****
  • Posts: 291
  • Country: us
  • somehow has an ee degree
    • szy.io
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #3 on: August 16, 2018, 01:24:15 am »
Is there a specific reason you need a variable resistor model? You can always do a .step command to change the value of a normal resistor across multiple simulations and see what the effect of changing the value is.
somehow allowed to be a Pixie Wrangler in Training
eBay Store | My site | Hackaday.io Projects | my mastodon.technology profile
 
The following users thanked this post: ChanceMcCrance

Offline ChanceMcCranceTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #4 on: August 16, 2018, 01:36:05 am »
I wanted to create a simulation of a variable power supply that I had built which used a 5k variable resistor.  I suppose using the .step command would be ok for now.
 

Offline mdszy

  • Supporter
  • ****
  • Posts: 291
  • Country: us
  • somehow has an ee degree
    • szy.io
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #5 on: August 16, 2018, 01:38:50 am »
I wanted to create a simulation of a variable power supply that I had built which used a 5k variable resistor.  I suppose using the .step command would be ok for now.

Variable resistor, or potentiometer? If you're using a potentiometer, you can replace it with two resistors that change along with each other to always be a constant 5k, but the resistance at each side of the "wiper" changes.
somehow allowed to be a Pixie Wrangler in Training
eBay Store | My site | Hackaday.io Projects | my mastodon.technology profile
 
The following users thanked this post: ChanceMcCrance

Offline ChanceMcCranceTopic starter

  • Newbie
  • Posts: 9
  • Country: us
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #6 on: August 16, 2018, 01:43:48 am »
It's technically a potentiometer, but I am only using the first two terminals of it. (like a rheostat)
 

Offline mdszy

  • Supporter
  • ****
  • Posts: 291
  • Country: us
  • somehow has an ee degree
    • szy.io
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #7 on: August 16, 2018, 01:45:34 am »
It's technically a potentiometer, but I am only using the first two terminals of it. (like a rheostat)

Ah, right. Then the .step command with a single resistor is exactly what you want.
somehow allowed to be a Pixie Wrangler in Training
eBay Store | My site | Hackaday.io Projects | my mastodon.technology profile
 
The following users thanked this post: ChanceMcCrance

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #8 on: August 16, 2018, 03:10:04 pm »
An arrow can by drawn on the standard resistor symbol, to make it clear it's a variable resistor.

Other options are a time and voltage controlled resistor.

To make a variable resistor, which starts at 1Ohm and increases to just over 1k, over a second:

Set the value of the resistor to:
R=1+1k*time

Or: set the resistor value to:
R=V(V_res)

And create a voltage source with the net named V_res and set its value to:
PULSE(1 1k 0 1)

The time controlled resistor is the easiest, but least flexible and the voltage controlled resistor is a bit more difficult but more flexible, as it can be ramped up and down.

I've attached the .asc files.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Seeking help with LTspice simulation of Variable Power Supply
« Reply #9 on: August 16, 2018, 03:56:17 pm »
As Hero999 points out, a voltage controlled resistor or potentiometer is the most flexible, but a parameter controlled one is much simpler to simulate and is adequate if you only need to set or step its initial value, which is then fixed within each run.

If you need actual potentiometers, here are the models I use:

potentiometer.asy is parameter controlled - set the instance parameter Rtot to total track resistance and wiper to the wiper position (0 to 1).  Use a .param or .step param command on your sim for control.  e.g to sweep it 0% to 100% in 10% steps :
Code: [Select]
.step param pot1 0 1 0.1and on the actual potentiometer instance:
Code: [Select]
Rtot=10K wiper={pot1}
potentiometerVC is voltage controlled with the wiper position set by a control voltage in the range 0 to 1V, with respect to the circuit universal ground node 0.   Simply ground the control voltage source's negative terminal, drop a net label on its positive terminal, and the same net label on the potentiometerVC's control terminal (far end of dotted line opposite wiper).  Its total track resistance is set by the instance parameter Rtot.

Both limit the effective wiper position to the range 0.001 to 0.999 as the LTspice SPICE engine cant handle resistances actually going to zero.  When the wiper position is zero, its at the bottom end of the track if the symbol hasn't been rotated.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf