<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problems with theta calculation in PMSM Vector Control function in Other NXP Products</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/Problems-with-theta-calculation-in-PMSM-Vector-Control-function/m-p/325719#M3058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never mind.&amp;nbsp; I had used the PMWmaster channel instead of the PMSMVC_channel and happened to get back that thing that went from -1 to 1.&amp;nbsp; Now that I've fixed it I get what I expect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jun 2014 16:04:42 GMT</pubDate>
    <dc:creator>peterdufault</dc:creator>
    <dc:date>2014-06-27T16:04:42Z</dc:date>
    <item>
      <title>Problems with theta calculation in PMSM Vector Control function</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Problems-with-theta-calculation-in-PMSM-Vector-Control-function/m-p/325717#M3056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still working with something based on AN3206.&amp;nbsp; I'm trying to figure out what's wrong with my commutation, and I started reading back the theta from the eTPU.&amp;nbsp; It doesn't make any sense to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a 4000 count encoder and a motor with two pole pairs.&amp;nbsp; According to the function description &lt;EM&gt;theta = (2 * encoder)/4000&lt;/EM&gt;, so theta should advance twice for each cycle.&amp;nbsp; However, it isn't even synchronized with the zero position of the encoder.&amp;nbsp; See the attached plot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In &lt;EM&gt;etpu_pmsmvc.c&lt;/EM&gt; scale is set to &lt;EM&gt;scale = motor_pole_pairs * 0x1000000 / qd_pc_per_rev; .&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since there was not a "get theta" function I added one like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;fract24_t fs_etpu_pmsmvc_get_theta(uint8_t channel)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t *pba;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pba = fs_etpu_data_ram(channel) + (0x4000 &amp;gt;&amp;gt; 2);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (fract24_t)(*(pba + ((FS_ETPU_PMSMVC_THETA_OFFSET) &amp;gt;&amp;gt; 2)));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:56:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Problems-with-theta-calculation-in-PMSM-Vector-Control-function/m-p/325717#M3056</guid>
      <dc:creator>peterdufault</dc:creator>
      <dc:date>2014-06-27T14:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with theta calculation in PMSM Vector Control function</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Problems-with-theta-calculation-in-PMSM-Vector-Control-function/m-p/325718#M3057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, whatever I'm getting back with that &lt;EM style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;fs_etpu_pmsmvc_get_theta&lt;/EM&gt;() function it isn't theta.&amp;nbsp; Even if I stop the motor rotation I get the same -1 to 1 ramp.&amp;nbsp; I've asked Freescale for the eTPU code that is being generated by the eTPU function selector so I can figure out what's going on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 15:51:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Problems-with-theta-calculation-in-PMSM-Vector-Control-function/m-p/325718#M3057</guid>
      <dc:creator>peterdufault</dc:creator>
      <dc:date>2014-06-27T15:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with theta calculation in PMSM Vector Control function</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Problems-with-theta-calculation-in-PMSM-Vector-Control-function/m-p/325719#M3058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never mind.&amp;nbsp; I had used the PMWmaster channel instead of the PMSMVC_channel and happened to get back that thing that went from -1 to 1.&amp;nbsp; Now that I've fixed it I get what I expect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 16:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Problems-with-theta-calculation-in-PMSM-Vector-Control-function/m-p/325719#M3058</guid>
      <dc:creator>peterdufault</dc:creator>
      <dc:date>2014-06-27T16:04:42Z</dc:date>
    </item>
  </channel>
</rss>

