Real Time Simulation of Hydraulic Systems Using Multibody Dynamics Analogy

Jeryes Daniel dit Rabih

Master of Engineering

Department of Mechanical Engineering

McGill University Montreal, Quebec 2016-08-15

Thesis submitted to McGill University in partial fulllment of the requirements of the degree of Master of Engineering (M.Eng.); Mechanical Engineering (Thesis)

c Jeryes Daniel dit Rabih, 2016 DEDICATION

To my family.

ii ACKNOWLEDGMENTS

I would like to thank my supervisor, Professor Jozsef Kovecses for his guidance and support during the research. I would also like to thank my colleagues at CM Labs: Marek Teichmann, Martin Hirschkorn, Danial Alizadeh and Ali Azimi for their help in the project. Finally, I would like to thank my family for their unconditional love, patience and encouragement.

iii ABSTRACT

The research objective of this thesis is to develop a real-time simulation model for hydraulic systems used to transmit power in machines such as excavators and cranes. Hydraulic simulation usually requires slow, expensive computation due to sti dierential equations and steep characteristics which make it hard to achieve real-time simulation. The solution model described in this thesis uses a mechani- cal system equivalent to the hydraulic circuit using a multibody dynamics analogy. Hydraulic circuits consisting of a , cylinders, motors, relief valves, a servovalve and check valves are simulated. The model is tested using a real-time rigid body dynamics engine (Vortex) and results were compared and validated with a hydraulic simulation engine (simHydraulics). The model is validated by applying it to the simulation of a hydraulic excavator.

iv ABRÉGÉ

L'objectif de recherche de cette thèse est de développer un modèle de simulation en temps réel pour les systèmes hydrauliques utilisés pour transmettre la puissance dans des machines telles que les excavatrices et les grues. La simulation hydraulique est généralement lente, coûteuse en raison des équations diérentielles raides et des caractéristiques abruptes qui rendent la simulation en temps réel dicile. La so- lution décrite dans cette thèse utilise un système mécanique équivalent au circuit hydraulique à l'aide de la dynamique multicorps. Les circuits hydrauliques consis- tent d'au moins une pompe, de cylindres, de moteurs, de soupapes de décompression, d'une servovalve et de clapets qui sont simulés. Le modèle est validé à l'aide d'un engin de simulation en temps-réel basé sur la dynamique des corps rigides (Vortex) et les résultats sont comparés et validés avec un moteur de simulation hydraulique (simHydraulics). Le modéle est validé en utilisant un exemple concret de simulation de pelle hydraulique.

v TABLE OF CONTENTS

DEDICATION ...... ii ACKNOWLEDGMENTS ...... iii ABSTRACT ...... iv ABRÉGÉ ...... v LIST OF TABLES ...... viii LIST OF FIGURES ...... ix 1 Introduction ...... 1 1.1 Motivation ...... 1 1.2 Objective ...... 3 1.3 Literature Review ...... 4 1.4 Thesis Overview ...... 10 2 Multibody Dynamics Formulations ...... 11 2.1 Introduction ...... 11 2.1.1 Equations of Motion ...... 11 2.1.2 Solution ...... 12 2.2 Constraints Derivation ...... 13 2.2.1 Gear Ratio ...... 13 2.2.2 Dierential ...... 16 2.3 Real-Time Simulation Engines ...... 19 3 Hydraulic Components Modelling ...... 21 3.1 Pump ...... 21 3.2 Hydraulic Motor ...... 26 3.3 Hydraulic Cylinder ...... 28 3.4 Power Transmission Junctions ...... 32

vi 3.4.1 1-1 Junction ...... 33 3.4.2 1-2 Junction ...... 35 3.4.3 1-n Junction ...... 37 3.4.4 Rotation to translation Junction ...... 38 3.5 Pipes ...... 39 3.5.1 Inertance ...... 39 3.5.2 Fluid Resistance ...... 41 3.5.3 Fluid Compliance ...... 43 3.6 Valves ...... 45 3.6.1 Orice ...... 46 3.6.2 Directional Control Valve ...... 48 3.6.3 Pressure Relief Valve ...... 49 3.6.4 ...... 51 4 Hydraulic Circuits Modeling and Simulation ...... 53 4.1 Hydrostatic Transmission - One Motor ...... 53 4.2 Hydrostatic Transmission - One Motor with Pipe Losses ...... 60 4.3 Hydrostatic Transmission - Two Motors ...... 64 4.4 Hydraulic Cylinder Circuit ...... 71 5 Application: Front Loader Actuation System ...... 75 5.1 Hydraulic System ...... 75 5.2 Simulation Inputs ...... 78 5.3 Simulation Results ...... 81 6 Conclusions ...... 84 A Simhydraulics Circuits ...... 86 References ...... 93

vii LIST OF TABLES Table page 1.1 Analogy between mechanical, electrical and hydraulic systems [9]. . .9 4.1 Pump Parameters ...... 54 4.2 Motor Parameters ...... 54 4.3 Pressure Relief Valve Parameters ...... 54 4.4 Fluid Parameters ...... 54 4.5 Pipe Parameters ...... 60 4.6 Cylinder Parameters ...... 72 4.7 4-Way Directional Valve Parameters ...... 73 5.1 Excavator Pump Parameters ...... 75 5.2 Fluid Parameters ...... 76 5.3 Tilt Cylinder Parameters ...... 76 5.4 Lift Cylinder Parameters ...... 76 5.5 Tilt Pipes Parameters ...... 76 5.6 Lift Pipes Parameters ...... 77 5.7 Tank Return Pipes Parameters ...... 77 5.8 Excavator Pressure Relief Valve Parameters ...... 77 5.9 5/3 Way Directional Valve Parameters ...... 77

viii LIST OF FIGURES Figure page 1.1 Tower Crane Simulator Developed by CM Labs Simulations . . . . .1 1.2 Hydraulic Shovel [1] ...... 2 1.3 Example for Compressibility Eects [5] ...... 4 1.4 Hydraulic junctions with constant and variable [2] ...... 6 1.5 Pressure drop in an orice [2]...... 8 1.6 Combination of smooth and non-smooth components [2]...... 8 2.1 Gear Ratio Constraint ...... 14 2.2 Dierential Constraint ...... 17 3.1 Pump Main Parts ...... 22 3.2 Revolute Joint ...... 22 3.3 Pump ...... 24 3.4 motor ...... 27 3.5 Cylinder Main Parts ...... 29 3.6 Prismatic Joint ...... 29 3.7 Cylinder ...... 31 3.8 Junction 1-1 example ...... 33 3.9 Junction 1-2 ...... 35 3.10 Junction 1-n ...... 37 3.11 Rack and Pinion ...... 38

ix 3.12 Rotation to Translation Junction ...... 39 3.13 Fluid Inertance Analogy ...... 40 3.14 Pipe Flow Inertance and Damping Analogy ...... 43 3.15 Mixture of Gas and Liquid ...... 44 3.16 Pipe Simulation Model ...... 45 3.17 Orice ...... 46 3.18 Valve Flow Versus Spool Position [16] ...... 47 3.19 Four Way, Three Position Valve ...... 48 3.20 Pressure Relief Valve ...... 49 3.21 Check Valve ...... 51 4.1 Hydrostatic Transmission Circuit - One Motor ...... 53 4.2 Equivalent Mechanical System of One Motor Circuit ...... 55 4.3 No Load Test Results for One Motor Circuit ...... 57 4.4 Damping Load Test Results for One Motor Circuit ...... 58 4.5 Stiness Load Test Results for One Motor Circuit ...... 59 4.6 Hydrostatic Transmission Circuit - One Motor with Pipe Losses . . . 60 4.7 Equivalent Mechanical System of One Motor Circuit with Pipe Losses 61 4.8 Motor Velocity with 5m Pipe Length ...... 62 4.9 Motor Velocity with 10m Pipe Length ...... 63 4.10 Motor Velocity with 15m Pipe Length ...... 63 4.11 Hydrostatic Transmission Circuit - Two Motors ...... 64 4.12 Equivalent Mechanical System of Two Motor Circuit ...... 65 4.13 No Load Test Results for Two Motor Circuit ...... 67

x 4.14 Dierent Motor Displacement Test Results for Two Motor Circuit . . 68 4.15 Damping Load Test Results for Two Motor Circuit ...... 69 4.16 Stiness Load Test Results for Two Motor Circuit ...... 70 4.17 Hydraulic Cylinder Circuit ...... 71 4.18 Equivalent Mechanical System of One Motor Circuit ...... 72 4.19 Test Results for Hydraulic Cylinder Circuit ...... 74 5.1 Tilt Valve Spool Position ...... 78 5.2 Lift Valve Spool Position ...... 79 5.3 Tilt Load ...... 79 5.4 Lift Load ...... 80 5.5 Tilt Cylinder Position ...... 81 5.6 Lift Cylinder Position ...... 82 5.7 Tilt Cylinder Velocity ...... 82 5.8 Lift Cylinder Velocity ...... 83 5.9 Pump Pressure ...... 83 A.1 Hydrostatic Transmission - with one Motor Circuit ...... 87 A.2 Hydrostatic Transmission - with one Motor with Pipe Losses Circuit . 88 A.3 Hydrostatic Transmission - with Two Motors Circuit ...... 89 A.4 Hydraulic Cylinder Circuit ...... 90 A.5 Excavator Hydraulic Circuit ...... 91 A.6 Excavator Block Hydraulic Circuit ...... 92

xi xii CHAPTER 1 Introduction 1.1 Motivation

Simulation is being used extensively in almost all industries for the purpose of improving design, productivity, quality and eciency. For example it can be used by engineers to predict the behaviour of their designed system in order to validate it before starting the manufacturing stage. Simulation is also widely used for the purpose of training machine operators such as the tower crane simulator developed by CM Labs Simulations shown in Fig. 1.1.

Figure 1.1: Tower Crane Simulator Developed by CM Labs Simulations

1 The simulation time of a physical model can vary depending on the model ap- proximations, numerical solver methods and the desired delity of the results. Real- time simulation refers to a model with execution time equal the actual physical time of the simulated behaviour. For example if a crane takes 30 seconds to hoist up 20 meters, the simulation would take 30 seconds as well. In other words, if the solver needs more than 30 seconds to solve the model equations, then the simulation is no longer real-time. Hydraulic systems are used in wide variety of machines such as cranes, excava- tors, planes and robots. They are used to transmit power from the engine to several types of actuators such as the tracks and hydraulic cylinders of the shovel shown in Fig. 1.2.

Figure 1.2: Hydraulic Shovel [1]

The simulation should predict the power losses in various hydraulic components. The speed and reductions at the actuators must be accurate as they impact the machine behaviour and operator reactions. As a result, high delity real-time simulation of hydraulic systems is necessary for accurate results and better training.

2 1.2 Objective

The objective of this thesis is to develop a real-time simulation model of hy- draulic systems using multibody dynamics analogy. The model should be integrated with a rigid body dynamics engine to actuate complex mechanisms and react to loads and machine states. Hydraulic simulation usually requires very small simulation time steps due to its sti dierential equations and steep characteristics, making it hard to achieve real- time simulation. The solution model described in this thesis uses a mechanical system equivalent to the hydraulic circuit using rigid body dynamics analogy, to address this issue. The model will be applied to the simulation of a hydraulic excavator using the Vortex Simulation Software which is a real-time multibody dynamics engine developed by CM Labs Simulations Inc.

3 1.3 Literature Review

Signicant eort has been devoted to developing a real-time simulation model of hydraulic systems and coupling it with multibody dynamics. Pfeifer in [2] and [3] presented a model which establishes the hydraulic equations of motion in the form of a multibody system equations with bilateral and unilateral constraints. The equations will then be used to derive a linear complementary problem (LCP) which can be solved using a standard pivoting algorithm, such as Lemke's algorithm described in [4]. In [2], it is mentioned that this model is able to reduce the computational time by three to four orders of magnitudes. Borchsenius [5] presents an example to show the eects of compressibility in a small hydraulic components. The example in [5], shown in Fig. 1.3 consists of a simple hydraulic system composed of a pressure source, uid line and hydraulic cylinder.

Figure 1.3: Example for Compressibility Eects [5]

The model is simulated with and without compressibility [5]. The results are compared to show the compressibility eects on the piston's position and pressure. The pressure change across the cylinder follows the uid continuity equation and dened as

4 ∂ρ + 5.(ρu) (1.1) ∂t where ρ is the uid density, t is time and u is the ow velocity vector eld. The continuity eq. (1.1) can be simplied leading to

E p˙ = (Q − A v ) (1.2) V P P where p˙ is the pressure change across the cylinder, E is the uid compressibility, V is the uid volume, Q is the uid ow, AP is the piston area and vP is the piston speed. For incompressible uid, eq. (1.2) becomes

Q − AP vP = 0 (1.3) which is equivalent to Kirchho's nodal equation in electrical systems meaning that the uid ow rate for uid that enters the hydraulic component is equal to the rate at which it leaves the component [2]. The simulation results in [5] show that compressibility does not inuence the piston position. It only produces small oscillations around the mean value of the pressure. These high frequency oscillations are usually far away from the operating frequency of the system. As a result, it can be concluded that compressibility eects can be neglected for small uid volume components such as the constant and variable volume junctions shown in Fig. 1.4.

5 Figure 1.4: Hydraulic junctions with constant and variable volumes [2]

By neglecting compressibility eects for hydraulic components with small uid volumes, the sti uid continuity dierential equations will simplify into algebraic forms as was shown in eq. (1.2) and eq. (1.3). The equivalent continuity equations for junctions with constant volume including and excluding compressibility eects can be expressed respectively as

E X p˙ = Q (1.4) V i X Qi = 0 (1.5)

Eqs. (1.2) to (1.5) do not consider the elasticity and the unilaterality of the uid properties. In [6], Pfeier approximated the small volume uid properties by unilateral characteristics that will capture the uid expansion at low as

V¯ ≥ 0;p ¯ ≥ 0; V¯ p¯ = 0 (1.6) where V¯ is the void volume and p¯ is dened by

p¯ = P − Pmin (1.7)

6 where Pmin is the minimum void pressure. It was shown in [6] that dierentiating eq. (1.6) leads to ¯˙ X V = Qi ≥ 0 (1.8)

It can be concluded from eq. (1.6) and eq. (1.8) that uid will follow Kirchho equation as long as the pressure is larger than the minimum pressure. Pfeier stated in [2] that hydraulic systems can be considered as a network of basic components. Complex elements such as control valves can be composed of elementary components such as orices, check valves and so forth. An example is the superposition of the throttle and check valve shown in Fig. 1.6. Orices with variable areas are used to control ow in hydraulic systems by changing the orice area. The pressure drop is non-linear as shown in Fig. 3.17. It can be described using Bernoulli equation as

ρ 1 ∆P = ( )2Q|Q| (1.9) 2 αAv where ρ is the uid density, Q is the uid ow, Av is the orice opening area and α is an empirical factor depending on the geometry of the orice and Reynolds number. When the valve is open, the pressure drop is calculated as a function of the ow rate and the valve area using eq. (1.9). When the valve closes or its area is too small, the equation becomes sti and innitely steep.

7 In order to avoid such numerical problems, when the valve is closed or its area is below a minimum value, the pressure drop equation is replaced by the constraint   Av, A ≥ Amin Q = (1.10)  0, A < Amin where Q is the uid ow rate, A is the valve area, Amin is the minimum valve area and v is the uid speed.

Figure 1.5: Pressure drop in an orice [2].

Figure 1.6: Combination of smooth and non-smooth components [2].

In [7], the discrete Lagrange energy principle was used to simulate and couple stable multi-domain systems consisting of piecewise linear components with time steps only depending on the system time scale. It was based on the work reported in

8 Eort e Flow f Displacement s p force F velocity v position x linear momentum x torque τ angular velocity w angle θ angular momentum θ U current I charge q ux linkage Λ pressure P volume rate Q volume V pressure momentum V T entropy rate S entropy S none Table 1.1: Analogy between mechanical, electrical and hydraulic systems [9].

[8] where components are based on energy storage, transference and transformation which are common to mechanical, electrical and hydraulic domains as shown in Table 1.1, see [9]. The mechanical, electrical and hydraulic circuits are formulated as linear com- plementarity problem (LCP) and solved together within the same solver avoiding co-simulation complexities.

9 1.4 Thesis Overview

This thesis reports on the work leading to the development of a real-time hy- draulic simulation model. Chapter 2 discusses multibody dynamics formulations and focuses on the concepts used for the analogy. Chapter 3 denes the anal- ogy for basic hydraulic components. Chapter 4 validates the model by simulating basic circuits that form the building blocks of complex hydraulic circuits using an implementation of the models in the V ortex simulation engine, compared to the SimHydraulics simulation engine. Chapter 5 applies the developed model to the simulation of a hydraulic excavator. Chapter 6 concludes the work and includes suggestions for future research work.

10 CHAPTER 2 Multibody Dynamics Formulations 2.1 Introduction

In this section, a summary of the constrained dynamics theory will be given as described in [10], [11] and [12]. It will introduce concepts that will be used for hydraulic systems analogy in the remaining chapters of this thesis. 2.1.1 Equations of Motion

A multibody system is represented by generalized coordinates vector q which is a set of geometric parameters whose value uniquely denes the position of the system relative to its initial position. The set is minimum if the generalized coordinates are independent. Constraints restrict the motion of the bodies on which they act. Associated with each constraint are a constraint equation and a constraint force. The constraint equation describes the geometry or kinematics of the constraint. Constraint force is the generalized force required to maintain the restriction on the motion of the system. The system constraint equations can be expressed as

φj(q1, q2, ..., qn, t) = 0 (2.1)

11 where j is the equation index, qi are the generalized coordinates and t is time. The constraints can be dierentiated and expressed at velocity level as

A ˙q + b = 0 (2.2) where A is the constraints Jacobian matrix, ˙q is the vector of generalized velocities and b is a vector function of the generalized coordinates and of time. The second derivative of the constraints equation can be expressed at the acceleration level as

A¨q + A˙ ˙q + b˙ = 0 (2.3) where A˙ is the derivative of the constraint Jacobian matrix. The equations of motion for a multibody dynamic system can be written as

T M¨q + c = fa + A λ (2.4)

where M is the generalized matrix, ¨q is the vector of generalized accelera- tions, c is the vector of Coriolis and centrifugal terms, fa is the vector of generalized applied and λ is a vector of Lagrange multipliers corresponding to the con- straints. 2.1.2 Solution

The equations of motion and constraint equations shown in eq. (2.4) and eq. (2.3) respectively can be rearranged into a matrix form as       M −AT q¨ f − c      a  (2.5)     =   −A 0 λ A˙ ˙q + b˙

12 The coecient matrix is symmetric. If the constraints are independent, then it is nonsingular and invertible. Hence, the solution of eq. (2.5) for the generalized accelerations and constraints Langrange multiplier can be obtained by

   −1   q¨ M −AT f − c      a  (2.6)   =     λ A 0 A˙ ˙q + b˙

As a result, the generalized constraint force can be determined by

T fc = A λ (2.7)

2.2 Constraints Derivation

In this section, constraint equations and forces will be derived for the gear ratio and dierential constraints that form the base of the hydraulic analogy described in the remaining chapters of this thesis. For other constraint derivations such as the hinge and prismatic joints, ball and socket, contact and friction refer to the derivations described in [10], [11] and [12]. 2.2.1 Gear Ratio

The gear ratio constraint is a constraint between four rigid bodies where the angular position of body B1 with respect to B2 along the gear axis of rotation is related to the angular position of body B3 with respect to B4 by a ratio r and a dierence b. The constraint equation can be dened as

φ(θ) = θ1 − θ2 + r(θ3 − θ4) + b = 0 (2.8)

13 Figure 2.1: Gear Ratio Constraint

where θ1, θ2, θ3 and θ4 are respectively the angular position of bodies B1, B2, B3 and B4 along the gear axis of rotation. The dierential of eq. (2.8) leads to

˙ ˙ ˙ ˙ θ1 − θ2 + rθ3 − rθ4 = 0 (2.9)

which can be re-arranged in matrix form as

  ˙ θ1    ˙    θ2   (2.10) 1 −1 r −r   = 0 θ˙   3   ˙ θ4

As a result, the constraint Jacobian matrix can be deduced by comparing eq. (2.2) and eq. (2.10) to be

  A = 1 −1 r −r (2.11)

14 The second derivative of eq. (2.8) leads to

¨ ¨ ¨ ¨ θ1 − θ2 + rθ3 − rθ4 = 0 (2.12)

To simplify equations, it is assumed that reference bodies B2 and B4 are static and will not rotate. The simplied constraint equation is expressed as

φ(θ) = θ1 + rθ3 + b = 0 (2.13)

The corresponding Jacobian matrix is

  A = 1 r (2.14)

The Langrangian function for this system can be expressed as

1 2 1 2 L = I θ˙ + I θ˙ (2.15) 2 1 1 2 3 3 where L is the Langrangian function dened as

L = T − V (2.16) where T is the kinetic energy and V is the potential energy. Langrage's equation can be used to derive the equations of motion. Its is dened as

d  ∂L  ∂L nc (2.17) − = Qk dt ∂q˙k ∂qk where is the generalized coordinate, nc is the generalized non conservative forces qk Qk associated with the generalized coordinate.

15 The application of Lagrange's equation eq. (2.17) on the generalized coordinates

θ1 and θ3 leads to ¨ I1θ1 = λ + τ(t) (2.18)

¨ I3θ3 = λr (2.19) where I1 and I3 are respectively the moments of of B1 and B3 around the axis of rotation and τ(t) is the external torque applied to B1. Substituting eq. (2.12) in eq. (2.18) and eq. (2.19) leads to

I θ¨ λ = − 3 1 (2.20) r2

I θ¨ λr = − 3 1 (2.21) r where λ is equivalent to the constraint torque applied at shaft B1 and λr is equivalent to the constraint torque applied at shaft B3. 2.2.2 Dierential

The Dierential constraint is a constraint between six rigid bodies where the angular position of body B1 with respect to B2 is related to the angular position of body B3 with respect to B4 and the angular position of body B5 with respect to B6 by ratios r2 and r3 and a dierence b. The constraint equation can be dened as

φ(θ) = θ1 − θ2 + r2(θ3 − θ4) + r3(θ5 − θ6) + b = 0 (2.22)

16 Figure 2.2: Dierential Constraint

where θ1, θ2, θ3, θ4, θ5 and θ6 are respectively the angular position of bodies B1, B2,

B3, B4, B5 and B6 along the gear axis of rotation. The dierential of eq. (2.22) leads to ˙ ˙ ˙ ˙ ˙ ˙ θ1 − θ2 + r2θ3 − r2θ4 + r3θ5 − r3θ6 = 0 (2.23)

which can be re-arranged in matrix form as   ˙ θ1     θ˙   2      ˙  θ3 1 −1 r −r r −r   = 0 (2.24) 2 2 3 3  ˙  θ4     θ˙   5  ˙  θ6

As a result, the constraint Jacobian matrix can be deduced by comparing eq. (2.2) and eq. (2.24) to be

17   (2.25) A = 1 −1 r2 −r2 r3 −r3

The second derivative of eq. (2.22) leads to

¨ ¨ ¨ ¨ ¨ ¨ θ1 − θ2 + r2θ3 − r2θ4 + r3θ5 − r3θ6 = 0 (2.26)

To simplify the equations, it is assumed that reference bodies B2, B4 and B6 are static and will not rotate. The simplied constraint equation is expressed as

φ(θ) = θ1 + r2θ3 + r3θ5 + b = 0 (2.27)

The corresponding Jacobian matrix is

  (2.28) A = 1 r2 r3

The Langrangian function for this system can be expressed as

1 2 1 2 1 2 L = I θ˙ + I θ˙ + I θ˙ (2.29) 2 1 1 2 3 3 2 5 5

The application of Lagrange's equation eq. (2.17) on the generalized coordinates

θ1, θ3 and θ5 leads to ¨ I1θ1 = λ + τ(t) (2.30)

¨ I3θ3 = λr2 (2.31)

¨ I5θ5 = λr3 (2.32)

18 where τ(t) is the external torque applied to B1. Substituting eq. (2.26) in eq. (2.30), eq. (2.31) and eq. (2.32) leads to

I3I5 ¨ (2.33) λ = 2 2 θ1 r2I5 + r3I3

r2I3I5 ¨ (2.34) λr2 = 2 2 θ1 r2I5 + r3I3

r3I3I5 ¨ (2.35) λr3 = 2 2 θ1 r2I5 + r3I3 where λ is equivalent to the constraint torque applied at shaft B1, λr2 is equivalent to the constraint torque applied at shaft B3 and λr3 is equivalent to the constraint torque applied at shaft B5. 2.3 Real-Time Simulation Engines

The simulation of multibody dynamics involves the solution of second order dierential equations. There are many numerical methods to solve them. However, for a real-time solution, the numerical method should not slow down the simulation while keeping accurate solutions. There are several real-time multibody dynamics simulation engines in the mar- ket. The one that is used for validation purposes in this thesis is Vortex engine developed by CM Labs Simulations Inc. Vortex is a high delity real-time simulation engine for complex rigid body dy- namical systems. It includes graphical capabilities and is optimized for fast and real-time computations. Vortex uses a linear complementarity problem (LCP) for- mulation and rst order semi-implicit Euler integrator with a xed time-step size in

19 order to solve the system of equations describing the dynamical system [12]. The time-step size is often set to 1 in Vortex for real-time simulation. The semi-implicit 60 s Euler integrator is a symplectic integrator and hence lead to better results than the standard Euler method. It is guaranteed to be stable for harmonic motions because it is implicit in velocity and explicit in generalized coordinates. Vortex uses rst order discretization because high order implicit methods are computationally expensive. Moreover, inequality constraints that are used in Vortex introduce discontinuities that violates the assumption of any high order integration method.

20 CHAPTER 3 Hydraulic Components Modelling Fluid power is the transmission of forces using a conned and pressurized uid. Power is transferred from a prime mover such as a diesel engine or an electric mo- tor to a mechanism on the other side of the machine such as a hydraulic cylinder of a bucket mechanism. Mathematical models of hydraulic components are based on uid conservation of ow and energy equations. Dynamics modelling and uid compressibility will be ignored for small volume components because their eects are negligible as was shown in section 1.3. However, dynamics modelling and compressibility eects will be included for the pipe network of a hydraulic system. This chapter investigates the modelling of major hydraulic components: pump, mo- tor, cylinder, pipe, junction, orice, directional valve, pressure relief valve and check valve. It describes the equivalent mechanical model of each hydraulic component using multibody dynamics analogy. 3.1 Pump

A pump is the component of a hydraulic system that transfers the mechanical energy provided by the power source into uid ow pressurizing the circuit. As shown in Fig. 3.1, the main components of a pump are the input shaft, impeller, uid suction inlet and uid discharge outlet. The pump will be modelled as a shaft constrained by a revolute joint around its longitudinal axis (Fig. 3.2). The constraint is dened with respect to the machine

21 Figure 3.1: Pump Main Parts frame of reference. This analogy is based on the pump structure shown in Fig. 3.1 which is basically a rotating shaft with an impeller pressurizing and moving the hydraulic uid. The pump revolute joint is driven by the power source shaft via a gear ratio constraint as will be seen in section 3.4 where power transmission between components will be discussed.

Figure 3.2: Revolute Joint

The mass and inertia of the revolute joint shaft represent the pump drive shaft and the impeller. Fluid mass properties inside the pump can be considered in the

22 shaft mass properties. However, this model describes only the mass properties of the shaft and impeller because uid volume inside the pump is considered negligible. There will be power losses in the pump due to friction in bearings and other moving parts and due to uid leakages. The friction will result in additional torque required from the power source. The torque needed to drive a pump can be expressed as

Dp∆P Tp = (3.1) ηmp where ∆P is the pressure dierence that the pump creates, Dp is the pump dis- placement which is the volume of uid pumped per revolution of the input shaft and

ηmp is the mechanical eciency which is usually given in the manual of the pump. Mechanical eciency is a measurement of the theoretical torque required to drive the pump input shaft, expressed as a proportion of the actual torque which include friction in the pump bearings. It can be concluded from eq. (3.1) that torque losses in the pump are equivalent to

1 Tp,losses = ( − 1)Dp∆P (3.2) ηmp

As a result, simulating the eects of internal uid and mechanical friction within a pump can be included in the model by adding a resistance torque or a rotational friction to the revolute joint with value equal to Tp,losses. The conservation of ow equation for a pump can be written as

V1 Q1 = DpN − Qleak − dP1/dt (3.3) βe

23 where N is the engine speed, Dp is the pump displacement, QLeak is the pump internal and external leakages, βe is the uid compressibility, P1 is the pressure and

V1 is the uid volume at the pump pressurized side as shown in Fig. 3.3. However, compressibility eects are negligible because V1 is too small and βe is large so that

V1 dP1/dt ≈ 0 (3.4) βe

Figure 3.3: Pump

The internal leakage in a pump is a result of excessive clearances between the pump blades and the casing body. The external leakage occur at the pump inlet and outlet ports. They are represented in the model by Qleak that can be expressed as

Qleak = (1 − ηvp)DpN (3.5)

where ηvp is the pump volumetric eciency and is usually given in the pump manual. Volumetric eciency is a measurement of the actual ow from a pump, expressed as a proportion of the theoretical ow which does not include leakages. ηvp is measured

24 at a nominal pressure Pnom and nominal uid viscosity µnom. This means that the volumetric eciency will not be the same if operating pressure and uid viscosity are dierent than the nominal values. As a result, eq. (3.5) can be used only when operating at nominal pressure and nominal viscosity. Fluid leakage is directly pro- portional to pressure in the system and inversely proportional to the uid viscosity.

Hence, the operational volumetric eciency 0 can be obtained using eq. (3.5) and ηvp adding operating pressure and viscosity eects

∆P µnom Qleak = (1 − ηvp)DpN (3.6) Pnom µ

Substituting eq. (3.4) and eq. (3.6) in eq. (3.3) leads to

0 (3.7) Q1 = ηvpDpN where 0 is expressed as ηvp

∆P µ ∆P µ 0 nom nom (3.8) ηvp = 1 − − ηvp Pnom µ Pnom µ

Volumetric eciencies and leakage eects will reduce the pump output ow

as shown in eqs. (3.6)-(3.8) because the volumetric eciency 0 will always be Q1 ηvp smaller than one. Reduction in ow will result in slower speeds at the nal hydraulic actuator. Further analysis and discussion of volumetric eciency eects on power transmission between hydraulic components will be presented in section 3.4. The pressure across the pump can be obtained using the results of the multibody dynamics simulation. Solving eq. (2.6) and eq. (2.7) for the system's acceleration, Lagrange multipliers and constraint forces, the pump revolute joint driving torque

25 Tp will be computed. Then, eq. (3.1) can be used to compute the pressure dierence ∆P across the pump. 3.2 Hydraulic Motor

A hydraulic motor converts hydraulic energy into mechanical energy. It gener- ates torque and rotation using the uid pressure and ow. The model of a hydraulic motor is very similar to the pump model. They both have the same structure shown in Fig. 3.1. However, a hydraulic motor use the pressurized ow to rotate its output shaft while the pump uses its input driven shaft rotation to create a uid ow. As a result, pump analogy can be applied to the hydraulic motor. It will be simulated as a shaft constrained on a revolute joint around its longitudinal axis (Fig. 3.2). The constraint is dened with respect to the machine frame of reference. The mass and inertia of the revolute joint shaft represent the motor rotating shaft and its blades. Similar to the pump model, the mass properties of uid inside the motor will be neglected because the uid volume inside the motor is negligible. There will be power losses in the motor due to friction in bearings and due to uid leakages. The motor mechanical eciency, ηmm, is usually given in the manual of the motor. It is a measurement of the actual torque output, expressed as a percentage of the theoretical output. The torque available at the motor shaft to drive a load can be expressed as

Tm = ηmmDm∆P (3.9)

where ∆P is the pressure dierence between the motor ports and Dm is the motor displacement. It can be concluded from eq. (3.9) that torque losses in the motor are

26 equivalent to

Tm,losses = (1 − ηmm)Dm∆P (3.10)

As a result, simulating the eects of internal uid and mechanical friction within a motor can be included in the model by adding a resistance torque or a rotational friction to the revolute joint with value equal to Tm,losses. The conservation of ow equation for a motor can be written as

V2 Q2 = DmW + Qleak − dP2/dt (3.11) βe where w is the motor shaft rotation speed, Dm is the motor displacement, QLeak is the motor internal and external leakages, βe is the uid compressibility, P2 is the pressure and V2 is the uid volume at the motor suction side as shown in Fig. 3.4.

However, compressibility eects are negligible because V2 is too small and βe is large so that

V2 dP2/dt ≈ 0 (3.12) βe

Figure 3.4: motor

27 The internal leakage in a motor is a result of excessive clearances between the motor blades and the casing body. The external leakage occur at the motor inlet and outlet ports. They are represented in the model by Qleak that can be expressed as

Qleak = (1 − ηvm)DmW (3.13) where ηvm is the motor volumetric eciency and is usually given in the motor manual.

ηvm is measured at a nominal pressure Pnom and nominal uid viscosity µnom. Similar to the pump, it can be concluded that the uid ow in a hydraulic motor is

0 (3.14) Q2 = ηvmDmW where 0 is the motor operational volumetric eciency and can be expressed as ηvm

∆P µ ∆P µ 0 nom nom (3.15) ηvm = 1 − − ηvm Pnom µ Pnom µ

The pressure across the motor can be obtained using the results of the multi- body dynamics simulation. Solving eq. (2.6) and eq. (2.7) for system's acceleration,

Lagrange multipliers and constraint forces, the revolute joint driving torque Tm will be computed. Then, eq. (3.9) can be used to compute the pressure dierence ∆P across the motor. 3.3 Hydraulic Cylinder

A hydraulic cylinder is the component of hydraulic systems that converts uid ow into mechanical energy. It generates force and translational motion using the uid pressure and ow. The model of a hydraulic cylinder is very similar to the pump and motor models except that it generate a translational motion instead of

28 rotational. As shown in Fig. 3.5, the main components of a cylinder are the cylinder, piston, and uid inlet and outlet ports.

Figure 3.5: Cylinder Main Parts

The hydraulic cylinder can be simulated as two rigid bodies representing the cylinder and its piston. The two bodies will be constrained by a prismatic joint which provides the linear sliding motion between the cylinder and the piston (Fig. 3.6). The cylinder rigid body is either xed to the chassis frame of reference or constrained with a revolute joint depending on the machine model. The cylinder prismatic joint is driven by uid ow which is simulated via a gear ratio constraint as will be seen in section 3.4.

Figure 3.6: Prismatic Joint

29 There will be power losses in the cylinder due to friction between the piston and its cylinder wall. Similar to the pump and motor, the friction losses are represented by the cylinder mechanical eciency, ηmc, which is usually given in the manual of a cylinder. The force available at the cylinder piston rod to drive a load can be expressed as

Fc = ηmcA∆P (3.16) where ∆P is the pressure dierence between the cylinder ports and A is piston area. It can be concluded from eq. (3.16) that friction losses in the cylinder are equivalent to

Fc,losses = (1 − ηmc)A∆P (3.17)

As a result, internal uid and mechanical friction eects within a cylinder can be included in the model by adding a resistance force or a translational friction to the prismatic joint as give by eq. 3.17. The conservation of ow equation for a cylinder can be expressed as:

V2 Q2 = Ax˙ + Qleak − dP2/dt (3.18) βe where Q2 is the uid ow leaving the cylinder, x˙ is the piston translational speed, A is the piston area, QLeak is the cylinder internal and external leakages, βe is the uid compressibility, P2 is the pressure and V2 is the uid volume at the cylinder suction side as shown in Fig. 3.7.

30 Figure 3.7: Cylinder

However, compressibility eects can be considered negligible because V2 is too small compared to βe leading to

V2 dP2/dt ≈ 0 (3.19) βe

The internal leakages between the piston rubber seals and cylinder frame in addition to the external leakages at the cylinder ports are represented in the model as

Qleak = (1 − ηvc)Ax˙ (3.20) where ηvc is the cylinder volumetric eciency. It is measured at a nominal pressure

Pnom and uid viscosity µnom. Similar to the pump and motor, it can be concluded that the uid ow in a hydraulic cylinder is

0 (3.21) Q2 = ηvcAx.˙

where 0 is the operational volumetric eciency and can be expressed as ηvc

∆P µ ∆P µ 0 nom nom (3.22) ηvc = 1 − − ηvc Pnom µ Pnom µ

31 The pressure across the cylinder can be obtained using the results of the multi- body dynamics simulation. Solving eq. (2.6) and eq. (2.7) for the system acceleration,

Lagrange multipliers and constraint forces, the prismatic joint driving force Fc will be computed. Then, eq. (3.16) can be used to compute the pressure dierence ∆P across the cylinder. 3.4 Power Transmission Junctions

In this section, a model will be developed for a junction which is the component used in this simulation to transfer power between two hydraulic components. It is considered that the ow arriving to the junction is coming from a pump and the ow leaving the junction is going to a hydraulic motor. However, the resulting analogy for the junction model will be applied to any other connection. The model describing the junction is based on the conservation of ow equation

V ΣQi = dP/dt (3.23) βe

However, compressibility eects can be neglected because V is too small com- pared with βe leading to V2 dP2/dt ≈ 0 (3.24) βe As a result, the conservation of ow equation will be analogous to Kirchhos law

ΣQi = 0 (3.25) which means that the uid ow rate entering the junction is equal to the ow rate leaving it.

32 The operating volumetric eciencies 0 and 0 of the pump and motor are up- ηvp ηvm dated at each simulation step according to eq. (3.8) and eq. (3.15) based on pressure values from the previous simulation step. 3.4.1 1-1 Junction

This is a junction connecting two hydraulic components. To demonstrate the modelling of a 1-1 junction, an example will be analyzed showing the power trans- mission from a pump to a motor.

Figure 3.8: Junction 1-1 example

Starting with eq. (3.25) and replacing eq. (3.7) and eq. (3.14), we obtain

Q1 = Q2 (3.26)

0 0 (3.27) ηvpDpN = ηvmDmW

0 0 (3.28) ηvpDpN − ηvmDmW = 0

0 ηvmDm (3.29) N − 0 W = 0 ηvpDp

33 It can be concluded by comparing eq. (3.29) and eq. (2.13) that the 1-1 junction is analogous to a gear ratio constraint between the pump and motor shafts with a ratio r and dierence b that can be expressed in terms of hydraulic parameters as

0 ηvmDm (3.30) r = − 0 ηvpDp

b = 0 (3.31)

By replacing eq. (3.30) in gear ratio constraint torque eq. (2.20), the torque required to drive the pump shaft can be expressed as

η02 D2 vp p ¨ (3.32) T1 = 02 2 I3θ1 ηvmDm Moreover, the pressure dierence across the pump can be obtained by replacing eq. (3.32) in eq. (3.1). As a result, the pressure dierence ∆P across the pump can be expressed as η η02 D mp vp p ¨ (3.33) ∆p = 02 2 I3θ1 ηvmDm Similarly, the torque available at the motor shaft to drive a load can be obtained by replacing eq. (3.30) in gear ratio constraint torque eq. (2.21)

η0 D vp p ¨ (3.34) T3 = 0 I3θ1 ηvmDm Moreover, the pressure dierence across the motor can be obtained by replacing eq. (3.34) in eq. (3.9). As a result, the pressure dierence ∆P across the motor can be expressed as

34 η0 D vp p ¨ (3.35) ∆p = 0 2 I3θ1 ηmmηvmDm 3.4.2 1-2 Junction

This is a junction connecting three hydraulic components. To demonstrate the modelling of a 1-2 junction, an example will be analyzed showing the power connec- tion from a pump to two motors.

Figure 3.9: Junction 1-2

Starting with eq. (3.25) and replacing eq. (3.7) and (3.14), we obtain

Q1 = Q2 + Q3 (3.36)

0 0 0 (3.37) ηvpDpN = ηvm2Dm2W2 + ηvm3Dm3W3

0 0 0 (3.38) ηvpDpN − ηvm2Dm1W2 − ηvm3Dm3W3 = 0

0 0 ηvm2Dm2 ηvm3Dm3 (3.39) N − 0 W2 − 0 W3 = 0 ηvpDp ηvpDp 35 It can be concluded by comparing eq. (3.39) and eq. (2.27) that the 1-2 junction is analogous to a dierent gear constraint between the pump and the two motor shafts with a ratios r2 and r3 and dierence b that can be expressed in terms of hydraulic parameters as 0 ηvm2Dm2 (3.40) r2 = − 0 ηvpDp

0 ηvm3Dm3 (3.41) r3 = − 0 ηvpDp

b = 0 (3.42)

By replacing eq. (3.40) and eq. (3.41) in the dierential gear constraint torque eq. (2.33), the torque required to drive the pump shaft can be expressed as

η02 D2 vp p ¨ (3.43) T1 = 02 2 02 2 I2I3θ1 ηvm2Dm2I3 + ηvm3Dm3I2 Furthermore, the pressure dierence across the pump can be obtained by replac- ing eq. (3.43) in eq. (3.1). As a result, the pressure dierence ∆P across the pump is can be expressed as

η η02 D mp vp p ¨ (3.44) ∆P = 02 2 02 2 I2I3θ1 ηvm2Dm2I3 + ηvm3Dm3I2 Similarly, the torque available at both motor shafts can be obtained by replacing eq. (3.40) and eq. (3.41) in the dierential constraint torque eq. (2.34) and eq. (2.35)

η0 η0 D vm2 vp p ¨ (3.45) T2 = Dm2 02 2 02 2 I2I3θ1 ηmm2ηvm2Dm2I3 + ηmm2ηvm3Dm3I2

36 η0 η0 D vm3 vp p ¨ (3.46) T3 = Dm3 02 2 02 2 I2I3θ1 ηmm3ηvm2Dm2I3 + ηmm3ηvm3Dm3I2 The pressure dierence across both motors can be obtained by replacing eq. (3.45) and eq. (3.46) in eq. (3.9). The pressure dierence ∆P across both motors can be expressed as η0 η0 D vm2 vp p ¨ (3.47) ∆P2 = 02 2 02 2 I2I3θ1 ηvm2Dm2I3 + ηvm3Dm3I2

η0 η0 D vm3 vp p ¨ (3.48) ∆P3 = 02 2 02 2 I2I3θ1 ηvm2Dm2I3 + ηvm3Dm3I2 3.4.3 1-n Junction

A model can be created for any junction transferring power between any number of hydraulic components n (Fig. 3.10).

Figure 3.10: Junction 1-n

Following the same approach used in sections 3.4.1 and 3.4.2, the constraint equation between the pump and motors shafts can be expressed as

N + r1W2 + r2W3 + ... + rnWn = 0 (3.49) where ri is a function of the pump and motors parameters.

37 3.4.4 Rotation to translation Junction

The model represented in the previous sections describes power transmission between rotating components. A similar model can be applied to connect rotational and translational components but with a rack and pinion gear analogy. The rack and pinion constraint is similar to the gear ratio constraint except that one of the two generalized coordinates involved is translational.

Figure 3.11: Rack and Pinion

Consider the junction shown in Fig. 3.12 connecting a pump with a hydraulic cylinder. Starting with eq. (3.25) and replacing eq. (3.7) and eq. (3.21), we obtain

Q1 = Q2 (3.50)

0 0 (3.51) ηvpDpN = ηvcAx˙

η0 D vp p (3.52) N − 0 x˙ = 0 ηvcA

38 Figure 3.12: Rotation to Translation Junction

It can be concluded from eq. (3.52) that the rotational to translation junction is analogous to a gear and pinion constraint between the pump shaft and the cylinder piston with a ratio r that can be expressed in terms of hydraulic parameters as

η0 D vp p (3.53) r = − 0 ηvcA

3.5 Pipes

Pipes form the network that connects the components in hydraulic circuits. The volume of uid inside the pipe is not small and as a result compressibility eects cannot be neglected. In this section, an analogy to mechanical systems will be used to model uid inertance, resistance and compliance eects inside a pipe. 3.5.1 Fluid Inertance

Fluid inertance represents the pressure dierence needed to cause a change in the uid ow rate. It is analogous to the force needed to cause a change in the velocity of the uid because it is derived from Newton's second law. The pressure dierence in a pipe can be expressed as

F ∆P = (3.54) A

39 where A is the pipe cross sectional area and F is the force moving the uid in the pipe.

Figure 3.13: Fluid Inertance Analogy

The uid ow rate in a pipe can be expressed as

Q = Avf (3.55)

where vf is the uid speed inside a pipe. The dierential of eq. (3.55) leads to

dQ/dt = Aaf (3.56)

where af is the uid acceleration inside the pipe. Starting with Newton's second law and replacing eq. (3.54), we obtain

F = mf af (3.57)

A∆P = mf af (3.58) where mf is the uid mass inside the pipe which can be dened as

mf = ρLA (3.59)

40 where ρ is the uid density and L is the pipe length. Replacing eq. (3.59) in eq. (3.58), we obtain

∆P = ρLaf (3.60)

Substituting eq. (3.56) in eq. (3.60) leads to

∆P = If dQ/dt (3.61)

where If is the uid inertance dened as

ρL I = (3.62) f A

As a result, uid inertance is derived from Newton's second law. Hence, ow in a pipe is analogous to a body mass in translation. It can be simulated as a rigid body with mass mf constrained with a prismatic joint. 3.5.2 Fluid Resistance

Fluid ow inside a pipe is resisted by viscous shear stresses within the uid and the turbulence that occurs along the internal walls of the pipe caused by the roughness of the pipe material. Fluid resistance results in power losses inside a pipe. The losses depend on the geometry of the pipe and on whether the ow is laminar, turbulent or in the transition state. Pressure drop across a pipe can be expressed using Darcy-Weisbach equation as

∆P = RQ (3.63)

41 where Q is the uid ow rate inside the pipe and R is the pipe resistance which can be expressed as L ρ (3.64) R = f 2 |Q| DH 2A where L is the pipe length, ρ is the uid density, DH is the pipe hydraulic diameter, A is the pipe cross sectional area and f is the friction factor which depends on Reynolds number Re that is used in uid mechanics to predict the state of uid ow. Reynolds number is dened as QD Re = H (3.65) Av where v is the uid speed inside the pipe. The friction factor can be expressed as   Ks for  Re <= ReL  Re  fT −fL (3.66) f = fL + (Re − ReL) for ReL < Re < ReT ReT −ReL    1 for Re <= Re  6.9 r/DH 1.11 2 T (−1.8 log( Re +( 3.7 ) )) where ReL is the Reynolds number at which the uid ow starts the transition phase to turbulent ow, ReT is the Reynolds number at which the ow is fully turbulent, fL is the friction factor at laminar border and fT is the friction factor at turbulent borders. Losses due to bends and ttings can be included in the model by adding their equivalent length to L. Starting with eq. (3.63) and replacing eq. (3.55) and eq. (3.54), we obtain

F = RA2v (3.67)

42 which is analogous to linear viscous damping in a mechanical system where the damping coecient can be expressed in terms of the hydraulic parameters as

b = RA2 (3.68)

As a result, uid resistance eects in a pipe can be simulated by adding damping to the rigid body representing the pipe ow. The damping coecient b is updated at each simulation step as per eq. (3.68) and eq. (3.64) using the uid ow rate value from previous simulation step.

Figure 3.14: Pipe Flow Inertance and Damping Analogy

3.5.3 Fluid Compliance

Fluid bulk modulus βl is an elastic constant representing the amount that the uid volume is reduced for a given pressure rise [13]. It is dened as

∆p β = (3.69) l ∆V/V where ∆p is the pressure dierence, V is uid volume inside the pipe and ∆V is the volume change.

However, the eective bulk modulus βe is a function of the relative gas content and the operating pressure. According to [14], the eective bulk modulus can be

43 expressed as 1 + α( Pa )1/n Pa+P (3.70) βe = βl 1/n Pa 1 + α n+1 βl n.(Pa+P ) n where P is the operating pressure, n is the gas specic ratio and α is the relative gas content at atmospheric pressure Pa. The relative gas content can be expressed as

V α = g (3.71) Vl where Vg is the gas volume and Vl is the liquid volume.

Figure 3.15: Mixture of Gas and Liquid

Fluid is dened as

V C = (3.72) βl

Starting with eq. (3.69) and replacing eq. (3.72), we obtain

∆V ∆p = (3.73) C

Replacing eq. (3.54) in eq. (3.73) leads to

A2 F = ∆x (3.74) C

44 which is analogous to spring stiness in mechanical systems where the applied force and the spring displacement are related by

F = K∆x (3.75) where K is the spring stiness. Hence, the equivalent stiness K can be expressed in terms of hydraulic parameters as

K = A2/C (3.76)

As a result, this model can represent uid compliance eects in a pipe by adding a spring with stiness K between two rigid bodies that represents the uid mass inside the pipe. The uid mass and damping coecient are distributed equally between the two rigid bodies as shown in Fig. 3.16.

Figure 3.16: Pipe Simulation Model

3.6 Valves

A valve is a variable area orice controlled either manually by the operator or automatically based on circuit conditions. It is used to control the power transmission in the system where uid at high pressure passes through a pressure drop caused by

45 the orice. The main objective of this section is to model several types of valves and create their dynamics analogy. 3.6.1 Orice

An orice is a thin plate with a hole in it restricting the uid ow and causing a pressure buildup. The pressure will drop on the other side of the plate as the uid passes through the hole and gains speed.

Figure 3.17: Orice

Based on [15], uid ow through an orice can be dened as

r 2 ∆P (3.77) qvalve = CDA(x) 2 2 0.25 ρ (∆P + Pcr)

A(x) = xAmax, 0 < x < 1 (3.78) where A(x) is the orice hole cross sectional area as a function of x which is the operator input, ρ is the uid density, CD is the ow discharge coecient, ∆P is the pressure drop across the orice and Pcr is minimum pressure for turbulent ow which can be dened as  2 ρ Recrv Pcr = (3.79) 2 CDDH where v is the uid kinematic viscosity, DH is the hydraulic diameter and Recr is the critical Reynolds number at which the uid ow becomes turbulent.

46 The orice can be simulated as a shaft connecting two hydraulic components at its inlet and outlet ports. The connecting shaft has a resistive torque to simulate the pressure build up and power losses in the valve. The resistive torque is proportional to the pressure drop across the orice. For example, if the valve is fully open there will be no pressure drop and hence the resistive torque is zero. If the valve is closed, the resistive torque will be at the maximum causing the shaft to stop and preventing power transmission. The ow going through the valve depend on the valve type and spool position as shown in Fig. 3.18.

Figure 3.18: Valve Flow Versus Spool Position [16]

The valve outlet ow will be calculated from the ow characteristic curve of the valve depending on the spool position and the incoming ow. Then, the pressure drop across the valve can be obtained using eq. (3.18). Finally, the resistive torque can be obtained using ∆P T = T (3.80) r P max

47 where Tmax is the maximum torque that can be transmitted through the valve. It can be calculated using eq. (3.1) if the inlet ow is coming form a pump. The connection between the orice shaft and the inlet and outlet hydraulic components can be represented by a 1-1 junction which is a gear ratio constraint with ratio r = 1 as was described in section 3.4. At each simulation step, the resistive torque applied to the shaft is updated using eq. (3.80). 3.6.2 Directional Control Valve

Directional valves are used to distribute the ow into dierent paths of the hydraulic circuit. In the case of a hydraulic cylinder, it is used to reverse the direction of the ow and hence the piston movement. There are many types of directional control valves. The most common is the 4/3 way directional valve shown in Fig. 3.19.

Figure 3.19: Four Way, Three Position Valve

The spool position will determine whether the valve is closed blocking the ow or the pressure port P is connected to either port A or port B. The other port will be connected to the tank T . If the spool is moved to the right, the ow will be directed to orices PA and BT while if it is moved to the left, the ow will be directed to orices PB and AT .

48 The 4/3 way directional valve can be simulated as a comnination of two orices that were described in the previous section. However, reversing the ow direction is done by changing the gear ratio between r = 1 and r = −1. 3.6.3 Pressure Relief Valve

A pressure relief valve is used to protect the pump from excessive pressure rise in the circuit. Pressure rise can happen because the cylinder is fully extended or fully retracted. It can also be due to a motor overload. The pressure relief valve is a variable area orice with area controlled by the pressure in the system. The valve will remain closed until the pressure exceeds a preset pressure then the valve will open allowing the ow to go to the tank releasing the pressure in the system.

Figure 3.20: Pressure Relief Valve

49 As long as the pressure is below the preset pressure the valve is closed and all the ow goes to the motor. The pressure relief valve orice area can be expressed as   for 0, P < Ppreset   Amax (3.81) A = (P − Ppreset), for Ppreset < P < Pmax  Pmax−Ppreset   for Amax P > Pmax

Assume that the load in Fig. 3.20 is a hydraulic motor. As was described in section 3.4, this is a 1-1 junction and is simulated by a gear ratio constraint with b = 0 when the valve is closed. When the valve is open, the conservation of ow equation can be expressed as

Q1 = Q2 + qprv (3.82) where qprv is the ow going into the pressure relief valve as per eq. (3.77) with valve area calculated from eq. (3.81) based on the pressure value from previous simulation step. Replacing eq. (3.7) and eq. (3.14) in eq. (3.82), we obtain

0 0 (3.83) ηvpDpN − ηvmDmW = qprv

0 ηvmDm qprv (3.84) N − 0 W = 0 ηvpDp ηvpDp It can be concluded by comparing eq. (3.84) and eq. (2.13) that power transmission form the pump to the motor can be simulated by a gear ratio with ratio r and dierence b that can be expressed in terms of hydraulic parameters as

0 ηvmDm (3.85) r = 0 ηvpDp

50 qprv (3.86) b = 0 ηvpDp To control the maximum pressure in the system, the gear ratio constraint can have a maximum limit for the torque that it can transmit. The maximum torque should be equivalent to the maximum pressure set by the pressure relief valve.

Tmax = DpPmax (3.87)

3.6.4 Check Valve

A check valve is a one way valve that allows the ow to go in only one direction. It has a variable area orice where the area is controlled by the cracking pressure due to the pretensioned spring. The valve will remain close while the pressure dierence is smaller than the cracking pressure. The valve will start opening when the cracking pressure is reached. Similar to the pressure relief valve, the area is modelled to change linearly with the pressure as per eq. (3.81).

Figure 3.21: Check Valve

The only dierence is that the shaft is allowed to rotate in only one direction. This is achieved by setting the maximum resistive torque described in eq. (3.80) only when the shaft is rotating in the positive direction. As a result, the resistive torque

51 can be expressed as   ∆P for  P Tmax, w > 0 Tr = (3.88)  for Tmax, w < 0

52 CHAPTER 4 Hydraulic Circuits Modeling and Simulation In this chapter, basic hydraulic circuits that form the building blocks of complex uid power systems will be modelled and simulated. The circuits are simulated using SimHydraulics software which is a Simulink library for modelling and simulating hydraulic systems. The results are used to validate the equivalent mechanical system as per the analogy described in this thesis. The equivalent mechanical system will be simulated using Vortex which is a multibody dynamics engine described in section 2.3. 4.1 Hydrostatic Transmission - One Motor

The circuit presented in this section is formed of a pump, motor and a pressure relief valve. It is used to drive motors in many applications, most commonly as the hydrostatic transmission in heavy duty machinery. The test parameters are shown in Tables 4.1 to 4.4.

Figure 4.1: Hydrostatic Transmission Circuit - One Motor

53 Pump Motor N 188 rad/s 3 Dm 52E − 5 m /rad 3 Dp 5E − 4 m /rad ηvp 0.92 ηvp 0.92 ηt 0.8 ηt 0.8 Pnom 1E7 Pa Pnom 1E7 Pa Wnom 188 rad/s Wnom 188 rad/s µnom 18 cSt µnom 18 cSt Table 4.2: Motor Parameters Table 4.1: Pump Parameters

Pressure Relief Valve

2 Amax 2E − 4 m Hydraulic Fluid

PSet 3E7 Pa α 0.005

3 PReg 5E6 Pa ρ 961.873 kg/m

CD 0.7 v 7.12831 cSt

Recr 12 β 1.23E9 Pa

Aleak 1E − 12 m2 Table 4.4: Fluid Parameters Table 4.3: Pressure Relief Valve Parameters

The equivalent mechanical system of this circuit is formed by two shafts rep- resenting the pump and the motor. The two shafts are constrained with a revolute joint to a xed frame of reference. The power is transmitted from the pump to the

54 motor shaft via a gear ratio constraint with ratio r as per eq. (3.85). Pressure re- lief valve eects are included in the model by updating the gear ratio dierence b parameter as per eq. (3.86) and by setting a limit on the maximum torque that the gear can transmit as per eq. (3.87) in the gear ratio constraint. (This is a feature of constraints in Vortex, and is implemented as a bound on the Lagrange multipli- ers in the solver). The model was simulated using V ortex where the parameters of the constraints are updated at each simulation step based on the current simulation states and operator inputs.

Figure 4.2: Equivalent Mechanical System of One Motor Circuit

The rst set of results shown in Fig. 4.3 is with no load applied to the motor. As expected, the pressure will drop back to zero when the desired velocity is reached. Using the same circuit and adding a damping load to the motor, its velocity decreases while pump pressure increases but it does not exceed the limit set by the pressure relief valve. The results are shown in Fig. 4.4. The response is fast without noticeable transient phase because pipes were not simulated in this system and the applied load to the hydraulic motor shaft was equivalent to a rotational damper. Transient phase will be noticeable if the applied

55 load is equivalent to a spring where the load is proportional to the spring stiness and the shaft angular position. Replacing the damping load with a stiness load, the motor will overload after few revolution and the pressure will not exceed the limits set by the pressure relief valve protecting the pump. Results are shown in Fig. 4.5. Notice that the results between SimHydraulics and our model implemented in Vortex match very well.

56 Figure 4.3: No Load Test Results for One Motor Circuit

57 Figure 4.4: Damping Load Test Results for One Motor Circuit

58 Figure 4.5: Stiness Load Test Results for One Motor Circuit

59 4.2 Hydrostatic Transmission - One Motor with Pipe Losses

The purpose of this section is to simulate and validate the pipe loss model. A pipe is added between the pump and motor of the previous circuit as shown in Fig. 4.6. The additional pipe properties are shown in Table 4.5. The simulation is performed for three dierent pipe length values.

Figure 4.6: Hydrostatic Transmission Circuit - One Motor with Pipe Losses

The equivalent mechanical system of this circuit is formed by two shafts repre- senting the pump and motor, and two rigid bodies representing the hydraulic uid inside the pipe. The two shafts are constrained with a revolute joint to a xed frame

Pipes D 0.01 m L 5 m Leq 1 m r 1.5E − 5 m ReL 2E3 ReT 4E3 n 1.4 Table 4.5: Pipe Parameters

60 of reference. The pipe bodies are constrained with two prismatic constraints to a

xed frame of reference. They are connected by a spring with stiness k as per eq. (3.76). Damping is added to the pipe prismatic constraints as per eq. (3.68). Power is transmitted from the pump to the rst pipe body by a gear and pinion con- straint with ratio r. Pressure relief valve eects are added to the model by updating the gear and pinion constraint dierence parameter b and setting a maximum limit to the force that the gear can transmit. Then, power is transmitted to the motor by another gear and pinion constraint between the pipe second rigid body and the motor shaft.

Figure 4.7: Equivalent Mechanical System of One Motor Circuit with Pipe Losses

The model is simulated with dierent pipe lengths to show the eects of uid inertance, resistance and compliance on the motor velocity. Notice that the pipe uid inertance and resistance eects appeared when increasing the pipe length from

5 m to 10 m as shown in Fig. 4.8 and Fig. 4.9. The motor velocity decreased from 110 rad/s to 80 rad/s. Compressibility eects will start to appear in the form of

61 oscillations by increasing the pipe length to 30 m as shown in Fig. 4.10. Notice that the model captures the oscillations but with an error. The accuracy can be improved by increasing the number of rigid bodies representing the pipe. Having n-bodies of mass mf /n with n-1 springs equivalent to the uid stiness will reduce the error. The number of rigid bodies n depends on the simulation performance and delity requirements.

Figure 4.8: Motor Velocity with 5m Pipe Length

62 Figure 4.9: Motor Velocity with 10m Pipe Length

Figure 4.10: Motor Velocity with 15m Pipe Length

63 4.3 Hydrostatic Transmission - Two Motors

The circuit presented in this section is formed by a pump, two motors and a pressure relief valve as shown in Fig. 4.11. It is similar to the rst circuit presented in this Chapter but with an additional motor to validate the 1-2 junction mechanical analogy. The test parameters are shown in Tables 4.1 to 4.4.

Figure 4.11: Hydrostatic Transmission Circuit - Two Motors

The equivalent mechanical system of this circuit is formed of three shafts rep- resenting the pump and the two motors. The three shafts are constrained with a revolute joint to a xed frame of reference. The power is transmitted from the pump to the motor shafts by a dierential gear constraint with ratios r2 and r3 as per eq. (3.40) and eq. (3.41). Pressure relief valve eects are included in the model by updating the dierential constraint dierence b parameter as per eq. (3.86) and by setting a limit on the maximum torque that the constraint can transmit as per eq. (3.87). The model was simulated using V ortex where the parameters of the con- straints are updated at each simulation step based on the current simulation states and operator inputs. Simulation states include current pressure and ow that aect

64 the dierential ratios and maximum torque that the gear can transmit. Operator in- puts include engine speed and motor displacement in case of a variable displacement motor.

Figure 4.12: Equivalent Mechanical System of Two Motor Circuit

The rst set of results shown in Fig. 4.13 is with no load. As expected, the pressure will drop back to zero when the desired velocities of the two motors are reached. Using the same circuit and changing one of the motor displacements, their velocities will not be same. The results are shown in Fig. 4.14. Using the same circuit and adding damping load to both motors, their velocities decrease while the pump pressure increases but it does not exceed the limit set by the pressure relief valve, as expected. The results are shown in Fig. 4.15. Replacing the damping load with two dierent stiness loads, the motors will overload after a few revolutions and the pressure will not exceed the limits set by the pressure relief valve protecting the pump, as expected. Motors do not stop at the same position as shown in Fig. 4.16 because they have dierent stiness loads.

65 Notice that the results between SimHydraulics and our implementation in Vortex match very well.

66 Figure 4.13: No Load Test Results for Two Motor Circuit

67 Figure 4.14: Dierent Motor Displacement Test Results for Two Motor Circuit

68 Figure 4.15: Damping Load Test Results for Two Motor Circuit

69 Figure 4.16: Stiness Load Test Results for Two Motor Circuit

70 4.4 Hydraulic Cylinder Circuit

The circuit presented in this section is formed by a pump, pressure relief valve, servovalve and cylinder as shown in Fig. 4.17. It is used to actuate mechanisms in many applications, most commonly the boom and bucket mechanisms of an excava- tor. The test parameters are shown in Tables 4.1, 4.3, 4.4, 4.6 and 4.7.

Figure 4.17: Hydraulic Cylinder Circuit

The equivalent mechanical system of this circuit is formed by two shafts repre- senting the pump and the servovalve and a rigid body representing the piston of the cylinder. The two shafts are constrained with a revolute joint to a xed frame of ref- erence and the piston is constrained with a prismatic joint. The power is transmitted from the pump to the servovalve shaft by a gear ratio constraint with ratio r = 1 or r = −1 depending on the spool valve position. Pressure relief valve eects are included in the model by updating the dierential constraint dierence b parameter as per eq. (3.86) and by setting a limit on the maximum torque that the constraint

71 Cylinder A 0.125 m2 P istonStroke 0.5 m Table 4.6: Cylinder Parameters can transmit as per eq. (3.87). Resistive torque is applied to the servovalve shaft de- pending on the pressure drop across the servovalve as per eq. (3.80). Then, power is transmitted from the servovalve shaft to the cylinder piston using a gear and pinion constraint with ratio r. The model was simulated using V ortex where the param- eters of the constraints are updated at each simulation step based on the current simulation states and operator inputs which include the servovalve spool position.

Figure 4.18: Equivalent Mechanical System of One Motor Circuit

The test results are shown in Fig. 4.19, where the operator input for the spool position is emulated with a sinusoidal function opening the valve in both directions.

The load added on the cylinder is of mass m = 100 kg, stiness K = 1000 N/m

72 4-Way Directional Valve 2 Amax 5E − 4 m hmax 5E − 3 m CD 0.7 Recr 12 Aleak 1E − 12 m2 Table 4.7: 4-Way Directional Valve Parameters

and damping d = 100 Ns/m. Note that the results between SimHydraulics and our model implemented in Vortex match very well. In all the simulated hydraulic models, Vortex was running at a xed time-step size of 1 ensuring real-time simulation. However, Simhydraulics was running with a 60 s variable time-step size that was sometimes too small for the sti models that included pipes and applied loads that are equivalent to a spring. Hence, the simulation time was excessive with Simhydraulics.

73 Figure 4.19: Test Results for Hydraulic Cylinder Circuit

74 CHAPTER 5 Application: Front Loader Actuation System This chapter presents the application of the developed hydraulics model to the simulation of a front loader actuation system using Simhydraulics and Vortex. The Simhydraulics model of the loader shown in Fig. A.5 and Fig. A.6 was taken from the Matlab examples that are available online at [17]. 5.1 Hydraulic System

The front loader hydraulic system consists of a pump, a pressure relief valve, two 5/3 way directional valves, two cylinders and six pipes connecting the components as shown in Fig. A.5 and Fig. A.6. The parameters of the components are listed in Tables 5.1 to 5.9.

Pump N 188 rad/s 3 Dp 4.5E − 6 m /rad ηvp 0.92 ηt 0.8 Pnom 1E7 Pa Wnom 188 rad/s µnom 18 cSt Table 5.1: Excavator Pump Parameters

75 Hydraulic Fluid α 0.004 ρ 845 kg/m3 v 5.26 cSt β 1.59E9 Pa Table 5.2: Fluid Parameters

Tilt Cylinder AreaA 0.0035 m2 AreaB 0.0021 m2 P istonStroke 0.42 m Mass 120 Kg BreakawayF rictionF orce 310 N CoulombF rictionF orce 310 N V iscousF rictionCoefficient 120 N/(m/s) Table 5.3: Tilt Cylinder Parameters

Lift Cylinder AreaA 0.004 m2 AreaB 0.0028 m2 P istonStroke 1.2 m Mass 120 Kg BreakawayF rictionF orce 524 N CoulombF rictionF orce 524 N V iscousF rictionCoefficient 120 N/(m/s) Table 5.4: Lift Cylinder Parameters

Tilt Pipes D 0.016 m L 3.5 m Leq 2.8 m r 1.5E − 5 m ReL 2E3 ReT 4E3 n 1.4 Table 5.5: Tilt Pipes Parameters

76 Lift Pipes D 0.016 m L 6.2 m Leq 4.8 m r 1.5E − 5 m ReL 2E3 ReT 4E3 n 1.4 Table 5.6: Lift Pipes Parameters

Tank Return Pipes D 0.016 m L 5 m Leq 1.2 m r 1.5E − 5 m ReL 2E3 ReT 4E3 n 1.4 Table 5.7: Tank Return Pipes Parameters

Excavator Pressure Relief Valve 2 Amax 1E − 4 m PSet 8.5E6 Pa PReg 5E5 Pa CD 0.7 Recr 12 Aleak 1E − 7 m2 Table 5.8: Excavator Pressure Relief Valve Parameters

5/3 Way Directional Valve HoleDiameter 6E − 3 m NumberofHoles 6 CD 0.7 Recr 12 Aleak 1E − 12 m2 Table 5.9: 5/3 Way Directional Valve Parameters

77 5.2 Simulation Inputs

The inputs to the simulation model are the valve spool positions and the load applied to the cylinders. Their values are variable to resemble operating conditions which include operator inputs and changing loads. The tilt and lift valve spool positions are shown in Fig. 5.1 and Fig. 5.2. Tilt and lift loads are shown in Fig. 5.3 and Fig. 5.4.

Figure 5.1: Tilt Valve Spool Position

78 Figure 5.2: Lift Valve Spool Position

Figure 5.3: Tilt Load

79 Figure 5.4: Lift Load

80 5.3 Simulation Results

The simulation results include pump pressure and positions and velocities of both cylinders. As shown in Figures 5.5-5.9, the results match very well between our model implemented with Vortex and Simhydraulics. The only dierence is in the oscillations due to compressibility eects. The model was able to capture the oscillations in pressure and velocities but with an error in the magnitude. The accuracy could be improved by increasing the number of rigid bodies representing the pipe ow. The pipe analogy described in 3.5.3 uses two rigid bodies with a spring between them. Accuracy could be improved by using n rigid bodies in series with n − 1 spring between them. However, additional bodies and constraints will result in increased computational complexity.

Figure 5.5: Tilt Cylinder Position

81 Figure 5.6: Lift Cylinder Position

Figure 5.7: Tilt Cylinder Velocity

82 Figure 5.8: Lift Cylinder Velocity

Figure 5.9: Pump Pressure

83 CHAPTER 6 Conclusions The scope of this thesis is to prove that the concept of simulating hydraulics using multibody dynamics environment is practical. It is then possible to simulate the entire machine dynamics using the same solver instead of simulating hydraulics and multibody dynamics separately. This is benecial because coupling two simulations in real-time is complex and can cause stability issues. For better simulation performance, it is recommended to reduce the number of equations representing the multibody dynamic system. This can be achieved by considering only one degree of freedom of the rigid bodies instead of six for some of the hydraulic components. For example, the uid ow in a pipe is simulated using a rigid body constrained with a prismatic joint. The rigid body dynamics adds six degrees of freedom and the constraint adds ve equations to restrict the motion along all the axs except the prismatic joint sliding axis. By considering only one degree of freedom of the rigid bodies, ve degrees of freedom and ve constraint equations can be removed from the total system equations. This thesis has shown that it is possible to simulate hydraulic systems using a multibody dynamics analogy. An equivalent mechanical system for many hydraulic components was developed. Basic hydraulic circuits that form the building blocks for larger circuits were modelled, simulated and validated using a hydraulics modelling software and a multibody dynamics simulation environment. The model was applied

84 to a hydraulic excavator and the results were satisfactory. Future work would include modelling additional hydraulic components and validating more complex hydraulic circuits.

85 APPENDIX A Simhydraulics Circuits

86 Figure A.1: Hydrostatic Transmission - with one Motor Circuit

87 Figure A.2: Hydrostatic Transmission - with one Motor with Pipe Losses Circuit

88 Figure A.3: Hydrostatic Transmission - with Two Motors Circuit

89 Figure A.4: Hydraulic Cylinder Circuit

90 Figure A.5: Excavator Hydraulic Circuit

91 Figure A.6: Excavator Block Hydraulic Circuit

92 References [1] Corporation, D., Engineered systems in the news, [Accessed February 7, 2016], 2012. [Online]. Available: http://www.dovercorporation.com/globalnavigation/ our-markets/engineered-systems/reducing-the-environmental-impact- of-hydraulic-systems. [2] Pfeier, F., Deregularization of a smooth system - example hydraulics, 2006. [3] Pfeifer, F., Mechanical system dynamics. Springer, 2008, vol. 40, isbn: 978-3- 540-79435-6. [4] Evers, J., More with the lemke complementarity algorithm, Mathematical Programming, 1978. [5] Borchsenius, F., Simulation â¨olhydraulischer systeme. Fortschritt-Berichte VDI, Reihe 8, Nr. 1005, VDI-Verlag D¨usseldorf, 2003. [6] Pfeifer, F., Unilateral problems of dynamics. Springer, 1999. [7] Sjostrom, T., Discrete time variational mechanics of multidomain systems: Applications to coupled electronic, hydraulic, and multibody systems, Dept. of Physics, Umea University, 2012. [8] Lacoursiere, C., Ghosts and machines: Regularized variational methods for interactive simulations of multibodies dry frictional contacts, Dept. of Com- puting Science, Umea University, 2007.

93 [9] Layton, R., Principles of analytical system dynamics. Mechanical Engineering Series Springer-Verlag, 1998. [10] Bara, D. and Witkin, A., Physically based modeling, 2001, Online SIG- GRAPH 2001 Course Notes. [11] Chappuis, D., Constraint derivation for rigid body simulation in 3d, 2013. [Online]. Available: http://www.danielchappuis.ch. [12] Erleben, K., Stable, robust, and versatile multibody dynaimcs animation, PhD thesis, 2004. [13] Akers, A., Gassman, M., and Smith, R., Hydraulic power system analysis. Tay- lor & Francis Group, 2006, isbn: 978-0-8247-9956-4. [14] Manring, N., Hydraulic control systems. John Wile & Sons, Newyork, 2005. [15] Simhydraulics reference, English, Version 1.7, The MathWorks, Inc, 2010. [16] (). Control valves and ow characteristics, [Online]. Available: http://www. engineeringtoolbox . com / control - valves - flow - characteristics - d _ 485.html. [17] Matlab examples, 2016. [Online]. Available: http : / / www . mathworks . com / examples / simhydraulics / mw / sh _ product - sh _ front _ loader - front - loader-actuation-system.

94