Electron microscopy
 
Switche-like Diodes and NgSpice Simulations
- Integrated Circuits -
- An Online Book -
Integrated Circuits                                                                                   http://www.globalsino.com/ICs/        


=================================================================================

 

There are two types of switches: are available:
         i) Vvoltage controlled switch (type SXXXXXX, model SW), which can be given by "SXXXXXXX N + N - NC + NC - MODEL <ON >< OFF". For the voltage controlled switch, nodes 3 and 4 are the positive and negative controlling nodes respectively.
         ii) Current controlled switch (type WXXXXXXX, model CSW), which can be given by "WYYYYYYY N + N - VNAM MODEL <ON > < OFF >". For the current controlled switch, the controlling current is that through the specified voltage source.

In the simulations, the direction of positive controlling current flow is from the positive node, through the source, to the negative node. Even though the switch model allows an almost ideal switch in ngspice, it is still not quite ideal, meaning the resistance can not be changed from 0 to infinity. By proper selection of the on and off resistances, they can be effectively zero and infinity in comparison to other circuit elements. The available parameters are listed in Table.

Table 4693. Parameters for NgSpice simulations of voltage and current switches. [1]

Switch model
Name
Parameter
Default
Units
SW VT Threshold voltage 0.0 V
CSW IT Threshold current 0.0 A
SW VH Hysteresis voltage 0.0 V
CSW IH Hysteresis current 0.0 A
SW,CSW RON On resistance 1.0 Ω
SW,CSW ROFF Off resistance 1.0e+12 (*) Ω

Figure 4693 shows an example which includes a threshold-voltage switch-like (ideal) diode.

Electrical circuit with a diode

Figure 4693. Electrical circuit with a threshold-voltage switch-like (ideal) diode.

=================================================

Simulation of electrical circuits with a threshold-voltage switch-like (ideal) diode (Figure 4693): code:
        Wheatstone bridge
        Wheatstone bridge
Output:        
        Wheatstone bridge                

        


        


         
         

         
         
         
         


         
         
         
         

[1] NgSpice Manual.

 

 

=================================================================================