Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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

Edited by: Balajik - Feb-08-21 07:07:02

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. 

Re: Lag or constant value in a loop till trigger

Thanks I will try that.

There are 0 guests and 0 other users also viewing this topic
You are here: