Menu

Change dynamical system

2019-08-16
2019-08-19
  • MAI VAN NGOC

    MAI VAN NGOC - 2019-08-16

    Dear Sir,

    I read an introduction about DSPACE as I attached below. I did not really understand about that. I understand that before click "Build Model" icon in Simulink, I need to add all C code file (<grampc_root>/matlab/include) into Source file, right?</grampc_root>

    Thank you very much

     

    Last edit: MAI VAN NGOC 2019-08-16
  • Felix Mesmer

    Felix Mesmer - 2019-08-16

    With regard to your first question. You have to change the file probfct.c, which contains the dynamics, cost functions, constraints and the corresponding derivatives. Please refer to section 3 of the manual.

    Regards,
    Felix

     
  • Tobias Englert

    Tobias Englert - 2019-08-16

    You are almost right about your second question. However, the files must be specified as additional build information, as it is stated in the documentation. I.e. in the fields below your red rectangle.

    Regards,
    Tobias

     
  • MAI VAN NGOC

    MAI VAN NGOC - 2019-08-16

    So, as you stated above, I captured the picture of custom code. So can you take an example for the red and blue rectangule? I mean you put the files that needed to put in each rectangule

    Best regards

    Mai Van Ngoc

     
  • MAI VAN NGOC

    MAI VAN NGOC - 2019-08-16

    So, as you stated above, I captured the picture of custom code. So can you take an example for the red and blue rectangule? I mean you put the files that needed to put in each rectangule

    Best regards

    Mai Van Ngoc

     

    Last edit: MAI VAN NGOC 2019-08-16
  • Tobias Englert

    Tobias Englert - 2019-08-16

    Hey,
    in the red rectangle you don't need to add anything. To the additional build information (the blue rectangle) you have to add <grampc_root>/matlab/include and <grampc_root>/include in the field "Include directories". In the field "Source files" (in the blue rectangle) you have to add all files in the folder <grampc_root>/src, similiar to how you added them in the red rectangle. Beside this, your problem description file (e.g. probfct.c) and the file <grampc_root>/matlab/src/grampc_run_Sfct.c must be added.</grampc_root></grampc_root></grampc_root></grampc_root>

    Best regards,
    Tobias

     
  • MAI VAN NGOC

    MAI VAN NGOC - 2019-08-19

    As you suggested, I added <grampc_root>/matlab/include and <grampc_root>/include in the field "Include directories". And in the "Source files" (in the blue rectangle) I also added all files in the folder <grampc_root>/src. In addition, I also added probfct_PMSM.c and the file <grampc_root>/matlab/src/grampc_run_Sfct.c for examle of PMSM in the source file. Finally, I selected "DSpace DS1401 Hardware Platform" for code generation compatible with DSPACE system. Did I set right?</grampc_root></grampc_root></grampc_root></grampc_root>

    Thank you very much

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.