Hints on using individual LTSpice commands and the things the Help Manuals don't tell you about
.param
One of the more confusing aspects of using .param (at least when I began using LT) was where and when do you use the curly barckets {} ?
The simplest definition doesn't require curly brackets
.param res1 = 1000
Which could be used to define a resistor of 1000 Ohms
But sometimes a parameter needs to be defined from other parameters,
Here it becomes more accurate to use curly brackets. Without the curly brackets - you can only nest (calculated) param valaues 1 deep Going any deeper (one calculation depnds on another etc) LT will pull errors
Correct Method { doesn't pull errors }
- Comment line : Calculate capacitance
- -------------------------------------
.param length = {3e-2} .param width = {4e-3} .param area = {length * width} .param gap = {40e-6} .param Eo = {8.85e-12} .param Capa = { (Eo * gap) / area} .MEAS Capa_ PARAM Capa
The answer (from the error log ) is:
capa_: capa=2.95e-012
To see the results in LTspice
Use the Error Log (a better name would have been the results log)
Incorrect method (pulls errors)
.param length = 3e-2 .param width = 4e-3 .param area = length * width .param gap = 40e-6 .param Eo = 8.85e-12 .param Cap = (Eo * gap) / area} .MEAS Capa_ PARAM Capa
Error:
Warning Can't resolve .param cap=(eo * gap)area)
The quickest way to check a calculation before you commit it to a library
is to create a section of text within the LT schematic.
Set the text as LTspice directive (command) ,
then run the schematic
Finding the measure results of a simulation
Check your results in the error log
Found from the toolbar :
View/Spice error Log
Suggestion:
Set the Tools/Control panel/ Operation / Generate Expanded Listing
and tick (yes) to see a more comprehensive output listing - helps with debugging