Free Spice Or Cheap Spice Simulator-Where To Start? - diyAudio
Go Back   Home > Forums > General Interest > Everything Else

Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools......

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 11th February 2007, 11:24 AM   #1
Wizard of Kelts
diyAudio Moderator
 
Join Date: Sep 2001
Location: Connecticut, The Nutmeg State
Default Free Spice Or Cheap Spice Simulator-Where To Start?

I have in mind a couple of very simple circuits with transformers I would like to mess around with in simulation before trying. I would prefer if the spice simulator contained a loudspeaker to sim, but this is not entirely necessary. The ability to simulate a transformer would be, however.

The demo version of LSPCAD for Adire drivers allows you to simulate passive crossover networks, but lacks the ability to use transformers. Hence my turning to circuit simulators.

Any suggestions where to look? I never used a spice simulator before.
__________________
"A friend will help you move. A really good friend will help you move a body."
-Anonymous
  Reply With Quote
Old 11th February 2007, 11:27 AM   #2
diyAudio Member
 
jan.didden's Avatar
 
Join Date: May 2002
Location: Great City of Turnhout, Belgium
Blog Entries: 7
Have you searched???

Jan Didden
__________________
If you don't change your beliefs, your life will be like this forever. Is that good news? - W S Maugham
Check out Linear Audio!
  Reply With Quote
Old 11th February 2007, 12:10 PM   #3
diyAudio Member
 
Pjotr's Avatar
 
Join Date: Nov 2002
Location: Netherlands
Hmm Jan,

Me think there is something more to say about PSpice in the context of LS simulation. PSpice by itself is nothing more then a numeric solver for differential equations.

The syntax of it is kind of a programming language. You have to understand this syntax to be able to really know what you are doing and to model the things you want to simulate, like loudspeakers..

Nowadays the are a lot of Pspice simulators which have an integrated schematic capture front end that automatically generates the Pspice listing in the background for you and are easy to use.

Kelticwizard, to get your feet wet, here you can download a free student/evaluation version of Microcap: http://www.spectrum-soft.com/demoform.shtm It is limited to 50 components but that is more than sufficient to simulate what you intend. Besides this software get a good introductory textbook about PSpice.

I myself used this software some 10 years ago to simulate a PR loudspeaker box, when no ready made LSsim-software for that was available. BUT to be able to build a model you have to fully understand the mathematics behind it. I have posted some years ago an electro-mechanical model for LS simulation on this board. For that use the search function

PSpice is not easy to get started with but at least it is great fun. Good luck!

Cheers
  Reply With Quote
Old 11th February 2007, 01:17 PM   #4
Wizard of Kelts
diyAudio Moderator
 
Join Date: Sep 2001
Location: Connecticut, The Nutmeg State
Quote:
Originally posted by janneman
Have you searched???

Jan Didden
I have searched both Google and this board. In fact, over the years I have paid attention to various threads where people were starting out in Spice, since I had in the back of my mind the idea that I would like to try it someday.

However, there seemed to be so many demos and programs to get started, I thought I would throw it out to the board what I was primarily interested in finding and see which would be the best choice to go.

Just like there are many free/cheap speaker simulation programs, the desirability of which depends on what the user is primarily interested in finding.
__________________
"A friend will help you move. A really good friend will help you move a body."
-Anonymous
  Reply With Quote
Old 11th February 2007, 01:19 PM   #5
Wizard of Kelts
diyAudio Moderator
 
Join Date: Sep 2001
Location: Connecticut, The Nutmeg State
Pjotr:

Thanks. I will take a look at site and see what develops. (Stay tuned, I might need help, lol).
__________________
"A friend will help you move. A really good friend will help you move a body."
-Anonymous
  Reply With Quote
Old 11th February 2007, 08:28 PM   #6
diyAudio Member
 
I_Forgot's Avatar
 
Join Date: Jan 2005
Location: Phoenix, Az.
You can simulate transformers in any spice program, including SwitcherCAD, free from Linear Technology. SWCAD has no limitations and there are a bunch of example circuits that show how to do things like implement transformers.

You use two inductors and add a spice directive that contains the coupling coefficient between the two. Of course, the inductors are ideal, so you will need to figure out a good model for your transformer and add the necessary parasitic elements either as properties of the inductors or connected to them. THAT is ALWAYS the hardest part when using spice.

A lot of people have tried modeling transformers before you so do a web search and see what is out there. You might get lucky and find a decent model that you can tailor to your specific part by making a few simple measurements.

I_F
Attached Images
File Type: png transformer.png (20.9 KB, 249 views)
  Reply With Quote
Old 11th February 2007, 09:06 PM   #7
diyAudio Member
 
I_Forgot's Avatar
 
Join Date: Jan 2005
Location: Phoenix, Az.
The image in the previous post shows how a transformer is created in SWCAD (and any other spice, as far as I know). The blue trace is the input voltage. The K1 statement contains the coupling coefficient between the two inductors. What you can't see on the schematic is the parasitic series R and parallel C and R for each of the inductors.

A tapped transformer coil would simply have a coupling coefficient statement like K1 L1 L2 L3 .99999

The 1 G resistor to ground on L2 is necessary because each loop in a circuit has to have a DC connection to ground in order for spice's solver to work. Using 1 Gohm ensures that the connection has no effect on the circuit behavior.

You can model core nonlinearities also. The help file that comes in SWCAD has this to say:

There are two forms of non-linear inductors available in LTspice. One is a behavioral inductance specified with an expression for the flux. The inductor's current is referred to by the keyword "x" in the expression. Below is an example in a netlist.


*
L1 N001 0 Flux=1m*tanh(5*x)
I1 0 N001 PWL(0 0 1 1)
.tran 1
.end

In the above example, I1 supplies a unity dI/dT so that the inductance can be read off as the voltage on node N001.

There other non-linear inductor available in LTspice is a hysteretic core model based on a model first proposed in by John Chan et la. in IEEE Transactions On Computer-Aided Design, Vol. 10. No. 4, April 1991. This model defines the hysteresis loop with only three parameters:


name | parameter | units
-----+-------------------------+------------
Hc | Coercive force | Amp-turns/meter
Br | Remnant Flux Density | Tesla
Bs | Saturation Flux Density | Tesla

The upper and lower branches of the hysteresis major loop are given by


H + Hc
Bup(H) = Bs --------------------- + 0H
|H+Hc| + Hc(Bs/Br-1)

and


H - Hc
Bdn(H) = Bs --------------------- + 0H
|H-Hc| + Hc(Bs/Br-1)

These functions are plotted in following figure. Hc and Br are the intersections of the major hysteresis loop with the H- and B-axes. Bs is the B-axis intersection of the asymptotic line, Bsat(H) = Bs + 0H, approached as H goes to infinity.



The initial magnetization curve is given by

Bmag(H) = .5 (Bup(H) + Bdn(H))

Minor loops are obtained by various translations of the above equations per the cited reference. The core's absolute and differential permeabilities are a function of H and the history of values of H. The plot below shows the path taken by an asymmetrical minor loop for a typical power ferrite(Hc=16 A-turns/m, Bs=.44T, Br= .10T).

In addition to the core property parameters Hc, Br, and Bs, mechanical dimensions of the core are required:


name | parameter | units
-----+----------------------------+-----------
Lm | Magnetic Length(excl. gap) | meter
Lg | Length of gap | meter
A | cross sectional area | meter**2
N | number of turns | --

Note that if specifying a non-zero gap the magnetic field, H, is not proportional to the current in the windings. LTspice solves for the magnetic fields in the core and gap under the assumption of uniform cross sectional area and thin or uniformly distributed gap.

Below is an example that shows inductance vs. current for L1, an inductor wound on a gapped core. You can read out the inductance as V(n001) since current source I1 supplies a unity dI/dt. The core follows the initial magnetization curve, so you can see that the permeability first increases from the initial value as the current is ramped and then drops as it saturates. Since the gap makes the inductance insensitive to the exact permeability of the core, you have to really zoom in on V(n001) to see that it does increase. The peak is when H inside the core is equal to its Hc.

*
L1 N001 0 Hc=16. Bs=.44 Br=.10 A=0.0000251
+ Lm=0.0198 Lg=0.0006858 N=1000
I1 0 N001 PWL(0 0 1 1)
.tran .5
.options maxstep=10u
.end


You'll find that using spice is the easy part. Modeling components accurately is the hard part.

I_F
  Reply With Quote
Old 12th February 2007, 06:21 PM   #8
diyAudio Member
 
Pjotr's Avatar
 
Join Date: Nov 2002
Location: Netherlands
Hi

LTspice, or better Swichcad what it is actually named, is also an option. But Microcap has a much better user interface and is easier to get on the run IMO.

But whatever you choose, a good textbook about PSpice is mandatory to stay on the road.

Cheers
  Reply With Quote
Old 12th February 2007, 11:58 PM   #9
diyAudio Member
 
I_Forgot's Avatar
 
Join Date: Jan 2005
Location: Phoenix, Az.
Quote:
Originally posted by Pjotr
Hi

LTspice, or better Swichcad what it is actually named, is also an option. But Microcap has a much better user interface and is easier to get on the run IMO.

But whatever you choose, a good textbook about PSpice is mandatory to stay on the road.

Cheers
Last time I looked, Microcap cost money... SWCAD is FREE! A good feature for audio maniacs is the ability to use .wav files for input and output.

Tuinenga's book is good, but somewhat dated by the lack of schematic capture. It does a good job of pointing out some pitfalls and shows how to do some things that can be tricky if you don't know a lot about spice.

I_F
  Reply With Quote
Old 14th February 2007, 03:21 PM   #10
Wizard of Kelts
diyAudio Moderator
 
Join Date: Sep 2001
Location: Connecticut, The Nutmeg State
I appreciate your help so far, but I am having some trouble getting started.

So far, I have found out from others that a netlist is sort of a word description of a circuit that a computer can understand. I'm not sure if I need a netlist, or how to make one.

This is supposed to be schematic capture software, but I did not see any provision to capture the schematic just posted. Nor did I see any provision just to import the AC source for use in a different circuit, at least not easily.

You open up this program, see a blank screen, click new schematic, then what? The help files are less than helpful, especially when they illustrate taking something from a "boost" file which does not exist on the program.

This program looks like something that can help a great deal if I can just figure out how to get my feet wet. I don't mind experimenting around once I can start making things happen on the xreen, which I don't seem to be able to do right now.

The entire purpose of this project is to develop a simple tuned circuit to attach to an output transformer to make it behave in certain ways. Given the fact that series LC circuits develop nulls, (short circuits ) at resonance, I thought a little work on the computer would be helpful before i started. If I cannot simulate a loudspeaker on the schematic, even just using an 8 ohm resistor and then fine-tuning by experimentation would suit my purposes on this project.

If it is not asking too much, I crudely drew up a simple circuit in MSPaint and wonder how you can go about putting this into SwitcherCAD and measuring the voltage and amperage from the open side of the transformer. Would that be at all possible?
Attached Images
File Type: gif transformer circuit b.gif (3.1 KB, 181 views)
__________________
"A friend will help you move. A really good friend will help you move a body."
-Anonymous
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spice simulator engines rtarbell The Lounge 1 26th July 2007 11:17 AM
please recommend free spice software kifeinthesink Parts 2 26th October 2006 03:06 AM
Spice/simulator lumanauw Everything Else 5 24th January 2004 08:53 AM
Free Spice demo pinkmouse Parts 0 10th February 2003 06:34 PM
Free SPICE simulator.. tschrama Everything Else 25 1st July 2002 10:14 PM


New To Site? Need Help?

All times are GMT. The time now is 03:01 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2