Switch problems once more


To ng-spice@ieee.ing.uniroma1.it
From Herbert Widlok <widlok@uci.agh.edu.pl>
Date Sun, 29 Oct 2000 11:26:00 +0100
Delivered-To mailing list ng-spice@ieee.ing.uniroma1.it
Mailing-List contact ng-spice-help@ieee.ing.uniroma1.it; run by ezmlm
References <Pine.LNX.3.96.1001026101808.349A-100000@ieee.ing.uniroma1.it > <39F945B9.CB8405F2@uci.agh.edu.pl > <39F988AC.43050D6A@analog.com >
Reply-To ng-spice@ieee.ing.uniroma1.it

Hi all,

    Thanks for this replays for my switch problems. I have tried using B 
source
instead off switch before and it is not working right, don't ask my why I 
have no
idea.

This time I have checked how switches works in PSPICE and Msim??? (Windows 
version
of Pspice with schematics, optimizer and so on) and find out that they all use
simple method -
    switch resistance change exponentially between RON and ROFF when control
voltage is between VON and VOFF.
For simple test I modified switch code to change resistance linearly when 
Vcontrol
is between VT-VH and VT+VH. This fixes all my problems - I use small VH when 
I want
fast switch and large when slower. Code is really simple and works as fast as
before.

Now back to ngspice... Switch levels can be used but:
    1) I  don't know how to add them
    2) I am not sure if they are really needed. How often standard "rapid" 
switches
will be used? This was the first time that I needed a switch, and I am doing 
really
a lot of simulations.
    3) Commercial PSPICE and other spice based simulators that I know don't 
use
rapid switches.

Please think about this. I will send my code tomorrow (for voltage and current
switches), Do with it what You want.

Michael


Partial thread listing: