Directquadraturezero transformation
The directquadraturezero (DQZ or DQ0^{[1]} or DQO,^{[2]} sometimes lowercase) transformation or zerodirectquadrature^{[3]} (0DQ or ODQ, sometimes lowercase) transformation is a tensor that rotates the reference frame of a threeelement vector or a threebythree element matrix in an effort to simplify analysis. The DQZ transform is the product of the Clarke transform and the Park transform, first proposed in 1929 by Robert H. Park.^{[4]}
The DQZ transform is often used in the context of electrical engineering with threephase circuits. The transform can be used to rotate the reference frames of ac waveforms such that they become dc signals. Simplified calculations can then be carried out on these dc quantities before performing the inverse transform to recover the actual threephase ac results, as an example, the DQZ transform is often used in order to simplify the analysis of threephase synchronous machines or to simplify calculations for the control of threephase inverters. In analysis of threephase synchronous machines the transformation transfers threephase stator and rotor quantities into a single rotating reference frame to eliminate the effect of timevarying inductances.
Contents
Introduction[edit]
The DQZ transform is made of the Park and Clarke transformation matrices, the Clarke transform (named after Edith Clarke) converts vectors in the ABC reference frame to the XYZ (often αβz) reference frame. The primary value of the Clarke transform is isolating that part of the ABCreferenced vector which is common to all three components of the vector; it isolates the commonmode component (i.e., the Z component). The powerinvariant, righthanded, uniformlyscaled Clarke transformation matrix is
 .
To convert an ABCreferenced column vector to the XYZ reference frame, the vector must be premultiplied by the Clarke transformation matrix:
 .
And, to convert back from an XYZreferenced column vector to the ABC reference frame, the vector must be premultiplied by the inverse Clarke transformation matrix:
 .
The Park transform (named after Robert H. Park) converts vectors in the XYZ reference frame to the DQZ reference frame. The primary value of the Park transform is to rotate the reference frame of a vector at an arbitrary frequency, the Park transform shifts the frequency spectrum of the signal such that the arbitrary frequency now appears as "dc" and the old dc appears as the negative of the arbitrary frequency. The Park transformation matrix is
 ,
where θ is the instantaneous angle of an arbitrary ω frequency. To convert an XYZreferenced vector to the DQZ reference frame, the column vector signal must be premultiplied by the Park transformation matrix:
 .
And, to convert back from a DQZreferenced vector to the XYZ reference frame, the column vector signal must be premultiplied by the inverse Park transformation matrix:
 .
The Clarke and Park transforms together form the DQZ transform:
The inverse transform is:
To convert an ABCreferenced vector to the DQZ reference frame, the column vector signal must be premultiplied by the DQZ transformation matrix:
 .
And, to convert back from a DQZreferenced vector to the ABC reference frame, the column vector signal must be premultiplied by the inverse DQZ transformation matrix:
 .
To really understand this transform better, a derivation of the transform is included.
Derivation[edit]
The Park transform derivation[edit]
The Park transform is based on the concept of the dot product and projections of vectors onto other vectors. First, let us imagine two unit vectors, and (the unit vectors, or axes, of the new reference frame from the perspective of the old reference frame), and a third, arbitrary, vector . We can define the two unit vectors and the arbitrary vector in terms of their Cartesian coordinates in the old reference frame:
 ,
where and are the unit basis vectors of the old coordinate system and is the angle between the and unit vectors (i.e., the angle between the two reference frames). The projection of the arbitrary vector onto each of the two new unit vectors implies the dot product:


 .
So, is the projection of onto the axis, and is the projection of onto the axis. These new vector components, and , together compose the new vector , the original vector in terms of the new DQ reference frame.
Notice that the positive angle above caused the arbitrary vector to rotate backwards when transitioned to the new DQ reference frame. In other words, its angle with respect to the new reference frame is less than its angle to the old reference frame, this is because the reference frame, not the vector, was rotated forwards. Actually, a forwards rotation of the reference frame is identical to a negative rotation of the vector.
The operation above can be summarized by a single matrix equation:
 .
This tensor can be expanded to threedimensional problems, where the axis about which rotation occurs is left unaffected; in the following example, the rotation is about the Z axis, but any axis could have been chosen:
 .
The Clarke transform derivation[edit]
The ABC unit basis vectors[edit]
Consider a threedimensional space with unit basis vectors A, B, and C, the sphere in the figure below is used to show the scale of the reference frame for context and the box is used to provide a rotational context.
Typically, in electrical engineering (or any other context that uses threephase systems), the threephase components are shown in a twodimensional perspective. However, given the three phases can change independently, they are by definition orthogonal to each other, this implies a threedimensional perspective, as shown in the figure above. So, the twodimensional perspective is really showing the projection of the threedimensional reality onto a plane.
Threephase problems are typically described as operating within this plane; in reality, the problem is likely a balancedphase problem (i.e., v_{A} + v_{B} + v_{C} = 0) and the net vector
is always on this plane.
The AYC' unit basis vectors[edit]
To build the Clarke transform, we actually use the Park transform in two steps. Our goal is to rotate the C axis into the corner of the box, this way the rotated C axis will be orthogonal to the plane of the twodimensional perspective mentioned above. The first step towards building the Clarke transform requires rotating the ABC reference frame about the A axis. So, this time, the 1 will be in the first element of the Park transform:
The following figure shows how the ABC reference frame is rotated to the AYC' reference frame when any vector is premultiplied by the K_{1} matrix. The C' and Y axes now point to the midpoints of the edges of the box, but the magnitude of the reference frame has not changed (i.e., the sphere did not grow or shrink).This is due to the fact that the norm of the K_{1} tensor is 1: K_{1} = 1. This means that any vector in the ABC reference frame will continue to have the same magnitude when rotated into the AYC' reference frame.
The XYZ unit basis vectors[edit]
Next, the following tensor rotates the vector about the new Y axis in a counterclockwise direction with respect to the Y axis (The angle was chosen so that the C' axis would be pointed towards the corner of the box.):
 ,
or
 .
Notice that the distance from the center of the sphere to the midpoint of the edge of the box is √2 but from the center of the sphere to the corner of the box is √3. That is where the 35.26° angle came from.
The norm of the K_{2} matrix is also 1, so it too does not change the magnitude of any vector premultiplied by the K_{2} matrix.
The zero plane[edit]
At this point, the Z axis is now orthogonal to the plane in which any ABC vector without a commonmode component can be found. Any balanced ABC vector waveform (a vector without a common mode) will travel about this plane, this plane will be called the zero plane and is shown below by the hexagonal outline.
The X and Y basis vectors are on the zero plane. Notice that the X axis is parallel to the projection of the A axis onto the zero plane, the X axis is slightly larger than the projection of the A axis onto the zero plane. It is larger by a factor of √3/2. The arbitrary vector did not change magnitude through this conversion from the ABC reference frame to the XYZ reference frame (i.e., the sphere did not change size). This is true for the powerinvariant form of the Clarke transform, the following figure shows the common twodimensional perspective of the ABC and XYZ reference frames.
It might seem odd that though the magnitude of the vector did not change, the magnitude of its components did (i.e., the X and Y components are longer than the A, B, and C components). Perhaps this can be intuitively understood by considering that for a vector without common mode, what took three values (A, B, and C components) to express, now only takes 2 (X and Y components) since the Z component is zero. Therefore, the X and Y component values must be larger to compensate.
Combination of tensors[edit]
The powerinvariant Clarke transformation matrix is a combination of the K_{1} and K_{2} tensors:
 ,
or

 .
Notice that when multiplied through, the bottom row of the K_{C} matrix is 1/√3, not 1/3. (It should be noted that Edith Clarke did use 1/3 for the powervariant case.) The Z component is not exactly the average of the A, B, and C components. If only the bottom row elements were changed to be 1/3, then the sphere would be squashed along the Z axis, this means that the Z component would not have the same scaling as the X and Y components.
As things are written above, the norm of the Clarke transformation matrix is still 1, which means that it only rotates an ABC vector but does not scale it, the same cannot be said for Clarke's original transform.
Powervariant form[edit]
It is sometimes desirable to scale the Clarke transformation matrix so that the X axis is the projection of the A axis onto the zero plane. To do this, we uniformly apply a scaling factor of √2/3 to get the powervariant Clarke transformation matrix:
or
 .
This will necessarily shrink the sphere by a factor of √2/3 as shown below. Notice that this new X axis is exactly the projection of the A axis onto the zero plane.
With the powervariant Clarke transform, the magnitude of the arbitrary vector is smaller in the XYZ reference frame than in the ABC reference frame (the norm of the transform is √2/3), but the magnitudes of the individual vector components are the same (when there is no common mode). So, as an example, a signal defined by
becomes, in the XYZ reference frame,
 ,
a new vector whose components are the same magnitude as the original components: 1. In many cases, this is an advantageous quality of the powervariant Clarke transform.
The DQZ transform[edit]
The DQZ transformation uses the Clarke transform to convert ABCreferenced vectors into two differentialmode components (i.e., X and Y) and one commonmode component (i.e., Z) and then applies the Park transform to rotate the reference frame about the Z axis at some given speed. The X component becomes the D component, which is in direct alignment with the vector of rotation, and the Y component becomes the Q component, which is at a quadrature angle to the direct component. The DQZ transform is

 .
Code implementation[edit]
For computational efficiency, it makes sense to keep the Clarke and Park transforms separate and not combine them into one transform.
A computationallyefficient implementation of the powerinvariant Clarke transform is
X = (2*A – B – C)*(1/sqrt(6));
Y = (B – C)*(1/sqrt(2));
Z = (A + B + C)*(1/sqrt(3));
while its inverse is
A = (1/sqrt(3))*Z;
B = A  (1/sqrt(6))*X;
C = B – (1/sqrt(2))*Y;
B += (1/sqrt(2))*Y;
A += (sqrt(2/3))*X;
A computationallyefficient implementation of the powervariant Clarke transform is
X = (2*A – B – C)*(1/3);
Y = (B – C)*(1/sqrt(3));
Z = (A + B + C)*(sqrt(2)/3);
while its inverse is
A = (1/sqrt(2))*Z;
B = A – (1/2)*X;
C = B – (sqrt(3)/2)*Y;
B += (sqrt(3)/2)*Y;
A += X;
Evidently, the constant coefficients could be precalculated.
A computationallyefficient implementation of the Park transform is
co = cos(theta);
si = sin(theta);
D = co*X + si*Y;
Q = co*Y  si*X;
while its inverse is
co = cos(theta);
si = sin(theta);
X = co*D  si*Q;
Y = si*D + co*Q;
Of course, it makes sense to only calculate co and si once if both the Park and inverse Park transforms are going to be used.
Example[edit]
In electric systems, very often the A, B, and C values are oscillating in such a way that the net vector is spinning. In a balanced system, the vector is spinning about the Z axis. Very often, it is helpful to rotate the reference frame such that the majority of the changes in the abc values, due to this spinning, are canceled out and any finer variations become more obvious.
The DQZ transformation can be thought of in geometric terms as the projection of the three separate sinusoidal phase quantities onto two axes rotating with the same angular velocity as the sinusoidal phase quantities.
Shown above is the DQZ transform as applied to the stator of a synchronous machine. There are three windings separated by 120 physical degrees, the three phase currents are equal in magnitude and are separated from one another by 120 electrical degrees. The three phase currents lag their corresponding phase voltages by . The DQ axes are shown rotating with angular velocity equal to , the same angular velocity as the phase voltages and currents. The D axis makes an angle with the phase A winding which has been chosen as the reference.The currents and are constant dc quantities.
Comparison with other transforms[edit]
Park's transformation[edit]
The transformation originally proposed by Park differs slightly from the one given above. Park's transformation is (qaxis is ahead of daxis, qd0):
and
Although useful, Park's transformation is not power invariant whereas the dqo transformation defined above is.^{[5]}^{:88} Park's transformation gives the same zero component as the method of symmetrical components, the dqo transform shown above gives a zero component which is larger than that of Park or symmetrical components by a factor of .
αβγ transform[edit]
The dqo transform is conceptually similar to the αβγ transform. Whereas the dqo transform is the projection of the phase quantities onto a rotating twoaxis reference frame, the αβγ transform can be thought of as the projection of the phase quantities onto a stationary twoaxis reference frame.
References[edit]
 Inline references
 ^ mathworks.com, 'abc to dq0, dq0 to abc', 2013. [Online]. Available: https://www.mathworks.com/help/physmod/sps/powersys/ref/abctodq0dq0toabc.html;jsessionid=f097857855b2d8d9318c5680594a. [Accessed: 11Dec2016].
 ^ theses.lib.vt.edu, 'Appendix A: Rotating (DQ) Transformation and Space Vector Modulation Basic Principles', [Online]. Available: https://theses.lib.vt.edu/theses/available/etd031899212402/unrestricted/APPENDIXES.PDF. [Accessed: 11Dec2016].
 ^ C. Kamalakannan and L. Padma Suresh, Eds., "Design and Analysis of Three Phase Four Wire," in Power Electronics and Renewable Energy Systems, NY: Springer India, 2015, p. 1029 [Online]. Available: https://books.google.com/books?id=EbSLBQAAQBAJ&pg=PA1029&lpg=PA1029&dq=%22zerodirectquadrature%22&source=bl&ots=HJLgB15oyl&sig=QDBYnrSUo3o_30LfF2h_xhabgJo&hl=en&sa=X&ved=0ahUKEwj7hO_4ezQAhVFiCwKHSgqCfAQ6AEIWDAK#v=onepage&q=%22zerodirectquadrature%22&f=false.
 ^ R.H. Park Two Reaction Theory of Synchronous Machines AIEE Transactions 48:716730 (1929).
 ^ P.M. Anderson and A.A. Fouad Power System Control and Stability IEEE Press (2003). ISBN 9788126518180
 General references
 J. Lewis Blackburn Symmetrical Components for Power Systems Engineering, Marcel Dekker, New York (1993). ISBN 0824787676
 Zhang et al. A threephase inverter with a neutral leg with space vector modulation IEEE APEC '97 Conference Proceedings (1997).
 T.A.Lipo, “A Cartesian Vector Approach To Reference Theory of AC Machines”, Int. Conference On Electric Machines, Laussane, Sept. 1824, 1984.