Name | Description |
---|---|
DelayParams | Definition of delay parameters |
TransportDelay | Transport delay with initial parameter |
InertialDelay | Inertial delay with initial parameter |
InertialDelaySensitive | Provide the input as output if it holds its value for a specific amount of time |
Type | Name | Default | Description |
---|---|---|---|
Time | tLH | rise inertial delay [s] | |
Time | tHL | fall inertial delay [s] | |
Logic | y0 | L.'U' | initial value of output |
partial block DelayParams "Definition of delay parameters" import L = Modelica.Electrical.Digital.Interfaces.Logic; parameter Modelica.SIunits.Time tLH(start=0) "rise inertial delay"; parameter Modelica.SIunits.Time tHL(start=0) "fall inertial delay"; parameter Digital.Interfaces.Logic y0=L.'U' "initial value of output";end DelayParams;
Provide the input as output exactly delayed by delayTime. If time less than delayTime the initial value y0 holds.
Extends from D.Interfaces.SISO (Single input, single output).
Type | Name | Default | Description |
---|---|---|---|
Time | delayTime | delay time [s] | |
Logic | y0 | L.'U' | initial value of output |
Type | Name | Description |
---|---|---|
output DigitalOutput | y | Connector of Digital output signal |
model TransportDelay "Transport delay with initial parameter" import D = Modelica.Electrical.Digital; import L = Modelica.Electrical.Digital.Interfaces.Logic; extends D.Interfaces.SISO(x(start=L.'U',fixed=true)); parameter Modelica.SIunits.Time delayTime(start=0) "delay time"; parameter D.Interfaces.Logic y0=L.'U' "initial value of output"; protected D.Interfaces.Logic x_delayed; equation x_delayed = integer(delay(x, delayTime)); y = if delayTime > 0 then (if time >= delayTime then x_delayed else y0) else pre(x);end TransportDelay;
Provides the input as output delayed by Tdel if the input holds its value for a longer time than Tdel. If time is less than Tdel the initial value initout holds.
Extends from D.Interfaces.SISO (Single input, single output).
Type | Name | Default | Description |
---|---|---|---|
Time | delayTime | Minimum time to hold value [s] | |
Logic | y0 | L.'U' | Initial value of output y |
Type | Name | Description |
---|---|---|
input DigitalInput | x | Connector of Digital input signal |
output DigitalOutput | y | Connector of Digital output signal |
block InertialDelay "Inertial delay with initial parameter" import D = Modelica.Electrical.Digital; import L = Modelica.Electrical.Digital.Interfaces.Logic; extends D.Interfaces.SISO; parameter Modelica.SIunits.Time delayTime(start=0) "Minimum time to hold value"; parameter D.Interfaces.Logic y0=L.'U' "Initial value of output y"; protected D.Interfaces.Logic y_auxiliary(start=y0, fixed=true); D.Interfaces.Logic x_old(start=y0, fixed=true); discrete Modelica.SIunits.Time t_next(start=delayTime, fixed=true); algorithm when delayTime > 0 and change(x) then x_old := x; t_next := time + delayTime; elsewhen time >= t_next then y_auxiliary := x; end when; y := if delayTime > 0 then y_auxiliary else x;end InertialDelay;
Provides the input as output delayed by Tdel if the input holds its value for a longer time than Tdel.
If the time is less than Tdel the initial value initout holds.
The delay Tdel depends on the values of the signal change. To calculate Tdel, the delaymap specified in
Digital.Tables is used. If the corresponding value is 1, then tLH is used, if it is -1, then tHL
is used, if it is zero, the input is not delayed.
Extends from D.Interfaces.SISO (Single input, single output).
Type | Name | Default | Description |
---|---|---|---|
Time | tLH | rise inertial delay [s] | |
Time | tHL | fall inertial delay [s] | |
Logic | y0 | L.'U' | initial value of output |
Type | Name | Description |
---|---|---|
output DigitalOutput | y | Connector of Digital output signal |
model InertialDelaySensitive "Provide the input as output if it holds its value for a specific amount of time" import D = Modelica.Electrical.Digital; import L = Modelica.Electrical.Digital.Interfaces.Logic; extends D.Interfaces.SISO(x(start=L.'U',fixed=true)); parameter Modelica.SIunits.Time tLH(start=0) "rise inertial delay"; parameter Modelica.SIunits.Time tHL(start=0) "fall inertial delay"; parameter D.Interfaces.Logic y0=L.'U' "initial value of output"; protected Integer delayTable[:,:]=D.Tables.DelayTable "specification of delay according to signal change"; Modelica.SIunits.Time delayTime; D.Interfaces.Logic y_auxiliary(start=y0, fixed=true); D.Interfaces.Logic x_old(start=y0, fixed=true); Integer lh; discrete Modelica.SIunits.Time t_next; algorithm when {initial(),(tLH > 0 or tHL > 0) and change(x) and not initial()} then x_old := if initial() or pre(x) == 0 then y0 else pre(x); lh := delayTable[x_old, x]; delayTime := if (lh > 0) then tLH else (if (lh < 0) then tHL else 0); t_next := time + delayTime; if (lh == 0 or abs(delayTime) < Modelica.Constants.small) then y_auxiliary := x; end if; elsewhen time >= t_next then y_auxiliary := x; end when; y := if ((tLH > 0 or tHL > 0)) then y_auxiliary else x;end InertialDelaySensitive;