Documentation 
Hydraulic continuous 4way directional valve
The 4Way Directional Valve block represents a continuous 4way directional valve. The fluid is pumped in the valve through the inlet line P and is distributed between two outside hydraulic lines A and B (usually connected to a doubleacting actuator) and the return line T. The block has four hydraulic connections, corresponding to inlet port (P), actuator ports (A and B), and return port (T), and one physical signal port connection (S), which controls the spool position.
There are multiple configurations of 4way directional valves, depending on the port connections in three distinctive valve positions: leftmost, neutral, and rightmost. This block lets you model the most popular configurations by changing the initial openings of the orifices, as shown in . Other SimHydraulics^{®} blocks provide more 4way and 6way directional valve configurations. For more information, see Modeling Directional Valves.
The 4Way Directional Valve block is built of four Variable Orifice blocks, connected as shown in the following diagram.
The Variable Orifice blocks are installed as follows: orifice PA is in the PA path, orifice PB is in the PB path, orifice AT is in the AT path, and orifice BT is in the BT path. All blocks are controlled by the same position signal, provided through the physical signal port S, but the Orifice orientation parameter in the block instances is set in such a way that positive signal at port S opens the orifices colored blue in the block diagram (orifices PA and BT ) and closes the orifices colored yellow (orifices PB and AT). As a result, the openings of the orifices are computed as follows:
$${h}_{PA}={h}_{PA0}+x$$
$${h}_{PB}={h}_{PB0}x$$
$${h}_{AT}={h}_{AT0}x$$
$${h}_{BT}={h}_{BT0}+x$$
where
h_{PA}  Orifice opening for the Variable Orifice PA block 
h_{PB}  Orifice opening for the Variable Orifice PB block 
h_{AT}  Orifice opening for the Variable Orifice AT block 
h_{BT}  Orifice opening for the Variable Orifice BT block 
h_{PA0}  Initial opening for the Variable Orifice PA block 
h_{PB0}  Initial opening for the Variable Orifice PB block 
h_{AT0}  Initial opening for the Variable Orifice AT block 
h_{BT0}  Initial opening for the Variable Orifice BT block 
x  Control member displacement from initial position 
By default, all initial openings are set to zero. By adjusting their values, you can obtain 11 different configurations, as shown in the following table. To specify the initial openings of the orifices, use the tab of the block dialog box.
Basic 4Way Directional Valve Configurations
No  Configuration  Initial Openings 

1 
 All four orifices are overlapped in neutral position:

2 
 All four orifices are open (underlapped) in neutral position:

3 
 Orifices PA and PB are overlapped. Orifices AT and BT are overlapped for more than valve stroke:

4 
 Orifices PA and PB are overlapped, while orifices AT and BT are open:

5 
 Orifices PA and AT are open in neutral position, while orifices PB and BT are overlapped:

6 
 Orifice AT is initially open, while all three remaining orifices are overlapped:

7 
 Orifice BT is initially open, while all three remaining orifices are overlapped:

8 
 Orifices PA and PB are open, while orifices AT and BT are overlapped:

9 
 Orifice PA is initially open, while all three remaining orifices are overlapped:

10 
 Orifice PB is initially open, while all three remaining orifices are overlapped:

11 
 Orifices PB and BT are open, while orifices PA and AT are overlapped:

All four orifices are assumed to be of the same shape and size and are parameterized with the same method. You can choose one of the following block parameterization options:
By maximum area and opening — Use this option if the data sheet provides only the orifice maximum area and the control member maximum stroke.
By area vs. opening table — Use this option if the catalog or data sheet provides a table of the orifice passage area based on the control member displacement A=A(h).
By pressureflow characteristic — Use this option if the catalog or data sheet provides a twodimensional table of the pressureflow characteristics q=q(p,h).
In the first case, the passage area is assumed to be linearly dependent on the control member displacement, that is, the orifice is assumed to be closed at the initial position of the control member (zero displacement), and the maximum opening takes place at the maximum displacement. In the second case, the passage area is determined by onedimensional interpolation from the table A=A(h). Flow rate is determined analytically, which additionally requires data such as flow discharge coefficient, critical Reynolds number, and fluid density and viscosity. The computation accounts for the laminar and turbulent flow regimes by monitoring the Reynolds number and comparing its value with the critical Reynolds number. See the Variable Orifice block reference page for details. In both cases, a small leakage area is assumed to exist even after the orifice is completely closed. Physically, it represents a possible clearance in the closed valve, but the main purpose of the parameter is to maintain numerical integrity of the circuit by preventing a portion of the system from getting isolated after the valve is completely closed. An isolated or "hanging" part of the system could affect computational efficiency and even cause failure of computation.
In the third case, when an orifice is defined by its pressureflow characteristics, the flow rate is determined by twodimensional interpolation. In this case, neither flow regime nor leakage flow rate is taken into account, because these features are assumed to be introduced through the tabulated data. Pressureflow characteristics are specified with three data sets: array of orifice openings, array of pressure differentials across the orifice, and matrix of flow rate values. Each value of a flow rate corresponds to a specific combination of an opening and pressure differential. In other words, characteristics must be presented as the Cartesian mesh, that is, the function values must be specified at vertices of a rectangular array. The argument arrays (openings and pressure differentials) must be strictly increasing. The vertices can be nonuniformly spaced. You have a choice of three interpolation methods and two extrapolation methods.
If you need to simulate a nonsymmetrical 4way valve (that is, with different orifices), use any of the variable orifice blocks from the Orifices library (such as Orifice with Variable Area Round Holes, Orifice with Variable Area Slot, or Variable Orifice) and connect them the same way as the Variable Orifice blocks in the schematic diagram of this 4Way Directional Valve block.
Positive signal at the physical signal port S opens the orifices in the PA and BT paths and closes the orifices in the PB and AT paths. The directionality of nested blocks is clear from the schematic diagram.
Fluid inertia is not taken into account.
Spool loading, such as inertia, spring, hydraulic forces, and so on, is not taken into account.
Only symmetrical configuration of the valve is considered. In other words, all four orifices are assumed to have the same shape and size.
Select one of the following methods for specifying the valve:
By maximum area and opening — Provide values for the maximum valve passage area and the maximum valve opening. The passage area is linearly dependent on the control member displacement, that is, the valve is closed at the initial position of the control member (zero displacement), and the maximum opening takes place at the maximum displacement. This is the default method.
By area vs. opening table — Provide tabulated data of valve openings and corresponding valve passage areas. The passage area is determined by onedimensional table lookup. You have a choice of three interpolation methods and two extrapolation methods.
By pressureflow characteristic — Provide tabulated data of valve openings, pressure differentials, and corresponding flow rates. The flow rate is determined by twodimensional table lookup. You have a choice of three interpolation methods and two extrapolation methods.
Specify the area of a fully opened valve. The parameter value must be greater than zero. The default value is 5e5 m^2. This parameter is used if Model parameterization is set to By maximum area and opening.
Specify the maximum displacement of the control member. The parameter value must be greater than zero. The default value is 5e3 m. This parameter is used if Model parameterization is set to By maximum area and opening.
Specify the vector of input values for valve openings as a onedimensional array. The input values vector must be strictly increasing. The values can be nonuniformly spaced. The minimum number of values depends on the interpolation method: you must provide at least two values for linear interpolation, at least three values for cubic or spline interpolation. The default values, in meters, are [0.002 0 0.002 0.005 0.015]. If Model parameterization is set to By area vs. opening table, the Tabulated valve openings values will be used together with Tabulated valve passage area values for onedimensional table lookup. If Model parameterization is set to By pressureflow characteristic, the Tabulated valve openings values will be used together with Tabulated pressure differentials and Tabulated flow rates for twodimensional table lookup.
Specify the vector of output values for valve passage area as a onedimensional array. The valve passage area vector must be of the same size as the valve openings vector. All the values must be positive. The default values, in m^2, are [1e09 2.0352e07 4.0736e05 0.00011438 0.00034356]. This parameter is used if Model parameterization is set to By area vs. opening table.
Specify the vector of input values for pressure differentials as a onedimensional array. The vector must be strictly increasing. The values can be nonuniformly spaced. The minimum number of values depends on the interpolation method: you must provide at least two values for linear interpolation, at least three values for cubic or spline interpolation. The default values, in Pa, are [1e+07 5e+06 2e+06 2e+06 5e+06 1e+07]. This parameter is used if Model parameterization is set to By pressureflow characteristic.
Specify the flow rates as an mbyn matrix, where m is the number of valve openings and n is the number of pressure differentials. Each value in the matrix specifies flow rate taking place at a specific combination of valve opening and pressure differential. The matrix size must match the dimensions defined by the input vectors. The default values, in m^3/s, are:
[1e07 7.0711e08 4.4721e08 4.4721e08 7.0711e08 1e07; 2.0352e05 1.4391e05 9.1017e06 9.1017e06 1.4391e05 2.0352e05; 0.0040736 0.0028805 0.0018218 0.0018218 0.0028805 0.0040736; 0.011438 0.0080879 0.0051152 0.0051152 0.0080879 0.011438; 0.034356 0.024293 0.015364 0.015364 0.024293 0.034356;]
This parameter is used if Model parameterization is set to By pressureflow characteristic.
Select one of the following interpolation methods for approximating the output value when the input value is between two consecutive grid points:
Linear — For onedimensional table lookup (By area vs. opening table), uses a linear interpolation function. For twodimensional table lookup (By pressureflow characteristic), uses a bilinear interpolation algorithm, which is an extension of linear interpolation for functions in two variables.
Cubic — For onedimensional table lookup (By area vs. opening table), uses the Piecewise Cubic Hermite Interpolation Polinomial (PCHIP). For twodimensional table lookup (By pressureflow characteristic), uses the bicubic interpolation algorithm.
Spline — For onedimensional table lookup (By area vs. opening table), uses the cubic spline interpolation algorithm. For twodimensional table lookup (By pressureflow characteristic), uses the bicubic spline interpolation algorithm.
For more information on interpolation algorithms, see the PS Lookup Table (1D) and PS Lookup Table (2D) block reference pages.
Select one of the following extrapolation methods for determining the output value when the input value is outside the range specified in the argument list:
From last 2 points — Extrapolates using the linear method (regardless of the interpolation method specified), based on the last two output values at the appropriate end of the range. That is, the block uses the first and second specified output values if the input value is below the specified range, and the two last specified output values if the input value is above the specified range.
From last point — Uses the last specified output value at the appropriate end of the range. That is, the block uses the last specified output value for all input values greater than the last specified input argument, and the first specified output value for all input values less than the first specified input argument.
For more information on extrapolation algorithms, see the PS Lookup Table (1D) and PS Lookup Table (2D) block reference pages.
Semiempirical parameter for valve capacity characterization. Its value depends on the geometrical properties of the valve, and usually is provided in textbooks or manufacturer data sheets. The default value is 0.7.
The maximum Reynolds number for laminar flow. The transition from laminar to turbulent regime is assumed to take place when the Reynolds number reaches this value. The value of the parameter depends on the orifice geometrical profile. You can find recommendations on the parameter value in hydraulics textbooks. The default value is 12.
The total area of possible leaks in the completely closed valve. The main purpose of the parameter is to maintain numerical integrity of the circuit by preventing a portion of the system from getting isolated after the valve is completely closed. An isolated or "hanging" part of the system could affect computational efficiency and even cause simulation to fail. Therefore, MathWorks recommends that you do not set this parameter to 0. The default value is 1e12 m^2.
Initial opening for the Variable Orifice PA block. The parameter can be positive (underlapped orifice), negative (overlapped orifice), or equal to zero for zero lap configuration. The default value is 0.
Initial opening for the Variable Orifice PB block. The parameter can be positive (underlapped orifice), negative (overlapped orifice), or equal to zero for zero lap configuration. The default value is 0.
Initial opening for the Variable Orifice AT block. The parameter can be positive (underlapped orifice), negative (overlapped orifice), or equal to zero for zero lap configuration. The default value is 0.
Initial opening for the Variable Orifice BT block. The parameter can be positive (underlapped orifice), negative (overlapped orifice), or equal to zero for zero lap configuration. The default value is 0.
Parameters determined by the type of working fluid:
Fluid density
Fluid kinematic viscosity
Use the Hydraulic Fluid block or the Custom Hydraulic Fluid block to specify the fluid properties.
The block has the following ports:
Hydraulic conserving port associated with the pressure supply line inlet.
Hydraulic conserving port associated with the return line connection.
Hydraulic conserving port associated with the actuator connection port.
Hydraulic conserving port associated with the actuator connection port.
Physical signal port to control spool displacement.
The 4Way Directional Valve block in the ClosedLoop Circuit with 4Way Valve and Custom Cylinder example is an opencenter, symmetrical valve controlling a doubleacting cylinder.
2Way Directional Valve  3Way Directional Valve  4Way Directional Valve A  4Way Directional Valve B  4Way Directional Valve C  4Way Directional Valve D  4Way Directional Valve E  4Way Directional Valve F  4Way Directional Valve G  4Way Directional Valve H  4Way Directional Valve K  6Way Directional Valve A