# Step Source (`step`)

> Changes once from a before value to an after value at time t0.

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

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

**Group:** Control · **Kind:** `{"block":"step","kind":"control"}`

## When to use it

Use it for a reference change, a load switch-on or an enable signal at a known time. Use Constant for a value that never changes.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `out` | signal | before until t0, after from t0 on |

## Common parameters

- `t0`: Step time (Default: 0)
- `before`: Output before the step (Default: 0)
- `after`: Output after the step (Default: 1)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `t0` | s | 0 |  | Step time |
| `before` | — | 0 |  | Output before the step |
| `after` | — | 1 |  | Output after the step |

_Parameter descriptions are in English in both languages._

## Model

The output is before for t < t0 and after for t >= t0. The solver lands a step exactly on t0, so the edge is not smeared. The defaults are t0 = 0, before = 0 and after = 1, and the values can be negative or in any unit the loop carries.

## Common mistakes

- A step in a reference makes a controller output jump at once. If the jump is larger than the limits of the loop, the controller saturates, so lower after or ramp it through an Integrator.
- The defaults 0 and 1 suit a logic enable, not a speed reference, so set before and after in the unit of the loop. For a PWM duty keep both between 0 and 1, and keep t0 inside the run time.

Problems rules: `control.saturated`, `duty.out_of_range`

## Datasheet and sources

No datasheet applies. The value of t0 is the time of your test event after start-up has settled, and before and after are the references you test, for example 0 and 100 rad/s.

## Example

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

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