Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation

Collection of validation models

Information

This package contains models that validate the blocks in Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.

Package Content

Name Description
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.HalfPeriodRatio HalfPeriodRatio Test model for calculating the half period ratio
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.NormalizedTimeDelay NormalizedTimeDelay Test model for calculating the normalized time delay
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.OnOffPeriod OnOffPeriod Test model for calculating the length of the on period and the off period
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.SamplerWithResetThreshold SamplerWithResetThreshold Test model for a sampler with a reset and a threshold
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.TuningMonitor TuningMonitor Test model for the tuning period management

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.HalfPeriodRatio Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.HalfPeriodRatio

Test model for calculating the half period ratio

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.HalfPeriodRatio

Information

Validation test for the block Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.HalfPeriodRatio.

This testing scenario in this example is the same as that in Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.TunMonitor. The lengths of the on period and the off period are sampled at 0.9s to calculate the half period ratio.

Modelica definition

model HalfPeriodRatio "Test model for calculating the half period ratio" Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.HalfPeriodRatio halPerRat "Calculate the half period ratio"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse tOnSig1( amplitude=-0.1, width=0.1, period=1, offset=0.1) "Block that generates signals for forming the signal of the length of On period"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse tOnSig2( amplitude=-0.1, width=0.9, period=1, offset=0.1) "Block that generates signals for forming the signal of the length of On period"; Buildings.Controls.OBC.CDL.Reals.Add tOn "The length of the on period"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse tOff( amplitude=-0.5, width=0.7, period=1, offset=0.5) "The length of the off period"; Buildings.Controls.OBC.CDL.Logical.Sources.SampleTrigger samTri(period=1, shift=0.9) "Stop signal for tuning"; equation connect(tOff.y, halPerRat.tOff); connect(tOnSig2.y, tOn.u1); connect(tOnSig1.y, tOn.u2); connect(tOn.y, halPerRat.tOn); connect(samTri.y, halPerRat.TunEnd); end HalfPeriodRatio;

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.NormalizedTimeDelay Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.NormalizedTimeDelay

Test model for calculating the normalized time delay

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.NormalizedTimeDelay

Information

Validation test for the block Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.NormalizedTimeDelay.

The input rho is a step signal that changes from 2 to 1 at 0.7s.

Modelica definition

model NormalizedTimeDelay "Test model for calculating the normalized time delay" Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.NormalizedTimeDelay norTimDel(gamma=3) "Calculate the normalized time delay"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse rho( amplitude=1, width=0.7, period=1, offset=1) "Half period ratio"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con( k=true) "Tuning signal"; equation connect(rho.y, norTimDel.rho); connect(con.y, norTimDel.inTun); end NormalizedTimeDelay;

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.OnOffPeriod Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.OnOffPeriod

Test model for calculating the length of the on period and the off period

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.OnOffPeriod

Information

Validation test for the block Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.OnOffPeriod.

This example considers a relay switch output from a relay controller, relSwi.

Modelica definition

model OnOffPeriod "Test model for calculating the length of the on period and the off period" Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.OnOffPeriod onOffPer "Calculate the length of the on period and the off period"; Buildings.Controls.OBC.CDL.Reals.Sources.CivilTime modTim "Simulation time"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse relSwi( width=0.2, period=0.8, shift=-0.1) "Control switch output"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse retSig( width=0.1, period=1, shift=-0.1) "Reset signal"; equation connect(modTim.y, onOffPer.tim); connect(relSwi.y, onOffPer.on); connect(onOffPer.trigger, retSig.y); end OnOffPeriod;

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.SamplerWithResetThreshold Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.SamplerWithResetThreshold

Test model for a sampler with a reset and a threshold

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.SamplerWithResetThreshold

Information

Validation test for the block Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.SamplerWithResetThreshold.

This example considers a real input, u, and a boolean input, resSig

Modelica definition

model SamplerWithResetThreshold "Test model for a sampler with a reset and a threshold" Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.SamplerWithResetThreshold sam(lowLim=0, y_reset=0) "Sampler"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse resSig( width=0.1, period=1, shift=-0.1) "Reset signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse u( amplitude=1, width=0.7, period=0.5, offset=-0.5) "Singal to be sampled"; equation connect(u.y, sam.u); connect(resSig.y, sam.trigger); end SamplerWithResetThreshold;

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.TuningMonitor Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.TuningMonitor

Test model for the tuning period management

Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.Validation.TuningMonitor

Information

Validation test for the block Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.TuningMonitor.

Modelica definition

model TuningMonitor "Test model for the tuning period management" Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses.TuningMonitor tunMan "Manage the tuning process"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse tOnSig1( amplitude=-0.1, width=0.1, period=1, offset=0.1) "Block that generates signals for forming the signal of the length of On period"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse tOnSig2( amplitude=-0.1, width=0.9, period=1, offset=0.1) "Block that generates signals for forming the signal of the length of On period"; Buildings.Controls.OBC.CDL.Reals.Add tOn "The length of the on period"; Buildings.Controls.OBC.CDL.Reals.Sources.Pulse tOff( amplitude=-0.5, width=0.7, period=1, offset=0.5) "The length of the off period"; Buildings.Controls.OBC.CDL.Logical.Latch tunSta "Display when tuning process starts"; Buildings.Controls.OBC.CDL.Logical.Latch tunEnd "Display when tuning process ends"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con(k=false) "False signal"; equation connect(tOnSig2.y, tOn.u1); connect(tOnSig1.y, tOn.u2); connect(tunMan.tOn, tOn.y); connect(tunMan.tOff, tOff.y); connect(con.y, tunSta.clr); connect(tunEnd.clr, con.y); connect(tunMan.triSta, tunSta.u); connect(tunMan.triEnd, tunEnd.u); end TuningMonitor;