Modelica.Electrical.Digital.Delay

Transport and inertial delay blocks

Information



Package Content

NameDescription
DelayParams Definition of delay parameters
Modelica.Electrical.Digital.Delay.TransportDelay TransportDelay Transport delay with initial parameter
Modelica.Electrical.Digital.Delay.InertialDelay InertialDelay Inertial delay with initial parameter
Modelica.Electrical.Digital.Delay.InertialDelaySensitive InertialDelaySensitive Provide the input as output if it holds its value for a specific amount of time


Modelica.Electrical.Digital.Delay.DelayParams

Definition of delay parameters

Information



Parameters

TypeNameDefaultDescription
TimetLH rise inertial delay [s]
TimetHL fall inertial delay [s]
Logicy0L.'U'initial value of output

Modelica definition

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;

Modelica.Electrical.Digital.Delay.TransportDelay Modelica.Electrical.Digital.Delay.TransportDelay

Transport delay with initial parameter

Modelica.Electrical.Digital.Delay.TransportDelay

Information


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).

Parameters

TypeNameDefaultDescription
TimedelayTime delay time [s]
Logicy0L.'U'initial value of output

Connectors

TypeNameDescription
output DigitalOutputyConnector of Digital output signal

Modelica definition

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;

Modelica.Electrical.Digital.Delay.InertialDelay Modelica.Electrical.Digital.Delay.InertialDelay

Inertial delay with initial parameter

Modelica.Electrical.Digital.Delay.InertialDelay

Information


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).

Parameters

TypeNameDefaultDescription
TimedelayTime Minimum time to hold value [s]
Logicy0L.'U'Initial value of output y

Connectors

TypeNameDescription
input DigitalInputxConnector of Digital input signal
output DigitalOutputyConnector of Digital output signal

Modelica definition

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;

Modelica.Electrical.Digital.Delay.InertialDelaySensitive Modelica.Electrical.Digital.Delay.InertialDelaySensitive

Provide the input as output if it holds its value for a specific amount of time

Modelica.Electrical.Digital.Delay.InertialDelaySensitive

Information


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).

Parameters

TypeNameDefaultDescription
TimetLH rise inertial delay [s]
TimetHL fall inertial delay [s]
Logicy0L.'U'initial value of output

Connectors

TypeNameDescription
output DigitalOutputyConnector of Digital output signal

Modelica definition

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;

HTML-documentation generated by Dymola Sun Jan 17 21:10:28 2010.