> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/control-and-measurements/transformations/abc-to-dq0-dq0-to-abc.md).

# abc to dq0, dq0 to abc

## Description

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-482c008161502e3e8211cbc52785390cd0cf21cb%2Fabctodq0_block.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-f853b789fdafce35743925b91987aa77ea39bcaf%2Fdq0toabc_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **abc to dq0** and **dq0 to abc** blocks, located in the **OPAL-RT SPS Software/Control** library, perform transformation from three-phase (abc) signal to dq0 rotating reference frame or the inverse.

The **abc to dq0** block uses a Park transformation to transform a three-phase (abc) signal to a dq0 rotating reference frame. The angular position of the rotating frame is given by the input wt, in rad.

The **dq0 to abc** block uses an inverse Park transformation to transform a dq0 rotating reference frame to a three-phase (abc) signal. The angular position of the rotating frame is given by the input wt, in rad.

When the rotating frame alignment at wt=0 is 90 degrees behind the phase A axis, a positive-sequence signal with Mag=1 and Phase=0 degrees yields the following dq values: d=1, q=0.

$$
V\_{d}
======

\frac{2}{3}
\left(
V\_{a}\sin(\omega t)
\+
V\_{b}\sin!\left(\omega t - \frac{2\pi}{3}\right)
\+
V\_{c}\sin!\left(\omega t + \frac{2\pi}{3}\right)
\right)
\\\[8pt]

# V\_{q}

\frac{2}{3}
\left(
V\_{a}\cos(\omega t)
\+
V\_{b}\cos!\left(\omega t - \frac{2\pi}{3}\right)
\+
V\_{c}\cos!\left(\omega t + \frac{2\pi}{3}\right)
\right)
\\\[8pt]
V\_{0}
======

\frac{1}{3}(V\_{a} + V\_{b} + V\_{c})
\\\[8pt]
$$

$$
V\_{a}
======

V\_{d}\sin(\omega t)
\+
V\_{q}\cos(\omega t)
\+
V\_{0}
\\\[8pt]

# V\_{b}

V\_{d}\sin!\left(\omega t - \frac{2\pi}{3}\right)
\+
V\_{q}\cos!\left(\omega t - \frac{2\pi}{3}\right)
\+
V\_{0}
\\\[8pt]

# V\_{c}

V\_{d}\sin!\left(\omega t + \frac{2\pi}{3}\right)
\+
V\_{q}\cos!\left(\omega t + \frac{2\pi}{3}\right)
\+
V\_{0}
\\\[8pt]
$$

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-86bfd0a1c866019342fe886b7ec04bfa8f22c897%2Fabc_dq0_vector.png?alt=media" alt="" width="483"><figcaption></figcaption></figure>

The block supports the two conventions used for the Park transformation:

* When the rotating frame is aligned with the phase A axis at t = 0, that is, at t = 0, the *d*-axis is aligned with the *a*-axis. This type of Park transformation is also known as the cosine-based Park transformation.
* When the rotating frame is aligned 90 degrees behind the phase A axis, that is, at t = 0, the *q*-axis is aligned with the *a*-axis. This type of Park transformation is also known as the sine-based Park transformation. Use this transformation in SPS Software models with three-phase synchronous and asynchronous machines.

Deduce the dq0 components from the abc signals by performing an abc to αβ0 Clarke transformation in a fixed reference frame. Then perform an αβ0 to dq0 transformation in a rotating reference frame, that is, by performing a −(ω.t) rotation on the space vector Us = u<sub>α</sub> + j· u<sub>β</sub>.

The abc-to-dq0 transformation depends on the dq frame alignment at t = 0. The position of the rotating frame is given by ω.t, where ω represents the dq frame rotation speed.

When the rotating frame is aligned with the phase A axis, the following relations are obtained:

$$
U\_{s}
======

# u\_{d} + j \cdot u\_{q}

# (u\_{a} + j \cdot u\_{q}) \cdot e^{-j \omega t}

\frac{2}{3}
\left(
u\_{a}
\+
u\_{b} \cdot e^{-\frac{j 2\pi}{3}}
\+
u\_{c} \cdot e^{\frac{j 2\pi}{3}}
\right)
\cdot e^{-j \omega t}
\\\[8pt]

# u\_{0}

\frac{1}{3}(u\_{a} + u\_{b} + u\_{c})
\\\[8pt]

\begin{bmatrix}
u\_{d} \\
u\_{q} \\
u\_{0}
\end{bmatrix}
=============

\frac{2}{3}
\begin{bmatrix}
\cos(\omega t) &
\cos!\left(\omega t - \frac{2\pi}{3}\right) &
\cos!\left(\omega t + \frac{2\pi}{3}\right)
\\
-\sin(\omega t) &
-\sin!\left(\omega t - \frac{2\pi}{3}\right) &
-\sin!\left(\omega t + \frac{2\pi}{3}\right)
\\
\frac{1}{2} & \frac{1}{2} & \frac{1}{2}
\end{bmatrix}
\begin{bmatrix}
u\_{a} \\
u\_{b} \\
u\_{c}
\end{bmatrix}
\\\[8pt]
$$

The inverse transformation is given by:

$$
\begin{bmatrix}
u\_{a} \\
u\_{b} \\
u\_{c}
\end{bmatrix}
=============

\begin{bmatrix}
\cos(\omega t) & -\sin(\omega t) & 1 \\
\cos!\left(\omega t - \frac{2\pi}{3}\right) &
-\sin!\left(\omega t - \frac{2\pi}{3}\right) &
1 \\
\cos!\left(\omega t + \frac{2\pi}{3}\right) &
-\sin!\left(\omega t + \frac{2\pi}{3}\right) &
1
\end{bmatrix}
\begin{bmatrix}
u\_{d} \\
u\_{q} \\
u\_{0}
\end{bmatrix}
\\\[8pt]
$$

When the rotating frame is aligned 90 degrees behind the phase A axis, the following relations are obtained:

$$
U\_{s}
======

# u\_{d} + j \cdot u\_{q}

(u\_{\alpha} + j \cdot u\_{\beta})
\cdot e^{-j\left(\omega t - \frac{\pi}{2}\right)}
\\\[8pt]

\begin{bmatrix}
u\_{d} \\
u\_{q} \\
u\_{0}
\end{bmatrix}
=============

\frac{2}{3}
\begin{bmatrix}
\sin(\omega t) &
\sin!\left(\omega t - \frac{2\pi}{3}\right) &
\sin!\left(\omega t + \frac{2\pi}{3}\right)
\\
\cos(\omega t) &
\cos!\left(\omega t - \frac{2\pi}{3}\right) &
\cos!\left(\omega t + \frac{2\pi}{3}\right)
\\
\frac{1}{2} & \frac{1}{2} & \frac{1}{2}
\end{bmatrix}
\begin{bmatrix}
u\_{a} \\
u\_{b} \\
u\_{c}
\end{bmatrix}
\\\[8pt]
$$

The inverse transformation is given by:

$$
\begin{bmatrix}
u\_{\alpha} \\
u\_{\beta} \\
u\_{0}
\end{bmatrix}
=============

\begin{bmatrix}
\sin(\omega t) & \cos(\omega t) & 1 \\
\sin!\left(\omega t - \frac{2\pi}{3}\right) &
\cos!\left(\omega t - \frac{2\pi}{3}\right) &
1 \\
\sin!\left(\omega t + \frac{2\pi}{3}\right) &
\cos!\left(\omega t + \frac{2\pi}{3}\right) &
1
\end{bmatrix}
\begin{bmatrix}
u\_{d} \\
u\_{q} \\
u\_{0}
\end{bmatrix}
\\\[8pt]
$$

## Ports

### Input

<table data-header-hidden><thead><tr><th width="249.7777099609375"></th><th></th></tr></thead><tbody><tr><td><strong>abc</strong> — abc signal<br>Vector</td><td>abc signal, specified as a vector.</td></tr><tr><td><strong>dq0</strong> — dq0 signal<br>Vector</td><td>dq0 signal, specified as a vector.</td></tr><tr><td><strong>wt</strong> — Angular position of dq rotating frame<br>Positive scalar</td><td>Angular position of the dq rotating frame, in radians, specified as a positive scalar.</td></tr></tbody></table>

### Output

<table data-header-hidden><thead><tr><th width="250.22222900390625"></th><th></th></tr></thead><tbody><tr><td><strong>dq0</strong> — dq0 signal<br>Vector</td><td>dq0 signal, returned as a vector.</td></tr><tr><td><strong>abc</strong> — abc signal<br>Vector</td><td>abc signal, returned as a vector.</td></tr></tbody></table>

## Parameters

<table data-header-hidden><thead><tr><th width="249.66668701171875"></th><th></th></tr></thead><tbody><tr><td><strong>Rotating frame alignment at wt=0</strong> — Alignment of rotating frame<br>90 degrees behind phase A axis (default) | Aligned with phase A axis</td><td><p>Alignment of the rotating frame at t = 0 of the dq0 components of a three-phase balanced signal:</p><p><span class="math">\\[8pt]u_{a} = \sin(\omega t) \\[8pt] u_{b} = \sin\!\left(\omega t - \frac{2\pi}{3}\right) \\[8pt] u_{c} = \sin\!\left(\omega t + \frac{2\pi}{3}\right) \\[8pt]</span></p><p>The positive-sequence magnitude equals 1.0 pu, and the phase angle equals 0 degrees.</p><p>When you select Aligned with phase A axis, the dq0 components are d = 0, q = −1, and zero = 0.</p><p>When you select 90 degrees behind phase A axis, the dq0 components are d = 1, q = 0, and zero = 0.</p></td></tr></tbody></table>

## Examples

Perform Clarke and Park Transformations : The power\_Transformations example shows various ways to use blocks to perform Clarke and Park transformations.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/control-and-measurements/transformations/abc-to-dq0-dq0-to-abc.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
