- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Lag or constant value in a loop till...
Lag or constant value in a loop till trigger
Lag or constant value in a loop till trigger
Hello All,
I am new to modelica. I have a model in which I have a first order plant model of a cooling system controlled by a PID controller. Due to very slow system response we want this PID control to be executed once in every 30 seconds. So the PID output of (SET- Error) has to remain constant for 30 seconds.
I am able to set up my model to run without this delay or sleep. However I need some help in introducing a logic for the delay. I have enclosed 2 files. first file without delay. Second one with partially completed attempt for this delay.
Can the experts please help.
Regards,
Balaji
Valve-PID.mo
Valve-PID-Delay.mo
Re: Lag or constant value in a loop till trigger
Instead of a switch you can use a TriggeredSampler. I think that might do what you want. You can trigger it every 30 seconds and it will then hold the output constant for until the next sample transition.
- dersh
- 66 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Lag or constant value in a loop till...