ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Undesired minimum gain of LimPID

Open christoff-buerger opened this issue 4 years ago • 2 comments

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:

  1. It is not documented in LimPID.
  2. I am not sure this is a good idea. Why do we restrict negative gains in a general component library?
  3. 0 gain is the really unwanted case but we can not easily express it in Modelica (everything except 0, i.e., ]0[)
  4. At the moment k=0 is valid, although it will cause gainTrack.k to fail due to gainTrack.k=1(k*Ni). So the k(min=0) is misleading in indictaing 0 would be a valid setting (although it is not).

christoff-buerger avatar Sep 13 '21 09:09 christoff-buerger

Minor note: This is the bug report related to the issues detected by https://github.com/modelica/efmi-testcases/pull/12

christoff-buerger avatar Sep 13 '21 09:09 christoff-buerger

@AHaumer, @MartinOtter: Can you have a look into this?

christoff-buerger avatar Nov 30 '21 14:11 christoff-buerger

Yes, you are right "min=0" should be removed for k.

MartinOtter avatar Mar 29 '23 08:03 MartinOtter

@christoff-buerger, could you please edit the initial comment above to include the missing / in the expression gainTrack.k=1(k*Ni)?

henrikt-ma avatar Apr 28 '23 06:04 henrikt-ma

@christoff-buerger, could you please edit the initial comment above to include the missing / in the expression gainTrack.k=1(k*Ni)?

@henrikt-ma Done

christoff-buerger avatar May 02 '23 07:05 christoff-buerger