Menu

How to add more inputs in Simulink Sfunction

Zejiang
2019-05-02
2019-11-15
  • Zejiang

    Zejiang - 2019-05-02

    Hello everyone,
    Could you please kindly let me know how to make more inputs appear in the Simulink Sfunction? We have four (t0, xk, xdes, udes), but I need to update my userparams in the Simulink. So, I need to have more SFunction inputs to realize my ODE formualtion, cost formulation, constraint specification, etc. I do change the grampc_runSfuc.c with more inputs as suggested, but after I recompile, no thing happened. The MPC_Subsystem block still only has four inputs.
    THANKS !

     
  • Zejiang

    Zejiang - 2019-05-03

    Hello everyonw,
    This problem is also solved.
    I guess we do not need to be 'constrained' by the Simulink template. In stead, we can use a new C-MEX Sfunc. After compile, initilization, and Run, all the port pins will appear.
    I need to say: GRAMPC is really fast......

    Thanks.

     
  • Andreas Völz

    Andreas Völz - 2019-11-15

    Hello Zejiang,

    for your information, the userparam vector has been added as additional input to the S-function in version 2.2 of GRAMPC. Thus, it should no longer be necessary to modify grampc_run_Sfct.c for your usecase.

    Regards,
    Andreas

     

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.