Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LimPID with integrator reset #494

Closed
PMehrfeld opened this issue Jul 18, 2016 · 3 comments · Fixed by #532
Closed

LimPID with integrator reset #494

PMehrfeld opened this issue Jul 18, 2016 · 3 comments · Fixed by #532

Comments

@PMehrfeld
Copy link
Contributor

I want to enhance Annex60.Controls.Continuous.LimPID. When a boolean input becomes true, the integrator should be reset.
The problem is easy to solve as long as you are not in pedantic mode.
But to satisfy pedantic criteria I can only see the solution to copy the whole source code of Modelica.Blocks.Continuous.LimPID instead of extending it. Because then the integrator can be replaced by an own integrator model including a boolean input to reset/reinit() the output y.

I will show the two possibilities in a new fork.

@PMehrfeld
Copy link
Contributor Author

It would be nice to get some feedback about the two options you can see in my fork: issue494_resetIntPID

So, what do you think is the best?
Option a) Leave LimPID as extension from standard library, but check in pedantic mode leads to erros.
Option b) Duplicate LimPID form standard library and create own integrator.
Option c) Neither a) nor b) and let everyone model this by himself/herself if someone need a reset of the integrator.
Option d) A better modelling approach than a) that will also meet the requirements of pedantic mode.

It would be nice to receive some feedback.

@Mathadon
Copy link
Member

Hi!
I did not check all of your code but I think b) would be best as long as the additional inputs / complexity can be disabled by default such that the default implementation stays the same.

The question arises however if we should do

reinit(y,y_inint)

or

reinit(y, something else)

c) is an option as well since we do not want to overload the user with complex options. Good documentation should however be sufficient to deal with this.

@PMehrfeld
Copy link
Contributor Author

Thanks a lot for your recommendations!

I now decided to choose Option b) and use the edge() function. Also you can choose the value to reinit with.
I hope the documentation is detailled enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants