<?xml version="1.0" encoding="UTF-8"?>
<net name="servo_bldc" type="iopt-flow">
  <component id="c2" class="local/diff_in.xml" x="150" y="205" width="110" height="60" rot="0" implementation="iopt-flow">
    <name off_x="-55" off_y="-35" text="diff_in_A"/>
    <source_model file="files/diff_in.xml"/>
    <input id="c2.I_P" name="I_P" off_x="-55" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c2.I_N" name="I_N" off_x="-55" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <output id="c2.O" name="O" off_x="55" off_y="-10" type="boolean" microstep="0" nano-step="2"/>
  </component>
  <component id="c3" class="local/diff_in.xml" x="150" y="280" width="110" height="60" rot="0" implementation="iopt-flow">
    <name off_x="-55" off_y="-35" text="diff_in_B"/>
    <source_model file="files/diff_in.xml"/>
    <input id="c3.I_P" name="I_P" off_x="-55" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c3.I_N" name="I_N" off_x="-55" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <output id="c3.O" name="O" off_x="55" off_y="-10" type="boolean" microstep="0" nano-step="2"/>
  </component>
  <component id="c4" class="local/nfilter.xml" x="285" y="195" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_a"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c4.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c4.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <component id="c5" class="local/nfilter.xml" x="285" y="250" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_b"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c5.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c5.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <arc id="a7" type="read" source="c2.O" target="c4.SIG"/>
  <arc id="a8" type="read" source="c3.O" target="c5.SIG"/>
  <arc id="a9" type="read" source="c5.FSIG" target="c6.ChB"/>
  <arc id="a10" type="read" source="c4.FSIG" target="c6.ChA"/>
  <signal id="MA_p" x="25" y="195" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="MA_n" x="55" y="215" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="MB_p" x="25" y="270" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="MB_n" x="55" y="290" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <arc id="a16" type="read" source="MA_p" target="c2.I_P"/>
  <arc id="a17" type="read" source="MA_n" target="c2.I_N"/>
  <arc id="a18" type="read" source="MB_p" target="c3.I_P"/>
  <arc id="a19" type="read" source="MB_n" target="c3.I_N"/>
  <operation id="o1" x="440" y="310" constant="1023" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="1023"/>
    <output off_x="20" off_y="0" name="K" id="o1.K" type="range" min="1023" max="1023" dynamic="none" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="literal" value="1023"/>
        <text>1023</text>
      </expression>
    </output>
  </operation>
  <operation id="o5" x="440" y="350" constant="20" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="20"/>
    <output off_x="20" off_y="0" name="K" id="o5.K" type="range" min="20" max="20" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>20</text>
        <operand type="literal" value="20"/>
      </expression>
    </output>
  </operation>
  <signal id="Enb" x="105" y="30" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <event id="Rst" x="65" y="30" mode="input" microstep="0" nano-step="0"/>
  <signal id="RotA" x="35" y="65" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="RotB" x="35" y="120" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <component id="c9" class="local/bldc_commut.xml" x="855" y="350" width="170" height="180" rot="0" implementation="iopt-flow">
    <name off_x="-85" off_y="-95" text="commut"/>
    <source_model file="files/bldc_commut.xml"/>
    <input id="c9.UpdClk" name="UpdClk" type="event" off_x="-85" off_y="-70" microstep="1" nano-step="2"/>
    <input id="c9.OutEnb" name="OutEnb" off_x="-85" off_y="-50" type="boolean" microstep="0" nano-step="1"/>
    <input id="c9.U" name="U" off_x="-85" off_y="-30" type="boolean" microstep="0" nano-step="5"/>
    <input id="c9.V" name="V" off_x="-85" off_y="-10" type="boolean" microstep="0" nano-step="5"/>
    <input id="c9.W" name="W" off_x="-85" off_y="10" type="boolean" microstep="0" nano-step="5"/>
    <input id="c9.Dir" name="Dir" off_x="-85" off_y="30" type="boolean" microstep="1" nano-step="8"/>
    <input id="c9.PwmH" name="PwmH" off_x="-85" off_y="50" type="boolean" microstep="1" nano-step="11"/>
    <input id="c9.PwmL" name="PwmL" off_x="-85" off_y="70" type="boolean" microstep="1" nano-step="11"/>
    <output id="c9.UH" name="UH" off_x="85" off_y="-70" type="boolean" microstep="1" nano-step="13"/>
    <output id="c9.UL" name="UL" off_x="85" off_y="-50" type="boolean" microstep="1" nano-step="13"/>
    <output id="c9.VH" name="VH" off_x="85" off_y="-30" type="boolean" microstep="1" nano-step="13"/>
    <output id="c9.VL" name="VL" off_x="85" off_y="-10" type="boolean" microstep="1" nano-step="13"/>
    <output id="c9.WH" name="WH" off_x="85" off_y="10" type="boolean" microstep="1" nano-step="13"/>
    <output id="c9.WL" name="WL" off_x="85" off_y="30" type="boolean" microstep="1" nano-step="13"/>
    <output id="c9.Sector" name="Sector" off_x="85" off_y="50" type="range" min="0" max="6" microstep="0" nano-step="1"/>
  </component>
  <signal id="U_h" x="25" y="405" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="U_l" x="50" y="425" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="V_h" x="25" y="465" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="V_l" x="50" y="485" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="W_h" x="25" y="525" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <signal id="W_l" x="50" y="545" mode="input" type="boolean" min="0" max="1" microstep="0" nano-step="0"/>
  <operation id="o2" x="1030" y="160" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="uh_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o2.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o2.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o2.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <operation id="o40" x="1030" y="225" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="ul_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o40.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o40.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o40.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <operation id="o42" x="1030" y="295" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="vh_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o42.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o42.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o42.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <operation id="o44" x="1030" y="365" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="vl_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o44.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o44.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o44.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <operation id="o46" x="1030" y="435" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="wh_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o46.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o46.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o46.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <operation id="o47" x="1030" y="500" rot="0" shape="rect" size="36" locked="true">
    <name off_x="-20" off_y="-30" text="wl_diff"/>
    <input off_x="-36" off_y="0" name="I" id="o47.I" type="boolean" min="0" max="1" frac="0"/>
    <output off_x="35" off_y="-10" name="OP" id="o47.OP" type="boolean" min="0" max="1" frac="0" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I"/>
        <text>I</text>
      </expression>
    </output>
    <output name="ON" id="o47.ON" type="boolean" min="0" max="1" frac="0" off_x="35" off_y="10" microstep="1" nano-step="14">
      <expression>
        <operand type="signal" idRef="I" neg="true"/>
        <text>NOT(I)</text>
      </expression>
    </output>
  </operation>
  <signal id="UHP" x="1135" y="150" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="UHN" x="1110" y="170" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="VHP" x="1135" y="285" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="VHN" x="1110" y="305" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="ULP" x="1135" y="215" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="ULN" x="1110" y="235" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="VLP" x="1135" y="355" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="VLN" x="1110" y="375" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="WHP" x="1135" y="425" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="WHN" x="1110" y="445" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="WLP" x="1130" y="490" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <signal id="WLN" x="1105" y="510" mode="output" type="boolean" min="0" max="1" dynamic="type" frac="0" microstep="1" nano-step="14"/>
  <component id="c10" class="local/nfilter.xml" x="595" y="525" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_w"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c10.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c10.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <component id="c11" class="local/nfilter.xml" x="595" y="465" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_v"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c11.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c11.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <component id="c12" class="local/nfilter.xml" x="595" y="405" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_u"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c12.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c12.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <component id="c13" class="local/diff_in.xml" x="155" y="415" width="110" height="60" rot="0" implementation="iopt-flow">
    <name off_x="-55" off_y="-35" text="u_diff_in"/>
    <source_model file="files/diff_in.xml"/>
    <input id="c13.I_P" name="I_P" off_x="-55" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c13.I_N" name="I_N" off_x="-55" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <output id="c13.O" name="O" off_x="55" off_y="-10" type="boolean" microstep="0" nano-step="2"/>
  </component>
  <component id="c14" class="local/diff_in.xml" x="295" y="475" width="110" height="60" rot="0" implementation="iopt-flow">
    <name off_x="-55" off_y="-35" text="v_diff_in"/>
    <source_model file="files/diff_in.xml"/>
    <input id="c14.I_P" name="I_P" off_x="-55" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c14.I_N" name="I_N" off_x="-55" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <output id="c14.O" name="O" off_x="55" off_y="-10" type="boolean" microstep="0" nano-step="2"/>
  </component>
  <component id="c15" class="local/diff_in.xml" x="155" y="535" width="110" height="60" rot="0" implementation="iopt-flow">
    <name off_x="-55" off_y="-35" text="w_diff_in"/>
    <source_model file="files/diff_in.xml"/>
    <input id="c15.I_P" name="I_P" off_x="-55" off_y="-10" type="boolean" microstep="0" nano-step="1"/>
    <input id="c15.I_N" name="I_N" off_x="-55" off_y="10" type="boolean" microstep="0" nano-step="1"/>
    <output id="c15.O" name="O" off_x="55" off_y="-10" type="boolean" microstep="0" nano-step="2"/>
  </component>
  <signal id="Sector" x="975" y="545" mode="output" type="range" min="0" max="6" dynamic="type" microstep="0" nano-step="2"/>
  <operation id="o18" x="705" y="280" rot="0" shape="arrow" size="20">
    <name off_x="-8" off_y="-17" text="or"/>
    <input off_x="-20" off_y="-7" name="Center" id="o18.Center" type="event" dynamic="all"/>
    <input off_x="-20" off_y="7" name="Start" id="o18.Start" type="event" dynamic="all"/>
    <output off_x="20" off_y="0" name="out" id="o18.out" type="event" min="0" max="1" frac="0" microstep="1" nano-step="2">
      <expression>
        <operand type="signal" idRef="Center"/>
        <operator type="or"/>
        <operand type="signal" idRef="Start"/>
        <text>Center OR Start</text>
      </expression>
    </output>
  </operation>
  <arc id="a24" type="read" source="Rst" target="c8.Rst" view="symbolic"/>
  <arc id="a25" type="read" source="Enb" target="c9.OutEnb" view="symbolic"/>
  <arc id="a39" type="read" source="c9.UH" target="o2.I"/>
  <arc id="a41" type="read" source="c9.UL" target="o40.I"/>
  <arc id="a43" type="read" source="c9.VH" target="o42.I"/>
  <arc id="a45" type="read" source="c9.VL" target="o44.I"/>
  <arc id="a48" type="read" source="c9.WH" target="o46.I"/>
  <arc id="a49" type="read" source="c9.WL" target="o47.I"/>
  <arc id="a51" type="read" source="o2.OP" target="UHP"/>
  <arc id="a53" type="read" source="o2.ON" target="UHN"/>
  <arc id="a28" type="read" source="o40.ON" target="ULN"/>
  <arc id="a29" type="read" source="o40.OP" target="ULP"/>
  <arc id="a31" type="read" source="o42.ON" target="VHN"/>
  <arc id="a32" type="read" source="o42.OP" target="VHP"/>
  <arc id="a35" type="read" source="o44.OP" target="VLP"/>
  <arc id="a36" type="read" source="o44.ON" target="VLN"/>
  <arc id="a42" type="read" source="o46.OP" target="WHP"/>
  <arc id="a44" type="read" source="o46.ON" target="WHN"/>
  <arc id="a46" type="read" source="o47.OP" target="WLP"/>
  <arc id="a47" type="read" source="o47.ON" target="WLN"/>
  <arc id="a1" type="read" source="c13.O" target="c12.SIG"/>
  <arc id="a4" type="read" source="c14.O" target="c11.SIG"/>
  <arc id="a5" type="read" source="c15.O" target="c10.SIG"/>
  <arc id="a13" type="read" source="c12.FSIG" target="c9.U"/>
  <arc id="a15" type="read" source="c11.FSIG" target="c9.V"/>
  <arc id="a30" type="read" source="c10.FSIG" target="c9.W"/>
  <arc id="a12" type="read" source="U_h" target="c13.I_P"/>
  <arc id="a33" type="read" source="U_l" target="c13.I_N"/>
  <arc id="a34" type="read" source="V_h" target="c14.I_P"/>
  <arc id="a37" type="read" source="V_l" target="c14.I_N"/>
  <arc id="a38" type="read" source="W_h" target="c15.I_P"/>
  <arc id="a40" type="read" source="W_l" target="c15.I_N"/>
  <arc id="a52" type="read" source="c9.Sector" target="Sector"/>
  <arc id="a56" type="read" source="o18.out" target="c9.UpdClk"/>
  <signal id="Error" x="900" y="75" mode="output" type="range" min="-512" max="511" dynamic="type" microstep="1" nano-step="6"/>
  <arc id="a62" type="read" source="Rst" target="c6.Rst" view="symbolic"/>
  <operation id="o3" x="600" y="75" constant="20" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="20"/>
    <output off_x="20" off_y="0" name="K" id="o3.K" type="range" min="20" max="20" dynamic="none" microstep="0" nano-step="1" frac="0">
      <expression>
        <text>20</text>
        <operand type="literal" value="20"/>
      </expression>
    </output>
  </operation>
  <operation id="o15" x="550" y="95" constant="1" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="1"/>
    <output off_x="20" off_y="0" name="K" id="o15.K" type="range" min="1" max="1" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>1</text>
        <operand type="literal" value="1"/>
      </expression>
    </output>
  </operation>
  <operation id="o51" x="600" y="115" constant="8" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="8"/>
    <output off_x="20" off_y="0" name="K" id="o51.K" type="range" min="8" max="8" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>8</text>
        <operand type="literal" value="8"/>
      </expression>
    </output>
  </operation>
  <arc id="a11" type="read" source="c6.Cntr" target="c1.SensPos"/>
  <arc id="a14" type="read" source="o51.K" target="c1.Kd"/>
  <arc id="a50" type="read" source="o15.K" target="c1.Ki"/>
  <arc id="a54" type="read" source="o3.K" target="c1.Kp"/>
  <arc id="a60" type="read" source="c1.Dir" target="c9.Dir" c1_x="85" c1_y="100" c2_x="-60" c2_y="-90"/>
  <component id="c16" class="local/PWM.xml" x="595" y="310" width="140" height="120" rot="0" implementation="iopt-flow">
    <name off_x="-70" off_y="-65" text="PWM"/>
    <source_model file="files/PWM.xml"/>
    <input id="c16.Rst" name="Rst" type="event" off_x="-70" off_y="-40" microstep="0" nano-step="1"/>
    <input id="c16.Enable" name="Enable" off_x="-70" off_y="-20" type="boolean" microstep="0" nano-step="1"/>
    <input id="c16.Period" name="Period" off_x="-70" off_y="0" type="range" min="1" max="4096" microstep="0" nano-step="1"/>
    <input id="c16.DC" name="DC" off_x="-70" off_y="20" type="range" min="0" max="4095" microstep="1" nano-step="8"/>
    <input id="c16.DeadTime" name="DeadTime" off_x="-70" off_y="40" type="range" min="0" max="255" microstep="0" nano-step="1"/>
    <output id="c16.Center" name="Center" type="event" off_x="70" off_y="-40" microstep="1" nano-step="1"/>
    <output id="c16.Start" name="Start" type="event" off_x="70" off_y="-20" microstep="1" nano-step="1"/>
    <output id="c16.Cntr" name="Cntr" off_x="70" off_y="0" type="range" min="0" max="4095" microstep="0" nano-step="4"/>
    <output id="c16.OutH" name="OutH" off_x="70" off_y="20" type="boolean" microstep="1" nano-step="10"/>
    <output id="c16.OutL" name="OutL" off_x="70" off_y="40" type="boolean" microstep="1" nano-step="10"/>
  </component>
  <arc id="a20" type="read" source="o1.K" target="c16.Period"/>
  <arc id="a21" type="read" source="o5.K" target="c16.DeadTime"/>
  <arc id="a26" type="read" source="c16.OutH" target="c9.PwmH"/>
  <arc id="a27" type="read" source="c16.OutL" target="c9.PwmL"/>
  <arc id="a55" type="read" source="c16.Center" target="o18.Center"/>
  <arc id="a58" type="read" source="c16.Start" target="o18.Start"/>
  <arc id="a61" type="read" source="c1.DC" target="c16.DC" c1_x="75" c1_y="125" c2_x="-65" c2_y="-105"/>
  <arc id="a63" type="read" source="Rst" target="c16.Rst" view="symbolic"/>
  <arc id="a64" type="read" source="Enb" target="c16.Enable" view="symbolic"/>
  <arc id="a71" type="read" source="c8.Cntr" target="c1.RefPos" c1_x="5" c1_y="45" c2_x="-50" c2_y="0"/>
  <component id="c6" class="local/qe.xml" x="440" y="205" width="130" height="100" rot="0" implementation="iopt-flow">
    <name off_x="-65" off_y="-55" text="motor_qe"/>
    <source_model file="files/qe.xml"/>
    <input id="c6.Rst" name="Rst" type="event" off_x="-65" off_y="-30"/>
    <input id="c6.ChA" name="ChA" off_x="-65" off_y="-10" type="boolean"/>
    <input id="c6.ChB" name="ChB" off_x="-65" off_y="10" type="boolean"/>
    <input id="c6.X4" name="X4" off_x="-65" off_y="30" type="boolean"/>
    <output id="c6.Cntr" name="Cntr" off_x="65" off_y="-30" type="range" min="0" max="1023"/>
  </component>
  <component id="c8" class="local/qe.xml" x="440" y="90" width="130" height="100" rot="0" implementation="iopt-flow">
    <name off_x="-65" off_y="-55" text="qenc"/>
    <source_model file="files/qe.xml"/>
    <input id="c8.Rst" name="Rst" type="event" off_x="-65" off_y="-30"/>
    <input id="c8.ChA" name="ChA" off_x="-65" off_y="-10" type="boolean"/>
    <input id="c8.ChB" name="ChB" off_x="-65" off_y="10" type="boolean"/>
    <input id="c8.X4" name="X4" off_x="-65" off_y="30" type="boolean"/>
    <output id="c8.Cntr" name="Cntr" off_x="65" off_y="-30" type="range" min="0" max="1023"/>
  </component>
  <operation id="o6" x="325" y="145" constant="1" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="1"/>
    <output off_x="20" off_y="0" name="K" id="o6.K" type="range" min="1" max="1" dynamic="none">
      <expression>
        <text>1</text>
        <operand type="literal" value="1"/>
      </expression>
    </output>
  </operation>
  <arc id="a59" type="read" source="o6.K" target="c8.X4"/>
  <operation id="o60" x="305" y="290" constant="0" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="0"/>
    <output off_x="20" off_y="0" name="K" id="o60.K" type="range" min="0" max="0" dynamic="none">
      <expression>
        <text>0</text>
        <operand type="literal" value="0"/>
      </expression>
    </output>
  </operation>
  <arc id="a65" type="read" source="o60.K" target="c6.X4"/>
  <arc id="a2" type="read" source="c1.PosErr" target="Error"/>
  <component id="c7" class="local/nfilter.xml" x="235" y="120" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_rb"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c7.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c7.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <component id="c17" class="local/nfilter.xml" x="235" y="65" width="100" height="40" rot="0" implementation="iopt-flow">
    <name off_x="-50" off_y="-25" text="nfilter_ra"/>
    <source_model file="files/nfilter.xml"/>
    <input id="c17.SIG" name="SIG" off_x="-50" off_y="0" type="boolean" microstep="0" nano-step="3"/>
    <output id="c17.FSIG" name="FSIG" off_x="50" off_y="0" type="boolean" microstep="0" nano-step="4"/>
  </component>
  <arc id="a22" type="read" source="c17.FSIG" target="c8.ChA"/>
  <arc id="a23" type="read" source="c7.FSIG" target="c8.ChB"/>
  <arc id="a57" type="read" source="RotB" target="c7.SIG"/>
  <arc id="a66" type="read" source="RotA" target="c17.SIG"/>
  <arc id="a3" type="read" source="c16.Center" target="c1.UpdClk" view="symbolic"/>
  <arc id="a6" type="read" source="Enb" target="c1.Enable" view="symbolic"/>
  <component id="c1" class="local/PID.xml" x="730" y="115" width="160" height="160" rot="0" implementation="iopt-flow" target="default">
    <name off_x="-80" off_y="-85" text="PID"/>
    <source_model file="files/PID.xml"/>
    <input id="c1.UpdClk" name="UpdClk" type="event" off_x="-80" off_y="-60"/>
    <input id="c1.Kp" name="Kp" off_x="-80" off_y="-40" type="range" min="0" max="127"/>
    <input id="c1.Ki" name="Ki" off_x="-80" off_y="-20" type="range" min="0" max="31"/>
    <input id="c1.Kd" name="Kd" off_x="-80" off_y="0" type="range" min="0" max="127"/>
    <input id="c1.Enable" name="Enable" off_x="-80" off_y="20" type="boolean"/>
    <input id="c1.RefPos" name="RefPos" off_x="-80" off_y="40" type="range" min="0" max="1023"/>
    <input id="c1.SensPos" name="SensPos" off_x="-80" off_y="60" type="range" min="0" max="1023"/>
    <output id="c1.Dir" name="Dir" off_x="80" off_y="-60" type="boolean"/>
    <output id="c1.PosErr" name="PosErr" off_x="80" off_y="-40" type="range" min="-512" max="511"/>
    <output id="c1.DC" name="DC" off_x="80" off_y="-20" type="range" min="0" max="1000"/>
  </component>
</net>
