Difference between revisions of "Motor Control"

From fswiki.us
Jump to navigation Jump to search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Electric Vehicle]]
 
[[Category:Electric Vehicle]]
=DC Brushed Motor Control=
+
 
 +
Motor control is a complex field which requires knowledge of linear algebra, control theory, and an understanding of electric machines. However, the overarching goal of every style of motor control is this keyword (look it up): rotating magnetic field, or RMF. This page aims to break down various styles of motor control, but focuses on the primary modern method, Field-Oriented Control or FOC.
 +
 
 +
=Inverter Setup=
 +
While the theory behind FOC is important to understand, most teams should be focusing on getting their motor controller working with their motor. This means understanding what parameters can be changed in a typical motor controller and how that may affect the operation of your motor. Some common parameters include:
 +
* Resolver offset: informs the motor controller where the magnetic north, or D-axis of the rotor is relative to the position of the resolver/encoder on the motor shaft. Essentially, it's quite hard to get the resolver/encoder sensor perfectly aligned with the rotor field when installing the sensor, so this offset tells the controller the relative position of the sensor compared to the rotor. In other words, how off you were when you randomly threw the sensor on the motor shaft.
 +
** Most controllers have a calibration procedure to dial this value in. Getting this value correct is essential to proper motor/controller operation & preventing errors or even damage to components
 +
* Switching/carrier frequency: this is the switching frequency of the motor controller's power stage. Ranges from 4.4-20kHz. The higher the switching frequency, the smoother/higher-resolution the sine wave. This has the advantage of lowering eddy current losses & associated heating in the motor, but increases losses in the motor controller since more switching events -> IGBTs/MOSFETs are transitioning more frequently -> more heat generated in the controller
 +
** <span>Note: low-inductance/resistance motors require a higher switching frequency since having a high inductance/resistance helps to smooth the sine waves being generated from the controller. Thus, the sine waves coming out of the controller don't need to be as smooth = lower switching frequency if the motor has more of a smoothing effect</span>
 +
* <span>Battery current limit: limits how much current the controller draws from the battery. This should be set relative to the maximum current the pack can produce without overheating</span>
 +
* <span>Phase current limit: sets the limit of the current in any of the motor's 3 phases. This is directly proportional to the torque that the motor produces. This is NOT the same as the battery current and can be 2-3x higher based on the Kv (voltage constant) of the motor windings.</span>
 +
* <span>PI loop gains: Changes the aggressiveness of the PI loops when there is an error between reference & measured DQ currents. These are typically preset by the controller manufacturer for specific motors and SHOULD NOT be changed unless there is an obvious issue with how the controller is commanding current</span>
 +
** <span>One way to tune these is to observe overshoot & drift in the commanded DQ currents: more overshoot indicates Kp may be too high while excessive drift means Ki may be too low</span>
 +
 
 
=Six-Step Control=
 
=Six-Step Control=
<div><h1>Field Oriented Control for Synchronous Machines</h1></div>Most FSAE grade motor controllers use field oriented control. This is due to the efficiency and dynamic performance of the controller and motor. Field oriented control relies on controlling the DQ-axis currents through applying a specific DQ-axis voltage to the motor. For a good explaination of field oriented control see the video below (though it focuses on sensorless field oriented control).<br data-attributes=""><br class="mw_emptyline_first"><br class="mw_emptyline"><a href="https://www.youtube.com/watch?v=cdiZUszYLiA&amp;t=11s" data-mce-href="https://www.youtube.com/watch?v=cdiZUszYLiA&amp;t=11s" title="[1]" data-mw-type="external_link" class="link external mw-external-link mceNonEditable" data-mw-wikitext="%5Bhttps://www.youtube.com/watch?v=cdiZUszYLiA&amp;t=11s%5D" contenteditable="false"><mwspan>[1]<div class="mceNonEditableOverlay"></div></mwspan></a><div><h2>Transformations</h2></div><div><h3>Clarke Transform</h3></div>The Clarke transform is used to convert the measurements of the phase currents or voltages to a rectangular 2d space vector, which represents both a complex phasor representing the AC current in the phases, and a vector with the same direction<span class="single_linebreak" title="single linebreak" contenteditable="false"><mwspan>¶</mwspan></span>of the magnetic field that the current will create. The real axis/the axis aligned with the phase A vector is called <span id="<@@@TAG155056@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>\alpha</math>" data-mw-type="tag" data-mw-id="155056" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%5Calpha%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha }">
+
=Field Oriented Control for Synchronous Machines=
  <semantics>
+
Most FSAE-grade motor controllers use Field-Oriented Control. This decouples the torque and flux (magnetic field strength) control within the motor, which offers improved efficiency and dynamic performance of the motor & controller. To summarize, there are 7 main steps to FOC.
    <mrow class="MJX-TeXAtom-ORD">
+
# Measure phase currents and rotor position - done using 2 or 3 phase current sensors + encoder/resolver for rotor position
      <mstyle scriptlevel="0" displaystyle="true">
+
# Clarke transform - linear transformation from the 3-phase stationary (abc) to 2-phase stationary (alpha/beta) of the currents in the stator windings
        <mi>α<!-- α --></mi>
+
# Park transform - linear transformation from the 2-phase stationary (alpha/beta) to 2-phase rotating frame (DQ) - this turns the 2-phase currents in the stator windings into 2-phase currents that the rotor sees as it rotates
      </mstyle>
+
## Here is the important part: the Q-axis of the rotor is what controls torque while the D-axis of the rotor controls the flux. Since we can request D and Q-axis currents independently now, we can control the torque and flux separately respectively
    </mrow>
+
# PI control loops: set the D-axis and Q-axis currents of the rotor based on the error between reference values given by throttle position and measured values from the phase current & rotor position sensors
    <annotation encoding="application/x-tex">{\displaystyle \alpha }</annotation>
+
# Inverse-Park transform: going back from the 2-phase rotating (DQ) frame to the 2-phase stationary (alpha/beta) frame
  </semantics>
+
# Inverse-Clarke transform: going back from the 2-phase stationary (alpha/beta) to the 3-phase stationary (abc) frame
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b79333175c8b3f0840bfb4ec41b8072c83ea88d3" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.338ex; width:1.488ex; height:1.676ex;" alt="{\displaystyle \alpha }"></span>
+
# SVPWM: space-vector pulse-width modulation: calculates the required PWM signals for the IGBT/MOSFET half-bridges to generate the correct 3x AC phase voltages which drive currents in each phase
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span>, while the imaginary axis/perpendicular axis is labeled <span id="<@@@TAG125345@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>\beta</math>" data-mw-type="tag" data-mw-id="125345" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%5Cbeta%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \beta }">
+
 
  <semantics>
+
 
    <mrow class="MJX-TeXAtom-ORD">
+
==Transformations==
      <mstyle scriptlevel="0" displaystyle="true">
+
===Clarke Transform===
        <mi>β<!-- β --></mi>
+
The Clarke transform is used to convert the measurements of the phase currents or voltages to a rectangular 2d space vector, which represents both a complex phasor representing the AC current in the phases, and a vector with the same direction
      </mstyle>
+
of the magnetic field that the current will create. The real axis/the axis aligned with the phase A vector is called <math>\alpha</math>, while the imaginary axis/perpendicular axis is labeled <math>\beta</math>. k is a scaling factor, where
    </mrow>
+
<math>k = \frac{2}{3}</math> results in a vector with the same magnitude as the original 3-phase signals, and <math>k = \sqrt{\frac{2}{3}}</math> results in a power-invariant transform.
    <annotation encoding="application/x-tex">{\displaystyle \beta }</annotation>
+
 
  </semantics>
+
<math>
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7ed48a5e36207156fb792fa79d29925d2f7901e8" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.671ex; width:1.332ex; height:2.509ex;" alt="{\displaystyle \beta }"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span>. k is a scaling factor, where<br class="mw_emptyline"><span id="<@@@TAG104565@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>k = \frac{2}{3}</math>" data-mw-type="tag" data-mw-id="104565" data-mw-name="math" data-mw-wikitext="%3Cmath%3Ek%20=%20%5Cfrac%7B2%7D%7B3%7D%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k={\frac {2}{3}}}">
 
  <semantics>
 
    <mrow class="MJX-TeXAtom-ORD">
 
      <mstyle scriptlevel="0" displaystyle="true">
 
        <mi>k</mi>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mn>2</mn>
 
            <mn>3</mn>
 
          </mfrac>
 
        </mrow>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle k={\frac {2}{3}}}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a32f140d5d8c9832545636b79bf45e81478334ca" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -1.838ex; width:6.308ex; height:5.176ex;" alt="{\displaystyle k={\frac {2}{3}}}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span> results in a vector with the same magnitude as the original 3-phase signals, and <span id="<@@@TAG109486@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>k = \sqrt{\frac{2}{3}}</math>" data-mw-type="tag" data-mw-id="109486" data-mw-name="math" data-mw-wikitext="%3Cmath%3Ek%20=%20%5Csqrt%7B%5Cfrac%7B2%7D%7B3%7D%7D%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k={\sqrt {\frac {2}{3}}}}">
 
  <semantics>
 
    <mrow class="MJX-TeXAtom-ORD">
 
      <mstyle scriptlevel="0" displaystyle="true">
 
        <mi>k</mi>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <msqrt>
 
            <mfrac>
 
              <mn>2</mn>
 
              <mn>3</mn>
 
            </mfrac>
 
          </msqrt>
 
        </mrow>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle k={\sqrt {\frac {2}{3}}}}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ee0412cac912c88cf59bc4156599e46640e80d09" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.338ex; width:8.632ex; height:6.176ex;" alt="{\displaystyle k={\sqrt {\frac {2}{3}}}}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span> results in a power-invariant transform.<br class="mw_emptyline_first"><span id="<@@@TAG191952@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>
 
 
\begin{bmatrix}
 
\begin{bmatrix}
 
x_\alpha \\
 
x_\alpha \\
Line 65: Line 40:
 
= k
 
= k
 
\begin{bmatrix}
 
\begin{bmatrix}
1 &amp; -\frac{1}{2} &amp; -\frac{1}{2} \\
+
1 & -\frac{1}{2} & -\frac{1}{2} \\
0 &amp; \frac{\sqrt 3}{2} &amp; -\frac{\sqrt 3}{2}
+
0 & \frac{\sqrt 3}{2} & -\frac{\sqrt 3}{2}
 
\end{bmatrix}
 
\end{bmatrix}
 
\begin{bmatrix}
 
\begin{bmatrix}
Line 73: Line 48:
 
x_C
 
x_C
 
\end{bmatrix}
 
\end{bmatrix}
</math>" data-mw-type="tag" data-mw-id="191952" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%0A%5Cbegin%7Bbmatrix%7D%0Ax_%5Calpha%20%5C%5C%0Ax_%5Cbeta%0A%5Cend%7Bbmatrix%7D%0A=%20k%0A%5Cbegin%7Bbmatrix%7D%0A1%20&amp;%20-%5Cfrac%7B1%7D%7B2%7D%20&amp;%20-%5Cfrac%7B1%7D%7B2%7D%20%5C%5C%0A0%20&amp;%20%5Cfrac%7B%5Csqrt%203%7D%7B2%7D%20&amp;%20-%5Cfrac%7B%5Csqrt%203%7D%7B2%7D%0A%5Cend%7Bbmatrix%7D%0A%5Cbegin%7Bbmatrix%7D%0Ax_A%20%5C%5C%0Ax_B%20%5C%5C%0Ax_C%0A%5Cend%7Bbmatrix%7D%0A%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{bmatrix}x_{\alpha }\\x_{\beta }\end{bmatrix}}=k{\begin{bmatrix}1&amp;-{\frac {1}{2}}&amp;-{\frac {1}{2}}\\0&amp;{\frac {\sqrt {3}}{2}}&amp;-{\frac {\sqrt {3}}{2}}\end{bmatrix}}{\begin{bmatrix}x_{A}\\x_{B}\\x_{C}\end{bmatrix}}}">
+
</math>
  <semantics>
+
===Park Transform===
    <mrow class="MJX-TeXAtom-ORD">
+
The Park transform is used to transform quantities from being referenced to the stator to being referenced to the rotor. The <math>\alpha\beta</math>-frame is "stationary", as in the axes remain fixed while the current
      <mstyle scriptlevel="0" displaystyle="true">
+
and voltage vector spins around with the rotor. in the DQ-frame, because it is referenced so the D axis always is aligned with a north pole on the rotor, constant current results in constant torque regardless of rotation.
        <mrow class="MJX-TeXAtom-ORD">
+
The transform itself is simply a rotation matrix, rotating the <math>\alpha\beta</math>-frame by the electrical angle of the rotor.
          <mrow>
+
 
            <mo>[</mo>
+
<math>
            <mtable rowspacing="4pt" columnspacing="1em">
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>α<!-- α --></mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>β<!-- β --></mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
            </mtable>
 
            <mo>]</mo>
 
          </mrow>
 
        </mrow>
 
        <mo>=</mo>
 
        <mi>k</mi>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mrow>
 
            <mo>[</mo>
 
            <mtable rowspacing="4pt" columnspacing="1em">
 
              <mtr>
 
                <mtd>
 
                  <mn>1</mn>
 
                </mtd>
 
                <mtd>
 
                  <mo>−<!-- − --></mo>
 
                  <mrow class="MJX-TeXAtom-ORD">
 
                    <mfrac>
 
                      <mn>1</mn>
 
                      <mn>2</mn>
 
                    </mfrac>
 
                  </mrow>
 
                </mtd>
 
                <mtd>
 
                  <mo>−<!-- − --></mo>
 
                  <mrow class="MJX-TeXAtom-ORD">
 
                    <mfrac>
 
                      <mn>1</mn>
 
                      <mn>2</mn>
 
                    </mfrac>
 
                  </mrow>
 
                </mtd>
 
              </mtr>
 
              <mtr>
 
                <mtd>
 
                  <mn>0</mn>
 
                </mtd>
 
                <mtd>
 
                  <mrow class="MJX-TeXAtom-ORD">
 
                    <mfrac>
 
                      <msqrt>
 
                        <mn>3</mn>
 
                      </msqrt>
 
                      <mn>2</mn>
 
                    </mfrac>
 
                  </mrow>
 
                </mtd>
 
                <mtd>
 
                  <mo>−<!-- − --></mo>
 
                  <mrow class="MJX-TeXAtom-ORD">
 
                    <mfrac>
 
                      <msqrt>
 
                        <mn>3</mn>
 
                      </msqrt>
 
                      <mn>2</mn>
 
                    </mfrac>
 
                  </mrow>
 
                </mtd>
 
              </mtr>
 
            </mtable>
 
            <mo>]</mo>
 
          </mrow>
 
        </mrow>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mrow>
 
            <mo>[</mo>
 
            <mtable rowspacing="4pt" columnspacing="1em">
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>A</mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>B</mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>C</mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
            </mtable>
 
            <mo>]</mo>
 
          </mrow>
 
        </mrow>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle {\begin{bmatrix}x_{\alpha }\\x_{\beta }\end{bmatrix}}=k{\begin{bmatrix}1&amp;-{\frac {1}{2}}&amp;-{\frac {1}{2}}\\0&amp;{\frac {\sqrt {3}}{2}}&amp;-{\frac {\sqrt {3}}{2}}\end{bmatrix}}{\begin{bmatrix}x_{A}\\x_{B}\\x_{C}\end{bmatrix}}}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d4000c82275c067f5f6aafcbfd1792306c269e58" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -4.005ex; width:34.754ex; height:9.176ex;" alt="{\displaystyle {\begin{bmatrix}x_{\alpha }\\x_{\beta }\end{bmatrix}}=k{\begin{bmatrix}1&amp;-{\frac {1}{2}}&amp;-{\frac {1}{2}}\\0&amp;{\frac {\sqrt {3}}{2}}&amp;-{\frac {\sqrt {3}}{2}}\end{bmatrix}}{\begin{bmatrix}x_{A}\\x_{B}\\x_{C}\end{bmatrix}}}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span><div><h3>Park Transform</h3></div>The Park transform is used to transform quantities from being referenced to the stator to being referenced to the rotor. The <span id="<@@@TAG142237@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>\alpha\beta</math>" data-mw-type="tag" data-mw-id="142237" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%5Calpha%5Cbeta%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha \beta }">
 
  <semantics>
 
    <mrow class="MJX-TeXAtom-ORD">
 
      <mstyle scriptlevel="0" displaystyle="true">
 
        <mi>α<!-- α --></mi>
 
        <mi>β<!-- β --></mi>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle \alpha \beta }</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2efb0e5523f52275f3193b0dfd9a92ad5b76830c" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.671ex; width:2.82ex; height:2.509ex;" alt="{\displaystyle \alpha \beta }"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span>-frame is "stationary", as in the axes remain fixed while the current<span class="single_linebreak" title="single linebreak" contenteditable="false"><mwspan>¶</mwspan></span>and voltage vector spins around with the rotor. in the DQ-frame, because it is referenced so the D axis always is aligned with a north pole on the rotor, constant current results in constant torque regardless of rotation.<span class="single_linebreak" title="single linebreak" contenteditable="false"><mwspan>¶</mwspan></span>The transform itself is simply a rotation matrix, rotating the <span id="<@@@TAG142237@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>\alpha\beta</math>" data-mw-type="tag" data-mw-id="142237" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%5Calpha%5Cbeta%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha \beta }">
 
  <semantics>
 
    <mrow class="MJX-TeXAtom-ORD">
 
      <mstyle scriptlevel="0" displaystyle="true">
 
        <mi>α<!-- α --></mi>
 
        <mi>β<!-- β --></mi>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle \alpha \beta }</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2efb0e5523f52275f3193b0dfd9a92ad5b76830c" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.671ex; width:2.82ex; height:2.509ex;" alt="{\displaystyle \alpha \beta }"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span>-frame by the electrical angle of the rotor.<br class="mw_emptyline_first"><span id="<@@@TAG167346@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>
 
 
\begin{bmatrix}
 
\begin{bmatrix}
 
x_d\\
 
x_d\\
Line 236: Line 61:
 
=
 
=
 
\begin{bmatrix}
 
\begin{bmatrix}
cos(\theta_r) &amp; sin(\theta_r) \\
+
cos(\theta_r) & sin(\theta_r) \\
-sin(\theta_r) &amp; cos(\theta_r)
+
-sin(\theta_r) & cos(\theta_r)
 
\end{bmatrix}
 
\end{bmatrix}
 
\begin{bmatrix}
 
\begin{bmatrix}
Line 243: Line 68:
 
x_\beta
 
x_\beta
 
\end{bmatrix}
 
\end{bmatrix}
</math>" data-mw-type="tag" data-mw-id="167346" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%0A%5Cbegin%7Bbmatrix%7D%0Ax_d%5C%5C%0Ax_q%0A%5Cend%7Bbmatrix%7D%0A=%0A%5Cbegin%7Bbmatrix%7D%0Acos(%5Ctheta_r)%20&amp;%20sin(%5Ctheta_r)%20%5C%5C%0A-sin(%5Ctheta_r)%20&amp;%20cos(%5Ctheta_r)%0A%5Cend%7Bbmatrix%7D%0A%5Cbegin%7Bbmatrix%7D%0Ax_%5Calpha%20%5C%5C%0Ax_%5Cbeta%0A%5Cend%7Bbmatrix%7D%0A%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{bmatrix}x_{d}\\x_{q}\end{bmatrix}}={\begin{bmatrix}cos(\theta _{r})&amp;sin(\theta _{r})\\-sin(\theta _{r})&amp;cos(\theta _{r})\end{bmatrix}}{\begin{bmatrix}x_{\alpha }\\x_{\beta }\end{bmatrix}}}">
+
</math>
  <semantics>
+
==Current Regulation==
    <mrow class="MJX-TeXAtom-ORD">
+
A PI controller is commonly used to regulate the currents. This is explained by starting with a simple motor model in the DQ-frame (the motor is represented by a voltage source, resistance, and inductance).  
      <mstyle scriptlevel="0" displaystyle="true">
+
<math>
        <mrow class="MJX-TeXAtom-ORD">
 
          <mrow>
 
            <mo>[</mo>
 
            <mtable rowspacing="4pt" columnspacing="1em">
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>d</mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>q</mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
            </mtable>
 
            <mo>]</mo>
 
          </mrow>
 
        </mrow>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mrow>
 
            <mo>[</mo>
 
            <mtable rowspacing="4pt" columnspacing="1em">
 
              <mtr>
 
                <mtd>
 
                  <mi>c</mi>
 
                  <mi>o</mi>
 
                  <mi>s</mi>
 
                  <mo stretchy="false">(</mo>
 
                  <msub>
 
                    <mi>θ<!-- θ --></mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>r</mi>
 
                    </mrow>
 
                  </msub>
 
                  <mo stretchy="false">)</mo>
 
                </mtd>
 
                <mtd>
 
                  <mi>s</mi>
 
                  <mi>i</mi>
 
                  <mi>n</mi>
 
                  <mo stretchy="false">(</mo>
 
                  <msub>
 
                    <mi>θ<!-- θ --></mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>r</mi>
 
                    </mrow>
 
                  </msub>
 
                  <mo stretchy="false">)</mo>
 
                </mtd>
 
              </mtr>
 
              <mtr>
 
                <mtd>
 
                  <mo>−<!-- − --></mo>
 
                  <mi>s</mi>
 
                  <mi>i</mi>
 
                  <mi>n</mi>
 
                  <mo stretchy="false">(</mo>
 
                  <msub>
 
                    <mi>θ<!-- θ --></mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>r</mi>
 
                    </mrow>
 
                  </msub>
 
                  <mo stretchy="false">)</mo>
 
                </mtd>
 
                <mtd>
 
                  <mi>c</mi>
 
                  <mi>o</mi>
 
                  <mi>s</mi>
 
                  <mo stretchy="false">(</mo>
 
                  <msub>
 
                    <mi>θ<!-- θ --></mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>r</mi>
 
                    </mrow>
 
                  </msub>
 
                  <mo stretchy="false">)</mo>
 
                </mtd>
 
              </mtr>
 
            </mtable>
 
            <mo>]</mo>
 
          </mrow>
 
        </mrow>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mrow>
 
            <mo>[</mo>
 
            <mtable rowspacing="4pt" columnspacing="1em">
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>α<!-- α --></mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
              <mtr>
 
                <mtd>
 
                  <msub>
 
                    <mi>x</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>β<!-- β --></mi>
 
                    </mrow>
 
                  </msub>
 
                </mtd>
 
              </mtr>
 
            </mtable>
 
            <mo>]</mo>
 
          </mrow>
 
        </mrow>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle {\begin{bmatrix}x_{d}\\x_{q}\end{bmatrix}}={\begin{bmatrix}cos(\theta _{r})&amp;sin(\theta _{r})\\-sin(\theta _{r})&amp;cos(\theta _{r})\end{bmatrix}}{\begin{bmatrix}x_{\alpha }\\x_{\beta }\end{bmatrix}}}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b3936dfef8cb177c2c3c1ae223fe87335c86a1dc" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.505ex; width:36.206ex; height:6.176ex;" alt="{\displaystyle {\begin{bmatrix}x_{d}\\x_{q}\end{bmatrix}}={\begin{bmatrix}cos(\theta _{r})&amp;sin(\theta _{r})\\-sin(\theta _{r})&amp;cos(\theta _{r})\end{bmatrix}}{\begin{bmatrix}x_{\alpha }\\x_{\beta }\end{bmatrix}}}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span><div><h2>Current Regulation</h2></div>A PI controller is commonly used to regulate the phase currents. This is explained by starting with a simple motor model in the DQ-frame (the motor is represented by a voltage source, resistance, and inductance). <br class="mw_emptyline"><span id="<@@@TAG149363@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>
 
 
I_{dq} = \frac{V_{dq} - V_{emf}}{R_s + sL_{dq}}
 
I_{dq} = \frac{V_{dq} - V_{emf}}{R_s + sL_{dq}}
</math>" data-mw-type="tag" data-mw-id="149363" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%0AI_%7Bdq%7D%20=%20%5Cfrac%7BV_%7Bdq%7D%20-%20V_%7Bemf%7D%7D%7BR_s%20+%20sL_%7Bdq%7D%7D%0A%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle I_{dq}={\frac {V_{dq}-V_{emf}}{R_{s}+sL_{dq}}}}">
+
</math>
  <semantics>
+
 
    <mrow class="MJX-TeXAtom-ORD">
+
 
      <mstyle scriptlevel="0" displaystyle="true">
+
We can then write the equation for the system as follows:<br /><math> G(s) = \frac{I_{dq}(s)}{V_{dq}(s) - V_{EMF,dq}} = \frac{1}{R_s + sL_{dq}} = \frac{\frac{1}{L_{dq}}}{(s + \frac{R_s}{L_{dq}})} </math>
        <msub>
+
 
          <mi>I</mi>
+
 
          <mrow class="MJX-TeXAtom-ORD">
+
The pole of the system can be cancelled out by a an appropriately tuned PI controller. The equation for the entire current controller can then be written as follows:
            <mi>d</mi>
+
<math>
            <mi>q</mi>
 
          </mrow>
 
        </msub>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mrow>
 
              <msub>
 
                <mi>V</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
              <mo>−<!-- − --></mo>
 
              <msub>
 
                <mi>V</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>e</mi>
 
                  <mi>m</mi>
 
                  <mi>f</mi>
 
                </mrow>
 
              </msub>
 
            </mrow>
 
            <mrow>
 
              <msub>
 
                <mi>R</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>s</mi>
 
                </mrow>
 
              </msub>
 
              <mo>+</mo>
 
              <mi>s</mi>
 
              <msub>
 
                <mi>L</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
            </mrow>
 
          </mfrac>
 
        </mrow>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle I_{dq}={\frac {V_{dq}-V_{emf}}{R_{s}+sL_{dq}}}}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1c3a5976ef651c6e22e536a8166ce9194ab517a3" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.505ex; width:17.55ex; height:6.176ex;" alt="{\displaystyle I_{dq}={\frac {V_{dq}-V_{emf}}{R_{s}+sL_{dq}}}}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span><br class="mw_emptyline_first"><br class="mw_emptyline">We can then write the equation for the system as follows:<br data-attributes=""><span id="<@@@TAG144167@@@>" class="mceNonEditable wikimagic mw-tag" title="<math> G(s) = \frac{I_{dq}(s)}{V_{dq}(s) - V_{EMF,dq}} = \frac{1}{R_s + sL_{dq}} = \frac{\frac{1}{L_{dq}}}{(s + \frac{R_s}{L_{dq}})} </math>" data-mw-type="tag" data-mw-id="144167" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%20G(s)%20=%20%5Cfrac%7BI_%7Bdq%7D(s)%7D%7BV_%7Bdq%7D(s)%20-%20V_%7BEMF,dq%7D%7D%20=%20%5Cfrac%7B1%7D%7BR_s%20+%20sL_%7Bdq%7D%7D%20=%20%5Cfrac%7B%5Cfrac%7B1%7D%7BL_%7Bdq%7D%7D%7D%7B(s%20+%20%5Cfrac%7BR_s%7D%7BL_%7Bdq%7D%7D)%7D%20%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G(s)={\frac {I_{dq}(s)}{V_{dq}(s)-V_{EMF,dq}}}={\frac {1}{R_{s}+sL_{dq}}}={\frac {\frac {1}{L_{dq}}}{(s+{\frac {R_{s}}{L_{dq}}})}}}">
 
  <semantics>
 
    <mrow class="MJX-TeXAtom-ORD">
 
      <mstyle scriptlevel="0" displaystyle="true">
 
        <mi>G</mi>
 
        <mo stretchy="false">(</mo>
 
        <mi>s</mi>
 
        <mo stretchy="false">)</mo>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mrow>
 
              <msub>
 
                <mi>I</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
              <mo stretchy="false">(</mo>
 
              <mi>s</mi>
 
              <mo stretchy="false">)</mo>
 
            </mrow>
 
            <mrow>
 
              <msub>
 
                <mi>V</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
              <mo stretchy="false">(</mo>
 
              <mi>s</mi>
 
              <mo stretchy="false">)</mo>
 
              <mo>−<!-- − --></mo>
 
              <msub>
 
                <mi>V</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>E</mi>
 
                  <mi>M</mi>
 
                  <mi>F</mi>
 
                  <mo>,</mo>
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
            </mrow>
 
          </mfrac>
 
        </mrow>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mn>1</mn>
 
            <mrow>
 
              <msub>
 
                <mi>R</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>s</mi>
 
                </mrow>
 
              </msub>
 
              <mo>+</mo>
 
              <mi>s</mi>
 
              <msub>
 
                <mi>L</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
            </mrow>
 
          </mfrac>
 
        </mrow>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mfrac>
 
              <mn>1</mn>
 
              <msub>
 
                <mi>L</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
            </mfrac>
 
            <mrow>
 
              <mo stretchy="false">(</mo>
 
              <mi>s</mi>
 
              <mo>+</mo>
 
              <mrow class="MJX-TeXAtom-ORD">
 
                <mfrac>
 
                  <msub>
 
                    <mi>R</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>s</mi>
 
                    </mrow>
 
                  </msub>
 
                  <msub>
 
                    <mi>L</mi>
 
                    <mrow class="MJX-TeXAtom-ORD">
 
                      <mi>d</mi>
 
                      <mi>q</mi>
 
                    </mrow>
 
                  </msub>
 
                </mfrac>
 
              </mrow>
 
              <mo stretchy="false">)</mo>
 
            </mrow>
 
          </mfrac>
 
        </mrow>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle G(s)={\frac {I_{dq}(s)}{V_{dq}(s)-V_{EMF,dq}}}={\frac {1}{R_{s}+sL_{dq}}}={\frac {\frac {1}{L_{dq}}}{(s+{\frac {R_{s}}{L_{dq}}})}}}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cbe9d2f69dac0e8e27f742f225ddb717f169b038" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -4.338ex; width:52.649ex; height:9.509ex;" alt="{\displaystyle G(s)={\frac {I_{dq}(s)}{V_{dq}(s)-V_{EMF,dq}}}={\frac {1}{R_{s}+sL_{dq}}}={\frac {\frac {1}{L_{dq}}}{(s+{\frac {R_{s}}{L_{dq}}})}}}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span><br class="mw_emptyline_first"><br class="mw_emptyline">The pole of the system can be cancelled out by a an appropriately tuned PI controller. The equation for the entire current controller can then be written as follows:<br class="mw_emptyline"><span id="<@@@TAG151981@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>
 
 
G_c(s) = \frac{V_{dq} - V_{EMF,dq}}{I_{e,dq}(s)} = k_p + \frac{k_i}{s} = \frac{1}{s}(k_i + sk_p)
 
G_c(s) = \frac{V_{dq} - V_{EMF,dq}}{I_{e,dq}(s)} = k_p + \frac{k_i}{s} = \frac{1}{s}(k_i + sk_p)
  
  
</math>" data-mw-type="tag" data-mw-id="151981" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%0AG_c(s)%20=%20%5Cfrac%7BV_%7Bdq%7D%20-%20V_%7BEMF,dq%7D%7D%7BI_%7Be,dq%7D(s)%7D%20=%20k_p%20+%20%5Cfrac%7Bk_i%7D%7Bs%7D%20=%20%5Cfrac%7B1%7D%7Bs%7D(k_i%20+%20sk_p)%0A%0A%0A%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G_{c}(s)={\frac {V_{dq}-V_{EMF,dq}}{I_{e,dq}(s)}}=k_{p}+{\frac {k_{i}}{s}}={\frac {1}{s}}(k_{i}+sk_{p})}">
+
</math>
  <semantics>
+
 
    <mrow class="MJX-TeXAtom-ORD">
+
 
      <mstyle scriptlevel="0" displaystyle="true">
+
More explicitly, the desired output voltage at any given point in time can be written as:<br /><math>
        <msub>
 
          <mi>G</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>c</mi>
 
          </mrow>
 
        </msub>
 
        <mo stretchy="false">(</mo>
 
        <mi>s</mi>
 
        <mo stretchy="false">)</mo>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mrow>
 
              <msub>
 
                <mi>V</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
              <mo>−<!-- − --></mo>
 
              <msub>
 
                <mi>V</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>E</mi>
 
                  <mi>M</mi>
 
                  <mi>F</mi>
 
                  <mo>,</mo>
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
            </mrow>
 
            <mrow>
 
              <msub>
 
                <mi>I</mi>
 
                <mrow class="MJX-TeXAtom-ORD">
 
                  <mi>e</mi>
 
                  <mo>,</mo>
 
                  <mi>d</mi>
 
                  <mi>q</mi>
 
                </mrow>
 
              </msub>
 
              <mo stretchy="false">(</mo>
 
              <mi>s</mi>
 
              <mo stretchy="false">)</mo>
 
            </mrow>
 
          </mfrac>
 
        </mrow>
 
        <mo>=</mo>
 
        <msub>
 
          <mi>k</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>p</mi>
 
          </mrow>
 
        </msub>
 
        <mo>+</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <msub>
 
              <mi>k</mi>
 
              <mrow class="MJX-TeXAtom-ORD">
 
                <mi>i</mi>
 
              </mrow>
 
            </msub>
 
            <mi>s</mi>
 
          </mfrac>
 
        </mrow>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mn>1</mn>
 
            <mi>s</mi>
 
          </mfrac>
 
        </mrow>
 
        <mo stretchy="false">(</mo>
 
        <msub>
 
          <mi>k</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>i</mi>
 
          </mrow>
 
        </msub>
 
        <mo>+</mo>
 
        <mi>s</mi>
 
        <msub>
 
          <mi>k</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>p</mi>
 
          </mrow>
 
        </msub>
 
        <mo stretchy="false">)</mo>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle G_{c}(s)={\frac {V_{dq}-V_{EMF,dq}}{I_{e,dq}(s)}}=k_{p}+{\frac {k_{i}}{s}}={\frac {1}{s}}(k_{i}+sk_{p})}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3b50211a6364f8445185950d57919bd1f11915ea" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.671ex; width:49.698ex; height:6.343ex;" alt="{\displaystyle G_{c}(s)={\frac {V_{dq}-V_{EMF,dq}}{I_{e,dq}(s)}}=k_{p}+{\frac {k_{i}}{s}}={\frac {1}{s}}(k_{i}+sk_{p})}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span><br class="mw_emptyline_first"><br class="mw_emptyline">More explicitly, the desired output voltage at any given point in time can be written as:<br data-attributes=""><span id="<@@@TAG107039@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>
 
  
  
Line 657: Line 93:
  
  
</math>" data-mw-type="tag" data-mw-id="107039" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%0A%0A%0AV_%7Bdq%7D%20=%20(I_%7Bdq,requested%7D%20-%20I_%7Bdq,measured%7D)%20%5Cfrac%7B1%7D%7Bs%7D(k_i%20+%20sk_p))%20+%20V_%7BEMF,dq%7D%0A%0A%0A%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle V_{dq}=(I_{dq,requested}-I_{dq,measured}){\frac {1}{s}}(k_{i}+sk_{p}))+V_{EMF,dq}}">
+
</math>
  <semantics>
+
 
    <mrow class="MJX-TeXAtom-ORD">
+
 
      <mstyle scriptlevel="0" displaystyle="true">
+
The back EMF is estimated using motor parameters and rotational speed. Also note that the entire system simplifies as follows:<br /><math>
        <msub>
 
          <mi>V</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>d</mi>
 
            <mi>q</mi>
 
          </mrow>
 
        </msub>
 
        <mo>=</mo>
 
        <mo stretchy="false">(</mo>
 
        <msub>
 
          <mi>I</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>d</mi>
 
            <mi>q</mi>
 
            <mo>,</mo>
 
            <mi>r</mi>
 
            <mi>e</mi>
 
            <mi>q</mi>
 
            <mi>u</mi>
 
            <mi>e</mi>
 
            <mi>s</mi>
 
            <mi>t</mi>
 
            <mi>e</mi>
 
            <mi>d</mi>
 
          </mrow>
 
        </msub>
 
        <mo>−<!-- − --></mo>
 
        <msub>
 
          <mi>I</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>d</mi>
 
            <mi>q</mi>
 
            <mo>,</mo>
 
            <mi>m</mi>
 
            <mi>e</mi>
 
            <mi>a</mi>
 
            <mi>s</mi>
 
            <mi>u</mi>
 
            <mi>r</mi>
 
            <mi>e</mi>
 
            <mi>d</mi>
 
          </mrow>
 
        </msub>
 
        <mo stretchy="false">)</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mn>1</mn>
 
            <mi>s</mi>
 
          </mfrac>
 
        </mrow>
 
        <mo stretchy="false">(</mo>
 
        <msub>
 
          <mi>k</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>i</mi>
 
          </mrow>
 
        </msub>
 
        <mo>+</mo>
 
        <mi>s</mi>
 
        <msub>
 
          <mi>k</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>p</mi>
 
          </mrow>
 
        </msub>
 
        <mo stretchy="false">)</mo>
 
        <mo stretchy="false">)</mo>
 
        <mo>+</mo>
 
        <msub>
 
          <mi>V</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>E</mi>
 
            <mi>M</mi>
 
            <mi>F</mi>
 
            <mo>,</mo>
 
            <mi>d</mi>
 
            <mi>q</mi>
 
          </mrow>
 
        </msub>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle V_{dq}=(I_{dq,requested}-I_{dq,measured}){\frac {1}{s}}(k_{i}+sk_{p}))+V_{EMF,dq}}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/21901ad9dcaaa3b4618afdebaf27a680089a853d" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -1.838ex; width:55.367ex; height:5.176ex;" alt="{\displaystyle V_{dq}=(I_{dq,requested}-I_{dq,measured}){\frac {1}{s}}(k_{i}+sk_{p}))+V_{EMF,dq}}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span><br class="mw_emptyline_first"><br class="mw_emptyline">The back EMF is estimated using motor parameters and rotational speed. Also note that the entire system simplifies as follows:<br data-attributes=""><span id="<@@@TAG103648@@@>" class="mceNonEditable wikimagic mw-tag" title="<math>
 
  
  
Line 751: Line 102:
  
  
</math>" data-mw-type="tag" data-mw-id="103648" data-mw-name="math" data-mw-wikitext="%3Cmath%3E%0A%0A%0AG_%7Bopen%20loop%7D(s)%20=%20G(s)G_c(s)%20=%20%5Cfrac%7B1%7D%7Bs%7D%5Cfrac%7Bk_p%7D%7BL_%7Bdq%7D%7D%0A%0A%0A%3C/math%3E" contenteditable="false"><mwspan><div class="mw-parser-output"><p><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G_{openloop}(s)=G(s)G_{c}(s)={\frac {1}{s}}{\frac {k_{p}}{L_{dq}}}}">
+
</math>
  <semantics>
+
==Torque Regulation==
    <mrow class="MJX-TeXAtom-ORD">
+
There are a couple ways to calculation the required current to achieve a desired torque
      <mstyle scriptlevel="0" displaystyle="true">
+
===Zero D-Axis Current===
        <msub>
+
This strategy is used for Surface Permanent Magnet (SPM) motors since they do not have a reluctance torque component. Maximum torque is generated when the stator field is 90* ahead of the rotor field (T = F x r). An important note is that negative current on the d-axis means that the stator field is oriented such that it fights, or weakens the rotor's magnetic field. This is called field weakening and allows SPMs to operate above their base speed.
          <mi>G</mi>
+
===Maximum Torque Per Amp (MTPA)===
          <mrow class="MJX-TeXAtom-ORD">
+
MPTA is a control strategy to obtain the greatest torque out of IPM motors, which have a difference in their Q-axis and D-axis inductances. Specifically the quantity (Lq-Ld) is positive. This is due to the fact that an IPM's rotor's magnets are buried in the rotor, rather than located on the surface as for Surface Permanent Magnet AC motors. MTPA works by introducing a small (compared to q-axis) negative d-axis current which takes advantage of reluctance torque of the IPM. Essentially, MTPA is maximizing the sum of magnetic and reluctance torque, rather than maximizing just magnetic torque with zero d-axis current.
            <mi>o</mi>
+
===Thermal Limiting===
            <mi>p</mi>
+
Losses in the motor and motor controller are a function of current. Therefore we need to reduce the current through the devices to limit the temperature of both the motor and controller.
            <mi>e</mi>
+
===Torque Ramp===
            <mi>n</mi>
+
Slowly ramp up torque (over a period of 10's or 100's of milliseconds) in order to prevent mechanical damage to drivetrain.
            <mi>l</mi>
+
==Surface Mount Permanent Magnet Machines==
            <mi>o</mi>
+
==Interior Permanent Magnet Machines==
            <mi>o</mi>
+
==Position Feedback<br />==
            <mi>p</mi>
+
Field oriented control relies on having the magnetic angle of the motor for the park transform. This can either be directly measured through an encoder or resolver (sensored control), or estimated/calculated from either the back EMF or motor impedance (sensorless control). One of the main limitations of sensorless control is that the angle is only easily estimated at either high or low speeds (depending on the method). A sensor ensures reliable angle feedback across the operating range.
          </mrow>
+
===Resolvers & Encoders===
        </msub>
+
====Calibration====
        <mo stretchy="false">(</mo>
+
==Space Vector PWM==
        <mi>s</mi>
 
        <mo stretchy="false">)</mo>
 
        <mo>=</mo>
 
        <mi>G</mi>
 
        <mo stretchy="false">(</mo>
 
        <mi>s</mi>
 
        <mo stretchy="false">)</mo>
 
        <msub>
 
          <mi>G</mi>
 
          <mrow class="MJX-TeXAtom-ORD">
 
            <mi>c</mi>
 
          </mrow>
 
        </msub>
 
        <mo stretchy="false">(</mo>
 
        <mi>s</mi>
 
        <mo stretchy="false">)</mo>
 
        <mo>=</mo>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <mn>1</mn>
 
            <mi>s</mi>
 
          </mfrac>
 
        </mrow>
 
        <mrow class="MJX-TeXAtom-ORD">
 
          <mfrac>
 
            <msub>
 
              <mi>k</mi>
 
              <mrow class="MJX-TeXAtom-ORD">
 
                <mi>p</mi>
 
              </mrow>
 
            </msub>
 
            <msub>
 
              <mi>L</mi>
 
              <mrow class="MJX-TeXAtom-ORD">
 
                <mi>d</mi>
 
                <mi>q</mi>
 
              </mrow>
 
            </msub>
 
          </mfrac>
 
        </mrow>
 
      </mstyle>
 
    </mrow>
 
    <annotation encoding="application/x-tex">{\displaystyle G_{openloop}(s)=G(s)G_{c}(s)={\frac {1}{s}}{\frac {k_{p}}{L_{dq}}}}</annotation>
 
  </semantics>
 
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0dc5d51749701c323f3d0daa405c72c74cf698d3" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.505ex; width:34.107ex; height:6.176ex;" alt="{\displaystyle G_{openloop}(s)=G(s)G_{c}(s)={\frac {1}{s}}{\frac {k_{p}}{L_{dq}}}}"></span>
 
</p></div><div class="mceNonEditableOverlay"></div></mwspan></span><br class="mw_emptyline_first"><br class="mw_emptyline"><br class="mw_emptyline"><br class="mw_emptyline"><br class="mw_emptyline"><div><h2>Torque Regulation</h2></div><div><h2>Surface Mount Permanent Magnet Machines</h2></div><div><h2>Interior Permanent Magnet Machines</h2></div><div><h2>Position Feedback<br data-attributes=""></h2></div>Field oriented control relies on having the magnetic angle of the motor for the park transform. This can either be directly measured through an encoder or resolver (sensored control), or estimated/calculated from either the back EMF or motor impedance (sensorless control). One of the main limitations of sensorless control is that the angle is only easily estimated at either high or low speeds (depending on the method). A sensor ensures reliable angle feedback across the entire operating range.<div><h3>Resolvers &amp; Encoders</h3></div><div><h4>Calibration</h4></div><div><h2>Space Vector PWM</h2></div>
 
  
 
=Field Oriented Control for Asynchronous Machines=
 
=Field Oriented Control for Asynchronous Machines=

Latest revision as of 05:16, 25 December 2024


Motor control is a complex field which requires knowledge of linear algebra, control theory, and an understanding of electric machines. However, the overarching goal of every style of motor control is this keyword (look it up): rotating magnetic field, or RMF. This page aims to break down various styles of motor control, but focuses on the primary modern method, Field-Oriented Control or FOC.

Inverter Setup

While the theory behind FOC is important to understand, most teams should be focusing on getting their motor controller working with their motor. This means understanding what parameters can be changed in a typical motor controller and how that may affect the operation of your motor. Some common parameters include:

  • Resolver offset: informs the motor controller where the magnetic north, or D-axis of the rotor is relative to the position of the resolver/encoder on the motor shaft. Essentially, it's quite hard to get the resolver/encoder sensor perfectly aligned with the rotor field when installing the sensor, so this offset tells the controller the relative position of the sensor compared to the rotor. In other words, how off you were when you randomly threw the sensor on the motor shaft.
    • Most controllers have a calibration procedure to dial this value in. Getting this value correct is essential to proper motor/controller operation & preventing errors or even damage to components
  • Switching/carrier frequency: this is the switching frequency of the motor controller's power stage. Ranges from 4.4-20kHz. The higher the switching frequency, the smoother/higher-resolution the sine wave. This has the advantage of lowering eddy current losses & associated heating in the motor, but increases losses in the motor controller since more switching events -> IGBTs/MOSFETs are transitioning more frequently -> more heat generated in the controller
    • Note: low-inductance/resistance motors require a higher switching frequency since having a high inductance/resistance helps to smooth the sine waves being generated from the controller. Thus, the sine waves coming out of the controller don't need to be as smooth = lower switching frequency if the motor has more of a smoothing effect
  • Battery current limit: limits how much current the controller draws from the battery. This should be set relative to the maximum current the pack can produce without overheating
  • Phase current limit: sets the limit of the current in any of the motor's 3 phases. This is directly proportional to the torque that the motor produces. This is NOT the same as the battery current and can be 2-3x higher based on the Kv (voltage constant) of the motor windings.
  • PI loop gains: Changes the aggressiveness of the PI loops when there is an error between reference & measured DQ currents. These are typically preset by the controller manufacturer for specific motors and SHOULD NOT be changed unless there is an obvious issue with how the controller is commanding current
    • One way to tune these is to observe overshoot & drift in the commanded DQ currents: more overshoot indicates Kp may be too high while excessive drift means Ki may be too low

Six-Step Control

Field Oriented Control for Synchronous Machines

Most FSAE-grade motor controllers use Field-Oriented Control. This decouples the torque and flux (magnetic field strength) control within the motor, which offers improved efficiency and dynamic performance of the motor & controller. To summarize, there are 7 main steps to FOC.

  1. Measure phase currents and rotor position - done using 2 or 3 phase current sensors + encoder/resolver for rotor position
  2. Clarke transform - linear transformation from the 3-phase stationary (abc) to 2-phase stationary (alpha/beta) of the currents in the stator windings
  3. Park transform - linear transformation from the 2-phase stationary (alpha/beta) to 2-phase rotating frame (DQ) - this turns the 2-phase currents in the stator windings into 2-phase currents that the rotor sees as it rotates
    1. Here is the important part: the Q-axis of the rotor is what controls torque while the D-axis of the rotor controls the flux. Since we can request D and Q-axis currents independently now, we can control the torque and flux separately respectively
  4. PI control loops: set the D-axis and Q-axis currents of the rotor based on the error between reference values given by throttle position and measured values from the phase current & rotor position sensors
  5. Inverse-Park transform: going back from the 2-phase rotating (DQ) frame to the 2-phase stationary (alpha/beta) frame
  6. Inverse-Clarke transform: going back from the 2-phase stationary (alpha/beta) to the 3-phase stationary (abc) frame
  7. SVPWM: space-vector pulse-width modulation: calculates the required PWM signals for the IGBT/MOSFET half-bridges to generate the correct 3x AC phase voltages which drive currents in each phase


Transformations

Clarke Transform

The Clarke transform is used to convert the measurements of the phase currents or voltages to a rectangular 2d space vector, which represents both a complex phasor representing the AC current in the phases, and a vector with the same direction of the magnetic field that the current will create. The real axis/the axis aligned with the phase A vector is called , while the imaginary axis/perpendicular axis is labeled . k is a scaling factor, where results in a vector with the same magnitude as the original 3-phase signals, and results in a power-invariant transform.

Park Transform

The Park transform is used to transform quantities from being referenced to the stator to being referenced to the rotor. The -frame is "stationary", as in the axes remain fixed while the current and voltage vector spins around with the rotor. in the DQ-frame, because it is referenced so the D axis always is aligned with a north pole on the rotor, constant current results in constant torque regardless of rotation. The transform itself is simply a rotation matrix, rotating the -frame by the electrical angle of the rotor.

Current Regulation

A PI controller is commonly used to regulate the currents. This is explained by starting with a simple motor model in the DQ-frame (the motor is represented by a voltage source, resistance, and inductance).


We can then write the equation for the system as follows:


The pole of the system can be cancelled out by a an appropriately tuned PI controller. The equation for the entire current controller can then be written as follows:


More explicitly, the desired output voltage at any given point in time can be written as:


The back EMF is estimated using motor parameters and rotational speed. Also note that the entire system simplifies as follows:

Torque Regulation

There are a couple ways to calculation the required current to achieve a desired torque

Zero D-Axis Current

This strategy is used for Surface Permanent Magnet (SPM) motors since they do not have a reluctance torque component. Maximum torque is generated when the stator field is 90* ahead of the rotor field (T = F x r). An important note is that negative current on the d-axis means that the stator field is oriented such that it fights, or weakens the rotor's magnetic field. This is called field weakening and allows SPMs to operate above their base speed.

Maximum Torque Per Amp (MTPA)

MPTA is a control strategy to obtain the greatest torque out of IPM motors, which have a difference in their Q-axis and D-axis inductances. Specifically the quantity (Lq-Ld) is positive. This is due to the fact that an IPM's rotor's magnets are buried in the rotor, rather than located on the surface as for Surface Permanent Magnet AC motors. MTPA works by introducing a small (compared to q-axis) negative d-axis current which takes advantage of reluctance torque of the IPM. Essentially, MTPA is maximizing the sum of magnetic and reluctance torque, rather than maximizing just magnetic torque with zero d-axis current.

Thermal Limiting

Losses in the motor and motor controller are a function of current. Therefore we need to reduce the current through the devices to limit the temperature of both the motor and controller.

Torque Ramp

Slowly ramp up torque (over a period of 10's or 100's of milliseconds) in order to prevent mechanical damage to drivetrain.

Surface Mount Permanent Magnet Machines

Interior Permanent Magnet Machines

Position Feedback

Field oriented control relies on having the magnetic angle of the motor for the park transform. This can either be directly measured through an encoder or resolver (sensored control), or estimated/calculated from either the back EMF or motor impedance (sensorless control). One of the main limitations of sensorless control is that the angle is only easily estimated at either high or low speeds (depending on the method). A sensor ensures reliable angle feedback across the operating range.

Resolvers & Encoders

Calibration

Space Vector PWM

Field Oriented Control for Asynchronous Machines