<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6">
  <compounddef id="regulace_8cpp" kind="file">
    <compoundname>regulace.cpp</compoundname>
    <includes local="no">math.h</includes>
    <includes refid="nastaveni__regulatoru__float_8h" local="yes">nastaveni_regulatoru_float.h</includes>
    <includes refid="regulace_8h" local="yes">regulace.h</includes>
    <incdepgraph>
      <node id="790">
        <label>regulace.h</label>
        <link refid="regulace_8h-source"/>
      </node>
      <node id="787">
        <label>work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp</label>
        <link refid="regulace.cpp"/>
        <childnode refid="788" relation="include">
        </childnode>
        <childnode refid="789" relation="include">
        </childnode>
        <childnode refid="790" relation="include">
        </childnode>
      </node>
      <node id="789">
        <label>nastaveni_regulatoru_float.h</label>
        <link refid="nastaveni__regulatoru__float_8h-source"/>
      </node>
      <node id="788">
        <label>math.h</label>
      </node>
    </incdepgraph>
      <sectiondef kind="define">
      <memberdef kind="define" id="regulace_8cpp_1525335710b53cb064ca56b936120431e" prot="public" static="no">
        <name>_USE_MATH_DEFINES</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="13" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="13" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="var">
      <memberdef kind="variable" id="regulace_8cpp_1d326b4d3473dcc30a7320073b1a86411" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double ud</definition>
        <argsstring></argsstring>
        <name>ud</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="28" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="28" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_174352e2af5ca7b52f4e791577b424c37" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double uq</definition>
        <argsstring></argsstring>
        <name>uq</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="28" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="28" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_12c34e6d1341d3ee390071ecaf9411914" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double alfa</definition>
        <argsstring></argsstring>
        <name>alfa</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="28" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="28" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_19424343761f8c4f4c1afe8f5b6bf471b" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double beta</definition>
        <argsstring></argsstring>
        <name>beta</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="28" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="28" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1a6543b2bc53bf16c6be8dbdfa0c5137c" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Sid</definition>
        <argsstring></argsstring>
        <name>Sid</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="29" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="29" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1738b424830c2456934492c1f1ebf8248" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Siq</definition>
        <argsstring></argsstring>
        <name>Siq</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="29" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="29" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_155885ac468775a6ca90a0f4264404729" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Surm</definition>
        <argsstring></argsstring>
        <name>Surm</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="29" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="29" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_102eeeeb5f00d724a3c82fb1d4ef8e8ed" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Iqwmax</definition>
        <argsstring></argsstring>
        <name>Iqwmax</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="32" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="32" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1d086f926f71e503743270604a5347508" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Iqw_reg</definition>
        <argsstring></argsstring>
        <name>Iqw_reg</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="32" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="32" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_151a59ff927f4ff0f0676c12e5c894a79" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Idw_urm</definition>
        <argsstring></argsstring>
        <name>Idw_urm</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="33" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="33" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1fa36cff2636c989fe0fa5c30e14d8d01" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Sw</definition>
        <argsstring></argsstring>
        <name>Sw</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="36" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="36" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_16adf77edbad3c6c9a69c0f2b7c9ab99a" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double U</definition>
        <argsstring></argsstring>
        <name>U</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="38" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="38" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1861a0366ee90e5e1cf56cafe74ddaabe" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Um</definition>
        <argsstring></argsstring>
        <name>Um</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="39" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="39" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1e490ab2f2d71bb4fbe86fe8a62a60aeb" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Urmf</definition>
        <argsstring></argsstring>
        <name>Urmf</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="39" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="39" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_104c723a40b1200dacfcdcaaf51bbf5a4" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Kodv_ud</definition>
        <argsstring></argsstring>
        <name>Kodv_ud</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="42" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="42" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_12a8671331ef13ec24076a290487409d5" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Kodv_uind</definition>
        <argsstring></argsstring>
        <name>Kodv_uind</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="42" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="42" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1d900a67bffe289dfbb015b908a2d1685" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Isd</definition>
        <argsstring></argsstring>
        <name>Isd</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="44" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_11c6d368fcf2a6b1c92e39c124d25d737" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Isq</definition>
        <argsstring></argsstring>
        <name>Isq</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="44" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1faeae9ee7305d7ca47b2707b9e1823ca" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Fs</definition>
        <argsstring></argsstring>
        <name>Fs</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="44" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1558972170606cd05054ab130beabad1e" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Fmag</definition>
        <argsstring></argsstring>
        <name>Fmag</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="44" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_115f09e12710588f190ffb75c32fd70e4" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double moment</definition>
        <argsstring></argsstring>
        <name>moment</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="44" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1bad4eebf61961d8f4731374800617981" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double K_Fs</definition>
        <argsstring></argsstring>
        <name>K_Fs</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="44" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_111a8f4d80b873b7ecfe5daf87b96c89a" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double K_moment</definition>
        <argsstring></argsstring>
        <name>K_moment</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="44" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1549a89c8114ff1e3d28010e2e1d3d862" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double Ismaxf2</definition>
        <argsstring></argsstring>
        <name>Ismaxf2</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="45" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="45" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_1a3378773e6dd84aeb1bcf451ba1d9025" prot="public" static="yes" mutable="no">
        <type>double</type>
        <definition>double tmp_omezeni</definition>
        <argsstring></argsstring>
        <name>tmp_omezeni</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="45" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="45" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="regulace_8cpp_18bf8016d7dc5deb088c84616ca363fbc" prot="public" static="no" mutable="no">
        <type>double</type>
        <definition>double Treg</definition>
        <argsstring></argsstring>
        <name>Treg</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="47" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="47" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="regulace_8cpp_1f1ab9d3fe7fb20fb6b2e7585725e72ea" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void init_regulace</definition>
        <argsstring>(double Ls, double Fpm, double kp, double p, double TV)</argsstring>
        <name>init_regulace</name>
        <param>
          <type>double</type>
          <declname>Ls</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Fpm</declname>
        </param>
        <param>
          <type>double</type>
          <declname>kp</declname>
        </param>
        <param>
          <type>double</type>
          <declname>p</declname>
        </param>
        <param>
          <type>double</type>
          <declname>TV</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="20"/>
      </memberdef>
      <memberdef kind="function" id="regulace_8cpp_171d09500b31dfce56234053b946cbf34" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void vektor_regulace</definition>
        <argsstring>(double Idw, double Iqw, double Urm_max, double Ww, double *u, double Isx, double Isy, double theta, double rychlost, double Ucn_2, double Uc, double Ucn, unsigned int rezim)</argsstring>
        <name>vektor_regulace</name>
        <param>
          <type>double</type>
          <declname>Idw</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Iqw</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Urm_max</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Ww</declname>
        </param>
        <param>
          <type>double *</type>
          <declname>u</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Isx</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Isy</declname>
        </param>
        <param>
          <type>double</type>
          <declname>theta</declname>
        </param>
        <param>
          <type>double</type>
          <declname>rychlost</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Ucn_2</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Uc</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Ucn</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>rezim</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="21"/>
      </memberdef>
      <memberdef kind="function" id="regulace_8cpp_1154c64d72d9a6e1e1d5621c6561372eb" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>double</type>
        <definition>double pi_reg</definition>
        <argsstring>(double epsilon, double Kpf, double Kif, double MAX, double MIN, double *S)</argsstring>
        <name>pi_reg</name>
        <param>
          <type>double</type>
          <declname>epsilon</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Kpf</declname>
        </param>
        <param>
          <type>double</type>
          <declname>Kif</declname>
        </param>
        <param>
          <type>double</type>
          <declname>MAX</declname>
        </param>
        <param>
          <type>double</type>
          <declname>MIN</declname>
        </param>
        <param>
          <type>double *</type>
          <declname>S</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="23" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="67" bodyend="78"/>
      </memberdef>
      <memberdef kind="function" id="regulace_8cpp_1d52cd3d5f2f7c2561b9d318c3d9e66a8" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>double</type>
        <definition>double uhel</definition>
        <argsstring>(double x, double y)</argsstring>
        <name>uhel</name>
        <param>
          <type>double</type>
          <declname>x</declname>
        </param>
        <param>
          <type>double</type>
          <declname>y</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="24" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="50" bodyend="64"/>
      </memberdef>
      <memberdef kind="function" id="regulace_8cpp_1355f57120e187949afdadc570d5c5bd6" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void filtr</definition>
        <argsstring>(double U, double *Uf, double kt)</argsstring>
        <name>filtr</name>
        <param>
          <type>double</type>
          <declname>U</declname>
        </param>
        <param>
          <type>double *</type>
          <declname>Uf</declname>
        </param>
        <param>
          <type>double</type>
          <declname>kt</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" line="25" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp" bodystart="80" bodyend="86"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/********************************************</highlight></codeline>
<codeline lineno="2"><highlight class="comment"></highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Vector<sp/>control<sp/>of<sp/>PMSM<sp/>Drive</highlight></codeline>
<codeline lineno="4"><highlight class="comment"></highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Control<sp/>-<sp/>floating<sp/>point</highlight></codeline>
<codeline lineno="6"><highlight class="comment"></highlight></codeline>
<codeline lineno="7"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Z.<sp/>Peroutka</highlight></codeline>
<codeline lineno="8"><highlight class="comment"></highlight></codeline>
<codeline lineno="9"><highlight class="comment">Rev.<sp/>16.3.2008</highlight></codeline>
<codeline lineno="10"><highlight class="comment"></highlight></codeline>
<codeline lineno="11"><highlight class="comment">*********************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>_USE_MATH_DEFINES</highlight></codeline>
<codeline lineno="14"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;math.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;nastaveni_regulatoru_float.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;regulace.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>init_regulace(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ls,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Fpm,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>kp,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>p,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>TV);</highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>vektor_regulace(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Idw,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Iqw,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Urm_max,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ww,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*u,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Isx,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Isy,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>theta,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>rychlost,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ucn_2,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Uc,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ucn,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rezim);</highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>pi_reg(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>epsilon,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Kpf,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Kif,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>MAX,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>MIN,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*S);</highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>uhel(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>y);</highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>filtr(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>U,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*Uf,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>kt);</highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"></highlight><highlight class="comment">//<sp/>regulatory<sp/>proudu</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ud,<sp/>uq,<sp/>alfa,<sp/>beta;</highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Sid,<sp/>Siq,<sp/>Surm;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="comment">//<sp/>omezeni<sp/>momentu</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Iqwmax,<sp/>Iqw_reg;</highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Idw_urm;</highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="comment">//<sp/>regulator<sp/>rychlosti</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Sw;</highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>U;</highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Um,<sp/>Urmf;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>velikost<sp/>napeti</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal"></highlight><highlight class="comment">//<sp/>odvazbovaci<sp/>obvod<sp/>-<sp/>blok<sp/>vypocet<sp/>napeti</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Kodv_ud,<sp/>Kodv_uind;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Isd,<sp/>Isq,<sp/>Fs,<sp/>Fmag,<sp/>moment,<sp/>K_Fs,<sp/>K_moment;</highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ismaxf2,<sp/>tmp_omezeni;</highlight></codeline>
<codeline lineno="46"><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Treg;</highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>uhel(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>y)</highlight></codeline>
<codeline lineno="51"><highlight class="normal">{</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>th;</highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x==0)</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(y==0)<sp/>th=0.;</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(y&gt;0)<sp/>th=M_PI/2.;</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>th=-M_PI/2.;</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/>th=atan(y/x);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"></highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x&lt;0)<sp/>th+=M_PI;</highlight></codeline>
<codeline lineno="62"><highlight class="normal"></highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>th;</highlight></codeline>
<codeline lineno="64"><highlight class="normal">}</highlight></codeline>
<codeline lineno="65"><highlight class="normal"></highlight></codeline>
<codeline lineno="66"><highlight class="normal"></highlight></codeline>
<codeline lineno="67"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>pi_reg(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>epsilon,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Kpf,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Kif,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>MAX,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>MIN,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*S)</highlight></codeline>
<codeline lineno="68"><highlight class="normal">{</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>out;</highlight></codeline>
<codeline lineno="70"><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/>out=Kpf*epsilon+*S;</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(out&gt;MAX)<sp/>out=MAX;</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(out&lt;MIN)<sp/>out=MIN;</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/>*S+=Kif*epsilon;</highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>out;</highlight></codeline>
<codeline lineno="78"><highlight class="normal">}</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>filtr(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>U,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*Uf,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>kt)</highlight></codeline>
<codeline lineno="81"><highlight class="normal">{</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ufpom;</highlight></codeline>
<codeline lineno="83"><highlight class="normal"></highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/>Ufpom=*Uf;</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/>*Uf=Ufpom+kt*(U-*Uf);</highlight></codeline>
<codeline lineno="86"><highlight class="normal">}</highlight></codeline>
<codeline lineno="87"><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>init_regulace(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ls,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Fpm,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>kp,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>p,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>TV)</highlight></codeline>
<codeline lineno="92"><highlight class="normal">{</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Kpd;<sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>pomocna<sp/>velicina</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="94"><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>parametry<sp/>pro<sp/>odvazbeni</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/>Fmag=Fpm;</highlight></codeline>
<codeline lineno="97"><highlight class="normal"></highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/>Sid=0;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>nulovani<sp/>integracni<sp/>slozky</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/>Siq=0;</highlight></codeline>
<codeline lineno="100"><highlight class="normal"></highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/>Surm=0;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>nulovani<sp/>integracni<sp/>slozky</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/>Urmf=0;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>filtrovane<sp/>napeti<sp/>Urm</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="103"><highlight class="normal"></highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>omezeni<sp/>momentu<sp/>kvuli<sp/>momentu<sp/>zvratu<sp/>-<sp/>omezeni<sp/>pomoci<sp/>frmax</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/>Ismaxf2=Ismax*Ismax;</highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>blok<sp/>VYPOCET<sp/>NAPETI</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/>Kodv_ud=Ls;</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/>Kodv_uind=Fmag;</highlight></codeline>
<codeline lineno="110"><highlight class="normal"></highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>regulator<sp/>rychlosti</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/>Sw=0;</highlight></codeline>
<codeline lineno="113"><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/>Treg=TV;</highlight></codeline>
<codeline lineno="115"><highlight class="normal">}</highlight></codeline>
<codeline lineno="116"><highlight class="normal"></highlight></codeline>
<codeline lineno="117"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>vektor_regulace(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Idw,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Iqw,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Urm_max,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ww,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*u,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Isx,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Isy,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>theta,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>rychlost,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ucn_2,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Uc,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Ucn,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rezim)</highlight></codeline>
<codeline lineno="118"><highlight class="normal">{</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>vypocet<sp/>Isd,<sp/>Isq</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/>Isd=Isx*cos(theta)+Isy*sin(theta);</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/>Isq=Isy*cos(theta)-Isx*sin(theta);</highlight></codeline>
<codeline lineno="122"><highlight class="normal"></highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/>Iqw_reg=pi_reg(Ww-rychlost,Kpw,Kpw*Treg/Tiw,MAXw,-MAXw,&amp;Sw);</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rezim==0)</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/>Iqw_reg=Iqw;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>vyrazeni<sp/>reg.<sp/>rychlosti</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rezim==2)<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>zkouska<sp/>max.<sp/>momentu</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/>Iqw_reg=Iqwmax;<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Iqw<sp/>=<sp/>sqrt(Imax^2-Idw^2)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"></highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Regulator<sp/>odbuzovani</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/>Idw_urm=pi_reg(Urm_max-Urmf,Kpurm,Kpurm*Treg/Tiurm,0.,MINurm,&amp;Surm);</highlight></codeline>
<codeline lineno="131"><highlight class="normal"></highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>regulace<sp/>proudu<sp/>Id,<sp/>Iq</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/>ud=pi_reg(Idw_urm-Isd,Kpi,Kpi*Treg/Tii,MAXi,-MAXi,&amp;Sid);</highlight></codeline>
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>omezeni<sp/>max.<sp/>momentu<sp/>(resp.<sp/>max.<sp/>Iqw)<sp/>s<sp/>ohledem<sp/>na<sp/>max.<sp/>proud</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/>tmp_omezeni=Ismaxf2-Idw_urm*Idw_urm;</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp_omezeni&lt;0)<sp/>Iqwmax=0;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>Iqwmax=sqrt(tmp_omezeni);</highlight></codeline>
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Iqw_reg&gt;Iqwmax)<sp/>Iqw_reg=Iqwmax;</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Iqw_reg&lt;-Iqwmax)<sp/>Iqw_reg=-Iqwmax;</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/>uq=pi_reg(Iqw_reg-Isq,Kpi,Kpi*Treg/Tii,MAXi,-MAXi,&amp;Siq);</highlight></codeline>
<codeline lineno="143"><highlight class="normal"></highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/>ud-=Kodv_ud*rychlost*Iqw_reg;</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/>uq+=Kodv_ud*rychlost*Idw_urm+Kodv_uind*rychlost;</highlight></codeline>
<codeline lineno="147"><highlight class="normal"></highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>omezeni<sp/>-<sp/>saturace<sp/>napeti<sp/>-<sp/>stejne<sp/>omezeni<sp/>jako<sp/>u<sp/>reg.<sp/>proudu</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ud&gt;MAXi)<sp/>ud=MAXi;</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ud&lt;-MAXi)<sp/>ud=-MAXi;</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(uq&gt;MAXi)<sp/>uq=MAXi;</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(uq&lt;-MAXi)<sp/>uq=-MAXi;</highlight></codeline>
<codeline lineno="153"><highlight class="normal"></highlight></codeline>
<codeline lineno="155"><highlight class="normal"></highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>velikost<sp/>a<sp/>poloha<sp/>vektoru<sp/>napeti</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/>Um=sqrt(ud*ud+uq*uq);</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/>alfa=uhel(ud,uq);</highlight></codeline>
<codeline lineno="159"><highlight class="normal"></highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>vypocet<sp/>polohy<sp/>vektoru<sp/>napeti<sp/>ve<sp/>stojicim<sp/>souradnem<sp/>systemu</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/>beta=alfa+theta;</highlight></codeline>
<codeline lineno="162"><highlight class="normal"></highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>vypocet<sp/>Urmf<sp/>pro<sp/>dalsi<sp/>periodu<sp/>vzorkovani</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/>filtr(Um/Ucn_2,&amp;Urmf,Treg/Tfurm);</highlight></codeline>
<codeline lineno="165"><highlight class="normal"></highlight></codeline>
<codeline lineno="166"><highlight class="normal"></highlight><highlight class="comment">//<sp/>saturation<sp/>of<sp/>modulation<sp/>depth<sp/>going<sp/>to<sp/>PWM</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Um&gt;Ucn_2*Urm_max)<sp/>Um=Ucn_2*Urm_max;<sp/><sp/></highlight><highlight class="comment">//<sp/>linear<sp/>modulation<sp/>area<sp/>only<sp/>-<sp/>ensure<sp/>max.<sp/>modulation<sp/>depth</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="168"><highlight class="normal"></highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/>*u=Um;</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/>*(u+1)=beta;</highlight></codeline>
<codeline lineno="172"><highlight class="normal"></highlight></codeline>
<codeline lineno="173"><highlight class="normal">}</highlight></codeline>
<codeline lineno="174"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/regulace.cpp"/>
  </compounddef>
</doxygen>
