Skip to content

jsl/symbols/transformer

Package name: jsl/symbols/transformer

Summary

Data Types

TransformerSymbol

Parameterized Transformer Symbol

Methods

Function Description
name Construct a Transformer Symbol

Functions

Function Description
TransformerSymbol

CoilParams

Specifications for the Coil Symbol

Functions

Function Description
get-pin-count
CoilParams
build-coil-glyphs Build the glyphs for a coil shape with tap lines for a Right facing coil
get-coil-height

TransformerSymbolParams

Parameters that define a Transformer Symbol

Functions

Function Description
TransformerSymbol
get-coils
build-coil-glyphs Build the glyphs for a coil shape with tap lines for a Right facing coil
TransformerSymbolParams

General Definitions

Function Description
ensure-up-down!
ensure-left-right!
Variable Description
DEF_TFR_PITCH Default Transformer Pitch
DEF_TFR_PIN_LEN
DEF_TFR_REF_SIZE
DEF_TFR_TAP_LEN
TFR_GRP_REF

Definitions

TransformerSymbol

Parameterized Transformer Symbol

public defstruct TransformerSymbol <: SymbolDefn
    params: TransformerSymbolParams

  • params: TransformerSymbolParams

User can select the form of this transformer using the TransformerSymbolParams type.

  • N1.p[1], N1.p[2] => Coil 1, End Pins p1=positive, p2=negative
  • N1.tap[1] => First tap starting from the top of Coil #1

The N1 is the coil identifier and will map to the Int value in the coils of the TransformerSymbolParams type.

The p[1]/p[2] pins are the endpoints of the coil. p[1] is always the positive pin (pin with marker).

The tap[...] array is a set of pins that map to the generated taps for this coil. This list is 1-indexed. It starts from he top of the coil.

Methods

name

Construct a Transformer Symbol

defmethod name (x:TransformerSymbol) -> String

  • Returns String

This type allows the user to construct a transformer symbol with a parameterized number of coils.

The pins for the generated coils will come in the form:

Functions

TransformerSymbol

public defn TransformerSymbol ( -- params:TransformerSymbolParams) -> TransformerSymbol

  • Returns TransformerSymbol

CoilParams

Specifications for the Coil Symbol

public defstruct CoilParams <: SymbolParams
    direction: Dir
    params: InductorSymbolParams
    polarized: Maybe<Dir>
    taps: Tuple<Int>

  • direction: Dir - Set the direction for this coil - either Left or Right.

  • params: InductorSymbolParams - Inductor Parameters for the coil. Note that the core-style parameter will be ignored at the coil level. The user can specify this at the TransformerParams level.

  • polarized: Maybe<Dir> - Optional polarization marker - This adds a dot near either the top or bottom pin. This value expects either an Up (top) or Down (bottom) to indicate where to place the polarized marker if not None.

  • taps: Tuple<Int> - Tap Locations for this coil if any. The indices in this list are dependent on the number of periods in the params. The max number of taps is 1 less than the number of periods. These indices are zero-based.

Typically a transformer will need at least two of these specifications to provide the two ports of a minimal transformer.

TODO - Diagram that shows the tap locations and other parameters.

Functions

get-pin-count

public defn get-pin-count (p:CoilParams) -> Int

  • Returns Int

CoilParams

public defn CoilParams ( -- params:InductorSymbolParams, direction:Dir, taps:Tuple<Int> = ?, polarized:Dir = ?, label-params?:SymbolLabelParams = ?) -> CoilParams

  • Returns CoilParams

build-coil-glyphs

Build the glyphs for a coil shape with tap lines for a Right facing coil

public defn build-coil-glyphs (node:SymbolNode, tp:TransformerSymbolParams, cp:CoilParams)

This function does not take the direction into account. The user needs to manage flipping/positioning if a Left facing coil is needed.

get-coil-height

public defn get-coil-height (p:CoilParams) -> Double

  • Returns Double

TransformerSymbolParams

Parameters that define a Transformer Symbol

public defstruct TransformerSymbolParams <: SymbolParams
    coils: Tuple<KeyValue<Int, CoilParams>>
    core-style: InductorCoreStyle
    pad-ref-size: Double
    pin-length: Double
    pin-pitch: Double
    tap-length: Double

  • coils: Tuple<KeyValue<Int, CoilParams>> - The coils are an ordered list of Coil Number and Coil Parameters The coils are separated into left and right coils while maintaining their order in this collection. The coils are then rendered on their appropriate side in that order. The Coil Number is intended to be a 1-based index that will be used to define the coil reference as N[i] where i is the coil number.

  • core-style: InductorCoreStyle - Style for the graphical representation of the transformer's core. This is typically used to indicate features like "Air Core", "Iron Core", "Ferrite Core", etc.

  • pad-ref-size: Double - Pad Reference Size defines the Text size for the pad id/reference as shown above the pin.

  • pin-length: Double - Pin Length is used in defining the pins used for the ends and taps of the transformer windings.

  • pin-pitch: Double - Pin pitch defines the size of the winding half-circle shapes

  • tap-length: Double - The tap length is the extra line added in the X direction to extend the connection points away from the winding. This value is optional but can be useful for clearer symbols when using windings with one or more taps. This extends the tap position line either to the left or right depending on the coil parameters. Integral values are highly suggested to maintain the schematic grid.

Functions

TransformerSymbol

public defn TransformerSymbol ( -- params:TransformerSymbolParams) -> TransformerSymbol

  • Returns TransformerSymbol

get-coils

public defn get-coils (p:TransformerSymbolParams, side:Dir) -> Tuple<KeyValue<Int, CoilParams>>

  • Returns Tuple<KeyValue<Int, CoilParams>>

build-coil-glyphs

Build the glyphs for a coil shape with tap lines for a Right facing coil

public defn build-coil-glyphs (node:SymbolNode, tp:TransformerSymbolParams, cp:CoilParams)

This function does not take the direction into account. The user needs to manage flipping/positioning if a Left facing coil is needed.

TransformerSymbolParams

public defn TransformerSymbolParams ( -- coils:Tuple<KeyValue<Int, CoilParams>>, core-style:InductorCoreStyle = ?, tap-length:Double = ?, pin-pitch:Double = ?, pin-length:Double = ?, pad-ref-size:Double = ?, label-params?:SymbolLabelParams = ?) -> TransformerSymbolParams

  • Returns TransformerSymbolParams

General Definitions

ensure-up-down!

public defn ensure-up-down! (field:String, direction?:Maybe<Dir>)

ensure-left-right!

public defn ensure-left-right! (field:String, direction:Dir)

DEF_TFR_PITCH

Default Transformer Pitch

public val DEF_TFR_PITCH

The idea is that this defines the scale of the winding half-circle shapes. I'm generally trying to use 1.0 here because this allows the taps of the windings to extract on the schematic grid.

DEF_TFR_PIN_LEN

public val DEF_TFR_PIN_LEN

DEF_TFR_REF_SIZE

public val DEF_TFR_REF_SIZE

DEF_TFR_TAP_LEN

public val DEF_TFR_TAP_LEN

TFR_GRP_REF

public val TFR_GRP_REF

Related Packages

Forwarded by packages: jsl/symbols/generators, jsl/symbols