PropValve22PT2TableQpx

model PropValve22PT2TableQpx
    parameter Real inputMax = 10 "Input value for 100 % open"
        annotation (Dialog(group = "Control Parameters"));
    parameter Modelica.SIunits.AngularFrequency angFreq = 2 * Modelica.Constants.pi * 50 "Angular frequency"
        annotation (Dialog(group = "Control Parameters"));
    parameter Modelica.SIunits.DampingCoefficient damping = 0.7 "Damping"
        annotation (Dialog(group = "Control Parameters"));
    parameter Modelica.SIunits.TimeAging vMax = 100 "max. Velocity"
        annotation (Dialog(group = "Control Parameters"));
    parameter Modelica.SIunits.TimeAging vMin = -100 "min. Velocity"
        annotation (Dialog(group = "Control Parameters"));

    extends HydraulicsByFluidon.Components.Valves.Base.PartialValve22TableQpx;
    extends HydraulicsByFluidon.Components.Valves.Base.PartialValveControlSignal_x2;
    extends HydraulicsByFluidon.Components.Valves.Base.PartialValveProp_x2;

    Modelica.SIunits.DimensionlessRatio Stroke(start = 0) "rel. Position of valve spool";
    Modelica.SIunits.TimeAging Velocity(start = 0) "rel. Velocity of valve spool";
    Modelica.Blocks.Nonlinear.Limiter limiter(limitsAtInit = true, strict = true, uMax = 1, uMin = 0);
equation
    if enableStrokeOut then 
        valveStrokeOut = Stroke;
    end if;
    if noEvent(vMax < Velocity) then 
        der(Stroke) = vMax;
    elseif noEvent(Velocity < vMin) then 
        der(Stroke) = vMin;
    else 
        der(Stroke) = Velocity;
    end if;
    limiter.u = Input / inputMax;
    valveEdgePA.Input = Stroke;
    der(Velocity) = angFreq * (angFreq * (limiter.y - Stroke) - 2 * damping * Velocity);

    annotation (Documentation(info = "<html>\n            <p>\n                The component PropValve22PT2TableQpx is a model of a 2-way proportional valve where the \n                stroke follows the input signal with a 2nd order delay.\n            </p>\n            <p>\n                <center><img src=\"modelica://HydraulicsByFluidon/Resources/Images/Components/Valves/DirectionalValves/PropValve22PT2.png\"></center>\n            </p>\n            <p>\n                The hydraulic parameterization of the meetering edge is done by providing a look-up table of the flow rate as\n                a function of the pressure drop and the input signal. Further information regarding the formatting of the \n                look-up table can be found in the documentation of the component \n                <a href=\"modelica://HydraulicsByFluidon.Components.Resistors.ResistorTableQpx\">ResistorTableQpx</a>.\n            </p>\n            <p>\n                For a positive stroke, the flow rate is increased with increasing input signal starting from \n                0 to <var>Input value for 100 % open</var> with maximum flow corresponding to an input \n                value of <var>Input value for 100 % open</var>.\n            </p>\n            <p>\n                The valve stroke can be shifted by <var>Relative overlap general</var>. \n                In accordance with common valve parameters a negative overlap will open the valve edge.\n            </p>\n            </html>"));
end PropValve22PT2TableQpx;