Free (standard conforming) library to precisely define and synchronize sampled data systems with different sampling rates. It provides convenient to use blocks to utilize the new synchronous language elements introduced in Modelica 3.3.
If you compare the output of Modelica_Synchronous.RealSignals.Periodic.PI on a clocked signal with the output from the continous PI from MSL on the continous signal, it differs a lot.
I suggest to add interval() as a factor:
x = previous(x) + u / Td * interval();
as this is the delta(time) from applying the difference quotient.
Please try the attached model:
testPIController.zip
All controllers under "RealSignals.NonPeriodic" have a parameterization of a continuous-time controller, that is discretized. In these cases, the sample period (= interval()) is explicitly utilized in the controller.
All controllers under "RealSignals.Periodic" are discrete-time controllers that are parameterized for a particular sample period. For example, Periodic.StateSpace is defined as x = Aprevious(x) + Bu, and this means that A,B (and C,D) have been designed for a particular sample period. Currently, in none of the controllers under Periodic, "interval" is used, because this "interval" is fixed and is implicitley included in the discrete parameters. The PI controller would be suddenly an exception.
If someone would like to utilize a PI controller with a continuous-time parameterization and sample period, then he/she can already use NonPeriodic.PI
If you compare the output of Modelica_Synchronous.RealSignals.Periodic.PI on a clocked signal with the output from the continous PI from MSL on the continous signal, it differs a lot.
I suggest to add
interval()
as a factor:x = previous(x) + u / Td * interval();
as this is the delta(time) from applying the difference quotient. Please try the attached model: testPIController.zip