C Code block DLL error while running MPC algorithim

Abdelrahman Ali
Abdelrahman Ali Altair Community Member
edited May 28 in Community Q&A

Hello, I am getting a DLL error while running model predictive control algorithim on a buck converter, will post a screenshot to the code here, thanks.

 

image

Tagged:

Answers

  • AltairLiz
    AltairLiz
    Altair Employee
    edited November 2023

    What Altair product are you using?  I can direct your question to the correct forum if you provide this information.

  • Albert_Dunford
    Albert_Dunford
    Altair Employee
    edited December 2023

    What Altair product are you using?  I can direct your question to the correct forum if you provide this information.

    this is PSIM

  • Albert_Dunford
    Albert_Dunford
    Altair Employee
    edited December 2023

    Hi Ali it is warning you that you have implemented digital control but you do not have the digital delay impact modelled you need a 1/z for the full digitization of your control. a ZOH does not introduce delay. Please see this tutorial video: 

  • Mohamed lamine Touré
    Mohamed lamine Touré Altair Community Member
    edited May 28

    Hello,
    Hi, I'm getting a DLL error when running model predictive control algorithms on a Boost converter. Can anyone help me? Here's my code image. image

  • Albert_Dunford
    Albert_Dunford
    Altair Employee
    edited May 28

    Hello,
    Hi, I'm getting a DLL error when running model predictive control algorithms on a Boost converter. Can anyone help me? Here's my code image. image

    this does not look like valid c code if you have not declared your variable data types.

    double iL = 0;

    double Vin = 0;

    double iL_ref = 0;

    int, float, etc. must be used to declare variables in c. you must declare them before you use them. you could also declare these as global variables outside of this function.

    the code in this function is re-intialized each time step i see a counter in your code if you want to store a value you must declare a static variable

    "static int count" will be a counter that actually counts

    here is a tutorial video for reference

    https://youtu.be/HreH4Cx-a94?si=GwHjAJh6phkvpeXz