# Voltage-Controlled Switch

Voltage-controlled switch with hysteresis

• Library:
• Simscape / Electrical / Additional Components / SPICE Passives

• ## Description

The Voltage-Controlled Switch block represents the electrical characteristics of a switch whose state is controlled by the voltage across the input ports (the controlling voltage).

This block models either a variable-resistance or a short-transition switch. For a variable-resistance switch, set the Switch model parameter to `Smooth transition between Von and Voff`. For a short-transition switch, set Switch model to ```Abrupt transition after delay```.

### Short-transition Switch

In a short-transition switch, the transition between the off and on states is instantaneous:

• When the controlling voltage is greater than or equal to the sum of the Threshold voltage, VT and Hysteresis voltage, VH parameter values, the switch is closed and has a resistance equal to the On resistance, RON parameter value.

• When the controlling voltage is less than the Threshold voltage, VT parameter value minus the Hysteresis voltage, VH parameter value, the switch is open and has a resistance equal to the Off resistance, ROFF parameter value.

• When the controlling voltage is greater than or less than the Threshold voltage, VT parameter value by an amount less than or equal to the Hysteresis voltage, VH parameter value, the voltage is in the crossover region and the state of the switch remains unchanged.

Note

If the Hysteresis voltage, VH parameter value is less than `0`, the block models a variable-resistance switch independently of the value you set for the Switch model parameter.

### Variable-resistance Switch

In a variable-resistance switch, the transition between the off and on states is exponential:

• When the Control voltage for on state, VON is greater than the Control voltage for off state, VOFF:

• If the controlling voltage is greater than the Control voltage for on state, VON parameter value, the switch is closed and has a resistance equal to the On resistance, RON parameter value.

• If the controlling voltage is less than the Control voltage for off state, VOFF parameter value, the switch is open and has a resistance equal to the Off resistance, ROFF parameter value.

• If the controlling voltage is greater than the Control voltage for off state, VOFF parameter value or less than the Control voltage for on state, VON parameter value, the resistance is defined by:

`${R}_{s}=\mathrm{exp}\left[{L}_{m}+3{L}_{r}\left(\frac{{V}_{c}-{V}_{m}}{2{V}_{d}}\right)-2{L}_{r}\left(\frac{{\left({V}_{c}-{V}_{m}\right)}^{3}}{{V}_{d}^{3}}\right)\right]$`

where:

• Rs is the switch resistance.

• ${L}_{m}=ln\left[{\left({R}_{ON}*{R}_{OFF}\right)}^{\frac{1}{2}}\right]$ is the log-mean of resistor values.

• ${L}_{r}=ln\left(\frac{{R}_{ON}}{{R}_{OFF}}\right)$ is the log-ratio of resistor values.

• Vc is the controlling voltage.

• ${V}_{m}=\frac{{V}_{ON}+{V}_{OFF}}{2}$ is the mean of the control voltages.

• ${V}_{d}={V}_{ON}-{V}_{OFF}$ is the difference between the control voltages.

• When the Control voltage for on state, VON is less than the Control voltage for off state, VOFF:

• If the controlling voltage is less than the Control voltage for on state, VON parameter value, the switch is closed and has a resistance equal to the On resistance, RON parameter value.

• If the controlling voltage is greater than the Control voltage for off state, VOFF parameter value, the switch is open and has a resistance equal to the Off resistance, ROFF parameter value.

• If the controlling voltage is less than the Control voltage for off state, VOFF parameter value or greater than the Control voltage for on state, VON parameter value, the resistance is defined by:

`${R}_{s}=\mathrm{exp}\left[{L}_{m}+3{L}_{r}\left(\frac{{I}_{c}-{I}_{m}}{2{I}_{d}}\right)-2{L}_{r}\left(\frac{{\left({I}_{c}-{I}_{m}\right)}^{3}}{{I}_{d}^{3}}\right)\right]$`

## Assumptions and Limitations

The block output resistance model is discontinuous during switching. The discontinuity might cause numerical issues. Try the following actions to resolve the issues:

• Set the On resistance, RON and Off resistance, ROFF parameter values to keep RON divided by ROFF as large as possible, and more than `1e+12`.

• Increase the Hysteresis voltage, VH parameter value to reduce switch chatter.

• If a variable-step solver is employed, decrease the Max step size parameter value (in the Configuration Parameters block dialog box).

Note

This increases the simulation time.

## Ports

### Conserving

expand all

Electrical conserving port associated with the voltage controlled switch positive input.

Electrical conserving port associated with the voltage controlled switch negative input.

Electrical conserving port associated with the voltage controlled switch positive output.

Electrical conserving port associated with the voltage controlled switch negative output.

## Parameters

expand all

Whether the transition between on state and off state current is instantaneous or not. To model this block as a variable-resistance switch, select `Smooth transition between Ion and Ioff`. To model this block as a short-transition switch, select ```Abrupt transition after delay```.

Voltage above which the block interprets the controlling voltage as HIGH.

Note

The controlling voltage must differ from the threshold voltage by at least the Hysteresis voltage, VH parameter value to change the state of the switch.

#### Dependencies

To enable this parameter, set Switch model to `Abrupt transition after delay`.

Amount by which the controlling voltage must exceed or fall below the Threshold voltage, VT parameter value to change the state of the switch.

#### Dependencies

To enable this parameter, set Switch model to `Abrupt transition after delay`.

Switch control voltage for the on state.

#### Dependencies

To enable this parameter, set Switch model to ```Smooth transition between Von and Voff```.

Switch control voltage for the off state.

#### Dependencies

To enable this parameter, set Switch model to ```Smooth transition between Von and Voff```.

Resistance of the switch when it is closed.

Whether to automatically calculate the off resistance of this switch as `1/GMIN`.

Note

The value of the parallel conductance, GMIN, depends on whether your model contains an Environment Parameters block.

By default, GMIN matches the GMIN parameter of the Environment Parameters block, whose default value is 1e–12. To change GMIN, add an Environment Parameters block to your model and set the GMIN parameter to the desired value.

#### Dependencies

To enable this parameter, set Switch model to `Abrupt transition after delay`.

Resistance of the switch when it is open.

#### Dependencies

To enable this parameter either:

• Set Switch model to `Abrupt transition after delay` and Use 1/GMIN as Off resistance to `No`. The default value is `1e12`.

• Set Switch model to ```Smooth transition between Von and Voff```. The default value is `1e6`.

, .

Time delay after which the switch transition takes place.

#### Dependencies

To enable this parameter, set Switch model to `Abrupt transition after delay`.

## Extended Capabilities

### Functions

Introduced in R2009a