Working and exportable PID controller

This commit is contained in:
2026-03-11 16:37:50 +01:00
parent 71722127f1
commit 9e124a5e92
4 changed files with 350 additions and 78 deletions

View File

@@ -1,14 +1,17 @@
true
true
"Check of EmbeddedControl.Math.DDifference completed successfully.
Class EmbeddedControl.Math.DDifference has 4 equation(s) and 4 variable(s).
1 of these are trivial equation(s)."
true
true
true
"Check of test.Controller completed successfully.
Class test.Controller has 32 equation(s) and 32 variable(s).
16 of these are trivial equation(s)."
Notification: Automatically loaded package Modelica 4.1.0 due to uses annotation from EmbeddedControl.
Notification: Automatically loaded package Complex 4.1.0 due to uses annotation from Modelica.
Notification: Automatically loaded package ModelicaServices 4.1.0 due to uses annotation from Modelica.
true
translateModel(test2d.Dcontroller) = true
translateModel() = true

View File

@@ -1,11 +1,14 @@
setCommandLineOptions("--simCodeTarget=ExperimentalEmbeddedC");
setCommandLineOptions("--target=gcc");
setCommandLineOptions("-d=initialization");
loadFile("/work/EmbeddedControl.mo");
loadFile("/work/test.mo");
okCheck := checkModel(EmbeddedControl.Math.DDifference);
print("checkModel(EmbeddedControl.Math.DDifference) = " + String(okCheck) + "\n");
okCheck := checkModel(test.Controller);
print("checkModel() = " + String(okCheck) + "\n");
print(getErrorString());
okTranslate := translateModel(EmbeddedControl.Math.DDifference, fileNamePrefix="difference");
print("translateModel(test2d.Dcontroller) = " + String(okTranslate) + "\n");
okTranslate := translateModel(test.Controller, fileNamePrefix="controller");
print("translateModel() = " + String(okTranslate) + "\n");
print(getErrorString());