LISO and Eagle on 40m machines
LISO is a circuit simulation and optimization program written by Gerhard Heinzel. It is useful for predicting the behavior of a circuit, estimating the noise, analyzing the stability of op-amps, fitting the measurement with the model, optimizing resistance/capacitance values etc. LISO is installed in /cvs/cds/caltech/apps/linux/LISO/. The LISO manual is here.
liso command
The main command of LISO is fil. It expects you to run the command always in the LISO installation directory. Since it is inconvenient, I wrote a wrapper script called liso. It is in the command search path of controls account. The script works just like fil except that you can call it from anywhere. The script takes the same arguments/options as fil. What it does is to convert given paths to absolute paths (if necessary) and change directory to /cvs/cds/caltech/apps/linux/LISO/. Then it runs fil passing the arguments given to liso.
Eagle PCB CAD
Eagle is an electric circuit schematic and PCB layout editor (http://www.cadsoft.de/). There is a free version for non-commercial use. Although its functionality is limited (board size is 100x80mm max, up to two layers, one schematic sheet), it is still useful for small projects. The free version is installed in /cvs/cds/caltech/apps/linux/eagle/ It generates high quality Gerber files, so that we can send them to PCB manufactures. However, the main reason I installed eagle on the controls machines is that eagle can be used as a graphical editor for LISO input files.
LISO input files are ascii text files. Usually you have to edit it using a text editor. A circuit is described as a net list. However it is not a fun to make a net list and there is a good chance of making mistakes. Using eagle's schematic editor, you can draw a schematic of your circuit, specify input and output points you want to test, specify a node where you want to measure noise and so on. Then you can convert the schematic into a LISO input file using a user language program (ULP) called liso.ulp. A preliminary version of liso.ulp was included in the LISO distribution. I enhanced it to be practically useful. I also created an eagle component library for LISO (liso.lbr) to be used with liso.ulp.
Sample session of analyzing op-amp circuit using Eagle and LISO
Open Eagle from a linux machine by typing eagle from command line.
From the left pane of the control panel, go to [Projects]->[liso-examples]->[OpAmp]. Double click on OpAmp.sch to open the schematic.
A schematic with a simple opamp circuit will show up. It is an inverted low-pass filter. To convert this schematic into a LISO input file, go to the control panel and find liso.ulp under "User Language Programs". Right click on it and select "Run in Schematic". A file called "OpAmp.fil" will be created in the same directory as the schematic (i.e. /cvs/cds/caltech/apps/linux/eagle/projects/liso-examples/OpAmp/). This is a LISO input file. To run LISO on it, go to the directory and type liso OpAmp . A plot showing the transfer function of the circuit will be shown.
To change the frequency range, go back to the schematic and change the value of a component labeled "FREQ". To do so, click on
in the left side tool bar and then click on the component. The default value log 10 100k 300 means "Calculate the transfer function at 300 logarithmically spaced points from 10Hz to 100kHz". You can chose either log or lin for spacing.
The input and output nodes of the transfer function measurement are specified by "uinput" and "uout" components. You can move those components to change the input and output nodes. You can specify the output format of the transfer function in the value of "uout". The format is explained in the description of the component and in the LISO manual.
LISO related components can be found in [Libraries]->[liso.lbr]. Some descriptions of the components are given in the library. Basically, you can specify arguments of LISO commands in the value field of each component. One useful component is GENERAL_INSTRUCTION component. The value field of this component will be directly written into the LISO input file. So you can put any LISO command by this component.
Other examples can be found in the same directory. OpAmp-Stability.sch shows how to do an op-amp stability analysis with LISO. OpAmp-Noise.sch is for noise estimation. More complex example can be found in /cvs/cds/caltech/apps/linux/eagle/projects/liso-examples/FSS/FSS_PC_Path.sch , which is the PC path filter of the FSS board.
Setting up liso on a mac
On a mac you can run liso with the binary (liso.osx) directly in the directory you are working in. For use system wide, there are a few things you need to configure for it to work smoothly.
Clone the liso directory from the 40m SVN
svn checkout --username svn40m https://nodus.ligo.caltech.edu:30889/svn/trunk/liso/ ./liso-localcopy
Mac a directory somewhere convenient/standard and copy liso.osx, fil.ini and opamp.lib (located somewhere in the above cloned directory) into it. For example do
mkdir /usr/local/bin/liso/ cd liso-localcopy/filter/ cp liso.osx fil.ini opamp.lib /usr/local/bin/liso/
Now add this directory your your path in the bash profile and also export a set path for fil.ini
vim ~/.bash_profile
Add the following lines
# Add path to liso dir PATH+=":/usr/local/bin/liso/" # Set path of liso fil.ini path export LISO_DIR=/usr/local/bin/liso
Restart terminal, the next session will now be able to run liso from any working directory. Remove the above to 'uninstall'.
You will probably need to modify a line in the fil.ini file to call gnuplot correctly. Find out where gnuplot is which gnuplot then put this into the line starting with GNUCOMMAND followed by "-persist %s &". It should be obvious what to do.
