140
A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Embed Size (px)

DESCRIPTION

A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Citation preview

Page 1: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

A Neural Network Approach to Fluid QuantityMeasurement in Dynamic Environments

Page 2: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Edin Terzic • Jenny TerzicRomesh Nagarajah • Muhammad Alamgir

A Neural NetworkApproach to FluidQuantity Measurementin Dynamic Environments

123

Page 3: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Edin TerzicDelphi Automotive SystemsRegent Court 20Sandringham, VIC 3191Australia

Jenny TerzicIveco Trucks Australia (Fiat Group)Regent Court 20Sandringham, VIC 3191Australia

Romesh NagarajahSwinburne University of TechnologyOrchard Gve 89Blackburn South, VIC 3130Australia

Muhammad AlamgirVipac AustraliaEldridge Road 4Wyndham Vale, VIC 3024Australia

ISBN 978-1-4471-4059-7 ISBN 978-1-4471-4060-3 (eBook)DOI 10.1007/978-1-4471-4060-3Springer London Heidelberg New York Dordrecht

British Library Cataloguing in Publication DataA catalogue record for this book is available from the British Library

Library of Congress Control Number: 2012936111

� Springer-Verlag London 2012

MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks orregistered trademarks of their respective holders.LabVIEWTM is a trademark of National Instruments. National Instruments Corporation, 11500 NMopac Expwy, Austin, TX 78759-3504, U.S.A. http://www.ni.com.

This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part ofthe material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission orinformation storage and retrieval, electronic adaptation, computer software, or by similar or dissimilarmethodology now known or hereafter developed. Exempted from this legal reservation are briefexcerpts in connection with reviews or scholarly analysis or material supplied specifically for thepurpose of being entered and executed on a computer system, for exclusive use by the purchaser of thework. Duplication of this publication or parts thereof is permitted only under the provisions ofthe Copyright Law of the Publisher’s location, in its current version, and permission for use must alwaysbe obtained from Springer. Permissions for use may be obtained through RightsLink at the CopyrightClearance Center. Violations are liable to prosecution under the respective Copyright Law.The use of general descriptive names, registered names, trademarks, service marks, etc. in thispublication does not imply, even in the absence of a specific statement, that such names are exemptfrom the relevant protective laws and regulations and therefore free for general use.While the advice and information in this book are believed to be true and accurate at the date ofpublication, neither the authors nor the editors nor the publisher can accept any legal responsibility forany errors or omissions that may be made. The publisher makes no warranty, express or implied, withrespect to the material contained herein.

Printed on acid-free paper

Springer is part of Springer Science+Business Media (www.springer.com)

Page 4: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Aims and Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.4 Methodology and Approach . . . . . . . . . . . . . . . . . . . . . . . . . . 71.5 Outline of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Capacitive Sensing Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Characteristics of Capacitors . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2.2 A Capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2.3 Capacitance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2.4 Capacitance in Parallel and Series Circuits. . . . . . . . . . . 142.2.5 Dielectric Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.2.6 Dielectric Strength . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3 Capacitive Sensor Applications . . . . . . . . . . . . . . . . . . . . . . . . 162.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.3.2 Proximity Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.3.3 Position Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.3.4 Humidity Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.3.5 Tilt Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

2.4 Capacitors in Level Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . 192.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.4.2 Sensing Electrodes . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.4.3 Conducting and Non-Conducting Liquids. . . . . . . . . . . . 24

2.5 Effects of Dynamic Environment. . . . . . . . . . . . . . . . . . . . . . . 25

v

Page 5: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

2.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.5.2 Effects of Temperature Variations. . . . . . . . . . . . . . . . . 252.5.3 Effects of Contamination . . . . . . . . . . . . . . . . . . . . . . . 262.5.4 Influence of Other Factors . . . . . . . . . . . . . . . . . . . . . . 28

2.6 Effects of Liquid Sloshing . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.6.2 Slosh Compensation by Dampening Methods . . . . . . . . . 292.6.3 Tilt Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302.6.4 Averaging Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

2.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3 Fluid Level Sensing Using Artificial Neural Networks . . . . . . . . . . 393.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393.2 Signal Processing and Classification . . . . . . . . . . . . . . . . . . . . 39

3.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393.2.2 Data Collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393.2.3 Signal Filtration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403.2.4 Feature Extraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413.2.5 Signal Classification . . . . . . . . . . . . . . . . . . . . . . . . . . 44

3.3 Artificial Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.3.1 Neuron Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.3.2 Transfer Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.3.3 Perceptron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

3.4 Neural Network Architectures . . . . . . . . . . . . . . . . . . . . . . . . . 493.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.4.2 Network Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.4.3 Network Topologies . . . . . . . . . . . . . . . . . . . . . . . . . . 49

3.5 Training Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.5.2 Supervised Learning . . . . . . . . . . . . . . . . . . . . . . . . . . 523.5.3 Unsupervised Learning . . . . . . . . . . . . . . . . . . . . . . . . 53

3.6 Neural Networks in Dynamic Environments . . . . . . . . . . . . . . . 533.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

3.7 Temperature Compensation with Neural Networks . . . . . . . . . . 53References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

4 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574.2 Capacitive Sensor-Based Level Sensing . . . . . . . . . . . . . . . . . . 57

4.2.1 Capacitive Sensor Signal . . . . . . . . . . . . . . . . . . . . . . . 574.2.2 Sensor Response Under Slosh Conditions . . . . . . . . . . . 58

4.3 Design of Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594.4 Feature Selection and Reduction . . . . . . . . . . . . . . . . . . . . . . . 61

vi Contents

Page 6: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

4.5 Signal Filtration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.6 Influential Factors Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 66References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

5 Experimentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695.2 Methodology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695.3 Data Collection and Processing Methodology . . . . . . . . . . . . . . 725.4 Apparatus and Equipment used in Experimental Programs . . . . . 73

5.4.1 Capacitive Level Sensor . . . . . . . . . . . . . . . . . . . . . . . 735.4.2 Fuel Tank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755.4.3 Linear Actuator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755.4.4 Heater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765.4.5 Arizona Dust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765.4.6 Signal Acquisition Card . . . . . . . . . . . . . . . . . . . . . . . . 78

5.5 Experiment Set A: Study of the Influential Factors . . . . . . . . . . 785.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785.5.2 Factorial Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795.5.3 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

5.6 Experiment Set B: Performance Estimation of Staticand Dynamic Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . 815.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815.6.2 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 815.6.3 BP Network Architecture . . . . . . . . . . . . . . . . . . . . . . . 825.6.4 Distributed Time-Delay Network Architecture . . . . . . . . 845.6.5 NARX Network Architecture . . . . . . . . . . . . . . . . . . . . 85

5.7 Experiment Set C: Performance Estimation UsingSignal Enhancement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865.7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865.7.2 Backpropagation Network Architecture . . . . . . . . . . . . . 875.7.3 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.8 Neural Network Data Processing . . . . . . . . . . . . . . . . . . . . . . . 905.8.1 Network Initialization . . . . . . . . . . . . . . . . . . . . . . . . . 925.8.2 Raw Signal Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925.8.3 Filtration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925.8.4 Feature Extraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935.8.5 Network Training . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935.8.6 Network Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

6 Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956.2 Experiment Set A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

Contents vii

Page 7: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

6.2.1 Main Effects Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956.2.2 Interaction Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 966.2.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

6.3 Experiment Set B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986.3.1 Frequency Coefficients . . . . . . . . . . . . . . . . . . . . . . . . 996.3.2 Backpropagation Network . . . . . . . . . . . . . . . . . . . . . . 996.3.3 Distributed Time-Delay Network . . . . . . . . . . . . . . . . . 996.3.4 NARX Neural Network . . . . . . . . . . . . . . . . . . . . . . . . 996.3.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

6.4 Experiment Set C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1026.4.1 Raw Capacitive Sensor Signals. . . . . . . . . . . . . . . . . . . 1026.4.2 Selection of Optimal Preprocessing Parameters

(Experiment Set C1) . . . . . . . . . . . . . . . . . . . . . . . . . . 1036.4.3 Selection of Optimal Signal Smoothing Parameters

(Experiment Set C2) . . . . . . . . . . . . . . . . . . . . . . . . . . 1086.4.4 Final Validation Results (Experiment Set C3) . . . . . . . . 1116.4.5 Frequency Coefficients . . . . . . . . . . . . . . . . . . . . . . . . 1126.4.6 Network Weights . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1146.4.7 Validation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156.4.8 Validation Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1186.4.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

7 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1217.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1217.2 Backpropagation Network Configurations. . . . . . . . . . . . . . . . . 1217.3 Selection of Signal Preprocessing Parameters . . . . . . . . . . . . . . 1227.4 Selection of Signal Smoothing Parameters . . . . . . . . . . . . . . . . 124

8 Conclusions and Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 1298.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1298.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

About the Authors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

viii Contents

Page 8: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Acronyms

ANN Artificial Neural NetworkBP Backpropagation Neural NetworkDAQ Data AcquisitiondB Decibel (logarithmic unit)DCT Discrete Cosine TransformDFT Discrete Fourier TransformDOE Design of ExperimentsDSP Digital Signal ProcessingDST Discrete Sine TransformDWT Discrete Wavelet TransformFFT Fast Fourier TransformFS Fourier SeriesFT Fourier TransformFTDNN Focused Time-Delay Neural NetworkFWT Fast Wavelet TransformIDCT Inverse Discrete Cosine TransformIFFT Inverse Fast Fourier TransformNARX Nonlinear Autoregressive Network with Exogenous InputsNN Neural NetworkOEL Occupational Exposure LimitPCMCIA Personal Computer Memory Card International AssociationPLC Programmable Logic ControllerRBF Radial Basis FunctionTDNN Distributed Time-Delay Neural NetworkWT Wavelet Transform

ix

Page 9: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Abstract

This book describes the research and development of a fluid level measurementsystem for dynamic environments. The measurement system is based on a singletube capacitive sensor. An Artificial Neural Network (ANN)-based signal char-acterization and processing system has been developed and used to compensate forthe effects of sloshing, temperature variation, and the influence of contamination influid level measurement systems operating in dynamic environments, particularlyautomotive applications. It has been demonstrated that a simple backpropagationneural network coupled with a Moving Median filter could be used to achieve thehigh levels of accuracy required, for fluid level measurement in dynamic envi-ronments including those relating to automotive applications.

xi

Page 10: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 1Introduction

1.1 Overview

This book documents a research program undertaken to design and develop acapacitive sensor-based fluid level measurement system for dynamic environ-ments, in particular automotive applications. The research work presented herein isbased on the use of a single capacitive sensor coupled with an artificial neuralnetwork (ANN)-based signal processing system for accurately determining thefluid level in dynamic environments. The objective of this research project is todesign and develop a fluid level sensor system without moving parts to accuratelydetermine the level of fluid in a dynamic environment, especially in vehicular fueltanks. The motivation for this research is the automotive industry’s requirementfor a robust and accurate fuel level measurement system that would functionreliably in the presence of slosh, temperature variation, and contamination.

This chapter provides a background to the research project and an overview ofthe problems experienced in fluid level measurement. The objectives of theresearch and the outline of this thesis are also described in this chapter.

1.2 Background

Modern automotive vehicles are equipped with digital gauges as well as withadditional functionalities that inform drivers about their vehicle’s fuel consump-tion and the remaining distance that the vehicle can travel without the need forrefuelling. The high precision digital displays and additional functionalities haveto rely on the accuracy of the fuel level measurement sensor. The reliability andaccuracy of the fluid level measurement system in the context of a dynamicenvironment, which primarily depends on the level sensor, is increasinglybecoming a concern for the automotive industry as well as everyday vehicle users.

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3_1,� Springer-Verlag London 2012

1

Page 11: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The existing fluid level sensor technology is mainly based on resistive typepotentiometers. The resistance value of the potentiometer changes with the fluidlevel. A float interconnected with the potentiometer changes the position of theterminals that are in contact with the resistive track. As the fluid level rises fromempty to full, the contacts on the resistive track slide from one end to the other,forming a complete swing. The resistive type level sensors are mechanical devicesthat are prone to wear and corrosion [1]; hence, such mechanical sensors have alimited functional life. The rubbing of the contacts across the resistive track createswear, which leads to a reduction in the accuracy of the level sensing mechanismover a short period of time.

The conventional level sensor systems used in automotive applications alsooccupy a significant amount of space because of the mechanical design that isassociated with them. The importance of level sensor accuracy and their reliabilityin hostile environments over long periods of time has led to the investigation ofvarious forms of motionless level sensors. Capacitive type level sensor is one suchexample that is increasingly being investigated as a substitute for mechanical levelsensors in industrial and particularly automotive applications. The use of capaci-tive sensor for this purpose is based on the fact that the electrical capacitance valueof the capacitive sensors changes in response to the changes in the capacitor’sphysical parameters [2].

Capacitive sensors can directly sense a variety of parameters, such as motion,chemical composition, electric field; and they can also indirectly sense many othervariables which can be converted into motion or dielectric constant, such aspressure, acceleration, fluid level, and fluid composition [2, 3]. Capacitive sensorscomprise sensing electrodes that operate with excitation voltage and a detectioncircuit. The detection circuitry modulates the variations in capacitance into avoltage, frequency, or pulse width modulated signal. Capacitive sensors have abroad range of applications that range from motion detection to proximity sensing.Some of these applications are described below: [4]

• Motion detectors can detect 10–14 m displacements with good stability, highspeed, and wide extremes of environment, and capacitive sensors with largeelectrodes can detect an automobile and measure its speed;

• Capacitive technology is displacing piezoresistance in silicon implementationsof accelerometers and pressure sensors, and innovative applications like fin-gerprint detectors and infrared detectors are appearing on silicon with sensordimensions in the microns and electrode capacitance of 10-15 F, with resolutionto 5-18 F;

• Capacitive sensors in oil refineries measure the quantity of water in oil, andsensors in grain storage facilities measure the moisture content of wheat;

• In the home, cost-effective capacitive sensors operate soft-touch dimmerswitches and provide the home craftsman with wall stud sensors and digitalconstruction levels;

• Laptop computers use capacitive sensors for two-dimensional cursor control, andtransparent capacitive sensors on computer monitors are found in retail kiosks.

2 1 Introduction

Page 12: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Tubular capacitive sensors are generally used for fluid level sensing applica-tions. The sensor determines the fluid level by measuring dielectric constant,which, in the case of fluid level sensing, is essentially the fluid in the tank filled inbetween two cylindrical tubes of radii ra and rb. If L0 is the length of the capacitivesensing tube, e0 is the permittivity of free space, and er is the dielectric constant ofthe fluid being then the capacitance value to be calculated using [5, 6]:

C ¼ erpe0L0

lnrb

ra

0B@

1CA F ð1:1Þ

Figure 1.1 shows (a) the basic structure of the tubular capacitive sensor and (b)its application in a fluid level measurement system. If the geometry of the sensingtube remains constant, the capacitance of the sensing tube is proportional to thedielectric constant [7], as shown in (1.2):

C / er ð1:2Þ

The dielectric constant is influenced by atmospheric changes such as temper-ature, humidity, pressure, and composition [8]. Environmental factors such astemperature, pressure, and humidity can affect the dielectric constant value of acapacitor and therefore, these effects can severely deteriorate the precision of thelevel measurement system [8]. Since capacitance is dependant on the dielectricconstant er, any variation in the dielectric constant of the fluid will lead to errors inthe level sensing measurements. These variations can be caused by contaminationor different fluids with different dielectric constants being mixed together, i.e., themixture of fuel and water contents in an automotive fuel tank will lead to inac-curate results. Temperature variation is another factor that reduces the sensoraccuracy by shifting the value of the dielectric constant. Changes in temperaturecan also alter the distance and area of the conducting plates of a capacitor. Insummary, the output of the capacitive sensor will be subject to inaccuracy, due to

(b)

L0Fluid (εr)

Tubular Capacitive Sensor

Lx

(a)

Fig. 1.1 Tubular capacitive sensor for fluid level sensing applications

1.2 Background 3

Page 13: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

the influence of contamination and temperature factors. As capacitive sensorstypically exhibit nonlinear response characteristics, an exact mathematical modeldescribing the relationship of the sensor response to the effects of environmentalfactors becomes more difficult to develop. Reference capacitive sensors [9–13]have been used in the past that recalibrate the dielectric constant parameter toimprove the capacitive sensor accuracy; however, the cost associated with such aconfiguration that requires an additional reference capacitor prohibits its wider usein applications where the cost factor plays an important role.

Apart from the accuracy of the level sensor itself, the fluid level measurementsystem operating in dynamic environments (i.e. automotive fuel tank) is influencedby sloshing. In automotive fuel tanks, the vehicle acceleration induces slosh waveswith natural frequencies dependent on the magnitude of the acceleration, geometryof the tank, and the amount of fluid contained in the tank [14, 15].

To compensate for the effects of sloshing in fluid level measurement systems,various mechanical dampening methods consisting of baffles, electrical dampeningtechniques utilizing low-pass filters, and statistical averaging methods have beenused in the past. However, all these approaches lead to higher production cost, andyet the accuracy of these measurement systems under sloshing conditions is notimproved significantly. The electrical dampening techniques and the statisticalaveraging methods primarily perform averaging on the raw sensor signals oversome period of time. Averaging over a variable timeframe has also been used inthe past [16–18] to improve the level sensor accuracy under sloshing conditions.This is done by determining the running state of the vehicle using the vehiclespeed data from the speed sensor. The fluid measurement system described byKobayashi et al. [17] employs a vehicle speed sensor to determine the runningstate of the vehicle. When the vehicle is operating at low speed (i.e. static con-dition), the averaging period is reduced to small values, and when the vehicle isoperating at a higher speed, the averaging period is prolonged up to 90 s. Despitethe dependence of the measurement system on the speed sensor, after analyzingthe raw sensor data from a resistive type fuel level sensor in a moving vehicle, ithas been observed that the averaging method still produces significant error afteraveraging the raw sensor signal over a longer period of time. Figure 1.2 illustratesthe raw volume signal obtained from a vehicle in motion, and two averaged signalscalculated after averaging the raw signal over 20 s, which is the typical averagingtime used in an automotive instrument cluster; and the second signal is an aver-aged signal over 90 s, which is a reasonably long period of time.

To improve the accuracy of fluid level measurement systems in dynamicenvironments in a cost-effective manner, a novel approach based on ArtificialNeural Networks (ANNs) is researched and described in this thesis. ANNs havethe ability to learn and recognize patterns. ANNs have been successfully used inmany applications to understand complicated problems and accurately predict asolution. Some applications of ANNs are voice recognition, face recognition,character recognition, meteorological forecasting, etc. [19–22]. Intelligentmachines and sensors that are intended to operate in dynamic environments can bedeveloped with neural networks without compromising accuracy. Patra et al. [23]

4 1 Introduction

Page 14: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

and Song et al. [24] have used neural networks to develop intelligent sensors thatcompensate for nonlinear environmental parameters. Neural networks can recog-nize patterns; and with sufficient number of hidden neurons having sigmoidalfunctions, they can be trained to produce any continuous multivariate functionwith any desired level precision [25]. The complex behavior of sensors in harshenvironments as well as the phenomena of sloshing can be analyzed using ANNsand any compensation for sensor inaccuracies can also be made using thisapproach. The sensing approach developed in this research is also applicable tonon-capacitive sensors such as ultrasonic and hall-effect sensors.

Additionally, prior to classifying the sensor signals with neural networks, thesystems approach described in this thesis performs signal enhancement on rawsensor signals. Three commonly used signal smoothing filters are investigatedthrough experimentation. The investigated filters consist of Moving Mean, MovingMedian, and Wavelet filters. These filters provide the following enhancements[26]:

• Remove impulse noise;• Smooth the signal curve;• Can be taken over wide intervals;• Preserve sharp edges of the signal curve.

In this research, various configurations of capacitive sensors are investigated todetermine the most appropriate, yet cost-effective setup of the capacitive type levelmeasurement system. Various limitations of capacitive sensors when operating indynamic environments are identified in the literature review section to assist in thedevelopment of a robust system that will perform to an acceptable level ofaccuracy. The experimental program for this research is designed and conductedusing the Design of Experiments (DOE) methodology. DOE involve differentscenarios consisting of various combinations of input factors to test the effects ofthose combinations of factors on the outcome (response factor) [27]. DOE is themost appropriate way to measure ‘main effects and interactions’ of the factors thatinfluence the accuracy of a fluid level measurement system [27]. To determine themost appropriate configuration of the ANN, experiments are performed to compare

Fig. 1.2 Raw sensor signal and an averaged sensor signal from a resistive type level sensor

1.2 Background 5

Page 15: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

the performance of various neural network architectures. Further experiments areconducted to compare the performance of the three investigated signal smoothingfilters, namely, Moving Mean, Moving Median, and Wavelet Filter. Finally, basedon the experimental results, a robust fluid level measurement system with highaccuracy is developed and analyzed using an extensive field trial program. Toinvestigate the performance of the proposed system, several field trials are carriedout by driving a vehicle with the developed sensor installed on suburban areasbased in Melbourne. This thesis also provides a detailed comparison of thedeveloped neural network-based fluid level measurement system with the currentlyused system. The results from this research indicate that the proposed system isable to determine the fluid level in dynamic environments with high accuracy andis superior in performance to existing systems.

1.3 Aims and Objectives

The purpose of this research is to investigate the use of artificial intelligence-basedtechniques in combination with a capacitive type sensor technology to achieveaccurate fluid level measurements in dynamic environments. The researchinvolves the design, development, and validation of a fluid level measurementmethodology and a system that is applicable in the context of potentially haz-ardous fluids and in dynamic environments.

The research aims to develop a robust fluid level sensor that maintains itsperformance and preserves its accuracy over a long period of time. The sensor isrequired to accurately determine fluid level under dynamic operating conditionsespecially, temperature variation, contamination, and slosh. To validate the arti-ficial intelligence-based fluid level measurement system under dynamic environ-ments, several field trials are carried out experimentally on a running vehicle,where the goal is to accurately determine the fuel level in the vehicle fuel tankunder sloshing and dynamic conditions. It is expected that the harshness of theambient environment would not adversely affect the accuracy of the sensor.

In summary, the research addresses the following aims:

• To obtain an understanding of the possible weaknesses and drawbacks of using acapacitive sensor as a fluid level measurement sensor;

• To understand the effects of liquid sloshing, temperature variations, and con-taminants on the sensor response;

• To understand the effectiveness of using ANNs as a signal processing techniqueto overcome the effects that sloshing and environmental changes might have onthe level sensor readings; and

• To understand the enhancement of the accuracy of the measurement system byusing different preprocessing filters on the sensor signal.

It is intended that the knowledge gained through this project will have thebroadest possible applications in intelligent sensor design.

6 1 Introduction

Page 16: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

1.4 Methodology and Approach

To achieve the aforementioned research objectives, an approach consisting of thefollowing steps is undertaken:

• Examining the relationship between the capacitive sensor output and theinfluential factors such as temperature, slosh, and contamination by adoptingthe DOE methodology;

• Understanding the characteristics of slosh waves at different levels of fluid in astorage tank;

• Understanding the patterns of the capacitive sensor output under dynamicconditions in both time and frequency domains;

• Determining the effectiveness of neural network-based signal processing tech-nique in improving the accuracy of the capacitive sensor-based fluid levelmeasurement system;

• Determining the most suitable neural network topology by investigating dif-ferent types of ANNs using experimental slosh data;

• Developing and training a set of selected neural network topologies using thedata samples obtained from the field trials;

• Investigating the influence of different signal enhancement techniques inimproving the performance of the ANN-based fluid level measurement systemunder dynamic real-life conditions.

1.5 Outline of the Thesis

This thesis comprises eight chapters that are briefly introduced below:Chapter 1 provides an introduction to the background problem and to the

project. An overview of the research program, covering the objectives andmethodology of this research are detailed in this chapter.

Chapter 2 provides a review of capacitive sensor technology, the details ofcapacitive type sensors, and their application in industrial environments. Thischapter also describes the limitations of capacitive sensors in the context ofindustrial applications.

Chapter 3 focuses on the basics of ANNs, including its various architectures,and its use in industrial applications. This chapter also focuses on the signalprocessing and classification aspects of ANNs in level sensing applications.A background to various signal classification approaches is also provided in thischapter.

Chapter 4 introduces the concept of having a capacitive sensor combined withANN-based signal processing for accurate and reliable fluid level measurement indynamic environments. The methodology underpinning the proposed system isdetailed in this chapter.

1.4 Methodology and Approach 7

Page 17: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 5 describes the experimental setup of the research work. The DOEsapproach and the equipments used for the experiments are described in Chap. 5. Inbrief, it covers all major experiments that are performed:

1. To analyze the sensor response under dynamic conditions;2. To determine the performance of different neural network topologies in relation

to the capacitive sensor signals under slosh;3. To understand the improvements provided by the three signal smoothing

functions (Moving Mean, Moving Median, and Wavelet filter).

Chapter 6 presents the experimental results for three major sets of experimentsperformed using the proposed approach to level sensing. It details experimentationresults of the three experiments in the presentation of Main Effects plots, Inter-action plots, Observed sensor signals, Frequency Coefficients plot, and Validationresults using various configurations of the ANN-based signal classificationtechnique.

Chapter 7 provides a detailed discussion of the experimental results. Theinfluence of the three influential factors (temperature, slosh, contamination) on theresponse of the capacitive sensor is discussed. The results obtained using differentANN topologies are also compared and discussed in this chapter. The influence ofsignal enhancement on the performance of the neural network-based signal clas-sifier is also discussed and finally the results are compared with current averaging-based fluid level measurement systems.

Chapter 8 provides the final conclusions of the research investigation. Thesummary of the findings of this research and suggestions for possible futureimprovements to the proposed approach to fluid level sensing in dynamic envi-ronments are presented here.

References

1. Fischer-Cripps, A. C. (2002). Force, pressure and flow. In Newnes interfacing companion(pp. 54–70). Oxford, Boston: Newnes.

2. Eren, H., & Kong, W. L. (1999). Capacitive sensors—displacement. In J. G. Webster (Ed.),The measurement, instrumentation, and sensors handbook. Boca Raton, FL: CRC Press LLC.

3. Dunn, W. C. (2005). Introduction to instrumentation, sensors and process control. Boston:Artech House.

4. Baxter, K. (1997). Capacitive sensors—design and applications. In Herrick, J. (ed.): 293IEEE Press.

5. Fraden, J. (2004). Handbook of modern sensors : Physics, designs, and applications. NewYork: Springer.

6. Pallás-Areny, R., & Webster, J. G. (2001). Reactance variation and electromagnetic sensors.In Sensors and signal conditioning (pp. 207–213). New York: Wiley.

7. Jewett, J. W., & Serway, R. A. (2004). Physics for scientists and engineers (6th ed.).Belmont: Thomson.

8. LION-Precision. (2006). Capacitive sensor operation and optimization (Technotes, no. LIONPRECISION).

8 1 Introduction

Page 18: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

9. Hochstein, P. A. (1990, February 07). inventor Teleflex Inc (US), assignee. Capacitive liquidsensor. Patent 5005409.

10. Mcculloch, M. L., Bruer, R. E., & Byram, T. P. (1997, September 09). inventors; AmericanMagnetics Inc (US) assignee. Capacitive level sensor and control system. Patent 6016697.

11. Takita, M. (2004, September 15). inventor Environmentally compensated capacitive sensor.Patent 20060055415.

12. Wells, P. (1990, July 23). inventor IIMorrow, Inc., assignee. Capacitive fluid level sensor.Patent 5042299.

13. Tward, E., & Junkins, P. (1982, February 03). inventors; Tward 2001 Limited (Los Angeles,CA) assignee. Multi-capacitor fluid level sensor. Patent 4417473.

14. Ibrahim, R. A. (2005). Liquid sloshing dynamics : Theory and applications. Cambridge, NewYork: Cambridge University Press.

15. Dai, L., & Xu, L. (2006). A numerical scheme for dynamic liquid sloshing in horizontalcylindrical containers. Proceedings of the Institution of Mechanical Engineers, Part D:Journal of Automobile Engineering, 220(7), 901–918.

16. Kobayashi, H., & Obayashi, H. (1983, June 08). inventors; Nissan Motor Company, Limited,assignee. Fuel volume measuring system for automotive vehicle. Patent 4611287.

17. Kobayashi, H., & Kita, T. (1982, December 30). inventors; Nissan Motor Company, Limitedassignee. Fuel gauge for an automotive vehicle. Patent 4470296.

18. Guertler, T., Hartmann, M., Land, K., & Weinschenk, A. (1997, January 27). inventors;DAIMLER BENZ AG (DE) assignee. Process for determining a liquid quantity, particularlyan engine oil quantity in a motor vehicle. Patent 5831154.

19. Krose, B., & van der Smagt, P. (1996). An introduction to neural networks. Amsterdam: TheUniversity of Amsterdam.

20. Rojas, R. (1996). Neural networks—a systematic introduction. New York: Springer.21. Veelenturf, L. P. J. (1995). Analysis and applications of artificial neural networks. London,

New York: Prentice Hall.22. Freeman, J. A., & Skapura, D. M. (1991). Neural networks: Algorithms, applications, and

programming techniques. Boston: Addison-Wesley.23. Patra, J. C., Juhola, M., & Meher, P. K. (2008). Intelligent sensors using computationally

efficient Chebyshev neural networks. Science Measurement & Technology, IET, 2(2), 68–75.24. Song, Z., Liu, C., Song, X., Zhao, Y., & Wang, J. (2007, December 15–18). A virtual level

temperature compensation system based on information fusion technology. IEEEInternational Conference on Robotics and Biomimetics, pp. 1529–1533.

25. Ripley, B. D. (1993). Statistical aspects of neural networks. In O. E. Barndorff-Nielsen, J.L. Jensen, & W. S. Kendall (Eds.), Networks and chaos—statistical and probabilistic aspects(pp. 40–123). London: Chapman & Hall.

26. Allen, R. L., & Mills, D. W. (2004). Time-domain signal analysis. In Signal analysis : Time,frequency, scale, and structure (p. 322). Piscataway, NJ: IEEE Press, Wiley-Interscience.

27. Bass, I., & Lawton, B. (2009). Improve. In Lean six sigma using sigmaxl and minitab (pp.213–282). New York: McGraw-Hill.

References 9

Page 19: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 2Capacitive Sensing Technology

2.1 Overview

This chapter describes the basic properties of capacitive sensor technologies and theiruse in various kinds of sensors in industrial applications. Physical properties as well assome limitations of capacitive sensing are described here. The use of capacitive sensorswith hazardous fluids, such as gasoline based fuels, and various configurations ofcapacitive sensors used in the application of fluid level measurement in dynamicenvironments are described. In brief, this chapter provides information on capacitivesensing technology and its use in dynamic and hostile environments.

2.2 Characteristics of Capacitors

2.2.1 Overview

Capacitors are the basic building blocks of the electronic world. To understandhow capacitive sensors operate, it is important to understand the fundamentalproperties and principles of capacitors. This section provides details on theunderlying principles of the capacitor. The physical, geometrical, and the electricalproperties of capacitors are discussed in this section.

2.2.2 A Capacitor

A capacitor is a device that consists of two electrodes separated by an insulator [1].Capacitors are generally composed of two conducting plates separated by a non-

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3_2,� Springer-Verlag London 2012

11

Page 20: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

conducting substance called dielectric (er) [1, 2]. The dielectric may be air, mica,ceramic, fuel, or other suitable insulating material [2]. The electrical energy orcharge is stored on these plates. Figure 2.1 illustrates a basic circuit configurationthat charges the capacitor as soon as the switch is closed.

Once a voltage is applied across the two terminals of the capacitor, theconducting plates will start to store electrical energy until the potential differenceacross the capacitor matches with the source voltage. The electrical charge remainson the plates after disconnecting the voltage source unless another componentconsumes this charge or the capacitor loses its charge because of leakage, since nodielectric is a perfect insulator. Capacitors with little leakage can hold their chargefor a considerable period of time [2]. The plate connected with the positiveterminal stores positive charge (or +Q) on its surface and the plate connected to thenegative terminal stores negative charge (or -Q).

The time required to fully charge a capacitor is determined by Time Constant(s). The value of the time constant describes the time it takes to charge a capacitorto 63% of its total capacity [1]. The time constant (s) is measured in seconds andcan be defined as in Eq. 2.1, where, R is the resistor connected inline with thecapacitor having C capacitance.

s ¼ RC ð2:1Þ

2.2.3 Capacitance

Capacitance is the electrical property of capacitors. It is the measure of the amountof charge that a capacitor can hold at a given voltage [2]. Capacitance is measuredin Farad (F) and it can be defined in the unit coulomb per volt as:

C ¼ Q

Vð2:2Þ

where,C is the capacitance in farad (F),Q is the magnitude of charge stored on each plate (coulomb),V is the voltage applied to the plates (volts).

Battery

Capacitor (C)

+Q

-Q

+-

Resistor (R)

Fig. 2.1 Capacitor used in acircuit to store electricalcharge

12 2 Capacitive Sensing Technology

Page 21: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

A capacitor with the capacitance of one farad can store one coulomb of chargewhen the voltage across its terminals is 1 V [2]. Typical capacitance values rangefrom about 1 pF (10-12 F) to about 1,000 lF (10-3 F) [3]. An electric field willexist between the two plates of a capacitor if the voltage is applied to one of theplates [1]. The resulting electric field is due to the difference between the electriccharges stored on the surfaces of each plate. The capacitance describes the effectson the electric field due to the space between the two plates.

The capacitance depends on the geometry of the conductors and not on anexternal source of charge or potential difference [2, 4]. The space between the twoplates of the capacitor is covered with dielectric material. In general, the capaci-tance value is determined by the dielectric material, distance between the plates,and the area of each plate (illustrated in Fig. 2.2). The capacitance of a capacitorcan be expressed in terms of its geometry and dielectric constant as [5]:

C ¼ ere0A

dð2:3Þ

where,C is the capacitance in farads (F),er is the relative static permittivity (dielectric constant) of the material between

the plates,e0 is the permittivity of free space, which is equal to 8:854� 10�12 F=m;A is the area of each plate, in square meters andd is the separation distance (in meters) of the two plates.

The capacitance phenomenon is related to the electric field between the twoplates of the capacitor [6]. The electric field strength between the two platesdecreases as the distance between the two conducting plates increases [1].Lower field strength or greater separation distance will lower the capacitancevalue. The conducting plates with larger surface area are able to store moreelectrical charge; therefore, a larger capacitance value is obtained with greatersurface area.

A

d

(a)

A

d

(b)

A

d

(c)

Fig. 2.2 Factors influencing capacitance value. a Normal. b Increased surface area, increasedcapacitance. c Decreased gap distance, increased capacitance

2.2 Characteristics of Capacitors 13

Page 22: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

2.2.4 Capacitance in Parallel and Series Circuits

The net capacitance of two or more capacitors, connected next to each other,depends on their connection configurations [3]. If two capacitors are connected inparallel, they both will have the same voltage across them; therefore, their netcapacitance will be the sum of the two capacitances. The net capacitance of aparallel combination of capacitors is given as [4]:

CT ¼Q1

Vþ Q2

Vþ � � � þ Qn

V; or ð2:4Þ

CT ¼ C1 þ C2 þ � � � þ Cn ð2:5Þ

where, CT is the total capacitance of the capacitors connected in parallel.Figure 2.3 shows the circuit configuration of multiple capacitors having capaci-

tances (C1, C2,…, C4). Both circuits (a) and (b) have the equivalent capacitance CT,which is the sum of all capacitances. However, if two or more capacitors are con-nected in series, the voltage across the two terminals may be different for eachcapacitor; although the electric charge will be the same on all of them [4]. Theequivalent capacitance of capacitors connected in series can be stated as (Fig. 2.4):

1CT

¼ V1

Qþ V2

Qþ � � � þ Vn

Q; or ð2:6Þ

1CT

¼ 1C1þ 1

C2þ � � � þ 1

Cnð2:7Þ

V

C1 C2 C3 C4

V

CT

(a) (b)

Fig. 2.3 Net capacitance of capacitors connected in parallel

(a)

VC1 C2

C3

(b)

V

CT

Fig. 2.4 Net capacitance of capacitors connected in series

14 2 Capacitive Sensing Technology

Page 23: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

2.2.5 Dielectric Constant

The gap between the two surfaces of a capacitor is filled with a non-conducting materialsuch as rubber, glass or, wood that separates the two electrodes of the capacitor [4]. Thismaterial has a certain dielectric constant. The dielectric constant is the measure of amaterial’s influence on the electric field. The net capacitance will increase or decreasedepending on the type of dielectric material. Permittivity relates to a material’s ability totransmit an electric field. In the capacitors, an increased permittivity allows the samecharge to be stored with a smaller electric field, leading to an increased capacitance.

According to Eq. 2.3, the capacitance is proportional to the amount of dielectricconstant. As the dielectric constant between the capacitive plates of a capacitorrises, the capacitance will also increase accordingly. The capacitance can be statedin terms of the dielectric constant, as [4]:

C ¼ er � C0 ð2:8Þ

where, C is the capacitance in Farads, er is the dielectric constant and C0 is thecapacitance in the absence of dielectric constant.

Different materials have different magnitudes of dielectric constant. Forexample, air has a nominal dielectric constant equal to 1.0, and some common oilsor fluids such as gasoline have nominal dielectric constant of 2.2. If gasoline isused as dielectric instead of air, the capacitance value using the gasoline asdielectric will increase by a factor of 2.2. This factor is called Relative dielectricconstant or Relative electric permittivity [2]. Some commonly used dielectricmaterials and their corresponding dielectric values are listed in Table 2.1.

2.2.6 Dielectric Strength

The electrical insulating properties of any material are dependent on dielectricstrength [7]. The dielectric strength of an insulating material describes the

Table 2.1 Commonly used dielectric materials and their values [4, 6]

Material Dielectric constant Material Dielectric constant

Accetone 19.5 Mica 5.7–6.7Air 1.0 Paper 1.6–2.6Alcohol 25.8 Petroleum 2.0–2.2Ammonia 15–25.0 Polystyene 3.0Carbon dioxide 1.0 Powdered milk 3.5–4.0Chlorine liquid 2.0 Salt 6.1Ethanol 24.0 Sugar 3.3Gasoline 2.2 Transformer oil 2.2Glycerin 47.0 Turpentine oil 2.2Hard paper 4.5 Water 80.0

2.2 Characteristics of Capacitors 15

Page 24: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

maximum electric field of that material. If the magnitude of the electric field acrossthe dielectric material exceeds the value of the dielectric strength, the insulatingproperties of the dielectric material will breakdown and the dielectric material willbegin to conduct [1]. The breakdown voltage or rated voltage of a capacitorrepresents the largest voltage that can be applied to the capacitor withoutexceeding the dielectric strength of the dielectric material [1]. The applied voltageacross a capacitor must be less than its rated voltage. The operating voltage acrossa capacitor can be increased depending on the insulating material or the dielectricconstant. Teflon and Polyvinyl chloride have greater dielectric strength. Thedielectric constant can be increased by adding high dielectric constant fillermaterial [8]. Table 2.2 lists the dielectric strength values for different types ofmaterials at room temperature.

Factors such as thickness of the specimen, operating temperature, frequency,and humidity can affect the strength of the dielectric materials.

2.3 Capacitive Sensor Applications

2.3.1 Overview

A capacitive sensor converts a change in position, or properties of the dielectricmaterial into an electrical signal [9]. According to the Eq. 2.3 in Sect. 2.2.3,capacitive sensors are realized by varying any of the three parameters of acapacitor: distance (d), area of capacitive plates (A), and dielectric constant (er);therefore:

C ¼ f ðd;A; erÞ ð2:9Þ

A wide variety of different kinds of sensors have been developed that areprimarily based on the capacitive principle described in Eq. 2.3. These sensors’functionalities range from humidity sensing, through level sensing, to

Table 2.2 Approximate dielectric strengths of various materials [4]

Material Dielectric strength(106 V/m)

Material Dielectric strength(106 V/m)

Air (dry) 3 Polystyrene 24Bakelite 24 Polyvinyl chloride 40Fused quartz 8 Porcelain 12Mylar 7 Pyrex glass 14Neoprene rubber 12 Silicone oil 15Nylon 14 Strontium titanate 8Paper 16 Teflon 60Paraffin-impregnated paper 11

16 2 Capacitive Sensing Technology

Page 25: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

displacement sensing [10]. A number of different kinds of capacitance basedsensors used in a variety of industrial and automotive applications are discussed inthis section.

2.3.2 Proximity Sensing

A proximity sensor is a transducer that is able to detect the presence of nearbyobjects without any physical contact. Normally a proximity sensor emits anelectromagnetic or electrostatic field, or a beam of electromagnetic radiation (e.g.infrared), and detects any change in the field or return signal. Capacitive typeproximity sensors consist of an oscillator whose frequency is determined by aninductance–capacitance (LC) circuit to which a metal plate is connected. When aconducting or partially conducting object comes near the plate, the mutualcapacitance changes the oscillator frequency. This change is detected and sent tothe controller unit [11]. The object being sensed is often referred to as the prox-imity sensor’s target. Figure 2.5 shows an example of the capacitive proximitysensor. As the distance between the proximity sensor and the target object getssmaller, the electric field distributed around the capacitor experiences a change,which is detected by the controller unit.

The maximum distance that a proximity sensor can detect is defined as‘nominal range’. Some sensors have adjustments of the nominal range or ways toreport a graduated detection distance. A proximity sensor adjusted to a very shortrange is often used as a touch switch. Capacitive proximity detectors have a rangetwice that of inductive sensors, while they detect not only metal objects but alsodielectrics such as paper, glass, wood, and plastics [12]. They can even detectthrough a wall or cardboard box [12]. Because the human body behaves as anelectric conductor at low frequencies, capacitive sensors have been used for humantremor measurement and in intrusion alarms [12]. Capacitive type proximitysensors have a high reliability and long functional life because of the absence ofmechanical parts and lack of physical contact between sensor and the sensedobject.

An example of a proximity sensor is a limit switch, which is a mechanical push-button switch that is mounted in such a way that it is activated when a mechanicalpart or lever arm gets to the end of its intended travel [13]. It can be implemented

Capacitive Proximity Sensor

Target Object

Electric FieldFig. 2.5 Capacitance basedproximity sensor

2.3 Capacitive Sensor Applications 17

Page 26: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

in an automatic garage door opener; where the controller needs to know if the dooris all the way open or all the way closed [13]. Other applications of the capacitiveproximity sensors are:

• Spacing—If a metal object is near a capacitor electrode, the mutual capacitanceis a very sensitive measure of spacing [14].

• Thickness measurement—Two plates in contact with an insulator will measurethe insulator thickness if its dielectric constant is known, or the dielectricconstant if the thickness is known [14].

• Pressure sensing—A diaphragm with stable deflection properties can measurepressure with a spacing-sensitive detector [14].

2.3.3 Position Sensing

A position sensor is a device that allows position measurement. Position can be either anabsolute position or a relative one [15]. Linear as well as angular position can be measuredusing position sensors. Position sensors are used in many industrial applications suchas fluid level measurement, shaft angle measurement, gear position sensing, digitalencoders and counters, and touch screen coordinate systems. Traditionally, resistive typepotentiometers were used to determine rotary and linear position. However, the limitedfunctional life of these sensors caused by mechanical wear has made resistive sensorsless attractive for industrial applications. Capacitive type position sensors are normallynon-mechanical devices that determine the position based on the physical parameters ofthe capacitor. Position measurement using a capacitive position sensor can be performedby varying the three capacitive parameters: Area of the capacitive plate, Dielectricconstant, and Distance between the plates. The following applications are some examplesof the utilization of capacitive position sensors in:

• Liquid level sensing—Capacitive liquid level detectors sense the liquid level in areservoir by measuring changes in capacitance between conducting plates whichare immersed in the liquid, or applied to the outside of a non-conducting tank[14].

• Shaft angle or linear position—Capacitive sensors can measure angle or positionwith a multi-plate scheme giving high accuracy and digital output, or with ananalogue output with less absolute accuracy but faster response and simplercircuitry.

• X–Y tablet—Capacitive graphic input tablets of different sizes can replace thecomputer mouse as an x–y coordinate input device. Finger-touch-sensitivedevices such as iPhone [16], z-axis-sensitive and stylus-activated devices areavailable.

• Flow meter—Many types offlow meters convert flow to pressure or displacement,using an orifice for volume flow or Coriolis Effect force for mass flow. Capacitivesensors can then measure the displacement.

18 2 Capacitive Sensing Technology

Page 27: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

2.3.4 Humidity Sensing

The dielectric constant of air is affected by humidity. As humidity increases thedielectric increases [17]. The permittivities of atmospheric air, of some gases, andof many solid materials are functions of moisture content and temperature [10].Capacitive humidity devices are based on the changes in the permittivity of thedielectric material between plates of capacitors [10]. Capacitive humidity sensorscommonly contain layers of hydrophilic inorganic oxides which act as a dielectric[18]. Absorption of polar water molecules has a strong effect on the dielectricconstant of the material [18]. The magnitude of this effect increases with a largeinner surface which can accept large amounts of water [18].

The ability of the capacitive humidity sensors to function accurately and reliablyextends over a wide range of temperatures and pressures. They also exhibit lowhysteresis and high stability with minimal maintenance requirements. These featuresmake capacitive humidity sensors viable for many specific operating conditions andideally suitable for a system where uncertainty of unaccounted conditions existsduring operations. There are many types of capacitive humidity sensors, which aremainly formed with aluminium, tantalum, silicon, and polymer types [10].

2.3.5 Tilt Sensing

In recent years, capacitive-type micro-machined accelerometers are gaining popularity.These accelerometers use the proof mass as one plate of the capacitor and use the otherplate as the base. When the sensor is accelerated, the proof mass tends to move; thus, thevoltage across the capacitor changes. This change in voltage corresponds to the appliedacceleration. Micromachined accelerometers have found their way into automotiveairbags, automotive suspension systems, stabilization systems for video equipment,transportation shock recorders, and activity responsive pacemakers [19].

Capacitive silicon accelerometers are available in a wide range of specifications.A typical lightweight sensor will have a frequency range of 0–1,000 Hz, and adynamic range of acceleration of ±2 to ±500 g [19]. Analogue Devices, Inc. [20] hasintroduced integrated accelerometer circuits with a sensitivity of over 1.5 g [14].With this sensitivity, the device can be used as a tiltmeter [14].

2.4 Capacitors in Level Sensing

2.4.1 Overview

The general properties of the capacitor described in Sect. 2.2.3 can be used tomeasure the fluid level in a storage tank. In a basic capacitive level sensing system,capacitive sensors have two conducting terminals that establish a capacitor. If the

2.3 Capacitive Sensor Applications 19

Page 28: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

gap between the two rods is fixed, the fluid level can be determined by measuringthe capacitance between the conductors immersed in the liquid. Since the capac-itance is proportional to the dielectric constant, fluids rising between the twoparallel rods will increase the net capacitance of the measuring cell as a function offluid height. To measure the liquid level, an excitation voltage is applied with adrive electrode and detected with a sense electrode. Figure 2.6 illustrates a basicset-up of a liquid level measurement system.

In this section, various aspects and configurations of capacitive fluid levelmeasurement systems have been described in detail.

2.4.2 Sensing Electrodes

The sensing electrodes of the capacitive sensor could be shaped into various formsand structures. The geometry of the sensing electrodes influences the electric fieldbetween them. For example, the capacitance between two parallel rods will bedifferent from that between two parallel plates because of the nature of electricfield distribution around an electrically charged object. A few types of sensingelectrodes, such as cylindrical rods, rectangular plates, helixical wires, and tubularshaped capacitors are described in this subsection.

2.4.2.1 Cylindrical Rods

Cylindrical rods are made of conductors, where the negative electrode stores thenegative charge and the positive electrode stores the positive charge. An electricalfield will exist between the two electrodes if a voltage is applied across them.

Figure 2.7 illustrates the two cylindrical rods separated by distance d. The capac-itance between the two parallel rods can be determined by the following rule [21]:

C ¼ pe0er

lnd

r

L; If d � r ð2:9Þ

Drive electrode Sense

electrode

Fluid

Fig. 2.6 Basic liquid levelsensing system

20 2 Capacitive Sensing Technology

Page 29: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

C ¼ pe0er

lnd þ

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

d2 � 4r2p

2r

! L; where d � r ð2:10Þ

where,C is the capacitance in farads (F),er is the relative static permittivity (dielectric constant) of the material between

the plates,e0 is the permittivity of free space, which is equal to 8:854� 10�12 F=m;L is the rod length in meters,d is the separation distance (in meters) of the two rods,r is the radius of the rod in meters.

2.4.2.2 Cylindrical Tubes

Cylindrical tube based electrodes are commonly used in tubular capacitive sensors.Tubular capacitive sensors have a simple design, which makes them easier tomanufacture. Maier [22] has used capacitive sensors that are formed as concentric,elongated cylinders for sensing the fuel level in aircraft fuel tanks. The capacitanceof the sensor varies as a function of the fraction of the sensor wetted by the fueland the un-wetted fraction in the airspace above the fuel/air interface [22].

Figure 2.8 shows an illustration of the cylindrical tube capacitor. A cylindricalcapacitor can be thought of as having two cylindrical tubes, inner and outer. Theinner cylinder can be connected to the positive terminal, whereas the outer cylindercan be connected to the negative terminal. An electric field will exist if a voltage isapplied across the two terminals. If ra is the radius of the inner cylinder and rb isthe radius of the outer cylinder then the capacitance can be calculated by using:

C ¼ pe0er

lnrb

ra

L F: ð2:11Þ

Qu et al. [23] used an electrode arrangement having a plurality of electrodesarranged next to each other to measure the liquid level. The device measures thecapacitance between a first (lowest) electrode, which is the measurement electrode,and a second electrode as the counter electrode. A controllable switching circuitconnects the electrodes to the measurement module. The connection can be switched

d

L

r

Fig. 2.7 Cylindrical sensingelectrodes

2.4 Capacitors in Level Sensing 21

Page 30: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

in a definable manner by the switching module. As the switching module controls theelectrodes, each electrode of the electrode arrangement can be switched in alterna-tion as the measurement electrode. At least one of the other electrodes can thereby beswitched as the counter electrode to a definable reference potential [23]. The distancebetween the electrodes is preferred to be the smallest possible. Several electrodes canbe implemented in groups to increase the measurement accuracy. By grouping theelectrodes, each electrode group can then be alternately switched as a measurementelectrode. At least one of the other respective electrode groups will be switched as thecounter electrode to the definable reference potential by the switching device [23].

The signals induced on the cable or wire connecting a probe could disturb theanalogue measurement signal. The signal disturbances can be caused by an externalelectromagnetic field, such as generated by a vehicle radio set. To reduce these dis-turbances, the use of coaxial cables is often preferred [24]. Pardi et al. [24] described acapacitive level sensing probe of a coaxial cylindrical type having a constant diameter.The probe comprises a pair of spaced coaxial electrodes constituting a cylindrical platecapacitor between the plates of which the fuel enters to vary the probe capacitance as afunction of fuel level [24]. Yamamoto et al. [25] described a capacitive sensor, wherethe detecting element comprises: a film portion made of a flexible insulating materialextending in a longitudinal direction; and a pair of detecting electrodes juxtaposed toeach other on a layer of the film portion and extending in the longitudinal direction. Thedetecting electrodes are immersed at least partially in the liquid to be measured. Thestate of the measured liquid is detected on the basis of an electrostatic capacity betweena pair of detecting electrodes. The liquid state detecting element further comprisesreinforcing portions made of a conductive material and disposed on the layer of filmportion on an outer side of the detecting electrodes. The reinforcing portions include: agrounding terminal for being connected with a ground line; and a pair of parallelreinforcing portions extending in the longitudinal direction along side edges of the filmportion so as to sandwich the pair of detecting electrodes [25].

2.4.2.3 Multi-Plate Capacitors

Capacitive type fluid level measurement systems can be constructed to havemultiple capacitors. There are various advantages of having multiple capacitors

+ + + +

-

--

-

-

+- Electric

Field

Inner tube(ra)

Outer tube (rb)

L

Fig. 2.8 Cylindrical tubecapacitor

22 2 Capacitive Sensing Technology

Page 31: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

such as increased capacitance value. Multicapacitor systems share the commondielectric constant, which is essentially the fluid itself in capacitive type fluid levelmeasurement systems.

If a capacitor is constructed with n number of parallel plates, the capacitancewill be increased by a factor of (n-1). For example, the capacitor illustrated inFig. 2.9 has seven plates, four being connected to A and three to B. Therefore,there are six layers of dielectric overlapped by the three plates, thus the totalresultant area of each set is (n-1)A, or [5]:

C ¼ ere0ðn� 1ÞAd

: ð2:12ÞTward [26, 27] described a multicapacitor sensor that is tubular in shape.

The designs are in association with a simple alternating current bridge circuit,including detector and direct readout circuitry, which is insensitive to changes inthe environmental characteristics of such fluid, to the fluid motion and disorien-tation of the container, or to stray capacitance in the sensor bridge system.Figure 2.10 shows an illustration of this multicapacitor system.

Wood [28] described a capacitive type liquid level sensor, where the sensorhousing is described as being cylindrical and includes multiple capacitors beingconfigured as ‘‘Y,’’ triangular, and circular. Its configuration extends from the top of aliquid storage tank in a direction generally normal to the horizontal plane level thatthe liquid seeks. The sensor capacitor plates monitor liquid levels at the separatelocations and associated circuitry interrogates these sensor capacitors to deriveoutput pulse characteristics of their respective capacitance values (liquid level). As aresult of interrogation, pulses having corresponding pulse widths are produced, andare compared to derive the largest difference between them. The largest difference isthen compared with a predetermined maximum difference value. If the maximumdifference value is greater, the capacitance values of the sensor capacitors are con-sidered to be close enough for the system to read any one of them, and determine thequantity of liquid remaining in the tank. Hence, an enabling signal is generated andone of the pulses from a sensor capacitor is read to determine the liquid level [28].

2.4.2.4 Helixical Capacitors

Peter [29] described a capacitive probe that is comprised of two rigid wires formedin a bifilar helix. The use of a bifilar helix structure enables small changes in fluid

A B

Fig. 2.9 Multiplate capacitor[5]

2.4 Capacitors in Level Sensing 23

Page 32: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

level to produce relatively large changes in probe capacitance [29]. Anotheradvantage of the helixical geometry is that the sensing probe is compact, stable,rugged, and low in cost. Since the helix can be fabricated from any conductivematerial, the probe may be adapted to virtually any operating environment. Thehelix may also be entirely self-supporting or may be formed around a tubularsupport structure [29].

2.4.3 Conducting and Non-Conducting Liquids

A dielectric material that can conduct electric current will decrease the performanceof the capacitor. The dielectric material should ideally be an insulator. But, the watercontent and other components mixed with the fluid can increase the conductivityof electrons in the fluid material. Several methods have been proposed for using acapacitive sensor to measure the fluid level in conducting and non-conductingliquids. A common method used places an insulating layer onto the conducting rods.The insulating layer will prevent the flow of electrons; hence a stable electric fieldcould be produced.

Lee et al. [30] described a capacitive liquid level sensor that consists of a low-cost planar electrode structure, a capacitance-controlled oscillator, and a micro-controller. The sensor described is able to measure absolute levels of conductingand non-conducting liquids with high accuracy [30]. Qu et al. [23] described alevel sensor, where the electrodes are insulated with low dielectric constantmaterial. Lenormand et al. [31] described a capacitive probe for measuring thelevel in conducting and non-conducting fluids. The probe comprises a tubularinsulating layer made of a dielectric heat resisting material baked at a hightemperature.

Tward [27] described a fluid level sensor for mounting in a fluid storage vesselfor sensing the level of the fluid within the vessel which is comprised of foursimilar electrically conductive capacitor elements each formed to present two

Fig. 2.10 Tubular shapedmulticapacitor level sensor[27]

24 2 Capacitive Sensing Technology

Page 33: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

electrically connected capacitive plates disposed at angles to each other.A material of known constant dielectric value fills two of the dielectric spacesthereby forming with their respective space defining capacitive plates twocapacitors of known fixed and substantially similar capacitive value. Theremaining two dielectric spaces are open to receive varying levels of fluid therebyforming with their respective capacitive plates, and the fluid within the spaces, twocapacitors of variable capacitive value [27].

2.5 Effects of Dynamic Environment

2.5.1 Overview

Environmental factors such as temperature, pressure, and humidity affect thedielectric constant of a capacitor and therefore these effects severely deterioratethe precision of level measurement [17]. Changes in temperature can alter thedistance and area of the conducting plates of a capacitor. The dielectric constant issubject to atmospheric changes such as temperature, humidity, pressure, andcomposition [17]. These factors influence the resulting capacitance value. Severalmethods have been employed to compensate for these factors. A reference probecan be used to recalibrate the dielectric constant, which can compensate for thechanges in dielectric constant.

2.5.2 Effects of Temperature Variations

Changes in the temperature of the liquid or gas can result in significant shifts in thedielectric constant of the liquid or gas, which introduces inaccuracies in the sensorreadings. This section describes some methods and techniques that have been usedin the past to overcome the effects of temperature changes on sensing devices.

Variations in temperature values can alter the geometry and size of thecapacitive sensor. Any change in the electrode gap will alter the value of thecapacitance and therefore an inaccurate or even invalid level measurement will beobtained. The electronic components can also behave differently at differenttemperatures. The sensing electronics used to determine fluid level can thereforeproduce inaccurate level readings at different temperatures. Peter [29] described amethod that can be used to monitor the level of a fluid in elevated temperatureenvironments. The design consists of a high-performance thermal insulator forthermally insulating the system’s electronic circuitry from the sensor probe.Atherton et al. [32] described a sensor based on the design described by Peter [29]for sensing the level of oil or transmission fluid under both normal and extremetemperature conditions. The active components of the sensor have input and

2.4 Capacitors in Level Sensing 25

Page 34: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

leakage currents substantially lower than those of diodes and current sources underhigh temperature conditions.

Lawson [33] described a method for collecting liquid temperature data from afuel tank by using a thermal sensitive resistive element that produces a valueproportional to the liquid’s temperature, a capacitor for storing a charge repre-sentative of this value, and a resistor through which the capacitor is discharged.Circuitry and software are provided that compares the voltage across the resistor toa reference as the capacitor discharges. This determines the number of clockcounts for which a predetermined relationship exists between the voltage acrossthe resistor and the reference and then consults a table to determine an absolutetemperature based on this clock count [33].

Other methods that use a reference capacitor such as described by McCullochet al. [34], can eliminate the effects of a changing dielectric constant at differenttemperatures. The recalibration method calculates the dielectric constant at anytemperature to avoid the effects of temperature changes that can shift the values ofthe dielectric constant.

2.5.3 Effects of Contamination

It was described in Sect. 2.2.3 that the capacitance is dependant on the dielectricconstant. Any change in the dielectric material will influence the capacitancevalue. To avoid the effects of the dielectric material on the capacitance value,several methods have been described that either eliminate the effects of thedielectric material, or recalibrate the dielectric parameter.

Hochstein [35] described a capacitive level gauge which determines the level ofsubstance in the container. The gauge includes a measurement capacitor formeasuring the level. Unlike conventional capacitance level gauges which may notdetect changes in dielectric constant, this gauge includes a reference capacitor fordetermining the dielectric constant of the substance. A controller is responsive tothe capacitors for producing a level signal which simultaneously indicates the leveland dielectric constant of the material. The level signal incorporates a frequencywhich is representative of the dielectric constant and a pulse width representativeof the level. The gauge supports a first pair of parallel conductive members toestablish the measurement capacitor and a second pair of parallel conductivemembers spaced along the gauge and below the measurement capacitor toestablish the reference capacitor. An advantage of this device is that its use doesnot require a predetermined shaped container. Additionally, the level signalsimultaneously indicates the level capacitance and reference capacitance foraccurate indication of the level.

Fozmula [36] described a capacitive liquid level sensor that can be calibratedusing a push button. The sensor works with various fluid types such as oil, diesel,water, and water-based solutions. The calibration option allows the sensor todetermine the dielectric constant of the fluid and adjust the output accordingly.

26 2 Capacitive Sensing Technology

Page 35: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The consequences of neglecting the safety of brake fluid can lead to some seriousproblems, i.e., water content leads to corrosion in the brake system components. Theon-line monitoring of oil quality and level eliminates the inconvenience to checkbrake fluid manually. It makes the vehicles safer and avoids additional waste byproviding a more scientific maintenance interval. Shida et al. [37] described a methodfor on-line monitoring of the liquid level and water content of brake fluid using anenclosed reference probe as the capacitive sensing component. The probe has anenclosed cavity at the end which is designed to hold fresh brake fluid as an on-linereference. Three capacitances formed by four electrodes are used for the liquid level,water content and reference measurement and form the mutual calibrating outputfunctions of the sensing probe. The liquid level measurement is calibrated to thepermittivity changes by the capacitance for water content measurement. Simulta-neously, the water content measurement is calibrated to temperature changes andvariety of fluids by the capacitance of the reference measurement. Therefore, oncethe permittivity characteristics of brake fluids are experimentally modeled, theproposed method has a self-calibration ability to accommodate influencing factorsincluding temperature, water content, and variety of brake fluids without an addi-tional sensor supported by a database as in conventional intelligent sensor systems.

McCulloch et al. [34] described a way to overcome the level reading errorscaused by variations in the dielectric constant of the fluid. The system is designedto measure liquid level with a high degree of accuracy regardless of dielectricchanges which may occur in the liquid or gas due to temperature changes, pressurechanges, and other changes affecting the dielectric constant. The primary sensor isan elongated capacitive probe positioned vertically within the container so that thelower portion of the probe is in liquid and the upper portion of the probe extendsabove the surface of the liquid. A capacitive liquid reference sensor is near thelower end of the probe, and a capacitive gas reference sensor is at the upper end ofthe probe. A controller is provided for driving each of the sensors with an electricalsignal and reading a resultant value corresponding to the capacitance of each of thesensors. The controller is configured to enable the system to be calibrated prior toinstallation by placing each of the sensors in a calibration or identical medium,reading sensor values corresponding to capacitances for each of the sensors, andcalculating and storing calibration values based on the sensor values [34].

Wallrafen [38] described a sensor for measuring the filling level of a fluid in avessel. The sensor has an electrode group which extends vertically over the fill-able vessel height, and dips into the fluid, and forms electrical capacitors whosecapacitances change in a measurable fashion when there are changes in the fillinglevel. The capacitances are determined by a connected evaluation circuit and arerepresented as a signal which describes the filling level. There is at least onemeasuring electrode which extends over the entire fillable vessel height. A plu-rality of reference elements are arranged at different reference heights within thefillable vessel height. Optionally, a plurality of measuring electrodes are arrangedin such a way that each measuring electrode has a significant change in width at areference height assigned to it, and wherein the entire fillable vessel height ispassed over by the measuring electrodes. The measuring electrode, the opposing

2.5 Effects of Dynamic Environment 27

Page 36: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

electrode, and five reference electrodes are printed on to a carrier which is bent in aU-shape. The electrodes are connected to an electronic circuit on the carrier bymeans of lines which are also printed on.

Takita [39] described a capacitive sensor that provides a high level of precision bytaking the effects of environmental changes into consideration and compensating forany and all changes to the plate area and to the value of the dielectric constant beforedetermining an accurate measurement. Such compensation can be achieved throughuse of a plurality of environmental sensors to mathematically calculate the changeaccording to the variant conditions surrounding the capacitive sensor. However, thecompensation would be made through the use of a reference capacitor with a fixedgap between the plates that is otherwise identical in both form and reaction toenvironmental changes as the capacitive sensor that it monitors to compensate for allenvironmental parameters other than the parameter of interest [39].

Other methods described by Wells [40], Tward [27], Stern [41], Gimson [42],and Park et al. [43] all use a reference capacitor to compensate for the effects ofcontamination in the fluid.

2.5.4 Influence of Other Factors

2.5.4.1 Sensitivity to Noise

Sensor plates may have signal capacitances in the fractional picofarad (pF) range,and connecting to these plates with a 60 pF per meter coaxial cable could totallyobscure the signal. However, with correct shielding of the coaxial cable as well as anyother stray capacitance one can almost completely eliminate the effects of noise [44].

2.5.4.2 Sensitivity to Stray Capacitance

One hazard of the oscillator circuits is that the frequency is changed if thecapacitor picks up capacitively coupled crosstalk from nearby circuits. The sen-sitivity of an RC oscillator to a coupled narrow noise spike is low at the beginningof a timing cycle but high at the end of the cycle. This time variation of sensitivityleads to beats and aliasing where noise at frequencies which are integral multiplesof the oscillator frequency is aliased down to a low frequency. This problem canusually be handled with shields and careful power supply decoupling [45].

2.5.4.3 Distance Between the Electrodes

The capacitance is dependent on the gap or distance between the conductingelectrodes. This distance can, however, increase or decrease, depending on theenvironmental conditions, and the material, which could incorporate inaccuracies

28 2 Capacitive Sensing Technology

Page 37: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

in the level readings. In some cases, movement of the fluid container can skew orbend the sensor, which will alter the distance between the electrodes, therebyerrors will be produced in the capacitance value, and hence the fluid level.

2.6 Effects of Liquid Sloshing

2.6.1 Overview

In mobile fluid tanks, such as automotive fuel tanks, acceleration will induce sloshwaves in the storage tank. This phenomenon of fluid fluctuation is called sloshing.The magnitude of sloshing is dependent on the value of the acceleration ordeceleration that may be caused by braking, speeding, and irregular terrain. A levelmeasurement device observing the fluid level under sloshing conditions willproduce erroneous level readings.

The sloshing phenomenon in moving rectangular tanks, for example, automotivefuel tanks, can be usually described by considering only 2-dimensional fluid flow, ifthe width of the tank is much less than its breadth [46]. The main factors contributingto the sloshing phenomenon are the acceleration exerted on the tank, amount ofexisting fluid, internal baffles, and the geometry of the tank [47, 48]. A detailedanalysis of liquid sloshing using the numerical approach for various tank configu-rations has been provided in the literature [47–55].

Different designs of fluid level measurement systems have used differenttechniques to compensate for the erroneous reading of liquid level due to theeffects of sloshing. This section of the literature review focuses on some levelsensing devices that attempt to operate effectively in both static and dynamicenvironments.

2.6.2 Slosh Compensation by Dampening Methods

Fluid sloshing can be physically and electrically dampened to suppress thesloshing effects. Electrical damping methods include the use of low-pass filters andnumerical averaging on digital sensor readings. Physical or mechanical dampingof slosh includes the use of baffles and geometrical methods. Figure 2.11 shows abasic geometrical dampening method. The sensor is placed inside a vessel, wherefluid can enter from the bottom of the vessel. The fluid stored in the vessel willexperience less slosh than the fluid outside the vessel. Therefore, the fluid insidethe vessel will be stable relative to the outside level.

Wood [28] described a capacitive type liquid level sensor that is useful for bothstationary and mobile storage tanks. The sensor is sensitive when the fuel isdisoriented with respect to a reference level. Its configuration extends from the top

2.5 Effects of Dynamic Environment 29

Page 38: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

of a liquid storage tank in a direction generally normal to the horizontal plane levelthat the liquid seeks. The sensor capacitor plates monitor liquid levels at theseparate locations and associated circuitry interrogates these sensor capacitors toderive output pulses characteristic of their respective capacitance values. As aresult of interrogation, pulses having corresponding pulse widths are produced andare compared to derive the largest difference between them. The largest differenceis then compared with a predetermined maximum difference value. If the maxi-mum difference value is greater, the capacitance values of the sensor capacitors areconsidered to be close enough for the system to read any one of them anddetermine the quantity of liquid remaining in the tank. Hence, an enabling signal isgenerated and one of the pulses from a sensor capacitor is read to determine theliquid level [28].

Tward et al. [27] described methods to solve the problem of liquid sloshing andliquid level shift. They also address the effects on liquid level and volume mea-surement of changes in the physical and chemical characteristics of the liquidbeing measured and of the multiple characteristics of the environment of the liquidand its container. Multiple capacitors can provide improved liquid level mea-surement in both stationary and dynamic conditions for liquid storage containersand tanks [27].

2.6.3 Tilt Sensor

Another method used to compensate for the dynamic effects determines the tiltangle, usually by incorporating an inclinometer. Nawrocki [56] described amethod that incorporates an inclinometer in the fuel gauging apparatus. A signalfrom a fuel quantity sensor can be transmitted to a fuel gauge or display only whenthe vehicle is tilted less than a predetermined degree. To accomplish this, a signalfrom the fuel sensor is passed through to the display by a microprocessor onlywhen the vehicle is substantially level and not accelerating or decelerating. Whenthe level condition is met, the signal indicative of the amount of fuel left in the tankis stored in the microprocessor memory and displayed on the fuel gauge, and isupdated again when the vehicle reaches the next level condition. Alternatively, acorrection factor matrix stored in memory can be applied to the signal receivedfrom the fuel sensor to calculate a corrected signal indicative of the amount of fuel

Capacitive Sensor Tube

Slosh Waves

Dampening Vessel

Stable Level

Fig. 2.11 Geometricallydampening the slosh waves

30 2 Capacitive Sensing Technology

Page 39: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

remaining in the fuel tank. Figure 2.12 shows an overview of the method describedby Nawrocki [56].

Lee [57] described a digital tilt level sensing probe system comprising a set ofmultiple capacitor elements in a fluid container arranged along an axis of mea-surement where each multiple capacitor element represents a discrete levelincrement in dielectric material fluid to be measured. Individual capacitors in eachelement are horizontally spaced to reflect a level differential on tilting of the fluidcontainer from its normal attitude. In the case of a probe for sensing tilt angle in asingle plane, the device includes integral capacitor elements, mounting pad,connector, custom IC pad, and circuitry moulded into the body [57] (Fig. 2.13).

Shiratsuchi et al. [58] described a capacitive type fuel level sensing system thatuses three capacitors to determine the fuel surface plane angle, and a fourthcapacitor is used as a reference capacitor to compensate for the variations in thedielectric constant. The high cost associated with having multiple capacitorsmakes this approach impractical. Furthermore, Shiratsuchi et al. [58] haveassumed the fuel surface as always a plane, whereas, even under normal drivingconditions, the surface of the fuel actually portrays slosh waves that fluctuate at avarying rate. The method described by Shiratsuchi et al. [58] determines the fluid

Fig. 2.12 Fuel level measurement system having an inclinometer [56]

Fig. 2.13 Fluid and tilt levelsensing probe system [57]

2.6 Effects of Liquid Sloshing 31

Page 40: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

level when the slope angle of the fluid level is at zero, which relates to the staticstate condition, and does not accurately determine fluid level under dynamicconditions.

2.6.4 Averaging Methods

The Averaging Method is another method besides the mechanical dampeningapproach that can compensate for the sloshing effects and produce better fuel levelreadings. The averaging method is basically a statistical averaging method thatgenerally collects the past level readings and determines the future level readingby using different calculation techniques. There are a few different averagingtechniques that have been applied in the past that include a simple ArithmeticMean, Weighted Average, and Variable Averaging Interval.

2.6.4.1 Arithmetic Mean

Arithmetic mean or simply mean is the traditional method of averaging the levelsensor readings. The mean value of the sampled signal x = [x1, x2, x3,…, xn] forn number of samples is calculated using:

meanðxÞ ¼ �x ¼ 1n

X

n

i¼1

xi: ð2:13Þ

The downside of averaging is that it produces a significant error for amomentarily large spike or an abnormal data entry in the elements of x. Forexample, if a sampled signal is given as:

x ¼ ½1:21; 1:30; 1:25; 1:27; 1:23; 1:91� ð2:14Þ

�x ¼ 1:21þ 1:30þ 1:25þ 1:27þ 1:23þ 1:916

¼ 1:36 ð2:15Þ

�x ¼ 1:21þ 1:30þ 1:25þ 1:27þ 1:235

¼ 1:25: ð2:16Þ

The average value obtained in the presence of an abnormal entry ‘1.91’ insignal x is given in (2.15), which is significantly larger than the average valuewhen obtained without ‘1.91’ element in x (2.16).

An improved version of averaging is described by Tsuchida et al. [59] whopresented a method that determines the center value of the past sensor readings. Thecenter value is assumed to be the accurate level reading. This method includesthe operations of performing sampling detection of an amount of fuel remaining inthe fuel tank of a vehicle, determining a center value for a plurality of remaining fuel

32 2 Capacitive Sensing Technology

Page 41: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

quantity values detected by a microcomputer, determining limit values each thereofbeing apart from the center value by a predetermined amount, using any subsequentdetected value exceeding the limit values as a new limit value, computing an averagevalue of a predetermined number of detected sampling values, and indicating it on adisplay. It also performs the function of discriminating and eliminating any suddenlychanged abnormal detected values due to changes in the attitude of the vehiclethereby producing stable measurement readings of the remaining fuel quantity [59].

2.6.4.2 Weighted Average

Weighted average is similar to the simple averaging method, except that there areadditional weights (w) assigned to each element in the sample signal x = [x1, x2,x3,…, xn]. In the absence of the weights, all data elements in x contribute equally tothe final average value. But, with the usage of the additional weights (w), the finalaverage can be controlled. If all the weights are equal, then the weighted mean isthe same as the arithmetic mean. The weighted average of a signal x = [x1, x2,x3,…, xn] and the weights w = [w1, w2, w3,…, wn] for n number of sampled pointscan be calculated using:

WmeanðxÞ ¼ �x ¼Pn

i¼1 wixiPn

i¼1 wi; wi [ 0: ð2:17Þ

2.6.4.3 Variable Averaging Interval

In the Variable Averaging method, raw sensor readings are averaged at differenttime-intervals depending on the state or motion of the vehicle. During staticconditions, when the vehicle is stationary or when the vehicle is operating at a lowspeed, the time constant or the averaging period is reduced to a small interval toquickly update the sensor readings by assuming that there will be negligible slosh.During dynamic conditions, the averaging period is increased to average the sensorreadings over a longer period of time. To determine the running state of thevehicle, normally a speed sensor is used.

Kobayashi et al. [60] described a sensor that uses digital signals as opposed toanalogue signals to determine the fluid volume in a fuel storage tank. The digitalfuel volume measuring system can indicate the amount of fuel within a fuel tankprecisely in the unit of 1.0 or 0.1 L The volume detection signals are simplyaveraged during a relatively short averaging time period at regular measuringcycles when the vehicle is being refueled, and further weight averaged or movingaveraged at regular measuring cycles when the vehicle is running. Therefore, fuelvolume can be indicated quickly at a high response speed when the vehicle isbeing refueled and additionally, fluctuations in the fuel volume readings can beminimized when the vehicle is running. Further, the system discloses the method

2.6 Effects of Liquid Sloshing 33

Page 42: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

of detecting the state where the vehicle is being refueled on the basis of the factthat the difference between at least one of the current data signal indicative of fuelvolume and at least one of the preceding data signal indicative of fuel volumeexceeds a predetermined value [60].

Guertler et al. [61] described a process that determines the quantity of a liquidsituated in a largely closed system. The liquid fluctuations in a dynamic or amoving vehicle can produce erroneous results. The process described Guertleret al. [61] determines the running state of the vehicle, the momentary drivingcondition, and, at least during selected driving conditions in the driving operation.The process continuously senses the filling level, as well as determines themomentary filling quantity via a given dependence of the liquid quantity readingon the driving condition and on the filling level. These fluctuations can be cal-culated as the result of the predetermined dependence of the liquid level andtherefore of the amount of fluid on the driving condition. In addition, the level canbe statistically averaged because of the continuous obtaining of measuring values.This permits the reliable determination of the fluid quantity whose level fluctuatesas a function of the driving condition by way of level measurements. This occursnot only when the vehicle is stopped and the engine is switched-off, but also in thecontinuous driving operation [61].

Kobayashi et al. [62] utilized the information about the various states of thevehicle, such as ignition ON–OFF, idle state, up, and down speeding. The fuellevel readings are averaged over time intervals which vary according to whetherthe liquid level of the fuel in the tank is stable or unstable. A fuel quantity iscalculated and displayed according to the averaged value. The stable or unstablecondition of the fuel level is discriminated in accordance with vehicle speed, andthe position of the ignition switch. Accordingly, when the fuel level is unstable, thesignal value is averaged over a time interval which is longer than that used whenthe fuel level is stable so that the response of display to variation of the fuel level isimproved [62].

2.7 Summary

A detailed investigation of the capacitive sensing technology as described in thischapter reveals the fact that capacitive technology is increasingly being used in abroad range of applications due to its non-mechanical characteristic, robustness inharsh environments, its ability to work with a wide range of chemical substances,compact and flexible size, and, longer functional life.

Even though the use of capacitive sensing technology in fluid level measure-ment systems has produced satisfactory outcomes in a broad range of applications,the literature review has highlighted some of the limitations of capacitive sensingtechnology in relation to its accuracy in fluid level measurements pertaining todynamic environments. Level sensing in dynamic environments is characterizedby three factors:

34 2 Capacitive Sensing Technology

Page 43: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

• Slosh.• Temperature variation.• Contamination.

Solutions provided to address each of these three above mentioned factors havebeen reviewed in this chapter. In most cases common solutions to overcome theseenvironmental factors require an additional capacitive sensor to be included to serve asa reference capacitor. The purpose of this reference capacitor is to provide additionalmeasurement signal taking into account factors above. This measurement is then usedto calculate offset in combination with the main capacitive sensor to improve theaccuracy of overall measurement system. However, these solutions entail either higherproduction cost because of the requirement for an additional sensor, or they provideonly marginal improvement in terms of accuracy compared to current systems.

References

1. Serway, R. A., & Jewett, J. W. (2004). Capacitance and dielectrics. In Physics for scientistsand engineers (6th ed., pp. 796–820). Scotland: Thomson.

2. Robbins, A., & Miller, W. (2000). Circuit analysis: Theory and practice. Albany: Delmar.3. Scherz, P. (2000). Practical electronics for inventors. New York: McGraw-Hill.4. Jewett, J. W., & Serway, R. A. (2004). Physics for scientists and engineers (6th ed.).

Scotland: Thomson.5. Bolton, W. (2006). Capacitance. Engineering science (p. 161). Oxford: Newnes.6. Benenson, W., Stoecker, H., Harris, W. J., & Lutz, H. (2002). Handbook of physics.

New York: Springer.7.. Avallone, E. A., & Baumeister, T., I. I. I. (1996). Marks’ standard handbook for mechanical

engineers. New York: McGraw-Hill.8. Samatham, R., Kim, K. J., Dogruer, D., Choi, H. R., & Konyo, M. (2007). Active polymers:

An overview. In K. J. Kim & S. Tadokoro (Eds.), Electroactive polymers for roboticapplications: Artificial muscles and sensors (p. 18). London: Springer.

9. Fischer-Cripps, A. C. (2002). Newnes interfacing companion. Oxford: Newnes.10. Eren, H., & Kong, W. L. (1999). Capacitive sensors—displacement. In J. G. Webster (Ed.),

The measurement, instrumentation, and sensors handbook. Boca Raton: CRC Press.11. Gibilisco, S. (2001). The illustrated dictionary of electronics. New York: McGraw-Hill.12. Pallás-Areny, R., & Webster, J. G. (2001). Reactance variation and electromagnetic sensors.

In Sensors and signal conditioning (pp. 207–273). New York: Wiley.13. Kilian, C. T. (2000). Sensors. In Modern control technology: Components and systems

(pp. 220–294). Novato: Delmar Thomson Learning.14. Baxter, L. K. (1997). Capacitive sensors—design and applications. In R. J. Herrick (Ed.)

IEEE Press.15. Ripka, P., & Tipek, A. (2007). Level position and distance. In Modern sensors handbook

(pp. 305–348). Newport Beach: ISTE USA.16. Wilson, T. V. How the iPhone works. HowStuffWorks, Inc; [cited]; Available from: http://

electronics.howstuffworks.com/iphone2.htm.17. LION-Precision (2006). Capacitive sensor operation and optimization, technotes, no. LION

PRECISION.18. Gründler, P. (2007). Conductivity sensors and capacitive sensors. In Chemical sensors: An

introduction for scientists and engineers (pp. 123–132). Berlin: Springer.

2.7 Summary 35

Page 44: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

19. Pallás-Areny, R., & Webster, J. G. (2001). Sensors and signal conditioning. New York:Wiley.

20. Analog Devices, Inc. High g Accelerometers. Analog Devices, Inc.; [cited]; Available from:http://www.analog.com/en/mems/high-g-accelerometers/products/index.html.

21. Kuttruff, H. (1991). Ultrasonics—fundamentals and applications. London: Elsevier AppliedScience.

22. Maier, L. C. (1990). Inventor simmonds precision products, Inc., assignee. Apparatus andmethod for determining liquid levels. Patent 4908783, 28 April 1987.

23. Qu, W., Gamel, J. F., Mannebach, H., & Jirgal, L. M., (2003, October 16). Inventors; HydacElectronic GmbH., assignee. Device and method for measuring capacitance and determiningliquid level. Patent 7161361 .

24. Pardi, R., & Marchi, G. (1981, March 10). Inventors; Logic S.p.A., assignee. System forsensing and signalling the amount of fuel in a vehicle tank, particularly aircraft tank. Patent4487066.

25. Yamamoto, T., Hayashi, S., & Kondo, M. (2005, January 5). Inventors; NGK SPARK PLUGCO (JP), assignee. Liquid state detecting element and liquid state detecting sensor. Patent7064560.

26. Tward, E., & Junkins, P. (1982, February 3) Inventors; Tward 2001 Limited (Los Angeles,CA) assignee. Multi-capacitor fluid level sensor. Patent 4417473.

27. Tward, E. (1982, February 3 ). Inventor Tward 2001 Limited, assignee. Fluid level sensor.Patent 4417472.

28. Wood, T. J. (1978, December 21). Inventor FORD MOTOR CO, assignee. Capacitive liquidlevel sensor. Patent 4194395.

29. Peter, H. (1987, May 26). Inventor Aisin Seiki Kabushiki Kaisha, assignee. Capacitive probefor use in a system for remotely measuring the level of fluids.

30. Toth, F. N., Meijer, G. C. M., & Lee, M. van der. (1996). A new capacitive precision liquid-level sensor. Conference on Precision Electromagnetic Measurements Digest (pp. 356–357).

31. Lenormand, R., & Chaput, C. (2003, March 26). Inventors; Institut Francais du Petroleassignee. Capacitive probe for measuring the level of an electricity-conducting liquid. Patent6844743.

32. Atherton, K. W., Clow, C. R., & Mawet, P. H. (1986, December 9). Inventors;CATERPILLAR INC (US) assignee. Dielectric liquid level sensor and method. Patent4806847.

33. Lawson, J. C. (1995, June 6). Inventor Chrysler Corporation assignee. Method for collectingliquid temperature data from a fuel tank. Patent 5613778.

34. Mcculloch, M. L., Bruer, R. E., & Byram, T. P. (1997, September 9). Inventors; AMERICANMAGNETICS INC (US) assignee. Capacitive level sensor and control system. Patent6016697.

35. Hochstein, P. A. (1990, Feburuary 7). Inventor TELEFLEX INC (US), assignee. Capacitiveliquid sensor. Patent 5005409.

36. Fozmula. Capacitive liquid level sensor is intelligent: EngineeringTalk; 2006 [updated 11/12/2006; cited]; Available from: http://www.engineeringtalk.com/news/foz/foz109.html.

37. Wang, C., & Shida, K. (2007). A new method for on-line monitoring of brake fluid conditionusing an enclosed reference probe. Measurement Science and Technology, 18(11), 3625.

38. Wallrafen, W. (1999, April 13). Inventor Mannesmann VDO, assignee. Sensor for accuratemeasurement of levels in irregularly shaped tanks. Patent 6293145.

39. Takita, M. (2004, September 15). Inventor Environmentally compensated capacitive sensor.Patent 20060055415.

40. Wells, P. (1990, July 23) Inventor IIMorrow, Inc., assignee. Capacitive fluid level sensor.Patent 5042299.

41. Stern, D. M. (1989, April 10). Inventor Drexelbrook Engineering Company, assignee.Two-wire compensated level measuring instrument. Patent 5049878.

42. Gimson, C. J. (1988, September 12). Inventor Mestra A. G., assignee. Capacitive sensor andcircuit for detecting contamination of guard electrode. Patent v. 1988.

36 2 Capacitive Sensing Technology

Page 45: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

43. Park, K. M., & Nassar, M. A. (1997, March 6). Inventors; Kavlico Corporation, assignee.Capacitive oil deterioration and contamination sensor. Patent 5824889.

44. Kuttruff, H. (1991). Oscillator. In Ultrasonics—fundamentals and applications (pp. 51–52).New York: Elsevier Applied Science.

45. Fraden, J. (2004). Interface electronics circuits. In Handbook of modern sensors: Physics,designs, and applications (pp. 151–225). New York: Springer.

46. Ibrahim, R. A. (2005). Introduction. In Liquid sloshing dynamics: Theory and applications(p. xvii). Cambridge: Cambridge University Press.

47. Ibrahim, R. A. (2005). Liquid sloshing dynamics: Theory and applications. Cambridge:Cambridge University Press.

48. Wiesche, S. (2003). Computational slosh dynamics: Theory and industrial application.Computational Mechanics, 30(5–6), 374–387.

49. Dai, L., & Xu, L. (2006). A numerical scheme for dynamic liquid sloshing in horizontalcylindrical containers. Proceedings of the Institution of Mechanical Engineers, Part D:Journal of Automobile Engineering, 220(7), 901–918.

50. Modaressi-Tehrani, K., Rakheja, S., & Sedaghati, R. (2006). Analysis of the overturningmoment caused by transient liquid slosh inside a partly filled moving tank. Proceedings of theInstitution of Mechanical Engineers, Part D: Journal of Automobile Engineering, 220(3),289–301.

51. Pal, N. C., Bhattacharyya, S. K., & Sinha, R. K. (2001). Experimental investigation of sloshdynamics of liquid-filled containers. Experimental Mechanics, 41, 63–69.

52. Dongming, L., & Pengzhi, L. (2008). A numerical study of three-dimensional liquid sloshingin tanks. Journal of Computational Physics, 227(8), 3921–3939.

53. Kita, K. E., Katsuragawa, J., & Kamiya, N. (2004). Application of trefftz-type boundaryelement method to simulation of two-dimensional sloshing phenomenon. EngineeringAnalysis with Boundary Elements, 28(2004), 677–683.

54. Pal, N. C., Bhattacharyya, S. K., & Sinha, P. K. (2001). Experimental investigation of sloshdynamics of liquid-filled containers. Experimental Mechanics, 41(1), 63–69.

55. Arafa, M. (2006). Finite element analysis of sloshing in rectangular liquid-filled tanks.Journal of Vibration and Control, 13(7), 883–903.

56. Nawrocki, R. (1990, December 17). Inventor FORD MOTOR CO (US) assignee. Apparatusand method for gauging the amount of fuel in a vehicle fuel tank subject to tilt. Patent5072615.

57. Lee, C. S. (1994, April 4). Inventor Lee, Calvin S. (Laguna Niguel, CA), assignee. Variablefluid and tilt level sensing probe system. Patent 5423214.

58. Shiratsuchi, T., Imaizumi, M., & Naito, M. (1993). High accuracy capacitance type fuelsensing system. SAE, 930359, 111–117.

59. Tsuchida, T., Okada, K., Okuda, Y., Kondo, N., & Shinohara, T. (1981, March 12). Inventors;Toyota Jidosha Kogyo Kabushiki Kaisha. (1981). assignee. Method of and apparatus forindicating remaining fuel quantity for vehicles. Patent 4402048.

60. Kobayashi, H., & Obayashi, H. (1983, June 8). Inventors; Nissan Motor Company, Limited,assignee. Fuel volume measuring system for automotive vehicle. Patent 4611287.

61. Guertler, T., Hartmann, M., Land, K., & Weinschenk, A. (1997, January 27). Inventors;DAIMLER BENZ AG (DE) assignee. Process for determining a liquid quantity, particularlyan engine oil quantity in a motor vehicle. Patent 5831154.

62. Kobayashi, H., & Kita, T. (1982, December 30). Inventors; Nissan Motor Company, Limitedassignee. Fuel gauge for an automotive vehicle. Patent 4470296.

References 37

Page 46: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 3Fluid Level Sensing Using ArtificialNeural Networks

3.1 Overview

The basic principles and applications of capacitive type sensors including some issuesrelating to application of capacitive type level sensing systems in dynamic environ-ments were discussed in Chap. 2. In this chapter, first, the fundamental principles ofsignal classification and processing are discussed. Then the background and appli-cations of Artificial Neural Networks (ANN) in the context of this research aredescribed. Finally, the use of neural networks in providing solutions to the problemsencountered in fluid level measurement in dynamic environments is described.

3.2 Signal Processing and Classification

3.2.1 Overview

Signal processing and signal classification plays a crucial role in the improvementof the accuracy of any fluid level measurement system, particularly, in dynamicenvironments. This section broadly focuses on various aspects of signal processingand classification techniques. Various components of signal pre-processing such asData collection methods, Feature extraction methods, and Signal filtrationmethods are discussed. Thereafter, a diverse range of signal classification tech-niques are described in this section (Fig. 3.1).

3.2.2 Data Collection

Typically, the output from a fluid level sensor is in the form of continuous voltageover time. However, to digitally process the sensor’s analog signal, the signal

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3_3,� Springer-Verlag London 2012

39

Page 47: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

needs to be converted into a discrete signal by sampling it at some constantsampling frequency fs [1]. The sampling interval Ts is the time between twosampled points, which is simply equal to:

Ts ¼1fs

ð3:1Þ

Figure 3.2 shows a continuous analog signal and its sampled version whensampled at a sampling frequency of 20 Hz. If x(t) is the analog sensor output signal,the discrete sampled signal x[n] at sampling frequency fs can be described as [2]:

x½n� ¼ xðnTsÞ ¼ xn

fs

� �; where n ¼ 0; 1; 2; 3; . . . ð3:2Þ

3.2.3 Signal Filtration

The signal values obtained from the level sensor are processed with different signalfiltration functions to enhance the performance of the signal classification systembefore the signal is interpreted [3]. The signal feature coefficients obtained from asignal containing noise in it can have an adverse effect on signal classificationaccuracy if used in the classification process [3, 4]. Noisy signals can be filteredusing different approaches, such as low-pass filter, high-pass filter, or band-passfilter. A low-pass filter can be used to eliminate high-frequency noise, especially

Fig. 3.2 Illustration of ananalog waveform and itssampled digital signal

Signal Processing Unit

Lev

el S

enso

r

Feature Extraction

Signal Classification

Accurate O

utput

Data Collection

Fig. 3.1 Overview of sensorsignal processing

40 3 Fluid Level Sensing Using Artificial Neural Networks

Page 48: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

when the level sensor signal consists of low-frequency content (i.e. slosh waves).Band-pass filters can be very useful if the range of effective frequency of interest isknown. Variable filters such as adaptive filter can be very useful for the reductionof white noise [5].

3.2.4 Feature Extraction

Apart from signal filtration, another operation performed in signal preprocessing isthe selection of features from and reduction of the size of the input signal, while atthe same time trying to preserve the information contained in the input signal.The reduction in the signal size will reduce the input size of the classificationnetwork, if one is used, as well as increase the network performance [4]. Trunk [6]has demonstrated that use of large quantities of data may be detrimental toclassification, especially if the additional data is highly correlated with previousdata [4]. The following methods are commonly used to extract a number offeatures from the input signal [4]:

• Fast Fourier Transform (FFT)• Discrete Cosine Transform (DCT) [7]• Wavelet Transform (WT)• Principle Component Analysis (PCA)• Fisher Discriminant Analysis (FDA)• Independent Component Analysis (IDA).

3.2.4.1 Fast Fourier Transform

The FFT algorithm is widely used to transform a time domain signal into thefrequency domain [8]. The Fourier transform of a signal involves decomposing thewaveform into a sum of sinusoids of various frequencies. A time domain signaly(t) can be transformed into the frequency domain as Y(x) [9]:

YðxÞ ¼Z1

�1

yðtÞe�jxt dt ð3:3Þ

Discrete Fourier Transform (DFT) is used where the input signal is discrete orsampled at fixed intervals. The DFT rule is described by the following equation,where Y(k) is the transformed function of y(t) for frequency k [10].

YðkÞ ¼ 1N

XN

n¼1

yðnÞe�j2pðk�1Þ n�1Nð Þ 1� k�N ð3:4Þ

3.2 Signal Processing and Classification 41

Page 49: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Once a signal has been transformed into a form that contains discrete frequencycoefficients using the FFT function, feature selection can be applied by selectingonly the desired range of frequency components. In fuel level systems, the sloshwaves produced in the tank consist of low-frequency components. Therefore, onlythe lower frequency range (0–10 Hz) can be selected and fed into the signalclassification unit (i.e. neural network).

3.2.4.2 Discrete Cosine and Sine Transforms

A sequence of finite data points can be expressed in terms of a sum of cosinefunctions oscillating at different frequencies using the DCT function. The DCT hasbeen used in numerous applications in the fields of science and engineering, fromdigital compression of images and audio, to spectral methods for the numericalsolution of partial differential equations. DCT plays a vital role in JPEG [11] andMPEG [12] type still images and multimedia compression.

In principle, DCT is related to Fourier Transformation (FS); however, DCTonly operates on the real data with even symmetry. DCT of a sample signal x(0),x(1), …, x(N-1) consisting of N number of samples is defined as [13]:

yðkÞ ¼ aðkÞXN�1

n¼0

xðnÞ cospð2nþ 1Þk

2N

� �; k ¼ 0; 1;. . .;N� 1 ð3:5Þ

The Inverse Discrete Cosine Transform (IDCT) function can be given as:

xðnÞ ¼XN�1

k¼0

aðkÞyðkÞ cospð2nþ 1Þk

2N

� �; n ¼ 0; 1;. . .;N� 1 ð3:6Þ

where,

aðkÞ ¼

ffiffiffiffiffi1N ;

qk ¼ 0ffiffiffiffiffi

2N ;

qk 6¼ 0

8><>: :

The transformation in vector form is written as [13]:

y ¼ CT x; ð3:7Þ

where, the elements of the matrix C are given by:

Cðn; kÞ ¼ 1ffiffiffiffiNp ; k ¼ 0; 0� n�N � 1 ð3:8Þ

Cðn; kÞ ¼ffiffiffiffi2N

rcos

pð2nþ 1Þk2N

� �; 1� k�N � 1; 0� n�N � 1 ð3:9Þ

42 3 Fluid Level Sensing Using Artificial Neural Networks

Page 50: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The Discrete Sine Transform (DST) is similar to DCT, however, it operates onthe real-odd portions of the DFT. DST is defined via the transform matrix [13]:

Sðk; nÞ ¼ffiffiffiffiffiffiffiffiffiffiffiffi

2N þ 1

rsin

pðk þ 1Þðnþ 1ÞN þ 1

� �; k; n ¼ 0; 1; . . .;N � 1: ð3:10Þ

The DCT and DST belong to the family of transforms that can be computed viaa fast method in O(N log2 N) operations [14]. DCT [7] is a real transform that hasgreat advantages in energy compaction [15]. The use of DCT rather than DST ispreferred in data compression applications, since the cosine functions (used inDCT) are much more efficient in transformation and require fewer data points toapproximate a typical signal.

3.2.4.3 Wavelet Transform

The Wavelet Transform is similar in concept to FFT; however, with the exceptionthat WT not only provides the frequency representation of the signal but alsoretains the time information [16]. It uses the windowing technique with variable-sized regions to provide a time-frequency representation of the input signal. It isuseful for analyzing non-stationary signals, where the frequency varies over time[16]. Therefore, local analysis can be performed using the WT method. WaveletTransform of a continuous signal yðtÞ can be defined as:

Cðs; pÞ ¼Z1

�1

yðtÞwðs; p; tÞ dt ð3:11Þ

where wðs; p; tÞ is the mother wavelet with s as the scale and p the position attime t.

To transform signals that are discontinuous (sampled signals), Discrete WaveletTransform (DWT) algorithm is used that analyzes signals at different frequencybands by decomposing them into coarse information and detail information sets[17]. The coarse information set contains the low-frequencies, whereas, the detailinformation contains the high-frequency components of the input signal. Todecompose an input signal into high-frequency and low-frequency components,DWT employs two sets of functions known as the scaling functions and waveletfunctions, where the functions can be viewed as low-pass and high-pass filters,respectively [17].

Figure 3.3 shows the input signal S, consisting of 1,000 sample points, beingdecomposed and down-sampled into high-frequency (cD) and low-frequency(cA) components. Down-sampling is useful in compressing the signal by dis-carding the higher frequency component, which is usually the noise [17]. Thecoefficients cA and cD represent the features of the original signal. After per-forming DWT on the input signal, the cA coefficients can be fed into the signalclassification unit.

3.2 Signal Processing and Classification 43

Page 51: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

3.2.5 Signal Classification

Pattern classification methods are divided into two classes [18]:

• Supervised Classification• Data Clustering (unsupervised classification)

Supervised classification methods require both the input and the target outputdata. It consists of the assignment of labels to the test pattern based on the trainingpatterns. There are two phases in supervised classification methods: learning andclassification. The pattern classifier system learns the system based on the trainingdata, and after training, it can be used to classify the test patterns. There are severaldifferent data classification methods, each method has different benefits and dis-advantages. Table 3.1 lists a few classification methods and provides a comparisonof their performance, computational cost, and other factors [4].

~ 500 coefs

~ 500 coefs

S

cD

cA

1000 Samples

High-Pass

Low-Pass

Fig. 3.3 Decompositionof signal S into high- andlow-frequency portions [17]

Table 3.1 Comparison of various classification algorithms [4]

Algorithm Classificationerror

Computationalcost

Memoryrequirements

Difficulttoimplement

Online Insightfrom theclassifier

Expectationmaximization(EM)

Low Medium Small Low No Yes

Nearest neighbour Med-Low High High Low No NoDecision trees Medium Medium Medium Low No YesParzen windows Low High High Low No NoLinear least

squares (LS)High Low Low Low Yes Yes

Geneticprogramming

Med-Low Medium Low Low No Some

Neural networks Low Medium Low High Yes NoAda-Boost Low Medium Medium Medium No NoSupport vector

machines(SVM)

Low Medium Low Medium Yes Some

44 3 Fluid Level Sensing Using Artificial Neural Networks

Page 52: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

In data clustering (unsupervised classification), the target value is not usedwhile training. The clustering method clusters the sample data points according totheir correlation with different cluster centers so as to attain a good partition of thedata. There are many different types of data clustering methods available, somewell-known methods are listed below [4]:

• K-means [19]• Fuzzy k-means [20]• Kohonen maps [21]• Competitive learning [22]

Supervised feed-forward neural networks are more flexible and can yield muchbetter results when compared with the data clustering methods such as K-means[23].

3.3 Artificial Neural Networks

ANN is an information processing technique that is inspired by the way biologicalnervous systems process information. It consists of neurones, a large number ofhighly interconnected elements working to solve specific problems. Similar tohumans, ANNs learn by example. A learning process configures ANN for a spe-cific application such as pattern recognition or data classification. Learning inbiological systems involves adjustments to the synaptic connections that existbetween the neurones, which is also true for ANNs [24].

Neural networks have a remarkable ability to derive meaning from complicatedor imprecise data. ANN can be used to extract patterns and detect trends that aretoo complex to be noticed by either humans or other computer techniques. Atrained neural network can be thought of as an expert in the categorization ofinformation it has been given to analyze [24]. With a sufficient number of hiddenneurons, neural networks can be trained to produce any continuous multivariatefunction with any desired level of precision [25].

Commonly, neural networks are adjusted, or trained, so that a particular inputleads to a specific target output. Such a situation is shown below. The network isadjusted, based on a comparison of the output and the target, until the networkoutput matches the target. Typically, many such input/target pairs are needed totrain a network. [26] (Fig. 3.4).

3.3.1 Neuron Model

The neuron receives inputs and produces an output that can be adjusted accordingto the training or teaching parameters. Figure 3.5 illustrates a simple neuronmodel. The output values can be adjusted using the weights W1, W2,…,Wn.

3.2 Signal Processing and Classification 45

Page 53: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The output a of the neuron in Fig. 3.6 is the function of input p multiplied bythe weight w, or a = f(wp). The neuron on the right has a scalar bias a, which isseen as simply being added to the product wp or as shifting the function f to the leftby an amount b. The sum of the weighted inputs and the bias b feeds into thetransfer function f.

The function f is the transfer function, normally a step function or a sigmoidfunction. The central idea of neural networks is that such parameters canbe adjusted so that the network exhibits some desired or interesting behavior.

Neuron Output

Teaching input

Inputs

Teach or Use

W1

W2

Wn

Fig. 3.5 A simple neuronmodel

Input Neural Network

(including weights and connections)

Output Target

Adjust Weights

Compare

Fig. 3.4 Typical configuration of an ANN [28]

Fig. 3.6 Neuron model withand without bias [26]

46 3 Fluid Level Sensing Using Artificial Neural Networks

Page 54: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The network can be trained to produce a particular function by adjusting theweight or bias parameters [26].

3.3.2 Transfer Function

The transfer function plays an important role in producing the output of a neuralnetwork. The transfer function combines the inputs and the weights values todeliver a signal to the output. This function typically falls into one of the threecategories:

• Linear (or ramp)• Threshold• Sigmoid

3.3.2.1 Linear Transfer Function

The output activity is proportional to the total weighted input. It is referred inMATLAB as purelin function (Fig. 3.7).

3.3.2.2 Threshold Transfer Function

Threshold transfer function sets the output to one of the two levels, depending onwhether the total input is greater or less than some threshold value. It is known ashard-limit or hardlim function in MATLAB (Fig. 3.8).

Fig. 3.7 Linear transferfunction [26]

Fig. 3.8 Threshold transferfunction [26]

3.3 Artificial Neural Networks 47

Page 55: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

3.3.2.3 Sigmoid Transfer Function

For sigmoid units, the output varies continuously but not linearly as the inputchanges. Sigmoid units bear a greater resemblance to real neurones than do linearor threshold units [22]. It is also known as Log-Sigmoid or logsig function inMATLAB (Fig. 3.9).

3.3.3 Perceptron

A perceptron neuron, which uses the threshold or hard-limit transfer functionhardlim, is shown in Fig. 3.10.

Each external input is weighted with an appropriate weight w1,j, and the sum ofthe weighted inputs is sent to the hard-limit transfer function, which also has aninput of 1 transmitted to it through the bias. The hard-limit transfer functionreturns a 0 or a 1. The perceptron neuron produces a 1 if the net input into thetransfer function is equal to or greater than zero; otherwise it produces zero at theoutput [26].

In MATLAB, the perceptron networks can be trained with the adapt function.This function presents the input vectors to the network one at a time and makescorrections to the network based on the results of each presentation. The use of theadapt function in this way guarantees that any linearly separable problem is solvedin a finite number of training presentations [27].

Fig. 3.9 Sigmoid transferfunction [26]

Fig. 3.10 Perceptron neuron[26]

48 3 Fluid Level Sensing Using Artificial Neural Networks

Page 56: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

3.4 Neural Network Architectures

3.4.1 Overview

A brief description of neural networks has been provided in the previous section.This section focuses on different architectures or topologies of neural networksthat can be used in this research.

3.4.2 Network Layers

Commonly, there are three main layers in neural networks, where each layer isconnecting to the neighbor layer [18]:

• Input layer—contains raw information about the input• Hidden layer—is based on inputs and weights between input and hidden layer• Output layer—depends on the activity of the hidden layer and the weights

between hidden and output layers (Fig. 3.11)

A neural network can have several layers. The use of layer notation can be seenin the three-layer network shown in Fig. 3.12 [26]. Each layer has a weight matrixW, a bias vector b, and an output vector a. The outputs of each intermediate layerare the inputs to the following layer.

3.4.3 Network Topologies

Two commonly used topologies of artificial neural network are:

• Feed-Forward Network and• Dynamic Neural Network

3.4.3.1 Feedforward Neural Network

In feedforward neural network topology, signals travel in one direction only, i.e.,from input to output. There is no loop or feedback between the neurons and their

INPUTLAYER

HIDDEN LAYER

OUTPUTLAYER

Fig. 3.11 Three main layersof ANN

3.4 Neural Network Architectures 49

Page 57: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

inputs and outputs. This network topology is also called static network and it isextensively used in pattern recognition. Backpropagation (BP) is the most populartype of feedforward neural network. Figure 3.13 illustrates an example of a staticfeedforward neural network topology.

3.4.3.2 Dynamic Neural Network

Neural networks can be classified into dynamic and static categories. Static(feedforward) networks have no feedback elements and contain no delays; theoutput is calculated directly from the input through feedforward connections. Indynamic networks, the output depends on not only the current input to the network,but also on the current or previous inputs, outputs, or states of the network.Dynamic neural networks are divided into two types [18]:

Fig. 3.12 Multiple layers of neurons [26]

Input Layer Output LayerHidden

Input

Neurons

Output

Fig. 3.13 Feedforward staticneural network

50 3 Fluid Level Sensing Using Artificial Neural Networks

Page 58: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

• Time-delay neural networks—Those that only have feedforward connectionsand

• Recurrent neural networks—Those that have feedback or recurrent connections

Time-delay neural networksFocused Time-Delay Neural Network (FTDNN) and Distributed Time-DelayNeural Network (TDNN) are examples of feedforward dynamic neural networks.FTDNN has an additional delay line at the input only, whereas, TDNN has atapped delay line memory at the input as well as throughout the network. [18].There is no feedback connection in these networks. These networks are well suitedfor applications involving time-series prediction. TDNN networks attempt torecognise the frequency content of the input signals, which suggests the suitabilityof these networks in determining time-varying sloshes. Figure 3.14 illustrates theDistributed (TDTT).

Recurrent neural networksIn recurrent neural network topology, signals can travel in both directions, i.e.,forward and backward. The neurons may be connected with each other formingloops or feedback, as shown in Fig. 3.15. This is a powerful method to controldynamic systems; however, it can also get quite complicated. The dynamic state ofthis network continuously changes until it reaches an equilibrium state. The systemstate stays at equilibrium until another input is received which causes the system toreconsider its state and a new equilibrium state is produced (Fig. 3.16).

Input Layer Output LayerHidden

Input

Neuron

Output

Time Delay Tap

Fig. 3.14 Distributed time-delay neural network

Input Layer Output LayerHidden

Input

Neurons

Output

Fig. 3.15 Recurrent neuralnetwork

3.4 Neural Network Architectures 51

Page 59: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The output of the NARX can be described as:

yðtÞ ¼ f ðyðt � 1Þ; yðt � 2Þ; . . .; yðt � nyÞ; uðt � 1Þ; uðt � 2Þ; . . .; uðt � nuÞÞð3:6Þ

3.5 Training Principles

3.5.1 Overview

Neural networks can be trained to perform a specific task. There are severalengineering tools available to train neural networks. MATLAB is one suchpowerful tool that includes a neural network module that trains, analyzes, andsimulates the neural network. Training procedure follows a learning rule ortraining algorithm, which is defined as a procedure for modifying the weights andbiases of a network [26]. Learning rules fall into two broad categories: Supervisedlearning and Unsupervised learning (Data clustering). A detailed discussed onthese two categories is contained in this section.

3.5.2 Supervised Learning

Supervised learning incorporates an external teacher, so that each output unit is toldwhat the desired response to input signals ought to be [28]. The learning rule isprovided with a set of examples (known as training set) of proper network behavior:

p1; t1f g; p2; t2f g; . . .; pQ; tQ

� �ð3:7Þ

Fig. 3.16 NARX network architecture

52 3 Fluid Level Sensing Using Artificial Neural Networks

Page 60: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

where, pq is an input to the network, and tq is the corresponding correct (target)output.

As the inputs are applied to the network, the network outputs are compared tothe targets. The learning rule is then used to adjust the weights and biases of thenetwork in order to move the network outputs closer to the targets.

3.5.3 Unsupervised Learning

Unsupervised learning method does not use an external teacher and it is based onlyupon local information. It is also referred to as self-organization, in the sense that itself-organizes data presented to the network and detects their emerging collectiveproperties [24]. The weights and biases are modified in response to network inputsonly. There are no target outputs available. Most of these algorithms performclustering operations. They categorize the input patterns into a finite number ofclasses. This is especially useful in such applications as vector quantization [26].

3.6 Neural Networks in Dynamic Environments

3.6.1 Overview

The use of neural networks in providing solutions to capacitive sensing levelmeasurement applications is discussed in this section. Furthermore, applicationsthat describe solutions to the issues pertaining to the accuracy of measurementsensors in dynamic environments are discussed in this section.

3.7 Temperature Compensation with Neural Networks

Patra et al. [29] proposed a scheme for an intelligent capacitive pressure sensor(CPS) using an (ANN). A switched-capacitor circuit (SCC) converts the change incapacitance of the pressure sensor into an equivalent voltage. The effect of changein environmental conditions on the CPS and subsequently upon the output of theSCC is nonlinear in nature. Especially, change in ambient temperature causesresponse characteristics of the CPS to become highly nonlinear, and complexsignal processing may be required to obtain the correct readout.

The proposed ANN-based scheme incorporates intelligence into the sensor. It ismentioned that this CPS model can provide a correct pressure readout within 1%error (full scale) over a range of temperature from 20 to 70�C. Two ANN schemes,direct modeling and inverse modeling of a CPS, are reported. The former modelingtechnique enables an estimate of the nonlinear sensor characteristics, whereas the

3.5 Training Principles 53

Page 61: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

latter technique estimates the applied pressure which is used for direct digitalreadout. When there is a change in ambient temperature, the ANN automaticallycompensates for this change based on the distributive information stored in itsweights [29].

Another method described by Patra et al. [30] also uses an ANN. The describedneural network-based sensor model automatically calibrates and compensates withhigh accuracy for the nonlinear response characteristics and nonlinear dependencyof the sensor characteristics on environmental parameters. It was shown that theNN-based (CPS) model can provide pressure readout with a maximum full-scaleerror of only 1.5% over a temperature range of -50 to 200�C for the three forms ofnonlinear dependencies [30].

References

1. Pharr, M., & Humphreys, G. (2004). Sampling and reconstruction. Physically basedrendering: From theory to implementation (pp. 279–367). Amsterdam, Boston: Elsevier/Morgan Kaufmann.

2. Hayes, M. H. (1999). Sampling Schaum’s outline of theory and problems of digital signalprocessing (pp. 101–141). New York: McGraw Hill.

3. Blum, A., & Langley, P. (1997). Selection of relevant features and examples in machinelearning. Artificial Intelligence, 97, 245–271.

4. Bousquet, O., von Luxburg, U., Rätsch, G. (2004). Machine learning summer school. In U.von Luxburg & G. Rätsch (Eds.), Advanced lectures on machine learning: ML summerschools 2003, Canberra, Australia, February 2–14, 2003, Tübingen, Germany, August 4–16,2003, (Rev. lectures/Olivier Bousquet). Berlin, New York: Springer.

5. Diniz, P. S. R. (2006). Adaptive filtering: Algorithms and practical implementation. NewYork: Springer.

6. Trunk, G. V. (1979). A problem of dimensionality: A simple example. Pattern Analysis andMachine Intelligence, PAMI-1(3), 306–307.

7. Ahmed, N., Natarajan, T., & Rao, K. R. (1974). Discrete cosine transform. IEEETransactions on Computers, C-23(1), 90–93.

8. Brigham, E. O. (1988). The fast fourier transform and its applications. Englewood Cliffs, NJ:Prentice Hall.

9. Zonst, A. E. (1995). Understanding the FFT: A tutorial on the algorithm and software forlaymen, students technicians and working engineers. Titusville, FL: Citrus Press.

10. Oklobdzija, V. G. (2002). The computer engineering handbook. Boca Raton: CRC Press.11. Pennebaker, W. B., & Mitchell, J. L. (1992). JPEG still image data compression standard.

New York: Van Nostrand Reinhold.12. Salomon, D., Bryant, D., & Motta, G. (2007). Data compression: The complete reference.

London: Springer.13. Theodoridis, S., & Koutroumbas, K. (2003). The discrete cosine and sine transforms. Pattern

recognition (2nd ed., pp. 230–231). San Diego, CA: Elsevier Academic Press.14. Jain, A. K. (1989). Fundamentals of digital image processing. Englewood Cliffs: Prentice Hall.15. Nixon, M. S., & Aguado, A. S. (2002). Discrete cosine transform. Feature extraction and

image processing (pp. 57–58). Oxford: Newnes.16. Mallat, S. G. (1999). A wavelet tour of signal processing. San Diego: Academic.17. Michel, M., Yves, M., Georges, O., & Jean-Michel, P. (2009) Discrete wavelet transform.

Wavelet toolbox 4—users guide. MathWorks, 1, 24–28.

54 3 Fluid Level Sensing Using Artificial Neural Networks

Page 62: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

18. Demuth, H., Beale, M., & Hagan, M. (2008). Neural network toolbox 6—users guide.MathWorks, 9(4), 259–265.

19. Lloyd, S. (1982). Least squares quantization in PCM. IEEE Transactions on InformationTheory, 28(2), 129–137.

20. Bezdek, J. C. (1973). Fuzzy mathematics in pattern classification. Applied mathematicscenter, Cornell University.

21. Kohonen, T. (1989). Self-organization and associative memory. New york: Springer.22. Rumelhart, D. E., & Zipser, D. (1986). Feature discovery by competitive learning. In Parallel

distributed processing (pp. 151–193). MIT Press.23. Hruschka, H., & Natter, M. (1999). Comparing performance of feedforward neural nets and

K-means for cluster-based market segmentation. European Journal of Operational Research,114(2), 346–353.

24. Neural Networks. [cited]. Available from: http://www.doc.ic.ac.uk/*nd/surprise_96/journal/vol4/cs11/report.html.

25. Ripley, B. D. (1993). Statistical aspects of neural networks. In O. E. Barndorff-Nielsen,J. L. Jensen, & W. S. Kendall (Eds.), Networks and chaos—statistical and probabilisticaspects (pp. 40–123). London: Chapman and Hall.

26. Demuth, H., Beale, M., & Hagan, M. (2007). Neural network toolbox 5—users guide.MathWorks.

27. Rojas, R. (1996). Neural networks—a systematic introduction. New York: Springer.28. Ball, R., & Tissot, P. (Date) Demonstration of artificial neural network in Matlab. Journal

[serial on the Internet]. The Mathworks Inc.29. Patra, J. C., Kot, A. C., & Panda, G. (2000). An intelligent pressure sensor using neural

networks. IEEE Transactions on Instrumentation and Measurement, 49(4), 829–834.30. Patra, J. C., Gopalkrishnan, V., Ang, E. L., & Das, A. (2004). Neural network-based self-

calibration/compensation of sensors operating in harsh environments [smart pressure sensorexample]. Proceedings of IEEE Sensors, 1, 425–428. October 24–27, 2004.

References 55

Page 63: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 4Methodology

4.1 Overview

This chapter discusses the characteristics of the capacitive sensor signal obtainedfrom a fuel level sensor under dynamic conditions. It also describes a methodologyto be used to develop a fluid level measurement system that compensates for theeffects of a dynamic environment. This involves using an intelligent signal clas-sification approach based on an Artificial Neural Network (ANN). Signalsmoothing functions that will be implemented to enhance the performance of theANN-based signal classification system are also described.

4.2 Capacitive Sensor-Based Level Sensing

4.2.1 Capacitive Sensor Signal

The output of the capacitive sensor is normally a continuous voltage signal overtime. The voltage signal is the representation of the fluid level observed by thesensor. The range, resolution, and linearity of the output signal could be differentfrom one type of manufacturer to another. The sensor signal representing the fluidlevel is illustrated in Fig. 4.1.

If L is the length of the capacitive tube filled with the fluid, and v is itsrepresented level in voltage, assuming the sensor response to be linear, theresolution can be given as:

Resolution ¼ DL

Dvmetre per volt ð4:1Þ

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3_4,� Springer-Verlag London 2012

57

Page 64: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The capacitive tube immersed in the liquid tank will detect the maximum level,hence the maximum voltage, when the fluid is filled up to the top of the sensingtube. Likewise, the minimum level will be detected when there is no fluid fillingthe sensing tube. The maximum and minimum level is dependent on the placementand length of the capacitive tube in the tank.

4.2.2 Sensor Response Under Slosh Conditions

Slosh waves will be produced in a tank filled with liquid when an external force isapplied to it. Representation of these slosh waves in a digital signal can be carriedout using a tubular capacitive sensor as the waves propagate through the capacitivetube within the tank. If the capacitive sensor can produce instantaneous readings ofthe fluid level in an electrical unit, a replica of these slosh waves could be observedon the oscilloscope. Figure 4.2 shows the output of the capacitive sensor readingthat will be seen on an oscilloscope under both static and dynamic conditions.Figure 4.2a shows that the sensor response is fairly constant under static condi-tions; Figure 4.2b shows that the sensor response produces a replica of the actualslosh waves.

As the fluid fluctuates, the sensor output produces a replica of the slosh wavesthat contains the following two components (Fig. 4.3):

• Oscillating wave, and• Bias shift

The frequency response of the oscillating slosh waves can be observed bytransforming the capacitive signal into the frequency domain. Fast FourierTransform (FFT) function can be used to obtain the frequency coefficients. Themagnitude of these frequency coefficients and the median value (bias shift) canbe used to describe the slosh pattern that exists in the fluid container. Thesesignal characteristics can be processed through an ANN to eliminate the effectsof dynamic slosh. Additionally, along with the frequency coefficients and biasshift, temperature and contamination values could also be processed through theANN to eliminate their effects on signal measurement accuracy.

Time

Vol

tage

Min

Capacitive Sensor

Lev

el

Ran

ge

Fig. 4.1 Capacitive signal representing fluid level in voltage

58 4 Methodology

Page 65: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

4.3 Design of Methodology

The observation and analysis of the slosh pattern produced under the effects ofacceleration in a closed container, instigated an approach that can eliminate thesloshing effects on level measurement. Thereby, accurate fluid level measurementswould be possible in dynamic environments. If the fluid quantity in a storagecontainer remains constant, the instantaneous fluid level in a dynamic environmentcan be defined as:

LðtÞ ¼ L0 � f ð4:2Þ

where L0 is the tank fluid level under static conditions, and f is the unknownsloshing function that depends on the acceleration effects exhibited on the tank,the existing fluid level, and the tank geometry. The goal is focused on determiningthe actual level L0 using the sensor output L(t) and the function f. The output of the

(b)

Capacitive Sensor

Static tank

Time

Vol

tage

Capacitive Sensor

Slosh Waves

TimeV

olta

ge

(a)

Fig. 4.2 Sensor response in static and dynamic conditions. a Tank remains static. b Tankmovement is produced

Time

Vol

tage

Bias shift

Oscillating wave

Fig. 4.3 Two components ofthe slosh wave

4.3 Design of Methodology 59

Page 66: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

fluid level sensor is observed to have a direct relationship with the vehicleacceleration when observed in a running vehicle, as shown in Fig. 4.4.

If the value of sloshing function f is known for every corresponding value ofsensor output L(t) the effect of fluid slosh can be eliminated.

L0 ¼LðtÞ

f¼ constant ð4:3Þ

The unknown function f is solved by experimentation with the aid of a neuralnetworks-based approach. A neural network can be constructed and trained withthe actual driving data obtained through several field trials to produce accuratelevel readings under the effect of liquid sloshing. Figure 4.5 demonstrates amethod that can be adopted to develop an accurate fluid level measurementsystem.

The capacitive level sensor signal, denoted as s(t), is a typically voltage signalin the range 0–5 V, which represents the minimum and maximum of the levelrange respectively. A detailed description of the methodology is provided inChap. 5. The sensor signal s(t) is sampled at 100 Hz. The sampled signal isaccumulated in a x9 second window frame (wi). The optimal value of x9 will bedetermined by experimentation as described in Chap. 5. After collecting the sensordata over x9 seconds, the x9 second data is filtered using the investigated filters.

0 50 100 150 200 250 300 350 400 450 5000

0.2

0.4

0.6

0.8

1

(a)

Sen

sor

Out

put (

V)

0 50 100 150 200 250 300 350 400 450 500-4

-2

0

2

4

Time (s)

Acc

eler

atio

n (m

/s2 )

(b)

Fig. 4.4 Vehicle acceleration and the raw sensor signal. a Raw sensor signal. b Inverted vehicleacceleration

60 4 Methodology

Page 67: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Then the signal features are extracted using the three feature extraction methodsFFT, DCT, and WT. The performance and influence of these three featureextraction functions will be investigated to determine the optimal feature extrac-tion method for the ANN-based measurement system. The coefficients (coef)obtained from the feature extraction functions, the median value (med) of the x9second capacitive sensor signal, the temperature readings T, and the contaminationfactor K are all contained in a vector forming input features for the ANN model.The ANN input vector xi can be represented as:

xi ¼ fcoef1; coef2; . . .; coefn;med; T ;Kg ð4:4Þ

4.4 Feature Selection and Reduction

Signal feature extraction, selection, and reduction play an important role in signalclassification systems. An introduction to feature extraction was given in Sect.3.2.4. Improper format of input signals supplied to the classifier can result in apoorly constructed classification problem. As Trunk [1] has demonstrated, data canbe detrimental to classification, especially if the data are highly correlated [2].Apart from the correlation of data, the size of the input feature data set is alsoimportant in determining the performance of signal classification systems. Anincrease of the input feature dimension ultimately causes a decrease in perfor-mance [3]. Hence, the correlation of the input data and the number of inputfeatures to be selected will be investigated during the development of the neuralnetwork-based classification system.

The process of choosing a subset of the features is referred to as ‘featureselection’, and the process of finding a good combination of features is known as‘feature reduction’ [4]. The goal of feature selection and reduction in signalpreprocessing is to choose a subset of features or some combination of the inputfeatures that will best represent the data [4]. According to Yom-Tov [4], findingthe best subset of features by testing all possible combinations is practically

s(t) S[n]

wi

Pre-Processing

Feature ExtractionFFT. DCT. WT

ANN

Training & Classification

Capacitive Level Sensor

Sampling

~100Hz

Windowing

xyVolume

Contamination value

Temperature value

Fig. 4.5 Block diagram of the proposed system

4.3 Design of Methodology 61

Page 68: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

impossible even when the number of input features is modest. For example, to testall possible combinations of the input data with 100 input features will requiretesting 1030 combinations [4].

According to Richards et al. [5], feature reduction can be effectively performedby transforming the data to a new set of axes, where patterns within the transformeddata set could be more easily distinguished than with the original data set [5].Therefore, in the capacitive type fluid level sensing system, the raw time-basedlevel signals will be converted into the frequency domain using the FFT functiondescribed in Sect. 3.2.4. By carrying out the Fourier transformation, the raw signalcontents that will be used as an input to the neural network will be represented byfrequency-coefficients. Figure 4.6 shows an example of the raw time-domain signalfrom the capacitive sensor over 60 s, and the frequency response of the samesignal obtained using the FFT function. The frequency spectrum of the raw sensorsignal under the influence of slosh describes the fluctuations or slosh frequencies inthe fuel tank. The frequency spectrum shown in Fig. 4.6 displays two large spikes at0.4 and 0.8 Hz, which represent two harmonics waves of the slosh.

According to Richards et al. [5], features which do not aid discrimination, bycontributing little to the separability of spectral classes, should be discarded.Richards et al. [5] describe feature selection as the process in which the leasteffective features are removed. Feature selection methods can be divided into threemain types [6]:

Fig. 4.6 Feature extraction using FFT function

62 4 Methodology

Page 69: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

1. Wrapper methods: The feature selection is performed around (and with) a givenclassification algorithm. The classification algorithm is used for ranking pos-sible feature combinations.

2. Embedded methods: The feature selection is embedded within the classificationalgorithm.

3. Filter methods: Features are selected for classification independently of theclassification algorithm.

In the proposed capacitive type fluid level sensing system, the Filter method isused to perform feature selection because this is the method that is independent of theclassification algorithm, while the other two methods incorporate learning orregression analysis. Additionally, filter methods are currently widely used in fueltank level sensing (without neural networks) to compensate for the effect of the slosh.They generally result in higher inaccuracy in dynamic environments. In this chapter,comparison will be made between various filters with and without use of the neuralnetworks to understand the effectiveness of each method. Based on the knowledge ofthe maximum slosh frequency attainable in a vehicle’s fuel tank, a low-pass filtermethod can be used to extract only selected number of FFT coefficients that wouldactually represent the sloshing and hence the undesired range offrequency will not betaken into consideration during signal processing through the neural network.

After transforming the time-based sensor signal into the frequency spectrum,the undesired portion of frequencies mainly consisting of low-amplitude noise isomitted. To determine the range of frequencies that may be exhibited in the fueltank, a 60-km-test drive was run in a suburban area, where occasional stops weremade. Figure 4.7a shows the typical range of slosh frequencies observed in thevehicular fuel tank using the capacitive type level sensor during a 60-km-testdrive. A close view of the 0–2 Hz slosh frequency range is shown in Fig. 4.7b.By using a low-pass filter, frequencies having lower amplitudes (i.e. noise) canbe removed prior to processing the signals through an ANN.

4.5 Signal Filtration

In the signal smoothing process, the raw signal is filtered to remove the signalnoise by smoothening it with the three investigated methods: Moving Mean,Moving Median, and Wavelet Transform (WT). A raw signal over x9 second ispassed through the investigated filters. The moving mean and moving medianfilters slide across the raw signal and calculate the mean/median values in theneighboring sampled points. If x is the sampled raw signal of N length, and w issize of the moving window, then the filtered output y using mean and median canbe obtained using Eqs. 4.5 and 4.6, respectively. The width of the moving windoww will be determined by experimentation (Chap. 5). The sliding window (movingwindow) function takes w samples of the raw signal and produces a mean ormedian value at the output.

4.4 Feature Selection and Reduction 63

Page 70: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

y½i� ¼ meanðx½i� 1�; x½i� 2�; . . .; x½i� w�Þ; for w� i�N

y½i� ¼ meanðx½1�; x½2�; . . .; x½i�Þ; for 1� i\wð4:5Þ

y½i� ¼ medianðx½i� 1�; x½i� 2�; . . .; x½i� w�Þ; w� i�N

y½i� ¼ medianðx½1�; x½2�; . . .; x½i�Þ; for 1� i\wð4:6Þ

0 1 2 3 4 5 6

0

100

200

300

400

500

Slosh Frequency (Hz)

|F|

0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.00

100

200

300

400

500

600

Slosh Frequency (Hz)

|F|

Very SignificantFreq. Range

Low amplitudeslosh range

(a)

(b)

Fig. 4.7 Typical range of slosh frequency in the fuel tank during normal driving

64 4 Methodology

Page 71: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The value of N for a signal frame of x9 second at 100 Hz is calculated as:

N ¼ 100 samples/s � x^

s ¼ 100 x^

samples ð4:7Þ

Figure 4.8 illustrates the moving mean and moving median filters when applied

to the raw signal data. As the moving window slides across the 20 s (x^ ¼ 20) long

raw signal, mean/median functions are applied to the raw signal values within thewindow range and a smooth signal is produced. The filtered versions of the rawsignal using both filters do not contain high frequency noise.

Another filter investigated is the WT filter that analyzes signals at differentfrequency bands by decomposing them into coarse information and detailedinformation sets. The coarse information set contains the low frequencies,whereas, the detailed information set contains the high frequencies of the inputsignal. Only the low frequency components, which reflect a smoothened version ofthe raw signal, are used and the high frequency components of the raw signal,which usually contain noise, are discarded. Hence, a smooth signal is produced

0.410

0.415

0.420

0.425

0.430

0.435

0.440

0.445

0.450

0.455

0.460

0 0.5 1 1.5 2 2.5 3

Time (s)

Lev

el s

ign

al (

V)

0.410

0.415

0.420

0.425

0.430

0.435

0.440

0.445

0.450

0.455

0.460

0 0.5 1 1.5 2 2.5 3

Time (s)

Lev

el s

ign

al (

V)

Moving Mean

Moving Median

Moving window

Filtered Output

Raw Signal

Fig. 4.8 Illustration of the moving mean and moving median filters

4.5 Signal Filtration 65

Page 72: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

using the WT function, as shown in Fig. 4.9. The Wavelet transformation isprocessed through MATLAB using dwt [7] function with Daubechies [8] Wavelet(db1).

Figure 4.9 shows the high frequency signal (b) and the low-pass filtered signal(c) when the raw sensor signal (a) is processed with the Discrete WaveletTransform (DWT) function.

All filtered signals using the investigated filtration methods are transformed intothe frequency domain and the frequency coefficients obtained, which are then fedinto the ANN-based signal processing system.

4.6 Influential Factors Analysis

An analysis on the influential factors will be carried out before the development ofthe ANN-based capacitive signal processing system. In the influential factorsanalysis, the effects and interaction between the influential factors will be inves-tigated by observing the response of the capacitive sensor. It was proposed inChap. 2 that the main factors influencing the accuracy of the measurement systemare: slosh, temperature, and contamination. The results from the factors analysis

0 2 4 6 8 10 12

Raw

Inpu

t

0 2 4 6 8 10 12

Det

aile

d

0 2 4 6 8 10 12Time (s)

App

roxi

mat

ion

(a)

(b)

(c)

Fig. 4.9 Wavelet filter applied on the raw signal

66 4 Methodology

Page 73: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

experiment will provide an understanding of the magnitude of the effects that thesethree influential factors may contribute to the response of the capacitive sensoroutput. According to Dean et al. [9], it is more effective to examine all possiblecauses of variation simultaneously rather than one at a time. Therefore, all threeinfluential factors will be simultaneously analyzed by developing a two-level (2n)factorial design experiment. Factorial experiments include all possible combina-tions of factor–level in the experimental design [10]. Detailed information aboutthe factorial design is provided in Sect. 5.4.2.

Factorial experiments provide an opportunity to study not only the individualeffects of each factor but also their interactions [11]. The results obtained from thefactorial analysis experiment will be used to generate Main Effects Plots andInteraction Plots of the three main influential factors. Main effects plot providesdetailed measures of the influence of each influential factor on the response of thecapacitive sensor output. Interaction Plots on the other hand provide details ofinteraction that may be found between the influential factors. The Main EffectsPlots and Interaction Plots will provide a better understanding of the impact of thethree influential factors on the capacitive sensor output. These plots will begenerated with Minitab software [12]. Minitab is a very sophisticated and easy touse software, which has also been adopted by most Six Sigma practitioners as apreferred tool [13, 14].

References

1. Trunk, G. V. (1979). A problem of dimensionality: A simple example. Pattern analysis andmachine intelligence (Vol. PAMI-1, no. 3, pp. 306–307, July).

2. Bousquet, O., von Luxburg, U., Rätsch, G. (2004). Machine learning summer school. In:U. von Luxburg & G. Rätsch (Eds.), Advanced lectures on machine learning: ML summerschools 2003, Canberra, Australia, February 2–14, 2003, Tübingen, Germany, August 4–16,2003, revised lectures/Olivier Bousquet. Berlin, New York: Springer.

3. van der Heijden, F., Duin, R. P. W., de Ridder, D., & Tax, D. M. J. (2004). Feature extractionand selection. Classification, parameter estimation, and state estimation : An engineeringapproach using MATLAB (pp. 183–214). Chichester, West Sussex, Eng., Hoboken,NJ: Wiley.

4. Yom-Tov, E. (2004). An introduction to pattern classification. In: O. Bousquet, U. vonLuxburg, & G. Rätsch (Eds.), School, machine learning summer, editors. Advanced lectureson machine learning: ML summer schools 2003 (pp. 1–20). Canberra, Australia, February2–14, 2003, Tübingen, Germany, August 4–16, 2003, revised lectures. Berlin, New York:Springer.

5. Richards, J. A., & Jia, X. (2006). Feature reduction. Remote sensing digital image analysis:An introduction (4th ed., pp. 267–294). Berlin: Springer.

6. Blum, A., & Langley, P. (1997). Selection of relevant features and examples in machinelearning. Artificial Intelligence, 97, 245–271.

7. Michel, M., Yves, M., Georges, O., & Jean-Michel, P. (2009). Wavelet toolbox 4—usersguide. MathWorks.

8. Daubechies, I. (Ed.). (1992). Ten lectures on wavelets. Philadelphia, PA: Society forIndustrial and Applied Mathematics.

4.6 Influential Factors Analysis 67

Page 74: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

9. Dean, A., & Voss, D. (1999). Principles and techniques. Design and analysis of experiments(pp. 1–5). New York: Springer.

10. Mason, R. L., Gunst, R. F., & Hess, J. L. (2003). Factorial experiments in completelyrandomized designs. Statistical design and analysis of experiments: With applications toengineering and science (pp. 140–160). Hoboken, NJ: Wiley-Interscience.

11. Das, M. N., & Giri, N. C. (1987). Factorial experiments. Design and analysis of experiments(pp. 98–159). New York: Halsted Press.

12. MINITAB (2000). User’s guide 2: Data analysis and quality tools. State College, PA:Minitab Inc.

13. Bass, I., Lawton, B. (2009). Lean six sigma using SigmaXL and Minitab. New York:McGraw-Hill, NetLibrary Inc.

14. Bass, I. (2007). An overview of Minitab and microsoft excel. Six sigma statistics with exceland Minitab (pp. 23–40). New York: McGraw-Hill.

68 4 Methodology

Page 75: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 5Experimentation

5.1 Overview

The implementation of the artificial neural network (ANN)-based capacitive signalclassification system requires some training samples of the system with actualsample data obtained under various dynamic conditions. A detailed description ofthe experimental setup used to conduct the research is provided in this section.There are three major experiments performed during this research. All experimentsare carried out using a regular standard automobile fuel tank. The first set ofexperiments determine the influence of contamination, temperature, and sloshingfactors. The second set of experiments determine the suitability and performanceof the static and dynamic neural networks. Finally, extensive experimentation iscarried out with a range of different fluid levels in the tank to observe slosh patternat different fluid levels. The data obtained from the third set of experiments will beused to train the backpropagation neural network while performing signalsmoothening using the Moving mean, Moving median, and Wavelet filters.

5.2 Methodology

In order to develop and enhance the performance of the neural network-based fluidlevel measurement approach; there are three sets of experiments performed in thisresearch. These experiments involve the study of the effects of a dynamic envi-ronment on the capacitive sensor-based fluid level measurement system. Themethodology used to run the experiments and validation plan is shown in Table5.1. The test conditions given in Table 5.1 are applied to the measurement systemduring the experiments to study the response of the capacitive sensor output underdynamic conditions (Fig. 5.1).

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3_5,� Springer-Verlag London 2012

69

Page 76: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Table 5.1 shows the overview of the experimental setup for the developmentand validation of the neural network-based fluid level measurement system. Theexperiments are configured into three discrete sections, which are labelled asExperiment Set A, Experiment Set B, and Experiment Set C. The overview andpurpose of the three parts of the experimental program are described below. Thedetailed descriptions of these three experiments will be provided later in thischapter.

Table 5.1 Methodology of experiments with test conditions, and output parameters

Tested fluid levels(L)

Test conditions Output parameters

ExperimentSet A

40, 45, 50, 55 • Slosh Capacitive sensor—Response withoutANN

• Temperature• Contamination

ExperimentSet B

40, 45, 50, 55 • Slosh Capacitive sensor—Response to sloshwith differentneural networkarchitectures

• Different ANNarchitectures(BP, DTDNN, NARX)

ExperimentSet C

5–9, 15, 20 • Slosh Capacitive Sensor—Response to Sloshwith BackpropagationANN and differentFiltration functions

• Backpropagation ANN• Different Window sizes (x9 )• Different feature extraction

functions (FFT, DCT,DWT)

25, 30, 35–40,45–50

• Different Signal Smoothingfunctions (Moving mean,Moving Median, Wavelet)

• Different filter tap sizes

s(t) S[n]

wi

Pre-Processing

filters

1. Unfiltered2. Mov. Median3. Mov. Mean4. Wavelet

Feature Extraction

FFT,DCT,WT

ANN

Training & Classification

1. BP Network2. DTDNN3. NARX

Capacitive Level Sensor

Sampling

fs

Windowing

xy

Volume

Experiment Set B Experiment Set C

Fig. 5.1 Overview of the experimental methodology

70 5 Experimentation

Page 77: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Experiment Set A is performed to study the interactions and the effects of theinfluential factors, which were proposed in Chap. 2 to be: Slosh frequency, Tem-perature and Contamination, on the capacitive sensor output. In order to understandthe behavior of the capacitive sensor in a dynamic environment, it is important todetermine the magnitude of the influence that the environmental factors contribute tothe response of the capacitive sensor in a dynamic environment. Experiment Set A isdesigned using the design of experiments (DOE) methodology to observe the MainEffects Plot and the Interaction Plot of the influential factors. To set and control theslosh frequency factor, Experiment Set A is conducted on-site using a LinearActuator (see Sect. 5.3.3). A fuel tank filled with fluid is mounted on the linearactuator. The linear actuator is controlled with a digital timer, which could be con-figured to generate a particular slosh frequency in the liquid container. A heater isused to set the temperature factor. To observe the sensor response under the effects ofcontamination, Arizona dust sample of varying quantity is mixed in the fluid. Thedetailed description of Experiment Set A is given in Sect. 5.4.

Experiment Set B is performed to determine the most suitable neural networktopology from a set of commonly used neural network configurations. To comparethe performance of the different neural network topologies under the influence ofthe slosh factor, Experiment Set B is conducted in a manner similar to ExperimentSet A. However, the contamination and temperature factors are kept constantduring Experiment Set B, as the slosh factor in Experiment Set A results (see Sect.6.2) is observed to be the prominent contributor to the accuracy of the measure-ment system. The primary focus of Experiment Set B is to examine the perfor-mance of different neural network topologies under the influence of sloshing. Thedata obtained from Experiment Set B are used to develop and validate two dif-ferent (static and dynamic) topologies of artificial neural networks. The detaileddescription of Experiment Set B is provided in Sect. 5.5.

Experiment Set C is carried out to understand the effectiveness of the ANN-basedsignal processing system on the slosh test data obtained from driving trials. Theselection of the optimal parameters for the ANN-based system is performed in thisexperiment. The influence of signal enhancement operations on the performance ofthe artificial neural network-based signal processing system is also investigated.Signal smoothing is performed on the raw sensor signals to enhance the performanceof the neural network-based signal classification system. In contrast to ExperimentSet A and Experiment Set B, which are both performed on-site on an experimental rigcontaining a linear actuator, Experiment Set C is performed on the road during fieldtrials to examine the performance of the ANN-based fluid level measurement systemunder actual driving conditions (i.e. dynamic environment). Extensive field trials arecarried out for over 20 different tank levels in the automotive fuel tank. During theseexperiments the fluid temperature is created in the fuel tank due to unused return fuelcoming back from the engine. Additionally, the fluid slosh is created due to vehiclemovement. Both temperature and slosh are recorded during the experiment. The dataobtained from the field trials are used to train the Backpropagation Neural Networkusing different signal processing filters. The detailed description of Experiment Set Cis given in Sect. 5.6.

5.2 Methodology 71

Page 78: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

5.3 Data Collection and Processing Methodology

The raw data obtained from the capacitive type level sensor using experimentationis processed using the methodology illustrated in Fig. 5.2.

The output from the capacitive type fluid level sensor is in the form of ananalog voltage signal. The amplitude of the sensor voltage signal denotes the levelof fluid contained in the tank. The sensor signal voltage linearly ranges from 0 V(empty) to 5 V (full). A detailed description of the capacitive level sensor used inthe experiments is provided in Sect. 5.3.1. The level signal from the capacitivesensor is sampled at 100 Hz using a DAQ Card in conjunction with the LabVIEWsoftware program. The sampled signal is accumulated over x9 seconds and thenprocessed through the neural network classifier. In this experiment x9 = 20 sinterval was used to limit the amount of data processing with still acceptableaccuracy of the measurement system.

FFT, DCT, WTCoefficients

Medianvalue

ARTIFICIALNEURAL NETWORK

Capacitive Sensor Signal (Analogue)

LabVIEWSampling at 100Hz

-sec sampled signal

Target/Predicted Volume

Signal Smoothing

Temperature

Contamination

Used in Experiment Set C

Fig. 5.2 Measurement system’s signal processing block diagram

72 5 Experimentation

Page 79: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

In Experiment Set C, where the influence of signal filtration is examined, theaccumulated sensor signal over x9 seconds was processed through a signal filtrationfunction before processing the signal data through the artificial neural networkbased signal processing system. Feature extraction is performed on the signalsprior to processing them through the neural network.

Statistical median function is used to calculate the middle value of the rawsampled signals. The median function provides the middle value as opposed to themean function that provides average value. In Sect. 2.6.4.1, it was discussed that thedownside of averaging is that it produces a significant error for a momentarily largespike due to an abnormal data entry. Therefore, median value was used as the middlevalue or the bias value (refer Sect. 4.2.2) of the fluctuating fluid level (slosh wave).

The frequency coefficients, the median value of the sampled signal, the tem-perature value from the temperature sensor, and the contamination value are allincorporated in the feature vector. The signal feature vector is then used as input tothe neural network-based signal processing system for training and validation ofthe network. Signal processing and signal classification are both carried out usingMATLAB software. Although the initially proposed neural network modelincluded contamination as a variable it was determined in the Experiment Set Athat the influence of contamination was not significant due to relatively constanttemperature during the vehicle experiment. Consequently, it was excluded fromthe neural network model in subsequent vehicle trials in the Experiment Set C.

5.4 Apparatus and Equipment used in ExperimentalPrograms

This section describes the instruments and equipment used to conduct the experiments.The assumptions made during the experiments are also described in the following sections.

5.4.1 Capacitive Level Sensor

The capacitive level sensor used to run the experimentations is the T/LL134 Fuellevel sensor built by Fozmula Ltd. The capacitive sensor is in the configuration ofan elongated tube capacitor (shown in Fig. 5.3).

The length of the liquid sensing tube is approximately 28 cm. The capacitivesensor outputs 0 V at the absence offluid; and 5 V at maximum fluid level. Therefore,the sensor produces the fluid level signal as a continuous analogue voltage signal thatlinearly ranges from 0 to 5 V. The sensor includes a manual calibration option tosense fluid levels in a variety of different kinds of fluids. With the manual calibrationfunction, the capacitive sensor calibrates the value of the dielectric constant withreference to the dielectric constant value of its surrounding fluid. The capacitivesensor can be calibrated at both full and empty points. During full-point calibration,

5.3 Data Collection and Processing Methodology 73

Page 80: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

the capacitive sensor is fully submerged in the fluid for which the sensor is to becalibrated and then the manual calibration (Cal.) button (shown in Fig. 5.3a) ispressed for 5 s. However, during the empty-point calibration, the sensor is taken outof the liquid and is made dry, then the Cal. button is pressed for 5 s. The manufacturerhas described the calibration steps for both full and empty points [1]:

Calibration of the full point:

1. Start with the sender fitted to the tank and connected to the power supply.2. The tank must be filled to the required full level with the liquid for which the

sender is to be calibrated.3. Depress the Cal. button on the top of the sender and hold for 5 s to set the full

point calibration. Check that the output reads full.4. The calibration for the full point can be reset for a liquid of a differing dielectric

constant by repeating the above procedure.

Calibration of the empty point:

1. Remove the sender from the tank, disconnect the power supply and shake offany excess liquid.

2. Depress the button on the top of the T/LL134 and hold.3. Connect the sender to the power supply, while continuing to hold the button for

a further 5 s. Release the button.4. The empty calibration is now set. Check that the output reads zero.

The calibration can be performed in the automotive gasoline type fuel prior tothe experiments to obtain accurate sensor readings. The sensor uses the three-wire

ManualCalibrationButton

Connector

LiquidSensingTube

28 cm

TankFittingThreads

Max.

Min.

(a) (b)

Fig. 5.3 Capacitive sensor used in the experiments

74 5 Experimentation

Page 81: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

connector, where two wires are used to power it and the third wire outputs thesignal as a voltage. The specification details of the capacitive sensor used in theexperiments are given in Table 5.2.

5.4.2 Fuel Tank

The fuel tank used in all the experiments had a storage capacity of 70 L. The fueltank originally belonged to a utility vehicle (Ute). The tank can be approximatedas a rectangular container with dimensions 34 9 34 9 81 cm. The capacitivesensor is mounted on top of the tank. Figure 5.4 shows the fuel tank properly fittedon a linear actuator (refer to Sect. 5.3.3).

The fuel tank is filled with Exxsol D-40 Stoddard solvent. Exxsol is the brandname of Exxon Mobil Corporation. Exxsol solvents are a series of de-aromatizedaliphatic hydrocarbons [2], where typical Aromatic content is below 1%. Thesefluids maintain good solvency characteristics for many applications. Exxondescribes the occupational exposure limit (OEL) of the Exxsol fluids as relativelyhigh, because of this advantage they often serve as replacements for more con-ventional solvents that might not meet health or environmental regulations. Hea-vier Exxsol D grades have boiling ranges between 140� and 310�C [3]. The ExxsolD-40 has the same properties as gasoline fluids but it is relatively safe forindustrial usage. Therefore, Exxsol D-40 fluid is used in the experiments. Thedetailed specifications of the Exxsol D-40 solvent are provided in Appendix B.

5.4.3 Linear Actuator

The Linear Actuator used to run the slosh tests is shown in Figs. 5.5 and 5.6. Thefigures show the actuator and the frame body on which the fuel tank is mounted.

Table 5.2 Capacitive sensordetailed specifications

Parameter Value

Supply voltage 7–35 VdcSupply current 15 mA at 12 Vdc

(approximately)Operating frequency 8.3 kHzOutput signal 0–5 VLinearity 1%Accuracy ±2.5%Housing 30% glass filled Nylon 6Sensor tube Stainless steel 316Internal insulators 30% glass filled Nylon 6Operating temperature -40�C to +85�CStorage temperature -55�C to +100�CShock 50 g 5.3 mS

5.4 Apparatus and Equipment used in Experimental Programs 75

Page 82: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The pneumatic actuator is run by compressed air to slide the tank back andforth. The linear actuator is controlled by a programmable logic controller (PLC)Timing Unit, which is shown in Fig. 5.6. As the linear actuator moves back andforth, slosh waves are created and observed in the fuel tank. The back and forwardstrike of the actuator can be controlled by setting the timer value of the PLCTimer. The PLC Timer actuates (fires) air pressure through the actuator controllercables (highlighted in Fig. 5.6). The fire timing can be easily set by using thekeypad located inside the PLC Timer Box.

5.4.4 Heater

To observe the effects of temperature variations on the sensor response, the heatingchamber is used to heat up the fuel in some parts of the experiments.

5.4.5 Arizona Dust

Arizona dust is used as the impurity substance in experiments to examine theperformance of the capacitive sensor-based measurement system when alterationtakes place in the value of the dielectric constant of the fluid. The response of the

Fig. 5.4 Utility tank used in the experiments

76 5 Experimentation

Page 83: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Fig. 5.5 Linear actuator used for creating slosh

Fig. 5.6 Linear actuator showing PLC timer and linear actuator

5.4 Apparatus and Equipment used in Experimental Programs 77

Page 84: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

capacitive sensor output is observed before and after the introduction of ArizonaDust samples.

5.4.6 Signal Acquisition Card

All signals from the capacitive sensor are acquired and stored on the computerusing the National Instruments DAQ card and the LabVIEW software. The signalacquisition board and the power source are shown in the figures below. The powersupply box is sourced by the AC mains to provide the 12 V DC output for thecapacitive sensor (Figs. 5.7, 5.8).

5.5 Experiment Set A: Study of the Influential Factors

5.5.1 Overview

The purpose of running Experiment Set A is to study the magnitude of the inter-action and the effects of the influential factors, which are proposed as described inChap. 2 to be: Slosh frequency, Temperature and Contamination. In order to fullycomprehend the behavior of the capacitive sensor in a dynamic environment, it is

Fig. 5.7 Signal acquisition board

78 5 Experimentation

Page 85: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

important to quantify the influence of the environmental factors on the response ofthe capacitive sensor.

5.5.2 Factorial Design

Experiment Set A is performed to understand the interactions between the threemain influential factors and determine the magnitude of the effects that thesefactors have on the capacitive sensor output. The experiment is designed with theDOE methodology. There are a wide variety of experimental designs for con-ducting factorial experiments [4]. Completely randomized design is one of themost straightforward designs to implement [4]. Mason et al. [5] described therandomization design method as: ‘Randomization is a procedure whereby factor–level combinations are (1) assigned to experimental units or (2) assigned to a testsequence in such a way that every factor–level combination has an equal chance ofbeing assigned to any experimental unit or position in the test sequence’ [4].

The factorial design is developed in a randomized way using Minitab software[6]. The high and low values of these factors are shown in Table 5.3.

Fig. 5.8 Power supply used to power the capacitive sensor

5.5 Experiment Set A: Study of the Influential Factors 79

Page 86: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The full factorial matrix of 2^3 factors with one replicate is shown in Table 5.4:The response variable in these designs is the fluid level, or the sensor output in

voltage. Arizona Dust is used as contamination in these experiments. The fullfactorial DOE used in this experiment uses only extreme values for each variableto minimize the number of runs and assumes linear relationship between low andhigh values. The main objective is to understand the trend as to how each variableaffects the accuracy (main effects) of the sensor response and interaction betweenvariables (interactions).

5.5.3 Experimental Setup

Experiment Set A is setup to implement the aforementioned factorial design. Afuel tank with 50 L of Exxsol D-40 Stoddard solvent is firmly mounted on thelinear actuator, as described in Sect. 5.3.2. The capacitive sensor described in Sect.5.3.1 is mounted on top of the fuel tank. The sensor cable is connected to the DAQCard. LabVIEW software is then run and the response of the sensor is obtained andstored. The capacitive sensor signal is sampled at 10 Hz sampling frequency. Anoverview of the experiment setup is illustrated in Fig. 5.9.

The experiment is run according to the run order shown in Table 5.4. The linearactuator is used to create slosh waves in the fuel tank. The frequency of the slosh iscontrolled by the PLC Timer described in Sect. 5.3.3. For heating the fluid up to50�C, a heating chamber is used (refer Sect. 5.3.4). Each experiment order shownin Table 5.4 is run for 60 s and the response of the capacitive sensor is recordedthroughout the run period.

Table 5.3 High and lowvalues of the influencingfactors

Factors Low value High value Unit

1-Slosh frequency 0.5 2 Hz2-Temperature 10 50 �C3-Contamination 0 150 g

Table 5.4 Experiment SetA—Full factorial matrix

Runorder

Sloshfrequency (Hz)

Temperature(�C)

Contamination(g)

1 2.0 10 02 0.5 50 1503 0.5 50 04 2.0 10 1505 2.0 50 06 0.5 10 1507 0.5 10 08 2.0 50 150

80 5 Experimentation

Page 87: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

5.6 Experiment Set B: Performance Estimation of Staticand Dynamic Neural Networks

5.6.1 Overview

Experiment Set B is performed to compare the performance of static and dynamicneural networks. The data samples obtained from these experiments are used totrain and validate three different neural networks: BP network, Discrete Time-delay Network, and NARX network. For simplicity, only four volume levels areused in the experiments. The influence of Arizona Dust Samples (contaminant) onthe sensor output is observed in the results of Experiment Set A to be very small;therefore, the influence of the contamination factor is ignored in Experiment Set B.However, temperature changes have a significant effect on the output of thecapacitive sensor and hence the temperature readings are observed and recordedduring this experiment (Fig. 5.10).

5.6.2 Experimental Setup

The setup for these sensor experiments is similar to the setup described forExperiment Set A. The fuel tank is filled with Exxsol D-40 at four different tankvolumes: 40, 45, 50, and 55 L. The capacitive sensor is fitted near the center of thetank. The tank is firmly mounted onto the linear actuator. The actuator is con-trolled by a pulse timer. The range of slosh frequency with very significantamplitude observed during a normal drive (refer Sect. 4.4) is 0.0–2.0 Hz based on

Signal Acquisition

card

PC Logs data using LabVIEW10 Hz sampled

data

Sensor signal in voltage

Fuel Tank

Fuel

Actuator moves back and forth at set frequency to create slosh

Capacitive sensor

Slosh waves

Fig. 5.9 Overview of theexperimental setup forExperiment set A

5.5 Experiment Set A: Study of the Influential Factors 81

Page 88: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

the initial study performed in the vehicle (this will be explained in more detail inthe Chap. 6). Hence, in this experiment, the range of slosh frequency generated bythe linear actuator is also fixed at 0.0–2.0 Hz. The slosh frequency or the cycle oflinear actuator could be selected from 0.0 to 2.0 Hz at an interval of 0.2 Hz. Thecomplete factorial matrix is shown in Table 5.5.

Figure 5.11 shows a block diagram of this experimental setup. The level signalfrom the capacitive sensor is acquired by LabVIEW using a DAQ Card that isconnected to the capacitive sensor. The capacitive signal indicating the fuel levelis sampled and recorded at 100 Hz.

5.6.3 BP Network Architecture

The backpropagation network is constructed using MATLAB software. The net-work is constructed with 64 neurons at the hidden layer (63 neurons representslosh frequency range from 0 to 6.3 Hz in increments of 0.1 Hz and 1 neuronrepresents signal median value after signal smoothing is performed). The number

FFT

Median value

SAMPLE DATA

(VECTOR ix )

Capacitive Sensor Signal (Analogue)

Sampling (100Hz)

20-sec long sampled signal

Temperature Sensor

ANN CLASSIFICATION

Fig. 5.10 System flowdiagram for Experiment Set B

82 5 Experimentation

Page 89: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

of neurons in the hidden layer is the same as the number of input neurons. Thetransfer functions of the hidden and the output layers are tansig and purelinrespectively, which are described in Sect. 3.3.2. An illustration of the BP network

Table 5.5 Experiment Set B—Full factorial matrix

Runorder

Slosh frequency(Hz)

Tank volume(L)

Runorder

Slosh frequency(Hz)

Tank volume(L)

1 0 40 23 0 502 0.2 40 24 0.2 503 0.4 40 25 0.4 504 0.6 40 26 0.6 505 0.8 40 27 0.8 506 1 40 28 1 507 1.2 40 29 1.2 508 1.4 40 30 1.4 509 1.6 40 31 1.6 5010 1.8 40 32 1.8 5011 2 40 33 2 5012 0 45 34 0 5513 0.2 45 35 0.2 5514 0.4 45 36 0.4 5515 0.6 45 37 0.6 5516 0.8 45 38 0.8 5517 1 45 39 1 5518 1.2 45 40 1.2 5519 1.4 45 41 1.4 5520 1.6 45 42 1.6 5521 1.8 45 43 1.8 5522 2 45 44 2.0 55

Signal Acquisition

card

PC Logs data using LabView100Hz sampled

data

Sensor signal involtage

Fuel Tank

Fuel

Actuator moves back and forth at a set frequency to create slosh

Capacitive sensor

Slosh waves

Fig. 5.11 ExperimentalSetup for Experiment Set B

5.6 Experiment Set B: Performance Estimation 83

Page 90: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

architecture is shown in Fig. 5.12. The input vector p consists of a total of 64signal features, where 63 are the frequency coefficients of the slosh signal afterperforming fft on it, and one vector element is the median value of the raw signal.The 63 value of the number of coefficients is derived from the observationdescribed in Sect. 4.4. It was observed that slosh frequency response was generallyless than 6.3 Hz. Hence, the frequency coefficients were filtered to 63 valuesbefore processing them through the artificial neural network.

5.6.4 Distributed Time-Delay Network Architecture

The distributed time-delay neural network (DTDNN) is developed as a two-layered distributed time-delay neural network. There were five neurons in thehidden layer (Layer 1) and one neuron in the output layer. The input vector p is thesame as that used in the BP network, consisting of 63 frequency coefficients and1 median value of the raw signal. The 63 frequency coefficients represent the0–6.3 Hz range of typical slosh frequency observed during a normal test drivedescribed in Sect. 4.4. Figure 5.13 shows an overview of the DTDNN architecture(Fig. 5.14).

Fig. 5.12 Backpropagation network architecture

Fig. 5.13 Distributed time-delay neural network architecture

84 5 Experimentation

Page 91: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Table 5.6 lists the values of the Distributed Time-delay Neural Networkparameters.

5.6.5 NARX Network Architecture

The NARX network is also developed as a two-layered dynamic network. Thereare four neurons in the hidden layer (Layer 1) and one neuron in the output layer.The input vector p is the same as that used in the BP and DTDNN networks, whichhave 63 frequency coefficients and 1 median value of the raw signal. The 63frequency coefficients number represents the 0–6.3 Hz range of typical sloshfrequency observed during a normal test drive described in Sect. 4.4. Figure 5.13shows an overview of the NARX network architecture.

Table 5.7 lists the values of the NARX network parameters.

Fig. 5.14 NARX Network architecture

Table 5.6 Distributed time-delay neural networkparameters

Variable Description Value

R Number of input featuresof the raw level signal

64

p(t) Features of the rawlevel signal

Matrix of64 9 1 features

d1 Layer 1 delay tap line 0:2d2 Layer 2 delay tap line 0:1S1 Layer 1 Neurons 5S2 Layer 2 Neurons 1

5.6 Experiment Set B: Performance Estimation 85

Page 92: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

5.7 Experiment Set C: Performance Estimation Using SignalEnhancement

5.7.1 Overview

Experiment Set C is carried out to investigate the effectiveness of using the arti-ficial neural network-based approach when the raw sensor signals are smoothenedusing a set of signal enhancement functions. Several consecutive field trials arecarried out by driving a vehicle containing the fuel tank to obtain training andvalidation data from the capacitive sensor operating under the effects of sloshing.First, feature extraction functions are configured and an optimal size of the inputvector is determined by experimentation. Second, optimal configurations of thesignal smoothing functions (described in Sect. 3.2.3) and the filter tap size aredetermined. Finally, the most appropriate configurations of the ANN-based systemare used to compare the accuracy of the ANN-based measurement system with thecurrently used averaging methods. Figure 5.15 shows an overview of the experi-mental setup for Experiment C.

The level signal from the capacitive sensor is acquired using LabVIEW and aDAQ Card, which is connected to the capacitive sensor in the vehicle. Thecapacitive sensor signal indicating the fuel level is sampled and recorded at100 Hz. The sampled level signal is gathered over 20 s, which is the typical hold-on time used in automotive vehicles for averaging the fuel level signal. Thiscollective signal over 20 s is then filtered using three investigated filtrationmethods. After filtration, feature extraction is performed on the filtered signalsusing the MATLAB built-in fast Fourier transform (fft), discrete cosine transform(dct) and discrete wavelet transform (dwt) functions described in Sect. 3.2.4. Theobtained coefficients (coef) from the transformation function, the median (med)value of the raw signal, and the value of the ambient temperature (T) in the tank,are stored in the input vector for training and classification of the ANN-basedsignal processing system.

Table 5.7 NARX Networkparameters

Variable Description Value

R Number of input featuresof the raw level signal

64

p(t) Features of the rawlevel signal

Matrix of64 9 1 features

d1 Layer 1 delay tap Line 0:1d2 Layer 2 delay tap Line 0:1S1 Layer 1 Neurons 4S2 Layer 2 Neurons 1

86 5 Experimentation

Page 93: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

5.7.2 Backpropagation Network Architecture

All four Backpropagation neural networks investigated share a common networkconfiguration that consists of a single hidden layer with 64 neurons as input, whichis the same as the number of input coefficients. The 63 frequency coefficientsnumber represents the 0–6.3 Hz range of typical slosh frequency observed during anormal test drive described in Sect. 4.4. The transfer functions of the hidden andthe output layers are tansig and purelin, respectively, which are described in Sect.3.3.2. The structure of each BP neural network is shown in Fig. 5.16.

Input p is passed through input layer weights IW, and the sum of the productIWp and the bias b1 is fed into the tansig transfer function. In the output layer, theoutput from the tansig function is multiplied by the output layer weights LW.Finally an output volume is produced by the purelin function by using LW and biasb2. A general equation to determine the tank volume in a particular tank based onthe slosh data p can be described as [7, 8]:

Time

Vol

tage

Time

Vol

tage

Frequency

|F|

ANN

BP Neural Network

Fuel Volume

Capacitive Sensor

Slosh Waves

FFT Coefficients (coef)

Unfiltered Raw Signal Filtered Raw Signal Transformation Time->Freq.

Vehicle Fuel Tank

Data Logging using LabVIEW(100Hz sampling)

Median Value (med )

Temperature (T )

Fig. 5.15 Experimental setup for Experiment Set C

Fig. 5.16 Architecture of the BP neural network

5.7 Experiment Set C: Performance Estimation Using Signal Enhancement 87

Page 94: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

VolumeðpÞ ¼ purelin LWðtansigðIWpþ b1ÞÞ þ b2½ � ð5:1Þ

The hidden layer weights (IW), output layer weights (LW) and the biases (b1 andb2) are obtained using the MATLAB Neural Network Toolbox after the networkhas been trained.

5.7.3 Experimental Setup

A fuel tank is fitted with a capacitive sensor near the center of the tank. The tankcan be approximated as a rounded edge rectangle with dimensions34 9 34 9 81 cm. The fuel tank is filled with fuel levels ranging from 5 to 50 Lin the experiment, which corresponds to 6–70% of the tank capacity. Due to thelimited length of the capacitive sensor tube used in the experiment, fuel levelsbelow 5 L could not be determined. The fuel tank is mounted in latitudinaldirection, where the longest length of the tank is in parallel to the direction of thevehicle. Table 5.8 lists all the fuel levels investigated in the experiment.

The capacitive sensor is calibrated to the ambient temperature and the fuel.Each experiment is conducted by driving a vehicle containing the instrumentedfuel tank for 3 km in a suburban residential area, where occasional stops are madeat some road intersections. Figure 5.17 shows the typical speed and accelerationobserved during the experiment.

For the selection of appropriate parameter values for the input window size (x9 ),feature extraction function, and the size of the input features, a factorial table(Table 5.10) of all feasible test values is generated according to the test conditionslisted in Table 5.9. Each test in Table 5.10 is evaluated using an ANN-basedsignal processing model and the capacitive signal samples obtained from the fieldtrials.

The selection of appropriate parameter values for the smoothing function,feature extraction function, and the tap size of the smoothing filter, a factorial table(Table 5.12) of all feasible test values is generated according to the test conditionslisted in Table 5.11. Each test in Table 5.12 is also implemented using ANN-basedsignal processing model and the capacitive signal samples obtained from the fieldtrials.

Table 5.8 List of tankvolumes investigated in theexperiment

Investigated tank levels (L)

5, 6, 7, 8, 915, 20, 25, 3035, 36, 37, 38, 39, 4045, 46, 47, 48, 49, 50

88 5 Experimentation

Page 95: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Table 5.9 Test conditions for the evaluation of ANN input configuration

Window size x9 (sec) Coefficients function Coefficients size

5, 7, 10, 14, 20 FFT, DCT, WT 63, 100

Table 5.10 Complete factorial table for the evaluation of ANN input configuration

Test#

Windowsize x9 (sec)

Coefficientsfunction

Coefficientssize

Test#

Windowsize x9 (sec)

Coefficientsfunction

Coefficientssize

1 5 FFT 63 16 10 DCT 1002 5 FFT 100 17 10 WT 633 5 DCT 63 18 10 WT 1004 5 DCT 100 19 14 FFT 635 5 WT 63 20 14 FFT 1006 5 WT 100 21 14 DCT 637 7 FFT 63 22 14 DCT 1008 7 FFT 100 23 14 WT 639 7 DCT 63 24 14 WT 10010 7 DCT 100 25 20 FFT 6311 7 WT 63 26 20 FFT 10012 7 WT 100 27 20 DCT 6313 10 FFT 63 28 20 DCT 10014 10 FFT 100 29 20 WT 6315 10 DCT 63 30 20 WT 100

0

5

10

15

20

25

30

35

40

45

50

55

60

65

0 50 100 150 200 250 300 350 400

Time (s)

Sp

eed

(km

/h)

-6

-4

-2

0

2

4

6

8

Acc

eler

atio

n (

m/s

²)

Speed (kph)Acceleration (m/s²)

Fig. 5.17 Typical speed and acceleration observed during the experiment

5.7 Experiment Set C: Performance Estimation Using Signal Enhancement 89

Page 96: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

5.8 Neural Network Data Processing

Once the training and validation data samples are obtained from the experiments,three types of neural network architectures are investigated using the MATLABsoftware. The following flowchart describes the procedure adopted to train andvalidate the artificial neural networks.

The three types of neural networks investigated in the research are the fol-lowing, which are described in Sect. 3.4.3:

Table 5.11 Test conditions for the evaluation of optimal signal smoothing functionconfigurations

Coefficients function Signal smoothing function Filter tap size

FFT, DCT, WT Moving mean, Moving median, Wavelet filter 5, 10, 15

Table 5.12 Complete factorial table for the evaluation of optimal signal smoothing functionconfigurations

Test#

Coefficientsfunction

Filterfunction

Filter tapsize

Test#

Coefficientsfunction

Filterfunction

Filter Tapsize

1 FFT Movingmean

5 15 DCT Movingmedian

15

2 FFT Movingmean

10 16 DCT Wavelet 5

3 FFT Movingmean

15 17 DCT Wavelet 10

4 FFT Movingmedian

5 18 DCT Wavelet 15

5 FFT Movingmedian

10 19 WT Movingmean

5

6 FFT Movingmedian

15 20 WT Movingmean

10

7 FFT Wavelet 5 21 WT Movingmean

15

8 FFT Wavelet 10 22 WT Movingmedian

5

9 FFT Wavelet 15 23 WT Movingmedian

10

10 DCT Movingmean

5 24 WT Movingmedian

15

11 DCT Movingmean

10 25 WT Wavelet 5

12 DCT Movingmean

15 26 WT Wavelet 10

13 DCT Movingmedian

5 27 WT Wavelet 15

14 DCT Movingmedian

10

90 5 Experimentation

Page 97: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

• Backpropagation Network (static)• Distributed time-delay network (TDNN, Dynamic feed-forward)• NARX Network (Dynamic feedback/recurrent)

Investigation of each type of neural network followed the same methodology asillustrated in Fig. 5.18. However, the network creation and initialisation ofparameter processes are different for each network type. The complete programcode for each experiment is provided in Appendix C.

Create & Initialise Neural Network

Load training & testing data

Pre-Processing

Prepare Training and Target data

Train the Neural Network

All signals loaded?

No

Validate the neural network with the test data

Show Results

Fig. 5.18 Neural networktraining and validationprogram

5.8 Neural Network Data Processing 91

Page 98: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

5.8.1 Network Initialization

In network initialization, the network type is defined and initialized with therequired input parameters. These parameters are different for each network type.The parameters consists of the number of network layers, number of neurons ineach layer, transfer functions, and the range of input–output values.

5.8.2 Raw Signal Data

The signal data is stored in files and folders that represent the conditions set in theexperiment runs. Basically, the folders are named by the fluid volumes and theraw-data files are named by the slosh frequency or the set frequency of the linearactuator. Additionally, there is an extra file for each raw-data file that contains theexperiment run configurations such as volume, slosh frequency, and temperaturevalues.

The raw signals are loaded up and preprocessing is performed. The frequencycoefficients are obtained using the integrated FFT function in MATLAB. Themagnitude of the coefficients of the raw signal, the median value, and the tem-perature value are all bundled in a cell array, which is called SignalsDB.Table 5.13 shows the format of SignalsDB array consisting of n number of signals.

5.8.3 Filtration

The three investigated filters used in the analysis of the neural network system aredeveloped in MATLAB. The Moving Mean and Moving Median filters aredeveloped using Eqs. (4.5) and (4.6), described in Sect. 4.5, whereas, the Waveletfilter used in the analysis is already contained in the Wavelet Toolbox inMATLAB. The following commands are used in MATLAB to filter a signal s withthe moving window size of w (Table 5.14).

The MATLAB code for these filtration functions is contained in Appendix D.

Table 5.13 Cell array containing details of the training signal features

Run Index 1 2 … n

1 Raw signal filename Raw signal filename … Raw signal filename2 Slosh frequency Slosh frequency … Slosh frequency3 Actual volume Actual volume … Actual volume4 Temperature Temperature … Temperature5 Average raw value Average raw value … Average raw value6 (Input vector x) (Input vector x) … (Input vector x)

92 5 Experimentation

Page 99: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

5.8.4 Feature Extraction

Feature extraction is performed using the MATLAB built-in FFT function. Toobtain the magnitude of the frequency coefficients of the sampled signal s con-sisting of L number of sample points, the following MATLAB commands areused:

% perform fft on the input signal s;fff_coefficients = abs(fft(s));

% remove symmetry due to the complex numbered values;Signal_Features = fff_coefficients (1:L/2 ? 1)/L;

% reduce the number of coefficients to 63;Signal_Features = fff_coefficients (1:63).

5.8.5 Network Training

The neural network is trained once the training and target vectors have beenloaded. Network parameters such as training function, maximum epoch, learningrate, and goal are set prior to calling the training function. The training functionused in MATLAB is called train, whose parameters are the network object,training vectors, and target vectors. These vectors are prepared from the raw sensorsignals, as shown in Table 5.13.

5.8.6 Network Validation

A trained network is validated in MATLAB by using the sim function. The val-idation function uses the network object and the test signals as the functionparameters. The test samples are also placed in the cell vector after preprocessingthem with the FFT function. The output of sim function produced the predictedfluid level, which is later compared with the actual fluid level that exists in thevehicle.

Table 5.14 Call functions tosmoothen the input signals

Filter Filter call function

Moving mean avgMean(s,w)

Moving median avgMedian(s,w)

Wavelet waveletfilter(s)

5.8 Neural Network Data Processing 93

Page 100: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

References

1. Fozmula. Installation Instruction Manual for Model T/LL130 series. Fozmula Limited; [cited].2. Cheremisinoff, N. P., & Archer, W. L. (2003). Properties and selection of organic solvents.

Industrial solvents handbook (p. 81). New York: Marcel Dekker.3. Corporation, Exxon Mobil. Aliphatics Fluids (Exxsol Series) - Grades & Datasheets. Exxon

Mobil Corporation; [cited]; Available from: http://www.exxonmobilchemical.com/Public_Products/Fluids/Aliphatics/Worldwide/Grades_and_DataSheets/Fluids_Aliphatics_ExxsolSBP_Grades_WW.asp.

4. Mason, R. L., Gunst, R. F., & Hess, J. L. (2003). Factorial experiments in completelyrandomized designs. Statistical design and analysis of experiments: with applications toengineering and science. Hoboken, N.J.; [Great]: Wiley-Interscience.

5. Mason, R. L., Gunst, R. F., & Hess, J. L. (2003) Statistical design and analysis of experiments:with applications to engineering and science. Hoboken, N.J.; [Great Britain]: Wiley-Interscience.

6. MINITAB user’s guide 2: data analysis and quality tools. (2000) State College, PA: MinitabInc.

7. Veelenturf, L. P. J. (1995). Analysis and applications of artificial neural networks. London:Prentice Hall.

8. Hagan, M. T., Demuth, H. B., & Beale, M. H. (1196). Neural network design. Boston: PWSPub.

94 5 Experimentation

Page 101: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 6Results

6.1 Overview

This chapter discusses the results obtained from the three sets of experimentsdescribed in Chap. 5. Experiment Set A results showing the response of thecapacitive sensor in a dynamic environment without using the artificial neuralnetwork-based signal processing system are provided in Sect. 6.2. Results forExperiment Sets B and C consisting of raw capacitive sensor signals, trainingsamples, and validation results are presented in the following sections.

6.2 Experiment Set A

6.2.1 Main Effects Plot

The results obtained from Experiment Set A are used to present main effects plotsof the three factors that influence the accuracy of the level measurement system.The importance of main effects and interaction plots was discussed in Sect. 4.6.

The output of the capacitive sensor was recorded for each experiment trialdescribed in Sect. 5.4. The capacitive sensor signal sampled at 10 Hz was aver-aged over 60 s to produce an averaged voltage that represented the fuel level.Table 6.1 shows the results obtained from Experiment Set A.

The main effects plots are shown in Figs. 6.1–6.3. The graphs show the degreeof influence caused by the three influential factors: slosh, contamination, andtemperature. It can be observed that the fuel volume is influenced by the liquidslosh and the temperature changes. However, the main effects plot for contami-nation, shown in Fig. 6.3, indicates that the changes in contamination level hadlittle effect on the fuel volume.

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3_6,� Springer-Verlag London 2012

95

Page 102: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

6.2.2 Interaction Plots

To observe the interaction between the influencing factors, results obtained fromExperiment Set A were used to generate the interaction plot. Figure 6.4 shows theinteraction plot for volume between the three influencing factors.

Table 6.1 Average volume readings obtained in Experiment Set A

Run order Slosh frequency (Hz) Temperature (�C) Contamination (g) Avg volume (L)

1 2.0 10 0 47.72 0.5 50 150 58.83 0.5 50 0 58.64 2.0 10 150 45.25 2.0 50 0 48.06 0.5 10 150 49.97 0.5 10 0 51.98 2.0 50 150 52.7

Fig. 6.1 Main effects plotfor slosh

Fig. 6.2 Main effects plotfor temperature

96 6 Results

Page 103: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The interaction plot shows that there is no significant interaction between thethree influential factors. However, the interaction plot revealed that there is someinteraction between temperature and slosh factors. As the temperature increases,the volume indicated by the capacitive sensor also increases, suggesting that theresponse of the capacitive sensor changes with temperature.

6.2.3 Summary

The three influencing factors proposed to have an impact on the level measurementwere the following:

• Liquid slosh;• Temperature; and• Contamination.

Fig. 6.3 Main effects plotfor contamination

Fig. 6.4 Interaction plots of the three influencing factors

6.2 Experiment Set A 97

Page 104: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

It can be seen from the main effect plots that the effects of slosh and temper-ature are significant compared with the effects of contamination. A reason for thisnegligible effect of contamination on the level measurement could be that theArizona dust did not affect the properties of the fluid. Figure 6.4 shows theinteraction plot of the influential factors. The interaction plot shows that there is nosignificant interaction between contamination and the other two factors being sloshand temperature. Hence, according to the observed results, the contaminationfactor is independent of temperature and slosh. But there is some interactionobserved between temperature and slosh. As the temperature increases to 50�C, thevolume signal is also observed to increase.

6.3 Experiment Set B

After obtaining the training samples from Experiment Set B, the training data atvarious tank volumes and slosh frequencies is stored in several files. These signalsare loaded and classified in terms of their frequency response and their medianvalue. Figure 6.5 shows the average fuel level data over 10 s obtained at variousinitial volume levels and generated slosh frequencies with the linear actuator. Itcan be seen that the average volume reading at various acceleration or slosh valuesis not constant.

However, after training and validating the static and dynamic neural networkmodels, the results indicate that the fluid levels can be ascertained to a muchhigher accuracy (Fig. 6.31), when compared with the simple averaging methodindicated in Fig. 6.5.

Capacitive Slosh Test

10

20

30

40

50

60

70

0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0

Slosh Frequency (Hz)

Ave

rag

e L

evel

Rea

din

g (

L)

40L

45L

50L

55L

Average Level Vs Slosh Frequency

Fig. 6.5 Average volume of the tank measured over 10 s at selected slosh frequencies

98 6 Results

Page 105: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

6.3.1 Frequency Coefficients

The raw signals obtained from Experiment Set B are transformed into the fre-quency domain using the MATLAB built-in fft function. Figure 6.6 shows thefrequency coefficients surface plot of the raw capacitive type level sensor signals.

6.3.2 Backpropagation Network

Figures 6.7, 6.8; Table 6.2.

6.3.3 Distributed Time-Delay Network

Figure 6.9.

6.3.4 NARX Neural Network

Figure 6.10.

Fig. 6.6 Frequency coefficients surface plot

6.3 Experiment Set B 99

Page 106: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

6.3.5 Summary

The MATLAB simulation and validation results for Experiment Set B show thatthe Backpropagation neural network produced the most accurate results. Bothtypes of dynamic networks (shown in Figs. 6.9, 6.10) were able to provide highlyaccurate results only when the input vectors were in the sequential order as thetraining vectors. However, the input data in these simulations was deliberately set

Fig. 6.7 Validation result forthe static feedforwardbackpropagation neuralnetwork

Fig. 6.8 Backpropagationnetwork training performance

100 6 Results

Page 107: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Table 6.2 BP networksimulation performanceresults

Parameter Value

Epochs 2821Performance 0.01Time 00:01:05Training algorithm TrainscgInput neurons 64No. of inputs 64

Misclassification range

Fig. 6.9 Validation resultsof the distributed time-delayneural network

Fig. 6.10 Validation resultof the NARX (dynamicfeedback) neural network

6.3 Experiment Set B 101

Page 108: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

out-of-sequence, to create a randomized input, to compare the effects of the timedelay and feedback associated with dynamic networks.

Table 6.3 summarizes the error results obtained using the averaging methodand the three investigated network topologies.

The overall results obtained from Experiment Set B using the three neuralnetwork topologies indicate remarkable reduction in slosh error, when the resultsare compared with the results obtained by simple averaging as is done in practiceat present (see Fig. 6.5).

6.4 Experiment Set C

The training samples obtained from Experiment Set C were processed withMATLAB using the methodology described in Sect. 5.3. The raw signals in thisexperiment were filtered through different filtration functions before the signalswere trained by the artificial neural network-based signal processing system. Therewere 20 test drive trials at different fuel levels that were carried out in thisexperiment, where each drive trial was conducted over a distance of 3 km. Thissection provides details on the raw signals obtained from the capacitive sensorduring the course of this experiment. The frequency coefficients plot, the networkweights coefficients, the validation results, and the validation error plots for alldrive trials (at different fuel quantity) are contained in this section.

6.4.1 Raw Capacitive Sensor Signals

The capacitive sensor signals throughout each drive trial are shown in Figs. 6.11–6.20. Each graph shows the trial data run for 280 s over the same drive route.These graphs clearly show the slosh created in the fuel tank over the drive path.The amplitude of slosh can be seen as varying for different tank volumes.

Table 6.3 Summary of the results obtained from three types of neural networks

Method Network type Avg. error(%)

Max. error(%)

Simple averaging N/A 32.43 68.44Feedforward back-propagation

(BP)Static 0.04 0.11

Distributed time-delay Dynamic without feedback 0.84 8.67NARX network Dynamic with feedback

(recurrent)0.12 2.60

102 6 Results

Page 109: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

6.4.2 Selection of Optimal Preprocessing Parameters(Experiment Set C1)

Table 6.4 shows the results for the optimal preprocessing parameters evaluationtest. The preprocessing configuration list in the table for each test number was

Fig. 6.11 Raw capacitive sensor signals (49 and 50 L)

Fig. 6.12 Raw capacitive sensor signals (47 and 48 L)

6.4 Experiment Set C 103

Page 110: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

applied on the raw capacitive sensor signals and then processed through thebackpropagation neural network using MATLAB. The results obtained from eachANN test model are compared with the results obtained with standard statisticalaveraging methods (note: the Test # is the actual vehicle test run and window sizeis the duration of test in seconds while data are recorded):

Fig. 6.13 Raw capacitive sensor signals (45 and 46 L)

Fig. 6.14 Raw capacitive sensor signals (39 and 40 L)

104 6 Results

Page 111: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Figures 6.21, 6.22 show plots of the average and standard deviation error resultsobtained from the optimal ANN preprocessing estimation test. In general, bothplots show significantly low error results for the ANN-based signal processingmodel when compared with the two currently used statistical averaging methods(mean and median). Figure 6.21 indicates that the optimal configuration for the

Fig. 6.15 Raw capacitive sensor signals (37 and 38 L)

Fig. 6.16 Raw capacitive sensor signals (35 and 36 L)

6.4 Experiment Set C 105

Page 112: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

ANN preprocessor is when it is configured with the parameters used in Test #25,which uses a window size of 20 s (x9 = 20 s), fast fourier transform function(FFT) as the feature extraction function and with 63 number of frequency coeffi-cients. Figure 6.22 shows that the standard deviation error was also the lowest forTest #25. Based on these observations, the optimal configuration for the ANNpreprocessor system include: FFT as the optimal feature extraction functions, 63 as

Fig. 6.17 Raw capacitive sensor signals (25 and 30 L)

Fig. 6.18 Raw capacitive sensor signals (9 and 20 L)

106 6 Results

Page 113: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

the number of signal coefficients, and a window size (x9 ) of 20 s. The optimalconfiguration obtained in this test will be used to run the next test ‘C2 selection ofoptimal signal smoothing parameters’. The results obtained using the discretecosine transform (DCT) function generally indicated a larger error when comparedwith the other two transformation functions (FFT and WT). However, by incor-porating the signal smoothing technique with the DCT transformation function, the

Fig. 6.19 Raw capacitive sensor signals (7 and 8 L)

Fig. 6.20 Raw capacitive sensor signals (5 and 6 L)

6.4 Experiment Set C 107

Page 114: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

accuracy of the ANN-based signal processing system might improve. Hence, DCTwill also be examined along with the FFT and WT functions in the next text ‘C2selection of optimal signal smoothing parameters’.

6.4.3 Selection of Optimal Signal Smoothing Parameters(Experiment Set C2)

After obtaining the optimal preprocessing parameters in Experiment Set C1,Experiment Set C2 was conducted to obtain optimal signal smoothing parameters.

Table 6.4 Results for the selection of optimal preprocessing configuration (Experiment Set C1)

Test # Window size(x9 )

Coef. func. Coef. size Average error (L) Std. deviation (L) error

Mean Median ANN Mean Median ANN

1 5 FFT 63 3.16 3.16 1.28 1.47 1.49 0.752 5 FFT 100 3.16 3.16 1.24 1.47 1.49 0.703 5 DCT 63 3.16 3.16 1.26 1.47 1.49 0.604 5 DCT 100 3.16 3.16 1.17 1.47 1.49 0.595 5 WT 63 3.16 3.16 1.28 1.47 1.49 0.736 5 WT 100 3.16 3.16 1.35 1.47 1.49 0.78

7 7 FFT 63 3.01 2.98 1.09 1.45 1.47 0.668 7 FFT 100 3.01 2.98 1.03 1.45 1.47 0.619 7 DCT 63 3.01 2.98 1.20 1.45 1.47 0.55

10 7 DCT 100 3.01 2.98 1.18 1.45 1.47 0.5411 7 WT 63 3.01 2.98 1.39 1.45 1.47 0.6812 7 WT 100 3.01 2.98 1.17 1.45 1.47 0.58

13 10 FFT 63 2.85 2.80 0.75 1.49 1.49 0.3914 10 FFT 100 2.85 2.80 0.78 1.49 1.49 0.4515 10 DCT 63 2.85 2.80 0.93 1.49 1.49 0.4216 10 DCT 100 2.85 2.80 0.94 1.49 1.49 0.4317 10 WT 63 2.85 2.80 1.05 1.49 1.49 0.4618 10 WT 100 2.85 2.80 1.11 1.49 1.49 0.49

19 14 FFT 63 2.61 2.45 0.81 1.47 1.40 0.5020 14 FFT 100 2.61 2.45 0.79 1.47 1.40 0.4921 14 DCT 63 2.61 2.45 1.05 1.47 1.40 0.4722 14 DCT 100 2.61 2.45 1.20 1.47 1.40 0.5423 14 WT 63 2.61 2.45 1.11 1.47 1.40 0.5424 14 WT 100 2.61 2.45 1.12 1.47 1.40 0.55

25 20 FFT 63 2.41 2.22 0.71 1.56 1.44 0.3926 20 FFT 100 2.41 2.22 0.75 1.56 1.44 0.4227 20 DCT 63 2.41 2.22 0.89 1.56 1.44 0.4728 20 DCT 100 2.41 2.22 0.87 1.56 1.44 0.4929 20 WT 63 2.41 2.22 1.08 1.56 1.44 0.4830 20 WT 100 2.41 2.22 0.99 1.56 1.44 0.50

108 6 Results

Page 115: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Experiment Set C2 was run to understand the significance and performance ofsignal smoothing technique in signal preprocessing. Table 6.5 lists the benchmarkresults of using different signal preprocessing approaches with the ANN-basedsignal processing system. A graph of the results listed in this table is shown inFig. 6.23.

ANN Test - Optimal ANN Param. Estimation

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100

FF FF DC DC WT WT FF FF DC DC WT WT FF FF DC DC WT WT FF FF DC DC WT WT FF FF DC DC WT WT

5 5 5 5 5 5 7 7 7 7 7 7 10 10 10 10 10 10 14 14 14 14 14 14 20 20 20 20 20 20

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Test No.

Ave

rag

e E

rro

r (L

)

Avg. Error (L) Mean Avg. Error (L) Median Avg. Error (L) ANN

Average Error Plot

Fig. 6.21 Average error plot––optimal ANN preprocessing estimation

ANN Test - Optimal Filter Param. Estimation

0.00

0.50

1.00

1.50

2.00

2.50

3.00

3.50

63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100 63 100

FF FF DC DC WT WT FF FF DC DC WT WT FF FF DC DC WT WT FF FF DC DC WT WT FF FF DC DC WT WT

5 5 5 5 5 5 7 7 7 7 7 7 10 10 10 10 10 10 14 14 14 14 14 14 20 20 20 20 20 20

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Test No.

Ave

rag

e E

rro

r (L

)

Avg. Error (L) ANN Avg. Error (L) MEAN Avg. Error (L) MEDIAN

Fig. 6.22 Standard deviation error plot––optimal ANN preprocessing estimation

6.4 Experiment Set C 109

Page 116: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Figure 6.23 shows the influence of signal filtration on the ANN-based signalprocessing system. The results shown in Fig. 6.23 indicate that the ANN-basedsystem provides the best results when it is configured with the configurations usedin Test #4. Test #4 was configured with the window size of 20 s (x9 = 20), FFT asthe feature extraction function, 63 number of coefficients, and moving medianfunction as the signal smoothing function with the filter tap-size of 5. Figure 6.23also indicates that the error results obtained using FFT function were generally lessthan the errors obtained from the other two transformation functions, WT andDCT. The WT function indicated a poor performance, when compared with FFTand DCT. The configurations used in Test #4 will be used in the next test toobserve the performance of the ANN-based signal classification system at differenttank volumes.

Table 6.5 Results for the selection of optimal signal smoothing parameters (Experiment Set C2)

Test # Coef. func. Filter func. Filter tapsize

Avg. error (L) (ANN)

Lower limit Avg. Upper limit St. Devia.

1 FFT Moving mean 5 0.30 0.79 1.28 0.492 FFT Moving mean 10 0.28 0.77 1.25 0.483 FFT Moving mean 15 0.33 0.73 1.14 0.414 FFT Moving median 5 0.23 0.70 1.16 0.475 FFT Moving median 10 0.33 0.77 1.22 0.456 FFT Moving median 15 0.34 0.81 1.28 0.477 FFT Wavelet 5 0.31 0.72 1.13 0.418 FFT Wavelet 10 0.31 0.74 1.16 0.439 FFT Wavelet 15 0.32 0.73 1.13 0.40

10 DCT Moving mean 5 0.41 0.91 1.41 0.5011 DCT Moving mean 10 0.46 1.00 1.55 0.5512 DCT Moving mean 15 0.43 0.93 1.42 0.4913 DCT Moving median 5 0.43 0.86 1.29 0.4314 DCT Moving median 10 0.43 0.92 1.40 0.4815 DCT Moving median 15 0.44 0.94 1.45 0.5016 DCT Wavelet 5 0.42 0.92 1.43 0.5017 DCT Wavelet 10 0.45 0.87 1.30 0.4318 DCT Wavelet 15 0.36 0.83 1.29 0.4719 WT Moving mean 5 0.54 1.39 2.23 0.8520 WT Moving mean 10 0.54 1.09 1.63 0.5421 WT Moving mean 15 0.52 1.04 1.55 0.5222 WT Moving median 5 0.57 1.18 1.79 0.6123 WT Moving median 10 0.58 1.16 1.74 0.5824 WT Moving median 15 0.54 1.09 1.63 0.5425 WT Wavelet 5 0.47 1.01 1.55 0.5426 WT Wavelet 10 0.50 1.03 1.57 0.5327 WT Wavelet 15 0.46 1.02 1.58 0.56

110 6 Results

Page 117: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

6.4.4 Final Validation Results (Experiment Set C3)

A final model of the ANN-based signal processing system was synthesized basedon the results observed in the previous experiments. The selected optimal values ofthe ANN preprocessor and the signal smoothing techniques were used to create afinal version of the ANN-based signal processing and classification model. Theconfiguration of the synthesized ANN model is shown in Fig. 6.24.

Window size20 sec =20 s * 100 samples/s=2000

Frequency

|F|

ANNModel

(BP Net.)Fuel Level

Capacitive Sensor

Fuel Tank

Coefficients (coef )

Windowing Feature Extraction

Data Logging using LabVIEWsamples(100 Hz sampling)

Median Value (med )

Temperature (T )

Func: Moving median

Tap Size: 5

Signal smoothing

FFTFeature size:

63 coef.

Fig. 6.24 Synthesised ANN-based measurement system model

ANN Test - Optimal Filter Param. Estimation

-0.25

0.25

0.75

1.25

1.75

2.251:

Mm

ea. (

t:5)

2: M

mea

. (t:1

0)

3: M

mea

. (t:1

5)

4: M

med

. (t:5

)

5: M

med

. (t:1

0)

6: M

med

. (t:1

5)

7: W

ave.

(t:5

)

8: W

ave.

(t:1

0)

9: W

ave.

(t:1

5)

10: M

mea

. (t:5

)

11: M

mea

. (t:1

0)

12: M

mea

. (t:1

5)

13: M

med

. (t:5

)

14: M

med

. (t:1

0)

15: M

med

. (t:1

5)

16: W

ave.

(t:5

)

17: W

ave.

(t:1

0)

18: W

ave.

(t:1

5)

19: M

mea

. (t:5

)

20: M

mea

. (t:1

0)

21: M

mea

. (t:1

5)

22: M

med

. (t:5

)

23: M

med

. (t:1

0)

24: M

med

. (t:1

5)

25: W

ave.

(t:5

)

26: W

ave.

(t:1

0)

27: W

ave.

(t:1

5)

Test No.

Ave

rag

e E

rro

r (L

)

Avg. Error (L) Lower limit Avg. Error (L) ANN Avg. Error (L) Upper limit

Fig. 6.23 Optimal ANN preprocessing filter parameter estimation

6.4 Experiment Set C 111

Page 118: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

6.4.5 Frequency Coefficients

The raw signals obtained from the test drives were transformed into the frequencydomain using the MATLAB’s built-in fast fourier transform (fft) module. Thefrequency coefficients plot of the capacitive sensor signals is shown in Fig. 6.25.

Fig. 6.25 Frequency coefficients surface plot

Fig. 6.26 Overall view of the observed raw signals and the actual fuel level

Table 6.6 Number of lapsedepochs until the performancegoal was reached

Signal filtration method Epochs elapsed

Unfiltered 9,597Wavelet filter 7,703Moving median 10,537Moving mean 8,032

112 6 Results

Page 119: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Feature reduction using filtration was described in Sect. 4.5. It was alsodescribed in Sect. 4.5 that the range of significant slosh frequency is 0–6.3 Hz. Inthis experiment, a low-pass filter was used to filter out slosh frequencies over6.3 Hz. This was achieved to increase the network training speed without incurringa performance penalty. The frequency coefficients and the median value of the

Table 6.7 List of input and output layer weights

Input weights (IW)

Coefficientsneurons

Coef1 Coef2 Coef3 Coef4 … Coef64

1 -3.67230 -2.69990 2.01490 -1.93900 .. 0.081782 -0.31637 0.02187 -0.26951 0.77212 .. -0.553573 -0.63585 -0.24946 -0.71994 0.31545 .. -0.632574 2.08610 -7.16130 -1.44020 -0.00524 .. 3.565005 -0.12350 3.03000 -3.95870 -3.48610 .. -2.643806 0.68726 0.31549 -1.31320 -0.64100 .. 0.705637 1.27600 0.77420 0.57284 1.59500 .. 2.674408 -0.70694 0.74962 0.44290 0.61051 .. -3.592809 -0.60444 -0.80074 -0.11980 0.38634 .. -0.65620

10 -1.18530 -0.38177 0.43947 2.59010 .. 0.0865911 2.73580 4.07470 3.94230 1.03570 .. 1.6848012 -0.36365 -0.48970 -4.26650 -1.92790 .. 0.3061913 0.99608 1.01140 0.26395 0.17200 .. 1.4192014 0.44885 -0.35802 0.29165 0.06762 .. 0.2649415 0.40191 5.89460 -6.44360 -2.01000 .. 1.3093016 1.58810 0.24304 1.08650 -0.47447 .. 1.3884017 0.56797 4.53360 -0.53564 0.71538 .. 0.6624518 -9.88650 4.35740 2.47440 2.06010 .. -3.0012019 -1.60100 -1.50780 5.36160 4.58350 .. 2.1114020 -3.19840 -9.55190 1.09080 -1.21410 .. 5.4781021 -0.86290 -5.23950 -0.63504 -2.47570 .. 4.8018022 0.41904 0.32452 -0.85046 0.86707 .. 0.6535723 -0.23133 -1.40690 -0.67389 1.23960 .. -0.6092924 -0.62330 8.75760 -4.86140 -2.53750 .. -5.3027025 -0.58484 0.01243 -0.12456 -0.78714 .. -0.8295526 0.23944 -0.13340 0.42486 0.70195 .. -7.7966027 4.80270 -2.38750 8.17730 -4.37790 .. -2.5606028 0.73341 -0.92260 3.44900 4.99560 .. -1.5714029 -0.16978 0.15246 0.44259 0.52290 .. 0.0023430 -2.52990 -0.98237 2.40700 2.30660 .. -0.08410… … … … … .. …64 -2.30790 -1.95100 -0.98339 0.04441 .. -5.16550Output layer weights (LW)

1 15.1550 -1.83800 2.62580 9.43560 .. -7.67050

6.4 Experiment Set C 113

Page 120: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

signals were all bundled in an array of 64 elements, which were then used to trainand validate the neural network.

Figure 6.26 shows a broader view of the raw sensor signals in the time domainthat were filtered through the investigated filters and then transformed into fre-quency domain using the FFT function. Along with the training samples, thecorresponding target value or the actual value of the initial fuel level in the tankare also shown.

6.4.6 Network Weights

After training the neural network, the network was validated using the test samplesobtained from the second field trial.

Table 6.6 shows the performance speed of the neural network when the fourmethods of signal filtration were applied. It shows that the network speed wasfaster with the signals that were filtered through the wavelet filter.

Fig. 6.27 Network verification results for volumes 48–50 L

114 6 Results

Page 121: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Table 6.7 lists the neural network weights obtained from the network on whichthe moving median filter was applied. The weights can be substituted into Eq. (4.1)to produce the output volume.

6.4.7 Validation Results

Figures 6.27–6.29 show the neural network validation results for different inputsignals. The graphs shown in these figures can be used to compare the performanceof the measurement system at different tank levels using both statistical averagingand neural network-based signal classification approaches.

Figure 6.27 shows the output results for selected (lower and higher) tank vol-umes. The output results were obtained after processing the capacitive sensorsignals with different processing methods. The time length of each trial is indicatedas 280 s. The graphs in Fig. 6.27 show fuel volumes averaged over the whole driveperiod of 280 s, after processing the signals through different processing methods.To describe the steps undertaken to obtain the overall averaged volume, a closer

Fig. 6.28 Network verification results for volumes 38–47 L

6.4 Experiment Set C 115

Page 122: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

look at the investigated 49 litre trial is also shown in Fig. 6.27. The raw sensorsignal illustrated in Fig. 6.27a was divided into 20-s-long signals, as shown inFig. 6.27b, which were then filtered and processed through the neural network.The overall averaged volume in Fig. 6.27c was calculated by averaging the neuralnetwork outputs for each trial over the whole 280-s-period.

Fig. 6.29 Network verification results for volumes 5–37 L

116 6 Results

Page 123: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

0

1

2

3

4

5

6

7

5 6 7 8 9 20 25 30 35 36 37 38 39 40 45 46 47 48 49 50

Investigated Tank Volumes (L)

Ove

rall

Ave

rag

e E

rro

r (L

)Moving Mean (without ANN)Moving Median (without ANN)ANN (Unfiltered)ANN (Moving Mean)ANN (Moving Median)ANN (Wavelet filter)

Fig. 6.30 Graph of the average error produced at different investigated tank volumes

0

1

2

3

4

5

6

7

Moving Mean(without ANN)

Moving Median(without ANN)

ANN(Unfiltered)

ANN (MovingMean)

ANN (MovingMedian)

ANN (Waveletfilter)

Applied Methods

| Ave

rag

e E

rro

r (L

) |

Absolute Max. Error

Abs. Average Error

Fig. 6.31 Investigation summary results showing the maximum and average errors

6.4 Experiment Set C 117

Page 124: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

6.4.8 Validation Error

Validation error was calculated by subtracting the observed average level from theactual or initial tank level. Table 6.8 shows the volume figures obtained using thestatistical averaging functions, and the neural network using different prepro-cessing filters. Average error values at a particular investigated tank volume areshown in Table 6.9. All values listed in Tables 6.8, 6.9 are in liters.

6.4.9 Summary

Figure 6.30 shows the overall absolute average error plots at different tank vol-umes using the statistical averaging methods and using the neural networkapproach by adapting different filters.

It can be seen from the graph in Fig. 6.30 that the average error produced by thesimple moving mean and moving median functions without using the neural networkis substantially large for lower volume ranges (8–25 L) as well as for higher volumes

Table 6.8 Validation results using statistical averaging methods and the neural networkapproach with different preprocessing filters

Actual tankvolume

Statistical averaging Artificial neural networks

Movingmeana

Movingmediana

ANN(unfiltered)

ANN(movingmean)

ANN (movingmedian)

ANN(waveletfilter)

50 55.96 55.38 49.87 49.76 49.72 50.0849 54.11 53.74 48.53 48.57 48.62 48.1248 49.34 49.18 48.12 48.11 48.11 48.1647 44.42 44.41 46.28 45.83 45.98 46.0546 45.64 45.57 45.85 45.81 45.55 45.5545 44.06 43.81 43.92 43.86 44.11 43.5940 40.04 39.96 40.08 40.09 40.17 39.8639 37.18 37.08 39.02 38.98 39.07 39.0638 38.18 37.75 38.11 38.36 38.35 38.1837 37.34 37.03 37.34 37.34 37.30 37.3136 35.23 35.08 35.85 36.03 36.16 35.9335 35.39 35.10 35.17 35.45 35.56 35.4030 30.14 29.81 30.09 30.70 30.38 29.9425 27.58 26.77 25.40 25.18 25.10 25.3120 22.37 21.74 21.44 21.26 21.11 21.46

9 14.01 13.38 8.92 8.94 9.04 8.888 10.85 10.12 7.90 7.90 7.90 7.907 7.47 7.09 7.22 7.23 7.23 7.216 5.99 5.84 6.04 6.05 6.05 6.055 6.27 5.33 4.96 4.98 4.99 4.97

a Averaged filter values without using neural networks

118 6 Results

Page 125: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

(47–50 L). However, the results obtained from the investigated BP networks indicateless error compared with the simple statistical methods. All four BP networks haveshown significant success in determining the fuel level with high accuracythroughout the investigated volumes and especially at low fuel volumes. Determi-nation of fuel volumes accurately is particularly important at low fuel volumes.

To summarize all the results, a graph shown in Fig. 6.31 was prepared that plotsthe overall average errors obtained using the statistical methods and the fourinvestigated artificial neural networks.

Table 6.9 Validation error results for applied statistical and neural network methods

Actual tankvolume

Statistical averaging Artificial neural networks methods

Movingmeana

Movingmediana

ANN(unfiltered)

ANN(movingmean)

ANN(movingmedian)

ANN(waveletfilter)

50 5.96 5.38 0.13 0.24 0.28 0.0849 5.11 4.74 0.47 0.43 0.38 0.8848 1.34 1.18 0.12 0.10 0.11 0.1647 2.58 2.59 0.72 1.17 1.02 0.9546 0.36 0.43 0.15 0.19 0.45 0.4545 0.94 1.19 1.08 1.14 0.89 1.4140 0.04 0.04 0.08 0.09 0.17 0.1439 1.82 1.92 0.02 0.02 0.07 0.0638 0.18 0.25 0.11 0.36 0.35 0.1837 0.34 0.03 0.34 0.34 0.30 0.3136 0.77 0.92 0.15 0.03 0.16 0.0735 0.39 0.09 0.17 0.45 0.56 0.4030 0.14 0.19 0.09 0.70 0.38 0.0725 2.58 1.77 0.40 0.18 0.10 0.3120 2.37 1.74 1.44 1.26 1.11 1.46

9 5.01 4.38 0.08 0.06 0.04 0.128 2.85 2.12 0.10 0.10 0.10 0.107 0.47 0.09 0.22 0.23 0.23 0.216 0.01 0.16 0.04 0.05 0.05 0.055 1.27 0.33 0.04 0.02 0.01 0.03

Absolute average error 1.73 1.48 0.30 0.36 0.34 0.37Max. error 5.96 5.38 1.44 1.26 1.11 1.46a Averaged filter values without using neural networks

6.4 Experiment Set C 119

Page 126: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 7Discussion

7.1 Overview

This chapter discusses the design and optimal selection of parameters of the ANN-based signal processing system. The selection of optimal preprocessing parametersused in the ANN-based measurement system and the results obtained from theexperimentations, and the possible improvements to the design of the ANN-basedsystem, are all discussed in this section.

7.2 Backpropagation Network Configurations

The fuel level measurement system designed and evaluated in this research isbased on a Backpropagation type of Artificial Neural Network. It was discussed inSect. 3.3 that artificial neural networks with a sufficient number of neurons in thehidden layer can be trained to produce virtually any form of output curve. Thechoice of selecting a particular network configuration plays a crucial role in termsof the performance of Artificial Neural Networks. Hence, field trials were con-ducted to experimentally determine the most suitable configuration for the artifi-cial neural network-based fuel level measurement system.

In the experiment Set A a factorial design of experiment was run to understandthe influence of slosh, temperature, and contamination on the accuracy of thecapacitive sensor without application of neural networks. Results of this experi-ment indicate that fluid slosh had the most significant influence on the sensoraccuracy. Temperature also has an influence especially in situations with largertemperature variances during experiments carried out in the laboratory but theeffect was not as significant. During the vehicle field trial however, the temperatureof fuel was relatively constant and had no significant effect on the sensor accuracy.

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3_7,� Springer-Verlag London 2012

121

Page 127: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Finally, the influence of contamination was not significant and was not taken intoaccount in subsequent experiment sets B and C.

Experiment Set B was run to investigate the performance of the neural network-based signal processing system using two sets of neural network architectureconfigurations: Static and Dynamic Neural Networks. The findings obtained fromExperiment Set B indicated remarkable reduction in slosh error, when the resultswere compared with the results obtained from the simple averaging method. TheExperiment Set B results provided in Table 6.3 showed that under dynamicsloshing conditions, the simple averaging method produced an average error ofover 30%, whereas, the maximum error figures obtained using the neural network-based signal processing methods were less than 10%.

The results obtained from Experiment Set B indicated that the FeedforwardBackpropagation (BP) network that produced an average error of 0.04% was themost feasible neural network architecture for the classification of the capacitive fuellevel signals in the current application. However, the results obtained from the otherneural network topologies such as Distributed Time-Delay and NARX showedsatisfactory classification results with average error of less than 1% (see Sect. 6.3.5). These results obtained using several different types of neural networks showedgood consistency in terms of the response of the neural network-based measure-ment system to the measurement of fuel levels using the capacitive sensing system.

Based on the findings of Experiment Set B, in Experiment Set C, the Back-propagation (BP) neural network architecture was selected to further investigate theperformance of the neural network-based signal processing system. Specifically, theinfluence of the number of hidden neurons on the system’s classification accuracywere investigated. Another objective of Experiment Set C was to observe the effectsof signal smoothing of input signals on the network classification accuracy. Theoutcomes of Experiment Set C are discussed in the following sections.

7.3 Selection of Signal Preprocessing Parameters

To determine an appropriate configuration for the ANN-based measurement sys-tem, it was important to determine the optimal parameters for the signal prepro-cessing functional block. That is, to determine an appropriate feature extractionfunction out of the three functions (FFT, DCT, WT) described in Sect. 3.2.4.Furthermore, the optimal size of the input window (x9 ), and the size of the featurevector was important to be determined experimentally. For this purpose, Experi-ment Sec C was conducted and the training and validation samples obtained fromthe field trials were used to investigate the performance of the ANN-based systembased on the different types of feature extraction functions, different sizes of theinput window (x9 ), and different sizes of the feature vector.

The results obtained from Experiment Set C1 indicated that the optimal solutionfor the signal preprocessor configuration is obtained using the Fast FourierTransform (FFT) function as the feature extraction function, with windows size

122 7 Discussion

Page 128: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

(x9 ) of 20 s and feature vector size of 63 coefficients. The overall performance ofeach of these parameters is shown in the following figures. The parameters thatwere found to be most feasible are circled in the result figures listed below.

Figure 7.1 shows the average performance of several ANN models havingdifferent number of coefficients investigated in Experiment Set C1. The overallperformance of the neural network-based classification system using both 63 and100 hidden neurons is much the same.

Figure 7.2 shows the overall performance of the three feature extractionfunctions used in the ANN-based measurement system. The overall performanceof the ANN-based system using FFT is observed to be much better when comparedwith using WT- and DCT-based feature extraction functions.

Figure 7.3 shows the performance of the ANN-based measurement systemwhen implemented with different window sizes (x9 ). A window size of 5 meansthat the measurement system uses 5 s sampled data to process the output. Like-wise, a window size of 14 means that the measurement system uses 14 s sampleddata from the capacitive sensor to process and predict the output level. The graphshown in Fig. 7.3 indicates that the window sizes have an effect on the error. Theperformance of the ANN-based fluid level measurement system having differentwindow sizes is generally seen as consistent and superior to the two statisticalaveraging methods (mean and median). The performance of the statistical aver-aging methods (without use of ANN) improves as the size of the input windowincreases, which illustrates the fact that a signal averaged over a longer period oftime will produce a more converged and accurate reading. This is also the casewith use of ANN although the effect of window size is less significant than withstatistical averaging methods (Fig. 7.3).

Average Error - Coefficient Sizes

1.061.05

0.90

0.95

1.00

1.05

1.10E

rro

r (L

)

63 100

Fig. 7.1 Overall performance of the ANN-based measurement system using different inputcoefficient sizes (error is in liters of tank fuel volume)

7.3 Selection of Signal Preprocessing Parameters 123

Page 129: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

7.4 Selection of Signal Smoothing Parameters

To investigate the performance of the ANN-based measurement system, whenapplied with the signal smoothing capability, it was important to determineappropriate parameters for the signal smoothing configuration. That is, to deter-mine an appropriate signal smoothing (filter) function out of the three functions(Moving Mean, Moving Median, Wavelet Filter) described in Sect. 4.5. Further-more, the optimal size of the filter tap, and an appropriate feature extraction

Average Error - Feature Extraction Functions

0.921.07 1.17

0.00

0.20

0.40

0.60

0.80

1.00

1.20

1.40

1.60

1.80

2.00

FFT DCT WT

Err

or

(L)

Avg. Error Upper-limit

Avg. Error (L)

Fig. 7.2 Overall performance of the ANN-based measurement system using different featureextraction functions

Average Error - Window size

0.00

0.50

1.00

1.50

2.00

2.50

3.00

3.50

5 7 10 14 20

Window Size (second)

Err

or

(L)

Mean Median ANN

Fig. 7.3 Overall performance of the ANN-based measurement system using different windowsizes compared with existing statistical averaging methods

124 7 Discussion

Page 130: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

function was important to be determined experimentally. For this purpose,Experiment Set C2 was conducted and the training and validation samplesobtained from the field trials were used to investigate the performance of the ANN-based system based on the different types of signal smoothing functions, differentfeature extraction functions, and different sizes of the filter tap.

The results obtained from Experiment Set C2 indicated that the optimal solutionfor the signal preprocessor configuration is using the Fast Fourier Transform (FFT)function as the feature extraction function, and Moving Median with tap size of 5as the signal smoothing function. The overall performance of each of these

Average Error - Filter Tap Sizes

0.9420.927

0.902

0.70

0.75

0.80

0.85

0.90

0.95

1.00

Err

or

(L)

5 10 15

Fig. 7.4 Overall performance of the ANN-based measurement system using various filter tapsizes

Average Error - Signal Smoothing Functions

0.960.870.94

0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

1.6

Moving Mean Moving Median Wavelet Filter

Err

or

(L)

Avg. Error (L) Avg. Error Upper-limit

Fig. 7.5 Overall performance of the ANN-based measurement system using different signalsmoothing functions

7.4 Selection of Signal Smoothing Parameters 125

Page 131: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

parameters is shown in the following figures. The parameters that were found to bemost feasible are circled in the results in Figs. 7.4 and 7.5.

Figure 7.6 shows the overall performance of ANN-based measurement sys-tem incorporating different feature extraction functions and signal smoothingtechnique. Figure 7.6 shows a general improvement in the ANN-based mea-surement system when incorporating the signal smoothing technique. Theaverage performance of the feature extraction functions shown in Fig. 7.2(without signal smoothing feature) Fig. 7.6 (with signal smoothing) indicate thatthe performance of the ANN-based system has improved with the inclusion ofthe signal smoothing technique. The overall average error for the FFT functionwithout the signal smoothing method was observed in Experiment C1 (Fig. 7.2)as 0.92 L, but with the inclusion of the signal smoothing method, it hasreduced to 0.75 L. The positive effect of signal smoothing on the neural net-work-based signal processing system are also observable for DCT- and WT-based systems.

Table 7.1 shows a comparison of the ANN-based signal processing systemwith and without the signal smoothing method. In Experiment Set C1, signal

Average Error - Feature Extraction Functions

0.75

1.110.91

0.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

1.6

1.8

FFT DCT WT

Err

or

(L)

Avg. Error (L) Avg. Error Upper-limit

Fig. 7.6 Overall performance of the ANN-based measurement system incorporating signalsmoothing techniques with different feature extraction functions

Table 7.1 Influence of signal enhancement on the performance of the ANN-based signal pro-cessing system

Implementedfeature extractionfunction

Average error (without signalsmoothing) (Experiment SetC1) (L)

Average error (with signalsmoothing) (Experiment SetC2) (L)

Errorreduction(%)

FFT 0.92 0.75 18DCT 1.07 0.91 15WT 1.17 1.11 5

126 7 Discussion

Page 132: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

smoothing on the raw sensor signal was not implemented, whereas in Experi-ment Set C2, the raw input signals were smoothened using three signalsmoothing functions, namely, Moving Average Filter, Moving Median Filter, andWavelet Transform Filter. The results shown in Table 7.1 indicate a substantialerror reduction of 18% in the ANN-based signal processing system when con-figured with FFT as the feature extraction function. Although the error reductionwith the DCT-based ANN is also fairly significant this was not the case with theWT-based ANN.

7.4 Selection of Signal Smoothing Parameters 127

Page 133: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Chapter 8Conclusions and Future Work

8.1 Conclusion

Artificial Neural Network (ANN)-based signal processing and classificationapproach coupled with a single capacitive sensor has been used to accuratelydetermine the fuel level in an automotive fuel tank under dynamic conditions.A comprehensive literature review was conducted on the usage of capacitive sensorsin dynamic environments and on the characteristics and effective use of ANNs.Based on the findings of the literature review, a capacitive sensor-based measure-ment system using (ANN)-based signal processing and classification was proposedto provide robust and accurate fuel level measurement in a dynamic environment.

Extensive experiments were performed to determine an optimal configuration forthe proposed ANN-based measurement system. The selection of the ANN parame-ters, the kernel parameters, and the signal preprocessing configurations were all basedon extensive experiments. To determine the performance of the ANN-based fuel levelmeasurement system, many field trials were carried out to obtain a large amount ofdata for the training and validation of the system. The raw capacitive sensor signalsobtained from the experiments data were observed to indicate large variations in thecalculated fuel volume, when the actual fuel in the tank had remained constant. Thisvariation in the capacitive sensor output was caused by sloshing effects.

The overall results obtained from the ANN-based measurement system, whendesigned to have the optimal configuration determined by experimentation, wereobserved to have remarkably higher accuracy in a dynamic environment whencompared with the existing statistical averaging methods. The ANN model appliedwith the Moving Median filter (with tap size of 5) produced a significantly lowermaximum average error of 1.11 L, when compared with the statistical averagingmethods of Moving Mean and Moving Median that produced a maximum averageerror of 5.96 and 5.38 L, respectively.

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3_8,� Springer-Verlag London 2012

129

Page 134: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

The increased accuracy of the fuel level measurement system that can beachieved in dynamic environments with the configuration described in this thesiswill provide more confidence to drivers regarding the actual amount of fuelindicated by the instrument panel. With the suggested fuel level measurementsystem, the distance-to-empty figures can be accurately computed. In particular,the ANN-based method is suitable for use in professional car racing where vehi-cles are subjected to highly dynamic maneuvres. Drivers of cars equipped with thismeasurement method can confidently drive a higher number of laps without fear ofrunning out of fuel in situations where fuel level in the tank is low.

The neural network approach has been used to accurately determine the fuel level inan automotive fuel tank under dynamic conditions. In an initial set of experiments(Experiment set A), the three factors that can potentially influence the level measure-ment were investigated, and the investigation indicated a substantial influence of thesloshing phenomenon and temperature variation on the capacitive level sensing output.

In a second set of experiments (Experiment set B), three different neural networkconfigurations were investigated using the data obtained from Experiment set A.These three networks are the most commonly used in various scientific applicationsand for that reason they were chosen for this analysis. A maximum error of 8.7%was obtained using the Distributed Time-Delay Neural Network and an error of0.11% was obtained using the Backpropagation Neural Network. The error resultsobtained by using the three neural network topologies were substantially less thanthat obtained by using the averaging method without neural networks.

In Experiment set C, four identical BP neural networks were developed and aninvestigation was carried out by applying three filtration methods and keeping oneunfiltered raw signal to analyze the performance of the BP neural network approachin improving the accuracy of the level sensor in the presence of liquid slosh. Thefour neural networks with applied filters Moving Mean, Moving Median, Wavelet,and Unfiltered had the same network configurations. The output response of eachnetwork with the same raw signals was also observed to be very similar. The BPnetwork applied with the Moving Median filter produced a maximum averagederror of 1.1 L (Fig. 6.31), which is significantly better than the results obtainedusing the statistical and non-neural network Moving Mean, and Moving Medianfunctions that produced a maximum averaged error of 6.0 and 5.4 L, respectively.

In summary, the neural network approach to signal processing has been dem-onstrated to be effective in determining the fuel level in dynamic environments usinga single tube capacitor. Furthermore, the BP network performance has beenenhanced with the implementation of a Median filter at the preprocessing stage.

130 8 Conclusions and Future Work

Page 135: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

8.2 Future Work

A Capacitive Sensor coupled with the ANN approach to signal processing will beused to address other factors such as tilting effect that causes liquid to shift to oneside. With the rapid improvements in microprocessor technology, it will be pos-sible to automatically train the ANN model in real time, which will furtherincrease the effectiveness of the measurement system in dynamic environments.

8.2 Future Work 131

Page 136: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Appendices

Appendix A: List of Publications

The following papers highlight the findings of this research. These articles werepublished in reputed journals during the course of this research program.

1. Terzic, Edin, Nagarajah, Romesh, and Alamgir, Muhammad. ‘‘A neuralnetwork approach to fluid quantity measurement in dynamic environments’’,Mechatronics; vol. 21, no. 1, pp. 145–155, Feb 2011.

2. Terzic, Edin, Nagarajah, C. Romesh, and Alamgir, Muhammad. ‘‘Capacitivesensor-based fluid level measurement in a dynamic environment using neuralnetwork’’, Engineering Applications of Artificial Intelligence; vol. 23, no. 4,pp. 614–619, June 2010.

3. Terzic, Edin, Nagarajah, Romesh, and Alamgir, Muhammad. ‘‘A NeuralNetwork Approach to Fluid Level Measurement in Dynamic EnvironmentsUsing a Single Capacitive Sensor’’, Sensors & Transducers Journal; vol. 114,no. 3, pp. 41–55, March 2010

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3,� Springer-Verlag London 2012

133

Page 137: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Appendix B: EXXSOL D-40 Fluid Specification

The following table provides detailed specifications for the Exxsol D-40 typeStoddard solvent used in the experimentations [1].

Reference

1. Corporation, Exxon Mobil. Aliphatics Fluids (Exxsol Series) —Grades & Datasheets. ExxonMobil Corporation; [cited]; Available from: http://www.exxonmobilchemical.com/Public_Products/Fluids/Aliphatics/Worldw ide/Grades_and_DataSheets/Fluids_Aliphatics_ExxsolSBP_Grades_WW.asp.

Table B.1 Exxsol D-40 fluid specifications

Property Units Typical values Test method

Distillation range �C ASTM D 86IBP 164DP 192

Flash point �C 48 ASTM D 56Density @ 15�C kg/dm3 0.772 ASTM D 4052Viscosity @ 25�C mm2/s 1.30 ASTM D 445Evaporation rate (n-BuAc = 100) – 15 EMC-AP-F01KB value – 32 ASTM D 1133Aniline point �C 70 ASTM D 611Aromatic content wt% 0.08 AM-S 140.31Colour (Saybolt) – ?30 ASTM D 156Bromine index mg/100 g 15 ASTM D 2710Surface tension @ 25�C mN/m 24.7 EC-M-F02 (Wilhelmy Plate)Refractive index @ 20�C – 1.428 ASTM D 1218

134 Appendices

Page 138: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

About the Authors

Dr. Edin Terzic is the Chief Manufacturing Engineer—Asia Pacific and ManagingDirector (CEO) of Powertrain at Delphi Automotive Systems Australia. He holds aBachelor of Mechanical Engineering (with honors), Master of Engineering inComputer Integrated Manufacturing, and PhD in Automotive Engineering fromSwinburne University of Technology. He has published a number of technicalpapers in the area of Engineering Applications of Artificial Intelligence. He alsoholds several international patents in the area of automotive engineering and hadsuccess in commercializing most of his research. Areas of research include:artificial neural networks, intelligent sensors and non-contact inspection.

Dr. Jenny Terzic is the Director of Corporate Quality at Iveco Trucks Australia(Fiat Group). She holds a Bachelor of Mechanical Engineering (with honors),Master of Engineering in Computer Integrated Manufacturing and PhD inAutomotive Engineering from Swinburne University of Technology. She has apublished number of technical papers in the area of Engineering Applications ofArtificial Intelligence. Areas of research include: support vector machines,artificial neural networks, advance signal processing, intelligent sensors, and non-contact inspection.

Prof. Romesh Nagarajah is the Professor of Mechanical Engineering atSwinburne University of Technology. He leads an internationally recognizedresearch group working in the fields of Non-Contact Inspection and IntelligentSensing. Professor Nagarajah has several international patents and has publishedover 150 international journal, conference, and technical papers in intelligentsensing and non-contact inspection. He has received several grants from theAustralian Research Council and the automotive industry to develop intelligentsensing systems for process monitoring and non-contact inspection.

Muhammad Alamgir is a Software Engineer at Vipac Engineers and Scientists.He has graduated in Computer Systems Engineering from RMIT University. Hehas been developing microcontroller-based sensors and instruments, and has alsobeen involved in smart-sensor-based projects, incorporating Artificial Intelligence-based techniques, at Delphi Automotive Systems, Australia.

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3,� Springer-Verlag London 2012

135

Page 139: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

Index

AAnalog waveform, 40Artificial neural network, 4, 45, 49, 57, 69, 71,

84, 129Averaging, 4, 29, 32, 33, 86, 102

BBackpropagation neural network, 69, 71, 82,

87, 100

CCapacitance, 12, 13Capacitive sensor, 3, 12Contamination, 4, 26

DDampening, 29Design of experiments, 5Dielectric constant, 3, 12, 15Dielectric strength, 15Discrete cosine transform (DCT), 41, 42Discrete sine transform (DST), 43Distributed time delay neural

network, 51, 84, 91Dynamic neural network, 49

EExxsol D-40, 134

FFast fourier transform (FFT), 41Feature extraction, 39, 41Feed forward network, 49Fisher discriminant analysis (FDA), 41Focused time delay neural network, 51Frequency coefficients, 58, 99Full factorial matrix, 83

HHidden layer, 49

IIndependent component analysis (ICA), 41Input layer, 49Interaction plots, 67, 96

LLabview, 86Learning rule, 52Linear transfer function, 47Low pass filter, 40

MMain effect plots, 67, 95Matlab, 92Moving mean, 5, 117Moving median, 5, 117

E. Terzic et al., A Neural Network Approach to Fluid Quantity Measurementin Dynamic Environments, DOI: 10.1007/978-1-4471-4060-3,� Springer-Verlag London 2012

137

Page 140: A Neural Network Approach to Fluid Quantity Measurement in Dynamic Environments

NNARX neural network, 52, 85, 91Network weights, 114Neural network validation, 101, 115Neuron model, 45

OOutput layer, 49

PPerceptron neuron, 48Principle component analysis (PCA), 41Purelin, 87

RRecurrent neural network, 51

SSigmoid function, 47Sigmoidal function, 5Signal classification, 44Signal filtration, 9

Signal smoothing, 5Sloshing, 4, 29Supervised classification, 44Supervised learning, 52

TTansig, 87Threshold transfer function, 47Tilt sensor, 30

UUnsupervised classification, 44Unsupervised learning, 53

VValidation error, 118

WWavelet filter, 5Wavelet transform (WT), 41, 43Weights, 45

138 Index