[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Simulation troubles ...



Richard,
  I probably should have sent this as well.   It's SPICE instructions for 
ngspice-
http://newton.ex.ac.uk/teaching/CDHW/Electronics2/userguide/

Look under 1.1.1 DC Analysis.
Regards,
Kurt
----------------------------------------------------------------------

Message: 1
Date: Mon, 05 Nov 2007 02:49:43 +0100
From: Richard Rasker <rasker@xxxxxxxxxx>
Subject: gEDA-user: Simulation troubles ...
To: gEDA user mailing list <geda-user@xxxxxxxxxxxxxx>
Message-ID: <1194227384.5239.219.camel@localhost>
Content-Type: text/plain

Hello,

I've been using gEDA for years using gschem and pcb, and recently, I
decided I'd like to check out the GUI simulation tools as well.
Long ago, I used some Windows-based simulation tools (e.g. MicroCap),
and these worked well enough for my simple needs.

For several days now, I'm trying to get to grips with the gEDA way of
doing things, and I'm failing miserably.

First off, I can't get gspiceui to compile, no matter what I try. It
seems Mandriva is simply incompatible, as I recall running into this
problem several times already in the past.
No problem, I downladed Kurt Peters' KJWaves, and it seems like the tool
I was looking for. There is a problem, however: apparently I don't
understand how it works.

First, I created the very simplest of RC networks in gschem and saved it
in a file by the name of test.sch,:

   v 20070216 1
   C 40000 40000 0 0 0 title-B.sym
   C 45200 46900 1 0 0 resistor-2.sym
   {
   T 45600 47250 5 10 0 0 0 0 1
   device=RESISTOR
   T 45400 47200 5 10 1 1 0 0 1
   refdes=R1
   T 45400 46700 5 10 1 1 0 0 1
   value=47k
   }
   C 46300 46100 1 90 0 capacitor-1.sym
   {
   T 45600 46300 5 10 0 0 90 0 1
   device=CAPACITOR
   T 45800 46500 5 10 1 1 180 0 1
   refdes=C2
   T 45400 46300 5 10 0 0 90 0 1
   symversion=0.1
   T 46700 46300 5 10 1 1 180 0 1
   value=100nF
   }
   C 44900 45800 1 0 0 vsin-1.sym
   {
   T 44600 46550 5 10 1 1 0 0 1
   refdes=V1
   T 45600 46650 5 10 0 0 0 0 1
   device=vsin
   T 45600 46850 5 10 0 0 0 0 1
   footprint=none
   T 44200 46050 5 10 1 1 0 0 1
   value=sin 0 1 10
   }
   C 45100 45500 1 0 0 gnd-1.sym
   C 46000 45800 1 0 0 gnd-1.sym


Then I generated a netlist as follows:

gnetlist -g spice-sdb test.sch -o test.net

The result:

   * gnetlist -g spice-sdb -o test.net test.sch
   *********************************************************
   * Spice file generated by gnetlist                      *
   * spice-sdb version 2.10.2007 by SDB --                 *
   * provides advanced spice netlisting capability.        *
   * Documentation at http://www.brorson.com/gEDA/SPICE/   *
   *********************************************************
   *==============  Begin SPICE netlist of main design ============
   V1 2 0 sin 0 1 10
   R1 2 1 47k
   C2 0 1 100nF
   .end

So far, so good. Then I fired up KJWaves, and chose
File -> Open SPICE Circuit, and selected test.net.

In the leftmost column (nodes) I selected node 1 (which is the output),
and clicked Add as Output in the Transfer Function group field. Then I
declared node 2 as an input in the same manner, and finally, I selected
the Calculate TF option.

Then I selected a Start Frequency of 10 and a Stop Frequency of 100 (as
the roll-off should be around 34Hz).

Finally, I selected the dB/Phase checkbox under "Output option" (I wish
to see the transfer function and the phase characteristics).

Having set the input node, the output node, the frequency range and the
desired output display, I clicked "Add Analysis to Simulation", at which
point the Circuit tab showed the following:

   * gnetlist -g spice-sdb -o test.net test.sch
   .TF V(1) V(2)
   .AC DEC 100 10.0  100
   .SAVE V(1)
   .OPT NOPAGE NOMOD
   .WIDTH OUT=133
   *********************************************************
   * Spice file generated by gnetlist                      *
   * spice-sdb version 2.10.2007 by SDB --                 *
   * provides advanced spice netlisting capability.        *
   * Documentation at http://www.brorson.com/gEDA/SPICE/   *
   *********************************************************
   *==============  Begin SPICE netlist of main design ============
   V1 2 0 sin 0 1 10
   R1 2 1 47k
   C2 0 1 100nF
   .end

Then I clicked the Run button, and confirmed the saving of KJ-test.NET,
then confirmed saving a file named KJ-WavesRAW.OUT, which was
subsequently opened again, after which I ended up in the "Select Axis
Variables" window.

So I selected the frequency for the X-axis and V(1) for the Y-axis, with
dB/Phase under "Other option". Then I clicked Add to Plot Window, after
which I got a flat line. And no matter what I choose, I get flat lines,
or no lines at all.

When checking out the Console tab, there appears to be an error:

   KJWaves version 1.1.2, Copyright (C) 2006-2007 Kurt M Peters.
   KJWaves comes with ABSOLUTELY NO WARRANTY.
   See the GNU General Public License for more details.
   Opening: /home/rr/electron/Tech/test.net.
   Successfully saved: /home/rr/electron/Tech/Tech/KJ-test.NET.
   Running command: ngspice -b /home/rr/electron/Tech/KJ-test.NET -r 
/home/rr/KJ-WavesRAW.OUT.
   ngspice -b /home/rr/electron/Tech/KJ-test.NET -r /home/rr/KJ-WavesRAW.OUT 
.
   ERROR>Warning: v1: no DC value, transient time 0 value used
   ERROR>No. of Data Columns : 2
   ERROR>
   ERROR>No. of Data Rows : 101
   Opening: /home/rr/KJ-WavesRAW.OUT.
   File Opened Successfully.


I can't make anything of this. What am I doing wrong? Is it the sine
wave source V1? If so, what should I use in its place? Why can't I
simply define input and output nodes, and calculate the transfer
function between the two? I tried reading Stuart Brorson's HOWTO on this
subject (http://www.brorson.com/gEDA/SPICE/intro.html, and in particular
http://www.brorson.com/gEDA/SPICE/x150.html), but I found it impossible
to comprehend, probably because it supposes expert knowledge of SPICE
(which I haven't) and the way gschem, netlist and SPICE files are
defined (which doesn't interest me at all).
I also read all of Brorson's advice and answers on the mailing list on
this subject, but that didn't get me any further. Neither did digging
through gschem attributes, netlists, .sym files and reading lots of
other stuff.

Let me put it like this:
What I want is to draw a schematic (e.g. in gschem), import it into a
simulation package, set a few parameters, and get results. What I don't
want, is to have to dig through and fully understand .sym files, spice
files, netlist files, pin designations and a host of other details, try
all sorts of CLI commands, install all kinds of tools, and still get
nothing. (I also tried following Al Davis' advice, but got stuck when
Mandriva couldn't fulfil one of gwave's dependencies.)

In the end, I resorted to the tried & tested method: I simply built the
circuit I wanted to test (a 5th order Chebyshev filter) with some old
components laying around, performed several tests and calculations (with
my old Casio pocket calculator), and found it worked as it should. It
only took me about one hour -- which was a breeze compared to the >> 10
hours I spent so far on trying to get results with gEDA simulation
tools, without result.


I'm sorry if I sound a bit miffed, and I appreciate the work people
apparently put into all this, but if I can't even get a simple f-dB plot
on my screen after well over two days of trying and searching, there
must be something wrong with the GUI tools. Or else I really missed the
link somewhere between "hard" analytical calculations (which I
understand) and the way simulation software works (which I thought I
understood).


What I think would be most useful in this respect, are sample files.
Lots of 'em, and well-documented. Not just one HOWTO page, not just a
rather general wiki entry, but LOTS of different examples, with
explanations from a to z. It may sound stupid, and it may sound like a
waste of time compared to the general RTFM motto, but in my experience,
providing examples work. The more, the better.
Actually, as it is my job anyway, I could write a decent manual -- once
*I* understand how it's supposed to work.

Best regards,

Richard Rasker




_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user