<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MBDT Fuzzzy Logic Controller in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBDT-Fuzzzy-Logic-Controller/m-p/1225609#M5704</link>
    <description>&lt;P&gt;Hi Marius, that's great thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appears to work great now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Crispin&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 14:20:42 GMT</pubDate>
    <dc:creator>C_Zuercher_APR</dc:creator>
    <dc:date>2021-02-03T14:20:42Z</dc:date>
    <item>
      <title>MBDT Fuzzzy Logic Controller</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBDT-Fuzzzy-Logic-Controller/m-p/1225445#M5701</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having some issues with deploying code onto the MPC5744P DEVKIT Board when using the Simulink Fuzzy Logic Control block.&lt;/P&gt;&lt;P&gt;When I comment through the Fuzzy Logic Control block, the code deploys perfectly fine and works as expected. However, when I leave the block in (as attached), the code deploys however there's no activity on the CAN Bus (as ascertained through PCAN-View) and the PWM Output remains at the initial value set in the PWM Config block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help with this?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Attached are:&lt;/P&gt;&lt;P&gt;- Simulink Model&lt;/P&gt;&lt;P&gt;- DBC File&lt;/P&gt;&lt;P&gt;- FIS File (for Fuzzy logic System)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 10:08:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBDT-Fuzzzy-Logic-Controller/m-p/1225445#M5701</guid>
      <dc:creator>C_Zuercher_APR</dc:creator>
      <dc:date>2021-02-03T10:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: MBDT Fuzzzy Logic Controller</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBDT-Fuzzzy-Logic-Controller/m-p/1225584#M5703</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/182314"&gt;@C_Zuercher_APR&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The problem is caused by the Fuzzy block which inserts the variable declaration code inside our step function. The variables' sizes are so large that it causes a stack overflow.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariuslucianand_0-1612358999462.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/136416iFE11D411F6F2A02D/image-size/large?v=v2&amp;amp;px=999" role="button" title="mariuslucianand_0-1612358999462.png" alt="mariuslucianand_0-1612358999462.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There are two ways of solving this.&lt;/P&gt;
&lt;P&gt;1. One of them is to try forcing the block to declare the variables from lines 310 to 323 as global so as they do not end up on the stack, on each step function execution. I've tried that but I was not successful so you should consider contacting MathWorks Support. I am sure that they can help you with this.&lt;/P&gt;
&lt;P&gt;2. You can use a custom linker file that contains an increased stack size. This is the faster workaround for your scenario. I have attached the linker file with a higher stack size.&lt;/P&gt;
&lt;P&gt;Let me show you how to install and use this linker file.&lt;/P&gt;
&lt;P&gt;a. in Matlab, type the following command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;cd(fullfile(mbd_find_mpc_root, '\mbdtbx_mpc574x\src\linker\gcc'))&lt;/P&gt;
&lt;P&gt;This will change the directory to where the linker files are stored. In this folder, you should copy the attached&amp;nbsp;&amp;nbsp;MPC5744P_flash_IncStack.ld file.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariuslucianand_1-1612359890216.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/136417i92003C38F199A8C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="mariuslucianand_1-1612359890216.png" alt="mariuslucianand_1-1612359890216.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;b. In your model,&amp;nbsp; Open the main config block. Go to "Build Toolchain", uncheck the "Default linker..." and select the newly added file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariuslucianand_2-1612360056954.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/136418i73F9BF6F3EFC16C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="mariuslucianand_2-1612360056954.png" alt="mariuslucianand_2-1612360056954.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If the added linker is not displayed there, just replace the 'MPC5744P_flash.ld' with the one attached.&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Marius&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 13:49:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBDT-Fuzzzy-Logic-Controller/m-p/1225584#M5703</guid>
      <dc:creator>mariuslucianand</dc:creator>
      <dc:date>2021-02-03T13:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: MBDT Fuzzzy Logic Controller</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBDT-Fuzzzy-Logic-Controller/m-p/1225609#M5704</link>
      <description>&lt;P&gt;Hi Marius, that's great thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appears to work great now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Crispin&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 14:20:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBDT-Fuzzzy-Logic-Controller/m-p/1225609#M5704</guid>
      <dc:creator>C_Zuercher_APR</dc:creator>
      <dc:date>2021-02-03T14:20:42Z</dc:date>
    </item>
  </channel>
</rss>

