The dq (Park) Transformation for Inverter Control
If you open up the control code of almost any grid-connected inverter, you will find it does its real work not on the three AC phase currents you measure, but on two DC-like quantities called d and q. Getting from one to the other is the job of the dq transformation, and it is the single most important mathematical idea in modern power-electronic control.
The payoff is enormous: it turns a set of three time-varying sinusoids into two constants you can regulate with ordinary PI controllers, the same way you would control a DC motor. This post builds the dq transformation from the ground up, Clarke then Park, shows exactly why the AC becomes DC, explains how d and q map onto active and reactive current, and works a concrete example with the actual matrices so the result is something you can compute, not just nod along to.
Why Controlling AC Directly Is Hard
Imagine trying to regulate a 50 or 60 Hz current with a PI controller acting on the instantaneous phase value. The reference is a moving sinusoid, so the controller is always chasing a target that never sits still. A PI controller has finite gain at any nonzero frequency, so it leaves a steady phase and amplitude error, and it has to track three of these signals at once, one per phase.
The trick that makes inverter control tractable is to stop watching the waveform from the outside and instead ride along with it. If you sit in a reference frame that spins at the same electrical frequency as the grid, a balanced sinusoid stops looking like a wave and starts looking like a stationary point. A constant. And constants are exactly what PI controllers handle perfectly, with zero steady-state error. That change of viewpoint is the dq transformation.
Step One: The Clarke Transform (abc to alpha-beta)
The dq transformation is done in two stages. The first, the Clarke transform, collapses the three phase quantities (which are not independent, they sum to zero in a balanced system) into two orthogonal components on a stationary plane, usually called alpha and beta:
\[ \begin{bmatrix} v_\alpha \\ v_\beta \end{bmatrix} = \frac{2}{3} \begin{bmatrix} 1 & -\tfrac{1}{2} & -\tfrac{1}{2} \\ 0 & \tfrac{\sqrt{3}}{2} & -\tfrac{\sqrt{3}}{2} \end{bmatrix} \begin{bmatrix} v_a \\ v_b \\ v_c \end{bmatrix} \]
That \( \tfrac{2}{3} \) scaling is a real choice with consequences. With \( \tfrac{2}{3} \) (the amplitude-invariant convention), the alpha-beta and dq magnitudes equal the per-phase peak amplitude, which is convenient because a measured value matches the controlled value. The alternative, \( \sqrt{\tfrac{2}{3}} \), is the power-invariant convention: the transform becomes orthonormal so power is computed without an extra factor, but the dq magnitudes are then \( \sqrt{3/2} \) larger than the phase peak. Most drive and inverter control uses amplitude-invariant scaling. Pick one and state it, because the rest of your gains depend on it.
Step Two: The Park Transform (alpha-beta to dq)
The alpha-beta components still rotate, they trace a circle at grid frequency. The Park transform rotates the axes by the grid angle \( \theta \) so they spin along with that vector, freezing it:
\[ \begin{bmatrix} v_d \\ v_q \end{bmatrix} = \begin{bmatrix} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{bmatrix} \begin{bmatrix} v_\alpha \\ v_\beta \end{bmatrix} \]
Combine the two and you get the direct abc-to-dq form that lives in real controllers:
\[ \begin{bmatrix} v_d \\ v_q \end{bmatrix} = \frac{2}{3} \begin{bmatrix} \cos\theta & \cos(\theta – \tfrac{2\pi}{3}) & \cos(\theta + \tfrac{2\pi}{3}) \\ -\sin\theta & -\sin(\theta – \tfrac{2\pi}{3}) & -\sin(\theta + \tfrac{2\pi}{3}) \end{bmatrix} \begin{bmatrix} v_a \\ v_b \\ v_c \end{bmatrix} \]
The angle \( \theta \) is the whole game, and it is not free: it has to track the grid. That is the job of the phase-locked loop, which is why a PLL sits in front of every grid-following control scheme. The sign of the \( q \) row, and therefore which rotation direction is positive, is a convention that varies between textbooks, so always check it against your own derivation before trusting a sign.
A Worked dq Transformation
Take a balanced, unity-amplitude voltage with the d-axis aligned to phase a at \( t = 0 \):
\[ v_a = \cos\theta, \quad v_b = \cos(\theta – \tfrac{2\pi}{3}), \quad v_c = \cos(\theta + \tfrac{2\pi}{3}) \]
Substitute into the combined matrix. The d-axis row is a sum of products of cosines that, using the identity \( \cos x \cos y = \tfrac{1}{2}[\cos(x-y) + \cos(x+y)] \), collapses neatly:
\[ v_d = \frac{2}{3} \cdot \frac{3}{2} = 1, \qquad v_q = 0 \]
The two double-frequency terms cancel across the three phases, leaving pure DC. That is the entire point: a balanced sinusoidal set of peak amplitude 1 becomes \( v_d = 1 \), \( v_q = 0 \), flat lines. The chart shows the three phase voltages sweeping through a cycle while d sits at 1 and q sits at 0. Any controller now sees constants.
What d and q Actually Mean
The dq transformation is not just a math convenience, the two axes carry physical meaning once you align the frame with the grid voltage. With the d-axis locked to the voltage vector, so that \( v_d = V \) and \( v_q = 0 \), the instantaneous power (amplitude-invariant scaling) becomes:
\[ P = \frac{3}{2} v_d i_d, \qquad Q = -\frac{3}{2} v_d i_q \]
This is the result that makes everything click. The d-axis current \( i_d \) sets active power; the q-axis current \( i_q \) sets reactive power. They are now independent knobs. Want to inject 0.2 pu more real power and absorb some reactive? Command \( i_d \) and \( i_q \) separately and let two simple PI loops do the rest. The vector picture is the cleanest way to hold this: the voltage points along d, the current vector’s projection on d is the active part and its projection on q is the reactive part. Mind the sign of \( Q \), it flips with the q-axis convention you chose earlier.
Where the dq Transformation Struggles: Unbalance
The clean DC result depends on a balanced set. The real grid is not always balanced, and unbalance is where the dq transformation shows its limits. An unbalanced three-phase set contains a negative-sequence component that rotates the opposite way to your frame. Seen from a frame spinning at \( +\omega \), that negative-sequence part appears at \( -\omega \) relative to you, which is \( 2\omega \) apart, so it shows up as a double-frequency (100 or 120 Hz) ripple riding on top of the DC.
That ripple is not cosmetic. It propagates into the active and reactive power and onto the DC link, and if a current loop tries to follow it, it injects distorted current. The second chart shows this: under unbalance, d and q are no longer flat but oscillate at twice grid frequency. The standard fixes are to separate the sequences (a double or decoupled synchronous reference frame, one spinning each way) or to notch out the \( 2\omega \) component, and they all start from understanding why the ripple is there in the first place. This is also the seam where naive dq control meets the harder world of real grids.
Conclusion
The dq transformation is one of those ideas that looks like abstract matrix algebra until the moment it clicks, and then you cannot unsee it. Every grid-following current loop, every grid-forming voltage loop, every PLL is written in this frame, because it is the frame where the control problem becomes easy: regulate two DC numbers instead of chasing three moving waves.
If you remember one thing, make it the physical meaning. Align d with the voltage and you have split the converter’s job into active power on one axis and reactive power on the other, controllable independently. Everything else in inverter control, the current loops, the decoupling, the droop and the PLL, is built on top of that single, elegant change of viewpoint. The rest of this control series assumes it, so it is worth getting comfortable here.
Key takeaways
- The dq transformation moves control into a frame spinning with the grid, turning balanced AC sinusoids into DC constants a PI controller can hold with zero steady-state error.
- It is two stages: Clarke (abc to stationary alpha-beta) then Park (rotate by the grid angle to dq).
- Scaling matters: 2/3 is amplitude-invariant (dq equals phase peak); the square root of 2/3 is power-invariant. State which you use.
- With the d-axis aligned to the voltage, id sets active power and iq sets reactive power as independent knobs (P = 1.5 vd id, Q = -1.5 vd iq).
- The grid angle for the Park transform comes from a PLL, which is why a PLL sits in front of grid-following control.
- Unbalance injects a double-frequency (2 omega) ripple into dq, handled by sequence separation or notch filtering.
Frequently Asked Questions
What is the dq transformation used for?
It converts three-phase AC quantities into two DC-like components, d and q, in a reference frame that rotates with the grid. This lets ordinary PI controllers regulate currents and voltages with zero steady-state error, which is why it underpins almost all grid-connected inverter and motor-drive control.
What is the difference between the Clarke and Park transforms?
The Clarke transform maps the three phases (abc) onto two stationary orthogonal axes (alpha-beta). The Park transform then rotates those axes by the grid angle so they spin with the voltage vector, producing the dq components. Together they form the abc-to-dq transformation.
Why do d and q become DC values?
Because the dq frame rotates at the same electrical frequency as a balanced three-phase set. Riding along with the rotating vector, it appears stationary, so its projections onto the d and q axes are constant. The double-frequency cross terms from the three phases cancel, leaving pure DC.
How do d and q relate to active and reactive power?
When the d-axis is aligned with the grid voltage (vd = V, vq = 0), active power is P = 1.5 vd id and reactive power is Q = -1.5 vd iq with amplitude-invariant scaling. So the d-axis current controls active power and the q-axis current controls reactive power, independently.
Related reading
- Inside a grid-following inverter: the control loops
- Inside a grid-forming inverter: droop, VSM and power synchronization
- How to design and tune a power-electronic control loop
- SRF-PLL design: synchronizing an inverter to the grid
- Electrical Engineering Formula Cheat Sheet (power systems quick reference)
References
- R. H. Park (1929) – Two-reaction theory of synchronous machines (original Park transform)
- MathWorks – Park Transform (abc to dq0) reference, with both scaling conventions
- Teodorescu, Liserre & Rodriguez – Grid Converters (Clarke/Park slides, Ch. 2)
- Direct-quadrature-zero transformation (open reference)