# Instantaneous Power (p, q) (`pq`)

> The instantaneous active and reactive power from the alpha-beta voltage and current.

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

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

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

## When to use it

Use it for power control of a grid inverter or an active rectifier, and to measure the power a drive draws. Use a `product` of voltage and current for a single phase.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `ealpha` | signal | Voltage alpha component input. |
| `ebeta` | signal | Voltage beta component input. |
| `ialpha` | signal | Current alpha component input. |
| `ibeta` | signal | Current beta component input. |
| `p` | signal | Active power output, k*(ealpha*ialpha + ebeta*ibeta). |
| `q` | signal | Reactive power output, k*(ebeta*ialpha - ealpha*ibeta); positive for a lagging current. |

## Common parameters

- `k`: Scale of p and q: 1.5 for amplitude-invariant αβ quantities (then p is the three-phase power), 1 for power-invariant ones (Default: 1.5)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `k` | — | 1.5 |  | Scale of p and q: 1.5 for amplitude-invariant αβ quantities (then p is the three-phase power), 1 for power-invariant ones |

_Parameter descriptions are in English in both languages._

## Model

The outputs are `p = k*(ealpha*ialpha + ebeta*ibeta)` and `q = k*(ebeta*ialpha - ealpha*ibeta)` (the instantaneous power theory of Akagi, Kanazawa and Nabae, 1984). With the amplitude-invariant `clarke` used by every block here `k` = 1.5 makes `p` the three-phase power. The block has direct feedthrough and no state; ripple on the inputs shows up on `p` and `q` at once.

## Common mistakes

- The sign of `q` depends on the convention: here a current that lags the voltage gives a positive `q` (an inductive load absorbs reactive power). Some texts use the opposite sign; check it against a known inductive load before closing a loop on it.
- Use `k` = 1 only with power-invariant (sqrt(2/3)) alpha-beta quantities. With the amplitude-invariant ones of `clarke` and `k` = 1 the power reads two thirds of the real value.

## Datasheet and sources

There is no datasheet. Feed it the voltage and current through `clarke` blocks from the meters at the point of connection.

## Example

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

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