フィルターのクリア

FMU generation with closed loop control

6 ビュー (過去 30 日間)
Marco Minneci
Marco Minneci 2024 年 2 月 15 日
コメント済み: Julian 2024 年 4 月 8 日
Hi everybody, I have a problem regarding the generation of an FMU code from Simulink with a closed loop control. Particularly, I need the closed loop since I have placed a PID controller in the model. When I try to export this model as a Standalone FMU, Simulink gives me a specific error: "Algebraic loops are not supported in generated code". I have tried to solve this error in different ways. Firstly I removed just the feedback in the Simulink model but when I tested the generated FMU again in Simulink, the previous error appeared again. So I decided to put a memory block in the feedback and in this way it works, but the output results are completely different and of course this is not acceptable. Does anyone have a different option for solving this issue?
Thank you every one.
  3 件のコメント
Marco Minneci
Marco Minneci 2024 年 2 月 16 日

I cannot post the true model for copyright issues. Here you have something very similar

Julian
Julian 2024 年 4 月 8 日
Are the PID Controller and Mass-Spring-Damper Blocks virtual or nonvirtual subsystems? You can see this by selecting the block and open Subsystem Block in the tool-bar. There is an option called: Make Atomic. If selected the block is handled like direct feedthrough even though the referenced model is not. This may cause the algebraic loop error when exporting as FMU.

サインインしてコメントする。

回答 (1 件)

Satwik
Satwik 2024 年 2 月 26 日
In Simulink algebraic loops occur when there is a loop present in the block diagram that does not contain any dynamics, that is, it does not have any delay or integration to break the loop. This causes issues during simulation and code generation because Simulink needs to solve a set of simultaneous equations, which it might not be able to do analytically.
To avoid this issue and export the model as a standalone FMU successfully, you can introduce a “delay” block in the feedback path. This will break the algebraic loop and introduce dynamics that can be handled by the solver. Choose a small delay time that does not significantly affect the expected performance of the model.

カテゴリ

Help Center および File ExchangeContinuous についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by