<?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>Model-Based Design Toolbox (MBDT)のトピックRe: S32K144 FOC using Hall sensor - motor cannot run</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-FOC-using-Hall-sensor-motor-cannot-run/m-p/1620901#M8087</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Fanqi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thank you for the details provided above, they helped me understand better your issue,&lt;/P&gt;
&lt;P&gt;As a starting point, I recommend using the following software:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;MATLAB r2021a (since the &lt;A href="https://www.mathworks.com/matlabcentral/fileexchange/93535-field-oriented-control-of-pmsm-using-nxp-s32k144-kit?s_tid=srchtitle_MCSPTE1AK144%20_1" target="_self"&gt;FOC-Hall model&lt;/A&gt; is compatible with it)&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-unlink="true"&gt;&lt;A href="https://www.mathworks.com/matlabcentral/fileexchange/64740-nxp-support-package-s32k1xx" target="_self"&gt;NXP Support Package S32K1xx&amp;nbsp;Version 2.3.0&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Following the described workflows above, all should be fine, I have the same setup on my end, and tested it fine.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 1 - Run 3-Phase PMSM in Open-Loop Control and Calibrate ADC Offset.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 2 - Calibrate Hall Sensor Offset for PMSM Motor.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 3 - Field-Oriented Control of PMSM Using Hall Sensor.&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#FF9900"&gt;Workflow 2&lt;/FONT&gt;&lt;/H2&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;From all of the above I find the workflow 2 very important since this will impact the Speed control of the Motor.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif"&gt;In my case, I had to change two motor phases, in order to change the rotation direction for the calibration:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefanvlad_1-1679577235934.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215993i037DEE50F0C506F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_1-1679577235934.png" alt="stefanvlad_1-1679577235934.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then I have added this value into the &lt;EM&gt;&lt;STRONG&gt;mcb_pmsm_foc_hall_MCSPTE1AK144_data.m&lt;/STRONG&gt;&lt;/EM&gt; script:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefanvlad_2-1679577287546.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215994i6F53B1DF8555D902/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_2-1679577287546.png" alt="stefanvlad_2-1679577287546.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then I &lt;FONT color="#339966"&gt;save and run&lt;/FONT&gt; the&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;mcb_pmsm_foc_hall_MCSPTE1AK144_data.m&lt;/EM&gt;&lt;/STRONG&gt; again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;FONT color="#FF9900"&gt;Workflow 3&lt;/FONT&gt;&lt;/H2&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Opening the &lt;STRONG&gt;mcb_pmsm_foc_hall_MCSPTE1AK144.slx&lt;/STRONG&gt; model, I flashed it on the &lt;STRONG&gt;S32K144&lt;/STRONG&gt; board, pressing Build ( or &lt;STRONG&gt;Ctrl+B&lt;/STRONG&gt; on keyboard):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefanvlad_3-1679577441862.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215995iBF890D89B5DEDF11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_3-1679577441862.png" alt="stefanvlad_3-1679577441862.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then opening the&amp;nbsp;&lt;STRONG&gt;mcb_hall_foc_host.slx&lt;/STRONG&gt;&amp;nbsp;model and open com port settings, and setting COM4:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefanvlad_5-1679578410819.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215998iFD09CA13D5465CF1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_5-1679578410819.png" alt="stefanvlad_5-1679578410819.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can see in the device manager what COM port your particular board has.&lt;/P&gt;
&lt;P&gt;Then I press &lt;FONT color="#00FF00"&gt;Run &lt;/FONT&gt;and also toggle from &lt;FONT color="#FF0000"&gt;Stop&lt;/FONT&gt; to &lt;FONT color="#3366FF"&gt;Start&lt;/FONT&gt;. If the motor does not &lt;FONT color="#3366FF"&gt;Start&lt;/FONT&gt;, press the reset button on the board.&lt;/P&gt;
&lt;P&gt;The final result with the motor spinning, after &lt;STRONG&gt;pressing the &lt;FONT color="#FF0000"&gt;reset&lt;/FONT&gt; button&lt;/STRONG&gt; on &lt;FONT color="#339966"&gt;the board&lt;/FONT&gt;, looks like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="stefanvlad_0-1679576373009.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215992iC7B19948524FA1C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_0-1679576373009.png" alt="stefanvlad_0-1679576373009.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope all of the above instructions help you to spin the motor &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Stefan&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 13:36:05 GMT</pubDate>
    <dc:creator>stefanvlad</dc:creator>
    <dc:date>2023-03-23T13:36:05Z</dc:date>
    <item>
      <title>S32K144 FOC using Hall sensor - motor cannot run</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-FOC-using-Hall-sensor-motor-cannot-run/m-p/1605114#M8032</link>
      <description>&lt;P&gt;Hello, I am using NXP MCSPTE1AK144 Motor Control Kit &lt;A href="https://www.nxp.com/design/development-boards/automotive-motor-control-solutions/arm-based-solutions-/s32k144-bldc-pmsm-development-kit:MCSPTE1AK144" target="_blank"&gt;https://www.nxp.com/design/development-boards/automotive-motor-control-solutions/arm-based-solutions-/s32k144-bldc-pmsm-development-kit:MCSPTE1AK144&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement a FOC algorithm for 3-phase PMSM. There are three workflows.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 1 - Run 3-Phase PMSM in Open-Loop Control and Calibrate ADC Offset.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 2 - Calibrate Hall Sensor Offset for PMSM Motor.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 3 - Field-Oriented Control of PMSM Using Hall Sensor.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The workflow 1 and 2 work well, the motor can run and I can observe signal in the scope. But in workflow 3, I built target model first (Figure 1), then when I run the host model (Figure 3), the motor cannot run. And all of the signals in the scope is like Figure 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just updated the values from workflow 1 and 2 in the target model initialization script&amp;nbsp;&lt;FONT size="2"&gt;mcb_pmsm_foc_hall_MCSPTE1AK144_data.m. &lt;FONT size="3"&gt;The port name was set correct. I am a beginner so I am confused about this. I would be very grateful if anyone can help me about it.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Fanqi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mcb_pmsm_foc_hall_MCSPTE1AK144 - Simulink academic use 24_02_2023 16_00_26.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/212246i9BA374BF8F3EDFDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="mcb_pmsm_foc_hall_MCSPTE1AK144 - Simulink academic use 24_02_2023 16_00_26.png" alt="mcb_pmsm_foc_hall_MCSPTE1AK144 - Simulink academic use 24_02_2023 16_00_26.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Figure 1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scope 24_02_2023 16_00_04.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/212247i903295A4E2F0ED5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Scope 24_02_2023 16_00_04.png" alt="Scope 24_02_2023 16_00_04.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Figure 2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mcb_hall_foc_host _ - Simulink academic use 24_02_2023 16_37_25.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/212248iAA468DCDC4FFB032/image-size/large?v=v2&amp;amp;px=999" role="button" title="mcb_hall_foc_host _ - Simulink academic use 24_02_2023 16_37_25.png" alt="mcb_hall_foc_host _ - Simulink academic use 24_02_2023 16_37_25.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Figure 3&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 08:49:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-FOC-using-Hall-sensor-motor-cannot-run/m-p/1605114#M8032</guid>
      <dc:creator>fanqi1</dc:creator>
      <dc:date>2023-02-24T08:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 FOC using Hall sensor - motor cannot run</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-FOC-using-Hall-sensor-motor-cannot-run/m-p/1620901#M8087</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Fanqi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thank you for the details provided above, they helped me understand better your issue,&lt;/P&gt;
&lt;P&gt;As a starting point, I recommend using the following software:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;MATLAB r2021a (since the &lt;A href="https://www.mathworks.com/matlabcentral/fileexchange/93535-field-oriented-control-of-pmsm-using-nxp-s32k144-kit?s_tid=srchtitle_MCSPTE1AK144%20_1" target="_self"&gt;FOC-Hall model&lt;/A&gt; is compatible with it)&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-unlink="true"&gt;&lt;A href="https://www.mathworks.com/matlabcentral/fileexchange/64740-nxp-support-package-s32k1xx" target="_self"&gt;NXP Support Package S32K1xx&amp;nbsp;Version 2.3.0&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Following the described workflows above, all should be fine, I have the same setup on my end, and tested it fine.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 1 - Run 3-Phase PMSM in Open-Loop Control and Calibrate ADC Offset.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 2 - Calibrate Hall Sensor Offset for PMSM Motor.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Workflow 3 - Field-Oriented Control of PMSM Using Hall Sensor.&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#FF9900"&gt;Workflow 2&lt;/FONT&gt;&lt;/H2&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;From all of the above I find the workflow 2 very important since this will impact the Speed control of the Motor.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif"&gt;In my case, I had to change two motor phases, in order to change the rotation direction for the calibration:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefanvlad_1-1679577235934.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215993i037DEE50F0C506F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_1-1679577235934.png" alt="stefanvlad_1-1679577235934.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then I have added this value into the &lt;EM&gt;&lt;STRONG&gt;mcb_pmsm_foc_hall_MCSPTE1AK144_data.m&lt;/STRONG&gt;&lt;/EM&gt; script:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefanvlad_2-1679577287546.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215994i6F53B1DF8555D902/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_2-1679577287546.png" alt="stefanvlad_2-1679577287546.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then I &lt;FONT color="#339966"&gt;save and run&lt;/FONT&gt; the&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;mcb_pmsm_foc_hall_MCSPTE1AK144_data.m&lt;/EM&gt;&lt;/STRONG&gt; again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;FONT color="#FF9900"&gt;Workflow 3&lt;/FONT&gt;&lt;/H2&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Opening the &lt;STRONG&gt;mcb_pmsm_foc_hall_MCSPTE1AK144.slx&lt;/STRONG&gt; model, I flashed it on the &lt;STRONG&gt;S32K144&lt;/STRONG&gt; board, pressing Build ( or &lt;STRONG&gt;Ctrl+B&lt;/STRONG&gt; on keyboard):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefanvlad_3-1679577441862.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215995iBF890D89B5DEDF11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_3-1679577441862.png" alt="stefanvlad_3-1679577441862.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then opening the&amp;nbsp;&lt;STRONG&gt;mcb_hall_foc_host.slx&lt;/STRONG&gt;&amp;nbsp;model and open com port settings, and setting COM4:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefanvlad_5-1679578410819.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215998iFD09CA13D5465CF1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_5-1679578410819.png" alt="stefanvlad_5-1679578410819.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can see in the device manager what COM port your particular board has.&lt;/P&gt;
&lt;P&gt;Then I press &lt;FONT color="#00FF00"&gt;Run &lt;/FONT&gt;and also toggle from &lt;FONT color="#FF0000"&gt;Stop&lt;/FONT&gt; to &lt;FONT color="#3366FF"&gt;Start&lt;/FONT&gt;. If the motor does not &lt;FONT color="#3366FF"&gt;Start&lt;/FONT&gt;, press the reset button on the board.&lt;/P&gt;
&lt;P&gt;The final result with the motor spinning, after &lt;STRONG&gt;pressing the &lt;FONT color="#FF0000"&gt;reset&lt;/FONT&gt; button&lt;/STRONG&gt; on &lt;FONT color="#339966"&gt;the board&lt;/FONT&gt;, looks like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="stefanvlad_0-1679576373009.png" style="width: 1920px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215992iC7B19948524FA1C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefanvlad_0-1679576373009.png" alt="stefanvlad_0-1679576373009.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope all of the above instructions help you to spin the motor &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Stefan&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 13:36:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-FOC-using-Hall-sensor-motor-cannot-run/m-p/1620901#M8087</guid>
      <dc:creator>stefanvlad</dc:creator>
      <dc:date>2023-03-23T13:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 FOC using Hall sensor - motor cannot run</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-FOC-using-Hall-sensor-motor-cannot-run/m-p/1782731#M8735</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203341"&gt;@stefanvlad&lt;/a&gt;&amp;nbsp;what modifications are necessary for this model to run on TORQUE control rather than on SPEED control ?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 06:35:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K144-FOC-using-Hall-sensor-motor-cannot-run/m-p/1782731#M8735</guid>
      <dc:creator>srnp6037</dc:creator>
      <dc:date>2024-01-04T06:35:33Z</dc:date>
    </item>
  </channel>
</rss>

