Skip to content
LIBRARY
PlanarMechanics.examples.excavator.ProportionalValve.md

PlanarMechanics.examples.excavator.ProportionalValve

Proportional 4/3 directional valve metering flow between a supply, a tank, and the two chambers of a hydraulic cylinder.

The spool command u is expected in the range [-1, 1]. A positive command opens the paths supply -> port_a and port_b -> tank (extending a cylinder whose cap side is connected to port_a); a negative command opens supply -> port_b and port_a -> tank. Each metering path follows a turbulent orifice law with a regularized square root so the flow is smooth through zero pressure drop and admits reverse flow. All four ports share the same medium and the four port mass flows sum to zero by construction. Leakage between ports is not modeled.

Usage

MultibodyComponents.PlanarMechanics.examples.excavator.ProportionalValve(Kv=5e-7, dp_small=1e5)

Parameters:

NameDescriptionUnitsDefault value
KvValve coefficient: volumetric flow per unit command and square root of pressure drop5e-7
dp_smallPressure-drop regularization of the orifice law1e5

Connectors

  • port_p - (Port)

  • port_t - (Port)

  • port_a - (Port)

  • port_b - (Port)

  • u - This connector represents a real signal as an input to a component (RealInput)

Variables

NameDescriptionUnits
upPositive part of the spool command
unNegative part of the spool command
rhoFluid density at the supply port
q_paVolumetric flow supply -> port_a
q_btVolumetric flow port_b -> tank
q_pbVolumetric flow supply -> port_b
q_atVolumetric flow port_a -> tank

Behavior

Behavior of this component cannot be rendered because it includes path variables.

Source

dyad
"""
Proportional 4/3 directional valve metering flow between a supply, a tank, and
the two chambers of a hydraulic cylinder.

The spool command `u` is expected in the range [-1, 1]. A positive command
opens the paths supply -> port_a and port_b -> tank (extending a cylinder whose
cap side is connected to port_a); a negative command opens supply -> port_b and
port_a -> tank. Each metering path follows a turbulent orifice law with a
regularized square root so the flow is smooth through zero pressure drop and
admits reverse flow. All four ports share the same medium and the four port
mass flows sum to zero by construction. Leakage between ports is not modeled.
"""
component ProportionalValve
  "Supply (pump) port"
  port_p = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 200, "y1": 950, "x2": 300, "y2": 1050, "rot": 0}
      },
      "tags": []
    }
  }
  "Tank (return) port"
  port_t = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 700, "y1": 950, "x2": 800, "y2": 1050, "rot": 0}
      },
      "tags": []
    }
  }
  "Cylinder cap-side port"
  port_a = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 200, "y1": -50, "x2": 300, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  "Cylinder rod-side port"
  port_b = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 700, "y1": -50, "x2": 800, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  "Spool command in [-1, 1]"
  u = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Valve coefficient: volumetric flow per unit command and square root of pressure drop"
  parameter Kv::Real = 5e-7
  "Pressure-drop regularization of the orifice law"
  parameter dp_small::Real = 1e5
  "Positive part of the spool command"
  variable up::Real
  "Negative part of the spool command"
  variable un::Real
  "Fluid density at the supply port"
  variable rho::Real
  "Volumetric flow supply -> port_a"
  variable q_pa::Real
  "Volumetric flow port_b -> tank"
  variable q_bt::Real
  "Volumetric flow supply -> port_b"
  variable q_pb::Real
  "Volumetric flow port_a -> tank"
  variable q_at::Real
relations
  continuity(port_p.medium, port_t.medium, port_a.medium, port_b.medium)
  up = max(u, 0)
  un = max(-u, 0)
  rho = HydraulicComponents.density(port_p.medium, port_p.p)
  q_pa = Kv * up * (port_p.p - port_a.p) / sqrt(sqrt((port_p.p - port_a.p) ^ 2 + dp_small ^ 2))
  q_bt = Kv * up * (port_b.p - port_t.p) / sqrt(sqrt((port_b.p - port_t.p) ^ 2 + dp_small ^ 2))
  q_pb = Kv * un * (port_p.p - port_b.p) / sqrt(sqrt((port_p.p - port_b.p) ^ 2 + dp_small ^ 2))
  q_at = Kv * un * (port_a.p - port_t.p) / sqrt(sqrt((port_a.p - port_t.p) ^ 2 + dp_small ^ 2))
  port_p.m_flow = rho * (q_pa + q_pb)
  port_t.m_flow = -rho * (q_bt + q_at)
  port_a.m_flow = rho * (q_at - q_pa)
  port_b.m_flow = rho * (q_bt - q_pb)
metadata {
  "Dyad": {"icons": {"default": "dyad://MultibodyComponents/ProportionalValve.svg"}}
}
end
Flattened Source
dyad
"""
Proportional 4/3 directional valve metering flow between a supply, a tank, and
the two chambers of a hydraulic cylinder.

The spool command `u` is expected in the range [-1, 1]. A positive command
opens the paths supply -> port_a and port_b -> tank (extending a cylinder whose
cap side is connected to port_a); a negative command opens supply -> port_b and
port_a -> tank. Each metering path follows a turbulent orifice law with a
regularized square root so the flow is smooth through zero pressure drop and
admits reverse flow. All four ports share the same medium and the four port
mass flows sum to zero by construction. Leakage between ports is not modeled.
"""
component ProportionalValve
  "Supply (pump) port"
  port_p = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 200, "y1": 950, "x2": 300, "y2": 1050, "rot": 0}
      },
      "tags": []
    }
  }
  "Tank (return) port"
  port_t = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 700, "y1": 950, "x2": 800, "y2": 1050, "rot": 0}
      },
      "tags": []
    }
  }
  "Cylinder cap-side port"
  port_a = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 200, "y1": -50, "x2": 300, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  "Cylinder rod-side port"
  port_b = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 700, "y1": -50, "x2": 800, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  "Spool command in [-1, 1]"
  u = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Valve coefficient: volumetric flow per unit command and square root of pressure drop"
  parameter Kv::Real = 5e-7
  "Pressure-drop regularization of the orifice law"
  parameter dp_small::Real = 1e5
  "Positive part of the spool command"
  variable up::Real
  "Negative part of the spool command"
  variable un::Real
  "Fluid density at the supply port"
  variable rho::Real
  "Volumetric flow supply -> port_a"
  variable q_pa::Real
  "Volumetric flow port_b -> tank"
  variable q_bt::Real
  "Volumetric flow supply -> port_b"
  variable q_pb::Real
  "Volumetric flow port_a -> tank"
  variable q_at::Real
relations
  continuity(port_p.medium, port_t.medium, port_a.medium, port_b.medium)
  up = max(u, 0)
  un = max(-u, 0)
  rho = HydraulicComponents.density(port_p.medium, port_p.p)
  q_pa = Kv * up * (port_p.p - port_a.p) / sqrt(sqrt((port_p.p - port_a.p) ^ 2 + dp_small ^ 2))
  q_bt = Kv * up * (port_b.p - port_t.p) / sqrt(sqrt((port_b.p - port_t.p) ^ 2 + dp_small ^ 2))
  q_pb = Kv * un * (port_p.p - port_b.p) / sqrt(sqrt((port_p.p - port_b.p) ^ 2 + dp_small ^ 2))
  q_at = Kv * un * (port_a.p - port_t.p) / sqrt(sqrt((port_a.p - port_t.p) ^ 2 + dp_small ^ 2))
  port_p.m_flow = rho * (q_pa + q_pb)
  port_t.m_flow = -rho * (q_bt + q_at)
  port_a.m_flow = rho * (q_at - q_pa)
  port_b.m_flow = rho * (q_bt - q_pb)
metadata {
  "Dyad": {"icons": {"default": "dyad://MultibodyComponents/ProportionalValve.svg"}}
}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses