# Multi-Winding Transformer (`multiTransformer`)

> A transformer with one primary and up to three secondaries on one core, each secondary with its own turns ratio, leakage and winding resistance.

![multiTransformer](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/multiTransformer.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/magnetics/multiTransformer/)

**Group:** Magnetics · **Kind:** `{"kind":"multiTransformer"}`

## When to use it

Use it for a multi-output flyback or forward converter, or any supply whose outputs share one transformer, such as the design magnetics.design gives with secondaries. For one secondary, Transformer does the same with fewer parameters.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `p1` | electrical | Primary, dotted end; positive current enters here |
| `n1` | electrical | Primary, other end |
| `p2` | electrical | Winding 2, dotted end |
| `n2` | electrical | Winding 2, other end |
| `p3` | electrical | Winding 3, dotted end; open when n3 is unset |
| `n3` | electrical | Winding 3, other end; open when n3 is unset |
| `p4` | electrical | Winding 4, dotted end; open when n4 is unset |
| `n4` | electrical | Winding 4, other end; open when n4 is unset |

## Common parameters

- `n2`: Turns ratio, primary to winding 2 (Default: 1)
- `n3`: Turns ratio, primary to winding 3; unset leaves winding 3 off and its pins open (Default: optional (off))
- `n4`: Turns ratio, primary to winding 4; unset leaves winding 4 off and its pins open (Default: optional (off))
- `lm`: Inductance that magnetizes the core, seen from the primary (Default: optional (off))

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `n2` | — | 1 |  | Turns ratio, primary to winding 2 |
| `n3` | — | optional (off) |  | Turns ratio, primary to winding 3; unset leaves winding 3 off and its pins open |
| `n4` | — | optional (off) |  | Turns ratio, primary to winding 4; unset leaves winding 4 off and its pins open |
| `lm` | H | optional (off) |  | Inductance that magnetizes the core, seen from the primary |
| `im0` | A | 0 |  | Magnetizing current at the start, seen from the primary; needs lm |
| `llk1` | H | 0 |  | Leakage inductance in series with the primary |
| `llk2` | H | 0 |  | Leakage inductance in series with winding 2 |
| `llk3` | H | 0 |  | Leakage inductance in series with winding 3 |
| `llk4` | H | 0 |  | Leakage inductance in series with winding 4 |
| `lk12` | H | optional (off) |  | Primary leakage, winding 2 shorted: measured at the primary with winding 2 shorted and winding 3 open; with lk13 and lk23 it sets llk1 to llk3 |
| `lk13` | H | optional (off) |  | Primary leakage, winding 3 shorted: measured at the primary with winding 3 shorted and winding 2 open; with lk12 and lk23 it sets llk1 to llk3 |
| `lk23` | H | optional (off) |  | Winding 2 leakage, winding 3 shorted: measured at winding 2 with winding 3 shorted and the primary open; with lk12 and lk13 it sets llk1 to llk3 |
| `lk14` | H | optional (off) |  | Primary leakage, winding 4 shorted: measured at the primary with winding 4 shorted and the others open; with lk12, lk13 and lk23 it sets llk4 |
| `lk24` | H | optional (off) |  | Winding 2 leakage, winding 4 shorted: measured at winding 2 with winding 4 shorted and the others open; with lk12, lk13, lk23 and lk14 it sets the coupling of windings 2 and 4 |
| `lk34` | H | optional (off) |  | Winding 3 leakage, winding 4 shorted: measured at winding 3 with winding 4 shorted and the others open; with lk12, lk13, lk23 and lk14 it sets the coupling of windings 3 and 4 |
| `rw1` | Ω | 0 |  | Wire resistance of the primary |
| `rw2` | Ω | 0 |  | Wire resistance of winding 2 |
| `rw3` | Ω | 0 |  | Wire resistance of winding 3 |
| `rw4` | Ω | 0 |  | Wire resistance of winding 4 |
| `rcore` | Ω | optional (off) |  | Resistance across the primary that models core loss |
| `isat` | A | optional (off) |  | Magnetizing current where the core saturates, seen from the primary; needs lm |
| `lmsat` | H | optional (off) |  | Magnetizing inductance once the core is saturated; a fifth of lm when unset |

_Parameter descriptions are in English in both languages._

**Use for:** Isolation · Isolated DC-DC stages

**Not for:** One secondary → [`transformer`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/magnetics/transformer/) · Three-phase transformers → [`transformer3`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/magnetics/transformer3/)

## Model logic

- Each secondary is an ideal transformer whose primary sits across the shared core voltage, so the reflected loads add in parallel on the primary.
- rw1 and llk1 sit in front of the core voltage; rwk and llkk sit in series with winding k; zero leaves each one out.
- lm sits once across the core voltage and starts at im0, with rcore across it; without lm the core is ideal and passes DC.
- isat makes lm a two-slope knee (lmsat, or 0.2·lm, above it) by the previous accepted current.
- lk12, lk13, lk23 and lk14 are solved into the star's llk1 to llk4 with lm taken into account; lk24 and lk34 add a coupled inductor in series with winding 2 or 3 and winding 4, carved from their leakages.

## Model

Before the run the part is expanded into one ideal two-winding transformer per secondary. Their primary windings all sit across one core voltage, so winding k sees v1 / nk, with nk = N1 / Nk, and its current, referred to the primary, adds to the primary current. rw1 and llk1 sit in series between p1 and the core voltage and are shared by every secondary; rwk and llkk sit in series with winding k only. lm sits once across the core voltage, seen from the primary, and starts at im0. Winding 2 is always on (n2 defaults to 1); windings 3 and 4 are on only when n3 or n4 is set. rcore across the core voltage models core loss, and isat with lmsat saturates lm, as on Transformer.

## Common mistakes

- Each nk is N1 / Nk, primary turns over that winding's turns, so a 5 V output from a 100 V core voltage uses nk = 20.
- Connecting p3, n3, p4 or n4 without setting that winding's ratio is refused, and so is setting llk3, rw3, llk4 or rw4 without it. Each secondary needs its own path to ground or a reference, as with Transformer.
- The leakage of each winding is its own series inductance; the leakage between two secondaries is the sum of theirs. To use the leakages measured between pairs of windings, give lk12, lk13 and lk23 (and lk14 with winding 4 on) instead of llk1 to llk4; lk24 and lk34 add the two pairs with winding 4 that the star cannot hold. The two sets cannot be mixed, and a set no passive part can have is refused with the keys named.

Problems rules: `island.floating`, `param.out_of_range`

## Datasheet and sources

Each nk is the rated primary voltage over the rated voltage of winding k, or the ratio of turns. lm is the primary inductance measured with every secondary open. llk1 is the leakage measured on the primary with the secondaries shorted; with no split given, put it all in llk1. lk12, lk13 and lk14 are measured at the primary with that winding shorted and the others open, lk23 and lk24 at winding 2 and lk34 at winding 3 the same way. rw1 to rw4 are the DC resistances of the windings. rcore comes from the core loss at the operating point, isat from the core's saturation flux density, and lmsat from the inductance measured past it.

## Example

Open the example with the command `file.openExample` and the name `demo:multiTransformer`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
