This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Fuzzy Inference System in Embedded Coder

Other Parts Discussed in Thread: TMS320F28335

Hello,
I have a simulink model containing fuzzy logic toolbox or fuzzy inference system (FIS). I want to generate code based on my simulink. My processor is TMS320F28335 and I work with CCS 5.5. I wrote following line in model properties and in InitFcn section
PMSM_Fuzzy_rules_mamdani_2=readfis('PMSM_Fuzzy_rules_mamdani_2.fis')
in which, PMSM_Fuzzy_rules_mamdani_2 is the name of my FIS.
I compile the model and I do not receive any error and simulink build successfully; however, my model does not work, even in the situation that FIS is in model but it does not actually affect in the control section. I really appreciate if someone has encountered such problem or has idea about using FIS in DSP.
Thank you
  • Hello,
    Your issue does not sounds specific to CCS/tools hence you will likely get better suggestions from the experts in the C2000 forums. I will move this thread there. You may also want to contact Mathworks as they can provide the best support for Simulink.

    Thanks
    ki
  • I need fuzzy logic in C2000, thanks
  • Hi,

    This is a tricky question, and I don't have any expertise with Fuzzy Logic - so here is what I was able to learn:

    1) The workflow is feasible - in other words you can use code generation with the Fuzzy Logic Toolbox on an MCU.

    2) However there are limitations when working with F28335. The code generated for the FIS block uses dynamic memory allocation and requires ~22kB of dynamic memory. The F28335 only has 34 kB of SARAM, which isn't enough for the FIS and the model to run. 

    3) There may be an advanced maneuver to use an ezDSP board which has external memory to get this to run. You can use the external memory for heap, which can then handle the FIS code while freeing up the other memory for the model to run.

    4) There may be a workaround requiring low level knowledge of the FLC block that can force the FIS to avoid using dynamic memory but I don't have the expertise to provide guidance on this.

    If you need more assistance beyond the above, you will need to contact MathWorks Technical Support

    Cheers,

    -Brian

    P.S: I was also told that in an upcoming release, the FIS block will no longer use dynamic memory, so this situation may improve.