Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay

Package with components related to a first-order plus time-delay model

Information

This package contains the blocks to identify the parameters of a first-order plus time-delay model.

Package Content

Name Description
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.ControlProcessModel ControlProcessModel Identify the parameters of a first-order plus time-delay (FOPTD) model of the control process
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.Validation Validation Collection of models that validate the blocks in the FirstOrderTimeDelay
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.BaseClasses BaseClasses Package with base classes

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.ControlProcessModel Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.ControlProcessModel

Identify the parameters of a first-order plus time-delay (FOPTD) model of the control process

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.ControlProcessModel

Information

This block calculates the model parameters of a FOPTD model. Specifically, it employs Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.BaseClasses.Gain and Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.BaseClasses.TimeConstantDelay to identify the gain, the time constant, and the time delay, respectively.

The calculations are disabled by default. They will be enabled once the tuning period starts, i.e., triSta becomes true. The calculations complete when the tuning period ends, i.e., triEnd becomes true.

Refer to Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.Controller for detailed explanation of the parameters yHig, yLow, and deaBan.

Parameters

TypeNameDefaultDescription
RealyHig Higher value for the output
RealyLow Lower value for the output
RealdeaBan Deadband for holding the output value

Connectors

TypeNameDescription
input RealInputtOnLength for the on period [s]
input RealInputtOffLength for the off period [s]
input RealInputtauNormalized time delay [s]
input RealInputuOutput of a relay controller
input BooleanInputtriStaRelay tuning status, true if the tuning starts
input BooleanInputtriEndRelay tuning status, true if the tuning ends
input BooleanInputinTunCheck if a tuning is ongoing
output RealOutputkGain
output RealOutputTTime constant [s]
output RealOutputLTime delay [s]
output BooleanOutputtunStaTrue when the autotuning completes successfully

Modelica definition

block ControlProcessModel "Identify the parameters of a first-order plus time-delay (FOPTD) model of the control process" parameter Real yHig(min=1E-6) "Higher value for the output"; parameter Real yLow(min=1E-6) "Lower value for the output"; parameter Real deaBan(min=1E-6) "Deadband for holding the output value"; Buildings.Controls.OBC.CDL.Interfaces.RealInput tOn( final quantity="Time", final unit="s", min=100*Buildings.Controls.OBC.CDL.Constants.eps) "Length for the on period"; Buildings.Controls.OBC.CDL.Interfaces.RealInput tOff( final quantity="Time", final unit="s", min=100*Buildings.Controls.OBC.CDL.Constants.eps) "Length for the off period"; Buildings.Controls.OBC.CDL.Interfaces.RealInput tau( final quantity="Time", final unit="s", min=100*Buildings.Controls.OBC.CDL.Constants.eps) "Normalized time delay"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Output of a relay controller"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput triSta "Relay tuning status, true if the tuning starts"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput triEnd "Relay tuning status, true if the tuning ends"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput inTun "Check if a tuning is ongoing"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput k "Gain"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput T( final quantity="Time", final unit="s", min=100*Buildings.Controls.OBC.CDL.Constants.eps) "Time constant"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput L( final quantity="Time", final unit="s", min=100*Buildings.Controls.OBC.CDL.Constants.eps) "Time delay"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput tunSta "True when the autotuning completes successfully"; protected Buildings.Controls.OBC.CDL.Reals.AddParameter addPar( final p=1) "Block that calculates the difference between 1 and the normalized time delay"; Buildings.Controls.OBC.CDL.Reals.Divide div "The output of samtau divided by that of addPar"; Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.BaseClasses.Gain gain(final yHig=yHig, final yLow=yLow) "Block that calculates the gain"; Buildings.Controls.OBC.Utilities.PIDWithAutotuning.SystemIdentification.FirstOrderTimeDelay.BaseClasses.TimeConstantDelay timConDel( final yHig=yHig, final yLow=yLow, final deaBan=deaBan) "Block that calculate the time constant and the time delay"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samK( final y_start=1) "Block that samples the gain when the tuning period ends"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samL( final y_start=1) "Block that samples the time delay when the tuning period ends"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samtOn( final y_start=1) "Block that samples the length of the on period when the tuning period ends"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samT( final y_start=1) "Block that samples the time constant when the tuning period ends"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samTau( final y_start=0.5) "Block that samples the normalized time delay when the tuning period ends"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai( final k=-1) "Product of the normalized time delay and -1"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Check if an error occurs during the autotuning process"; Buildings.Controls.OBC.CDL.Logical.And and2 "Check if the autotuning completes successfully"; Buildings.Controls.OBC.CDL.Utilities.Assert assTunFai(final message= "Autotuning failed. The controller gains are unchanged.") "Warning message when an autotuning fails"; CDL.Logical.Nand nand1 "Check if an errors occured during tuning"; equation connect(gain.u, u); connect(gain.tOn, tOn); connect(gain.tOff, tOff); connect(gain.triSta, triSta); connect(timConDel.T, samT.u); connect(samT.y, T); connect(samT.trigger, triEnd); connect(L, samL.y); connect(samL.u, timConDel.L); connect(samL.trigger, triEnd); connect(samK.y, timConDel.k); connect(samK.trigger, triEnd); connect(samK.y, k); connect(timConDel.tOn, samtOn.y); connect(samtOn.u, tOn); connect(samtOn.trigger, triEnd); connect(gai.y, addPar.u); connect(tau,samTau. u); connect(samTau.y, gai.u); connect(samTau.y, div.u1); connect(triEnd,samTau. trigger); connect(addPar.y, div.u2); connect(div.y, timConDel.rat); connect(and2.u1, not1.y); connect(and2.y, tunSta); connect(and2.u2, triEnd); connect(timConDel.triFai, not1.u); connect(gain.k,samK. u); connect(nand1.u1, inTun); connect(nand1.u2, timConDel.triFai); connect(nand1.y, assTunFai.u); end ControlProcessModel;