<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Trigonometry-Free SVPWM Algorithm and FPGA Application Simulation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Kai Zhang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Caiyun Wu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Shenyang Ligong University</institution>
          ,
          <addr-line>Shenyang</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <fpage>149</fpage>
      <lpage>155</lpage>
      <abstract>
        <p>SVPWM algorithm is widely used in motor control systems, but the traditional SVPWM algorithm is complicated in the calculation of the normal vector and the calculation of the adjacent vector action time, and the existence of irrational factors causes the problem of poor data accuracy, to solve the above shortcomings, a TF-SVPWM (Trigonometry-Free SVPWM algorithm) algorithm is proposed. First, the three-phase voltage is obtained by introducing the Clarke inverse transform, thus changing the trigonometric operation into an addition and subtraction operation, and reducing the complexity of the operation by eliminating the irrational number factor; then, the TF-SVPWM algorithm is verified in the Simulink environment; finally, the TF-SVPWM algorithm is implemented in the FPGA, and the data accuracy is improved by avoiding the calculation of irrational numbers. Theoretical analysis and simulation results show that the TF-SVPWM algorithm makes the operation of sector and adjacent vector action time simple and easy to implement on FPGA, leaving enough resources for the implementation of the whole motor control system.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;SVPWM algorithm</kwd>
        <kwd>Clarke inverter</kwd>
        <kwd>three-phase voltage</kwd>
        <kwd>FPGA</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Space Vector Pulse Width Modulation (SVPWM) is commonly used in the vector control of
permanent magnet synchronous motors and brushless DC motors because of its low waveform
distortion, high voltage utilization, and easy implementation in control systems [1-2].</p>
      <p>Currently, motor control systems implement SVPWM algorithms mostly using microcontrollers or
digital signal processors. However, the functions of both rely on the sequential execution of the program
to achieve. Therefore, the algorithm execution delay is large and limited execution efficiency.
Compared to them, FPGA (Field-Programmable Gate Array), field-programmable gate arrays, have the
advantages of parallel architecture, flexibility, and low power consumption, which are more suitable
for implementing SVPWM algorithms.</p>
      <p>Literature [3] made a detailed analysis of the traditional SVPWM algorithm and gave simulation
results, but it is only applicable to the Simulink environment and cannot be directly used in the actual
control system; literature [4] proposed a sector judgment method simulating human eye recognition,
and the sector judgment condition was simplified, but its adjacent vector action time calculation was
not simplified; 1literature [5] proposes an SVPWM algorithm based on line voltage calculation, using
the phase angle of the line voltage converted to phase voltage, and the phase angle is used as the input
parameter of the SVPWM algorithm to calculate the sector free from the complex calculation formula,
but the sine and cosine of the phase angle should be calculated when the adjacent vector action time,
while the calculation formula becomes more complicated due to the existence of irrational number
factor.</p>
      <p>Considering the above literature, the SVPWM algorithm needs to calculate the complex
trigonometric function problem in the sector calculation and adjacent vector action time, and the
problem of poor calculation accuracy caused by the irrational number factor is also considered.
Therefore, a TF-SVPWM (Trigonometry-Free SVPWM algorithm, TF-SVPWM) algorithm is proposed
in this paper. The Clarke inversion is introduced, and the resulting three-phase voltage avoids the
trigonometric operation and eliminates the irrational factor. The TF-SVPWM algorithm is simulated in
a Simulink environment to verify the effectiveness of the algorithm. Finally, this paper uses FPGA to
implement the TF-SVPWM algorithm to avoid floating point fixed points, reduce the number of
operations, and make the accuracy of operations improved. The theoretical analysis and simulation
results show that the TF-SVPWM algorithm proposed in this paper is simpler than the traditional
SVPWM algorithm in terms of sector calculation formula and adjacent vector action time calculation
formula, and the data accuracy is higher than that of the traditional algorithm. In addition, the algorithm
proposed in this paper can be implemented on FPGA, which reduces the consumption of hardware
resources and has certain theoretical and engineering application value.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Coordinate transformation of vector control</title>
      <p>Vector control theory mainly decouples the control equations of the AC motor, controls the magnetic
chain and torque of the motor separately and independently, and controls the AC motor with the same
idea as controlling the DC motor. Since the magnetic chain, current, and voltage of the AC motor are
rotating vector quantities, the coordinate transformation transforms each physical quantity of the motor
from the stationary three-phase coordinate system to the rotating two-phase coordinate system, and the
sinusoidal quantities input to the AC motor are decoupled into the direct flow. The input parameter of
the conventional SVPWM algorithm is the two-phase cross-flow after the Park inversion, but irrational
numbers are introduced in the calculation of the intermediate variables. To reduce the computational
complexity, the irrational number factor is eliminated to facilitate FPGA implementation. For this
reason, this paper will introduce Clarke's inverse transform based on the traditional SVPWM algorithm.</p>
    </sec>
    <sec id="sec-3">
      <title>2.1. Park inverter</title>
      <p>
        In motor control systems, to achieve the two-phase cross-flow required by the SVPWM algorithm,
the current ones are used to obtain the AC quantities by the coordinate transformation of the straight
flow rate regulated by the PID link using the Park inversion. The specific method is to transform the
rotating coordinate system (d-q coordinate system) voltages Ud, Uq to the two-phase stationary
coordinate system (α-β coordinate system) to obtain the input parameters Uα, Uβ of the SVPWM
algorithm. the Park inversion matrix is shown in equation (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ).
      </p>
      <p>U  cos -sin  Ud 
U  = cos sin  Uq 
（1）
where: Ud, Uq is the voltages in the d-axis and q-axis, and θ is the angle through which the rotor turns.</p>
      <p>The conventional SVPWM algorithm uses the voltages Uα and Uβ of the Park inversion to calculate
the sector and adjacent vector action time, thus introducing irrational numbers, which makes the formula
for calculating the sector and adjacent vector action time complicated.</p>
      <p>To eliminate the irrational numbers, simplify the sector judgment conditions, reduce the complexity
of calculating the sector and adjacent vector action times, and avoid the degradation of accuracy when
processing data in FPGA, Clarke's inverse transform is introduced in this paper.</p>
    </sec>
    <sec id="sec-4">
      <title>2.2. Clarke inverters</title>
      <p>
        After the Park inversion, the voltages Uα and Uβ are again coordinate transformation. The coordinate
transformation is carried out from a two-phase coordinate system (α-β coordinate system) to a
threephase coordinate system (a-b-c coordinate system), The three-phase voltages UA, UB, and UC calculate
the intermediate variables eliminating the irrational number factor and reducing the number of
operations. The Clarke inverse transformation matrix is shown in equation (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ).
      </p>
      <p>
UUA  =  -112
 B 
U 
 C  - 12</p>
      <p>
0 
3  U </p>
      <p>
2  U 
3 
2 
（2）
where: Uα and Uβ are the voltages of the α-axis and β-axis.</p>
      <p>
        Although irrational numbers exist in Eq. (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ), the TF-SVPWM algorithm does not affect the accuracy
of the algorithm because it directly uses the re-obtained UA, UB, and UC, avoiding the problem of
irrational numbers introduced by the two-phase voltage calculation.
      </p>
    </sec>
    <sec id="sec-5">
      <title>3. TF-SVPWM algorithm</title>
      <p>The coordinate transformation is studied in the previous paper, and the conventional algorithm is
studied in the following, and then the three-phase voltage obtained from the Clarke inversion is applied
to the SVPWM algorithm, and the TF-SVPWM algorithm is obtained after theoretical derivation.</p>
    </sec>
    <sec id="sec-6">
      <title>3.1. Traditional SVPWM algorithm</title>
      <p>
        According to the literature [6], three variables A, B, and C are defined in the calculation of sectors
in equation (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ). then the variable N=4C+2B+A is defined, if A&gt;0, N=1; if B&gt;0, N=2; if C&gt;0, N=4. The
values of six sectors are obtained from the combination of A, B, and C.
      </p>
      <p>
        A = U
B = − 23 U − 12 U
C = 23 U − 12 U
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
      </p>
      <p>
        Calculating the adjacent vector action time requires defining the three variables X, Y, and Z of
equation (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ).
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
where: TPWM is the period of the PWM wave, Udc is the bus voltage, and Uα and Uβ are the voltages of
the α-axis and β-axis.
      </p>
      <p>
        From Eqs. (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) and (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ), it can be seen that the sector calculation formula and the adjacent vector
action time calculation formula have complicated structures and are not easy to implement on FPGA.
For this reason, the TF-SVPWM algorithm is proposed below.
      </p>
    </sec>
    <sec id="sec-7">
      <title>3.2. TF-SVPWM algorithm</title>
      <p>
        (
        <xref ref-type="bibr" rid="ref5">5</xref>
        ).
      </p>
      <p>The instantaneous value expression of the three-phase symmetric sine voltage is shown in equation

X =



Y =


Y =


3TPWM U
Udc</p>
      <p>
3TPWM ( 3 U + 1 U )
Udc 2 2 
3TPWM (− 3
Udc 2</p>
      <p>U + 1 U )</p>
      <p>2 
A = UB − UC

B = UA − UC

C = UB − UA
X = TPWM (UB − UC )

 Udc

Y = TPWM (UA − UC )

 Udc

Z = TPWM (UB − UA )
 Udc
where: Um is the peak value of phase voltage and ω is the angular frequency of phase voltage.</p>
      <p>
        The vector of the three-phase voltage synthesis is shown in equation (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ). The synthesized vector
amplitude is equated to the output voltage amplitude, so the rotated vector after synthesis is multiplied
by a factor of 2/3.
where: U = 13 (UB − UC ) , U = 13 (UB − UC ) .
      </p>
      <p>Redefine A, B, and C as shown in equation (7).
(7)</p>
      <p>
        Substituting the expressions of Uα and Uβ into equation (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) yields the expressions of variables X, Y,
and Z as shown in equation (8).
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
(8)
      </p>
      <p>From Eqs. (7) and (8), it can be seen that the trigonometric function operation is avoided, which
reduces the computational effort; the structure of the sector calculation formula and the adjacent vector
action time calculation formula obtained from the three-phase voltage is simpler compared to the
twophase voltage, and there are no irrational numbers in the formula thus improving the data accuracy.
Therefore, the TF-SVPWM algorithm is easier to implement on FPGA than the traditional algorithm.</p>
      <p>In this section, the improved SVPWM algorithm is obtained after theoretical derivation, and the
TFSVPWM algorithm is simulated in the Simulink environment below.</p>
    </sec>
    <sec id="sec-8">
      <title>3.3. TF-SVPWM algorithm simulation</title>
      <p>According to Equation (7), the simulation results of sectors are obtained as shown in Figure 1. From
Figure 1, it can be seen that the sectors appear in the order of 3-1-5-4-6-2, which is by the law of sector
appearance. Then, the duty cycle calculation method in the literature [6] is used in the TF-SVPWM
algorithm, and the simulation results of the duty cycle are shown in Fig. 2, which are similar to the
conventional algorithm as saddle wave. Therefore, the variables A, B, and C defined by the TF-SVPWM
algorithm are correct.
Figure.2: duty cycle</p>
      <p>It can be seen from Fig. 1 and Fig. 2 that the sector and duty cycle curves obtained from the
simulation of the TF-SVPWM algorithm are similar to those of the literature [6]; therefore, the
algorithm proposed in this paper is correct. In the following, the coordinate transformation is
implemented by FPGA, and then the TF-SVPWM algorithm is implemented.</p>
    </sec>
    <sec id="sec-9">
      <title>4. FPGA Implementation of Coordinate Transformation</title>
      <p>The algorithm proposed in this paper solves the problem of needing to calculate trigonometric
functions in traditional algorithms, avoids calculating floating point numbers on FPGAs, and has higher
data accuracy. the TF-SVPWM algorithm has a simple structure compared to traditional algorithms, is
easier to implement on FPGA, and consumes fewer hardware resources.</p>
    </sec>
    <sec id="sec-10">
      <title>4.1. FPGA implementation of the Park inverter</title>
      <p>
        In this paper, we use the Cordic algorithm to realize the sine and cosine values needed for Park's
inverse conversion and follow equation (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) to directly call the multiplier IP core to realize the
multiplication of two direct flows with sine and cosine functions. The simulation results are shown in
Figure 3, Sin and Cos are the output sine and cosine values, and finally, the two intersecting flows are
obtained Uα and Uβ.
      </p>
    </sec>
    <sec id="sec-11">
      <title>4.2. FPGA implementation of the Clarke inverter</title>
      <p>To save the logic resources of the chip, the Clarke inversion is implemented by replacing the
3
2
multiplication with a shift operation by using equation (9). The simulation results are shown in
Figure 4, and the three-phase voltages UA, UB, and UC are obtained.</p>
      <p>3  2−1 + 2−2 + 2−4 + 2−5 + 2−6 + 2−8 + 2−9 + 2−10 + 2−11
2
(9)</p>
    </sec>
    <sec id="sec-12">
      <title>5. TF-SVPWM algorithm FPGA implementation</title>
      <p>The core algorithm of TF-SVPWM consists of a sector calculation module, adjacent vector action
time calculation module, three-way duty cycle calculation module, PWM signal generation module, and
dead time setting module. From Figure 5, we can see that the sectors appear in the order of
3-1-5-4-62, which is to the design requirements; the simulation results of the three-way duty cycle are all saddle
waves as shown in Figure 6, therefore, it is verified that the TF-SVPWM algorithm proposed in this
paper is correct.</p>
    </sec>
    <sec id="sec-13">
      <title>6. Conclusion</title>
      <p>To address the problem that the conventional SVPWM algorithm requires the calculation of complex
trigonometric functions for the sector and adjacent vector action times, this paper proposes the
TFSVPWM algorithm and FPGA implementation. Firstly, the three-phase voltage is obtained by using the
Clarke inversion, which eliminates the irrational number factor, simplifies the formula structure,
reduces the computational complexity of the sector and the adjacent vector action time, and improves
the data accuracy. Then, the TF-SVPWM algorithm is simulated in the Simulink environment and
implemented on the FPGA platform to realize the TF-SVPWM algorithm without fixed-point operation.
In addition, the proposed algorithm has advantages in terms of hardware resource consumption and data
accuracy; it leaves enough hardware resources for the implementation of the whole motor control
system; using the TF-SVPWM algorithm proposed in this paper for vector control of permanent magnet
synchronous motor, and then completing the whole motor closed-loop control system is the next step
to be done.</p>
    </sec>
    <sec id="sec-14">
      <title>7. References</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Shi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Xin</surname>
          </string-name>
          , and
          <string-name>
            <given-names>L.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>"Simulation of PMSM field-oriented control based on SVPWM," 2017 29th Chinese Control And Decision Conference (CCDC</article-title>
          ),
          <year>2017</year>
          , pp.
          <fpage>7407</fpage>
          -
          <lpage>7411</lpage>
          , doi: 10.1109/CCDC.
          <year>2017</year>
          .
          <volume>7978524</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Vinayaka</surname>
            <given-names>K U</given-names>
          </string-name>
          and
          <string-name>
            <surname>Priya</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <article-title>"Analysis of BLDC motor performance using space vector pulse width modulation,"</article-title>
          <source>2016 International Conference on Computation of Power, Energy Information and Communication (ICCPEIC)</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>549</fpage>
          -
          <lpage>552</lpage>
          , doi:10.1109/ICCPEIC.
          <year>2016</year>
          .
          <volume>7557292</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Xin</given-names>
            <surname>Zhou</surname>
          </string-name>
          and
          <string-name>
            <given-names>J. X.</given-names>
            <surname>Jin</surname>
          </string-name>
          ,
          <article-title>"A universal simulation model for motor control based on SVPWM,"</article-title>
          <source>2011 International Conference on Applied Superconductivity and Electromagnetic Devices</source>
          ,
          <year>2011</year>
          , pp.
          <volume>212215</volume>
          ,
          <issue>doi</issue>
          :10.1109/ASEMD.
          <year>2011</year>
          .
          <volume>6145103</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Q.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Deng</surname>
          </string-name>
          , M. Cheng, and G. Buja,
          <article-title>"A Novel Method Simulating Human Eye Recognition for Sector Judgement of SVPWM Algorithm,"</article-title>
          <source>in IEEE Access</source>
          , vol.
          <volume>8</volume>
          , pp.
          <fpage>90216</fpage>
          -
          <lpage>90224</lpage>
          ,
          <year>2020</year>
          , DOI: 10.1109/ACCESS.
          <year>2020</year>
          .
          <volume>2993806</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>W.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Chen</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>"A Novel Engineering Implementation of SVPWM Based on onLine Voltage Information</article-title>
          ,
          <article-title>"</article-title>
          <source>2018 IEEE 2nd International Conference on Circuits, System and Simulation (ICCSS)</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>52</fpage>
          -
          <lpage>55</lpage>
          , doi:10.1109/CIRSYSSIM.
          <year>2018</year>
          .
          <volume>8525917</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>X.</given-names>
            <surname>Liang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Luo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Yuan</surname>
          </string-name>
          and
          <string-name>
            <given-names>Z.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <article-title>"Research and implementation of SVPWM control algorithm based on FPGA,"</article-title>
          <source>2016 IEEE International Conference on Mechatronics and Automation</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>22</fpage>
          -
          <lpage>26</lpage>
          , doi:10.1109/ICMA.
          <year>2016</year>
          .
          <volume>7558528</volume>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>