Hydraulics Simulation in Matlab

75
Modelling Hydraulics with MATLAB/Simulink for Real-Time Simulation and System Testing Third Year Project Report Philip Foster (Under the supervision of Steve King) Word Count: 14,389 using Microsoft Word ‘Word Count’ (excluding all appendices)

description

Matlab simulation

Transcript of Hydraulics Simulation in Matlab

Page 1: Hydraulics Simulation in Matlab

Modelling Hydraulics with MATLAB/Simulink for Real-Time Simulation and System Testing

Third Year Project Report

Philip Foster

(Under the supervision of Steve King)

Word Count: 14,389 using Microsoft Word ‘Word Count’

(excluding all appendices)

Page 2: Hydraulics Simulation in Matlab

Abstract

One major requirement of the aircraft industry is the complete testing of all systems. Hydraulic systems feature heavily in aircraft, powering the brakes, undercarriage and all of the steering mechanisms. Hydraulic systems conventionally are not modelled in real-time due to the iterative nature of the solutions. A representation of a hydraulic system as an electrical network was investigated. This would allow the creation of real-time modelling software. Real-time simulation would allow increased testing into unpredictable model states, in particular, emergency situations. Accuracy of the model was compared to existing software currently used within the aircraft industry.

Acknowledgments

I would like to thank my supervisor, Steve King, for his support and guidance during this project. Many thanks also go out to Steve Wright for his support before and during this project and all his help during my Industrial Placement at Airbus UK. His help has been invaluable. Finally I would like to thank my girlfriend Gill for her encouragement and for putting up with me during the whole project process.

Page 3: Hydraulics Simulation in Matlab

Table of Contents

1 Introduction .............................................................................. 1

1.1 Background ......................................................................... 1

1.2 Project Aim.......................................................................... 1

1.3 MATLAB/Simulink ................................................................. 2

1.4 Report Structure .................................................................. 2

2 Review ..................................................................................... 4

2.1 Aircraft Industry................................................................... 4

2.1.1 Federal Aviation Administration (FAA) ................................ 5

2.1.2 Joint Aviation Authorities (JAA) ......................................... 6

2.1.3 Hydraulic Regulations ...................................................... 6

2.2 Modelling Tools .................................................................... 7

2.3 Matlab ................................................................................ 7

2.3.1 Simulink ........................................................................ 8

2.3.2 SimPowerSystems........................................................... 9

2.4 Example Hydraulic Systems ..................................................10

2.5 Modelling Hydraulics ............................................................12

2.6 Mathematical Models............................................................12

2.7 Fuel Model..........................................................................13

3 Process ...................................................................................16

4 Model Design ...........................................................................18

4.1 Software Choices.................................................................18

4.2 Initial Ideas ........................................................................18

4.3 Library Design ....................................................................19

4.3.1 The Pump .....................................................................20

4.3.2 The Actuator .................................................................22

i

Page 4: Hydraulics Simulation in Matlab

4.3.3 Other Components .........................................................25

4.4 The Models.........................................................................29

4.4.1 The Simple System ........................................................29

4.4.2 The Standard System .....................................................30

4.4.3 The Extended System.....................................................30

4.5 Configuration......................................................................31

5 Evaluation ...............................................................................32

5.1 Introduction .......................................................................32

5.2 Data Analysis......................................................................33

5.2.1 Model 1 ........................................................................34

5.2.2 Model 2 ........................................................................42

5.2.3 Model 3 ........................................................................47

5.3 Problems with Designs .........................................................52

6 Conclusion ...............................................................................53

6.1 Process Evaluation...............................................................53

6.2 The Product In Industry .......................................................53

6.3 Further Work ......................................................................54

6.3.1 Extra Components in the Model........................................54

6.3.2 Extra System Information ...............................................54

6.3.3 A Graphical User Interface ..............................................55

7 Bibliography.............................................................................56

Appendix............................................. Error! Bookmark not defined.

ii

Page 5: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

1 Introduction

1.1 Background

In all modern military and commercial aircraft, hydraulic systems power the flight controls. When a pilot moves his (or her) controls, whether in a jet fighter, a helicopter or on a Boeing 747, at some point a hydraulic system will be accessed. Power is generated using pumps and is controlled by various devices along the circuit. An example hydraulic system, from the McDonnell Douglas F-15C Eagle [AND00], a tactical fighter, can be seen in Figure 1 on page 11. This shows how complex a simple network can become when back up devices and safety controls are added. For large aircraft there will be many more output components but the system will have the same format.

In the aerospace industry very accurate models are required for all electrical and mechanical systems onboard the craft. These are used to rigorously test all scenarios expected during flight. This includes all the hydraulics systems that are used in the braking and steering controls. For the testing, large test-rigs are configured with the aircraft flight equipment and different states are run to allow safety equipment to be correctly configured. Testing on the systems starts with software models since this is much cheaper and easier to correct than building a full hydraulic system. When test flights are run, the simulated aircraft is modelled in different scenarios, recording results for how the system runs under standard operation and error conditions. In the case of the hydraulics systems some data must be pre-calculated and look-up tables used to allow the model to be run in real-time.

This is not a completely desirable situation as the model can only be tested as far as the recorded scenarios stretch. These pre-calculated results cannot be a complete set for every expected or more importantly every unexpected action that can change the environment. Whilst testing every action is unfeasible, if a model can be run in real-time errors can be introduced to a system and the results calculated as the model runs.

1.2 Project Aim

The aim for this project is to investigate and produce a model of a hydraulics system that can be run in real-time. Currently, hydraulics models cannot be run deterministically due to the effects of the non-compressibility of the liquid in the system. This effect forces the system to calculate all the flows at all junctions within the system simultaneously.

1

Page 6: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

In a large environment the model must deal with many simultaneous equations with the only solution being iterative. In large networks this produces a very irregular run time, since at some points of execution there are only a few calculations but when the whole network is active multiple calculations will slow the system down immensely.

Using ideas currently being developed at Airbus UK, this project is investigating whether linearising the hydraulic equations and using an electrical network to model a hydraulic network will produce a real-time solution. Numerous models need to be designed and created and then compared to existing programs using identical model designs. Each model needs to be thoroughly tested if it is to be used within any industry, especially the aircraft industry.

1.3 MATLAB/Simulink

MATLAB is a software tool created by The Mathworks, designed to make mathematical calculations simpler. Simulink is a tool integrated within MATLAB that uses MATLAB’s software engine and an interactive visual environment to simulate a wide range of different types of systems. There are a large number of add-on packages for the tool that extend the product significantly, including an electrical circuit Blockset.

This tool is widely used in industry due to its multi-domain features and its ability to be integrated within other environments. This makes it ideal to use for a product such as this, especially since the tool is used at Airbus UK and can easily be tested using their systems.

Further details of these products and their uses are discussed in the next chapter.

1.4 Report Structure

The rest of the report is structured as follows:

Chapter 2 studies literature and ideas of modelling hydraulics and the problems found within this field. Also discussed are current modelling tools and the requirements for aircraft modelling.

Chapter 3 describes the modelling process used for this project and how it was applied.

Chapter 4 shows the design and implementation of the model. This includes descriptions of the processes used in developing the model and building up a full working system from individual components.

2

Page 7: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Chapter 5 evaluates how effective the modelling process was and compares the finished product to the initial requirements.

Chapter 6 presents general conclusions to the project, discussing its success. Future work and use for the project in industry is also examined.

3

Page 8: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

2 Review

2.1 Aircraft Industry

Within the aircraft industry there is a need for very accurate modelling. Whilst this may sound obvious there are a large number of standards that need to be attained for an aircraft to be built and flown. From the author’s experience during a sandwich year at Airbus UK, a large period of time is spent creating very accurate models for the different sections and systems on board. For both the fuel and hydraulic modelling processes large software test rig computers are built and used to test the software that is used on the aircraft. These test rigs are built to have the same input and output structure as the final aircraft so that the software can be fully tested. Further tools are built to act as the front and back end of the model.

Tests are run for a wide range of different situations and scenarios to see how the aircraft is predicted to cope. The main purpose for this is to be able to model accurately which signals will be passed around the aircraft between the different electronic devices so suitable solutions can be programmed and automated. This means when the aircraft comes to be built there will be a good idea of how it will behave in all the test situations.

The models are run as quickly as possible from a pre-decided flight plan (i.e. it has already been decided what will happen during the flight) and the results and data are then returned. The models can also be run in real-time, where a “pilot” flies the aircraft and the test-rig is used to simulate how the aircraft will cope with different actions. This is important for satisfying the different aviation regulatory authorities that the aircraft is safe to fly and ensuring certification of the aircraft.

The introduction of fly-by-wire has also increased the need for computer modelling. [AIR04] describes fly-by-wire as an electronically managed flight control system that uses computers to make the aircraft easier and safer to handle. Airbus first introduced the concept to commercial aircraft in 1988 helping it become an industry standard. The fly-by-wire system replaces the mechanical linkages between the pilots’ controls and the “moving surfaces”1 of the aircraft. The process has many advantages, from reducing the weight of the aircraft, resulting in improved efficiency, to added safety features. The computer keeps the aircraft within the

1 These are the movable surface on the outside of the aircraft, e.g. Aileron, Elevator and Rudder.

4

Page 9: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

‘safety protection window’ preventing the aircraft from rolling or pitching too much. Modelling is essential for this to take place to allow the safety window to be created and the necessary procedures to be written to correct a situation where the error bounds are exceeded.

In an aircraft there are many different hydraulic systems that need to be modelled. These include flight controls, landing gear, gear door actuation, nose wheel steering, thrust reversers and braking [AERO04]. Each system has different requirements and has to be modelled and tested in different ways.

There are a number of governing authorities around the world that issue certificates for aircraft design, manufacture and maintenance. They are all variations on the same idea, with the main difference being how widely they are recognised internationally. Many western countries have bodies that are responsible for aviation safety although the Federal Aviation Administration (FAA), based in Washington, and Joint Aviation Authorities (JAA), based in Holland, are the two largest authorities.

2.1.1 Federal Aviation Administration (FAA)

The FAA [FAA04a] is the main governing body for producing regulations that aircraft manufacturers must follow to gain certification for their aircraft. Whilst they are based in America and their slogan is “Bringing Safety To America’s Skies”, they do have international recognition. According to [FAA04b]:

“The FAA will only issue product design approvals to an applicant in a country with which the United States has concluded a bilateral agreement for the export and import airworthiness certification of such products.”

The list of countries within the bilateral agreement is listed on the web page and includes the United Kingdom, which means that they can issue certificates for the approval of British designed and built aircraft.

In principle, the FAA is responsible for the safety of civil aviation in the United States and the countries covered by the bilateral agreement. They have a number of major roles for promoting safety, from air traffic control through to the development of new aviation technology. Safety regulations are issued and enforced by the body, with minimum standards in all areas of aircraft production, operation and maintenance. Aircraft must be certificated in a number of categories throughout the entire production process, including ‘Design Approvals’, ‘Production Approvals for Aircraft, Engines & Propellers’ and ‘Continued Operational Safety’.

To gain a certificate to produce even one test aircraft many conditions must be fulfilled. There are 6 phases which the FAA tests on, as listed on [FAA04b]:

5

Page 10: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

1. Partnership for Safety Plan 2. Conceptual Design and Standards 3. Refined Product Definition and Risk Management 4. Certification Project Planning 5. Certification Project Management 6. Post Certification

The agency produces regulations known as FAR’s (Federal Aviation Regulations) for aircraft manufacturers to follow. These provide a full list of regulations for all areas of aircraft design, listing everything that must be satisfied for certification to be granted. Advisory Circulars (AC’s) are also produced which provide guidance for demonstrating compliance with the regulations. These AC’s are not mandatory but are derived from FAA and industry experience in determining compliance with the ‘Code of Federal Regulations’ (CFR). They include extracts from regulations and illustrate common practices in which manufacturers have complied with the regulations

2.1.2 Joint Aviation Authorities (JAA)

The JAA2 is based in Holland and is Europe’s equivalent governing body for aircraft safety. They have a similar remit to the FAA with similar regulations and licensing powers. Like the FAA, their authority extends only to the current member countries. Luftrecht Online [LUF04] describes the JAA as a body representing a number of European states as their civil aviation regulatory authority. They have an agreement to co-operate with developing and implementing common safety regulatory standards. Although the founding 10 Member States signed the agreement it has no specific status under international law.

2.1.3 Hydraulic Regulations

There are many regulations that are covered by the FAR’s that are associated with hydraulics. These vary in form and type of requirement and are not always directly linked with hydraulic systems but are connected with the steering and braking structures. Confirmation comes from the AC’s: for example, AC 25.753-1 [FAA04c] gives an example of how the aircraft manufacture can show compliance with the braking system requirements for certain transport aircraft. The document provides links to all the relevant FAR documents. Example regulations include stopping distances for the aircraft and back up braking systems.

2 The JAA is soon to be renamed the European Aviation Safety Agency (EASA)

6

Page 11: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

2.2 Modelling Tools

There are a large number of available software programs for modelling hydraulic systems. Some of these are specifically designed for the purpose whilst others have the ability to model a number of environments in a large range of areas. Companies tend to avoid reliance on one single piece of software for their modelling, but will use a range of software packages, each being the best available for its given field.

[ADI04] gives a range of available software programs that are used in the hydraulic modelling field. This project is not examining the way the tools are used nor comparing different results, but rather at how a different modelling technique can used to provide a real-time simulation, something that all of the “off-the-shelf” tools are unable to supply. The availability of the software and experience needed to use the tools also needs to be taken into consideration. Each of the tools is different in style and use and they vary in the way in which they can be integrated with other tools.

A common feature of all the tools is they cannot produce a deterministic hydraulic model. This is due to the nature of hydraulic systems and hydraulic fluids that are used within systems. In most circumstances there is no actual need for real time modelling especially since the tools can calculate the data from the model and store the characteristics in look-up tables that can then be used within real time modelling. The only situation where it would be useful for real time data calculations to take place is when there are a very large number of different states for the model to be in. If the system is highly complex not all the data can be generated resulting in inaccuracies during run-time. During run-time, if the software does not have the data within its look-ups tables then it will estimate a value based on its closest known results.

From [JOS02], the general-purpose software applications Matlab and Adams™ [ADAMS04] can provide a framework, which can be used to create a specific hydraulic system simulation package. There is another category of specialised packages, which includes Hypneu and Easy5. They are configured for specific hydraulic systems but are not suitable for a complex system like aircraft hydraulics. This project will limit itself to only using two of these tools, AdamsTM for the comparison data production and Matlab to produce the new model. Refer to Section 4.1 for further information regarding the choice of software.

2.3 Matlab

MATLAB (Matrix Laboratories) is very powerful mathematical software package used by a large number of companies to test a wide and varied

7

Page 12: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

range of systems. The Mathworks website [MAT04a] refers to the product as

“a high-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numerical computation.”

As is suggested by the name, Matlab is a matrix and vector based program, with fast processing of matrix computations, linear equations and similar calculations. One point to note though is that Matlab does use finite-precision arithmetic to solve its mathematical equations that produces approximate solutions. This is less accurate than other methods but is not comparable due to other significant differences within the tool.

Matlab is also able to interact with other types of software and can execute code written in different programming languages as well as its own, built in scripting/programming language.

2.3.1 Simulink

Simulink is an icon driven simulation and modelling tool that runs on top of the Matlab environment. The sales literature on the Mathworks website [MAT04b] for the software describes the tool as:

“Simulink is a platform for multidomain simulation and Model-Based Design of dynamic systems. It provides an interactive graphical environment and a customizable set of block libraries…

…Simulink is integrated with MATLAB, providing immediate access to an extensive range of tools for algorithm development, data visualization, data analysis and access, and numerical computation.”

[UCSD04] provides a useful overview of Simulink. It describes the software package as a way to model, simulate and analyse dynamic systems. The package has support for linear and non-linear systems, and modelling can also use continuous time, sample time or a mix of the two. There is also the option to have multi-rate systems, where different sections have different sampling rates.

Simulink uses block graphics to represent flow diagrams for the world being modelled. These blocks provide a simple way of simulation, avoiding all the coding needed if just Matlab is to be used. This interface allows models to be displayed on screen, in the same format as they would appear if drawn with pen and paper, thus making the whole process highly user friendly. The models are designed to be hierarchical so can be designed and built using both top-down and bottom-up approaches.

The whole software package has many benefits, one of which is the block libraries that can be purchased for the tool. Standard tools include many different sinks, sources, linear and non-linear components and connectors.

8

Page 13: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

These allow a large number of different systems to be modelled. There already exist a number of third party packages available for Simulink that model hydraulics that have been designed by Mathworks working with other companies worldwide. These provide most of the needed hydraulic components to create a very good model although, like other software, all the processes involved cannot be run deterministically.

Since MATLAB and Simulink are integrated, the model can be simulated, analysed and revised in either environment at any point.

2.3.2 SimPowerSystems

SimPowerSystems [MAT04c] (formerly known as Power System Blockset) is a Simulink library toolbox developed to extend Simulink to model basic electrical circuits and detailed electrical power systems. It is designed for aiding development of self-contained power systems. This tool uses Simulink’s solver to produce accurate simulations. The model also can be used for real-time simulation using ‘discretization’ [MAT04c]:

“Discretization simulates your system with fixed time-step trapezoidal integration, and is especially effective for power system models that include power electronic devices. This mode also facilitates the execution of your model in real time.”

Real time simulation is an important aspect of modelling especially if designing automated systems. In an automated system the controlling computer must be able to react to many different situations and make decisions based on a continually changing environment.

A fundamental concept of real-time simulation is the need for fixed iteration step sizes. In complex stiff systems like large electrical circuits, or hydraulics models, the usual approach is to use a variable step solver. With a system that has the ability to use a fixed step size, although the accuracy of the model can suffer, real-time modelling is feasible.

From [SWJ04], SimPowerSystems automates state-space matrix creation. Hydraulics Blocksets do exist, but none is capable of being translated to real-time code. An abstraction wrapper library can be written around electrical components to produce a hydraulic model. The two main advantages of this system are a general solution to all network conditions can be designed and there is fast development by use of high-level tools. Disadvantages are piecewise linear approximation of non-linear components and large computational effort for the solver.

9

Page 14: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

2.4 Example Hydraulic Systems

Most hydraulic system designs are confidential, whether for commercial or military aircraft so identifying examples of complete systems is difficult. However, [AND00] provides information about the McDonnell Douglas F-15C Eagle tactical fighter. Detail is given for a number of advanced design concepts used within the aircrafts hydraulics system.

The Hydraulic Systems consist of three independent systems: Power Control 1 (PC-1), Power Control 2 (PC-2), and Utility. PC-1 and PC-2 systems power the primary flight controls and the Utility system supplies all other requirements, plus back-up for stabilator longitudinal and roll control, aileron roll control, and rudder directional control. Hydraulic power is available to maintain adequate and safe control for flight and landing with only one of any of these three systems operational.

The block diagram shows the various subsystems in the "A" and "B" circuitry of the PC-1, PC-2, and Utility systems. In the Utility system, the "A" circuit lines are primarily on the left side of the aircraft and the "B" circuit is primarily on the right-hand side. This improves the likelihood of the aircraft surviving when under gunfire. Any one of the three hydraulic systems can maintain a supply of hydraulic pressure to the entire control system. It can be seen from figure 1 that as a result of the hydraulic supply to the flight controls crossing over between left and right engine driven pumps, and being driven through RLS circuitry and switching valves, there is multiple redundancy of hydraulic supply to the F-15 primary flight control components varying according to different emergency situations.

Features of the system include sensing equipment for the pressure of the system, preventing any leakage if a pipe is ruptured, Switching Valves that check the system pressure whilst preventing the loss of fluid further down the system, plus many features for preventing air leakage into the system. The principles of the system remain the same as any other aircraft despite these additional specifications.

10

Page 15: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 1 - F-15 Hydraulic System from [AND00]

11

Page 16: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

2.5 Modelling Hydraulics

Hydraulic systems are complex and are difficult to model due to the properties of the hydraulic fluid, namely the bulk modulus3. As the fluid is pushed and pumped around the network the pressures and flows need to be calculated for all the relevant sections. Since all the flows at all the junction points are dependent on the pressures in the pipes, which in turn are dependent on the flows and pressures at the other junction points, this is an iterative calculation.

In, for example, a fuel system model for an aircraft, the fuel is less dense than hydraulic fluid, which makes modelling easier. This is because a less dense fluid compresses when under pressure causing a notable delay between a pump being turned on and fuel flowing through an open valve somewhere else on the aircraft. This gives the software modelling the fuel network time to calculate all the necessary flows and can remove any loops in the calculations.

[INT04] refers to a number of cases in which the bulk modulus is a very important factor and should be considered when designing a model. If air is trapped in the system, unpredictable results may occur since gas is highly compressible. This causes dampening in the network. The overall system pressure can vary the bulk modulus, as shown in [WAT89]. Temperature can also affect the bulk modulus so this factor will also need to be considered in a system.

[MEC04] looks into the modelling of an automated steering system for an off-road vehicle. They used Matlab/Simulink to model their hydraulics systems for an ideal world and then ran tests using an actual vehicle to draw comparisons. This required real-time modelling so a mathematical model was used instead of a hydraulics block set. This works fine but stops the model being easily used for different scenarios and is confined to the scope of the design.

2.6 Mathematical Models

The basis of hydraulic models is the underlying mathematical equations that are being used to describe the system. According to [PFEI03], there are some key equations that are used when simulating a hydraulic model. In this paper, Pfeiffer and Borrchsenius describe these equations and a different method to try and simplify the modelling process. They also discuss the problem of the bulk modulus and how best to simplify the non-linear differential equations.

3 The compressibility of the fluid

12

Page 17: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

In physical modelling, “mathematical models are based on balancing equations and constitutive relations (static relations between quantities)” [KTH04]. With regards to hydraulics, the model needs to develop a relation between pressure and flow. The areas that need modelling are pipes, where a pressure drop drives a flow, tanks, where flow is stored, and items to provide a flow resistance. At junctions or connections the flows must sum to zero and all the pressures must be equal.

In [HAE02] basic hydraulic principles are discussed. Many of these are not relevant for a system such as aircraft hydraulics but are worth noting in the event of minor discrepancies in results. Concepts such as the flow of liquid through the pipes can have different results depending on the type of flows. Laminar flow is characterised by smooth, predictable streamlines, and turbulent flows are erratic and unpredictable. In the connecting tubes of aircraft hydraulics systems, the cross-sectional area should be small enough to make effect like these negligible.

Loss of energy due to friction is a basic principle that should not be ignored as negligible. According to [HAE02] there are many equations that approximate the friction losses associated with the flow of a liquid through a given section. In this paper they are generalised into a single equation for the mean velocity of the fluid in a channel.

2.7 Fuel Model

During the author’s time on placement year at Airbus UK, he worked on a fuel model system. This software has been designed to model a fuel system in real-time for future aircraft produced by the company. This software is proprietary and cannot be published externally from Airbus UK but the general concepts are useful. The model uses new techniques to model a large fuel network in real-time. The model is large and very complex but makes use of libraries to simplify many sections. Details of this model are from [FSP04]. The idea of this system is to apply the SimPowerSystems Blockset to create a fuel simulation program. SimPowerSystems is an electrical modelling library but can be utilized to model a fluid network since most of the features have parallels between the two environments. Refer to section 2.3.2 for further details on SimPowerSystems.

Fuel networks are generally pressure driven fluid flow networks and in the case of aircraft have multiple sources and sinks. To calculate the resulting flows of such a network requires multiple simultaneous equations to be created and solved. Using the SimPowerSystems Blockset, Simulink allows automatic generation of the state-space matrices needed to solve the network flow equations. The electrical network that is produced allows accurate, real-time modelling of the flows within a fuel network.

13

Page 18: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

This is an improvement on the previous simulation programs that relied on pre-calculated flows in look-up tables

As with any model there are approximations. Within the Fuel Simulation Program, the pressure is modelled as voltage, flow as current and conductive elements as resistors. For a deterministic model there cannot be any iterative equations so all elements are assumed to have a linear Pressure/Flow relationship. Most fuel systems display properties of increasing resistance with increasing flow. Bi-linear approaches can be made, where there are two linear equations with a switch over point. This increases accuracy but has further complications that require advanced techniques to solve.

The issue of bi-linear approximations is interesting. With a linear approach, a straight line is used to approximate a curve. The case where this would be applied is where the flow of the system is changing, i.e. a pump has just been switched on. Obviously this is not a very good model and depending on the situation the results could be useless. In a bi-linear model, two straight-line equations are used to approximate the curve, which improves the situation greatly, and in the case of the fuel system, is sufficient to generate accurate results. Generally the switch over between zero and full fuel flow is only a few seconds so not much accuracy is lost through this approximation. The problem occurs when the graph reaches the cut-off point, the join between the two equations. Hysteresis causes the value to jump between the two different equations, over-stepping the boundary. In some cases the jump will be corrected by reducing the size of the next iteration. This causes the value to be lowered to below the cut-off value, which in turn will make the value jump up again. This creates a large fluctuation in the system. See Figures 2 and 3 for examples of these situations.

One solution is to have two cut-off boundaries, one for the increasing value and one when it is decreasing. This can still result in the occasional erroneous results though. Another idea is to increase the iteration speed of the model although this will increase the computational power required and slow the system down.

A third solution is to use a Simulink S-Function block, where C-code is used to perform calculations. This is much more powerful than just using Simulink blocks and allows extra checks on the system. The main purpose is to remove the problem of hysteresis by adding in extra logical checks for the system. A check is used to confirm the switch between equations to prevent invalid results using a confirmation time for each cycle.

14

Page 19: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 2 - Infinite Oscillating Error

Figure 3 - Jumping Error

15

Page 20: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

3 Process During this project the Waterfall Model for systems development was followed. This model was chosen as it is a fairly simple process to follow and has a number of useful advantages. The whole process is structured in a rigid format, enforcing a disciplined approach to the project. Testing occurs regularly throughout the design and implementation allowing regular checking and improvements to be included. There are a number of different interpretations of the Waterfall Model; the version being followed is described by Adrian Als and Charles Greenidge [ALS03]. This is slightly different from the commonly used Sommerville version in that there is an iterative approach between all neighbouring states. In Sommerville the only iterative phase is from the final stage to all the previous stages.

Figure 4 - Waterfall Model from [ALS03]

16

Page 21: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

There are disadvantages with this process compared to other models but are not significant for this particular project. The problem of the iterative process generally found with this model is solved using [ALS03]. The inflexible process here is not an issue due to the small size of the project, the concise plan and the topic. The project has engineering roots so the structure can be followed easily. The problem of having errors or infeasible tasks that are not detected until the process is complete still remains. The linearity of the design process was suitable in this case. The rigid structure is useful for this project, from the initial designs and ensuring the systems is fully tested to the need for maintenance and allowing the product to be used in different environments.

There are six separate stages to this model, “Requirements Analysis”, “Specification”, “System and Software Design”, “Implementation and Testing”, “Integration and Systems Testing” and “Maintenance”. The aim of the first stage, requirements analysis, was specifying the goals and identifying the constraints. This was decided during the initial project proposal and ideas stage. The specification phase was merged with the requirements analysis since the size of the project is not large and a separate stage was not required here. Most versions of the waterfall model have these stages combined.

System and software design is shown in the “Model Design” chapter. The software was created from the system specification. The main consideration was software architecture and how to ensure that the model would be useful as a product. This required the model to make use of libraries, as all the individual components would be required separately if re-used on actual aircraft design. The modelling tools used also needed consideration when designing the system.

The ‘implementation and testing’ and ‘integration and systems testing’ phases show the translation of the designs into software. Both these two phases are shown in the “Model Design” chapter. The testing focuses on identifying errors and ensuring that the specification has been met. Individual units are then combined and tested as a complete system to ensure the whole product meets the system requirements.

The maintenance phase shows how the product can be changed to meet the customers needs, adapted for different environments, enhanced and any undetected errors corrected.

17

Page 22: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

4 Model Design Using MATLAB three simple hydraulic models were designed with increasing complexity. The designs for these three different are described in this chapter. These models aim to show how the techniques used for fuel modelling (see section 2.7) could be adapted for use in hydraulic modelling, particularly within the aircraft industry.

4.1 Software Choices

MALAB was chosen as the software to use for this product for a number of reasons. There are many different applications that could have been used but were not chosen. The main reason for this was how MATLAB is used and how applicable its use is for this project. MATLAB is widely used because it can be adapted for many different situations. It has the ability to add Blocksets into the package or extend the libraries in-house as well as its compatibility with many different programming languages.

This project idea has been derived from the author’s experiences within Airbus UK, with one of the aims to compare the model against current techniques at this company. MATLAB is widely used within Airbus UK and the author has experience using the software. This saved much time having to learn the interface of a new environment. Access to the software involved was also a major consideration and having full access to MATLAB and all the required Blocksets made the choice simple.

MATLAB fits all of these requirements so was picked. There may be other packages that are also suitable for the project but for the timescale and size of this project finding and learning how to use them would not be productive. Since the use in industry of MATLAB is so wide it is assumed that it is the best choice.

4.2 Initial Ideas

From looking at an overview of an aircraft’s hydraulic system [AND00] a simple hydraulics model can be drawn up. On an aircraft, the most common scenario of hydraulics has a pump to supply the pressure into the system and multiple actuators on the output. On all systems there exists a back up pump in case of failure. There are many other features within a full system, with accumulators for storage of pressure, to supply instant power to an actuator when required, valves, flow regulators and pressure reducers. There will also be numerous safety features in the system, with checks to ensure all components are fully functional.

18

Page 23: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Using these ideas a simple system can be drawn up. The key features for a system are the inputs and outputs. The other components are not required so for simplicity the initial models do not make use of them. The components that were used were created individually in a library module in Simulink before being inserted into different systems for testing.

4.3 Library Design

In Simulink, creating a new library is a simple process. Each component is a sub-system within a standard Simulink model. These sub-systems can then just be dragged-and-dropped into other models. The library model is then locked and the user must specifically unlock the block before changes can be made. This prevents accidental changes to the components of the library.

Figure 5 - The Main Hydraulic Library

19

Page 24: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

4.3.1 The Pump

The pump system requires two inputs and one output. The inputs are the pressure of the hydraulic fluid in the pipe system flowing into the pump, and the on/off switch. The output is the pressure of the fluid leaving the pump. The pump block also contains local variables located within the system, giving details about its configuration. The values for these variables are set in the initialisation file.

The variables are:

PumpSwitchTime: Time taken for the pump to open. This allows the system to model the increasing flow within the system whilst the pump turns on.

PumpOnPressure: The pressure that the pump generates and adds to the system when fully switched on.

PumpOffPressure The pressure the pump supplies when switched off.

PumpZeroPressureFlow The flow through the pump when the pressure is zero.

PumpInternalResistance The resistance to the system caused by the pump. This is calculated from PumpOnPressure and PumpZeroPressureFlow.

PumpOnDelay Used for testing to allow the model to switch the pump on and off after the pump after a specified delay.

The system has two sections. The first calculates how fast the pump is currently running by counting up from 0% to 100% on each cycle of the simulation. This is necessary since the pump will not switch from ‘Off’ to ‘On’ instantaneously, but will take a few seconds to power up and be able to produce full pressure and output a maximum flow. This is all calculated using standard Simulink mathematical blocks.

The main block that calculates the pump speed is a Switch block. This block outputs two different values depending on the value of the second input, and the On/Off input to the block. If the switch is on, the pump will ramp up to a maximum flow using the PumpSwitchTime variable. This value is passed through two blocks before it reaches the switch. The first is a Saturation block that is used to prevent a ‘Divide by Zero’ error on the next block. This is implemented using two values for the upper and lower limits for the value passed through the block. These are both set in the

20

Page 25: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

initialisation file InitModel.m, and are 1e9 for the upper bound (InfiniteTime) and the sample time MainSamplingTime/10 for NearZeroTime. These values are required for systems such as this where the values passed between functions range greatly. In any system, divide-by-zero errors need to be avoided and at the upper end, the values need to be bounded to prevent values being divided by near infinite values, where rounding errors will create divide-by-zero errors.

This value is then passed to a Math Function block that takes the reciprocal of the time, to find the period. This is simply the change to the pump’s rate on each iterative step of the model. This value is then passed into the switch. The ‘On’ side takes this value and the ‘Off’ side takes the value after it is passed through a Gain block, with a value of ‘-1’ to negate the period, representing the pump turning off. The value is then passed into a ‘Zero Order Integrator’ block before being linked to the main pump model.

The ‘Zero Order Integrator’ block calculates the actual percentage that the pump is switched on. This is required to have a loop, so the model can store the value of the pump’s state. To allow the loop to successfully run, a Unit Delay block is required. This block outputs a reset value on the first iteration to initialise the loop. The initial condition in this case is the pump is switched off. A saturation block is used to limit the pump to being able to run between 0 and 1, preventing the pump outputting greater than 100% of its power or running with a negative flow. The value that is passed out of the block is the sum of the input value with the value from the previous iteration. A gain block is used to change the input value from seconds to a value relative to the iteration of the model, the MainSamplingTime. The output of this, PumpUnitPressure is passed to the second section of the pump, where the actual pressure is calculated.

Figure 6 - The 'Zero Order Integrator' Block

21

Page 26: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

The second section uses the SimPowerSystems Blockset and models the pressure of the system as a voltage. This voltage is then passed out from the block. The Pump pressure is taken as the PumpOnPressure multiplied by PumpUnitPressure, the rate that the pump is working at. The pump pressure is then used as the input to a Controlled Voltage Source block. This converts the Simulink value to a voltage value. This voltage is then passed out of the block via a resistor, representing the internal resistance of the pump.

Figure 7 - The 'Pump' Block

4.3.2 The Actuator

The actuator comprises of two sections, a Piston Block, that opens when a pressure is applied to it, and a Spring Block, that applies a back force to the piston. From [ENG00], a simple hydraulic actuator can be seen. This is a typical design so was used as a basis of this model. The input to an actuator is the hydraulic fluid, and the result of this is the movement of the piston. By dividing the actuator up into the two individual components, extra inputs and outputs were required for the interaction between the components.

Information about the location of the piston must be passed to the spring so that it can calculate how much pressure it is exerting back on the piston head. This backpressure is then passed back to the piston where

22

Page 27: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

the movement of the piston is calculated from the force being applied by the pump and the backpressure.

Figure 8 - Hydraulic Actuator from [ENG00]

The Piston Block takes two inputs; the pressure into the system and the backpressure applied from the Spring Block. The only output is the position of the piston head, showing how compressed or extended the actuator is.

The variables used in this block, initialised in the InitModel.m file are:

PistonLength The length of the piston.

PistonDiameter The diameter of the piston head.

PistonArea: The area of the piston head. This allows the model to calculate the position of the piston head and calculate how extended the actuator is. Calculated from PistonDiameter.

PistonVolume: The volume of the whole piston i.e. how much hydraulic fluid the piston can contain before being fully opened. Calculated from PistonLength and PistonArea.

InitialPos The starting position of the piston.

23

Page 28: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

InitialPressure Initialises the Unit Delay block for the system pressure.

PistonInletResistance The resistance caused by the inlet of the piston.

InitialVolume Used to initialise the ZeroOrderIntegrator, calculated using PistonArea and InitialPos.

The piston, like the pump, is controlled by a voltage source. There are two sections again, one to calculate how much the piston has moved and one to generate the voltages and measure the current. These represent the pressure and flow in the system.

There are two pressure sources in the block, one from the main input to the pump and one from the Spring Block. The backpressure from the spring is passed into a Controlled Voltage Source block via a Delay block. This is used to break the loop in the system, initialising the pressure/voltage in the system. The second pressure input is passed through a Universal Bridge Block, which forms part of an internal loop in the piston. This loop prevents the piston being able to open further than the maximum length. This block, set as a one-arm bridge with an ideal switch, will switch off the circuit once the piston has reached its maximum length.

The pressure of the system is measured using a Current Measurement Block from the SimPowerSystems Blockset. The output value is then integrated (using a Zero Order Integrator Block) to calculate the total volume within the piston. The position of the piston is then calculated from the volume within the piston by dividing the volume by the area of the piston head. The volume is prevented from exceeding the maximum possible volume by using a simple Boolean ‘Is greater than’ comparison. If the piston is calculated as full, the Universal Bridge Block halts the flow through the system, preventing any increase in the volume of fluid in the piston.

24

Page 29: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 9 - The 'Piston' Block

The Spring Block is a simple mathematical calculation using a Simulink ‘Gain’ Block. This just applies a proportional force to the pressure, such as a spring would when under pressure. This output is passed through to the Piston Block.

Figure 10 - The 'Spring' Block

4.3.3 Other Components

The other main components in the simple models comprise of pipes and junction blocks. These are simple devices that just add resistance to the system, which is the only effect that either device has that we are

25

Page 30: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

interested in. There are also a number of other components that are not included in the library but feature in the model.

Junctions There are two types of junction in the model, one is a simple T-Junction, with one input and two outputs and the other has two inputs and two outputs. These junctions were modelled using a “perfect” connection, where there is only negligible resistance. It was assumed that the resistance in the junction is minimal compared to that of the rest of the circuit considering the pressures involved and the dimensions of the pipes.

Figure 11 - Junction with 1 Input and 2 Outputs

Figure 12 - Junction with 2 Inputs and 2 Outputs

26

Page 31: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Pipes A pipe is modelled as a resistance. This resistance depends on the length and diameter of the pipe. Other factors that could be considered are the materials being used and their effect on the resistance, but this is assumed negligible in these examples as the material being used would be identical throughout the system.

Two pipes were designed, one pipe with a fixed length and diameter as the feed pipe into the pump and a second that was used around the models which had its properties varied.

Figure 13 - The 'Pipe' Block

Supply The Supply block in the models is the source of the hydraulic fluid. It is assumed that the system cannot run out of hydraulic fluid, since the maximum volume of the system will be known before construction. This means the block can be modelled as an infinite source, which makes the block much simpler. A SimPowerSystems block ‘Ground’ is used, which provides a virtual connection to ground in an electrical circuit. In this case, it symbolises an infinite source of fluid.

Figure 14 - The 'Supply' Block

27

Page 32: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Step Block A ‘Step’ block is used as the switch for the pump. This is simply for testing and removes the need to design a model wrapper. This block has an initial value and after some time delay switches to a final value. The initial value of ‘0’ represents the pump being switched off. After a delay time of ‘PumpOnDelay’, a variable set in the initialisation file, the block outputs a value of ‘1’ for the pump being switched on.

Figure 15 - Parameters for the Step Block

Auxiliary Components A ‘Flowtap’ component is required in the models to extract data from the system. This is simply a Current Measurement block that measures the current at a particular point in the circuit. This is the measurement of flow at that point in the circuit. This measurement can then be passed to standard Simulink blocks, such as a Scope for analysis.

A ‘Scope’ is used for data analysis. This block produces a graphical display of the input data and provides the option to save the data to the main MATLAB environment.

The models all require an additional block to be inserted into the main model page. The ‘Powergui’ block, from the SimPowerSystems blockset allows the electrical system to be ‘discretized’, giving the solution a fixed time step, essential for real-time simulation. The model parameter MainSamplingTime is passed into this block fixing the simulation’s time step to this value.

28

Page 33: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

4.4 The Models

These models build up the testing process from an initial basic model to more complicated models. The simple model has no serious use in a real world setting but is used for testing. The second model shows the standard system, although it has many features missing from a full aircraft hydraulic system. The third model shows a system with two inputs and two outputs. This system is the crucial one as it is a significant advance from typical fluid networks. The iterative nature of most networks prevent this systems being solved deterministically due to the constant change in more than one input to the circuit.

4.4.1 The Simple System

Initially, a simple system was created, just to test that the individual components all worked. This consists of one pump and one actuator working in a linear system. This system should just be used to test configuration details and show each of the individual components works and produces accurate results.

Figure 16 - The Simple System

29

Page 34: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

4.4.2 The Standard System

The second model is of the standard system. The extra component in this system is the junction that divides the flow from the pump into the two actuators.

Figure 17 - The Standard System

4.4.3 The Extended System

The third model shows an erroneous system where there are two pump sources. This would only occur if the system had an error and both the main and secondary pump switched on. Since this is a very unlikely situation due to the number of tests that are applied to the system, not much time is spent modelling the results. This is a situation however that does require modelling, as does any disaster situation.

Each component within the model was created in a library that allows re-use. Simulink has a built in process for helping library design. This allows blocks to be created and then inserted into different systems, or many times into the same system. The advantage of this approach is obvious, with updating the models much easier, errors and bugs being easier to trace and fix.

30

Page 35: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 18 - The Extended System

4.5 Configuration

The model was designed for easy configuration. This allows the model to be easily changed and so increases the ease of re-use. MATLAB allows models in Simulink to be passed variable information that is initialised when the model is run. This means that the information for a wide range of parameters can be edited without changing the actual model.

In the case of this hydraulics model, the main variables changed for each model are the properties for the pipes and for the system pressure. A large number of other variables are stored within this file, which is run at the MATLAB command prompt, either manually or through a script. These range from the model’s iteration speed to the stiffness of the spring within the actuator.

The full file, “InitModel.m” is listed in the appendix.

31

Page 36: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

5 Evaluation

5.1 Introduction

Each model was tested using script files written in MATLAB, outputting data for analysis in a spreadsheet.

Initially the time-step, MainSamplingTime, was set to 0.01s but this caused problems with over-stepping the maximum length of the piston. This was noticed before actual testing was performed, notably before the spring backpressure was configured. When the model was on its final iteration, when the guard on the piston was hit, the model would perform one final calculation before preventing further expansion of the piston. As can be seen on the graph below, when the time step was set to 0.01s, the originally intended iteration speed, the over-step is large. By reducing the time step to 0.001s this error is reduced significantly, from 5.3mm to 0.9mm respectively. This is an advantage provided that the shorter time step does not cause the model to significantly slow down, which on a model of this size is not a problem.

Figure 19 - Graph showing the difference in results when using different timestep values.

This is discussed further in the Problems with Designs section below.

32

Page 37: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

5.2 Data Analysis

Most of the variables used within the initialisation file remain constant throughout testing but some were changed to give a number of different situations. The main variables that were set during the testing phase are:

MainSamplingTime: 0.001s

Pipe Values

PipeLength: 1m, 5m, 10m

PipeDiameter: 0.005m, 0.01m, 0.02m

PumpOnPressure: 1e7 Pascal, 3.8e6 Pascal.

Actuator Values

InitialPos 0.2m

PistonLength 0.5m

SpringSitffness 6e7 Newtons

During the rest of the report, 1e7 Pascal will be referred to as HP, High-Pressure, and 3.8e6 Pascal will be referred to as LP, Low-Pressure.

These values were chosen to give a representation of different outputs that could occur. Models were created with Adams™ software and used identical values in their simulations. When the system is run, the piston is opened until equilibrium is reached with the spring in the actuator. The point of equilibrium is determined by the stiffness of the spring and the pressure the pump exerts on the system. Varying the pressure changes how far the piston moves, a higher pressure causes the piston to move further.

According to [FSP04], for the testing of the Airbus FSP software, when numerical analysis was performed, typically a 5–10% variation is permitted from the corresponding comparison package. Inaccuracies are expected since the model is simplified to allow real-time functionality and is concentrating on only a small part of the system.

33

Page 38: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

5.2.1 Model 1

The first model was used as the main test suite, to check whether the data produced were reasonable. The configuration of the model was checked and various inputs to the model were altered as a result.

Testing was performed to check that the various equations in the initialisation file were correct, including calculation of the resistances with the pipes and other components. The pump and piston resistances were set to negligible levels since the resistance within the pipes is dominant. This resistance varies with the length and diameter of the pipe.

Since a huge quantity of data was output from the models during simulation, certain variables needed to be chosen to be part of the comparison. The Adams™ model could be set up to output data about the flow rate and pressure in and out of every component as well as the position and velocity of the piston at every time-step of the model. For the first model, produces six different sets of data, with 10,000 individual values. The most important of these values is the actual position of the piston since all the other values just contribute to this value. This is the final product of the system; the other values are just useful for testing and analysis of the model.

The first positive point to notice about the model is that the piston opens to virtually the correct position. When not rounded to 3s.f. the difference between the models is only 0.000659m, or just over half a millimetre. The percentage difference for the value is 9.98e-5. This shows that the model produces a correct final result. Comparing the time taken to open is the next stage.

The data table below shows a summary of the position of the piston at second time steps. This data is for three different cases, when the diameter of the pipe was varied. The length and pressure of the system were kept the same for these values, at 1m and HP (1e7 Pa). The results from Adams™ are taken to be the correct value for the position of the piston at the given time. This is due to the Adams™ model being used widely in industry and will have been tested against real world models.

34

Page 39: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Time (s)

MATLAB Model Piston Position for various pipe diameters Adams™ Model Piston Position for

various pipe diameters

0.005m 0.01m 0.02m 0.005m 0.01m 0.02m

0 0.200 0.2 0.2 0.200 0.2 0.2

1 0.387 0.408 0.408 0.371 0.409 0.409

2 0.407 0.408 0.408 0.408 0.409 0.409

3 0.408 0.408 0.408 0.409 0.409 0.409

4 0.408 0.408 0.408 0.409 0.409 0.409

5 0.408 0.408 0.408 0.409 0.409 0.409

6 0.408 0.408 0.408 0.409 0.409 0.409

7 0.408 0.408 0.408 0.409 0.409 0.409

8 0.408 0.408 0.408 0.409 0.409 0.409

9 0.408 0.408 0.408 0.409 0.409 0.409

10 0.408 0.408 0.408 0.409 0.409 0.409

Table 1 – A summary of results from Model 1, comparing the position of the piston against time.

Using the complete set of results (rather than just the summary above) for these three model tests, the mean difference values are:

Pipe Diameter 0.005m 0.01m 0.02m

Mean Difference (m) 0.00204 0.00106 0.00211

Mean Percentage Difference 0.711 0.407 0.823

Table 2 – The differences in piston positions between the MATLAB and Adams models.

This data comparison is not very useful. In table 1, the piston opens too quickly to make many useful observations. The averages of the data (table 2) show that the model does produce good results for the short pipe length over all three diameters. The percentage difference of the model is minimal.

35

Page 40: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

The mean difference values are calculated using the MATLAB model results minus the Adams Model results, so a positive values implies the MATLAB model opens the piston faster than the Adams model, and vice versa for the negative values.

The table below compares the data produced for the three different pipe lengths at HP and d=0.005m.

Time (s)

MATLAB Model Piston Position for various pipe lengths Adams™ Model Piston Position for

various pipe lengths

1m 5m 10m 1m 5m 10m

0 0.200 0.200 0.200 0.200 0.200 0.200

1 0.387 0.268 0.237 0.371 0.295 0.268

2 0.407 0.318 0.269 0.408 0.358 0.321

3 0.408 0.352 0.296 0.409 0.392 0.359

4 0.408 0.373 0.318 0.409 0.405 0.384

5 0.408 0.387 0.337 0.409 0.408 0.397

6 0.408 0.395 0.352 0.409 0.409 0.403

7 0.408 0.400 0.364 0.409 0.409 0.406

8 0.408 0.403 0.373 0.409 0.409 0.408

9 0.408 0.405 0.381 0.409 0.409 0.408

10 0.408 0.407 0.387 0.409 0.409 0.409

Table 3 – A summary of results from Model 1, comparing the position of the piston against time.

Using the complete set of results (rather than just the summary above) for these three model tests, the mean difference values are:

Pipe Length 1m 5m 10m

Mean Difference (m) 0.00204 -0.0194 -0.0443

Mean Percentage Difference 0.711 -5.23 -12.0

Table 4 – The differences in piston positions between the MATLAB and Adams models.

36

Page 41: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Table 4 shows that the mean difference for the new model is not very significant when the pipe is 1m long, with 2mm as an average distance. The percentage difference is significant for the 10m length pipe and would not be able to be used uncorrected. Whilst 4.4cm is a small value for the difference, when the piston was only moving approximately 21cm, from a starting position of 20cm to a final position of 40.9cm it is a much larger percentage.

This is of concern since in the aircraft the pipe lengths will probably be longer than 10m and the difference increases significantly with the length. The main cause for this will be the equation for calculating the resistances in the pipes, since this is the only place where the pipe length features. This equation is not simple to solve and has many other factors involved in calculating a value for the resistance of a length of pipe.

Looking at all of the results for this model, tables 5 and 6, this trend continues. For the smallest and middle length piping, the accuracy is good, with the percentage difference being very low. As the pipe diameter increases though, the accuracy does too. For the 10m length of pipe with the diameter at 0.02m the average difference between the two positions of the piston is only 2mm.

Difference between the MATLAB model and the Adams™ model.

L=1,

d=0.005 L=5,

d=0.005 L=10,

d=0.005 L=1,

d=0.01 L=5,

d=0.01 L=10,

d=0.01 L=1,

d=0.02 L=5,

d=0.02 L=10,

d=0.02

Mean Difference (m)

0.00225 -0.0192 -0.0441 0.00127 -0.00614 -0.0161 0.00232 0.000135 -0.00261

Mean Percentage Difference

0.788 -5.17 -12.0 0.491 -1.61 -4.20 0.924 0.129 -0.654

Table 5 – The difference between the MATLAB and Adams models for all HP scenarios.

L=1,

d=0.005 L=5,

d=0.005 L=10,

d=0.005 L=1,

d=0.01 L=5,

d=0.01 L=10,

d=0.01 L=1,

d=0.02 L=5,

d=0.02 L=10,

d=0.02

Mean Difference (m)

-0.00204 -0.0126 -0.0205 -0.000570 -0.00376 -0.00724 -1.7E-05 -0.00086 -0.00195

Mean Percentage Difference

-0.832 -5.12 -8.35 -0.227 -1.51 -2.92 0.00316 -0.346 -0.780

Table 6 – The difference between the MATLAB and Adams models for all LP scenarios.

37

Page 42: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphical output of the results confirms these results showing that when the pipe is short the accuracy is good and as the length increases the accuracy decreases. Comparing figures 20 and 21, it is easy to see that as the pipe diameter increases the accuracy also increases. It can be seen that as the pipe diameter is increased the piston opens quicker.

The other comparison is to look at the trends with the pipe lengths, keeping the diameter constant. This shows what happens during the simulation more clearly, that as the pipe length is increased the piston opens slower. Figures 22 and 23 show the 1m long pipe looks out of place but it is proportionally much shorter than the difference between the other two lengths. The results are similar to the Adams™ results although it is possible to see that the wider pipes are less accurate than the 0.005m diameter pipe.

In a comparison between the HP and LP mean percentage difference, shown in tables 5 and 6, all the values have a similar range. There are a few outliers where the HP value is higher than the LP as generally they are similar. There is no trend as to where the outliers occur. For d=0.05m and d=0.01m the occurrence is with the longest pipe length but for the widest pipe the unexpected values occur with the shortest pipe length.

The standard deviation for the differences between the models is 0.0335 for the HP tests and 0.00840 for the LP tests. This shows that the accuracy for the LP simulations is much higher although overall the standard deviation value is low. The total variance from the mean difference is minimal. The LP system has a lower standard deviation value as the piston is moving a shorter distance. This implies that 95% of the values are within 0.101m for the HP simulations and only 0.0252m for the LP simulations.

Generally all the results are within a 5% error margin of the Adams results, only three of the eighteen simulations exceed this lower error bound, and only one of these is greater than 10% from the Adams output.

38

Page 43: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 20 - Graph showing the piston position against time for the MATLAB model, HP and L=1m.

Figure 21 – A graph showing the piston position against time for the Adams™ model, HP and L=1m.

39

Page 44: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 22 - A graph showing the piston position against time for the MATLAB model, LP and d=0.005m

Figure 23 - A graph showing the piston position against time for the Adams™ model, LP and d=0.005m

40

Page 45: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

By looking at the full set of graphs, which are listed in the appendix, it is possible to see that the trends between the sets of graphs are similar. This shows that throughout the model’s simulation the model produces similar results, rather than results that just average out over time to produce a good average. By producing a similar curve on the graph to the Adams results the model shows that it does work, just not as accurately as required.

Another point for observation for the model with regards to accuracy is the time scale for the model solutions. The worst cases are when the pipe length is longest and the diameter is narrowest. This case gives the longest time for the piston to open. Often the time for the piston to open fully is longer than the 10 seconds of simulation. This effect is likely to be a by-product of the faults mentioned with the pipe resistance equations but could be a separate issue. More testing would be required to decide whether this is the case or not.

The same initialisation file, with no alterations, was then used in the tests for Model 2 and Model 3.

41

Page 46: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

5.2.2 Model 2

Looking at the second set of examples as used for Model 1, where the pressure is set to HP, and diameter is 0.005m and the pipe length is varied, it is clear that the model does not produce accurate results. For these results, the 10m pipe has the worst difference. However, both the 1m and 5m length pipes have an 8% difference, which is a significant increase in the errors from Model 1.

In this model there are three pipe blocks used, the flow is effectively flowing through two lengths of pipe. When the pipe length is set to 1m the fluid is flowing through 2m of pipe between the pump and each of the actuators. This means that any errors with the pipe resistance equation regarding the length of the pipe will be effectively doubled.

Time (s)

MATLAB Model Piston Position for various pipe lengths Adams™ Model Piston Position for

various pipe lengths

1m 5m 10m 1m 5m 10m

0 0.200 0.200 0.200 0.200 0.200 0.200

1 0.304 0.225 0.213 0.260 0.238 0.228

2 0.360 0.248 0.225 0.306 0.270 0.252

3 0.387 0.269 0.237 0.339 0.298 0.274

4 0.399 0.287 0.248 0.362 0.320 0.294

5 0.404 0.304 0.259 0.377 0.339 0.311

6 0.407 0.318 0.269 0.388 0.353 0.326

7 0.408 0.331 0.278 0.395 0.365 0.339

8 0.408 0.342 0.287 0.400 0.375 0.350

9 0.408 0.352 0.296 0.403 0.382 0.359

10 0.408 0.360 0.304 0.405 0.388 0.367

Table 7 – A summary of results from Model 1, comparing the position of the piston against time.

Using the complete set of results (rather than just the summary above) for these three model tests, the difference values are:

42

Page 47: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Pipe Length 1m 5m 10m

Difference (m) 0.0263 -0.0279 -0.0452

Percentage Difference 8.09 -8.38 -14.3

Table 8 – The differences in piston positions between the MATLAB and Adams models.

The results displayed in tables 7 and 8 show a decrease in accuracy for the 1m pipe compared to Model 1, but it is still the most accurate of the three different pipe lengths. The 10m pipe’s accuracy is now considerably outside the 5-10% suggested to be an allowable error margin.

The full set of difference results are shown below. Only the shortest pipe fully opens during the 10 second simulation, which allows a large percentage difference to occur.

Difference between the MATLAB model and the Adams™ model.

L=1,

d=0.005 L=5,

d=0.005 L=10,

d=0.005 L=1,

d=0.01 L=5,

d=0.01 L=10,

d=0.01 L=1,

d=0.02 L=5,

d=0.02 L=10,

d=0.02

Mean Difference

(m) 0.0261 -0.0280 -0.0453 0.00564 -0.0171 -0.0461 0.00708 0.000176 -0.00850

Mean Percentage Difference 8.00 -8.44 -14.3 1.70 -4.69 -12.2 2.29 0.0400 -2.33

Table 9 – The difference between the MATLAB and Adams models for all HP scenarios.

L=1,

d=0.005 L=5,

d=0.005 L=10,

d=0.005 L=1,

d=0.01 L=5,

d=0.01 L=10,

d=0.01 L=1,

d=0.02 L=5,

d=0.02 L=10,

d=0.02

Mean Difference

(m) -0.00498 -0.0192 -0.0212 -0.0015 -0.0113 -0.0166 3.59E-05 -0.00263 -0.00582

Mean Percentage Difference -2.06 -8.00 -8.98 -0.619 -4.55 -6.77 0.0137 -1.07 -2.34

Table 10 – The difference between the MATLAB and Adams models for all LP scenarios.

43

Page 48: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Looking at tables 9 and 10, it can be seen that, once again, the results dramatically improve when the pipe width increases. There is still a trend on which of the pipe lengths are accurate, although the whole set of data seems to have been shifted. The piston now opens more slowly for all the pipe lengths in comparison to the Model 1. This can be put down to the extra pipe blocks in the model. Overall more of the results from the difference calculations are negative so generally the piston is just opening more slowly in the MATLAB model, but as there are some exceptions. This means that that whilst the problem still probably lies within the pipe resistance calculations, other areas may be producing errors.

There are some odd results when comparing the differences between the HP and LP simulations. Unlike in Model 1 over half of the results have a mean percentage difference with significant variation between the HP and LP systems. In this system the pressure seems to affect the accuracy, but this is likely to be due to the total time taken for the piston to fully open. There is no common trend to show that by varying the pressure the precision of the model will be affected although more testing would be required to confirm this.

Figures 24 and 25 show that there are some large inaccuracies. The results for the wider pipes appear to be quite accurate although the time taken for the piston to open is small.

Since the junction block is modelled to be a perfect, resistance free connector, rather than applying a resistance, errors may be occurring. Also, any errors with the pipe resistance equations (as mentioned for Model 1) will be doubled in these models so it is not easy to check other areas for problems unless the pipe equations are improved.

For this model the average standard deviation value for the differences between the two models is 0.0420 for the HP simulations and 0.0107 for the LP simulations. This is worse than for model 1 but is still a low variation.

The majority of the results lie within 5% of the Adams results, and of these there is still only one value that exceeds the 10% upper bound.

44

Page 49: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

These are graphical outputs showing some of the results from Model 2. The full set of graphs is listed in the appendix.

Figure 24 - Graph showing the piston position against time for the MATLAB model, HP and L=1m.

Figure 25 - Graph showing the piston position against time for the Adams™ model, HP and L=1m.

45

Page 50: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 26 - Graph showing the piston position against time for the MATLAB model, LP and d=0.005m.

Figure 27 - Graph showing the piston position against time for the Adams™ model, LP and d=0.005m

46

Page 51: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

5.2.3 Model 3

Once again we will look at the same set of examples as for Model 1, with pressure set to HP, diameter at 0.005m and the pipe length varied.

Time (s)

MATLAB Model Piston Position for various pipe lengths Adams™ Model Piston Position for

various pipe lengths

1m 5m 10m 1m 5m 10m

0 0.200 0.200 0.200 0.200 0.200 0.200

1 0.337 0.239 0.219 0.287 0.255 0.240

2 0.387 0.272 0.237 0.341 0.298 0.274

3 0.402 0.300 0.254 0.372 0.330 0.303

4 0.407 0.323 0.269 0.390 0.353 0.326

5 0.408 0.341 0.283 0.399 0.370 0.344

6 0.408 0.356 0.296 0.403 0.382 0.359

7 0.408 0.368 0.308 0.406 0.390 0.370

8 0.408 0.377 0.318 0.407 0.396 0.379

9 0.408 0.384 0.328 0.408 0.400 0.386

10 0.408 0.390 0.337 0.408 0.403 0.391

Table 11 – A summary of results from Model 1, comparing the position of the piston against time.

Using the complete set of results (rather than just the summary above) for these three model tests, the mean difference values are:

Pipe Length 1m 5m 10m

Mean Difference (m) 0.0169 -0.0221 -0.0500

Mean Percentage Difference 5.17 -6.38 -14.8

Table 12 – The differences in piston positions between the MATLAB and Adams models.

47

Page 52: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

The data for this model shown in table 11 is marginally more accurate than for Model 2. The fluid still only flows through two pipes, so the inclusion of the extra pump to the system has not made the system function any worse than before. Once again, only the shortest pipe here opens the piston up to the equilibrium point so there is room for error but the slight increase in the accuracy could be due to the slightly quicker average solution time to the model.

The full set of comparison data is shown below.

Difference between the MATLAB model and the Adams™ model.

L=1,

d=0.005 L=5,

d=0.005 L=10,

d=0.005 L=1,

d=0.01 L=5,

d=0.01 L=10,

d=0.01 L=1,

d=0.02 L=5,

d=0.02 L=10,

d=0.02

Mean Difference (m) 0.0169 -0.0221 -0.0500 0.00397 -0.0113 -0.0321 0.00484 0.000258 -0.00544

Mean Percentage Difference 5.17 -6.38 -14.8 1.21 -3.09 -8.50 1.58 0.0750 -1.49

Table 13 – The difference between the MATLAB and Adams models for all HP scenarios.

L=1,

d=0.005 L=5,

d=0.005 L=10,

d=0.005 L=1,

d=0.01 L=5,

d=0.01 L=10,

d=0.01 L=1,

d=0.02 L=5,

d=0.02 L=10,

d=0.02

Mean Difference (m) -0.00333 -0.0168 -0.0227 -0.000970 -0.00764 -0.0125 5.65E-05 -0.00173 -0.00382

Mean Percentage Difference -1.37 -6.92 -9.42 -0.399 -3.07 -5.07 0.0236 -0.701 -1.53

Table 14 – The difference between the MATLAB and Adams models for all LP scenarios.

The results are a mixture of negative and positive differences, show that the model produces results either side of the Adams results, opening the piston both quicker and slower under different simulation conditions. As the diameter of the pipe gets wider the set of results shift towards a positive difference. Here the overall solution time is quicker, leaving less time for the model to produce inaccurate results. Likewise, when the length of the pipe is shortest the results are more accurate, due to a quicker solution time.

Looking at figures 28 and 29 the shapes of the graphs are similar although the MATLAB model opens the piston quicker in all three of these conditions. The LP simulation results shown in figures 30 and 31 appear

48

Page 53: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

much closer, although the MATLAB model opens the piston slower in these situations.

For model 3, the standard deviation for the difference between the two models for the HP simulations is 0.0390 and is 0.00988 for the LP simulations. This is an improvement from model 2 and is almost as good as the results from model 1. This implies that 95% of the results are within 0.117m for the HP simulation and only 0.0296m for the LP simulation.

Overall the percentage difference is good, with once again a majority of results within 5% of the Adams results and only one falling outside 10%.

49

Page 54: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 28 - Graph showing the piston position against time for the MATLAB model, HP and L=1m.

Figure 29 - Graph showing the piston position against time for the Adams™ model, HP and L=1m.

50

Page 55: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Figure 30 - Graph showing the piston position against time for the MATLAB model, LP and d=0.005m

Figure 31 - Graph showing the piston position against time for the Adams™ model, LP and d=0.005m

51

Page 56: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

5.3 Problems with Designs

During the testing of these models some problems with the system were noticed.

As mentioned before, there is a fundamental problem with the model when over-stepping the maximum length of the piston. During normal simulation, where the piston does not reach its full length, this is not a problem. In situations where the piston does reach its maximum length the iteration of the model means that the system will overstep the maximum length by one step before preventing the model from moving the piston any further. By reducing the iteration time-step of the model to 0.001 seconds this overstep becomes negligible, but this does not remove the problem. This is a problem with sampled systems and has no true solution. Extra checks could be inserted using the previous iteration as a check but this would not guarantee prevention of over stepping the maximum piston length.

By using a time-step of 1ms, an extra 10 calculations need to be included for the system to run. Whilst using simple models this is not noticed but in a full system with many more components this might become a problem. One solution is to use a faster, more powerful machine to solve the model. This is not always possible though. Testing would be required to find out the computational requirements for the system.

Currently the system uses a junction block that models perfect behaviour with negligible internal resistance. Obviously this is not true. It was assumed that throughout the system the resistance caused to the system by the junction was minimal in comparison the rest of the circuit. An improvement to this design would be a benefit to the system.

Comparisons between the first model and the second two are not ideal, as the Pipe block component appears a different number of times. This block is the least accurate and further testing needs to be carried out to improve the resistance equation. Testing could also be carried out where only one pipe length or diameter is varied and the remaining pipe blocks have fixed resistances.

52

Page 57: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

6 Conclusion Analysis of the model shows that it is possible to model a simple hydraulic network with fairly good accuracy. More work does need to be performed to improve the pipe component and to improve the accuracy. Real-time simulation is also achieved by using the discrete solver within the Simulink environment. This is provided as part of the SimPowerSystems functionality. Since real-time simulation is achieved, the main purpose for the investigation, it is successful, although improved accuracy would be required for actual use within industry.

6.1 Process Evaluation

During the project the Waterfall Model was followed as a systems development process. This process worked fairly successfully setting out the main targets for the process. Since the project was fairly small, the requirements and specification stages were easily met without problems. The design and implementation phases would have had problems if there were not a feedback loop allowing updates. When starting to implement some of the features a few of the designs needed to be updated, especially when looking at the internal loops to some of the library blocks.

Integrating the models together did not have any problems and due to the design maintenance should not be a problem. By setting out clearly the aim for the project initially through the requirements, the other stages were completed smoothly. For this project this version of the Waterfall Model was successful.

6.2 The Product In Industry

If the product were to be used in Industry a number of alterations would be essential. Steve Wright, from Airbus UK, has said that to turn this model into a fully functional product for use in their test suites the following would be required. An interface layer is needed to produce the signals to allow the interactions between the hardware test suite and software. Scalability would have to be tested to ensure the product could cope with a full system rather than just a few components in the model. Finally, for testing, a full ‘Regression Test Suite’ would have to be built and run on the final system, checking all of the individual components work and are initialised correctly, to testing the full system in a number of preset environments. The other features mentioned below in Further Work would also be required.

53

Page 58: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

6.3 Further Work

During the design of the model some additional work and ideas were conceived that would enhance the project. The most obvious extension is the inclusion of more components in the library block, to allow a wider set of models to be created. Storing and calculating more information within the model would produce a system able to simulate more diverse situations as well as increasing accuracy. Creating a graphical user interface for simulating the system would increase the usability of the system, making it more practical to use.

6.3.1 Extra Components in the Model

For the model to be a viable product, the inclusion of other, major hydraulic components would be required. Some components that would be required for a full system are values to switch on and off the flow to various parts of the system, accumulators to store energy and provide instantaneous pressure through the system, much like a capacitor does in an electrical circuit. Many safety features would be required too to test out a system fully.

6.3.2 Extra System Information

For a full system, properties of the surrounding environment would need to be taken into account. The temperature of the system, fluid properties and modelling flow in 3D could all have effects on the system as a whole.

On an aircraft, temperature would vary significantly depending on the height of flight and speed of travel. Internally, temperature also varies depending on proximity to engines, the cabin or leading edges of the wing. The hydraulic fluid behaves differently at different temperatures, so even the insulation of the pipes would affect the model. Fluids expand as temperature increases, so could cause erroneous results if the system were significantly hotter or cooler than the simulation. By introducing an extra parameter and passing it through the system, the heat value could be measured and kept track of. The model already uses volume as a measurement of the fluid rather than mass so this could be implemented without too many problems.

The fluid properties, namely the density, have a major effect on the system. Density is linked to the temperature of the fluid, but also effects how compressible the fluid is. In hydraulics, compressibility is not a positive characteristic but all fluids can be compressed depending on the pressure exerted upon them. It would be an advantage to be able to model the compressibility to some degree of accuracy, thus enhancing the overall accuracy of the model.

54

Page 59: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Modelling fluid flow in three dimensions, rather than assuming horizontal flow would affect properties of the system. This would take into account the aircraft orientation since during take-off and landing the angle of the aircraft with respect to gravity varies extensively. Since gravity does play a major part in the movement of objects, if a flow of fluid were assisted by gravity there would be some increase in kinetic energy. Designing a model for a 3D world would be very difficult. If flow were to be modelled for the changing pitch or roll of the aircraft as well as the initial 3D environment of the system within the aircraft, there would be many factors that would need to be included. A representation would need to be created to allow the position of components and, for items like pipes, a gradient would need to be known. Tests would then need to be performed to check how this actually affects the system so the model’s equations could be edited.

6.3.3 A Graphical User Interface

A Graphical User Interface, or GUI, would be necessary for a fully functional system. MATLAB provides the ability to produce an exportable code through the sub-component Real-Time Workshop. This product generates and executes C code from Simulink models for the testing of systems. Using an integrated product would allow the full functionality to be easily converted into a usable and useful application. It is also possible to use the C code generated to compile an application on other operating systems or hardware platform. Once the code has been produced it can be plugged in to a designed GUI application. This also allows the system to be updated easily.

55

Page 60: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

7 Bibliography [ADAMS04] http://www.mscsoftware.com/products/products_detail.cfm?PI=435

Product details for Adams/Hydraulics software. Last accessed on .

[ADI04] http://www.adi.com/pdfs/AircraftIntegration.pdf - Paper on Aircraft Development. Last accessed on 06 Nov 04.

[AERO04] T. Gerkens, G. Fritsch, C. Seyffert, J. Büttner, I. Mugtussidis and I. Morrish (2004). The Iron Bird for the Fairchild-Dornier 728. Aerospace Science and Technology 8 (2004) 231–243.

[AIR04] http://www.airbus.com/media/fly_by.asp - Information on fly-by-wire process. Last accessed on 06 Dec 04.

[ALS03] Adrian Als & Charles Greenidge, 2003 - http://scitec.uwichill.edu.bb/cmp/online/cs22l/waterfall_model.htm - Waterfall model. Last accessed on 10 Feb 04.

[AND00] Robert S. Andrews, Senior Engineer, Hydraulic Design. Details of the hydraulic system of an F-15 jet. http://www.f15sim.com/operation/f15_hydraulic_system.html - Last accessed on 23 Feb 05.

[ENG00] http://www.engineersedge.com/hydraulic/hydraulic_actuator.htm - Details about hydraulic actuators. Lat accessed on 23 Feb 05.

[FAA04a] http://www.faa.gov - The main Federal Aviation Administration web page. Last accessed on 25 Nov 04.

[FAA04b] http://www.faa.gov/certification/aircraft/original_design_approval.htm - Guide on Original Design Approval Process. Last accessed on 08 Dec 04.

[FAA04c] AC 25.735-1. Brakes and Braking Systems Certification Tests and Analysis. Advisory Circular document produced by the FAA.

[FSP04] Steve Wright, Airbus UK, 2004, “A380 FCMS Test Rig High Level Design for Fuel Simulation Program (FSP)”.

[HAE02] Computer Applications in Hydraulic Engineering: connection theory to practise. Haestad Methods, Inc. Haestad Press 2002.

[INT04] K. Wu, Q. Zhang and A. Hanson (2004). Modelling and identification of a hydrostatic transmission hardware-in-the-loop simulator. Int. J. Vehicle Design, Vol. 34, No. 1.

[JOS02] Ashok Joshi, Jayan, PG., "Modeling And Simulation Of Aircraft Hydraulic System", AIAA Modelling and Simulation Conference and Exhibit, 05-08 August 2002, Monterey, CA, USA.

[KTH04] Principles of Physical Modelling, March 14 2004. Lecture by Mikael Johansson from KTH Royal Institute of Technology, Stokholm. Published at http://www.s3.kth.se/control/kurser/2E1282/lectures/lec02.pdf. Last accessed on 08 Dec 04.

56

Page 61: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

[LUF04] http://www.luftrecht-online.de/english/jaa.htm - Information on JAA. Last accessed on 11 Feb 05.

[MAT04a] http://www.mathworks.com/products/matlab/ - Overview of Matlab software. Last accessed on 01 Nov 04.

[MAT04b] http://www.mathworks.com/products/simulink/ - Overview of Simulink software. Last accessed on 01 Nov 04.

[MAT04c] http://www.mathworks.com/products/simpower/ - Overview of SimPowerSystems Blockset. Last accessed on 30 Nov 04.

[MEC04] Q. Zhang, D. Wu, J. F. Reid and E. R. Benson (July 2002). Model recognition and validation for an off-road vehicle electrohydraulic steering controller. Agricultural Engineering Department, University of Illinois at Urbana –Champaign, Urbana, IL 61801,USA.

[PFEI03] Friedrich Pfeiffer and Fredrik Borrchsenius. New Hydraulic System Modelling (2003). Institute for Applied Mechanics, Technical University of Munich.

[SWJ04] Steve J Wright (Aug 2004). SJW Bath Symposium.

[UCSD04] http://www-ccs.ucsd.edu/matlab/toolbox/simulink/c01_get1.html#1950 - Information about Simulink from University of California. Last accessed on .

[WAT89] Watton, J. (1989). Fluid Power Systems: Modelling, Simulation, Analog and Microcomputer Control, Prentice-Hall, Englewood Cliffs, NJ.

57

Page 62: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Appendix

MATLAB file: InitModel.m

% Initialisation for Hydraulics Project Model

% Add common directory to path, to allow library to be accessed

CurrentDir = pwd;

% Sampling periods

MainSamplingPeriod = 0.001; % 1 msecs

% Switching levels for devices

DiscreteSwitchOn = 1.0; % Volts

DiscreteSwitchOff = 0.0; % Volts

DiscreteSwitchThreshold = 0.5; % Volts

% Constants and translation factors

TypicalFluidDensity = 797.0; % kg/m3 [Supplied in Flowmaster model]

SecsPerHour = 3600; % sec/hr [Physical constant]

SecsPerMin = 60; % sec/min [Physical constant]

Mins2Secs = SecsPerMin; % sec/min [Physical constant]

Litres2CubeM = 1/1000; % Translate litres to m^3 [Physical constant]

kpl2kpm3 = 1/Litres2CubeM; % Translate kg/litre to kg/m3 [Physical constant]

PerMin2PerSec = 1/SecsPerMin; % Translate per-min to per-sec [Physical constant]

PerSec2PerMin = SecsPerMin; % Translate per-sec to per-min [Physical constant]

PerSec2PerCycle = MainSamplingPeriod; % Translate per sec to per-cycle

PerCycle2PerSec = 1/PerSec2PerCycle; % Translate per-cycle to per-second

PerMin2PerCycle = PerMin2PerSec * PerSec2PerCycle; % Translate per-min to per-cycle

lpm2mps = Litres2CubeM/Mins2Secs; % Translate litres/min to m3/sec

lpm2kps = lpm2mps * TypicalFluidDensity; % Translate litres/min to kg/sec

Pascal2Bar = 1/100000; % Translate Pascals to bar

Bar2Pascal = 100000 % Translate bar to pascals

BarPerLpm2PascalPerMps = Bar2Pascal/lpm2mps; % Translate bar/lpm to pascal/m3ps

BarPerLpm2PascalPerKps = Bar2Pascal/lpm2kps; % Translate bar/lpm to pascal/kps

Pi = 3.1415926; % Mathematical Constant

% General infinite values [Selected to avoid calculation saturation]

InfiniteVolume = 1e9

InfiniteLevel = 1e9;

57

Page 63: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

InfinitePressure = 1e9;

InfiniteFlow = 1e9;

InfiniteResistance = 1e9 * BarPerLpm2PascalPerKps;

InfiniteTime = 1e9;

% General near-zero values [Selected to avoid calculation saturation]

NearZeroResistance = 1e-9 * BarPerLpm2PascalPerKps; % Pascal/kgs-1

NearZeroTime = MainSamplingPeriod/1000; % sec

% Pump parameters

PumpOnPressure = 1.0e7; % Pascal - [HP = 1e7, LP = 3.8e6]

PumpOffPressure = (0.0 * Bar2Pascal); % Pascal

PumpZeroPressureFlow = (530 * lpm2kps); % kg/s

PumpSwitchTime = 0.01; % sec

PumpInternalResistance = PumpOnPressure/PumpZeroPressureFlow; % Pascal/kgs-1

PumpOnDelay = 0; % sec

% Piston parameters

PistonInletResistance = 4e-6 * BarPerLpm2PascalPerKps; % Pascal/kgs-1

PistonLength = 0.5; % m

PistonDiameter = 4e-3; % m

PistonArea = (PistonDiameter / 2)^2 * Pi; % m^2

PistonVolume = PistonLength * PistonArea; % m^3

InitialPos = 0.2; % m

InitialPressure = 0.0; % Pascal

InitialVolume = InitialPos * PistonArea; % m^2

% Pipe parameters

PipeLen = 1.0; % m [Varied between 1m, 5m and 10m]

PipeDiam = 0.005; % m [Varied between 0.005m, 0.01m and 0.02m]

PipeResistance = (PipeLen * 4) / ( (PipeDiam / 2)^2 * Pi ) * BarPerLpm2PascalPerKps;

% Pascal/kgs-1

InPipeResistance = NearZeroResistance; % Pascal/kgs-1

JunctionResistance = NearZeroResistance; % Pascal/kgs-1

% Spring parameters

SpringStiffness = 2e5; % Newtons

58

Page 64: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Model 1 Graphical Output.

Graphs comparing pipe lengths for the HP system.

The top set of graphs are for d=0.005m, the second set are for d=0.01m and the bottom set are for d=0.02m

MATLAB Graphs Adams Graphs

59

Page 65: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing pipe diameters for the HP system.

The top set of graphs are for L=1m, the second set are for L=5m and the bottom set are for L=10m

60

Page 66: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing the pipe length results for the LP system.

The top set of graphs are for d=0.005m, the second set are for d=0.01m and the bottom set are for d=0.02m

61

Page 67: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing the pipe diameter results for the LP system.

The top set of graphs are for L=1m, the second set are for L=5m and the bottom set are for L=10m

62

Page 68: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Model 2 Results

Graphs comparing pipe lengths for the HP system.

The top set of graphs are for d=0.005m, the second set are for d=0.01m and the bottom set are for d=0.02m

63

Page 69: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing pipe diameters for the HP system.

The top set of graphs are for L=1m, the second set are for L=5m and the bottom set are for L=10m

64

Page 70: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing pipe lengths for the LP system.

The top set of graphs are for d=0.005m, the second set are for d=0.01m and the bottom set are for d=0.02m

65

Page 71: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing pipe diameters for the LP system.

The top set of graphs are for L=1m, the second set are for L=5m and the bottom set are for L=10m

66

Page 72: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Model 3

Graphs comparing pipe lengths for the HP system.

The top set of graphs are for d=0.005m, the second set are for d=0.01m and the bottom set are for d=0.02m

67

Page 73: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing pipe diameters for the HP system.

The top set of graphs are for L=1m, the second set are for L=5m and the bottom set are for L=10m

68

Page 74: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing pipe lengths for the LP system.

The top set of graphs are for d=0.005m, the second set are for d=0.01m and the bottom set are for d=0.02m

69

Page 75: Hydraulics Simulation in Matlab

Modelling Hydraulics for Real-Time Simulation Phil Foster

Graphs comparing pipe diameters for the LP system.

The top set of graphs are for L=1m, the second set are for L=5m and the bottom set are for L=10m

70