http://ltwiki.org/api.php?action=feedcontributions&user=Jose+luu&feedformat=atomLTwiki-Wiki for LTspice - User contributions [en]2024-03-29T02:21:57ZUser contributionsMediaWiki 1.31.7http://ltwiki.org/index.php?title=The_Chan_model&diff=1558The Chan model2015-02-05T09:52:41Z<p>Jose luu: /* example */</p>
<hr />
<div>'''The Chan model''' is a hysteretic core model based on a model first proposed in by John Chan et al. in the [http://ieeexplore.ieee.org/iel1/2519/00075630.pdf ''IEEE Transactions On Computer-Aided Design'', Vol. 10. No. 4, April 1991] but extended with the methods in United States Patent [http://www.google.com/patents/US7502723 7,502,723].&nbsp; Compared to older core models, the Chan model is particularly robust, computationally efficient and compact, requiring only three parameters to define most any commonly encountered magnetic hysteresis loop.<br />
<br />
Once the core material's generic magnetic properties are set, establishing the circuit-level non-linear inductance requires specifying three more parameters to set the geometry of the specific core and one additional parameter to set the core winding turn-count.&nbsp; The Chan model as implemented in LTspice does not directly support Mutual Inductance, so unless only a single-winding inductor is being modeled, multiple windings must be added on via additional circuitry.<br />
<br />
This page is incomplete.&nbsp; Perhaps a link to the original paper should be given along with some discussion of how the model works and why and how it is more robust and computationally efficient than other core models.&nbsp; Equations supported with illustrative graphs would be helpful.<br />
<br />
==example==<br />
<br />
Ferrite bead inductor using fair rite 73 material ref [http://www.fair-rite.com/cgibin/catalog.pgm?THEONEPART=2673000101 2673000101]<br />
<br />
Instead of entering 1.5uH as inductor value, use Hc=19.1 Bs=.39 Br=.15 A=3.575u Lm=6.9m N=1 Lg=0<br />
<br />
Parameters are derived from the fair-rite documentation page as follows:<br />
* HC is the coercive force in A/M and should be the A/M equivalent of 0.24 Oersted (multiply by 1000 and divide by 4*PI)<br />
* BS is the saturation in Tesla and should be the Tesla equivalent of the 3900 Gauss value (divide by 10000) giving .39T<br />
* Br is the remanence (remnant) and should be the Tesla equivalent of the 1500 Gauss value<br />
* A is the bead magnetic cross section in square meters, use dimensions C*(A-B)/2, area is in mm2 hence the u<br />
* Lm is the length of the magnetic flux lines in meters, use PI*(A+B)/2<br />
* N is the number of turns, use value between 1 and 0.5 in the case of a ferrite bead<br />
* Lg=0 since we have no gaps</div>Jose luuhttp://ltwiki.org/index.php?title=The_Chan_model&diff=1557The Chan model2015-02-05T09:51:53Z<p>Jose luu: /* example */</p>
<hr />
<div>'''The Chan model''' is a hysteretic core model based on a model first proposed in by John Chan et al. in the [http://ieeexplore.ieee.org/iel1/2519/00075630.pdf ''IEEE Transactions On Computer-Aided Design'', Vol. 10. No. 4, April 1991] but extended with the methods in United States Patent [http://www.google.com/patents/US7502723 7,502,723].&nbsp; Compared to older core models, the Chan model is particularly robust, computationally efficient and compact, requiring only three parameters to define most any commonly encountered magnetic hysteresis loop.<br />
<br />
Once the core material's generic magnetic properties are set, establishing the circuit-level non-linear inductance requires specifying three more parameters to set the geometry of the specific core and one additional parameter to set the core winding turn-count.&nbsp; The Chan model as implemented in LTspice does not directly support Mutual Inductance, so unless only a single-winding inductor is being modeled, multiple windings must be added on via additional circuitry.<br />
<br />
This page is incomplete.&nbsp; Perhaps a link to the original paper should be given along with some discussion of how the model works and why and how it is more robust and computationally efficient than other core models.&nbsp; Equations supported with illustrative graphs would be helpful.<br />
<br />
==example==<br />
<br />
Ferrite bead inductor using fair rite 73 material ref [http://www.fair-rite.com/cgibin/catalog.pgm?THEONEPART=2673000101 2673000101]<br />
<br />
Instead of entering 1.5uH as inductor value, use Hc=19.1 Bs=.39 Br=.15 A=3.575u Lm=6.9m N=1 Lg=0<br />
<br />
Parameters are derived from the fair-rite documentation page as follows:<br />
* HC is the coercive force in A/M and should be the A/M equivalent of 0.24 Oersted (multiply by 1000 and divide by 4*PI)<br />
* BS is the saturation in Tesla and should be the Tesla equivalent of the 3900 Gauss value (divide by 10000) giving .39T<br />
* Br is the remanence (remnant) and should be the Tesla equivalent of the 1500 Gauss value<br />
* A is the bead magnetic cross section, use dimensions C*(A-B)/2, area is in mm2 hence the u<br />
* Lm is the length of the magnetic flux lines in meters, use PI*(A+B)/2<br />
* N is the number of turns, use value between 1 and 0.5 in the case of a ferrite bead<br />
* Lg=0 since we have no gaps</div>Jose luuhttp://ltwiki.org/index.php?title=The_Chan_model&diff=1556The Chan model2015-02-05T09:42:02Z<p>Jose luu: /* example */</p>
<hr />
<div>'''The Chan model''' is a hysteretic core model based on a model first proposed in by John Chan et al. in the [http://ieeexplore.ieee.org/iel1/2519/00075630.pdf ''IEEE Transactions On Computer-Aided Design'', Vol. 10. No. 4, April 1991] but extended with the methods in United States Patent [http://www.google.com/patents/US7502723 7,502,723].&nbsp; Compared to older core models, the Chan model is particularly robust, computationally efficient and compact, requiring only three parameters to define most any commonly encountered magnetic hysteresis loop.<br />
<br />
Once the core material's generic magnetic properties are set, establishing the circuit-level non-linear inductance requires specifying three more parameters to set the geometry of the specific core and one additional parameter to set the core winding turn-count.&nbsp; The Chan model as implemented in LTspice does not directly support Mutual Inductance, so unless only a single-winding inductor is being modeled, multiple windings must be added on via additional circuitry.<br />
<br />
This page is incomplete.&nbsp; Perhaps a link to the original paper should be given along with some discussion of how the model works and why and how it is more robust and computationally efficient than other core models.&nbsp; Equations supported with illustrative graphs would be helpful.<br />
<br />
==example==<br />
<br />
Ferrite bead inductor using fair rite 73 material ref [http://www.fair-rite.com/cgibin/catalog.pgm?THEONEPART=2673000101 2673000101]<br />
<br />
Instead of entering 1.5uH as inductor value, use Hc=19.1 Bs=.39 Br=.15 A=3.575u Lm=6.9m N=1 Lg=0<br />
<br />
Parameters are derived from the fair-rite documentation page as follows:<br />
* HC is the coercive force in A/M and should be the A/M equivalent of 0.24 Oersted (multiply by 1000 and divide by 4*PI)<br />
* BS is the saturation in Tesla and should be the Tesla equivalent of the 3900 Gauss value (divide by 10000) giving .39T<br />
* Br is the remanence (remnant) and should be the Tesla equivalent of the 1500 Gauss value<br />
* A is the bead magnetic cross section, use dimensions C*(A-B)/2, area is in mm2 hence the u<br />
* Lm is the length of the magnetic flux lines, use PI*(A+B)/2<br />
* N is the number of turns, use value between 1 and 0.5 in the case of a ferrite bead<br />
* Lg=0 since we have no gaps</div>Jose luuhttp://ltwiki.org/index.php?title=The_Chan_model&diff=1555The Chan model2015-02-05T09:40:34Z<p>Jose luu: /* example */</p>
<hr />
<div>'''The Chan model''' is a hysteretic core model based on a model first proposed in by John Chan et al. in the [http://ieeexplore.ieee.org/iel1/2519/00075630.pdf ''IEEE Transactions On Computer-Aided Design'', Vol. 10. No. 4, April 1991] but extended with the methods in United States Patent [http://www.google.com/patents/US7502723 7,502,723].&nbsp; Compared to older core models, the Chan model is particularly robust, computationally efficient and compact, requiring only three parameters to define most any commonly encountered magnetic hysteresis loop.<br />
<br />
Once the core material's generic magnetic properties are set, establishing the circuit-level non-linear inductance requires specifying three more parameters to set the geometry of the specific core and one additional parameter to set the core winding turn-count.&nbsp; The Chan model as implemented in LTspice does not directly support Mutual Inductance, so unless only a single-winding inductor is being modeled, multiple windings must be added on via additional circuitry.<br />
<br />
This page is incomplete.&nbsp; Perhaps a link to the original paper should be given along with some discussion of how the model works and why and how it is more robust and computationally efficient than other core models.&nbsp; Equations supported with illustrative graphs would be helpful.<br />
<br />
==example==<br />
<br />
Ferrite bead inductor using fair rite 73 material ref [http://www.fair-rite.com/cgibin/catalog.pgm?THEONEPART=2673000101 2673000101]<br />
<br />
Instead of entering 1.5uH as inductor value, use Hc=19.1 Bs=.39 Br=.15 A=3.575u Lm=6.9m N=1 Lg=0<br />
<br />
Parameters are derived from the fair-rite documentation page<br />
* HC is the coercive force in A/M and should be the A/M equivalent of 0.24 Oersted (multiply by 1000 and divide by 4*PI)<br />
* BS is the saturation in Tesla and should be the Tesla equivalent of the 3900 Gauss value (divide by 10000) giving .39T<br />
* Br is the remanence (remnant) and should be the Tesla equivalent of the 1500 Gauss value<br />
* A is the bead magnetic cross section, use dimensions C*(A-B)/2, area is in mm2 hence the u<br />
* Lm is the length of the magnetic flux lines, use PI*(A+B)/2<br />
* N is the number of turns, use value between 1 and 0.5 in the case of a ferrite bead<br />
* Lg=0 since we have no gaps</div>Jose luuhttp://ltwiki.org/index.php?title=D_Diode&diff=1535D Diode2015-01-22T20:52:24Z<p>Jose luu: /* Commentary, Explanations and Examples */</p>
<hr />
<div>{{#widget:Iframe<br />
|url=http://ltwiki.org/LTspiceHelp/LTspiceHelp/D_Diode.htm<br />
|width=800<br />
|height=600<br />
|border=0<br />
}}<br />
----<br />
Return to [[LTspice Annotated and Expanded Help*]]<br />
<br />
== Commentary, Explanations and Examples ==<br />
[http://www.ltwiki.org/index.php5?title=LTspice_Tools_and_Applications#Computation_of_SPICE_diode_parameters_from_3_electrical_measurements Use this tool to help determine the IS, N, RS parameters]<br />
<br />
{{#widget:DISQUS<br />
|id=ltwiki<br />
|uniqid={{PAGENAME}}<br />
|url={{fullurl:{{PAGENAME}}}}<br />
}}</div>Jose luuhttp://ltwiki.org/index.php?title=LTspice_Tools_and_Applications&diff=1534LTspice Tools and Applications2015-01-22T20:40:25Z<p>Jose luu: /* Computation of SPICE diode parameters from 3 electrical measurements */</p>
<hr />
<div>== How to convert SPICE Netlist to an LTspice schematic ==<br />
<br />
[http://ltwiki.org/files/SchBuilder.zip Schematic Builder] to automate the first steps below. <br><br />
<br />
Before you start, make working copy of the netlist and then clean<br />
it up by doing any reordering of lines or shortening of node/net<br />
names that will make them easier to work with. For example, nets<br />
with names like "n023" and "n001" can usually be safely shortened<br />
to "n23" and "n1" (sometimes I do this in a word processor with<br />
find and replace). Also, it is a good idea to move all comments<br />
to the end of the working netlist (if not delete them altogether).<br />
<br />
At this point, I like to import the netlist into LTspice, either<br />
directly onto the schematic (if the netlist is short) or into a<br />
separate LTspice netlist window.<br />
<br />
Now go through the netlist line by line and place a component of<br />
the corresponding type on the schematic (arrange these in rows by<br />
component type such that you build up rows of all the same type).<br />
It is important to do this in exactly the same order as the net-<br />
list because this will greatly ease cross checking when you think<br />
you have finished. (Also, all of the SPICE text, such as model<br />
statements, etc. should be copied and pasted in at the end.)<br />
<br />
As you place each component, edit its reference designator to<br />
agree with the corresponding netlist reference designator.<br />
<br />
As you place each component, place a net-label/node-name directly<br />
on each pin of the component (of course, these should agree with<br />
their names in the netlist, too). Don't bother with wires yet as<br />
these will just be trouble to move around later.<br />
<br />
Once all the components are placed, view the SPICE Netlist (it's<br />
a drop-down menu item) and verify that it agrees *exactly* with<br />
the original netlist (it will, if you followed these instructions<br />
carefully). Correct any errors as needed until agreement is<br />
perfect. This "schematic" should actually be able to run at<br />
this point.<br />
<br />
(This above section is what is automated by the SchBuilder.)<br />
<br />
So far you have just been playing the part of a robot, but now<br />
comes the fun part where human judgement is required. Move the<br />
components around on the schematic to group them such that the<br />
pins that have the same net names are close to each other and<br />
that signal flow makes sense. Use the Highlight Net tool (right<br />
mouse button click on a pin or net) to make sure no connection<br />
is overlooked.<br />
<br />
Only when the parts are reasonably well placed is it time to<br />
start drawing in the wires and adjust the look of the schematic.<br />
<br />
Be sure to check occasionally that the two netlists continue to<br />
match.<br />
<br />
Because both netlists and schematics are just ascii text files,<br />
the first part of this process should be fairly straightforward<br />
to automate in software. Grouping components and connecting them<br />
for least total wire length might be harder, but still possible<br />
(I would try an approach using the so-called "synthetic annealing"<br />
algorithm). However, finishing the schematic to human sensibilities<br />
would seem beyond the reach of any canned program, but having a<br />
utility that did the first two steps would be a big time saver and<br />
well worthwhile. (from analogspiceman, used by permission)<br />
<br />
== Comparing LTspice and Oscilloscope Waveforms ==<br />
<br />
Sometimes you want to see how closely your SPICE simulation matches the real circuit as seen by your scope. Here is a utility which imports an LTspice waveform and the data from your scope, overlays them, and allows you to slide one back and forth to line them up. It’s called CompareWaveforms, and here’s what it looks like:<br />
<br />
[[File:CompareWaveformsScreen.png]]<br />
<br />
You select the files to compare, press Compare, and use the long slider along the bottom to line up the waveforms. You can save the plot as a .png file to include in a report.<br />
<br />
The formats of the input files are straightforward. The LTspice file is the direct output of File / Export from the LTspice waveform window. The scope file is a .csv (Comma-Separated Values text file) with two header lines at the beginning (because that’s what my scope puts out). Each subsequent line is of the form time-in-seconds, volts. These are easily changed in the Python source if you wish. The scope data file may have a time offset due to trigger delay or trace positioning, so that is subtracted from the scope time measurements to match the LTspice time which starts at zero.<br />
<br />
Note on waveform comparison: you may want to include the loading of your scope probe in your simulation. My probes are 12 pF in parallel with 2.2 Mohm, which can alter the simulator waveforms. Also, make your total simulation time equal to the sweep time of your scope (typically the time/div times 10), and make the start of the waveform roughly the same. CompareWaveforms allows you to adjust time +/-10% of the total sweep.<br />
<br />
[http://ltwiki.org/files/CompareWaveforms-1.0-win32.msi Compare Waveforms Complete Install for Windows] <br><br />
<br />
[http://ltwiki.org/files/CompareWaveforms_v1.01.zip Compare Waveforms Python 3.4 Source Code] <br><br />
<br />
[http://www.exality.com/blog/ More info and tools at Exality]<br />
<br />
== Computation of SPICE diode parameters from 3 electrical measurements ==<br />
<br />
This calculator tool is a Mathematica CDF (Computable Document Format), the CDF player is a 200MB download from the Wolfram site.<br />
<br />
It takes 3 measurements either taken on the real device or from the datasheet to determine IS, N, Rs. This application uses the Mathematica Symbolic and numerical solvers to invert the diode current vs voltage formula.<br />
<br />
Enter the 3 measurements in the input fields and click the checkbox "Compute now!" to get the diode definition line and the current vs voltage graph as shown in the picture below.<br />
<br />
[[File:Diode_Spice_Modeling.JPG]]<br />
<br />
Actual application is below, must download and install the CDF player from Wolfram the be usable.<br />
<cdf width="900" height="1024">Diode_Parameters_Spice.cdf</cdf><br />
<br />
= Discussion =<br />
<br />
{{#widget:DISQUS<br />
|id=ltwiki<br />
|uniqid={{PAGENAME}}<br />
|url=http://ltwiki.org/index.php5?title=LTspice_Tools_and_Applications<br />
}}</div>Jose luuhttp://ltwiki.org/index.php?title=File:Diode_Spice_Modeling.JPG&diff=1533File:Diode Spice Modeling.JPG2015-01-22T20:36:03Z<p>Jose luu: Picture of the Mathematica CDF application</p>
<hr />
<div>Picture of the Mathematica CDF application</div>Jose luuhttp://ltwiki.org/index.php?title=File:Diode_Parameters_Spice.cdf&diff=1532File:Diode Parameters Spice.cdf2015-01-22T20:26:44Z<p>Jose luu: Jose luu uploaded a new version of &quot;File:Diode Parameters Spice.cdf&quot;: CDF document (Wolfram mathematica) which allows compuation of spice diode parameters from 3 electrical measurements</p>
<hr />
<div>CDF document (Wolfram mathematica) which allows compuation of<br />
spice diode parameters from 3 electrical measurements</div>Jose luuhttp://ltwiki.org/index.php?title=File:Diode_Parameters_Spice.cdf&diff=1531File:Diode Parameters Spice.cdf2015-01-22T20:17:57Z<p>Jose luu: Jose luu uploaded a new version of &quot;File:Diode Parameters Spice.cdf&quot;: Mathematica embeded application, allows computation of the spice diode parameters from 3 electrical measurements</p>
<hr />
<div>CDF document (Wolfram mathematica) which allows compuation of<br />
spice diode parameters from 3 electrical measurements</div>Jose luuhttp://ltwiki.org/index.php?title=LTspice_Tools_and_Applications&diff=1530LTspice Tools and Applications2015-01-22T20:15:54Z<p>Jose luu: /* Computation of SPICE diode parameters from 3 electrical measurements */</p>
<hr />
<div>== How to convert SPICE Netlist to an LTspice schematic ==<br />
<br />
[http://ltwiki.org/files/SchBuilder.zip Schematic Builder] to automate the first steps below. <br><br />
<br />
Before you start, make working copy of the netlist and then clean<br />
it up by doing any reordering of lines or shortening of node/net<br />
names that will make them easier to work with. For example, nets<br />
with names like "n023" and "n001" can usually be safely shortened<br />
to "n23" and "n1" (sometimes I do this in a word processor with<br />
find and replace). Also, it is a good idea to move all comments<br />
to the end of the working netlist (if not delete them altogether).<br />
<br />
At this point, I like to import the netlist into LTspice, either<br />
directly onto the schematic (if the netlist is short) or into a<br />
separate LTspice netlist window.<br />
<br />
Now go through the netlist line by line and place a component of<br />
the corresponding type on the schematic (arrange these in rows by<br />
component type such that you build up rows of all the same type).<br />
It is important to do this in exactly the same order as the net-<br />
list because this will greatly ease cross checking when you think<br />
you have finished. (Also, all of the SPICE text, such as model<br />
statements, etc. should be copied and pasted in at the end.)<br />
<br />
As you place each component, edit its reference designator to<br />
agree with the corresponding netlist reference designator.<br />
<br />
As you place each component, place a net-label/node-name directly<br />
on each pin of the component (of course, these should agree with<br />
their names in the netlist, too). Don't bother with wires yet as<br />
these will just be trouble to move around later.<br />
<br />
Once all the components are placed, view the SPICE Netlist (it's<br />
a drop-down menu item) and verify that it agrees *exactly* with<br />
the original netlist (it will, if you followed these instructions<br />
carefully). Correct any errors as needed until agreement is<br />
perfect. This "schematic" should actually be able to run at<br />
this point.<br />
<br />
(This above section is what is automated by the SchBuilder.)<br />
<br />
So far you have just been playing the part of a robot, but now<br />
comes the fun part where human judgement is required. Move the<br />
components around on the schematic to group them such that the<br />
pins that have the same net names are close to each other and<br />
that signal flow makes sense. Use the Highlight Net tool (right<br />
mouse button click on a pin or net) to make sure no connection<br />
is overlooked.<br />
<br />
Only when the parts are reasonably well placed is it time to<br />
start drawing in the wires and adjust the look of the schematic.<br />
<br />
Be sure to check occasionally that the two netlists continue to<br />
match.<br />
<br />
Because both netlists and schematics are just ascii text files,<br />
the first part of this process should be fairly straightforward<br />
to automate in software. Grouping components and connecting them<br />
for least total wire length might be harder, but still possible<br />
(I would try an approach using the so-called "synthetic annealing"<br />
algorithm). However, finishing the schematic to human sensibilities<br />
would seem beyond the reach of any canned program, but having a<br />
utility that did the first two steps would be a big time saver and<br />
well worthwhile. (from analogspiceman, used by permission)<br />
<br />
== Comparing LTspice and Oscilloscope Waveforms ==<br />
<br />
Sometimes you want to see how closely your SPICE simulation matches the real circuit as seen by your scope. Here is a utility which imports an LTspice waveform and the data from your scope, overlays them, and allows you to slide one back and forth to line them up. It’s called CompareWaveforms, and here’s what it looks like:<br />
<br />
[[File:CompareWaveformsScreen.png]]<br />
<br />
You select the files to compare, press Compare, and use the long slider along the bottom to line up the waveforms. You can save the plot as a .png file to include in a report.<br />
<br />
The formats of the input files are straightforward. The LTspice file is the direct output of File / Export from the LTspice waveform window. The scope file is a .csv (Comma-Separated Values text file) with two header lines at the beginning (because that’s what my scope puts out). Each subsequent line is of the form time-in-seconds, volts. These are easily changed in the Python source if you wish. The scope data file may have a time offset due to trigger delay or trace positioning, so that is subtracted from the scope time measurements to match the LTspice time which starts at zero.<br />
<br />
Note on waveform comparison: you may want to include the loading of your scope probe in your simulation. My probes are 12 pF in parallel with 2.2 Mohm, which can alter the simulator waveforms. Also, make your total simulation time equal to the sweep time of your scope (typically the time/div times 10), and make the start of the waveform roughly the same. CompareWaveforms allows you to adjust time +/-10% of the total sweep.<br />
<br />
[http://ltwiki.org/files/CompareWaveforms-1.0-win32.msi Compare Waveforms Complete Install for Windows] <br><br />
<br />
[http://ltwiki.org/files/CompareWaveforms_v1.01.zip Compare Waveforms Python 3.4 Source Code] <br><br />
<br />
[http://www.exality.com/blog/ More info and tools at Exality]<br />
<br />
== Computation of SPICE diode parameters from 3 electrical measurements ==<br />
<br />
This calculator tool is a Mathematica CDF (Computable Document Format), the CDF player is a 200MB download from the Wolfram site.<br />
<br />
<cdf width="900" height="1024">Diode_Parameters_Spice.cdf</cdf><br />
<br />
= Discussion =<br />
<br />
{{#widget:DISQUS<br />
|id=ltwiki<br />
|uniqid={{PAGENAME}}<br />
|url=http://ltwiki.org/index.php5?title=LTspice_Tools_and_Applications<br />
}}</div>Jose luuhttp://ltwiki.org/index.php?title=LTspice_Tools_and_Applications&diff=1529LTspice Tools and Applications2015-01-22T20:15:13Z<p>Jose luu: /* Computation of SPICE diode parameters from 3 electrical measurements */</p>
<hr />
<div>== How to convert SPICE Netlist to an LTspice schematic ==<br />
<br />
[http://ltwiki.org/files/SchBuilder.zip Schematic Builder] to automate the first steps below. <br><br />
<br />
Before you start, make working copy of the netlist and then clean<br />
it up by doing any reordering of lines or shortening of node/net<br />
names that will make them easier to work with. For example, nets<br />
with names like "n023" and "n001" can usually be safely shortened<br />
to "n23" and "n1" (sometimes I do this in a word processor with<br />
find and replace). Also, it is a good idea to move all comments<br />
to the end of the working netlist (if not delete them altogether).<br />
<br />
At this point, I like to import the netlist into LTspice, either<br />
directly onto the schematic (if the netlist is short) or into a<br />
separate LTspice netlist window.<br />
<br />
Now go through the netlist line by line and place a component of<br />
the corresponding type on the schematic (arrange these in rows by<br />
component type such that you build up rows of all the same type).<br />
It is important to do this in exactly the same order as the net-<br />
list because this will greatly ease cross checking when you think<br />
you have finished. (Also, all of the SPICE text, such as model<br />
statements, etc. should be copied and pasted in at the end.)<br />
<br />
As you place each component, edit its reference designator to<br />
agree with the corresponding netlist reference designator.<br />
<br />
As you place each component, place a net-label/node-name directly<br />
on each pin of the component (of course, these should agree with<br />
their names in the netlist, too). Don't bother with wires yet as<br />
these will just be trouble to move around later.<br />
<br />
Once all the components are placed, view the SPICE Netlist (it's<br />
a drop-down menu item) and verify that it agrees *exactly* with<br />
the original netlist (it will, if you followed these instructions<br />
carefully). Correct any errors as needed until agreement is<br />
perfect. This "schematic" should actually be able to run at<br />
this point.<br />
<br />
(This above section is what is automated by the SchBuilder.)<br />
<br />
So far you have just been playing the part of a robot, but now<br />
comes the fun part where human judgement is required. Move the<br />
components around on the schematic to group them such that the<br />
pins that have the same net names are close to each other and<br />
that signal flow makes sense. Use the Highlight Net tool (right<br />
mouse button click on a pin or net) to make sure no connection<br />
is overlooked.<br />
<br />
Only when the parts are reasonably well placed is it time to<br />
start drawing in the wires and adjust the look of the schematic.<br />
<br />
Be sure to check occasionally that the two netlists continue to<br />
match.<br />
<br />
Because both netlists and schematics are just ascii text files,<br />
the first part of this process should be fairly straightforward<br />
to automate in software. Grouping components and connecting them<br />
for least total wire length might be harder, but still possible<br />
(I would try an approach using the so-called "synthetic annealing"<br />
algorithm). However, finishing the schematic to human sensibilities<br />
would seem beyond the reach of any canned program, but having a<br />
utility that did the first two steps would be a big time saver and<br />
well worthwhile. (from analogspiceman, used by permission)<br />
<br />
== Comparing LTspice and Oscilloscope Waveforms ==<br />
<br />
Sometimes you want to see how closely your SPICE simulation matches the real circuit as seen by your scope. Here is a utility which imports an LTspice waveform and the data from your scope, overlays them, and allows you to slide one back and forth to line them up. It’s called CompareWaveforms, and here’s what it looks like:<br />
<br />
[[File:CompareWaveformsScreen.png]]<br />
<br />
You select the files to compare, press Compare, and use the long slider along the bottom to line up the waveforms. You can save the plot as a .png file to include in a report.<br />
<br />
The formats of the input files are straightforward. The LTspice file is the direct output of File / Export from the LTspice waveform window. The scope file is a .csv (Comma-Separated Values text file) with two header lines at the beginning (because that’s what my scope puts out). Each subsequent line is of the form time-in-seconds, volts. These are easily changed in the Python source if you wish. The scope data file may have a time offset due to trigger delay or trace positioning, so that is subtracted from the scope time measurements to match the LTspice time which starts at zero.<br />
<br />
Note on waveform comparison: you may want to include the loading of your scope probe in your simulation. My probes are 12 pF in parallel with 2.2 Mohm, which can alter the simulator waveforms. Also, make your total simulation time equal to the sweep time of your scope (typically the time/div times 10), and make the start of the waveform roughly the same. CompareWaveforms allows you to adjust time +/-10% of the total sweep.<br />
<br />
[http://ltwiki.org/files/CompareWaveforms-1.0-win32.msi Compare Waveforms Complete Install for Windows] <br><br />
<br />
[http://ltwiki.org/files/CompareWaveforms_v1.01.zip Compare Waveforms Python 3.4 Source Code] <br><br />
<br />
[http://www.exality.com/blog/ More info and tools at Exality]<br />
<br />
== Computation of SPICE diode parameters from 3 electrical measurements ==<br />
<br />
This calculator tool is a Mathematica CDF (Computable Document Format), the CDF player is a 200MB download from the Wolfram site.<br />
<br />
<cdf width="800" height="1024">Diode_Parameters_Spice.cdf</cdf><br />
<br />
= Discussion =<br />
<br />
{{#widget:DISQUS<br />
|id=ltwiki<br />
|uniqid={{PAGENAME}}<br />
|url=http://ltwiki.org/index.php5?title=LTspice_Tools_and_Applications<br />
}}</div>Jose luuhttp://ltwiki.org/index.php?title=File:Diode_Parameters_Spice.cdf&diff=1528File:Diode Parameters Spice.cdf2015-01-22T20:12:50Z<p>Jose luu: Jose luu uploaded a new version of &quot;File:Diode Parameters Spice.cdf&quot;: Mathematica Computable ducment format file, allows computation of the spice diode parameters from 3 electrical measurements</p>
<hr />
<div>CDF document (Wolfram mathematica) which allows compuation of<br />
spice diode parameters from 3 electrical measurements</div>Jose luuhttp://ltwiki.org/index.php?title=LTspice_Tools_and_Applications&diff=1527LTspice Tools and Applications2015-01-22T15:24:14Z<p>Jose luu: /* Computation of SPICE diode parameters from 3 electrical measurements */</p>
<hr />
<div>== How to convert SPICE Netlist to an LTspice schematic ==<br />
<br />
[http://ltwiki.org/files/SchBuilder.zip Schematic Builder] to automate the first steps below. <br><br />
<br />
Before you start, make working copy of the netlist and then clean<br />
it up by doing any reordering of lines or shortening of node/net<br />
names that will make them easier to work with. For example, nets<br />
with names like "n023" and "n001" can usually be safely shortened<br />
to "n23" and "n1" (sometimes I do this in a word processor with<br />
find and replace). Also, it is a good idea to move all comments<br />
to the end of the working netlist (if not delete them altogether).<br />
<br />
At this point, I like to import the netlist into LTspice, either<br />
directly onto the schematic (if the netlist is short) or into a<br />
separate LTspice netlist window.<br />
<br />
Now go through the netlist line by line and place a component of<br />
the corresponding type on the schematic (arrange these in rows by<br />
component type such that you build up rows of all the same type).<br />
It is important to do this in exactly the same order as the net-<br />
list because this will greatly ease cross checking when you think<br />
you have finished. (Also, all of the SPICE text, such as model<br />
statements, etc. should be copied and pasted in at the end.)<br />
<br />
As you place each component, edit its reference designator to<br />
agree with the corresponding netlist reference designator.<br />
<br />
As you place each component, place a net-label/node-name directly<br />
on each pin of the component (of course, these should agree with<br />
their names in the netlist, too). Don't bother with wires yet as<br />
these will just be trouble to move around later.<br />
<br />
Once all the components are placed, view the SPICE Netlist (it's<br />
a drop-down menu item) and verify that it agrees *exactly* with<br />
the original netlist (it will, if you followed these instructions<br />
carefully). Correct any errors as needed until agreement is<br />
perfect. This "schematic" should actually be able to run at<br />
this point.<br />
<br />
(This above section is what is automated by the SchBuilder.)<br />
<br />
So far you have just been playing the part of a robot, but now<br />
comes the fun part where human judgement is required. Move the<br />
components around on the schematic to group them such that the<br />
pins that have the same net names are close to each other and<br />
that signal flow makes sense. Use the Highlight Net tool (right<br />
mouse button click on a pin or net) to make sure no connection<br />
is overlooked.<br />
<br />
Only when the parts are reasonably well placed is it time to<br />
start drawing in the wires and adjust the look of the schematic.<br />
<br />
Be sure to check occasionally that the two netlists continue to<br />
match.<br />
<br />
Because both netlists and schematics are just ascii text files,<br />
the first part of this process should be fairly straightforward<br />
to automate in software. Grouping components and connecting them<br />
for least total wire length might be harder, but still possible<br />
(I would try an approach using the so-called "synthetic annealing"<br />
algorithm). However, finishing the schematic to human sensibilities<br />
would seem beyond the reach of any canned program, but having a<br />
utility that did the first two steps would be a big time saver and<br />
well worthwhile. (from analogspiceman, used by permission)<br />
<br />
== Comparing LTspice and Oscilloscope Waveforms ==<br />
<br />
Sometimes you want to see how closely your SPICE simulation matches the real circuit as seen by your scope. Here is a utility which imports an LTspice waveform and the data from your scope, overlays them, and allows you to slide one back and forth to line them up. It’s called CompareWaveforms, and here’s what it looks like:<br />
<br />
[[File:CompareWaveformsScreen.png]]<br />
<br />
You select the files to compare, press Compare, and use the long slider along the bottom to line up the waveforms. You can save the plot as a .png file to include in a report.<br />
<br />
The formats of the input files are straightforward. The LTspice file is the direct output of File / Export from the LTspice waveform window. The scope file is a .csv (Comma-Separated Values text file) with two header lines at the beginning (because that’s what my scope puts out). Each subsequent line is of the form time-in-seconds, volts. These are easily changed in the Python source if you wish. The scope data file may have a time offset due to trigger delay or trace positioning, so that is subtracted from the scope time measurements to match the LTspice time which starts at zero.<br />
<br />
Note on waveform comparison: you may want to include the loading of your scope probe in your simulation. My probes are 12 pF in parallel with 2.2 Mohm, which can alter the simulator waveforms. Also, make your total simulation time equal to the sweep time of your scope (typically the time/div times 10), and make the start of the waveform roughly the same. CompareWaveforms allows you to adjust time +/-10% of the total sweep.<br />
<br />
[http://ltwiki.org/files/CompareWaveforms-1.0-win32.msi Compare Waveforms Complete Install for Windows] <br><br />
<br />
[http://ltwiki.org/files/CompareWaveforms_v1.01.zip Compare Waveforms Python 3.4 Source Code] <br><br />
<br />
[http://www.exality.com/blog/ More info and tools at Exality]<br />
<br />
== Computation of SPICE diode parameters from 3 electrical measurements ==<br />
<br />
This calculator tool is a Mathematica CDF (Computable Document Format), the CDF player is a 200MB download from the Wolfram site.<br />
<br />
<cdf width="600" height="1024">Diode_Parameters_Spice.cdf</cdf><br />
<br />
= Discussion =<br />
<br />
{{#widget:DISQUS<br />
|id=ltwiki<br />
|uniqid={{PAGENAME}}<br />
|url=http://ltwiki.org/index.php5?title=LTspice_Tools_and_Applications<br />
}}</div>Jose luu