\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{amsmath}
\usepackage{matlab-prettifier}
\usepackage{float}
\usepackage[paperheight=11in,
   paperwidth=8.5in,
   top=0.5in,
   bottom=.5in,
   left=.5in,
   right=.5in]{geometry}

\title{EENG 577 M3 Synchronous Generator}
\author{E. Hildenbrandt \\ D. Davis  \\ J. Brownlee}

\date{31 January 2025}
\begin{document}
\maketitle

\section*{PART 1}
\subsection*{1.1)}
\begin{figure}[h]
    \centering
    \includegraphics[width=0.49\linewidth]{schematic.PNG}
    \includegraphics[width=0.49\linewidth]{4-pole-dqf.png}
    \title{Figure 1: Winding schematic diagram and Cross-section of generator, not to scale. }
\end{figure}

\subsection*{1.2)}
We will use the Park Transform to remove the desired sinusoidal effects and simplify analysis by converting ABC into dd (direct), qq (quadrature), and oo (zero sequence). The machine parameters in the Park Transform world are as follows.
\begin{align*}
    & L_{dd} = L_{sa} + L_{ma} + \frac{3}{2}L_{sv} = 0.0028 [H] \\
    & L_{qq} = L_{sa} + L_{ma} - \frac{3}{2}L_{sv} = 0.0027 [H] \\
    & L_{oo} = L_{sa} - 2L_{ma} = 3.5\cdot10^{-4} [H]
\end{align*}
% -------------------------------------------------------------------------------------------
The steady state model uses resistance and inductance parameters on the stator winding, rotor winding, field winding, and the damping circuits. The parameters are well known and given as values. The following section derives the general form of the SS model, $\mathbf{\dot{X}} = A\cdot\mathbf{X} + B\cdot\mathbf{U}$ where A corresponds to the current state of the generator and B corresponds with the external inputs. \\
\begin{align*}
& V = 
\begin{bmatrix}
    v_d \\
    v_q \\
    v_o \\
    v_f \\
    v_{kd1} = 0 \\
    v_{kq1} = 0 \\
    v_{kd2} = 0 \\
    v_{kq2} = 0
\end{bmatrix}, 
\mathbf{\dot{I}}= 
\begin{bmatrix}
    i_d \\
    i_q \\
    i_o \\
    i_f \\
    i_{kd1} \\
    i_{kq1} \\
    i_{kd2} \\
    i_{kq2}
\end{bmatrix}, \space \space \space \space
I =
\begin{bmatrix}
    i_d \\
    i_q \\
    i_o \\
    i_f \\
    i_{kd1} \\
    i_{kq1} \\
    i_{kd2} \\
    i_{kq2}
\end{bmatrix}\\\\
% -------------------------------------------------------------------------------------------
& R_{ss} = \begin{bmatrix}
    r_s & 0 & 0 \\
    0 & r_s & 0\\
    0 & 0 & r_s
\end{bmatrix}
& R_{rr} = 
\begin{bmatrix}
    r_f & 0 & 0 & 0 & 0 \\
    0 & r_{kd1} & 0 & 0 & 0 \\
    0 & 0 & r_{kq1} & 0 & 0 \\
    0 & 0 & 0 & r_{kd2} & 0 \\
    0 & 0 & 0 & 0 & r_{kq2} \\
\end{bmatrix} \\\\
% -------------------------------------------------------------------------------------------
& L_{ss1} =
\begin{bmatrix}
    0 & -L_{qq} & 0 \\
    L_{dd} & 0 & 0 \\
    0 & 0 & 0 
\end{bmatrix}
& L_{ss2} =
\begin{bmatrix}
    0 & 0 & L_{akqm1} & 0 & -L_{akqm2} \\
    L_{afm} & L_{akdm1} & 0 & L_{adkm2} & 0 \\
    0 & 0 & 0 & 0 & 0 
\end{bmatrix} \\\\
% -------------------------------------------------------------------------------------------
& L_{ss3} =
\begin{bmatrix}
    L_{dd} & 0 & 0 \\
    0 & L_{qq} & 0 \\
    0 & 0 & L_{oo} 
\end{bmatrix} 
& L_{ss4} =
\begin{bmatrix}
    L_{afm} & L_{akdm1} & 0 & L_{adkm2} & 0 \\
    0 & 0 & L_{akqm1} & 0 & L_{akqm2} \\
    0 & 0 & 0 & 0 & 0 
\end{bmatrix}\\\\
% -------------------------------------------------------------------------------------------
& L_{ss5} = \frac{3}{2}L_{ss4}^T
& L_{rr} =  
\begin{bmatrix}
    L_{ff} & L_{fkd1} & 0 & L_{fkd2} & 0 \\
    L_{kd1f} & L_{kd1kd1} & 0 & L_{kd1kd2} & 0 \\
    0 & 0 & L_{kd2kd2} & 0 & L_{kq1kq2} \\
    L_{kd2f} & L_{kd2kd1} & 0 & L_{kq1kq1} & 0 \\
    0 & 0 & L_{kq2kq1} & 0 & L_{kq2kq2} \\
\end{bmatrix}
\end{align*}\\
% -------------------------------------------------------------------------------------------
The resistance and inductance matrices can be defined by substituting the above matrices. This will give resistance matrix R and inductance matrices L1 and L2.
\begin{align*}
    & R = \begin{bmatrix}
        R_{ss} & 0\\
        0 & R_{rr}
    \end{bmatrix} 
    && L_1 = 
    \begin{bmatrix}
        L_{ss1} & L_{ss2} \\
        0 & 0
    \end{bmatrix}
    &&& L_2 = 
    \begin{bmatrix}
        L_{ss3} & L_{ss4} \\
        L_{ss5} & L_{rr}
    \end{bmatrix}
\end{align*}\\
% -------------------------------------------------------------------------------------------
Here we can define the voltage relation $V = RI + \frac{d}{dt}\Lambda = RI + \frac{d}{dt}(LI)$ where the inductance relationships are independent of time using the Park transformation. We can solve for $\dot{\mathbf{I}}$ by rearranging equation (1) which gives equation (2) where terms A and B are given in equation (3). The expanded SS equations with values are given below.
\begin{equation}
    V = RI + \omega L_1I + L_2\dot{I}
\end{equation}
\begin{equation}
    \dot{I} = -L_2^{-1}(R+wL_1)I + L_2^{-1}V = AI + BV
\end{equation}
% is this supposed to be R+jwL instead of R+wL? because it is a phasor
% matrix math, not phasors , sigma = w*t
\begin{align}
    & A = -L_2^{-1}(R+wL_1) &&     B = L_1^{-1}
\end{align}
% -------------------------------------------------------------------------------------------
\begin{align*}
\tiny
\begin{bmatrix}
    \dot{i_d} \\
    \dot{i_q} \\
    \dot{i_o} \\
    \dot{i_f} \\
    \dot{i_{kd1}} \\
    \dot{i_{kd2}} \\
    \dot{i_{kq1}} \\
    \dot{i_{kq2}}
\end{bmatrix} = 
\tiny \begin{bmatrix}
-647.5862&	596.9233&	0&	0.0053&	0.5029&	149.5098&	11.3920&	84.3503\\
-362.3242&	-372.2046&	0&	-3.3475e+03&	-57.3306&	0.0833&	-101.3225&	18.8945\\
0&	0&	-520.0847&	0&	0&	0&	0&	0\\
-1.8003&	1.6595&	0&	-2.3584&	0.0168&	0.4156&	11.1249&	0.2345\\
922.0367&	-849.9026&	0&	1.7373&	-3.8468&	-212.8728&	105.1943&	-120.0984\\
548.4617&	563.4180&	0&	5.0672e+03&	86.7832&	-0.6577&	153.3751&	58.5838\\
1.7364e+03&	-1.6005e+03&	0&	76.9090&	-0.6225&	-400.8760&	-477.9227&	-226.1658\\
855.8833&	879.2228&	0&	7.9075e+03&	135.4265&	0.4220&	239.3443&	-272.6299
\end{bmatrix}
\begin{bmatrix}
    i_d \\
    i_q \\
    i_o \\
    i_f \\
    i_{kd1} \\
    i_{kd2} \\
    i_{kq1} \\
    i_{kq2}
\end{bmatrix} + \\
\tiny\begin{bmatrix}
1.1838e+03&	0&	0&	-0.0612&	-3.1832e+03&	0&	-876.3064&	0\\
0&	680.4195&	0&	0&	0&	-678.5433&	0&	-1.0859e+03\\
0&	0&	950.7560&	0&	0&	0&	0&	0\\
3.2911&	0&	0&	27.4228&	-106.0903&	0&	-855.7616&	0\\
-1.6856e+03&	0&	0&	-20.2014&	2.4347e+04&	0&	-8.0919e+03&	0\\
0&	-1.0300e+03&	0&	0&	0&	5.3602e+03&	0&	-3.3669e+03\\
-3.1742e+03&	0&	0&	-894.2911&	3.9399e+03&	0&	3.6763e+04&	0\\
0&	-1.6073e+03&	0&	0&	0&	-3.4393e+03&	0&	1.5668e+04
\end{bmatrix}
\begin{bmatrix}
    v_d \\
    v_q \\
    v_o \\
    v_f \\
    0 \\
    0 \\
    0 \\
    0
\end{bmatrix}
\end{align*}
% -------------------------------------------------------------------------------------------
\newpage
\section*{PART 2}
\subsection*{2.1)}
The steady state currents can be calculated form the given information as follows. 
\begin{equation*}
    I_a = \frac{S}{3\cdot |V_a|}\angle \cos ^{-1}(pf) = \frac{659MVA}{3\cdot |\frac{20kV}{\sqrt{3}}|}\angle \cos ^{-1}(0.9) = 19023.7\angle25.84^{\circ}
\end{equation*}
After Finding $I_a$ the phase currents can be calculated for time zero. 
\begin{equation*}
    i_a(0) = \sqrt{2}\cdot|I_a|\cos(25.84^\circ) = 24213.3[A]
\end{equation*}

\begin{equation*}
    i_b(0) = \sqrt{2}\cdot|I_a|\cos(25.84^\circ - 120^\circ) = -1950.73[A]    
\end{equation*}

\begin{equation*}
    i_c(0) = \sqrt{2}\cdot|I_a|\cos(25.84^\circ - 240^\circ) = -22262.5[A]  
\end{equation*}
$I_f$ can be found for time zero using $E_{AF}$ and the mutual inductance between the field and armature windings. 
\begin{equation*}
    I_f = \frac{\sqrt{2}E_{af}}{\omega L{afm}}
\end{equation*}

\begin{equation*}
    E_{af} = [(va - X_qi_a\sin(\phi)) + j(Xqi_a\cos(\phi))]+(X_d-X_q)i_a\sin(\delta+\phi) 
\end{equation*}

\begin{equation*}
    X_d = 377(0.1254e^{-3}+0.4158e^{-3}) = 0.204032
\end{equation*}

\begin{equation*}
    X_q = 377(0.03762e^{-3} + 0.1375e^{-3}) = 0.06602
\end{equation*}

\begin{equation*}
    \delta = \angle \tan^{-1}(\frac{X_qi_acos(\phi)}{V_a-X_qI_a\sin(\phi)}) =  \angle \tan^{-1}(\frac{0.06602 \cdot19023.7 \cos(25.84)}{16329.9-0.06602 \cdot 19023.7\sin(25.84)}) = \angle4.09
\end{equation*}

\begin{equation*}
\begin{split}
     E_{af} & = [(16329.9 - 0.06602 \cdot 19023.7\sin(25.84)) + j(0.06602 \cdot 19023.7\cos(25.84))] + \cdots \\
     & \cdots (0.204032-0.06602)19023.7\sin(5.86+25.84)  = 17170.9
\end{split} % the amperstands are the locators for split and other functions btw
\end{equation*}
\begin{equation*}
    I_f = \frac{\sqrt{2}\cdot17170.9}{377\cdot 26.1\cdot 10^{-3}} = 2467.9[A]
\end{equation*}

\begin{equation*}
    i_{kd1} = 0
\end{equation*}

\begin{equation*}
    i_{kq1} = 0
\end{equation*}

\begin{equation*}
    i_{kd2} = 0
\end{equation*}

\begin{equation*}
    i_{kq2} = 0
\end{equation*}
\newpage
\subsection*{2.2)} We can use numerical integration to calculate the synchronous generators parameters including stator winding currents, damper bar currents, field winding current, and the generator torque. In the first section of the below analysis, we ignore the effect of the damper bars by removing the resistance and inductance quantities of the damping circuits from the matrices used in equation (1). In the model, there is a simulated 3 phase fault from line to neutral on the wye connected bus bar after 10 cycles given 60 cycles per second. The fault clears after 25 cycles where the steady state is re-established.
\begin{figure}[H]
    \centering
    \includegraphics[width=0.49\linewidth]{dqo_no_dampers.png}
    \includegraphics[width=0.49\linewidth]{ABC_no_dampers.png}\\
    \includegraphics[width=0.49\linewidth]{field_no_dampers.png}
    \includegraphics[width=0.49\linewidth]{tem_no_dampers.png}\\
    \title{Figure 2: Synchronous Generator Parameters without Damping Circuits}
\end{figure}
The generator is essentially at its steady-state value after 10 cycles, at which point the fault occurs and creates a spike in both the d and q current. The 3-phase to ground fault is symmetrical and so it does not affect the $i_o$ current and has less effect on the $i_q$ current. At the fault, without the damping bars the $i_d$ current is huge (almost 12 times normal), but the damping bars improve the fault current (only 5 times normal). The damping bars receive about the same amount of current (in the direct axis) as the main windings, and they make the fault current fall faster than it would without the damping bars. However, the peak mechanical torque with the damping bars is higher by a factor of about 3.\\ 

The decrease in current caused by the damping bars would decrease the heat dissipated in the generator. However, depending on the windings and the prime mover it is possible that the increase in torque would be worse for the generator than the increase in heat. More analysis would be required to determine whether the machine would be damaged in either case, and the effects on fault resiliency.\\
\begin{figure}[H]
    \centering
    \includegraphics[width=0.49\linewidth]{DQO_dampers.png}
    \includegraphics[width=0.49\linewidth]{ABC_dampers.png}\\
    \includegraphics[width=0.49\linewidth]{field_dampers.png}
    \includegraphics[width=0.49\linewidth]{tem_dampers.png}\\
    \includegraphics[width=0.49\linewidth]{dampers.png}\\
    \title{Figure 3: Synchronous Generator Parameter with Damping Circuits}
\end{figure}
\newpage
\input{appendix}
\end{document}
