External trigger to s-function

Hello,

I have a Simulink model with acados integrated as an s-function. Suppose that my acados solver has a sampling time of 1 second, but I only want to trigger the s-function once every 10 seconds (ideally the trigger event is variable and inferred from Simulink) and apply the controls in an open loop fashion until the solver is triggered again. Is there an option for this or to specify some kind of external trigger when creating the solver?

Regards,
Jorn

Hi Jorn,

I’m not aware of such functionality in acados, but I think this might be useful:

Hope it helps,
Josip

Hi Josip,

Thank you for the answer. Indeed I’m currently using a triggered subsystem as you suggested. However, I would like to have the sampling time of the subsystem to be faster than the time step of acados, and as far as I am aware, the triggered subsystem does not allow for that.

Regards,
Jorn

Hi Jorn,

I understand, perhaps the rate transition block would help:

Unfortunately I don’t know if it works within a triggered subsystem as you would like, but I have otherwise found it useful.

Kind regards,
Josip

Hi Josip,

As this now becomes more of a Simulink issue rather than an acados issue, I will mark it as solved.

Thank you for your help.

Regards,
Jorn

1 Like