Main Content

SPDT Switch

Single-pole double-throw switch

  • SPDT Switch block

Libraries:
Simscape / Electrical / Switches & Breakers

Description

The SPDT Switch block models a single-pole double-throw switch:

  • When the switch is open, port p is connected to port n1.

  • When the switch is closed, port p is connected to port n2.

Open connections are modeled by a resistor with value equal to the reciprocal of the Open conductance parameter value. Closed connections are modeled by a resistor with value equal to the Closed resistance parameter value.

If the Threshold width parameter is set to zero, the switch is closed if the voltage presented at the vT control port exceeds the value of the Threshold parameter.

If the Threshold width parameter is greater than zero, then switch conductance G varies smoothly between off-state and on-state values:

G=xRclosed+(1x)Gopen

λ=vTThresholdThreshold width

x={0for λ03λ22λ3for 0<λ<11for λ1

The block uses the function 3λ2 – 2λ3 because its derivative is zero for λ = 0 and λ = 1.

Defining a small positive Threshold width can help solver convergence in some models, particularly if the control port signal vT varies continuously as a function of other network variables. However, defining a nonzero threshold width precludes the solver making use of switched linear optimizations. Therefore, if the rest of your network is switched linear, set Threshold width to zero.

Optionally, you can add a delay between the point at which the voltage at vT passes the threshold and the switch opening or closing. To enable the delay, on the Dynamics tab, set the Model dynamics parameter to Model turn-on and turn-off times.

Model Gate Control Port

You can control the switch gates by using a physical signal port or electrical conserving ports. To select the gate control port, set the Modeling option parameter to either:

  • PS control port — The block contains a physical signal port that is associated with the threshold voltage.

  • Electrical control port — The block contains electrical conserving ports that are associated with the threshold voltage.

Examples

Ports

Refer to the figure for port locations.

Input

expand all

Physical port associated with the signal that opens and closes the switch.

Dependencies

To enable this port, set Modeling option to PS control port.

Conserving

expand all

Electrical conserving port.

Electrical conserving port.

Electrical conserving port.

Electrical conserving port for the positive voltage associated with opening and closing the switch.

Dependencies

To enable this port, set Modeling option to Electrical control port.

Electrical conserving port for the negative voltage associated with opening and closing the switch.

Dependencies

To enable this port, set Modeling option to Electrical control port.

Parameters

expand all

Whether to specify physical or electrical control port for the switch gate.

Main

Resistance between the p port and ports n1 and n2 when the switch is closed. The value must be greater than zero.

Conductance between the p port and ports n1 and n2 when the switch is open. The value must be greater than zero.

The threshold voltage above which the switch will turn on.

The minimum voltage increase above the threshold value that will move the switch from fully open to fully closed.

Dynamics

Select whether the block models a switching delay:

  • No dynamics — Do not model the delay. This is the default option.

  • Model turn-on and turn-off times — Use additional parameters to model a delay between the point at which the voltage at vT or + and - passes the threshold and the switch opening or closing.

Time between the input voltage exceeding the threshold voltage and the switch closing. The value must be greater than zero.

Dependencies

This parameter is visible only when you select Model turn-on and turn-off times for the Model dynamics parameter.

Time between the input voltage falling below the threshold voltage and the switch opening. The value must be greater than zero.

Dependencies

This parameter is visible only when you select Model turn-on and turn-off times for the Model dynamics parameter.

The value of the physical signal input vT at time zero. This value is used to initialize the delayed control voltage parameter internally.

Dependencies

This parameter is visible only when you select Model turn-on and turn-off times for the Model dynamics parameter.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2012b