This package demonstrates how to replace a traditional PI controller with Recurrent Neural Networks (RNNs) within a Modelica simulation.
Two types of neural networks are integrated as surrogates for the PI controller:
Both networks are provided in TensorFlow Lite and ONNX formats and are incorporated into Modelica via SMArtInt interface blocks.
To validate the neural controllers, a step test applies a constant control deviation after 10 seconds. This allows observation of the proportional and integral actions compared to the traditional PI controller.
Additionally, a more complex scenario models a two-room
temperature regulation system. Here, the PI controller adjusts
heating based on an external temperature profile provided through a
CombiTable. A physical reference model is included to
compare against the neural network controllers.
For the step test where a constant control deviation is applied, monitor the following variables:
controller.u): The step
input applied after 10 seconds.controller.y): Output
signal of the PI controller and the neural network surrogates.For the two-room temperature regulation scenario, important variables to observe include:
controller.u): Difference
between temperature setpoint and measured temperature (controller
error).controller.y): Output
signal of the PI controller and the neural network surrogates.temperature.T):
Temperature in each room controlled by the PI or neural network
controller.combiTimeTable.y[1]): Table output defining the
setpoint for the room temperature. (Useful to plot alongside the
actual room temperature.)| Name | Description |
|---|---|
| Tensor Flow Lite Tester | |
| ONNX Tester |