# Gear (`gear`)

> An ideal gear that links two shafts with a speed ratio and an optional loss.

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

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

**Group:** Mechanical · **Kind:** `{"element":"gear","kind":"mechanical"}`

## When to use it

Use it to couple a motor to a load at a different speed. It does not model elasticity or backlash.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `a` | mechanical | Side a, usually the motor. Speed is n times b |
| `b` | mechanical | Side b, usually the load. Torque is n times a |

## Common parameters

- `n`: Speed ratio between the two shafts (Default: 1)
- `eff`: Share of power that gets through (Default: 1)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `n` | — | 1 |  | Speed ratio between the two shafts |
| `eff` | — | 1 |  | Share of power that gets through |

_Parameter descriptions are in English in both languages._

## Model

The gear is ideal, with ωa = n·ωb and Tb = n·Ta, so the power is passed on. A load inertia J on side b acts as J/n² on side a. For eff below 1, a loss torque (1 - eff)·abs(Ta) acts on side a and opposes its rotation. It fades linearly to zero below 0.1 rad/s and uses the torque of the last accepted step. The shaft is rigid, and there is no backlash.

## Common mistakes

- The ratio is the speed at a divided by the speed at b, so a reduction gear with the motor on a needs n above 1. With the motor on b the same gear speeds the load up.
- Put the two sides on different shaft nets, with different net names for a and b. If both pins share one net and n is not 1, that net is forced to zero speed.
- eff must be above 0 and at most 1, or the run is refused. The loss acts on side a, so an efficiency measured at the load side differs a little at partial load.

Problems rules: `compile.error`

## Datasheet and sources

n is the gear ratio from the nameplate, the input speed divided by the output speed. eff is the gearbox efficiency at the working torque, and the gearbox inertia is added as an Inertia part on the side where it sits.

## Example

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

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