ModelicaStandardLibrary
ModelicaStandardLibrary copied to clipboard
Undesired minimum gain of LimPID
Modelica.Blocks.Continuous.LimPID has min=0 for the controller gain k. I wonder if that is a good idea and indeed intentional.
I stumbled upon this on a controller developed by DLR, which was more or less a copy and paste of the MSL LimPID, but it had a negative gain. Switching to the MSL LimPID now caused some strange error, because in the generated code we used the min as a means to saturate parameter changes when recalibratingm causing division by 0 (negative gain saturated to 0).
My issue is, that this default constraint is very questionable:
- It is not documented in
LimPID. - I am not sure this is a good idea. Why do we restrict negative gains in a general component library?
- 0 gain is the really unwanted case but we can not easily express it in Modelica (everything except 0, i.e.,
]0[) - At the moment
k=0is valid, although it will causegainTrack.kto fail due togainTrack.k=1(k*Ni). So thek(min=0)is misleading in indictaing 0 would be a valid setting (although it is not).
Minor note: This is the bug report related to the issues detected by https://github.com/modelica/efmi-testcases/pull/12
@AHaumer, @MartinOtter: Can you have a look into this?
Yes, you are right "min=0" should be removed for k.
@christoff-buerger, could you please edit the initial comment above to include the missing / in the expression gainTrack.k=1(k*Ni)?
@christoff-buerger, could you please edit the initial comment above to include the missing
/in the expressiongainTrack.k=1(k*Ni)?
@henrikt-ma Done