# DC Machine (`dc`)

> A DC motor with separate armature and field windings.

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

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

**Group:** Machines · **Kind:** `{"kind":"machine","model":"dc"}`

## When to use it

Use it when you need field control, field weakening, or a shunt or series connection. Use PM DC Machine when magnets make the field.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `ap` | electrical | Armature positive, current in gives positive torque |
| `an` | electrical | Armature negative terminal |
| `fp` | electrical | Field positive, current in makes a positive field |
| `fn` | electrical | Field negative terminal |
| `shaft` | mechanical | Mechanical shaft, speed in rad/s |

## Common parameters

- `ra`: Resistance of the armature winding (Default: 0.5)
- `la`: Inductance of the armature winding (Default: 5m)
- `laf`: Field-armature coupling; illustrative default (Default: 1)
- `rf`: Resistance of the field winding (Default: 100)
- `j`: How strongly the rotor resists speeding up (Default: 0.01)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `ra` | Ω | 0.5 |  | Resistance of the armature winding |
| `la` | H | 5m |  | Inductance of the armature winding |
| `rf` | Ω | 100 |  | Resistance of the field winding |
| `lf` | H | 1 |  | Inductance of the field winding |
| `laf` | H | 1 |  | Field-armature coupling; illustrative default |
| `j` | kg·m² | 0.01 |  | How strongly the rotor resists speeding up |
| `b` | N·m·s/rad | 0 |  | Friction that grows with speed |
| `w0` | rad/s | 0 |  | Shaft speed at the start |

_Parameter descriptions are in English in both languages._

## Model

The equations are va = ra·ia + la·dia/dt + laf·if·ωm, vf = rf·if + lf·dif/dt and Te = laf·if·ia, so laf·if acts as the flux constant ke. Armature reaction, brush drop, commutation and field saturation are not modelled. The results are i(M1.a) for the armature, i(M1.f) for the field, wm(M1) and Te(M1).

## Common mistakes

- Without field current the machine makes no torque and no back-EMF. Supply the field through fp and fn and let it settle, because the default field time constant is 10 ms.
- Full voltage at standstill draws the stall current, which is the voltage divided by ra and far above the rated current. Limit it with a chopper current loop.
- The rotor inertia j is already on the shaft, so adding it again as an Inertia part counts it twice. Reversing the field polarity reverses the torque and the back-EMF.

Problems rules: `pin.unconnected`

## Datasheet and sources

Take ra and la from the armature winding and rf and lf from the field winding. Get laf by dividing the rated back-EMF constant (in V·s/rad at the rated field current) by that field current, and take j from the datasheet.

## Example

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

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