86
UPTEC F10 057 Examensarbete 30 hp December 2010 Detecting Leakages in the Pneumatic System of Heavy Vehicles Modelling Using Simulink Axel Eriksson

Detecting Leakages in the Pneumatic System of Heavy Vehiclesuu.diva-portal.org/smash/get/diva2:376906/FULLTEXT01.pdf · Detecting Leakages in the Pneumatic System of Heavy Vehicles

  • Upload
    leanh

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

UPTEC F10 057

Examensarbete 30 hpDecember 2010

Detecting Leakages in the Pneumatic System of Heavy Vehicles Modelling Using Simulink

Axel Eriksson

Teknisk- naturvetenskaplig fakultet UTH-enheten Besöksadress: Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0 Postadress: Box 536 751 21 Uppsala Telefon: 018 – 471 30 03 Telefax: 018 – 471 30 00 Hemsida: http://www.teknat.uu.se/student

Abstract

Detecting Leakages in the Pneumatic System of HeavyVehicles

Axel Eriksson

In this thesis an algorithm for detecting leakages in the pneumatic system of heavy vehicles is developed. Besides a description of this algorithm, the thesis includes a description of the pneumatic system of heavy vehicles, a review of some basic statistics and change detection analysis, and a description and analysis of some validation tests.

Heavy vehicles use compressed air for various applications, including brakes and suspensions. Leakages in the pneumatic system are quite common and results in an increase in fuel usage, since more compressed air has to be produced. This is of course both environmentally and economically damaging. In order to avoid this damage, leakages need to be fixed. The first step is to notice the presence of leakages.

The leakage detecting algorithm is based on a statistical deviation analysis. Inputs used are pressure measurements from the different compressed air circuits and some state variables regarding the compressed air users. All this information is communicated aboard on the vehicles’ controller area network (CAN).

The algorithm has been validated using real data measurements from test drives, some of them including a vehicle suffering from leakages. The results indicate that the algorithm manages to identify leakages, but also that there are some problems regarding incorrectly interpreting other events as leakages. The results also indicate that the algorithm fail in the ambition to locate the leakages.

If this algorithm should be implemented in a real time system to be used aboard, it is suggested that some improvements are made. These improvements mainly concern avoiding false alarms.

Tryckt av: Ångströmlaboratoriet, Uppsala Universitet

Sponsor: Scania CV ABISSN: 1401-5757, UPTEC F10 057Examinator: Tomas NybergÄmnesgranskare: Torsten SöderströmHandledare: Martin Svensson

2

List of Abbreviations APS Air Processing System

CAN Controller Area Network CUSUM Cumulative Summation

DC Desiccant Cartridge

ELC Electronic Levelling Control

GMA Geometric Moving Average IDU Integrated Desiccant Use

MCPV Multi Circuit Protection Valve MTD Mean Time to Detection

MTFA Mean Time between False Alarms PDF Probability Density Function

PGN Parameter Group Number PV Purge Valve

SAE Society of Automotive Engineers

3

Table of Contents

1! INTRODUCTION............................................................................................................................................6!

1.1! BACKGROUND.............................................................................................................................................6!

1.2! PROBLEM STATEMENT ................................................................................................................................6!

1.3! TASK AND LIMITATIONS .............................................................................................................................7!

2! THEORY 1: THE PNEUMATIC SYSTEM OF THE VEHICLE..............................................................8!

2.1! OVERVIEW OF THE SYSTEM ........................................................................................................................8!

2.2! THE COMPRESSOR.......................................................................................................................................8!

2.3! APS ..........................................................................................................................................................10!

2.3.1! Compressed Air Dryer......................................................................................................................10!

2.3.2! Compressed Air Distributor .............................................................................................................11!

2.4! COMPRESSED AIR USERS ..........................................................................................................................14!

2.4.1! Service Brakes ..................................................................................................................................14!

2.4.2! Parking Brake / Trailer ....................................................................................................................15!

2.4.3! Auxiliary Equipment.........................................................................................................................16!

2.4.4! ELC...................................................................................................................................................17!

2.5! LEAKAGES IN THE PNEUMATIC SYSTEM ...................................................................................................18!

2.5.1! Fast Leakages and Slow Leakages ...................................................................................................18!

2.5.2! Leakages Affecting the System in Different Situations .....................................................................19!

2.5.3! Common Leakage Locations ............................................................................................................19!

2.6! CAN .........................................................................................................................................................19!

3! THEORY 2: SCIENTIFIC FRAMEWORK...............................................................................................21!

3.1! CHANGE DETECTION.................................................................................................................................21!

3.1.1! Basic Algorithms ..............................................................................................................................21!

3.1.2! Parameter Tuning.............................................................................................................................22!

3.2! STATISTICS................................................................................................................................................22!

3.2.1! Regression analysis ..........................................................................................................................22!

3.2.2! Hypothesis Testing ...........................................................................................................................23!

4! SOLUTION LOGIC ......................................................................................................................................28!

4.1! ASSIGNMENT – EXTENDED DESCRIPTION .................................................................................................28!

4.2! PART 1 – LEAKAGE DETECTION................................................................................................................29!

4.2.1! Part 1 Basic Logic ............................................................................................................................29!

4.2.2! Part 1 Variables ...............................................................................................................................30!

4.2.3! Part 1 Calculations ..........................................................................................................................31!

4.2.4! Part 1 Normal State..........................................................................................................................33!

4.2.5! Part 1 Design Parameters ................................................................................................................37!

4.3! PART 2 – LEAKAGE LOCATION ESTIMATION.............................................................................................44!

4.3.1! Part 2 Basic Logic ............................................................................................................................44!

4.3.2! Part 2 Variables ...............................................................................................................................44!

4.3.3! Part 2 Calculations ..........................................................................................................................45!

4.3.4! Part 2 Normal State..........................................................................................................................45!

4.3.5! Part 2 Design Parameters ................................................................................................................46!

4.4! SYSTEM SUMMARY ...................................................................................................................................46!

4.4.1! Part 1 Summary................................................................................................................................46!

4.4.2! Part 2 Summary................................................................................................................................47!

4.5! SYSTEM RISKS AND LIMITATIONS.............................................................................................................48!

4.5.1! Part 1 Risks and Limitations ............................................................................................................48!

4.5.2! Part 2 Risks and Limitations ............................................................................................................49!

5! MODEL VALIDATION ...............................................................................................................................50!

5.1! VALIDATION TESTS...................................................................................................................................50!

5.1.1! Real Leakage Tests ...........................................................................................................................50!

5.1.2! False Alarm Tests .............................................................................................................................51!

5.2! RESULTS OF VALIDATION TESTS ..............................................................................................................52!

5.2.1! Results of Real Leakage Tests ..........................................................................................................52!

5.2.2! Results of False Alarm Tests ............................................................................................................62!

4

5.2.3! Result Summary................................................................................................................................65!

5.3! SHORTCOMINGS OF VALIDATION METHODS .............................................................................................66!

6! CONCLUSIONS ............................................................................................................................................67!

7! FURTHER WORK........................................................................................................................................70!

7.1! AVOIDING FALSE ALARMS .......................................................................................................................70!

7.1.1! False Alarms Caused Randomly ......................................................................................................70!

7.1.2! False Alarms Caused by a Change in the Type of Driving ..............................................................73!

7.2! LOWERING THE REQUIRED COMPUTATIONAL POWER ..............................................................................73!

APPENDIX I – SIMULINK MODEL ................................................................................................................75!

Table of Figures Figure 2.1 – An example of a pneumatic system of a vehicle, block diagram. ......................... 9!

Figure 2.2 – Total amount of air in system (blue line) and compressor status (red line)......... 10!

Figure 2.3 – IDU, compressor and regeneration status. ........................................................... 11!Figure 2.4 – APS block diagram .............................................................................................. 12!

Figure 2.5 – Pressures in circuits E21 and E25, indicating pressure compensation. ............... 13!

Figure 2.6 – Pressure in circuit E21 (blue line) and service brake status (red line)................. 14!

Figure 2.7 – Pressure in circuit E23 (blue line) when parking brake is activated and

deactivated (red line). ....................................................................................................... 15!

Figure 2.8 – Pressure in circuit E24 (blue line) when clutch pedal is pressed down (red line)........................................................................................................................................... 17!

Figure 2.9 – Pressure in circuit E25 (blue line) when vehicle is lifted (red line). ................... 18!

Figure 3.1 – Possible outcomes of a hypothesis test ................................................................ 24!

Figure 3.2 – Probability density function plots for t and normal distributions ........................ 27!Figure 4.1 – Samples in one box are used to compute one k value ......................................... 31!

Figure 4.2 – New and old k values to be used in t-test ............................................................ 32!

Figure 4.3 – Histogram of k, measuring constantly ................................................................. 33!Figure 4.4 – Histogram of k, measuring when compressor is inactive .................................... 34!

Figure 4.5 – Histogram of k, measuring during normal state and compressor is inactive ....... 35!

Figure 4.6 – Air amount (blue curve) and k values (slope of red lines)................................... 35!

Figure 4.7 – Zoomed in air amount (blue curve) and k values (slope of red lines) ................. 36!

Figure 4.8 – The number of samples used during a test drive (one hour long), based on the

value of n1......................................................................................................................... 38!Figure 4.9 – Constructed plot of k over time, leakage occurs when t = -100 .......................... 39!

Figure 4.10 – Minimum leakage that the system is able to detect, leakage increment between

old and new measurements .............................................................................................. 41!

Figure 4.11 – Required value of n2, as a function of n3, to detect a 10 l/min leakage ............. 42!Figure 4.12 – The number of samples used during a test drive (45 minutes long), based on the

value of n4......................................................................................................................... 43!Figure 4.13 – Basic logic of part 1 ........................................................................................... 46!

Figure 4.14 – Basic logic of part 2 ........................................................................................... 47!Figure 5.1 – k values obtained during real leakage test 1 (part 11) ......................................... 53!

Figure 5.2 – t values obtained during real leakage test 1 (part 11) .......................................... 54!Figure 5.3 – alarms sent during real leakage test 1 (part 11) ................................................... 55!

Figure 5.4 – histogram of k from real leakage test 1 (part 11)................................................. 55!

Figure 5.5 – k values obtained during real leakage test 1 (part 12) ......................................... 56!

Figure 5.6 – t values obtained during real leakage test 1 (part 12) .......................................... 57!

5

Figure 5.7 – alarms sent during real leakage test 1 (part 12) ................................................... 57!

Figure 5.8 – k values obtained during real leakage test 2 (part 11) ......................................... 58!

Figure 5.9 – t values obtained during real leakage test 2 (part 11) .......................................... 59!

Figure 5.10 – alarms sent during real leakage test 2 (part 11) ................................................. 59!Figure 5.11 – histogram of k from real leakage test 2 (part 11)............................................... 60!

Figure 5.12 – k values obtained during real leakage test 2 (part 12) ....................................... 60!Figure 5.13 – t values obtained during real leakage test 2 (part 12) ........................................ 61!

Figure 5.14 – alarm sent during real leakage test 2 (part 12)................................................... 61!Figure 5.15 – k values obtained during false alarm test 1 (part 11) ......................................... 62!

Figure 5.16 – t values obtained during false alarm test 1 (part 11).......................................... 63!

Figure 5.17 – alarms sent during false alarm test 1 (part 11)................................................... 63!

Figure 5.18 – k values obtained during false alarm test 2 (part 11) ......................................... 64!

Figure 5.19 – t values obtained during false alarm test 2 (part 11).......................................... 65!

Figure 5.20 – alarms sent during false alarm test 2 (part 11)................................................... 65!Figure 6.1 – Total air amount in system during driving characterized by high air consumption.

Red parts of the curve are measured during normal state. ............................................... 68!Figure 6.2 – Total air amount in system during driving characterized by low air consumption.

Red parts of the curve are measured during normal state. ............................................... 68!Figure 6.3 – Pressure in circuit E24. Red parts of the curve are measured during normal state.

.......................................................................................................................................... 69!Figure 7.1 – Running mean of k with different window sizes. Blue – single k values, green –

mean of 21, yellow – mean of 101, red – total mean. ...................................................... 70!

Figure 7.2 – New and old k values to be used when using multiple t-tests ............................. 71!

Figure 7.3 – k values of fictitious false alarm 1 ....................................................................... 71!

Figure 7.4 – k values of fictitious false alarm 2 ....................................................................... 72!

Figure 7.5 – k values of fictitious true alarm ........................................................................... 72!

6

1 Introduction

1.1 Background

Heavy vehicles use compressed air to a wide range of applications, including service brakes

and suspensions. The pneumatic system consists of the compressor, which produces

compressed air, the APS, which dries and distributes the air to the five different compressed

air circuits, each of which is responsible for supplying one or more applications with compressed air.

Due to the fact that the cost (i.e. the fuel usage) of producing compressed air is low in

comparison to other costs related to driving the vehicle, the amount of compressed air used has not been an important issue historically. The compressed air has more or less been seen as

free. But recent year’s development has changed this viewpoint.

The development of the vehicles has made them more and more fuel efficient, and there are

no longer any major improvements to be made by simple procedures. This means that every

possible improvement leading to a decrease of diesel usage, even if it is just a small fraction

of a litre per mile, is now of interest. This leads to the fact that the cost of producing

compressed air is now an important issue to Scania.

To lower the compressed air usage, the applications using compressed air can be made more

efficient, the compressor producing the compressed air can be made more efficient, and the

system itself can be made more efficient, i.e. less affected by leakages. Unfortunately, as of today, Scania vehicles suffering from leakages in the pneumatic system are quite common.

The leakage could of course be minimized by making the pneumatic system more solid and

robust. But since a lot of these leakages are caused by additional applications not constructed

nor attached by Scania (for example cranes), some leakages would occasionally still haunt the

system. To minimize the negative effects of the leakages it is important to repair them when they occur. This is usually not something that the driver can do himself, but something for a

mechanic to do. Nevertheless, if the leakage is never noticed, it would never get fixed.

Therefore, to prevent an unnecessary high fuel usage caused by leakages in the pneumatic

system, a system detecting those leakages would be beneficial.

1.2 Problem Statement

A warning system similar to the one described above exists in today’s vehicles, but it is not very good. The existing warning system is only based on the amount of compressed air

produced by the compressor (which is controlled by the pressure in the pneumatic system). If the compressor is producing more air than what is considered to be normal, the driver receives

a warning on the dashboard. There are two different degrees of the warning, depending on

how much air is produced. This system is actually not designed to detect leakages, but to warn

if the pneumatic system is under dimensioned relative to the vehicle and its applications. A leakage must therefore be extremely large to be detected by the current system.

This warning system only tells the driver that the compressed air usage is higher (or much

higher) than normal. This might be because of a leakage in the system, but it is not for certain. It could also be caused by the type of driving. For example, more air will be used if the driver

7

uses the service brakes more frequently than normal. Even other, less obvious, factors will

affect the compressed air usage.

If the abnormal usage of compressed air is in fact due to leakages in the pneumatic system, the warning doesn’t give any information regarding where those leakages are most likely to

be. This means that the mechanic has to search the entire system for leakages, which is of course not efficient.

These shortages of the existing warning system have created a demand for a more

sophisticated one: a system that first of all provides reliable information about whether the

system is leaking or not, but also provides information regarding where the leakages are most

likely to be.

The first step towards such a warning system is a model for detecting/estimating leakages in the pneumatic system.

1.3 Task and Limitations

The aim for this thesis is to create a foundation for a more sophisticated warning system

regarding leakages in the pneumatic system of heavy vehicles. This will be done by

constructing a Simulink model for detecting those leakages. The model shall be able to provide information about whether the pneumatic system leaks or not, and if it does, it should

be able to provide information regarding where the leakages are most likely to be.

To be able to use the model in the vehicles, to detect leakages while driving, the model must be compatible with the software used in the vehicles and built to operate in real time. This is,

however, not part of the task. Instead, the task is limited to construct a model which detects leakages in the pneumatic system based on stored data.

The model should be able to estimate where the leakages are (or at least where they are most

likely to be). This is a question which could be answered with various precision. For this

thesis, the model requirements are limited to provide information regarding which of the five

compressed air circuits are most likely to leak. Estimating exactly where the leakages are,

within the circuits, is not part of the task.

In conclusion, the task is to construct a Simulink model which, based on stored data

information, tells if the pneumatic system is leaking, and in that case, in which of the five different compressed air circuits the leakage is most likely to be.

Available information to be used as input to the model is all information communicated at the

vehicles’ CAN, the local network within the vehicles. This information consists of various data regarding the driving characteristics and the current state of the vehicle.

8

2 Theory 1: The Pneumatic System of the Vehicle This chapter will provide brief overlooking information regarding the pneumatic system in

general, and more detailed information regarding those parts considered more relevant for this specific thesis.

2.1 Overview of the System

The pneumatic system of the vehicle consists of all parts producing, distributing, storing or

consuming compressed air. Figure 2.1 shows a simplified model of the entire system. Fresh

air enters the system and goes straight to the compressor. From the compressor (which

compresses the air) the air flows via the APS and the tanks and ducts to the compressed air

users. After or during the usage the compressed air leaves the system. In a perfect system the air only leaves through the compressed air users or through the purge valve during

regeneration (regeneration will be explained later in this chapter). A perfect system, however, only exists in theory, meaning that there will always be some leakages. These leakages may

occur at any part of the system.

The heart of the system, the compressor and the APS, is usually placed near by the engine. The entire system though, because of the placement of the compressed air users, covers

practically the entire vehicle. Figure 2.1 only shows the logic of the system. The physical

placement of and distances between different parts are hence not taken in consideration. How

the system actually appears on the vehicle is not considered relevant information for this

thesis.

After the APS, the air enters one of five different compressed air circuits, each with its own

sphere of responsibility. Circuit E21 supplies the rear service brake with air, circuit E22 the

front service brake, circuit E23 the parking brake and trailer, circuit E24 the auxiliaries and

circuit E25 the ELC. As seen in figure 2.1, circuits E21, E22 and E23 contain tanks for storing

the compressed air, whereas circuits E24 and E25 connect the compressed air users straight to

the APS (in some vehicles, also E25 contains tanks). Of course, some air will be stored in the ducts, but this is a small amount compared to the tanks.

2.2 The Compressor

The function of the compressor is to supply the pneumatic system with compressed air, to maintain the pressure in the system at a point where the applications using compressed air

function as well as required. The compressor only has two states, active and inactive, meaning

that the rate at which compressed air is produced when active is not possible to control

directly. The amount produced is however not constant, but dependent on the current engine speed and the pressure in the system. The dependence on the engine speed is directly

proportional. The dependence on the system pressure is not completely proportional, but it is

quite linear in the region of interest. The relative compressed air production (at 10 bar it is

100%) is known for some values of the pressure (and the rest can be obtained approximately by interpolating).

9

Figure 2.1 – An example of a pneumatic system of a vehicle, block diagram.

10

The compressor is controlled by the APS using a quite complex logic. A simplified

description is that it is turned on when the system pressure falls below a certain predefined

limit, and turned off when the system pressure reaches another predefined limit. This logic

gives the amount of air in the system an approximately periodical variation, which is easily observed in figure 2.2. Another observation from figure 2.2 is that the limits at which the

compressor is activated and deactivated varies. This limit is dependent of the current state of the vehicle (and the load on the engine).

The length of the inactive periods is of course related to the usage of compressed air, and

varies from a couple of seconds to a couple of minutes. The usage itself is related to the type

of driving and, possibly, to leakages.

Figure 2.2 – Total amount of air in system (blue line) and compressor status (red line).

2.3 APS

The APS has three functions, to dry the compressed air, to distribute the compressed air and

to control the compressor. The APS also contains devices to measure the pressures in circuits E21, E22 and E23. (The APS will possibly, in a near future, also be able to measure the

pressure in circuit E24). This information is communicated at CAN and used as input in the

system developed in this thesis. Besides controlling the compressor and measuring circuit

pressures, the APS can be divided into two parts, one drying the compressed air and one distributing the compressed air.

2.3.1 Compressed Air Dryer

It is important that the air entering the system is dry. Moister in the system is a safety issue,

especially during winter when it might freeze. To dry the air, a desiccant cartridge (DC) is

placed right after the compressor. The desiccant absorbs the moister while letting the air pass

11

through. After a while the desiccant will be saturated, meaning that it needs to be dried to

function as required.

The desiccant is dried by letting air pass from inside the system, the back way through the DC, and out of the system carrying the moister. For every 10 litres dried by the DC, the DC

needs one litre to be dried itself. To keep track of how much air is needed to dry the desiccant, and control when it should be dried, a counter called integrated desiccant use (IDU) is used.

IDU constantly add one to its count for every 10 litres of air entering the system, and subtracts one for every litre leaving the system through the DC. The relationship between IDU,

compressor status and regeneration status is presented in figure 2.3. Regeneration occurs

when the IDU reaches a certain predefined limit, which is set to regenerate quite long before

the desiccant gets saturated. This limit is however dependent of the current pressure in the

system in order to secure the system pressure before regenerating. Hence, when the system

pressure, for some reason, is low even though the compressor has been active a lot lately, regeneration will not occur.

Figure 2.3 – IDU, compressor and regeneration status.

The regeneration is managed by opening the purge valve (PV), which is placed on a duct

connected on the duct connecting the compressor and the DC (see figure 2.4). When the PV is open, air will automatically, due to the pressure, leave the system this way.

2.3.2 Compressed Air Distributor

After getting dried, the air enters the multi-circuit protection valve (MCPV). The MCPV is responsible for distributing the air to the five different circuits. It contains one pressure

12

limiter, five charge valves and three bypass bleeds. These are organised in a quite complex

logic, presented in the block diagram in figure 2.4.

The pressure in the system depends on the usage, the compressor and the regenerations. It usually varies between around 10 and 12 bars. Circuits E23 and E24 contains devices which

may break, or not function as required, at these high pressures. Therefore, the inflow to these circuits is equipped with a pressure limiter, limiting the pressure in the circuits to a maximum

of 8.5 bars.

To avoid a situation where a major leakage in one of the five circuits also affects the supply

pressure in the rest of the circuits, the inflow to all circuits are controlled by charge valves.

When open, air can pass through a charge valve in either direction. If the pressure in a circuit

falls below a certain level, the charge valve closes, thus preventing more air to enter that

circuit. If the pressure decay is caused by a leakage, this prevents the air in the other circuits to leave the system in the same leakage. This means, for example, that a huge leakage in

circuit E21, making the rear service brake unusable, will not affect the performance of the front service brake.

Figure 2.4 – APS block diagram

The charge valve on the inflow to circuit E23 is also controlled by an additional logic; it is only open when the sum of the pressures in circuit E21 and E22 exceeds 7.2 bars. This is a

13

safety precaution. If the vehicle has been standing unused for a while (over a night for

example) even a small leakage may cause the system pressure to drop to low levels. When

this happens, the applications using compressed air will not fully function. This can be

problematic if it affects critical applications, for example the service brakes. The charge valve makes sure that, when starting the car with empty compressed air tanks, the service brakes

circuits (E21 and E22) will charge before the parking brake circuit (E23). Since the parking brake needs compressed air to be released (this will be explained in greater detail later in this

chapter), this means that it is impossible to release the parking brake before the supply pressure is high enough to operate the service brake. It is thus not possible to start driving

before the service brakes start working.

The bypass bleeds are open all the time, but limits the flow rate and some of them only let air

pass in one direction (according to the arrows in figure 2.4). The function of the bypass bleeds

parallel to the charge valves in circuits E24 and E25 is to assure that there is some pressure in the system, even when the charge valve is closed. The one connecting E23 to E22 is a safety

precaution. If the pressure in E22 is lower than the pressure in E23, this will even out. The reason for this is that the supply pressure in E22 is more critical to the vehicle than the one in

E23.

Figure 2.5 – Pressures in circuits E21 and E25, indicating pressure compensation.

In a normal state, when all charge valves are open, all circuits are connected to each other

through open ducts. This means that pressure decay in one of the circuits will be compensated

by the other circuits, and the pressures in all circuits will follow each other. This is easily observed in figure 2.5, showing pressure in circuits E21 and E25 over time. Even though the

pressures may appear to be identical, they are actually not. The small difference between them is caused by the time the pressure compensation takes.

14

2.4 Compressed Air Users

When leaving the APS, the compressed air enters one of the five different circuits, whose

function is to supply one or more of the compressed air users. To understand how the

compressed air usage depends on the compressed air users, it is necessary to understand how

they work and how they use compressed air.

2.4.1 Service Brakes

Circuit E21 supplies the rear service brake whereas circuit E22 supplies the front service

brake. Since the rear and front service brakes work analogous, they will be described together.

Scania vehicles use drum or disc brakes. The basic idea is that a brake shoe is pressed against

the inside of a spinning drum/disc (in the wheel), adding friction and creating a deceleration. Compressed air is used to manage the brake shoe. When the brake pedal is pressed down, a

valve opens letting compressed air to flow into the brake chamber. When the pressure in the

brake chamber rises it pushes the brake shoe against the spinning drum/disc. Figure 2.6 shows

the pressure in circuit E21 (rear brake) before, during and after braking.

Figure 2.6 – Pressure in circuit E21 (blue line) and service brake status (red line).

Given that no leakages exist, air will only leave the system through the service brakes when

the brakes are released, i.e. when brake pedal is released after being pressed down. The small decrease in pressure when the brake is not activated seen in figure 2.6 might be caused by a

leakage, pressure compensation to other circuits, or a combination of them both.

15

2.4.2 Parking Brake / Trailer

Circuit E23 supplies the parking brake and trailer (when one is attached) with compressed air. They work and use compressed air differently and will thus be described separately.

2.4.2.1 Parking Brake

The parking brake works in the opposite of the service brakes. Instead of using compressed

air to brake it needs compressed air not to brake. This works mechanically by a brake shoe

attached to a spring. The spring presses the brake shoe against the wheel unless a chamber is

filled with compressed air pushing it back. This makes it impossible to release the parking brake without enough pressure in the system, as described in section 2.3.2. This also makes a

leakage in the system not affecting the parking brake while the vehicle is standing unused. Figure 2.7 shows the pressure in circuit E23 when the parking brake is switched on and off.

Figure 2.7 – Pressure in circuit E23 (blue line) when parking brake is activated and deactivated (red line).

When released, it is obvious that the pressure will decrease. This is easily observed in figure

2.7. From inspecting figure 2.7, it is also apparent that there is a small decrease in pressure when the parking brake is switched on. This is caused by the trailer as described below.

2.4.2.2 Trailer

If a trailer is attached to the vehicle, this will also be supplied with compressed air by circuit

E23. The trailer uses compressed air mainly for its service brakes, which work analogous with the service brakes of the vehicle. Some trailers, mainly outside Sweden, are also equipped

with parking brakes. The trailer service brakes can be controlled in two ways, by the brake pedal, in which case both vehicle and trailer brake, and by a special trailer brake switch, in

which case only the trailer brakes.

16

The trailer is connected to two compressed air ducts. One of them is used to supply the

applications with compressed air, called the feeding part, and the other is used to control the

applications, called the operating part. For example, when using the service brakes, a valve

has to be opened to let air flow from the feeding part into the brake chamber. This valve is opened by a compressed air signal through the operating part. The operating part works

regardless if a trailer is attached or not. This is the reason for the small decrease in pressure when the parking brake is switched on, as seen in figure 2.7, even though no trailer was

attached.

Just like the service brakes and the parking brake on the vehicle, no air is used unless the

service brakes are used or the state of the parking brake is changing. It is possible, however,

for a trailer to use compressed air for more applications than the brakes, for example air

suspension. Because of the fact that trailers are being swapped between drivers, the

information about the trailer and its compressed air usage is usually limited. But given that no leakages exist, the trailer air consumption should be low except for when braking.

2.4.3 Auxiliary Equipment

Circuit E24 supplies the auxiliary equipments with compressed air. Auxiliary equipments

include the applications not included in the other circuits, with the common characteristic that

their compressed air consumption is quite limited. The different applications will be described separately.

2.4.3.1 Engine

The engine uses compressed air to a number of applications. It has three compressed air

controlled dampers; one controlling the exhaust gas brake, one controlling the exhaust gas recirculation (EGR damper) and one controlling the fresh air inflow (to avoid cooling down

the engine more than necessary). It uses compressed air to dose the reducing agent to lower

the amount of NOx in the exhaust gas (called selective catalytic reduction technology or SCR

technology). It also uses compressed air to clean the diesel particulate filter. This is, however,

limited to around 20 minutes every other day.

The engine application using most compressed air is the NOx reduction. This is constantly

activated and the usage is not directly related to any driving characteristics. Overall, the compressed air usage by the engine is quite constant.

2.4.3.2 Cab suspension

The cab suspension consists of air bellows attaching the cab to the chassis. The compressed

air works as a spring reducing the bounces. For the suspension to function as good as

required, the bellows need to be kept at a certain level (height). Therefore, the bellows contain

valves connecting them to circuit E24. The valve opens, letting more compressed air into the bellow, if the bellow level falls bellow a certain limit. If the bellow rises over another limit the

valve opens, letting air out of the bellow. The valve is mechanical, meaning that there is no

dynamic in the control of the bellow level. Hence, when for example driving on a bumpy

road, there will flow air through the valve, with changing direction, almost constantly. Nevertheless, the compressed air usage of the cab suspension will in general be low and quite

constant over time. Even when driving on a bumpy road, the usage is not big enough to observe just by inspecting a pressure graph of the entire circuit.

17

For the comfort of the driver and passenger (if any), the seats are equipped with their own

additional suspensions.

2.4.3.3 Clutch

When the clutch pedal gets pressed down, a valve is opened letting compressed air in to a

cylinder, pushing the clutch lever arm forward. Figure 2.8 shows the pressure decrease in

circuit 24 when the clutch pedal is pressed down. It is apparent that the decrease is

momentarily when pressing it down, i.e. the compressed air usage is independent of how long the clutch switch is pressed down.

Figure 2.8 – Pressure in circuit E24 (blue line) when clutch pedal is pressed down (red line).

2.4.3.4 Air horn

Some vehicles are equipped with horns using compressed air. The usage is limited to when the horn is used, which is usually quite rarely, and even then the air amounts are not

considerable.

2.4.4 ELC

Circuit E25 supplies the air suspension, also called electronic levelling control (ELC). Just like the cab, the entire vehicle rests on air bellows. These are located between the wheel axles

and the chassis. The ELC has two functions; besides damping bounces it also makes it possible to lift or lower the vehicle.

Just like for the cab suspension, the bellows need to be kept at a certain level, but the control

mechanism differs. The ELC uses an electronic control, with the deviation from the normal level integrated over the last minute as input. This gives a smoother control and lowers the

18

compressed air usage. It also makes the usage more constant over time. Theoretically, more

air will be used when driving on a bumpy road. This is, however, not something that could be

observed by inspecting a pressure graph.

Figure 2.9 – Pressure in circuit E25 (blue line) when vehicle is lifted (red line).

The vehicle can be lifted or lowered using the ELC. This is done by letting air flow into the

bellows (to lift the vehicle) or by releasing air from the bellows (to lower the vehicle).

Lowering the vehicle only affects the air in the bellows, i.e. the system pressure remains the

same as before. Lifting the vehicle, on the other hand, requires a quite large amount of air. This is easily observed by inspecting figure 2.9. After the lift in figure 2.9, the pressure rises

to a bit below the level before the lift. This is so because of pressure compensation from the

other circuits.

2.5 Leakages in the Pneumatic System

Leakages in the pneumatic system might differ a lot from each other. The type of leakage can

be described using two characteristics, how it develops and when it affects the system. For the

first characteristic there are two options. The leakage may occur suddenly (a fast development), or it may slowly become bigger and bigger (a slow development). For the

second characteristic, there are also two main options. The leakage may affect the system constantly (leak all the time) or only in some special situations (for example only when the

service brakes are active or while driving on a bumpy road). Of course a leakage could have

the characteristics of any combination of these four options.

2.5.1 Fast Leakages and Slow Leakages

Fast leakages might occur, for example, at the workshop when work is done to the vehicle or

while driving if hitting a bump or something equivalent. This kind of leakages is less common

19

than the slow ones. They are also in general easier to detect. If they occur while driving (given

that the leakage is big enough) the driver will most often notice them immediately.

Slow leakages might occur, for example, when a valve or gasket has gotten old. This kind of leakages is both more common and harder to detect than the fast ones. The development of

the leakages might take days or even weeks, which of course makes it (practically) impossible for the driver to detect them. A leakage is affecting the fuel usage even if it causes a quite

small waste of compressed air compared to the air usage of some the applications. A leakage is considered important to fix when it reaches a leaking rate of around ten litres per minute.

This could be compared to the usage during a full power brake, which is around 25 litres per

axle. It is obvious that this calls for a quite sophisticated leakage detection system.

2.5.2 Leakages Affecting the System in Different Situations

As stated above, a leakage may affect the system either constantly or in some special situations only. The more common of these two cases are leakages affecting the system

constantly. Leakages affecting the system constantly will also, obviously, cause a bigger compressed air waste and will hence have a bigger effect on the fuel usage (given that it is

compared to a special situation leakage of similar size). When considering the aforementioned

comparison between a leakage and a full power brake, it is easy to understand that a normal

size leakage only affecting the system in some special situations will not cause any big problems.

2.5.3 Common Leakage Locations

Leakages can of course occur anywhere in the system, but some circuits and applications are

more prone to leak than others. The circuit most often suffering from leakages is the auxiliary equipment circuit (E24). This is because it contains so many different applications (the risk of

leakages is increasing with the number of components), and they are located in different

environments (for example, heat will affect the applications in the engine). One of the more

common applications to leak is the seat suspension.

2.6 CAN

The controller area network (CAN) is a local network used for communication between the

different components and control units within the vehicle. The communication is event driven and uses a priority system. CAN is standard in the vehicle industry, hence it is not only used

by Scania.

The CAN messages are binary vectors which follow a distinct structure consisting of three parts, the header, the data field and the end of frame. The header consists of 29 bits including

information about priority, message type (identifier) and source address. The data field

consists of 64 bits which carries the actual information of the message. The end of frame

contains 15 bits which distinguishes the end of the message, and includes a cyclic redundancy check. Even though the messages always follow this structure, the binary vector itself can be

longer due to bit stuffing. Bit stuffing is a security check meaning that a one is automatically inserted after five consecutive zeros, and vice versa. This means that six consecutive ones or

zeros is considered a signal error. The inserted bits do not carry any information (other than

confirming the validity of the signal) and is automatically terminated by the reader while

decoding.

20

For the information in the data field to be usable, the reader must understand what it means.

That is why the identifier is there. Every message type has its own identifier code. The

identifier should tell what every single one of the 64 bits in the data field stands for. This is done by a general convention of the identifier codes.

The convention used by Scania is built on the one presented by the SAE-J1939 (the society of

automotive engineers - truck bus control and communications network subcommittee), which is standard in the heavy vehicle industry. This convention consists of around 400 messages, of

which Scania uses the majority. In addition to these messages, Scania also uses some own

designed messages which are not in SAE-J1939.

In Scania trucks CAN is divided into three smaller local networks, red CAN, yellow CAN and

green CAN. This breakdown is based on the importance of the communicated information. Red CAN carries the most critical information, for example information regarding the engine

and the gearbox system. Green CAN carries the least critical information, for example information regarding distance sensor and the automatic climate control. Yellow CAN is right

between red and green regarding importance.

Besides the aforementioned breakdown, every message also gets classified into one of two internal priority categories. The messages are labelled 3 for control (high priority) or 6 for

information (low priority). If a control message and an information message are trying to use

the same band with at the same time, the control message will be sent and the information

message will be held. The information will still be sent but maybe a bit later than what was

intended.

Since there are a lot of different applications in the vehicle using compressed air, there are a

lot of different messages containing information concerning the pneumatic system. For

example, the APS and the suspension management system are part of the yellow CAN,

whereas the brake management system is part of the red CAN.

As said before, the communication on CAN is event driven. All messages, however, have

upper and lower limits on the time between two messages are sent. For some messages these

two limits coincide, meaning that the message is sent at a constant rate. The messages that

will be used in this thesis are all sent at a constant rate of 10 Hz.

21

3 Theory 2: Scientific Framework This chapter contains a review of the theoretical framework needed to complete the task for

this thesis. Since detecting leakages in the pneumatic system is to detect changes in the system, change detection theory is considered a crucial concept. To fully use the theory of

change detection, and to be able to customize the algorithms for this specific task, an

understanding of some basic statistics will also be needed.

3.1 Change Detection

This part will mainly be focusing on the parts of the theory needed for this specific thesis. For

a deeper and more general review, see Gustafsson [3].

3.1.1 Basic Algorithms

Detecting changes in some system is to detect when the system deviates from its normal state.

This can be done by either signal estimation, parameter estimation or state estimation. In this thesis, signal estimation will be used. This means that some output signal from the system is

measured to see when it deviates from its normal state. A basic assumption made when using this method is that the output signal can be represented as a sum of a deterministic part (the

actual signal) and a stochastic part (white noise)

(3.1)

A common approach to signal estimation is to use an adaptive filter transforming the signal

into a sequence of residuals. The sequence of residuals should resemble white noise. For this

reason, the filter is also called a whitening filter. When the system changes this sequence will

change, meaning that either the mean or variance (or both) will change. Unless the change is

that the variance is smaller (which is unlikely), the signal (or at least its absolute value) will

be larger.

Due to the noise it is not always trivial to detect when the signal has become larger. The

change detection algorithm will therefore need some predefined rule about when to send an

alarm that a change has occurred, i.e. a stopping rule. Two ways of doing this is the

cumulative summation (CUSUM) test and the geometric moving average (GMA) test.

The CUSUM test is based on the recursive algorithm (3.2). The idea is that all samples that

deviate from what is considered to be normal (which is zero due to the whitening filter) are

summarized. An alarm is sent if/when this sum (i.e. gt) exceeds some predefined threshold h.

(3.2)

!t is called a drift parameter and is used to prevent a positive random walk caused by the

white noise. st is the tested variable, if the aim is to detect changes in the mean value it equals

the residual itself.

The GMA test is also based on a recursive function and just as in the CUSUM test an alarm is

sent if gt exceeds some predefined threshold h (i.e. if some average of the latest samples are

too far away from what is considered to be normal, which is zero due to the whitening filter).

22

(3.3)

" is called the forgetting factor and decides the shape of the moving average window (i.e. how

the samples used to compute an average are weighted), it can be set to any value between 0 and 1. st is the same as above.

3.1.2 Parameter Tuning

An important part in both the CUSUM and the GMA tests is to set the threshold value h. This

will decide how sensitive the system is when detecting changes. A low value of h will ensure

that most of the changes will be detected in good time, but at the same time the risk of sending false alarms will be high. A high value of h will lower the frequency of false alarms,

but at the same time the risk of not detecting real changes (or detecting them only after a long

time) will be high.

The tradeoff between detecting real changes and avoiding false alarms is called the

fundamental limitation of change detection [3]. In some situations, a false alarm will be no big

deal whereas not detecting a real change would be catastrophic, and in some situations it will

be the other way around. h must therefore always be chosen specifically for the current

conditions and circumstances. The same also holds for the other design parameters, " and !.

There are two common measures to evaluate the performance of the test. The first one is called mean time between false alarms (MTFA) and measures how often false alarms occurs

on average. The second is called mean time to detection (MTD) and measures the average time from a system change until the alarm is sent. When designing a change detection test

usually one of these (the most crucial one) is set to a satisfying level and then the algorithm is

chosen and the parameters are tuned to minimize the other one.

3.2 Statistics

As in the previous section, this part will mainly be focusing on the parts of the theory needed for this specific thesis. For a deeper and more general review, see for example Blom and

Holmquist [1] and Blom [2].

3.2.1 Regression analysis

Regression analysis is a statistical method used to examine and describe dependencies

between one dependent variable and one or more independent variable(s), by using a sample

from an observation. This is done by modelling a curve (i.e. a mathematical function) that fits

with the observed sample, also called curve fitting. The most common approach to this is the least squares method. The idea is to find the function that minimizes the squares of the

vertical distances between the function and the sample points, mathematically expressed as

!

minc1 ,...,cm

y i( ) " f x1i( ),...,xk i( ),c1,...,cm( )( )

2

i=1

n

#$

% &

'

( ) (3.4)

In (3.4), variables c1 to cm are the constants (parameters) in the function f. yi is the value of the

dependent variable in sample point i, whereas x1i to xki are the values of the independent

23

variables in the same sample point. n is the number of sample points, m is the number of

parameters in f and k is the number of independent variables. The format of function f must

always be decided before numerically computing the values of the parameters. The function f

can take any form (polynomial, trigonometric, exponential etc.)

A special, and maybe the most common, case is when there is only one independent variable and f is a polynomial of degree one (hence m equals two and k equals one in (3.4)). This

special case is called a simple linear regression, and the least squares method equation looks like

(3.5)

Even if the relationship between two variables is not linear, a linear regression analysis can

provide some useful information. For example it can tell if a growth (decrease) in one variable

leads to a growth or decrease in the other. The method is thus widely used.

Another common special case is when the independent variable (x) is some time measurement. The analysis will then give information about the variable’s tendency (growth

or decrease) during the measured time span. In this special case the regression is a form of

time series analysis.

3.2.2 Hypothesis Testing

3.2.2.1 General Hypothesis Testing

Hypothesis testing is a statistical method for making decisions regarding some measured

variable. From this variable a test statistic (denoted T) is defined. The test statistic may for example be the mean or variance of the data sample obtained when measuring the variable of

interest. Besides T, the foundation is two hypotheses regarding T, the null hypothesis

(denoted H0) and the alternative hypothesis (denoted H1). H0 and H1 have to deviate from each

other, but they do not need to be each others exact opposites.

A hypothesis test always focuses on H0, which is the only of the two hypotheses that is actually tested. The test is conducted by forming a critical region (denoted c, sometimes also

called rejection region) for the test statistic T. If T is part of c, then H0 is rejected with some predefined level of certainty. Since H0 and H1 do not need to be each others exact opposites,

rejecting H0 does not necessarily imply that H1 is true. It only means that H1 might be true. Analogously, not rejecting H0 does not necessarily imply that H1 is false (and hence neither

that H0 is true). In conclusion, not rejecting H0 does not provide any new information. Of course, this situation differs a bit in the special case when H0 and H1 are each others exact

opposite (when (3.7) is true).

(3.6)

If (3.6) is true, then:

• H0 is rejected => H0 is not true (with some predefined level of certainty), H1 might be

true but it is not implied.

24

• H0 is not rejected => Either of H0 and H1 (but not both at the same time) might be true

but it is not implied (no new information).

(3.7)

If (3.7) is true, then:

• H0 is rejected => H0 is not true, H1 is true (with the same predefined level of certainty).

• H0 is not rejected => H0 or H1 (but not both at the same time) is true (no new information).

Given that H0 can be either true or false (the correct value, not the calculated) and that it could

be either rejected or not rejected, there are in total four different outcomes of a hypothesis

test. These are summarized in figure 3.1.

Figure 3.1 – Possible outcomes of a hypothesis test

As seen in figure 3.1, there are two different types of errors. Type one error is to reject H0

when it is in fact true. A type two error is to not reject H0 when it is in fact false. The

predefined level of certainty mentioned earlier is set to get the probability of either of these

errors below a desired value. The probability of a type one error is denoted # whereas the

probability of a type two error is denoted $.

The probability of a type one error, #, is called the significance level of the test and is usually

the fixed parameter when constructing the test (this is because $ is often much more complex

to deal with than #). # is quite often set to one of the values 0.05, 0.01 or 0.001. It is not,

however, necessary to use one of these standard values. Instead # should be chosen to suit the

current conditions of the test situation. The probability of correctly rejecting H0 (i.e. one minus $) is called the power of the test. Notice that a high test power corresponds to a low

probability of a type 2 error.

! = P(type I error) (3.8) " = P(type II error) (3.9)

1- " = test power (3.10)

Typically, it is considered more important to have a low significance level than a high test

power. This is caused by the fact that not rejecting H0 does not provide any new information,

and that it is usually worse to say something that is incorrect than to say nothing at all. If #,

however, is set to a value arbitrarily close to zero, H0 will never be rejected and the test would be useless.

25

Choosing # is thus always a tradeoff between the probability of a type one and a type two

error, respectively. In that sense, choosing # reminds a lot of choosing the parameters in the

change detection algorithms described in section 3.1 (the fundamental limitation of change

detection).

Another alternative is to calculate the value of the test statistic first, and then use this to derive a threshold value (usually called p-value) of # for when H0 would be rejected or not. The p-

value gives information of for what significance level H0 can be rejected. In some sense this gives more information. But most of the time a yes or no answer (whether or not to reject H0)

is of more interest, and then a value for # must be decided.

3.2.2.2 Normal Approximation and the Central Limit Theorem

For many statistical methods it is a requirement that, and in some situations when it is not a requirement it makes calculations easier if, the examined variable follows a normal

distribution (sometimes also called Gaussian distribution). The normal distribution depends

on two parameters, the mean (denoted µ) and the variance (denoted %2). The distribution

(denoted N(µ, %2)) has the following probability density function, where x is the variable. This

is also shown in figure 3.2.

(3.11)

The probability density function (3.11) appears quite complex and it is hard to intuitively see

that any process should follow this distribution. Nevertheless, the normal distribution is very useful. This is because of the central limit theorem, as stated below.

The sample mean of any set of random variables, that is independent and identically

distributed with finite mean and variance, will converge to a normal distribution as the

sample size goes to infinity. [2]

More precisely, if the variables follow any distribution with mean µ and variance %2, the

sample mean will converge to a normal distribution with mean µ and variance %2 /n (i.e. N(µ,

%2/n)), where n is the sample size.

The central limit theorem thus says that the sample mean of any set of variables that is

independent and identically distributed (usually noted iid) can be approximated as normally

distributed, given that the sample size is sufficiently large. This is a very useful theorem. The

main problem while using it is to know what sufficiently large means. This will vary from situation to situation and is of course dependent of the required accuracy. It can sometimes

also be difficult to decide whether two measurements are independent or not. Even in

situations where it is not clear that the measurements are totally independent or that the

sample size is big enough, normal approximation is often implemented due to lack of alternatives.

3.2.2.3 The Student t-test

The student t-test is a type of hypothesis test where the null hypothesis H0 is that two different

samples, both assumed to be normally distributed, come from the same distribution

26

H0 : X1 = X2, H1 : X1 # X2 (3.12)

The t-value computed in the test (equation (3.13)) follows the t distribution. The t distribution is very similar to the normal distribution, but with the difference that it is applied as an

approximation when the theoretical variance is unknown.

In (3.12), X1 and X2 are the theoretical means of the distributions of the samples {x11,…, x1n} and {x21,…, x2m}. H1 does not necessarily need to be that X1 is unequal to X2 (as in (3.12)), it

could also, for example, be that X1 is less than X2 or that X1 is greater than X2. H0 is usually

rewritten to X1 – X2 = 0, which makes the difference between the sample means the test

statistic. The first part of the test is done by computing

(3.13)

In (3.13), the numerator is the difference between the two sample means (i.e. the test statistic). In the denominator, s

2 denotes the sample variances and n denotes the sample sizes. The t-

value in (3.13) corresponds to a p-value described in section 3.2.2.1. In contrast to the normal distribution, however, the t-distribution is depending on one more parameter, the degrees of

freedom (denoted !). ! is computed by

(3.14)

Notice that the degrees of freedom always should be an integer, meaning that the value

obtained in (3.14) has to be rounded (it is usually rounded downwards). After computing t and

!, the corresponding # is obtained from either the probability density function of the t-

distribution, or straight from a table. Since the probability density function is quite complex,

the later is usually to prefer.

The shape of the probability density curve of the t-distribution reminds a lot of the one of a

normal distribution. The difference is that the t-distribution is more spread out. When the

degrees of freedom go to infinity, however, the t-distribution will converge to a normal

distribution, as shown in figure 3.2.

The degrees of freedom is increasing when the sample sizes are increasing, it is not dependent

of the magnitudes the variances but the relationship between them. This is easily seen in

equation (3.14) if dividing both nominator and denominator with either s14 or s2

4. The degrees

of freedom parameter should be interpreted as a rectification of the probability density

function (and hence the critical region) due to the fact that the variances are unknown. The

PDF will be more spread out and the critical region smaller (hence the complement to the

critical region, the region where H0 is not rejected, will be larger). As the sample sizes go to

27

infinity, the sample variances will converge to the theoretical variances of the distributions

(given by the law of large numbers), and ! will go to infinity. When ! goes to infinity, the t

distribution will converge to a normal distribution and the critical region will thus converge to

one constructed with known theoretical variances.

Figure 3.2 – Probability density function plots for t and normal distributions

As mentioned earlier, the t-value calculated in (3.13) corresponds to a p-value. This means

that the # obtained with it is a threshold value for on what confidence level H0 could be rejected. The critical region for the test statistic (i.e. the difference between the two sample

means), given a predefined #, is computed by

(3.15)

It is easy to see that equation (3.15) is derived from equation (3.13). To compute the critical

region, the first step is to calculate ! with equation (3.14). Then ! is used together with the

predefined # to get t. When t is obtained, equation (3.15) can be computed.

28

4 Solution Logic This chapter describes how the theory reviewed in chapter three has been applied to solve the

specific task of this thesis. First is a description of the assignment, a bit more detailed than the one in the introduction chapter. The rest of the chapter will contain a review of the logic of

how the assignment has been solved, i.e. the logic of the system. The last part of the chapter

contains a brief summary of the system logic and a review of the system limitations and

shortcomings. A description of how the model has been implemented in Simulink is presented in appendix I.

4.1 Assignment – Extended Description

The assignment is to create a Simulink model which shall be able to detect leakages in the pneumatic system of Scania vehicles. The model should also be able to say in which of the

five circuits the leakage is most likely to be.

As stated in chapter one, the assignment is limited to create a model which uses stored data as input. However, in the end the goal is to be able use the model on vehicles operating in real

time. This means that, even though it is not part of this thesis to make it work in real time, the model should be made so that its logic could be a foundation for a model working in real time.

A necessary requirement for the model is thus to be causal (which is not a necessary

requirement when using stored data). Another, more interesting, aspect is the computational

power required when using the model. Since there are a lot of different control units in the

vehicle, and since there is a limited computational power, this is a crucial aspect. For this assignment, there is no predefined upper limit for the computational power required to use the

model. Instead, the aim is to try to keep this number low, without negatively affecting the

performance of the model.

As mentioned in chapter three, the accuracy of a change detection model will always be a

trade off between some fundamental performance measurements. In this case it will mainly concern how big changes have to be to be detected, how fast they will be detected and the

probability of sending false alarms (and also, when it is taken under consideration, the computational power required to run the model). Since leakages are considered important to

fix when they reach a leakage rate of about ten litres per minute, the goal is to make the system accurate enough to detect leakages of this size.

In section 2.5, some different kinds of leakages were mentioned. The first distinction was

whether the leakage develops suddenly or slowly. For this assignment, the slowly developing leakages are considered most important to detect. This is because they are more common and

usually harder to detect. A system able to detect slowly developing leakages is probably also

able to detect faster developing leakages. The main focus when tuning the parameters will

thus be to detect the slowly developing leakages. The second distinction was whether the leakage affects the system constantly or only in some special situations. The only leakages not

affecting the system constantly that is considered important to detect are those only affecting the system while the compressor is active. The other special cases are considered less

important because the amounts of air lost through them are usually quite low in comparison.

What pressure measurements are available at CAN is stated in section 2.3. Since the system developed in this thesis will not be implemented in the vehicles very soon (if it will be

29

implemented at all), the system will be developed under the condition that the pressure in

circuit E24 is available.

Since the assignment is divided into two parts, the leakage detection and the leakage location estimation, the description of the model will also be divided. From here on, “part 1” will refer

to the leakage detection part, and “part 2” will refer to the leakage location estimation part. These two parts will, however, be included in the same Simulink model.

4.2 Part 1 – Leakage Detection

4.2.1 Part 1 Basic Logic

Leakages in the pneumatic system will be detected by measuring the usage of compressed air

and changes in that quantity. The basic idea is thus quite similar to the one of the existing warning system (as described in chapter one). But the new system will of course include some

features to improve the accuracy compared to the existing system.

As stated in chapter one, a big shortcoming (probably the biggest) of the existing warning system is that it only measures the compressed air usage without relating it to the type of driving. This leads to that when driving in a very air consuming way, a warning would be sent

regardless of if there were any leakages in the system.

To improve this shortcoming, the new system will consider the type of driving when

measuring the usage of compressed air. This will be done by not measuring when the type of

driving is such that the usage is considerable higher than normal regardless of the presence of leakages. The usage will thus only be measured during some kind of “normal state”, when the

most air consuming applications are not active. What cases will be excluded from the measurements will be stated later in this chapter.

Another shortcoming of the existing warning system is that it compares the usage to a

predefined threshold. There are two reasons for why a predefined threshold is not optimal. Firstly, either a different threshold has to be set for every sold vehicle (which would require

considerable resources), or the same threshold would be used for all vehicles (which would

make the system quite inaccurate, keeping in mind that almost every sold vehicle is unique).

Of course, neither of these two alternatives is a good solution. Secondly, this predefined threshold will always be the same, regardless of for example a change in weight (due to the

loading of cargo) or the attachment of a trailer, even though both these occurrences would change the compressed air usage.

To improve this shortcoming, instead of comparing the usage to a predefined threshold, the

new system will use a dynamic function to detect changes in the usage (i.e. the current usage

will be compared to the usage a while ago). This way, the same system can be applied with

high accuracy to all vehicles, and it can be adjusted to zero value when, for example, the vehicle is loaded or a trailer is attached.

In conclusion, the system will measure the usage of compressed air and compare the current

value to earlier values. If the current value is significantly higher, a leakage is assumed. To improve the accuracy, the usage will not be measured in those cases where the type of driving

affects it considerable more than normal.

30

4.2.2 Part 1 Variables

As stated in section 4.2, leakages will be detected by observing changes over time in the compressed air usage. The compressed air usage is thus the variable needed for part one. This

is, however, not something that is available directly at CAN. It must therefore be calculated using inputs that are available at CAN.

The pressures in circuits E21, E22, E23 and E24 are available at CAN. By using the

thermodynamic relation that pressure multiplied by volume is constant, the total amount of air

(denoted A) in these circuits is obtained. It is computed by the following equation, where p

stands for pressure, v for volume and index i for the different circuits.

(4.1)

The usage of compressed air is equal to the decrease of A. To be able to compare one

decrease with another, it has to be measured as a function of time (i.e. the decrease rate should be measured). The decrease rate is usually obtained by differentiating the signal. This is,

however, related to big risks when the signal is affected by high frequency noise (since differentiating will amplify the high frequency components of the signal). In this case the

average change rate is the interesting part (the low frequency component), not the momentary change rate. Therefore, the decrease rate is instead obtained by taking the slope coefficient

from a simple linear regression (equation (3.5)) with A as the dependent variable and time as

the independent variable, according to equation (4.2). This can be seen as approximating the

real signal with a linear signal such that the power of the error signal (the difference between the real signal and the approximated one) is minimized.

(4.2)

In equation (4.2), t is some unit of time. Since the samples are taken at a constant rate, the

easiest way to go is to use a t equal to the summation indexes i. One time step is 0.1 seconds.

The number of samples used in the regression, n1, is a design parameter. All design

parameters will be discussed later in this chapter.

From here on, the usage rate (the slope coefficient c1 in equation (4.2)) will be denoted k. No k will be computed using partly the same samples as the previous k, hence there will be no

overlapping. This choice is made in order to make the different k values independent (why this is important will be pointed out later on). Since there will be no overlapping, and since

measurements will be done only during some normal state (as mentioned before and described

in greater detail later on), the amount of air samples will be used to compute k values

according to figure 4.1 (n1 is number of samples used to compute one k value).

31

Figure 4.1 – Samples in one box are used to compute one k value

4.2.3 Part 1 Calculations

Leakages in the pneumatic system will be detected by detecting changes in variable k (as defined in previous section).

The change detection algorithms presented in section 3.1 are not perfectly suited for this

problem, but still some basic ideas can be used. The GMA method uses a moving time

window, computes the average of the weighted samples, and compares it to a predefined

threshold. As explained in section 4.2, a predefined threshold is not a well suited solution for this problem. The GMA method is, however, still applicable, by doing some small

adjustments. Instead of using a predefined threshold, the moving average is compared to

another moving average taken earlier. When this is decided, a hypothesis test can be

formulated

(4.3)

µ1 and µ2 are the true means of the distributions of k at the measurement moments. If there is

no change in the system (i.e. no new leakages) then the distributions are the same and H0 is not rejected. If the system has changed significantly (i.e. a significant leakage has occurred)

then H0 will be rejected. A rejection of H0 thus indicates a leakage. Since the air consumption (not affected by the type of driving) cannot randomly decrease, H0 will only be rejected if µ1

is significantly lower than µ2 (this will halve the amount of false alarms).

When comparing two samples taken from the same distribution, the whitening filter does not serve any good. This means that k will be used just as defined earlier.

Also the shape of the window will be slightly adjusted compared to the one earlier described.

This is done to be able to also use the sample variance (instead of only the mean). To use the variance, the samples have to be weighted equally, and hence a rectangular window has to be

used. The sample mean and variance will be computed according to

32

(4.4)

(4.5)

The number of k values used, n in equations (4.4) and (4.5), is another design parameter.

Since there is no need for the number of k values used to estimate µ1 to be the same as the

number of k values used to estimate µ2, n is divided into two different design parameters, n2

and n3 (indexed two and three to not get mixed up with n1). As for previous design

parameters, these will be dealt with later.

When the sample mean and variance have been computed, H0 is tested using a student t test (as described in section 3.2.2.3). The two moving windows used to collect k values for the t-test is shown in figure 4.2. As previously stated, a requirement when using a student t-test is

that the two sample means are normal distributed. According to the central limit theorem, the mean value of k will be approximately normal distributed if the different k values are

independent and identically distributed. It is the independency that makes it important to not

use partly the same samples for two k values (i.e. to avoid overlapping). The degrees of

freedom (equation (3.13)) will not be computed in the system for every t test. Instead it will be set to a value based on the design parameters and assumed to be constant (i.e. the

relationship between the two sample variances is, regarding the degrees of freedom, assumed

to be constant). This simplification is made to lower the computational power required to run

the system.

Figure 4.2 – New and old k values to be used in t-test

The t value will, however, be calculated in the system, according to equation (3.12). It is the t

value that will be compared to a threshold to decide whether or not to reject H0. The threshold

value of t is dependent of the degrees of freedom and #, the significance level (or in this case, required minimum probability of a type one error, as described in section 3.2.2.1). # is another

design parameter and will thus be discussed later on.

33

The difference between performing a student t-test and just comparing the sample means is

that the sample variances are considered. This has two advantages. Firstly, the level of

certainty when sending an alarm will be known. Secondly, a few randomly caused outliers

will have a smaller chance of causing a false alarm (since they will increase the variance).

4.2.4 Part 1 Normal State

As described in section 4.2.1, measurements will only be made during some “normal state”

type of driving. The purpose is to measure when the usage (given that the system does not

suffer from any leakages) is as constant as possible. Lower variance in the usage while

measuring will make it easier to detect changes in the usage. In this section, the “normal state” will be defined.

The aim for the normal state is to make the variance of variable k (c1 in equation (4.2)) as low

as possible. Figure 4.3 shows a histogram of k (air amount change) when measurements are made constantly, independent of the type of driving. In this case the design parameter n1

(number of samples in the regression) is set to 150.

Some of the k values represented in figure 4.3 are positive, meaning that the amount of air is

increasing. These are of course measured when the compressor is active. These positive

values are causing a quite big variance. It thus seems like a good idea to exclude periods when the compressor is active from the normal state. But since detecting leakages that only affects

the system when the compressor is active is considered important, this will not be done.

Instead the problem will be divided into two separate parts, for which separate calculations

will be made.

Figure 4.3 – Histogram of k, measuring constantly

From here on, “part 11” refers to leakage detection when the compressor is inactive, and “part

12” refers to leakage detection when the compressor is active.

34

4.2.4.1 Part 11 Normal State

Figure 4.4 shows a histogram of k where measurements are made only when the compressor is inactive (but with no other restraints). Almost all positive values are now gone (the ones left

are caused by measurement noise). Compared to figure 4.3, not only the mean value and

median value have changed. Also the standard deviation (and hence the variance) is

remarkably lower.

To lower the variance even more, some more special cases will be excluded from the measurement periods. To decide what special cases will be excluded, two criteria have been

used. The first one is that the special case should last for a limited amount of time during which the compressed air usage should be affected significantly. The second is that

information about when the special case is occurring should be available at CAN. With these two criteria, and the knowledge about the pneumatic system provided in chapter two, the

following special cases have been chosen.

• When the purge valve is open (i.e. during regeneration)

• When the service brakes are used

• When the clutch switch is pressed down

• When the parking brake is active

• When the lifting control is used

The effect that these have on the compressed air usage is quite easy to observe in figure 2.6 –

2.9. The parking brake only uses air when it is released and the clutch only uses air when it

gets pressed down. The decision not to measure these as long as they are in active state is a simplification made under the assumption that these states are usually only lasting for a short

amount of time.

Figure 4.4 – Histogram of k, measuring when compressor is inactive

35

When only measuring during normal state, as it is defined above, and when the compressor is

inactive, k is distributed according to figure 4.5.

Figure 4.5 – Histogram of k, measuring during normal state and compressor is inactive

The standard deviation has decreased significantly compared to figure 4.4. Also notice that

the mean value and median value are quite similar, indicating a symmetric distribution (which

indicates that a normal approximation might be well suited). The reason for why the total

number of k values in the histogram has decreased compared to previous plots is that the total measurement time has decreased due to the restrictions.

Figure 4.6 – Air amount (blue curve) and k values (slope of red lines)

36

Figure 4.7 – Zoomed in air amount (blue curve) and k values (slope of red lines)

Figure 4.6 and 4.7 show the air amount curve (blue) and the fitted lines (red) measured during

normal state (during a test drive). The slope coefficients of the red lines are k values.

In figure 4.6 and 4.7 the k values (the slopes of the red lines) appears to be quite similar. The

parts of the blue curve without red lines are parts where the type of driving is not defined as

normal state (or at least not for time period long enough to collect a k value). The parts without red lines seem to be the parts where the slope of the blue curve is either positive or

very negative (i.e. steep). This indicates that the definition of the normal state is quite well

suited.

4.2.4.2 Part 12 Normal State

Since the applications using compressed air works independently of whether the compressor

is active or not, the normal state will be defined as for part 11. The only difference is of

course that measurements will be done when the compressor is active instead of inactive.

When splitting the problem into two different parts there are, however, some differences that

need to be stated. Firstly, when the compressor is active, the air amount increases, and hence k will be positive (it could be interpreted as a filling rate instead of a usage rate). If a leakage

occurs, the filling rate will decrease and k will be less positive (the slope will be less steep). But even with this difference taken under consideration, the same tests can be performed as

for part 11. Secondly, when the compressor is active, k will also be depending on the engine speed and the system pressure (as explained in section 2.2). This will increase the variance of

k in a disadvantageous way. This problem is solved by, before doing the t-test, dividing every k value with the average engine speed during the time that specific k value was obtained, and

then multiplying it with the average relative production rate depending on the system pressure. Since the compressed air generation is directly proportional to the engine speed, this

will make the leakage test independent of the rate at which compressed air is generated

37

(which is obviously to prefer). The dimension of the part 12 k values will however lack

physical interpretation.

To be able to customize part 12 independently of part 11, it will be given its own design variables. For part 12, n4, n5 and n6 correspond to n1, n2 and n3, as defined earlier. # will be the

same for both parts.

Notice that a leakage affecting the system constantly will (given that it is big enough) set off the alarms for both part 11 and part 12.

4.2.5 Part 1 Design Parameters

With the variables and normal states defined the only thing left to do, before implementing

the system, is to choose values for the design parameters. According to the system requirements, as stated in section 4.1, the main focus will be to detect slowly developing

leakages. The aim is, however, to describe the relationships between these parameters and the system performance as thorough as possible. These descriptions should serve as a manual for

how to tune the design parameters differently if the main focus changes.

4.2.5.1 Part 11 Design Parameters

For part 11, there are in total four different design parameters. These are stated below.

n1 - the number of samples used to compute one k value. n2 - the number of k values used to compute the current average usage rate.

n3 - the number of k values used to compute the previous average usage rate. # - the chosen probability of a type one error.

The total number of samples used to compute the current and previous average usage rate will

be n2 times n1 and n3 times n1, respectively. This means that, given that n2 and n3 are

unconstrained (which they are), the value of n1 is not very important for the variance of the

average usage rates. By making n2 and n3 functions of n1, such that their products are

constant, the variance (except the part caused by measurement noise) will be independent of

n1.

The uncertainty of an arbitrary k (the variance caused by measurement noise) will not affect the outcome of the t-tests. It is thus crucial for this uncertainty to be low to get a

representative result. The uncertainty is lowered by increasing n1. If n1 is too big (compared to

the average continuous period of normal state) on the other hand, very few k values will be

collected, which will make it take a long time to get enough information for a comparison (and it will take a long time to detect a leakage). The numbers of k values obtained is shown

in equation (4.6), where NS is a continuous period of normal state. It is thus important that n1 is not too big compared to the measuring periods (NS), and not small enough to be too

affected by the measurement noise.

(4.6)

38

(4.7)

Another option would be to let n1 vary and use every single period of normal state to compute exactly one k value. This would be efficient in the sense that all samples during normal state

would be used (with a fixed n1 some information will always be wasted). This would, however, cause a big problem. The different k values would not be identically distributed

(since they would be computed with a varying number of samples). Hence the normal approximation would not be applicable and the student t-test would not be feasible.

Figure 4.8 – The number of samples used during a test drive (one hour long), based on the value of n1.

Figure 4.8 shows the number of k values and samples used by the system during a test drive

(roughly one hour long), for some different values of n1 (computed with equations (4.6) and

(4.7)). The exact magnitude of the effect of the measurement noise on an arbitrary k value is

quite complex to derive, but the effect of the variance of k is inversely proportional to the

square root of n1 (and the uncertainty of k can be seen as part of the variance). If n1 is equal to

50, the measurement noise effect will be twice as big as for n1 equal to 200. But the number of samples used is only around 60 percent higher. It thus seems more efficient to choose a value

closer to 200. To not get too few k values, n1 is set to 150 (which equal 15 seconds).

The choices of n2 and n3 will affect the certainty of system (the probabilities for a type one

and a type two error) and the time delay between a leakage occurring and the leakage is

detected (the MTD). The probability of a type one error is of course depending on the choice

of # (as a design parameter). But a lower #, without changing n2 and n3, is obtained by

adjusting the t-test threshold, which will increase $, and hence lower the power of the test. Hence, when n2 and n3 are set, a change in # is just a change in the tradeoff between # and $.

By choosing n2 and n3 properly (i.e. big enough), both # and $ can become arbitrarily small (this is given by the law of large numbers).

Figure 4.9 shows a constructed (fictitious) plot of different k values over time. When t is -100,

a leakage occurs.

The null hypothesis of the student t-test performed to detect leakages is that the n2 k values

taken between t1 and t2 come from the same distribution as the n3 k values taken between t2

and t3 (notice that the t-axle in this case is not a continuous time axle, t should instead be seen as an index). The test statistic is the difference between the mean values of the samples.

39

The two intervals of length n2 and n3 shown in figure 4.9 are the moving average windows.

The k values used to estimate the current average k will always be the n2 latest k values

computed (i.e. k1 to kn2, where k1 is the latest value computed). The k values used to estimate the previous average value of k will always be the n3 k values computed before (i.e. kn2+1 to

kn3). It is quite easy to see that the probability of detecting this leakage will take on its maximum value when t2 is equal to the time when the leakage occurred.

This means that the time from that a leakage occurs until it is detected (assuming it is only

detected when the probability of detection takes on its maximum value) is the time it takes to

collect n2 k values. In equation (3.14) it is easily seen that the size of the critical region will

decrease (and hence the certainty will increase) if n2 is increased.

Figure 4.9 – Constructed plot of k over time, leakage occurs when t = -100

In conclusion, a low value of n2 will make the probability of detecting a leakage low, but if it

is detected it is detected soon after occurring. A high value of n2, on the other hand, will make

the probability of detecting a leakage high, but it will be detected a long time after occurring.

The critical region is analogously dependent of n3 (see equation (3.14)). In contrast to n2,

however, n3 does not affect the time from a leakage occurring to detection. In figure 4.7 it is

easy to see that changing n3 does not change the location of t2 (this only depends on n2). There

are only two small negative effects of increasing n3. The first one is that the required computational power will be increased. The other is that the first t-test will be done when

(n2+n3) k values have been computed. This means that increasing n3, with a fixed n2, will increase the time before the first test is done and the first alarm can possibly be sent. Since

this is only a question of hours it will not be a problem unless the system is reset very often (due to for example changes in the load).

It thus seems like a good idea to set n3 to a quite large value. Since the parts in the critical

region limit calculation affected by n2 and n3, respectively, are summed together, it is not

40

possible to completely compensate a low value of n2 with a high value of n3. Since the most

important part is to detect slowly developing leakages, minimizing the MTD will be slightly

neglected and n2 and n3 will be set to quite high values. The exact values will be derived later.

The last design parameter to be chosen for part 11 is #, the chosen probability of a type one

error. An important performance measurement to consider when deciding # is the mean time between false alarms (MTFA), as described in section 3.1.2. This performance measurement

is closely related to $. If an alarm (true or false) is sent, it is probable that another one will be sent when the next t-test is performed (since there is only one new k value in each sample). If

all alarms sent consecutively are considered to be the same, the MTFA can approximately be

seen as an exponentially distributed variable with expected value t/# (where t is the mean time

between two k values are obtained).

A new t-test will be performed every time a new k value is calculated. How often this happens will vary. The minimum time between two k values is 15 seconds (given by n1 = 150 and the

sample rate = 10 Hz) and there is no maximum time. From figure 4.6, the average number of k values generated seems to be about one per minute (with n1 = 150).

This means that the MTFA is approximately 1/# minutes. Given this, the MTFA can become

arbitrarily big by choosing # small enough. # is set to 0.001 (and hence MTFA will be 1000 minutes).

Of course one false alarm every 1000 minutes is way too much. This is however the # that

will be used in the validation tests. This is because the validation tests will be too short to

implement the system with arbitrarily good accuracy (this will be seen later).

With # available, the only thing missing to compute a threshold value of t are the exact values

of n2 and n3 (since these are needed to compute the degrees of freedom !, according to

equation (3.13)). But since n2 and n3 will be derived from the t value, ! will be assumed to be

around 100 (this will be tested later on). If ! equals 100, t will be approximately 3.2 (with # equal to 0.001).

This means that for an alarm to be sent, the value computed in equation (3.12) has to fall

below -3.2. With this knowledge, the relationship between the size of the leakages possible to

detect and the values of n2 and n3 can be derived. To do this, equation (3.12) is rewritten as

(4.8)

41

Figure 4.10 – Minimum leakage that the system is able to detect, leakage increment between old and new

measurements

When computing equation (4.8) with the threshold value of t and the sample variances and sample sizes, the minimum value of the difference between the mean of the new k values and

the mean of the old k values to send an alarm, will be given (i.e. the minimum leakage that the

system is able to detect). Notice that the minimum leakage in this case means the minimum

leakage where the probability of detection exceeds the probability of non detection (for one t-test). Also notice that the size of the leakage means the size of the increment between the

mean of the old measurement and the mean of the new measurement. This is shown in figure

4.10.

If the minimum leakage that the system is able to detect is set to 10 (i.e. the goal for the

system), an expression for the required values of n2 and n3 is obtained

(4.9)

If the two sample variances are assumed to be the same, and both equal 275.56 (taken from figure 4.5, where the standard deviation equals 16.6 litres per minute), the required size of n2

can be written as a function of n3 only

(4.10)

Notice that, according to equation (4.10), n2 will take on negative values if n3 is less than 28

(since 0.36 times n3 will be less than one). Of course n2 can not be negative, hence there is no

feasible solution of equation (4.10) if n3 is less than 28. This means that, to be able to detect a

42

ten litres per minute leakage, n3 must be at least 28, independently of how big n2 is. Figure

4.11 is a plot of equation (4.12) for values of n3 between 40 and 200.

Figure 4.11 – Required value of n2, as a function of n3, to detect a 10 l/min leakage

Notice that in figure 4.11 (and equation (4.10)) n2 and n3 could switch places. With figure

4.11 as a guideline, n2 is set to 50 and n3 is set to 100. This is above the line in figure 4.11

with some margin (the exact value of the lowest leakage that the system is able to detect with

these values of n2 and n3 equals 9.2 litres per minute).

Earlier the degrees of freedom ! has been assumed to be around 100. This of course needs to

be verified. To calculate ! without knowing the sample variances, the assumption that they are

identical will be done. The calculations are shown below.

(4.11)

With 98 degrees of freedom and t equal to 3.2, the probability of a type one error is 0.0009

(i.e. less than 0.001). This shows that the assumption made earlier holds, and the t-test threshold does not need to be changed.

Theoretically, with this choice of n2 and n3, a ten litres per minute leakage should be detected.

This, however, requires the difference in mean between the new and old k values to be at least

43

ten litres per minute. The leakage thus has to develop very fast. To be able to detect a slowly

developing leakage, without increasing the window sizes, there needs to be a time delay

between the old measurements and new measurements (how big the delay has to be depends

on how slowly the leakage develops). The logic of this is quite easy to understand when looking at figure 4.10.

An alternative way to go would be to use several t-tests simultaneously, with various time

delays between new and old measurements. If several t-tests are used, the total probability of a false alarm will of course increase. This has to be considered when relating the MTFA to #

(theoretically calculating the MTFA would in this case not be trivial since the different t-tests

would not be independent).

4.2.5.2 Part 12 Design Parameters

The design parameters of part 12 have the exact same effect on the system as the parameters

in part 11. This means that the review in the previous section only needs to be complemented

by describing the small differences between the two parts.

The most obvious difference is that, on average, the total amount of time that the compressor

is inactive is significantly higher than the total amount of time that it is active (this is easily

seen in figure 2.2 and 2.3). This means that the periods of normal state will on average be

both shorter and less frequent compared to the ones in part 11. In figure 2.2 and 2.3, the periods when the compressor is active seems to vary between five and ten seconds. This

means that n4 has to be set to a lower value then n1. Figure 4.12 shows how many k values are

obtained (and how many samples are used) for different values of n4. The numbers are taken

from a 45 minutes long test drive.

Figure 4.12 – The number of samples used during a test drive (45 minutes long), based on the value of n4.

There is a remarkable increase in k values obtained when n4 is decreased from 50 to 40, but

this increase seems to decline when n4 is decreased further (the total amount of samples used is even lower when n4 equals 30 than when it equals 40). 40 thus seems like a good value for

n4.

Notice that the number of k values obtained in part 12 is roughly 45 per minute, in

comparison to 60 in part 11. This means that (given that the other design parameters are the

44

same as in part 11) the MTD will be higher in part 12. This will, however, not be taken under

consideration since the system accuracy is considered more important than the MTD.

Another difference between part 12 and part 11 is that the lower value of n4 (compared to n1) will increase the effects on the uncertainty of k caused by the measurement noise. But to be

able to run the system, the k values nevertheless need to be treated as correct values. This problem will be solved by increasing n5 and n6. Since n1 is roughly for times bigger than n4,

the effects on the variance caused by measurement noise will be roughly twice as big in part 12 as in part 11. n5 and n6 will thus be doubled compared to n2 and n3. Hence n5 equals 100

and n6 equals 200. In equation (3.12) it is easy to see that if the variances are doubled, this is

compensated by doubling the sample sizes.

The degrees of freedom will be 198 for part 12 (computed with equation (4.11) with n2 and n3

replaced by n5 and n6). The same threshold for t will be used as for part 11, 3.2 (the degrees of freedom are not enough to use t equal to 3.1, and smaller fractions will not be used). Hence H0

for part 12 will be rejected if the t-value computed in part 12 exceeds 3.2 (and an alarm will be sent).

4.3 Part 2 – Leakage Location Estimation

4.3.1 Part 2 Basic Logic

To estimate the location of a detected leakage, the time delay of the pressure compensation

will be used. As described in chapter two, a drop in pressure in one circuit will be

compensated by air flowing from the other circuits. Even though the pressure evens out quite fast, it does not happen instantaneously. This means that if a leakage occurs in one circuit, and

air flows from the other circuits to compensate, the average difference in pressure between this circuit and the others will increase due to the time delay.

By measuring the differences in pressure and check for changes, the location of a detected

leakage can be estimated. There is one big difference between part one and part two. In part two, no decision whether or not to send an alarm has to be made. This means that no

thresholds are needed. The only thing needed to be calculated is in which circuit the leakage is

most likely to be (and not how likely it is).

4.3.2 Part 2 Variables

The location of a detected leakage will be estimated by observing changes in the average

pressure difference in the circuits. To minimize the computational power required to run the system, only two differences will be used

(4.12)

A positive (negative) average value of D1 indicates that the pressure in circuit E21 is higher

(lower) than the pressure in circuit E22. Given that the average pressure difference when no

leakages exist is zero, this would indicate a leakage in circuit E22 (E21) since the circuit not

leaking will on average have a higher pressure than the one leaking (caused by the time delay

of the pressure compensation). This is of course analogous for D2. The assumption that the

45

average pressure difference is zero when no leakages exist is however a far too uncertain

assumption to be made (for example caused by wrongly calibrated pressure measurement

devices). This is why it is not enough to observe the average pressure difference, but the

change in this variable has to be observed.

4.3.3 Part 2 Calculations

Changes in the two pressure differences D1 and D2 will be computed using a simpler logic

than the one in part 1, by merely comparing means. The mean of a sample of new values of

D1 (D2) will be compared to the mean of a sample of old values of D1 (D2). This will result in

a trend indicator (denoted capital T)

(4.13)

According to the logic described earlier, a big positive (negative) T1 indicates a leakage in

circuit E22 (E21). This is because D1 has become more positive (negative) and thus the average pressure in circuit E21 has become higher (lower) compared to the average pressure

in circuit E22. Analogously, a big positive (negative) T2 indicates a leakage in circuit E24

(E23).

This will, however, only give separate information about if the leakage is more or less likely

to be in circuit E21 than E22, and E23 than E24. To decide in what (only one) circuit the leakage is most likely to be located, the absolute values of T1 and T2 will be compared (the

highest one indicates a leakage, since that change is bigger). The comparison is done simply

by subtracting. This gives the logic of the leakage location estimation as follows.

If & T1&>& T2&

T1> 0 => Leakage in E22

T1< 0 => Leakage in E21

If & T1&<& T2&

T2> 0 => Leakage in E24 T2< 0 => Leakage in E23

Notice that the logic described above only tells where an already detected leakage is most

likely to be located. One of these will always be true, regardless whether the system is leaking or not.

4.3.4 Part 2 Normal State

The same normal states as in part one will also be applied in part two. This is to use the same

samples as the one detecting the leakages (if a leakage is detected using some samples, a

change in the pressure difference should be observable in the same sample). Since part one is

divided into two different parts, the same is done to part two. For part two, however, the only difference between the two parts are the samples (and number of samples) used. Other than

that the calculations will be identical.

46

4.3.5 Part 2 Design Parameters

Since the samples used for part two are decided by the design parameters of part one, and since there are no thresholds in part two, part two has no design variables.

4.4 System summary

4.4.1 Part 1 Summary

The general idea of the system for detecting whether or not the system leaks is outlined in

figure 4.13. Basically the same logic is applied to both part 11 and part 12.

Figure 4.13 – Basic logic of part 1

The system input is pressure samples. By using the different pressures and the known tank volumes, the total amount of air in the system is computed. The usage rate during normal state

(a state when the type of driving does not affect the usage too much) is measured by doing a linear regression and taking the slope coefficient k (as shown in figure 4.6 and 4.7). Then a set

of newly computed k values are compared to a set of older ones using a t-test. If they are

considered to be collected from different distributions, a leakage is assumed and an alarm will

be sent. The performance of the system is controlled by tuning the design parameters stated

below.

n1 - the number of samples used to compute one k value.

Increasing n1 will decrease the effect of the measurement noise, but increase the MTD.

n2 - the number of k values used to compute the current average usage rate. Increasing n2 will (for a fixed #) increase the power of the test, but also increase the MTD.

n3 - the number of k values used to compute the previous average usage rate.

Increasing n3 will (for a fixed #) increase the power of the test.

# - the chosen probability of a type one error.

47

Decreasing # will (for fixed n2 and n3) decrease the probability of a type one error, but

increase the probability of a type two error (i.e. decrease the power of the test).

Another negative effect of increasing n1, n2 or n3 is that it will increase the required computational power. Increasing n2 and n3 will also increase the time to the first t-test is

performed.

Note that in part 12, k is the filling rate. To get the filling rate without being affected by the compressed air generation rate, k needs to be divided by the engine speed. Also notice that in

part 12, the design parameters are called n4, n5 and n6.

If some change (except a leakage) that affects the overall usage of compressed air occurs (for

example a change in load or attaching a trailer) the system should be reset. If it is not, the

change in compressed air usage will (if it is big enough) be interpreted as a leakage. Since zeroing the system only means to restart it, this feature will not be part of the system itself.

4.4.2 Part 2 Summary

The general idea of the system for detecting whether or not the system leaks is outlined in

figure 4.14.

Figure 4.14 – Basic logic of part 2

The system input is the pressure samples (as in part one). These are used to compute the pressure difference between circuits E21 and E22, and the difference between circuit E23 and

E24. The mean values of new differences are compared to the mean values of old differences (by subtracting), which gives two trend values (denoted T1 and T2). The signs and the

relationship between the trend values decide where a detected leakage is most likely to be

located.

Since part one is divided into two subparts, also part two is. This means that there will be in

total four T1 and four T2 values (since there are two different comparisons (E21 to E22 and E23 to E24) and two different normal states (when the compressor is active and when the

compressor is inactive)). The calculations will, however, only differ in the samples (and

number of samples) used. This will be decided by n1 to n6.

48

4.5 System Risks and Limitations

The logic of the system is, even though it is considered to be more accurate than the existing warning system, not perfect. In this section the risks and limitations of the basic logic will be

stated.

4.5.1 Part 1 Risks and Limitations

The first thing worth mentioning is a fundamental difference between the assignment and the solution. The assignment was to construct a system to detect leakages in the pneumatic

system. The solution is a system that detects changes (that is not related to the driving

characteristics) in the compressed air usage. This means that, with the constructed system,

leakages will only be detected if occurring while measuring. It will hence not be possible to detect a leakage if applying the system to an already leaking vehicle (unless of course the

leakage is increasing). This difference will of course not affect the system performance if the measurement starts when the vehicle is brand new. It will, however, be a limitation in the case

when a trailer is attached. If a trailer is attached, the air consumption will increase (even if the

trailer is not leaking), and the system must hence be zeroed. An alarm will not be sent if the

trailer is leaking (unless the leakage is increasing). This is an obvious limitation, but there is no way around it without knowing how much compressed air this specific trailer would

consume if not leaking.

The aim of the system is to detect changes in the compressed air usage that is not related to

the type of driving. Of course, there is a risk that this aim is not completely fulfilled, i.e. that the normal state definition is not rigid enough. In section 4.2.4 the applications that will not

use compressed air during normal state are listed. But as stated in section 2.4, these are not all the applications using compressed air. The following is a list of applications whose

compressed air usage will affect the output of the system (the alarms) even if not leaking.

• ELC • EGR damper

• Exhaust gas brake • SCR technology

• Cab suspension • Seat suspension

• Air horn

These are not affecting the normal state definition due to the criterions stated in section 4.5.1. They are not using considerable amounts of compressed air during limited periods of time

which are easily identified by input from CAN. Instead most of these are considered to have a

quite constant compressed air usage. If, however, the type of driving changes (for example

due to a change of driver or a change of road type/environment) in a way that the compressed air usage by some of these applications changes significantly and persistent, this will cause a

problem (i.e. false alarms).

There will also be a problem when special applications that use compressed air very straggly

are added to the vehicles. An example of this is pneumatic driven doors that are often installed

on buses. Since these kinds of applications are not considered when defining normal state, there usage will affect the k values and might cause false alarms.

49

The risks of getting false alarms from the system will be further examined, using a more

practical approach, in chapter 6, “Model Validation”.

Another risk is the interpretation of false alarms. As stated before, there will always be a risk of false alarms. Since the system is only detecting changes, only one alarm (or a bunch of

consecutive alarms) will be sent when a leakage occurs (unless the leakage continues to grow). A correct alarm will thus be very similar (or identical) to a false alarm. If the

comparison instead was to a predefined threshold, alarms would be sent constantly after a leakage occurred. The correct alarms would then differ from the false ones. But even with this

limitation taken under consideration, a predefined threshold is considered a less suitable

solution. This is because it would require too much knowledge about the normal compressed

air usage.

There is also a risk related to the interpretation of a part 12 alarm. As previously stated, a leakage affecting the system constantly will set off both alarms. But since the k values are

obtained at a lower rate in part 12 than in part 11, and since n5 and n6 are bigger than n2 and n3, the part 12 alarm will be sent significantly later than the part 11 alarm. This means that it

sometimes could be tricky to decide whether a type 12 alarm really indicates a leakage that only affects the system when the compressor is active. It could also happen that a leakage

affecting the system constantly sets of the part 12 alarm but not the part 11 alarm (due to the stochastic part of the signal). But even if a leakage sometimes might be difficult to label, the

most important part is that it is detected.

A limitation in the system is that not all available information is used. Some samples will not

be included in the tests (even some that are measured during normal state), which is shown in

figure 4.1. This is however impossible to change without computing the k values with various sample sizes (which would make the t-test unusable due to the central limit theorem).

Another limitation is that leakages not affecting the system during normal state will not be

detected. This limitation was, however, explained and motivated in section 4.1, and will thus not be given any more attention.

4.5.2 Part 2 Risks and Limitations

Part two does not decide whether or not to send alarms. This means that there is no false

alarm risk in part two. When an alarm is sent (from part one), this will always come with a

location estimation, independent of the certainty. This might cause a risk of incorrectly interpreting the alarms. An alarm saying that there is a leakage in circuit E21 should be

interpreted as there is a leakage and it is most likely to be located in circuit E21. This means

that if circuit E21 is examined without finding any leakages, the leakage is located somewhere

else. It does not (necessarily) mean that it was a false alarm.

50

5 Model Validation The leakage detection method developed in this thesis has in the previous chapters only been

motivated theoretically. To examine whether the theory holds or not, also some practical validation tests will be performed. This chapter contains a description of these tests, the test

results and a review of the limitations and shortcomings of the test methodology. An

interpretation of the results, together with the more theoretical aspects, will be presented in

the next chapter.

5.1 Validation Tests

The leakage detection system will be tested using data collected during real test drives. Since

the model is not (yet) made to work in real time on the vehicle, the data will be collected first and the detection system will be applied later, on the stored data. The tests are divided into

two different categories. The first one is tests performed to examine the risk (probability) of false alarms. The second one is tests performed to examine how accurate the model is

regarding detecting real leakages.

Since the pressure in circuit E24 is not communicated at CAN, a measurement device has to be placed manually. This will be done for some of the tests, but not all. I the cases where this

is not done, the pressure in circuit E24 is set to the same value as the pressure in circuit E23.

Since the amount of air in circuit E24 is small compared to the total amount of air in the

system (see the tank volumes in section 5.3), this will not noticeably affect the leakage

detection performance. The leakage location estimation algorithm will, however, not work at

all (and can hence not be tested).

The total time of the tests will vary. This means that the sizes of the windows for computing

the mean k value (design parameters n2, n3, n5 and n6) will differ between the different tests.

This is a requirement to get descent (or any at all) results. This may seem like a weak test

technique, but actually it is not. As shown before, the test accuracy will strictly increase as the

window sizes increase. Given that the test is performed with the same or smaller window sizes, the test result will never be better than the result of the real system in an identical

situation. The only thing that will be better with smaller windows is the MTD. This will therefore not be taken under consideration during these tests.

The number of samples used to compute the different k values (n1 and n4) and the probability

of a type one error (#) will, however, always remain the same.

The validation tests are divided into two categories, real leakage tests and false alarm tests.

5.1.1 Real Leakage Tests

The idea of the real leakage tests is to try how well the system detects real leakages. This will

be done by running the system on stored data measured during a test drive where a real

leakage is created. The real leakages are created by opening a valve and placing an air flow limiter (i.e. without actually damaging the vehicle). Two different tests will be performed,

with various leakage sizes and characteristics.

51

5.1.1.1 Real Leakage Test 1

The first test is performed to examine whether the system is able to detect a big, fast

developing leakage. As stated before, the fast developing leakages are assumed to be easier to detect than slowly developing leakages, and of course the bigger they are, the easier they will

be to detect. This is thus the easiest real leakage test for the system to pass. Even though this

kind of leakage is less common and therefore less important than slowly developing leakages,

it was considered an interesting first test since it will reveal if the basic logic of the system

holds. If it does, tuning the design parameters can optimize the performance of the system.

The test is performed by stopping the vehicle sometime during the drive to open a valve, and then continue driving. The pressure in circuit E24 is not measured. The test is described

below.

Total time 60 minutes Type of driving country road / highway

Time without leakage 30 minutes

Time with leakage 30 minutes

Size of leakage ~ 100 litres / minute

The test was executed on the roads between Södertälje and Trosa on September 22 2010.

5.1.1.2 Real Leakage Test 2

The second test is a more difficult test for the system than the first one. In this test a slowly

developing leakage will affect the system. Due to limitations in the ability to construct

controlled leakages, the leakage will not increase continuously. Instead the leakage will

increase stepwise (this is done manually), but with step sizes too small to (theoretically) detect

one single increase. The pressure in circuit E24 is measured. The test is described below.

Total time 220 minutes

Type of driving country road / highway

Time with no leakage 90 minutes First leakage size ~ 5 litres / minute

Time with first leakage 30 minutes

Second leakage size ~ 8 litres / minute

Time with second leakage 30 minutes

Third leakage size ~ 11 litres / minute

Time with third leakage 70 minutes

The test was executed on the roads between Stockholm and Nyköping on September 28 2010.

5.1.2 False Alarm Tests

The idea of the false alarm tests is to examine the risks of getting false alarms embedded in

the system. This will be done by running the system on stored data measured during test

drives where the vehicle is known not to start/increase leaking (i.e. all alarms sent are false

alarms). Two different tests will be performed, with various degrees of difficulty for the system to pass (i.e. to not send out an alarm).

52

5.1.2.1 False Alarm Test 1

Test 1 is a test executed over a long period of time with what is considered quite demanding

driving (high air consumption). The idea is to see how the system performs under tough but invariant conditions. The pressure in circuit E24 is not measured. The test is described below.

Total time 7 hours

Type of driving lots of slopes, curves and accelerations

The test was executed on Scania test course in Södertälje between October 22 and October 27.

5.1.2.2 False Alarm Test 2

In test 2 the ambition when driving is to cause a false alarm. This is to try the system

performance during some kind of worst case scenario. This will be done by dividing the test

drive into two different parts. During the first part the driving should be characterised by low air consumption whereas the second part should be more demanding. This scenario could

occur in real life when for example exiting a big highway and entering a smaller road or a more urban environment. It could also happen if the vehicle changes driver, if the new driver

drives more aggressively than the first one. The first part of the test is quite long to also show

how the system performs under normal conditions. The pressure in circuit E24 is not

measured. The test is described below.

Part 1

Total time 6 hours

Type of driving highway

Part 2 Total time 30 minutes

Type of driving lots of slopes, curves, accelerations and powerful brakes

The test was executed in traffic on the roads between Stockholm, Södertälje and Vingåker and on the Scania test course between October 22 and October 28.

5.2 Results of Validation Tests

In this section the results from the tests described in the previous section will be presented.

Along with the results from the system constructed in this thesis, also the output from the

existing warning system will be presented as a comparison.

5.2.1 Results of Real Leakage Tests

5.2.1.1 Real Leakage Test 1 Result

During real leakage test 1 a total number of 81 k values was obtained when the compressor was inactive (54 before and 27 after the leakage) and a total number of 97 k values was

obtained when the compressor was active (25 before and 72 after the leakage). These values are the guideline when deciding the window sizes. The choices of the windows were as

follows:

n2 = 20

53

n3 = 20

n5 = 20

n6 = 25

This leads to the t threshold for the two tests to be -3.4 for both part 11 and part 12.

The first thing worth noticing is that more k values was obtained when the compressor was

active than when it was inactive, which contradicts the theory. This depends on the big leakage causing the compressor to work more than usual (it does thus not say that the theory

is wrong).

The results of the part 11 test are presented in figures 5.1 to 5.4. Figure 5.1 shows the k values

obtained from the test. The difference between the first 54 and the following 27 is quite

obvious.

Figure 5.1 – k values obtained during real leakage test 1 (part 11)

Figure 5.2 shows the t values obtained. Notice that the first 39 (n2 + n3 - 1) are uninteresting

since the inputs used contains zeros because not enough k values have been computed. The red line is the threshold for whether or not to send an alarm (i.e. whether or not to reject the

null hypothesis).

54

Figure 5.2 – t values obtained during real leakage test 1 (part 11)

The first k value computed when the system was leaking was number 55. The leakage is thus

possible to detect in t-test number 55 to 94 (the criterions are that at least one new k value was measured after the leakage occurred and that at least one old k value was measured before the

leakage occurred) and the highest probability of detection takes on its highest value at t-test

number 75 (the criterion is that all old k values was measured before the leakage occurred and

all new k values was measured after the leakage occurred). The 75th

t value is also in fact

clearly the most negative (indicating that the theory holds).

Figure 5.3 shows the alarms sent during the test. The first alarm was sent after t-test number

64. It was thus enough to have 9 out of 20 new k values measured after the leakage occurred

to detect the leakage. This, together with the extremely significant t value at the maximum

detection probability, shows that the system detected this leakage fairly easily (as expected).

55

Figure 5.3 – alarms sent during real leakage test 1 (part 11)

The fact that the system detected this leakage easily shows that the algorithm is working.

Even though this should be considered as an unusual big leakage, it was not detected by the existing warning system.

The size of the leakage is also revealed in the histogram of the k values, shown in figure 5.4,

which is clearly bimodal.

Figure 5.4 – histogram of k from real leakage test 1 (part 11)

56

The results from the part 12 test, presented in figure 5.5 to 5.7, were not as clear as the one

from part 11. The leakage was, however, detected. Figure 5.5 shows the k values obtained

(the first 25 before the leakage occurred and the following 72 after the leakage occurred).

Nothing can be concluded by simply inspecting this plot. Notice that the dimension of the k values in this case is not litres per minute (since it has been divided by engine speed). The unit

does not have any physical interpretation.

Figure 5.5 – k values obtained during real leakage test 1 (part 12)

Figure 5.6 shows the computed t values. Notice that the first 44 (n5 + n6 - 1) values are uninteresting for the same reason as for part 11. The leakage is detected and two alarms are

sent (see figure 5.7). There are still, however, some areas of uncertainty.

The maximum probability of detection (theoretically) occurs at t test number 45, but alarms

are sent at tests 50 and 51. This indicates that the test outcome is partly caused by some

randomness. Also, even though this was an extremely big leakage, the t value did not exceed the threshold with great margin.

57

Figure 5.6 – t values obtained during real leakage test 1 (part 12)

Figure 5.7 – alarms sent during real leakage test 1 (part 12)

Since no measurements were done on circuit E24 there are no results available for part two (the leakage location estimation).

5.2.1.2 Real Leakage Test 2 Result

During real leakage test 2 a total number of 402 k values was obtained when the compressor

was inactive (160 with no leakage, 36 with the first leakage, 51 with the second leakage and

58

155 with the last leakage) and a total number of 115 k values was obtained when the

compressor was active (34 with no leakage, 13 with the first leakage, 19 with the second

leakage and 49 with the last leakage). These values are the guidelines when deciding the

window sizes. The choices were as follows:

n2 = 50 n3 = 100

n5 = 20 n6 = 20

This leads to the t threshold for the two tests to be -3.2 for part 11 and -3.4 for part 12.

The results from part 11 are presented in figure 5.8 to 5.11. Figure 5.8 shows the k values

obtained. There is a noticeable decrease around k value number 160 (the time for the first leakage), but after that there are no obvious changes. The first leakage should only be around

five litres per minute, but the difference in usage between before and after 160 seems to be around 20 litres per minute. The most likely reason for this is additional leakage in the

connection to the controlled leakage. Unfortunately, if this is true, it means that the test was not as hard for the system to pass as planned.

Figure 5.8 – k values obtained during real leakage test 2 (part 11)

Figure 5.9 and 5.10 shows the t values and the alarms sent, respectively. The leakage was

again (as in previous test) detected fairly easily. Even if the test did not turn out as hard for the system to pass as intended, it was way harder than real leakage test 1 (20 litres per minute

compared to 100 litres per minute). This result is thus not only an additional indication that

the theory holds, but also a stronger one.

59

Figure 5.9 – t values obtained during real leakage test 2 (part 11)

Figure 5.10 – alarms sent during real leakage test 2 (part 11)

An interesting aspect when inspecting the histogram (figure 5.11) is the strength of the t-test. Even though the bimodality is not very clear, the t-test reveals it with great certainty. This

indicates a good chance to detect even smaller leakages.

60

Figure 5.11 – histogram of k from real leakage test 2 (part 11)

The results from part 12 are presented in figure 5.12 to 5.14. Just as in real leakage test one

part 12, the plot of k values (figure 5.12) does not reveal any clear pattern.

Figure 5.12 – k values obtained during real leakage test 2 (part 12)

When looking at the t values and the alarm (figure 5.13 and 5.14) there is a clearer pattern,

and it appears as the leakage is detected. This is however not for certain. One alarm is sent,

and this happens at t-test number 92. Since only 34 k values are obtained before the first

leakage, and since the maximum probability of detection is 20 k values after the alarm, this

61

alarm could have been caused by a randomness. It should then be considered as a false alarm

which, luckily, happened to be sent when a real leakage was affecting the system (and it was

then not really a false alarm). When looking at figure 5.12 this possibility appears quite likely.

Figure 5.13 – t values obtained during real leakage test 2 (part 12)

Figure 5.14 – alarm sent during real leakage test 2 (part 12)

The leakage location estimation algorithm was tested but did not give any good (correct)

results. This might be because the theory simply does not hold. For example the pressure

compensation might be too fast compared to the pressure measurement sampling rate (10 Hz).

62

Another option is that the simplification to not consider the complex logic of how the pressure

is compensated was too big.

If the theory does in fact hold, the result might be caused by that the pressure in the different circuits are measured in different ways. The measurements taken from CAN are low pass

filtered by the APS. The pressure measurements from circuit E24 on the other hand are just raw data, and hence much more affected by noise. This difference might be a problem.

5.2.2 Results of False Alarm Tests

5.2.2.1 False Alarm Test 1 Result

During false alarm test 1 a total number of 530 k values were obtained when the compressor

was inactive. Due to the result of the real leakage tests, no tests were performed when the

compressor was active (part 12). The design parameters were chosen as before.

n2 = 50

n3 = 100

This of course leads to the same t threshold as before, i.e. -3.2 for part 11.

The results are presented in figure 5.15 to 5.18. Figure 5.15 shows the k values obtained. The k values are quite similarly distributed over time, but at the same time quite spread out. This

indicates that the system is not perfect.

Figure 5.15 – k values obtained during false alarm test 1 (part 11)

The lack of perfection is also apparent in figure 5.16 and 5.17, which shows that a false alarm

has been sent. This false alarm is just randomly caused. When comparing figure 5.16 to figure

5.2 and 5.9 it is obvious that this (false) alarm is not sent with the same certainty as the (real)

alarms in the real leakage tests. This is of course positive.

63

Figure 5.16 – t values obtained during false alarm test 1 (part 11)

Figure 5.17 – alarms sent during false alarm test 1 (part 11)

5.2.2.2 False Alarm Test 2 Result

During false alarm test 2 a total number of 769 k values were obtained when the compressor

was inactive (759 during the driving characterized by low air consumption and 10 during the

driving characterized by high air consumption). To be able to test the system more high air

consumption k values than ten would be needed. This was obtained by repeating the data

64

sequence sampled during the high air consumption driving 16 times. Due to the result of the

real leakage tests, no tests were performed when the compressor was active (part 12). The

design parameters were chosen as before.

n2 = 50

n3 = 100

This of course leads to the same t threshold as before, i.e. -3.2 for part 11.

The results are presented in figure 5.19 to 5.21. Figure 5.19 shows the k values obtained. The

repetitive pattern of the last k values is caused by the fact that the same data sequence is used

over and over again, as explained above. The k values obviously decreases after the type of

driving changes. This also leads to a false alarm which is shown in figure 5.20 and 5.21. In

figure 5.20 it is apparent that the alarm is sent with quite high accuracy, indicating big shortcomings in the system.

When comparing the high consumption driving to the low consumption driving, the total

compressed air usage increased by 254% whereas the mean of the absolute value of k increased by 174%. The goal was of course to have the later of these two numbers equal to

zero independent of the value of the first one.

Figure 5.18 – k values obtained during false alarm test 2 (part 11)

In figure 5.20 and 5.21 there is also apparent that two more false alarms have been sent. These are, however, not caused by a change in the type of driving. These are instead probably just

caused by randomness (as the alarm in false alarm test 1).

65

Figure 5.19 – t values obtained during false alarm test 2 (part 11)

Figure 5.20 – alarms sent during false alarm test 2 (part 11)

5.2.3 Result Summary

5.2.3.1 Results Part 11

For the leakage detection when the compressor is inactive part, two things can be stated.

Firstly, the system managed to detect the constructed leakages used in the tests. Secondly, the

system failed in the false alarm tests (false alarm were sent).

66

5.2.3.2 Result Part 12

For the leakage detection when the compressor is active part, no good results were obtained. I barely managed to detect the big constructed leakage and did not manage to detect the smaller

constructed leakage.

5.2.3.3 Result Part 2

For the leakage location estimation part no good results were obtained. The system did not manage to correctly locate the constructed leakages.

5.3 Shortcomings of Validation Methods

Before analyzing the results some shortcomings of the validation tests need to be stated. First of all, only four tests have been performed, which are all quite limited in time. These four

tests only cover a small fraction of all the possible situations that may occur while driving. It

is also a quite obvious limitation that the pressure in circuit E24 was only measured during

one of the tests. In real leakage test 2 the constructed leakage turned out to be bigger than planned, which made the result not to reveal as much information as wanted. The last

shortcoming worth mentioning is the reuse of a data sequence (instead of extending the length

of the test) during false alarm test 2, which of course may have affected the outcome.

All these shortcomings are taken under consideration when analyzing the results. The tests

are, however, considered substantial enough to point out the general strengths and weaknesses

of the system, and thereby also to point out the most important fields for improvement.

67

6 Conclusions The aim for this thesis was to create a foundation for a warning system regarding leakages in

the pneumatic system of Scania vehicles. The goal for the system was to be able to detect if the vehicle was leaking and, in that case, compute the most likely location of the leakage.

For this purpose an algorithm has been developed and theoretically motivated. The validation

tests performed indicated that the algorithm performed well in some situations, but it did also, unfortunately, reveal some problematic weaknesses.

The first aim, to be able to detect whether the pneumatic system is leaking, was partially

fulfilled. The system seems to be able to detect leakages, but it also seems to incorrectly interpret other events as leakages. The second aim, to be able to locate a detected leakage, was

not fulfilled at all.

The failure in the second aim has already been discussed (section 5.2.1.2) and will not be

given any more attention.

For the first aim, as previously stated, both positive and negative results were obtained. The

fact that the two real (constructed) leakages that were tested were detected shows that the

system works at least in some situations. This indicates that the system, with some

improvements, could be usable. It thus seems like a good idea to further investigate the cause of the false alarms.

The false alarms that were sent during the tests can be divided into two different categories;

randomly caused false alarms and false alarms caused by a change in the type of driving.

The first category includes the alarm sent in false alarm test 1 and the first alarms sent in false

alarm test 2. This type of false alarms was not unexpected and should not be seen as a big

problem. They are a consequence of the chosen value of the design parameter # and could be avoided by changing this design parameter. When inspecting the presentation of the test

results it is easy to see that a change of the t threshold would actually be enough (without loosing the true alarms). More sophisticated methods to avoid this kind of false alarms will be

discussed in the next chapter.

The second category includes the last alarm sent in false alarm test 2. This type of false alarms should, contrary to the previously described type, be considered a major concern. The

idea of the system was to measure the compressed air usage when it was independent of the type of driving. The result of false alarm test 2 shows that this ambition has failed, and hence

that the normal state definition is not good enough.

Figures 6.1 and 6.2 show two parts of the air amount curve from false alarm test 2, one from when the driving was described as demanding (figure 6.1) and one from when the driving was

described as not demanding (figure 6.2). The red parts of the curves are defined as normal state. In both figures it is apparent that the steepest parts of the curves are not red, indicating

some strengths of the normal state definition. The fact that the total compressed air usage

increase was distinctively larger than the mean of the absolute value of k increase indicates

the same. But the test result still shows that the definition is not good enough.

68

In figure 6.2 there is a part of the curve that is almost completely flat. In figure 5.18 it is also

easy to see that there are a lot of k values (when the driving was not demanding) just around

zero. Flat areas like this, where the air consumption is almost zero, do not exist when the

driving is demanding. This seems to be the biggest difference between the curves.

Figure 6.1 – Total air amount in system during driving characterized by high air consumption. Red parts

of the curve are measured during normal state.

Figure 6.2 – Total air amount in system during driving characterized by low air consumption. Red parts

of the curve are measured during normal state.

69

This suggests that at least one of the compressed air users consume air constantly (or at least

very frequently) only when the driving is demanding.

Circuits E21, E22 and E23 serve applications which only use compressed air at certain events, which should all be covered by the normal state definition. It is hence likely that the source of

the consumption that negatively affects the results is either circuit E24 or E25. A deeper review of the pressure in circuit E24, presented in figure 6.3, reveals some more information.

Figure 6.3 – Pressure in circuit E24. Red parts of the curve are measured during normal state.

The big pressure drops indicate that one of the compressed air users uses air. The red parts of

the curve are measured during normal state. It is apparent that some of these drops contain red

dots and hence are occurring during normal state.

A similar review has been done on circuit E25, without any interesting findings. This suggests

that the increase in compressed air usage (during normal state) when the driving becomes more demanding is caused by one or more of the auxiliary equipments. Which of them has

however not been identified.

70

7 Further Work This chapter will describe what work needs to be done to the system to be able to use it. The

validation tests show that the system works in some cases, but they also show that it has some major weaknesses concerning false alarms.

If the system should be able to be implemented on vehicles, these false alarms have to be

taken care of. If they are not, the system will be useless. Another aspect is the required computational power. Even though no deeper analysis of this has been made, an educated

guess says that it needs to be lowered.

7.1 Avoiding False Alarms

In chapter six the false alarms were divided into two different categories. The same

categorization will be made here as well, starting with the randomly caused false alarms.

7.1.1 False Alarms Caused Randomly

As said in chapter six, the randomly caused false alarms are a consequence of the choice of

the design parameter #. One way to deal with this would be to change # but leave everything

else the same. This would result in a larger t (absolute value). A negative effect of this would be that real leakages would have to be bigger in order to be detected.

Another option would be to increase the window sizes. It seems logical that this would

decrease the variance, and this is also confirmed by figure 7.1. Figure 7.1 shows the single k

values (blue), the mean of 21 k values (green) and the mean of 101 k values (yellow). The red

line is the total mean. It is easy to see that a bigger window leads to lower variation. Bigger windows would also lead to that # could be lowered without affecting the minimum size of

leakages that the system is able to detect.

Figure 7.1 – Running mean of k with different window sizes. Blue – single k values, green – mean of 21,

yellow – mean of 101, red – total mean.

71

To be able to use larger windows, more data needs to be stored. And if more data should be

stored, there is actually another option which is considered more beneficial. This is to use

several windows and several tests.

Figure 7.2 shows how the k values would be used if two new and two old windows would be used. The idea is that both new windows are tested against both old ones and an alarm is sent

if all four tests show that the new values comes from a different distribution than the old ones. This would be better than just increasing the window sizes in the sense that it is a stronger

requirement that the result of all these tests indicate a leakage than that the average result

indicates a leakage.

Figure 7.2 – New and old k values to be used when using multiple t-tests

Consider the fictitious k value plots presented in figures 7.3 – 7.5. Figure 7.3 shows a case

where the k values for a short amount of time for some reason are lower than normal. This is

not a leakage but some randomly caused abnormality.

Figure 7.3 – k values of fictitious false alarm 1

72

Figure 7.4 shows a case where the k values for a short amount of time for some reason are

higher than normal. This is not a leakage but some randomly caused abnormality.

Figure 7.4 – k values of fictitious false alarm 2

Figure 7.5 shows a case where the k values decreases permanently. This is a real leakage.

Figure 7.5 – k values of fictitious true alarm

73

These three cases would all result in alarms if the only test was “new 1” against “old 1”.

When all windows are used and four tests are performed, however, only the real leakage

results in an alarm.

This approach has been tested with good results on the data from both false alarm tests one

and two and on real leakage test two. The result was that no randomly caused false alarms were sent but the real alarm was sent. Real leakage test one was not tested due to the number

of k values being too few.

This shows that the approach with several windows increases the accuracy of the model. It is

suggested that this method is further investigated to derive the perfect setup regarding number

of windows and window sizes.

7.1.2 False Alarms Caused by a Change in the Type of Driving

In order to avoid the false alarms caused by a change in the type of driving, the normal state

definition has to be improved so that the type of driving does not affect the k values. In chapter six it was shown that it is highly likely that the main weakness of the normal state

definition is the inability to identify the usage of the auxiliary equipments.

It is therefore suggested that the compressed air usage by the auxiliary equipments are further investigated, and that the normal state definition is adjusted according to the findings of this

investigation. An interesting test would for example be to do some test drives with different

applications served by the auxiliary circuit deactivated, and see how this would affect the

compressed air usage.

If the investigation doesn’t lead anywhere, an alternative would be to use in the normal state

definition that the pressure in circuit E24 has to be above some predefined limit (for example

7.6 bar). This would exclude all significant usage from circuit E24 from the normal state. Of course this would require the pressure in circuit E24 to be available. Due to lack of sufficient

data, this approach has not yet been tested.

7.2 Lowering the Required Computational Power

The best way to lower the required computational power, without negatively affecting the

performance of the system to much, is considered to be to simplify the mathematical methods used. For example the t-test could be replaced by simply comparing the means, thus saving

the system from compute the variances. Also the least squares method could be changed to something requiring less computational power, for example just computing the difference

between the first and the last air amount sample of the same k value.

If it is decided that a decrease in the required computational power is needed in order to be able to implement the system on vehicles, it is suggested that these simplifications are further

investigated. How much would the required computational power decrease and how would the performance be affected?

74

List of References Litterature

[1] Gunnar Blom & Björn Holmquist (1998), “Statistikteori med tillämpningar”, third

edition, Studentlitteratur, Lund

[2] Gunnar Blom (1984), “Sannolikhetsteori med tillämpningar”, second edition, Studentlitteratur, Lund

[3] Fredrik Gustafsson (2000), “Adaptive Filtering and Change Detection”, John Wiley

& Sons Ltd, West Sussex England

[4] Lennart Råde & Bertil Westergren (2004), “Mathematics Handbook – for Science and Engineering”, fifth edition, Studentlitteratur, Lund

[5] SAE J1939-71 (2010), Society of Automotive Engineers

[6] Anders Svärdström (1999), ”Signaler och System”, Studentlitteratur, Lund

[7] Tungboken – Att köra lastbil och buss, Sveriges trafikskolors riksförbund (2008),

Elvins grafiska AB, Helsingborg

Interviews

[8] Tomas Björnelund (2010-09-02), topic: system overview and different leakage characteristics.

[9] Ulf L Carlsson (2010-06-18), topic: compressed air usage by the engine.

[10] Simon Decaye (2010-06-17), topic: compressed air usage by the cab suspension

[11] Anna Pernestål (2010-07-08), topic: change detection in general.

[12] Roine Reimdal (2010-06-16), topic: compressed air usage by the ELC.

Tutoring

[13] Martin Svensson (2010-06-07 – 2010-11-15)

75

Appendix I – Simulink Model This chapter contains a detailed presentation of the Simulink model. The system logic, as described in chapter 4, will not be motivated again. This chapter will only describe how this

logic has been implemented in Simulink.

All subsystems’ names contain a level number. This tells in what layer the subsystem is located. Level one corresponds to the main system. In a subsystem, the blue ports are

subsystem inputs and the green ports are subsystem outputs. A lot of the information and descriptions in this chapter is also included as comments in the Simulink model.

Overview of the Model – Level 1 The top level of the system is shown in figure A 1. The system is broken down into five major

subsystems (each containing one or two additional layers of subsystems), one controlling the

input, one reporting the output and three different calculation subsystems, one for each of part

11, 12 and 2 (this is where the actual testing is performed). The function and logic of every subsystem will be described in greater detail later on.

Figure A 1– Simulink model, level 1

The entire system is executed once for every sample. It is easy to see that there is no feedback

from the output to the input subsystem. This means that the system does not work as a loop; instead the dynamic parts of the logic are controlled by buffers storing data where it is needed.

This will be described later.

System Input Block – Level 2 The input block takes information from CAN and feeds the rest of the model with the necessary information. Since the model does not work in real time, the CAN information

76

comes in matrix form. The model is designed to be fed by a matrix with twelve columns and

as many rows as samples. The first row has to be the index numbers, since Simulink

automatically uses this as a time scale. Row 2 through 12 should contain the following

information (in the exact same order).

Information PGN Circuit E21 pressure 65198

Circuit E22 pressure 65198 Circuit E23 pressure 65198

Circuit E24 pressure 65198

Air compressor status 65198

Purge valve open (not included in SAE J 1939)

Clutch switch 65265

Brake switch 65265 Lifting control 65114

Parking brake switch 65265 Engine speed 61444

PGN stands for parameter group number and is a standard identification code in SAE J 1939.

Information with the same PGN is included in the same message (remember that one message includes eight bytes of information, as described in section 2.6). By default Simulink uses this

information one row at a time, giving the model a real time characteristic. The first step in the

system input block is then to divide the input row into scalars, as shown in figure A 2.

Figure A 2 – System input block

The pressure samples and the engine speed sample are immediately routed to a subsystem output port. The rest of the information enters new blocks to define the normal states for part

11 and part 12 respectively. These are all Boolean variables. The “whether to measure part

11” block is shown in figure A 3. This block simply implements the normal state as defined in

section 4.5. The “whether to measure” variable equals one during normal state and zero the

77

rest of the time. The “whether to measure part 12” block is very similar, but with the

difference that it implements a different logic for the “compressor active” variable (following

the normal state definition for part 12).

Figure A 3 – “whether to measure part 11” block, output equals one during normal state

In conclusion, the system input block takes the CAN information as input. The output is a vector containing the pressure measurements for the different circuits, two Boolean variables

(one for part 11 and one for part 12) which are one during normal state and zero otherwise,

and the engine speed.

Calculations Part 11 Block – Level 2 The “calculations part 11” block takes the pressure vector and the “whether to measure”

variable as input, and returns an alarm (i.e. a Boolean variable which equals one if a leakage

is detected) as output. The block overview is shown in figure A 4.

Figure A 4 – “calculations part 11” block

It is apparent that there is also a second output, the “whether to measure vector”. This is to be used by the calculations part 2 block and will thus be dealt with later.

78

The “calculation part 11” block is broken down into three subsystems. The “pressure to air

vector creation” does two things. It converts pressure to amount of air (by using equation

(4.1)) and creates air amount vectors. This subsystem is shown in figure A 5.

Figure A 5 – “pressure to air vector creation” block, converts pressure into air amount

The volumes used to convert the pressure into amount of air are the sums of the (known) tank

and (estimated) duct volumes of every circuit, as shown below. The tank and duct volumes may differ from vehicle to vehicle, but these are the volumes on the vehicle used in the model

validation (which will follow in the next chapter).

Volumes Tank Duct Total

Volume volume volume (rounded to nearest integer)

E21 57,6 l ~10 l ~68 l E22 57,6 l 3-4 l ~61 l

E23 14,8 l 3-4 l ~18 l

E24 0 l ~2 l ~2 l

The delay line stores the n1 latest values and sends that vector every time this subsystem is

executed. The input to the enable port is the “whether to measure” variable. This subsystem is thus only executed during normal state. This means that the output always is a vector

containing the n1 latest air amount samples measured during normal state.

The “leakage or not” block (which is shown in figure A 6) takes this vector as input and returns the alarm (the Boolean variable) as output. The first step is the polyfit block, which

computes the least squares linear regression. The polyfit block output is a constant term (which is terminated) and a slope coefficient, i.e. a k value. The k value then goes two ways.

The upper way computes the mean and variance of the new k values. The delay line

constantly sends out the n2 latest k values, whose mean and variance are calculated and used

as input to the t-test. The lower way calculates the mean and variance of the old k values. The integer delay holds every k value for n2 executions, which makes the moving windows work

as described in figure 4.2. The rest is analogous with the upper way, except that n2 is replaced

by n3.

79

The t-test block (which will be described later) returns the t value as output. This is compared

to a constant to create the alarm (the output of the “compare to constant” block is one if the

comparison is true).

Figure A 6 – “leakage or not” block, computes k values and performs t-tests.

The enable port of the “leakage or not” takes the output of the “whether to measure vector”

block as input (this block is shown in figure A 7). The “whether to measure vector” block

takes the “whether to measure” variable as input and returns a Boolean variable which equals

one if the n1 latest samples (since the latest non normal state sample or since the latest k value was computed) are measured during normal state. This is done by a running sum of the

number of normal state samples, which is zeroed when a non normal state sample is measured

or when the sum equals n1 (hence when n1 consecutive normal state samples have been

measured).

Figure A 7 – “whether to measure vector” block, output equals one when a new k value should be

computed.

The “whether to measure vector” block thus returns a one when a new k value should be computed. By using this as input to the enable port on the “leakage or not” block this will

only be executed when a new k value should be computed and when a new t-test should be performed.

80

For the output of the “leakage or not” block (the alarm) to be able to equal one, the “leakage

or not” block must have been executed at least n2 + n3 times (this is controlled by the running

sum of the enable input and the AND port, seen in the lower part of figure A 6). The reason

for this is to prevent that alarms are sent when some of the input k values to the t-test is zero (the initial output before the delay lines and integer delays fills up).

The t-test block in the “leakage or not” block is shown in figure A 8. The inputs are the mean

and variance of the new and old k values respectively, and the output is the t value. The logic is taken straight from equation (3.12).

Figure A 8 – t-test part 11, output equals one if leakage is detected

The output of the “leakage or not” block will pass an AND port together with the output of

the “whether to measure vector” block before it goes to the output port of the “calculations

part 11” block. This makes that only one alarm is sent every time H0 is rejected. Without this AND port one rejected H0 would be followed by an alarm in every time step until next t-test

where H0 is not rejected.

Calculations Part 12 Block – Level 2 The calculations for part 12 are very similar to the ones of part 11. To avoid redundant

descriptions, this section will only concern the differences.

The “calculations part 12” block is shown in figure A 9. The “pressure to air vector creation” block and the “whether to measure vector” block is identical to the bocks with the same

names in “calculations part 11” (except that the design parameters are changed). The “leakage

or not” block, on the other hand, differs a little bit.

When the compressor is active, the inflow rate of compressed air depends on the engine speed

and the system pressure. As stated in section 4.5.2, this will be handled by dividing every k

value by the average engine speed and then multiplying it with the average relative production rate depending on the system pressure.

The engine speed sample goes to a delay line which constantly sends out a vector containing

the n4 latest engine speed samples. The system pressure sample goes to a look up table where

81

the relative production rate is obtained (10 bar corresponds to 100%). The relative production

rate then goes to a delay line which constantly sends out a vector containing the n4 latest

relative production rate samples. The vectors created by the delay lines are then used as input

to the “leakage or not” block.

Figure A 9 – “calculations part 12” block

The “leakage or not” block is shown in figure A 10. The only differences compared to the

corresponding block in the calculations for part 11 are the two inputs “engine speed” and “relative compressed air production”, which are both vectors of length n4. The k value

obtained in the polyfit block is divided by the mean of the “engine speed” vector and multiplied by the mean of the “relative compressed air production” vector. As stated in

section 4.5.2, this makes the k value independent of at which rate compressed air flows into

the system.

Figure A 10 – “leakage or not” block, computes k values and performs t-tests.

82

Calculations Part 2 Block – Level 2 The “calculations part 2” block takes the pressure vector and the “whether to measure vector”

variable (for both part 11 and part 12) as input, and returns the alarm type as output. The alarm type is a vector consisting of eight Boolean elements (the interpretation of this vector

will be given later).

The “calculations part 2” block is shown in figure A 11. The “pressure difference calculations” block takes the pressure vector as input and returns the pressure difference

between circuit E21 and E22 and the pressure difference between circuit E23 and E24

(according to equation (4.3)) in a two element vector as output. This vector then goes two

ways, the upper for estimate locations for part 11 leakages and the lower for part 12 leakages. Since these two calculations are identical (except for the design parameters), only the part 11

leakage location estimation will be described.

Figure A 11 – “calculations part 2” block

The two element vector is split into scalars which both enters delay lines. The delay lines

constantly sends out a vector containing the n1 latest pressure differences (the pressure in

circuit E21 minus the pressure in circuit E22 from the upper delay line and the pressure in circuit E23 minus the pressure in circuit E24 from the lower delay line). These vectors then

enters the “pressure difference change part 11” block.

The “pressure difference change part 11” block takes these two vectors as input and returns

the alarm type as output. The alarm type is a vector consisting of four Boolean elements, of

which exactly one always will equal one. If the first element equals one the leakage (if any) is most likely to be located in circuit E21, if the second element equals one the leakage (if any)

is most likely to be located in circuit E22, and so on.

The “pressure difference change part 11” block is shown in figure A 12. It consists of three

subsystems, two trend calculations (one for the pressure in circuit E21 minus the pressure in

circuit E22, and one for the pressure in circuit E23 minus the pressure in circuit E24) and the “alarm type decision” block.

83

Figure A 12 – “pressure difference change part 11” block

The two different trend calculation blocks are identical, the one for the pressure in circuit E21 minus the pressure in circuit E22 is shown in figure A 13. The first mean calculation returns

the mean value of the input vector (hence the n1 latest values of the pressure difference of circuit E21 minus E22). The upper delay line then constantly sends out the n2 latest input

vector means. The lower delay line constantly sends out the n3 latest means with a delay of n2. The mean values of the delay lines output vectors are computed respectively, and then

compared by subtracting the lower from the upper value.

Figure A 13 – Trend value calculation

The “pressure difference change part 11” is an enabled subsystem, with the “whether to

measure vector” variable as input on the enable port. The block is thus executed every time a

new k value is computed (in the part 11 calculations). This means that the subtraction in the

“pressure difference change trend circuit 1-2” (figure A 13) is between the mean value of the

pressure difference between circuit E21 and E22 measured during all samples used to

compute the “new” k values, and the mean value of the pressure difference between circuit E21 and E22 measured during all samples used to compute the “old” k values. The result of

the subtraction is hence T1 in equation (4.7).

Using the same logic, also T2 is calculated. T1 and T2 (denoted “trend circuit 1-2” and “trend circuit 3-4” in the Simulink model) are then used as input to the “alarm type decision” block

(shown in figure A 14).

This block simply implements the logic described in section 4.4.2. The output is a vector

consisting of four Boolean variables, which should be interpreted as stated earlier.

84

Figure A 14 – Alarm type decision

Since the same calculations are also made for part 12 (leakages detected during compressor active state) two of these four Boolean element vectors will be created. These two vectors are

merged creating a vector consisting of eight Boolean variables. This is the last step of the “calculations part 2” block (figure A 11), and hence the final output of the part two

calculations.

System Output Block – Level 2 The last part of the system is the system output block. As seen in figure A 1, this block takes

the alarms from part 11 and 12 and the alarm type as input. The output from this block (i.e.

the alarm) goes straight to the Matlab workspace. If this leakage detecting system (or

something based on it) is to be used in Scania vehicles in the future, the output (how alarms, if

any, will be presented) will be an important topic of its own. How the output of this Simulink model is presented is thus quite irrelevant. Instead, this output will only be interesting when

validating the model.

The system output block is shown in figure A 15. The first thing that happens is that the eight element long “alarm type” vector is divided into two four element long alarm type vectors.

These are now identical to the output from “pressure difference change part 11” and “pressure difference change part 12”, i.e. the output of “calculations part 2” if they had not been merged

(see figure A 11). These vectors constantly shows in what circuit a possible leakage is most likely (independent of a leakage is detected or not).

These vectors are then routed to the “send alarm part 11” block (shown in figure A 16) and

the “send alarm part 12” block, respectively. The only thing these subsystems do is to save the alarm type vector in a variable called Alarm11/Alarm12 on the Matlab workspace. These are

enabled subsystems which take the alarms from part 11 and part 12, respectively, as input on the enable ports.

This means that the “pressure difference change part 11” will only be executed when a

leakage is detected during compressor inactive state, and the “pressure difference change part

12” will only be executed when a leakage is detected during compressor active state.

85

Hence, if Alarm11 (Alarm12) is empty, there is no detected leakage during compressor

inactive (active) state. If it is nonempty, a leakage is detected during compressor inactive

(active) state and the most likely location of the leakage is given by what of the four vector

elements that equals one.

Figure A 15 – Simulink system output block

Figure A 16 – “send alarm part 11” block, final system output