Relay

Old Content - visit altium.com/documentation

Model Kind

General

Model Sub-Kind

Spice Subcircuit

SPICE Prefix

X

SPICE Netlist Template Format

@DESIGNATOR %1 %2 %3 %4 %5 @MODEL #|PARAMS:| ?PULLIN|PULLIN=@PULLIN| ?DROPOFF|DROPOFF=@DROPOFF| ?CONTACT|CONTACT=@CONTACT| ?RESISTANCE|RESISTANCE=@RESISTANCE| ?INDUCTANCE|INDUCTANCE=@INDUCTANCE|

Parameters (definable at component level)

The following component-level parameters are definable for this model type and are listed on the Parameters tab of the Sim Model dialog. To access this dialog, simply double-click on the entry for the simulation model link in the Models region of the Component Properties dialog.

Pullin

contact pull in voltage (in Volts).

Dropoff

contact drop off voltage (in Volts).

Contact

contact resistance (in Ohms).

Resistance

coil resistance (in Ohms).

Inductance

coil inductance (in Henrys).

Notes

A relay is not one of the built-in SPICE engine models. It is a complex device and, as such, is defined using the hierarchical sub-circuit syntax.

All of the parameters will normally have a default value assigned. The default should be applicable to most simulations. Generally you do not need to change this value. Entering a value for a parameter on the Parameters tab of the Sim Model dialog will override its specified value in the sub-circuit file.

To check the default values of a relay, open the appropriate sub-circuit (.ckt) file. You can view the content of this file for the model specified on the Model Kind tab of the Sim Model dialog, by clicking on the Model File tab at the bottom of the dialog. The default parameter values are listed in the .SUBCKT line.

Examples

Consider the relay in the above image, with the following characteristics:

  • Pin1 is connected to net OUT
  • Pin2 is connected to net P2
  • Pin3 is connected to net P1
  • Pin4 is connected to net In
  • Pin5 is connected to net GND
  • Designator is RLY1
  • The linked simulation sub-circuit file is 12VSPDT.ckt, with the following content:

*Generic relay pins: COM NC NO T1 T2
*SPDT Relay Subcircuit Parameters
*PULLIN     = Pull in voltage
*DROPOFF    = Drop off voltage
*CONTACT    = Contact resistance
*RESISTANCE = Coil resistance
*INDUCTANCE = Coil Inductance 
*AC/DC relay
.SUBCKT 12VSPDT 1 2 3 4 5 
+ PARAMS: PULLIN=9.6 DROPOFF=0.1 CONTACT=1m RESISTANCE=1000 INDUCTANCE=10m
L1 4 6 {(INDUCTANCE/2)}
L2 5 7 {(INDUCTANCE/2)}
R1 6 7 {RESISTANCE}
BNO 8 0 V={PULLIN}-abs(v(6,7))
SW1 2 1 8 0 SWNC ON
BNC 9 0 V=abs(v(6,7))
SW2 3 1 9 0 SWNO OFF
.MODEL SWNC SW(VT={DROPOFF} RON={CONTACT} )
.MODEL SWNO SW(VT={(PULLIN*0.98)} RON={CONTACT} )
.ENDS SPDTRELAY

  • Pullin = 8.4V - set on the Parameters tab of the Sim Model dialog.

The entries in the SPICE netlist would be:

*Schematic Netlist:
XRLY1 OUT P2 P1 IN 0 12VSPDT PARAMS: Pullin=8.4V
.
.
*Models and Subcircuit:
.SUBCKT 12VSPDT 1 2 3 4 5 PARAMS: PULLIN=9.6 DROPOFF=0.1 CONTACT=1m
+ RESISTANCE=1000 INDUCTANCE=10m
L1 4 6 {(INDUCTANCE/2)}
L2 5 7 {(INDUCTANCE/2)}
R1 6 7 {RESISTANCE}
BNO 8 0 V={PULLIN}-abs(v(6,7))
SW1 2 1 8 0 SWNC ON
BNC 9 0 V=abs(v(6,7))
SW2 3 1 9 0 SWNO OFF
.MODEL SWNC SW(VT={DROPOFF} RON={CONTACT} )
.MODEL SWNO SW(VT={(PULLIN*0.98)} RON={CONTACT} )
.ENDS SPDTRELAY

The Netlister will evaluate the formulae in the sub-circuit definition using the value for the Pullin parameter specified in the Sim Model dialog (which overrides the default) and the default values for all other parameters, as defined in the 12VSPDT.ckt file.

You are reporting an issue with the following selected text and/or image within the active document: