(W) Current Controlled Switch Statement
The current-controlled switch monitors the current through another circuit element to control its switch resistance. Contrary to PLECS, it is not possible to simulate ideal switches (zero on-resistance, infinite off-resistance) in SPICE.
Wname pos neg Vname modelName
.MODEL modelName CSW <NAME=value ...>
The above statement probes the current of a device with the name
Vname. Allowed device types are voltage sources (V), controlled sources (E,H), and function-based voltage sources (B).You can customize this model by providing a list of model parameter (name-value format) at the end of the .MODEL statement.
PLECS Spice supports two types of current-controlled switch models:
Models without hysteresis and continuous resistance transitions
Models with hysteresis and discontinuous resistance transitions
Model Parameters
Continuous resistance model
Parameter |
Value |
Default Value |
|---|---|---|
Ion |
Control value at which the switch is fully closed |
\(1\, \text{A}\) |
Ioff |
Control value at which the switch is fully opened |
\(0\, \text{A}\) |
Ron |
Resistance when the switch is closed |
\(1\, \Omega\) |
Roff |
Resistance when the switch is open |
\(10^{6}\, \Omega\) |
The switch resistance transitions smoothly between \(R_\text{off}\) and \(R_\text{on}\) over the control voltage range \(\left[I_\text{off}, I_\text{on}\right]\).
Hysteresis model
Parameter |
Value |
Default Value |
|---|---|---|
It |
Threshold current |
\(0.5\, \text{A}\) |
Ih |
Hysteresis current |
\(1\, \text{A}\) |
Ron |
Resistance when the switch is closed |
\(1\, \Omega\) |
Roff |
Resistance when the switch is open |
\(10^{6}\, \Omega\) |
The switch changes its internal state from off to on (closes) when the control current \(I_\text{c}\) reaches \(I_\text{t} + |I_\text{h}|\) and opens again at \(I_\text{c} = I_\text{t} - |I_\text{h}|\).
Model selection
The continuous resistance model is automatically used when either
IonorIoffis given and all parameters related to hysteresis are ignored.When using the hysteresis model, it is recommended to specify both
ItandIhto avoid compatibility issues with other SPICE solvers.
Examples
Vsense sense_in sense_out 0
W1 load_pos load_neg Vsense CSW_model
.MODEL CSW_model CSW Ion=10 Ioff=0.1 Ron=0.01 Roff=1Meg