<?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>S32KのトピックRe: S32K396_eTPU_Angle delay</title>
    <link>https://community.nxp.com/t5/S32K/S32K396-eTPU-Angle-delay/m-p/1707451#M26221</link>
    <description>thank you very much. You described it very clearly.</description>
    <pubDate>Fri, 18 Aug 2023 09:27:28 GMT</pubDate>
    <dc:creator>Zhougw</dc:creator>
    <dc:date>2023-08-18T09:27:28Z</dc:date>
    <item>
      <title>S32K396_eTPU_Angle delay</title>
      <link>https://community.nxp.com/t5/S32K/S32K396-eTPU-Angle-delay/m-p/1705355#M26106</link>
      <description>&lt;P&gt;question: when I call function(fs_etpu_resolver_get_outputs_extrapolated) at T1 to get angle and speed.&lt;/P&gt;&lt;P&gt;what angle do I get, I get real angle of T1, or the angle I get is not from T1, just a time before T1(for example T0) because of calculation delay? would eTPU compensate the calculation delay?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="angle.png" style="width: 493px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/236601i8B2959F660C6B07A/image-size/large?v=v2&amp;amp;px=999" role="button" title="angle.png" alt="angle.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;eTPU get the peak value of sin at tD, but the peak value happend at tB, would eTPU compensate the delay(tD-tB)?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="excitation.png" style="width: 641px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/236602i759E118B57603CE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="excitation.png" alt="excitation.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In demo code of dual motor example, fs_etpu_resolver_get_outputs_extrapolated used when abs(pFOC-&amp;gt;Resolver_SW.wRotEl.filt)&amp;gt; 100, is there any limit about calling the function(fs_etpu_resolver_get_outputs_extrapolated )?&amp;nbsp; Not Applicable for low speed?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 03:49:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K396-eTPU-Angle-delay/m-p/1705355#M26106</guid>
      <dc:creator>Zhougw</dc:creator>
      <dc:date>2023-08-16T03:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: S32K396_eTPU_Angle delay</title>
      <link>https://community.nxp.com/t5/S32K/S32K396-eTPU-Angle-delay/m-p/1707346#M26214</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would like to give you the overview of how the angle calculation and timing is working in the eTPU Resolver function and this hopefully gives you answers to your questions:&lt;/P&gt;
&lt;P&gt;Resolver function processes the entire excitation period within the ATO update thread. It oversamples the excitation signal with multiple samples and processes them and picks the most representative sample for the excitation peak value. The example illustration is on the figure below, where yellow marked sample is the one selected as representative for the peak value. Note that for illustration only 9 samples were depicted for half period, in real function we are sampling 16 samples per half period. It means we are computing updates for angle twice per period, every 16 samples. Those ATO updates are available in &lt;EM&gt;resolver_outputs_calculated&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa17216_0-1692343228575.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/237020i74F82EA0A8C6479F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa17216_0-1692343228575.png" alt="nxa17216_0-1692343228575.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the illustration of the ATO update timing:&lt;/P&gt;
&lt;P&gt;16 samples (in blue circle) start to be processed by the ATO UPD eTPU thread. At the time when eTPU thread is started the &lt;STRONG&gt;current_time&lt;/STRONG&gt; is sampled. 16 Samples of the 1&lt;SUP&gt;st&lt;/SUP&gt; half period in the blue circle are actually a prediction for the next half period – this is where the red dot is denoting the &lt;STRONG&gt;timestamp&lt;/STRONG&gt;. But due to SDADC processing delay and also DMA transfer delay is larger than the half period and goes beyond the timestamp, here called as &lt;STRONG&gt;adc_delay – &lt;/STRONG&gt;this is the delay between the timestamp of the predicted angle and the start of the ATO update thread. The delay has been measured and it corresponds to 19 us on MPC5777C. &lt;STRONG&gt;adc_delay &lt;/STRONG&gt;is a configurable parameter of the resolver function and only has to be measured once for the device.&amp;nbsp;This assumes ATO thread is not being delayed by any other eTPU thread. So, this is the explanation of the &lt;STRONG&gt;Timestamp&lt;/STRONG&gt; for the calculated angle. Hopefully this answers your question related to delay compensation.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa17216_1-1692343228629.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/237021i3AA33407FE3EA5FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa17216_1-1692343228629.png" alt="nxa17216_1-1692343228629.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Timestamp is used for extrapolated angle calculation. On the next figure it is depicted how the extrapolated period is calculated – this is then used for extrapolated angle calculation.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa17216_2-1692343228684.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/237022iE0544C8486087EBC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa17216_2-1692343228684.png" alt="nxa17216_2-1692343228684.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the extrapolation thread is evoked (green box), the &lt;STRONG&gt;extrapolate time&lt;/STRONG&gt; is sampled and the last Timestamp of the last updated angle is used for the &lt;STRONG&gt;extrapol_period&lt;/STRONG&gt; calculation. So to answer your question which angle you will get when you call the &lt;EM&gt;fs_etpu_resolver_get_outputs_extrapolated&lt;/EM&gt; you will always get the last updated ATO angle extrapolated to the time when you evoked the extrapolation. What will vary is the extrapolation period. The shorter the period is the more precise the extrapolated angle you get. The picture above depicts the situation when the extrapolation is called just before the ATO updates the new angle, so the extrapolation uses the most fresh data. There are HW semaphores implemented to protect the data coherency between the ATO update and extrapolation calculation (arrow with LCK depicts the position when the ATO locks the HW semaphores while updating the new angle and speed, after UNLCK the semaphores are free and extrapolation loads the new fresh values). Hopefully this answers your second question.&lt;/P&gt;
&lt;P&gt;Regarding your last question on limitation of extrapolation - no there are no limitations on usage.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 07:26:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K396-eTPU-Angle-delay/m-p/1707346#M26214</guid>
      <dc:creator>nxa17216</dc:creator>
      <dc:date>2023-08-18T07:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: S32K396_eTPU_Angle delay</title>
      <link>https://community.nxp.com/t5/S32K/S32K396-eTPU-Angle-delay/m-p/1707451#M26221</link>
      <description>thank you very much. You described it very clearly.</description>
      <pubDate>Fri, 18 Aug 2023 09:27:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K396-eTPU-Angle-delay/m-p/1707451#M26221</guid>
      <dc:creator>Zhougw</dc:creator>
      <dc:date>2023-08-18T09:27:28Z</dc:date>
    </item>
  </channel>
</rss>

