<?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)のトピックModule 10: Sensorless Speed Control</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/956170#M3671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_9.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87810i333C5F79E030C88D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_9.png" alt="pastedImage_9.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;INTRODUCTION&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;In this article we are going to discuss a couple of aspects that you should expect when building complex applications like Motor Control Speed Control of PMSM based on Sensorless methods. As discussed in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp; and&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477111"&gt;Module 9: Position Observer (Part 2/2)&lt;/A&gt;&amp;nbsp;there are numerous techniques for estimating the rotor speed and position and one method was chosen to be applied for our use-case.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Now, based on my personal experience with various motor setups and different techniques, I can honestly say that is not always easy to have such a setup working from the first try, and for each application there might be a slightly different approach, extra tuning or perhaps a trick to have it running as per expectations.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;As the current publication date of this article proves, I've also run into various issues with this application. Perhaps my initial expectations were high or perhaps I was hopping that someone will glue together modules M8 with M9 and provide a final solution. I'm pleased to see that the articles part of this workshop&amp;nbsp;&lt;A href="https://community.nxp.com/thread/464336"&gt;3-Phase PMSM Control Workshop with NXP's Model-Based Design Toolbox&lt;/A&gt;&amp;nbsp; have thousand of views and lots of comments. But more important is the fact that viewers have started to build their own setups or to participate with articles to extend various functionalities presented in the main articles.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Anyhow, based on your requests passed via this community, personal messages and even direct feedback via FAE/Sales/Marketing (which I would like to thank you all for the interest and valuable feedback) I've decided that is time to put this to an end. Hence, I've started to work again full time on this and now after a couple of iterations, I'm ready to share with you all the final&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.mathworks.com/products/simulink.html" style="color: #2989c5; text-decoration: none;"&gt;Simulink&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;model that is controlling the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.nxp.com/design/development-boards/automotive-motor-control-development-solutions/arm-based-solutions-/s32k144-development-kit-for-3-phase-pmsm:MTRDEVKSPNK144" style="color: #2989c5; text-decoration: none;" title="https://www.nxp.com/design/development-boards/automotive-motor-control-development-solutions/arm-based-solutions-/s32k144-development-kit-for-3-phase-pmsm:MTRDEVKSPNK144"&gt;S32K144 Development Kit for 3-phase PMSM | NXP&lt;/A&gt;&amp;nbsp;in Sensorless Mode directly from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.mathworks.com/products/matlab.html" style="color: #2989c5; text-decoration: none;"&gt;MATLAB&lt;/A&gt;.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Nonetheless, this article (since it the last in this workshop) is going to be a little bit different than the rest of the ones you got used in this workshop. Instead of focusing how the model is implemented step-by-step and technical aspects (in fact all technicalities have been discussed previously) , I prefer to talk about:&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;the approaches I've used to make it work&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;what challenges I've faced during development&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;things you need to pay attentions when porting your own applications&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;suggestions for improvements&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;How It Works&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The zip file that you'll find at the end of this article contains three components:&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;STRONG&gt;PMSM_Sensorless_s32k144.mdl&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Simulink model developed with MATLAB 2019a. If you need to use an older version of MATLAB, then just open the mdl file as text and edit the third line.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87812i1F8D83015114D4FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;&lt;STRONG&gt;Sensorless_Params.m&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Matlab script that computes the parameters for the BackEMF and Tracking Observers discussed in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp;This script is called automatically when the Simulink model is opened in MATLAB.&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87813iDD7214F1E2169BF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px;"&gt;&lt;STRONG&gt;FreeMASTER project&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to control the PMSM behavior, tune and to visualize the parameters and variables&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87814iABE75CB21EEEFD43/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;To run the model on the hardware&amp;nbsp;the next&amp;nbsp;steps should be followed:&lt;/P&gt;&lt;OL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Make sure you have the correct SW setup. This model has been developed with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/docs/DOC-343949"&gt;Model-Based Design Toolbox for S32K1xx Automotive Version 4.1.0&lt;/A&gt;&amp;nbsp; Type "ver" in the MATLAB prompt to display the version of the toolbox installed&lt;/LI&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Make sure the HW is configured correctly to operate in PMSM mode. It is important to verify the J9/J10/J11 position as indicated on the MotorGD shield in order to allow phase current measurements. Also, make sure R72 potentiomenter is set to allow a higher DC current threshold. Read carefully the model description available in the mdl file&amp;nbsp;&lt;/LI&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Generate the code for the model and download the code to your target.&lt;/LI&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Open FreeMASTER project to control the motor behavior&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;Implementation Details&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The Simulink model for the sensorless speed control of the PMSM is a combination of the model shown in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/471093"&gt;Module 8: Speed Control&lt;/A&gt;&amp;nbsp;enhanced with the observers discussed in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp;. The basic control structure is very similar, hence we are not going to repeat our self but instead we shall focus on differences and new features added.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The main control structure with fast and slow control loops is shown in Fig. 1&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87815i055C87168527E5CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 1: Sensorless Speed Control of PMSM Simulink Model&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The main difference between this model and the one one shown in Fig. 34 within&amp;nbsp;&lt;A href="https://community.nxp.com/thread/471093"&gt;Module 8: Speed Control&lt;/A&gt;&amp;nbsp;is the fact that actual motor speed is estimated in the Fast Loop rather than being estimated based on Hall Sensor transitions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #333399; font-size: 22px;"&gt;&lt;STRONG&gt;Slow Loop Subsystem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The Slow Loop subsystem has been slightly updated to reflect better the operations that takes place at each 1ms interrupt.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_11.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87816i6D40F26C228BD49F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_11.png" alt="pastedImage_11.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 2:&amp;nbsp;Slow Loop Subsystem&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;As shown in Fig. 2, the first operation is to deal with the Speed Reference profile during acceleration and deceleration regimes. The next operation is to compute the torque command based on a Speed Controller. In parallel with the speed controller we need to monitor the Speed Reference to select the mode of operation: open loop, tracking mode and closed loop. This information is need to switch from open loop to closed loop operation. The last operation done in Slow Loop is the Alignment procedure which is done only at startup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this subsystem the major modifications made compared with previous model in Fig. 33 within&amp;nbsp;&lt;A href="https://community.nxp.com/thread/471093"&gt;Module 8: Speed Control&lt;/A&gt;&amp;nbsp; are:&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_15.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87817i0E1108CC7BBD3338/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_15.png" alt="pastedImage_15.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 3: Speed Controller Subsystem&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;The Speed_Fbk, estimated by the Tracking Observer needs to be translated from electrical to mechanical units and then filtered with a moving average filter.&amp;nbsp;&lt;/LI&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;The PI Speed Controller has been enhance to allow an initial value for the integral part accumulator. This is required to have a smoother transitions between open and closed loop.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #333399; font-size: 22px;"&gt;&lt;STRONG&gt;Fast Loop Subsystem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The fast loop subsystem has been optimized further for getting the best possible performance and to keep some tuning options available. Compared with Fig. 30 in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/471093"&gt;Module 8: Speed Control&lt;/A&gt;&amp;nbsp;the new model adds 2 new subsystems highlighted below in blue foreground: Rotor Position and BackEMF Observer&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_23.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87818i76BE6B94F7F837BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_23.png" alt="pastedImage_23.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 4:&amp;nbsp;Fast Loop Subsystem&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The BackEMF Observer subsystem implements the model shown in Fig. 9 within&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp;but this time directly in floating point using the dedicated&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.nxp.com/design/automotive-software-and-tools/automotive-math-and-motor-control-library-set:AUTOMATH_MCL" style="color: #2989c5; text-decoration: none;" title="https://www.nxp.com/design/automotive-software-and-tools/automotive-math-and-motor-control-library-set:AUTOMATH_MCL"&gt;Automotive Math and Motor Control Library Set | NXP&lt;/A&gt;&amp;nbsp;functions: AMCLIB_BemfObsrvDQ and AMCLIB_TrackObsrv&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_28.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87819i650FCFFD7C6A19D3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_28.png" alt="pastedImage_28.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 5: Speed and Position Observers&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The parameters for these observers are computed according with the guidelines from the AMMCLIB User Manual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The other subsystem that has been modified is the Rotor Position, that handles the merging speed/angle between the open loop, tracking and closed loop modes of operation.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_31.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87857iAFEA1AA4E3730ECA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_31.png" alt="pastedImage_31.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 6: Speed and Position Observers&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="text-align: justify;"&gt;In case of the closed loop operation, due to the delays added by the estimation procedure, we need to compensate for the the rotor phase advance from the moment we read the current/voltages and the moment we are ready to apply the new command voltages. During the computations the rotor will advance with some degrees depending on the commanded speed, hence the new angle needs to be advanced forwards.&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;Sensorless&amp;nbsp;Run Time&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The FreeMASTER project is giving you access to all important parameters and variables for tuning or monitoring actions.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Fig. 7, illustrates a typical startup, followed by an acceleration and deceleration regimes. Throughout these profiles, the Speed Controller manages to keep the motor speed within a decent error envelope of +/- 200 rpm. If better performance is required, then the FreeMASTER can be used to tune the PI controller gains in real time.&amp;nbsp;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87858iB40B15A24CCAD580/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 7:&amp;nbsp;Control system response at startup and change of speeds&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Further investigations and tuning may be deployed to achieved the best system stability. Fig. 8, shows the BackEMF observer output during startup of PMSM and show fast the estimator can cope with changes in the motor speed commands.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87859iD71C390EFE2BA762/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 8: Rotor Position and Speed Estimation during startup of PMSM&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Keep in mind that there are multiple parameters that influence the system response, hence you need to have an holistic view of the entire system. Fig. 9 shows how the current controllers behaves during startup (from 5 to 8 sec on the scope) and then during acceleration regime.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_12.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87860iE804F2097C9141B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_12.png" alt="pastedImage_12.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig.&amp;nbsp;9:&amp;nbsp;Flux and Torque current controllers responses&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;Some Things to Consider&amp;nbsp;when Porting Applications&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Let us presume you have a totally different system (motor and perhaps drive) that you need to configure for running in sensorless mode. If you hope that by simply taking a model like the one shown here, it will work then perhaps you are too optimistic. What are the main steps and procedures to have your system running ?&amp;nbsp;&lt;/P&gt;&lt;OL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The first step (assuming is a new drive and motor) is to check if you can&amp;nbsp;rotate the motor in a simple open loop mode - like the one discussed in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/467938"&gt;Module 5: V/F Scalar Control&lt;/A&gt;. You basically connect the motor phases with the power drive and starting from a low voltage command level you check if the motor start spinning. This first step ensure your PWM command sequence are correct.&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The second step is to measure the phase currents. With the motor spinning at low and high rpm in open loop you start to check the ADC measurements as shown in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/469445"&gt;Module 6: Current Sensing (Part 1/2)&lt;/A&gt;&amp;nbsp; and&amp;nbsp;&lt;A href="https://community.nxp.com/thread/469526"&gt;Module 6: Current Sensing (Part 2/2)&lt;/A&gt;&amp;nbsp;. There is no purpose of moving forward until you manage to read the currents correctly.&amp;nbsp;&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The third step is to tune the Current Controllers making sure the IQ and ID currents can follow your commands. The tuning aspects have been discussed with various occasions. You can compute the gains mathematically and tune the controllers manually, it really does not matter as long as they follow your command. Using the model attached here, you can tune the controllers during the alignment procedure by simply changing the value of the constant in the Align_Sequence State Flow diagram. A larger value will give you enough time during standstill where there is no back-emf to influence the current controller. Remember, that the current controllers shall be always tuned with the rotor at standstill position - typically with current applied in D-axis.&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The fourth step is to tune the observers. Starting from the mathematical equations and your motor parameters you'll get a first set of values. Then you need to verify the estimations. For that you can force the motor to stay in tracking mode by changing the value of the speed limit. In the tracking mode you should compare the estimated speed and electric angle with the ones estimated by the observer. If there are differences between them, try to change the manually the gains of the observers. Based on personal experience the motor electrical parameters like inductance are the ones that influence the most the observer results. So, if our observer fails to produce the correct estimates, then have a look at your electrical parameters first&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The fifth step is to measure the execution of the loops and subsystems. Check how much time does it takes to perform all the computations. The timing might affect the phase advance or even the entire system if the loops starts to overlap.&amp;nbsp;&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The last step is to close the loop. Start with a higher merging speed and then decrease it step by step. If the transition from open to close is not happening correctly, then you need to check the speed controller tuning. Perhaps the transition between the modes creates a disturbance, perhaps the integral part is not at the level it should be from open loop as shown in Fig. 10&lt;/LI&gt;&lt;/OL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="height: 341px;"&gt;&lt;TD style="height: 341px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87861iDD1F1A444F2235AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 27px;"&gt;&lt;TD style="text-align: center; height: 27px;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 10:&amp;nbsp;Transition from open to closed loop&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Once you have the system up and running, then is time for another settings or improvements. Tune the Speed and Current Controllers to deal with the system dynamics and loads.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;If you run into issues with this particular sensorless application then perhaps you wish to have a look to other implementations too like the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.nxp.com/design/development-boards/automotive-motor-control-development-solutions/arm-based-solutions-/s32k144-development-kit-for-3-phase-pmsm:MTRDEVKSPNK144" style="color: #2989c5; text-decoration: none;" title="https://www.nxp.com/design/development-boards/automotive-motor-control-development-solutions/arm-based-solutions-/s32k144-development-kit-for-3-phase-pmsm:MTRDEVKSPNK144"&gt;S32K144 Development Kit for 3-phase PMSM | NXP&lt;/A&gt;&amp;nbsp;Reference Design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;Improvements Proposals&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;As it was stated in the beginning of this workshop, the main reason for having these articles is to demonstrate how you can built applications with Model-Based Design Toolbox. These examples should be considered only for teaching aspects and promotion of the toolbox various functionalities. It is not in the scope of these articles to present a state of the art solution but rather to showcase various possibilities that can be address within this space.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;In this particular use case, there are a few improvements that could be done to achieve a better control system starting from these examples:&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Optimize the application further by using the dedicated NXP AMMCLIB Controllers instead of the standard ones from Simulink. This will give a bust in performance but it will be harder to tune since the gains will be hard coded into the generated code.&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87862i1259943E9594D789/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Replace part of the control loops with dedicated blocks from the AMMCLIB/Advanced Motor Control Library blocks like Current/Speed Loops. This will make your model harder to read but more faster since the number of read/writes for data manipulation will be reduced.&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="height: 387px;"&gt;&lt;TD style="height: 387px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87863iF98AA45A3161D7B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Change the implementation format from Floating Point (easier for teaching purposes) to a Fixed Point model. This will allow further increase in performance by lowering the time needed for computations. Again AMMCLIB can be used to model such applications.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="text-align: justify;"&gt;Implement a phase advance mechanism that will take into consideration the motor speed. Now, that is a fixed value that covers the entire range of operation of a particular motor. For a more generic implementation, that should consider the speed range and the amount of time needed for computation in fast loop.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="text-align: justify;"&gt;Consider both clock wise and counter clock wise directions. Currently the model implements a single direction assuming the sensorless applications are mainly used for pumps/fans and such type of devices that do not require reversals.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Another area suitable for improvements is the one dealing with application failures and monitoring. Using finite state machines like the one presented here&amp;nbsp;&lt;A href="https://community.nxp.com/docs/DOC-340884"&gt;Model Based Design Approach to Motor Control with S32K144 - part No.1&lt;/A&gt;&amp;nbsp;you can build a complex application on top of existing model to deal with real life scenarios. Currently the model attached do not contains any kind of failure modes for the application like what need to be done in case the sensorless estimation is crashing. These kind of feature is the responsibility of the engineers that design the application to deal with.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Modelling improvements is another area that could potentially improve the user experience. Integrating&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.mathworks.com/products/simscape.html" style="color: #2989c5; text-decoration: none;" title="https://www.mathworks.com/products/simscape.html"&gt;Simscape - MATLAB &amp;amp; Simulink&lt;/A&gt;&amp;nbsp;&amp;nbsp;into the model will help to compare the simulations against the real hardware implementation. Since not all the users might own such licenses we tried to stay apart of such models or at least we tried to build our simplified plants as shown in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/467938"&gt;Module 5: V/F Scalar Control&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;If you have other ideas for improvements, let us know as comments below. We look forward to see more applications implemented on top of&amp;nbsp;&lt;A href="http://www.nxp.com/mbdt" style="color: #2989c5; text-decoration: none;" title="http://www.nxp.com/mbdt"&gt;Model-Based Design Toolbox | NXP&lt;/A&gt;&amp;nbsp;and show cased here in this community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold; font-size: 16px;"&gt;Update revisions&lt;/STRONG&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0in;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 11.5pt;"&gt;May 06, 2020&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="color: #51626f; background-color: #ffffff; border: 0px; padding: 0px 0px 0px 30px;"&gt;&lt;LI style="border: 0px; font-weight: inherit; margin: 0.5ex 0px 0.0001pt;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;Added the model&amp;nbsp;to work with&amp;nbsp;&lt;A _jive_internal="true" data-objecttype="102" href="https://community.nxp.com/docs/DOC-346265" style="color: #3d9ce7; background-color: transparent; border: 0px; font-weight: inherit; font-size: 16px; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;&lt;SPAN style="color: blue; border: 0px; font-weight: inherit; font-size: 16px;"&gt;Model-Based Design Toolbox for MPC57xx Automotive Version 3.2.0&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp; .&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Sep 2019 11:25:16 GMT</pubDate>
    <dc:creator>Daniel_Popa</dc:creator>
    <dc:date>2019-09-22T11:25:16Z</dc:date>
    <item>
      <title>Module 10: Sensorless Speed Control</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/956170#M3671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_9.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87810i333C5F79E030C88D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_9.png" alt="pastedImage_9.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;INTRODUCTION&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;In this article we are going to discuss a couple of aspects that you should expect when building complex applications like Motor Control Speed Control of PMSM based on Sensorless methods. As discussed in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp; and&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477111"&gt;Module 9: Position Observer (Part 2/2)&lt;/A&gt;&amp;nbsp;there are numerous techniques for estimating the rotor speed and position and one method was chosen to be applied for our use-case.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Now, based on my personal experience with various motor setups and different techniques, I can honestly say that is not always easy to have such a setup working from the first try, and for each application there might be a slightly different approach, extra tuning or perhaps a trick to have it running as per expectations.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;As the current publication date of this article proves, I've also run into various issues with this application. Perhaps my initial expectations were high or perhaps I was hopping that someone will glue together modules M8 with M9 and provide a final solution. I'm pleased to see that the articles part of this workshop&amp;nbsp;&lt;A href="https://community.nxp.com/thread/464336"&gt;3-Phase PMSM Control Workshop with NXP's Model-Based Design Toolbox&lt;/A&gt;&amp;nbsp; have thousand of views and lots of comments. But more important is the fact that viewers have started to build their own setups or to participate with articles to extend various functionalities presented in the main articles.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Anyhow, based on your requests passed via this community, personal messages and even direct feedback via FAE/Sales/Marketing (which I would like to thank you all for the interest and valuable feedback) I've decided that is time to put this to an end. Hence, I've started to work again full time on this and now after a couple of iterations, I'm ready to share with you all the final&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.mathworks.com/products/simulink.html" style="color: #2989c5; text-decoration: none;"&gt;Simulink&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;model that is controlling the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.nxp.com/design/development-boards/automotive-motor-control-development-solutions/arm-based-solutions-/s32k144-development-kit-for-3-phase-pmsm:MTRDEVKSPNK144" style="color: #2989c5; text-decoration: none;" title="https://www.nxp.com/design/development-boards/automotive-motor-control-development-solutions/arm-based-solutions-/s32k144-development-kit-for-3-phase-pmsm:MTRDEVKSPNK144"&gt;S32K144 Development Kit for 3-phase PMSM | NXP&lt;/A&gt;&amp;nbsp;in Sensorless Mode directly from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.mathworks.com/products/matlab.html" style="color: #2989c5; text-decoration: none;"&gt;MATLAB&lt;/A&gt;.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Nonetheless, this article (since it the last in this workshop) is going to be a little bit different than the rest of the ones you got used in this workshop. Instead of focusing how the model is implemented step-by-step and technical aspects (in fact all technicalities have been discussed previously) , I prefer to talk about:&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;the approaches I've used to make it work&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;what challenges I've faced during development&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;things you need to pay attentions when porting your own applications&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;suggestions for improvements&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;How It Works&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The zip file that you'll find at the end of this article contains three components:&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;STRONG&gt;PMSM_Sensorless_s32k144.mdl&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Simulink model developed with MATLAB 2019a. If you need to use an older version of MATLAB, then just open the mdl file as text and edit the third line.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87812i1F8D83015114D4FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;&lt;STRONG&gt;Sensorless_Params.m&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Matlab script that computes the parameters for the BackEMF and Tracking Observers discussed in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp;This script is called automatically when the Simulink model is opened in MATLAB.&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87813iDD7214F1E2169BF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px;"&gt;&lt;STRONG&gt;FreeMASTER project&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to control the PMSM behavior, tune and to visualize the parameters and variables&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87814iABE75CB21EEEFD43/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;To run the model on the hardware&amp;nbsp;the next&amp;nbsp;steps should be followed:&lt;/P&gt;&lt;OL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Make sure you have the correct SW setup. This model has been developed with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.nxp.com/docs/DOC-343949"&gt;Model-Based Design Toolbox for S32K1xx Automotive Version 4.1.0&lt;/A&gt;&amp;nbsp; Type "ver" in the MATLAB prompt to display the version of the toolbox installed&lt;/LI&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Make sure the HW is configured correctly to operate in PMSM mode. It is important to verify the J9/J10/J11 position as indicated on the MotorGD shield in order to allow phase current measurements. Also, make sure R72 potentiomenter is set to allow a higher DC current threshold. Read carefully the model description available in the mdl file&amp;nbsp;&lt;/LI&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Generate the code for the model and download the code to your target.&lt;/LI&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Open FreeMASTER project to control the motor behavior&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;Implementation Details&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The Simulink model for the sensorless speed control of the PMSM is a combination of the model shown in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/471093"&gt;Module 8: Speed Control&lt;/A&gt;&amp;nbsp;enhanced with the observers discussed in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp;. The basic control structure is very similar, hence we are not going to repeat our self but instead we shall focus on differences and new features added.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The main control structure with fast and slow control loops is shown in Fig. 1&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87815i055C87168527E5CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_7.png" alt="pastedImage_7.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 1: Sensorless Speed Control of PMSM Simulink Model&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The main difference between this model and the one one shown in Fig. 34 within&amp;nbsp;&lt;A href="https://community.nxp.com/thread/471093"&gt;Module 8: Speed Control&lt;/A&gt;&amp;nbsp;is the fact that actual motor speed is estimated in the Fast Loop rather than being estimated based on Hall Sensor transitions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #333399; font-size: 22px;"&gt;&lt;STRONG&gt;Slow Loop Subsystem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The Slow Loop subsystem has been slightly updated to reflect better the operations that takes place at each 1ms interrupt.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_11.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87816i6D40F26C228BD49F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_11.png" alt="pastedImage_11.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 2:&amp;nbsp;Slow Loop Subsystem&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;As shown in Fig. 2, the first operation is to deal with the Speed Reference profile during acceleration and deceleration regimes. The next operation is to compute the torque command based on a Speed Controller. In parallel with the speed controller we need to monitor the Speed Reference to select the mode of operation: open loop, tracking mode and closed loop. This information is need to switch from open loop to closed loop operation. The last operation done in Slow Loop is the Alignment procedure which is done only at startup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this subsystem the major modifications made compared with previous model in Fig. 33 within&amp;nbsp;&lt;A href="https://community.nxp.com/thread/471093"&gt;Module 8: Speed Control&lt;/A&gt;&amp;nbsp; are:&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_15.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87817i0E1108CC7BBD3338/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_15.png" alt="pastedImage_15.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 3: Speed Controller Subsystem&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;The Speed_Fbk, estimated by the Tracking Observer needs to be translated from electrical to mechanical units and then filtered with a moving average filter.&amp;nbsp;&lt;/LI&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;The PI Speed Controller has been enhance to allow an initial value for the integral part accumulator. This is required to have a smoother transitions between open and closed loop.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #333399; font-size: 22px;"&gt;&lt;STRONG&gt;Fast Loop Subsystem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The fast loop subsystem has been optimized further for getting the best possible performance and to keep some tuning options available. Compared with Fig. 30 in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/471093"&gt;Module 8: Speed Control&lt;/A&gt;&amp;nbsp;the new model adds 2 new subsystems highlighted below in blue foreground: Rotor Position and BackEMF Observer&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_23.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87818i76BE6B94F7F837BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_23.png" alt="pastedImage_23.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 4:&amp;nbsp;Fast Loop Subsystem&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The BackEMF Observer subsystem implements the model shown in Fig. 9 within&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp;but this time directly in floating point using the dedicated&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.nxp.com/design/automotive-software-and-tools/automotive-math-and-motor-control-library-set:AUTOMATH_MCL" style="color: #2989c5; text-decoration: none;" title="https://www.nxp.com/design/automotive-software-and-tools/automotive-math-and-motor-control-library-set:AUTOMATH_MCL"&gt;Automotive Math and Motor Control Library Set | NXP&lt;/A&gt;&amp;nbsp;functions: AMCLIB_BemfObsrvDQ and AMCLIB_TrackObsrv&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_28.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87819i650FCFFD7C6A19D3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_28.png" alt="pastedImage_28.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 5: Speed and Position Observers&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The parameters for these observers are computed according with the guidelines from the AMMCLIB User Manual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;The other subsystem that has been modified is the Rotor Position, that handles the merging speed/angle between the open loop, tracking and closed loop modes of operation.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_31.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87857iAFEA1AA4E3730ECA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_31.png" alt="pastedImage_31.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 6: Speed and Position Observers&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="text-align: justify;"&gt;In case of the closed loop operation, due to the delays added by the estimation procedure, we need to compensate for the the rotor phase advance from the moment we read the current/voltages and the moment we are ready to apply the new command voltages. During the computations the rotor will advance with some degrees depending on the commanded speed, hence the new angle needs to be advanced forwards.&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;Sensorless&amp;nbsp;Run Time&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The FreeMASTER project is giving you access to all important parameters and variables for tuning or monitoring actions.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Fig. 7, illustrates a typical startup, followed by an acceleration and deceleration regimes. Throughout these profiles, the Speed Controller manages to keep the motor speed within a decent error envelope of +/- 200 rpm. If better performance is required, then the FreeMASTER can be used to tune the PI controller gains in real time.&amp;nbsp;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87858iB40B15A24CCAD580/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 7:&amp;nbsp;Control system response at startup and change of speeds&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Further investigations and tuning may be deployed to achieved the best system stability. Fig. 8, shows the BackEMF observer output during startup of PMSM and show fast the estimator can cope with changes in the motor speed commands.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87859iD71C390EFE2BA762/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 8: Rotor Position and Speed Estimation during startup of PMSM&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Keep in mind that there are multiple parameters that influence the system response, hence you need to have an holistic view of the entire system. Fig. 9 shows how the current controllers behaves during startup (from 5 to 8 sec on the scope) and then during acceleration regime.&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_12.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87860iE804F2097C9141B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_12.png" alt="pastedImage_12.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig.&amp;nbsp;9:&amp;nbsp;Flux and Torque current controllers responses&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;Some Things to Consider&amp;nbsp;when Porting Applications&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Let us presume you have a totally different system (motor and perhaps drive) that you need to configure for running in sensorless mode. If you hope that by simply taking a model like the one shown here, it will work then perhaps you are too optimistic. What are the main steps and procedures to have your system running ?&amp;nbsp;&lt;/P&gt;&lt;OL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The first step (assuming is a new drive and motor) is to check if you can&amp;nbsp;rotate the motor in a simple open loop mode - like the one discussed in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/467938"&gt;Module 5: V/F Scalar Control&lt;/A&gt;. You basically connect the motor phases with the power drive and starting from a low voltage command level you check if the motor start spinning. This first step ensure your PWM command sequence are correct.&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The second step is to measure the phase currents. With the motor spinning at low and high rpm in open loop you start to check the ADC measurements as shown in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/469445"&gt;Module 6: Current Sensing (Part 1/2)&lt;/A&gt;&amp;nbsp; and&amp;nbsp;&lt;A href="https://community.nxp.com/thread/469526"&gt;Module 6: Current Sensing (Part 2/2)&lt;/A&gt;&amp;nbsp;. There is no purpose of moving forward until you manage to read the currents correctly.&amp;nbsp;&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The third step is to tune the Current Controllers making sure the IQ and ID currents can follow your commands. The tuning aspects have been discussed with various occasions. You can compute the gains mathematically and tune the controllers manually, it really does not matter as long as they follow your command. Using the model attached here, you can tune the controllers during the alignment procedure by simply changing the value of the constant in the Align_Sequence State Flow diagram. A larger value will give you enough time during standstill where there is no back-emf to influence the current controller. Remember, that the current controllers shall be always tuned with the rotor at standstill position - typically with current applied in D-axis.&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The fourth step is to tune the observers. Starting from the mathematical equations and your motor parameters you'll get a first set of values. Then you need to verify the estimations. For that you can force the motor to stay in tracking mode by changing the value of the speed limit. In the tracking mode you should compare the estimated speed and electric angle with the ones estimated by the observer. If there are differences between them, try to change the manually the gains of the observers. Based on personal experience the motor electrical parameters like inductance are the ones that influence the most the observer results. So, if our observer fails to produce the correct estimates, then have a look at your electrical parameters first&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The fifth step is to measure the execution of the loops and subsystems. Check how much time does it takes to perform all the computations. The timing might affect the phase advance or even the entire system if the loops starts to overlap.&amp;nbsp;&lt;/LI&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;The last step is to close the loop. Start with a higher merging speed and then decrease it step by step. If the transition from open to close is not happening correctly, then you need to check the speed controller tuning. Perhaps the transition between the modes creates a disturbance, perhaps the integral part is not at the level it should be from open loop as shown in Fig. 10&lt;/LI&gt;&lt;/OL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="height: 341px;"&gt;&lt;TD style="height: 341px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87861iDD1F1A444F2235AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 27px;"&gt;&lt;TD style="text-align: center; height: 27px;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 10:&amp;nbsp;Transition from open to closed loop&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Once you have the system up and running, then is time for another settings or improvements. Tune the Speed and Current Controllers to deal with the system dynamics and loads.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;If you run into issues with this particular sensorless application then perhaps you wish to have a look to other implementations too like the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.nxp.com/design/development-boards/automotive-motor-control-development-solutions/arm-based-solutions-/s32k144-development-kit-for-3-phase-pmsm:MTRDEVKSPNK144" style="color: #2989c5; text-decoration: none;" title="https://www.nxp.com/design/development-boards/automotive-motor-control-development-solutions/arm-based-solutions-/s32k144-development-kit-for-3-phase-pmsm:MTRDEVKSPNK144"&gt;S32K144 Development Kit for 3-phase PMSM | NXP&lt;/A&gt;&amp;nbsp;Reference Design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;Improvements Proposals&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;As it was stated in the beginning of this workshop, the main reason for having these articles is to demonstrate how you can built applications with Model-Based Design Toolbox. These examples should be considered only for teaching aspects and promotion of the toolbox various functionalities. It is not in the scope of these articles to present a state of the art solution but rather to showcase various possibilities that can be address within this space.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;In this particular use case, there are a few improvements that could be done to achieve a better control system starting from these examples:&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="color: #51626f; background-color: #ffffff; border: 0px; text-align: justify;"&gt;Optimize the application further by using the dedicated NXP AMMCLIB Controllers instead of the standard ones from Simulink. This will give a bust in performance but it will be harder to tune since the gains will be hard coded into the generated code.&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD style="border: inherit solid inherit; font-size: inherit; padding: 5px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87862i1259943E9594D789/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Replace part of the control loops with dedicated blocks from the AMMCLIB/Advanced Motor Control Library blocks like Current/Speed Loops. This will make your model harder to read but more faster since the number of read/writes for data manipulation will be reduced.&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY style="border: inherit solid inherit;"&gt;&lt;TR style="height: 387px;"&gt;&lt;TD style="height: 387px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87863iF98AA45A3161D7B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_6.png" alt="pastedImage_6.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Change the implementation format from Floating Point (easier for teaching purposes) to a Fixed Point model. This will allow further increase in performance by lowering the time needed for computations. Again AMMCLIB can be used to model such applications.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="text-align: justify;"&gt;Implement a phase advance mechanism that will take into consideration the motor speed. Now, that is a fixed value that covers the entire range of operation of a particular motor. For a more generic implementation, that should consider the speed range and the amount of time needed for computation in fast loop.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="text-align: justify;"&gt;Consider both clock wise and counter clock wise directions. Currently the model implements a single direction assuming the sensorless applications are mainly used for pumps/fans and such type of devices that do not require reversals.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Another area suitable for improvements is the one dealing with application failures and monitoring. Using finite state machines like the one presented here&amp;nbsp;&lt;A href="https://community.nxp.com/docs/DOC-340884"&gt;Model Based Design Approach to Motor Control with S32K144 - part No.1&lt;/A&gt;&amp;nbsp;you can build a complex application on top of existing model to deal with real life scenarios. Currently the model attached do not contains any kind of failure modes for the application like what need to be done in case the sensorless estimation is crashing. These kind of feature is the responsibility of the engineers that design the application to deal with.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px;"&gt;&lt;LI style="margin: 0.2em 0px; text-align: justify;"&gt;Modelling improvements is another area that could potentially improve the user experience. Integrating&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.mathworks.com/products/simscape.html" style="color: #2989c5; text-decoration: none;" title="https://www.mathworks.com/products/simscape.html"&gt;Simscape - MATLAB &amp;amp; Simulink&lt;/A&gt;&amp;nbsp;&amp;nbsp;into the model will help to compare the simulations against the real hardware implementation. Since not all the users might own such licenses we tried to stay apart of such models or at least we tried to build our simplified plants as shown in&amp;nbsp;&lt;A href="https://community.nxp.com/thread/467938"&gt;Module 5: V/F Scalar Control&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://community.nxp.com/thread/477109"&gt;Module 9: Position Observer (Part 1/2)&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;If you have other ideas for improvements, let us know as comments below. We look forward to see more applications implemented on top of&amp;nbsp;&lt;A href="http://www.nxp.com/mbdt" style="color: #2989c5; text-decoration: none;" title="http://www.nxp.com/mbdt"&gt;Model-Based Design Toolbox | NXP&lt;/A&gt;&amp;nbsp;and show cased here in this community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold; font-size: 16px;"&gt;Update revisions&lt;/STRONG&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; margin: 2pt 0in;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 11.5pt;"&gt;May 06, 2020&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="color: #51626f; background-color: #ffffff; border: 0px; padding: 0px 0px 0px 30px;"&gt;&lt;LI style="border: 0px; font-weight: inherit; margin: 0.5ex 0px 0.0001pt;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit; font-size: 12pt;"&gt;Added the model&amp;nbsp;to work with&amp;nbsp;&lt;A _jive_internal="true" data-objecttype="102" href="https://community.nxp.com/docs/DOC-346265" style="color: #3d9ce7; background-color: transparent; border: 0px; font-weight: inherit; font-size: 16px; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;&lt;SPAN style="color: blue; border: 0px; font-weight: inherit; font-size: 16px;"&gt;Model-Based Design Toolbox for MPC57xx Automotive Version 3.2.0&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp; .&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="border: 0px; padding: 0in; color: #333399; font-weight: bold; font-size: 30px;"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Sep 2019 11:25:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/956170#M3671</guid>
      <dc:creator>Daniel_Popa</dc:creator>
      <dc:date>2019-09-22T11:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Module 10: Sensorless Speed Control</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/956171#M3672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;The speed detected with respect to the command value is reversed when viewed with Freemaster.&lt;BR /&gt;Speed adjustment is also not possible.&lt;BR /&gt;Hall sensor is not connected.&lt;BR /&gt;The MATLAB I am using is R2019A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2019 12:04:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/956171#M3672</guid>
      <dc:creator>hayaoki7</dc:creator>
      <dc:date>2019-10-01T12:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Module 10: Sensorless Speed Control</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/956172#M3673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/hayaoki7"&gt;hayaoki7&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The detected speed - can't be changed. It is a value computed by the observer at each 100ms.&lt;/P&gt;&lt;P&gt;The motor speed can be changed via:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Option one - Click on the Speed Widget in the FreeMASTER&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92846i7B2EA9A9FBE910DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Option two - use the Variable Watch window&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92844i9D3ADEE2792CDCB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general all the variables can be converted from read-only to read/write from Variable/Modifying tab&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92847i79F7EEFF673C64B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example there is no hall sensor needed - the rotor angle estimation requires only the i_a/i_b phase currents and control voltages u_alpha and u_beta. In M8 we use the hall sensor to estimate the speed because the motor do not have an encoder. If you have motor with any other type of sensor mounted - then it would be much more easier and more robust to build a motor control application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2019 12:23:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/956172#M3673</guid>
      <dc:creator>Daniel_Popa</dc:creator>
      <dc:date>2019-10-03T12:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Module 10: Sensorless Speed Control</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/1225800#M5710</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/50705"&gt;@Daniel_Popa&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I have version 4.2 of the MBDT and the&amp;nbsp;mcspte1ak144 development kit. When I open the model in M10_Sensorless.zip, all of the toolbox functions are unlinked and broken. Is there a way that either you can port the model over to version 4.2?&lt;/P&gt;&lt;P&gt;Alternatively, what would happen if I also install v. 4.1? would I be able to then open the model and replace the functions one by one with their 4.2 counterparts? Any help would be appreciated. Thank you for the very educational course!&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;-Mark&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 20:03:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/1225800#M5710</guid>
      <dc:creator>mpalframan</dc:creator>
      <dc:date>2021-02-03T20:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Module 10: Sensorless Speed Control</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/1226594#M5720</link>
      <description>&lt;P&gt;Specifically I get this error when loading the model:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Failure in mbd_s32k_convert_mdl_to_latest_version: Unable to find system or file 'ammclib_bam_s32k14x'. The closest match is 'ammclib_bam_S32K14x' in 'C:\Users\mark.palframan\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\mbdtbx_s32k14x\AMMCLIB_s32k14x\bam\ammclib_bam_S32K14x.slx'.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 19:33:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/1226594#M5720</guid>
      <dc:creator>mpalframan</dc:creator>
      <dc:date>2021-02-04T19:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Module 10: Sensorless Speed Control</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/1345781#M6530</link>
      <description>&lt;P&gt;I noticed that the position observer implementation in the final model is different from from the one in M9. Is there a reason? I tried both of them in an S32K144 project and I can't get the M10 version to work, whereas the M9 one seems to work as expected under the same conditions. Are they supposed to work in same way?&lt;/P&gt;&lt;P&gt;Thank you and best regards!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 09:49:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-10-Sensorless-Speed-Control/m-p/1345781#M6530</guid>
      <dc:creator>alessandro96</dc:creator>
      <dc:date>2021-09-24T09:49:35Z</dc:date>
    </item>
  </channel>
</rss>

