• No results found

CONTROL STRATEGY AND MODELING FOR ENGINE OIL SYSTEM

N/A
N/A
Protected

Academic year: 2021

Share "CONTROL STRATEGY AND MODELING FOR ENGINE OIL SYSTEM"

Copied!
60
0
0

Loading.... (view fulltext now)

Full text

(1)

Västerås, Sweden

Thesis for the Degree of Master of Science in Engineering - Robotics

30.0 credits

CONTROL STRATEGY AND

MODELING FOR ENGINE OIL SYSTEM

Dalibor Colic

dcc16001@student.mdh.se

Jakob Norin

jnn16012@student.mdh.se

Examiner: Martin Ekström

Mälardalen University, Västerås, Sweden

Supervisors: Lennie Carlén Eriksson, Per Hellström, Miguel León Ortiz

Mälardalen University, Västerås, Sweden

Company Supervisors: Robert Gröning, Johan Salomon

Scania, Södertälje, Sweden

(2)

Abstract

The power of an engine is not only used to drive the mechanical equipment connected to the engine, but also parts of the engine itself. One of these parts is the oil pump. The minimum needed oil pressure, produced by the pump, varies during the operational run of the engine. The oil pump is, therefore, often over-dimensioned to ensure that the oil supply is adequate. The over-dimensioned oil pump circulates an excessive amount of oil through the system, thus putting unnecessary strain on the engine itself. A strained engine consumes more fuel. To reduce fuel consumption, the ability to control the amount of oil circulated more accurately is therefore of interest. As oil systems are non-linear, Artificial Intelligence controllers are investigated. This work developed four versions of a model of an engine oil system and evaluated a Genetic Algorithm and two versions of Differential Evolution to adjust the weights of a Neural Network that alter the weights in a PID controller. The models were created in Simscape and Simulink, and the Neural Network was created using the Neural Network toolbox in MATLAB. The Genetic Algorithm and Differential Evolution algorithms were coded in MATLAB. The results show that the accuracy of the model is important and that the use of a machine learning algorithm for controlling a fluid system is feasible.

(3)

Acknowledgements

We want to thank our supervisors Lennie Carlén Eriksson and Per Hellström, for guiding us through this thesis work and helping with the structural part of the report and unending proofreading, with a special shout-out to Per for his detailed commenting. We are thankful to Miguel León Ortiz for providing us with support about the technical parts of machine learning. We would also like to thank our supervisors Robert Gröning och Johan Salomon at Scania, for supporting us with valu-able knowledge concerning the oil system and control systems. Finally, we would like to thank Scania for giving us this opportunity and providing equipment for us to work with.

(4)

Contents

1 Introduction 1

1.1 Hypothesis and Research Questions . . . 1

1.2 Delimitation . . . 1

2 Background 3 2.1 Combustion Engines . . . 3

2.2 The Engine Oil Control System . . . 3

2.3 Variable Displacement Vane Pump . . . 4

2.4 Fluid Dynamics of Vane Type Pumps . . . 4

2.5 Valve . . . 5

2.6 Feed Forward Control . . . 6

2.7 Simulink and Simscape . . . 6

2.8 Stochastic, Heuristic, and Metaheuristic Algorithms . . . 8

2.8.1 Genetic Algorithm . . . 8 2.8.2 Differential Evolution . . . 9 3 Related Work 12 3.1 System Modeling . . . 12 3.2 System Control . . . 14 3.3 Intelligent Control . . . 15

4 Ethical and Societal Considerations 17 5 Method 18 5.1 Methodology . . . 18

5.2 System Modelling . . . 18

5.3 Data Collection and Training of the Neural Network . . . 18

5.4 Model Creation . . . 19

5.4.1 Control System Modeling . . . 22

5.4.2 Valve Modeling . . . 24

5.5 Artificial Intelligence Controller . . . 24

5.5.1 Feed Forward Neural Network . . . 25

5.5.2 Genetic Algorithm . . . 25 5.5.3 Differential Evolution . . . 26 6 Results 27 6.1 Model A . . . 27 6.2 Model B . . . 29 6.3 Model C . . . 30 6.4 Model D . . . 33 7 Discussion 35 7.1 Discussion of Decisions . . . 35

7.2 Discussion of the Results . . . 36

8 Conclusions 38 8.1 Future Work . . . 38

References 41

Appendix A Split Plots of Model A Results 42

Appendix B Split Plots of Model B Results 44

(5)
(6)

List of Figures

1 Ideal illustration of the oil control system. The solid lines are oil flow, and dashed lines are electrical signals. Note that leakages are not shown. . . 4 2 Oil flow through the valve with different positions of the spool, allowing the oil to

flow to and from the control chamber. . . 6 3 An illustration of the oil pressure acting on the spool. Note that the shape of the

spool is an approximation. . . 6 4 A mass-spring-damper model made in Simulink. . . 7 5 A mass-spring-damper model made in Simscape. . . 7 6 Illustration of single point crossover for GA. The genes of parent 1 are in blue and

the genes of parent 2 are in purple. . . 8 7 A general flowchart of DE including the necessary steps. . . 9 8 Example of binomial crossover with D = 5, δ = 3 and Pc = 0.8. The vector to the

right is the trial vector that is to be generated based on the random numbers in the purple vector. . . 10 9 Example of the greedy selection method on a minimization problem with random

numbers. . . 11 10 Model of the oil system explained by Nahim et al. . . 12 11 Flowchart of the methodology in this thesis work. Where green indicates the problem

formulation and related work. Red indicates a quality check, blue indicates the implementation and yellow indicates tests. . . 19 12 Version C of the model. The block marked by a yellow square is the pump. . . 21 13 The control system of model C modelled in Simulink. The blue square is the NN.

The feed forward controller of model C is the the lookup table under the Proportional Integral Derivative (PID). . . 23 14 The valve system for model C modelled in Simscape. . . 24 15 Architecture of the FFNN developed in this work. . . 25 16 Comparison between all different algorithms used on model A, where the purple line

is the oil pressure reference that the algorithms are trying to follow. . . 27 17 Best fitness for each generation of Genetic Algorithm (GA) model A, where a lower

value is better. . . 28 18 Best fitness for each generation of Differential Evolution (DE)/current-to-pBest/1,

where a lower value is better. . . 28 19 Comparison between all different algorithms used in model B, where the purple line

is the oil pressure reference that the algorithms are trying to follow.. Note that GA, DE/rand/1 and DE/current-to-pBest/1 are all the same. . . 29 20 Best fitness for each generation of DE/current-to-pBest/1, where a lower value is

better. . . 29 21 Comparison between all different algorithms implemented in model C, where the

purple line is the oil pressure reference that the algorithms are trying to follow. Note that the control methods all produced the same result. . . 30 22 Comparison between all the algorithms implemented in model C, where the purple

line is the oil pressure reference that the algorithms are trying to follow. The models are trained with the feed forward control, but evaluated without it. . . 31 23 Comparison between GA and DE/current-to-pBest/1 on model C, trained without

the feed forward control. The purple line is the oil pressure reference that the algorithms are trying to follow. . . 31 24 Best fitness for each generation of GA model C, where a lower value is better. . . . 32 25 Best fitness for each generation of DE/current-to-pBest/1 model C, where a lower

value is better. . . 32 26 Comparison between the NNs trained with GA and DE/current-to-pBest/1 and the

version based on lookup tables implemented in model D, where the purple line is the oil pressure reference that the algorithms are trying to follow. . . 33

(7)

27 Zoomed in comparison between DE/current-to-pBest/1 and the lookup table PID in model D, where the purple line is the oil pressure reference that the algorithms are trying to follow. . . 33 28 Fitness progression of the GA implemented in model D. . . 34 29 Fitness progression of the DE/current-to-pBest/1 implemented in model D. . . 34 30 Comparison between the NN trained with GA and the version based on lookup

tables implemented in model A. . . 42 31 Comparison between the NN trained with DE/rand/1 and the version based on

lookup tables implemented in model A. . . 43 32 Comparison between the NN trained with DE/current-to-pBest/1 and the version

based on lookup tables implemented in model A. . . 43 33 Comparison between the NN trained with GA and the version based on lookup

tables implemented in model B. . . 44 34 Comparison between the NN trained with DE/rand/1 and the version based on

lookup tables implemented in model B. . . 45 35 Comparison between the NN trained with DE/current-to-pBest/1 and the version

based on lookup tables implemented in model B. . . 45 36 Comparison between the NN trained with GA and the version based on lookup

tables implemented in model C. . . 46 37 Comparison between the NN trained with DE/rand/1 and the version based on

lookup tables implemented in model C. . . 47 38 Comparison between the NN trained with DE/current-to-pBest/1 and the version

based on lookup tables implemented in model C. . . 47 39 Comparison between the NN trained with GA and the version based on lookup

tables implemented in model C. . . 48 40 Comparison between the NN trained with DE/rand/1 and the version based on

lookup tables implemented in model C. . . 48 41 Comparison between the NN trained with DE/current-to-pBest/1 and the version

based on lookup tables implemented in model C. . . 49 42 Comparison between the NN trained with GA and the version based on lookup

tables implemented in model C, trained without the feed forward control of the PID. 49 43 Comparison between the NN trained with DE/current-to-pBest/1 and the version

based on lookup tables implemented in model C, trained without the feed forward control of the PID. . . 50 44 Comparison between the NN trained with GA and the version based on lookup

tables implemented in model D, both without the feed forward control. . . 51 45 Comparison between the NN trained with GA and the version based on lookup

(8)

List of Tables

1 Colors of the domains in Simscape used in this work. . . 7 2 Notation description of the symbols used by Truong et al. to describe power loss

due to oil leakage in an variable vane oil pump. . . 13 3 User parameters used during training of GA. . . 26 4 User parameters used during training of DE. . . 26

(9)

List of Acronyms

AI Artificial Intelligence

DE Differential Evolution

FFNN Feed Forward Neural Network

GA Genetic Algorithm

HVAC Heat, Ventilaiton, and Air Conditioning

NN Neural Network

PID Proportional Integral Derivative

PWM Pulse Width Modulated

RPM Rotations Per Minute

RQ Research Question

VDOP Variable Displacement Oil Pump

(10)

1

Introduction

World wide transportation of goods has a significant impact on the environment. Today it has become essential to include the environment in business operations, especially emission-intensive activities such as the transportation industry, while maintaining the economic performance [1]. Fuel consumption is directly related to the load of the engine. Such as the mass of the truck, but also the work of driving the generator, water pump and oil pump. The oil pump is essential in an engine as it circulates the oil. The oil flow lubricates the internal components, decreasing the wear and thus increasing the lifetime of the engine [2].

In general, a lubrication system with a rotating component with a fixed displacement is optimized to work efficiently at a target speed and a maximum operating lubricant temperature. Since the lubrication requirements do not directly correspond to the operating speed, this results in an oversupply of lubricant in many situations. To ensure that the lubrication is sufficient at most operating speeds, pumps are over-dimensioned. The excess lubricant oil is returned to the oil reservoir through a pressure relief valve to avoid overpressuring within the mechanical system. This results in a significant amount of energy being wasted when displacing unnecessary amounts of oil and thus increases fuel consumption.

This thesis work evaluates a control strategy and model of an engine oil system with a Variable Displacement Oil Pump (VDOP) investigated by Scania. The pump modeled will be a Variable Displacement Vane Pump (VDVP) since it is commonly used from similar applications [3], [4]. It is also evaluated whether an Artificial Intelligence (AI) controller would be suitable for con-trolling such a system, as versions of AI controllers successfully have been implemented in similar systems [5], [6].

A model of the engine oil system will be created to explore which part of the system has the most notable impact on the control system. There are many difficulties within such systems since many parameters are not constant, such as the oil’s viscosity, the rotational velocity of the oil pump rotor, and oil leaks within the system. Three AI algorithms for machine learning are trained on the created model to evaluate the possibility of improving the control of a regular PID controller. Section2explains information that is necessary to understand this work but can be skipped by someone experienced in this subject. Section3 evaluates state of the art and what previous work have done, and how it may be implemented in this work. Section4discuss some of the ethical and societal considerations and impact of this work. Section5describes the method and methodology used during this work and some of the decisions made. The results are presented in Section6and discussed in Section7. A conclusion of the work is summarized in Section8.

1.1

Hypothesis and Research Questions

In this section, the Research Questions (RQs) which are to be answered during this thesis work are stated. The RQs are developed to evaluate the following hypothesis.

Hypothesis: An intelligent controller could be more effective than a traditional PID for regulating oil pressure in an engine, with respect to average error, oscillations, and overshoot.

• RQ1: How could the actuator in the engine oil system be controlled in order to reduce the fuel consumption, with respect to oil pressure, oil temperature and engine speed?

• RQ2: What sensor data is needed in order to control the engine oil pressure?

1.2

Delimitation

Some limitations exist for the work due to requests from Scania. • The software for modelling will be Simulink.

(11)

• The final implementations should be inexpensive, meaning that the additional cost for pro-ducing each truck with the system implemented should be minimal. This is in order to make production feasible and maintain competitiveness on the market.

• The data used for training is secret and may not be transferred outside of the Scania hardware or network.

• Since the training of the AI algorithms takes between 2-7 days, depending on which model the AI it is being trained on, this work focuses on showing the feasibility of using AI algorithms for controlling an oil system rather than finding the most optimal solution.

(12)

2

Background

This section starts with a broad overview of the essential functions of a combustion engine. This is followed by a brief introduction to control theory and PID controllers. Then, the basic concepts of fluid dynamics and their applications in this work will be explained, followed by an insight into the software tools used for this thesis work.

2.1

Combustion Engines

The basic operating principle of combustion engines is the explosion caused by the fuel igniting in the engine’s combustion chamber. The explosions push the rods and turn the crankshaft by converting the linear motion to a circular. Multiple pistons are mounted on the same crankshaft. When one piston is pushed down, others are pushed up by the rotation of the shaft. In the case of a diesel engine, the explosion in the combustion chamber is created by mixing the fuel with air and applying pressure to reach the ignition point, as opposed to a petrol engine where a spark is used for ignition. As the load on the engine increases, more fuel is consumed. Some of the force generated by the engine is used to drive critical components of the engine, such as a water pump, oil pump, and generator. The water pump is needed to cool the engine to prevent overheating during extended use. The oil pump circulates oil through the system to lubricate the moving parts. Wear occurs when moving mechanical parts interact. The oil acts as a cushion between the parts and extends the time between service and replacement. The engine generator is used to provide electricity for the electronics in the truck, such as the computer calculating the fuel mixture. Since the powering of these systems is done by the engine, which in turn uses fuel as energy, a reduction of the work done by the systems will lead to lower fuel consumption.

2.2

The Engine Oil Control System

The model of the engine oil control of interest can be seen in Figure1. The oil is initially pumped from the oil pan to the oil filter by the pump. The pump used for this work is a so-called VDVP. The amount of oil being displaced is controlled by the volume of oil in the control chamber. When the oil volume in the chamber increases, the chamber will displace the stator of the pump and thus create a larger offset. This, in turn, increases the amount of pressure created by the pump and the amount of oil being displaced. When the oil volume in the control chamber decrease, a spring returns the stator to its original position. The walls between the pump and control chamber consist of multiple different materials, and when the temperature increases as the engine heat up, the materials expand at different rates. This causes leakages, both to and from the control chamber, depending on the difference in pressure and to the oil pan. Leakages also exist between different chambers of the oil pump [7]. Further explanation of the oil dynamics can be found in Section2.4After the pump, the oil reaches the oil filter. The impact of the filter on the oil pressure is largely dependant on the oil’s viscosity, and therefore the temperature of the oil. After the filter, the oil is split with the majority of the oil going into the engine to lubricate the moving parts, and a smaller part enters the control loop. The oil pressure is measured at this point. The oil then enters the control valve. A computer decides the direction of the oil from the control valve. The computer collect sensory data, such as the aforementioned oil pressure, engine revolution speed, and the temperature of the oil. From the sensory data, the gains (Kp, Ki, Kd) of a PID controller

is altered. The PID control the Pulse Width Modulated (PWM) signal to a spool in the valve, controlling the direction of the oil flow. A more in-depth explanation can be found in Section2.5

(13)

Valve Oil Pan Pump Oil Filter Engine Computer Control Chamber

Figure 1: Ideal illustration of the oil control system. The solid lines are oil flow, and dashed lines are electrical signals. Note that leakages are not shown.

2.3

Variable Displacement Vane Pump

A VDVP is a type of pump commonly used in vehicle and hydraulic applications to reduce energy consumption while lubricating the mechanical parts and preventing premature wear. The pump can vary the displacement of the oil by introducing oil into a control chamber. The stator overcomes the preload force of the spring and rotates around its pivot point. It thus reduces the eccentricity, meaning a circularity that has a different centre or deviates from a circular path, and achieves a variable displacement [8], [9].

2.4

Fluid Dynamics of Vane Type Pumps

In this thesis work, the control of the oil system indicates that an understating of basic fluid dynamics is needed, such as Bernoulli’s principle. This principle describes the relation between flow and pressure: an increase in flow results in a simultaneous decrease in the fluid’s static pressure or potential energy. From the integration of Newton’s second law of motion or by using the law of conservation of energy, one can derive Bernoulli’s principle, seen in equation1a.

v2 2 + gh + p ρ= C (1a) v2 1 2 + gh1+ p1 ρ = v2 2 2 + gh2+ p2 ρ (1b) where:

• v is the velocity of the fluid

• g is the acceleration caused by the gravitational pull of the earth. • h is the elevation of the fluid

(14)

• ρ is the density of the fluid • C is a constant

By using Equation1a, it is possible to calculate the difference of the properties between two points in a streamline since the points can be considered equivalent. This is shown in Equation1b. Note that this is only possible if the sum of the kinetic, inertial, and potential energy remains constant.

Oil used in motors is a Newtonian fluid, meaning that the viscous properties of the fluids are linearly related to the strain rate. This simplifies many computations.

To calculate the maximum theoretical discharge of vane type pumps the following equations can be used.

emax=

DC− DR

2 (2)

Equation2is the equation for the maximum possible eccentricity where DRis the rotor diameter of

the pump. DCis the cam ring diameter. L is the width of the vane pump and e is the eccentricity.

VDmax= π 4 D 2 c− D 2 R L (3)

Equation3 is the maximum volumetric displacement. VDmax= π 4(Dc− Dg) (Dc+ Dg) L VDmax= π 4 (Dc+ Dg) (2emax) L (4)

By using Equation2, Equation3can be simplified as Equation4

VDmax=

π

2 (DC+ DR) eLm3

rev (5)

The actual volumetric displacement occurs when emax= ehence Equation5is acquired.

QT = VDxN (6)

Equation6is the equation for the quality of discharge where N is rev/min

2.5

Valve

The actuator of the system currently investigated by the Scania is a valve placed after the oil pressure sensor and before the oil return to the oil pan, as seen in Figure1. The valve controls the oil flow to the control chamber in the oil pump regulating the amount of oil being pumped. The valve has three holes and an actuator spool being moved by a solenoid from one end and a spring from the other. It can be considered a proportional valve. The first hole of the valve is the oil input. The second hole is connected to the aforementioned chamber by the oil pump, and oil may flow in either direction, thus filling or emptying the chamber. The third and last hole in the valve is used for the return of the oil to the oil pan. In order to control the flow of the oil, an internal spool in the valve is moved to block either the first or last hole. When the spool blocks the first hole, the oil in the control chamber will be pushed out by expanding the contracted spring and returning to the oil pan through the valve, shown in Figure2a.

When the last hole is blocked, the chamber will instead begin to fill and therefore decrease the oil volume being pumped through the system, as shown in Figure2b.

The spool has two different sized areas on either end. The oil pressure will thus cause two forces of different magnitudes to alter the position of the spool. This is illustrated in Figure3.

(15)

(a) Oil flow when the first opening of the valve is closed.

(b) Oil flow when the last opening of the valve is closed.

Figure 2: Oil flow through the valve with different positions of the spool, allowing the oil to flow to and from the control chamber.

Figure 3: An illustration of the oil pressure acting on the spool. Note that the shape of the spool is an approximation.

The solenoid affecting the spool is controlled by a PWM signal. A higher duty cycle of the PWM will create a stronger magnetic field and therefore push the spool into the spring, contracting it. Similarly, a lower duty cycle will create a weaker field and allow the spring to expand, and thus push back on the spool. There is no cheap way to determine the position of the spool inside the valve, and there is, therefore, no way to know the error in the positioning of the spool.

2.6

Feed Forward Control

In some control systems, a feed forward controller is used. The feed forward is used to set an optimum value of the control signal without adjusting for the impact of the sent signal. The feed forward is most often used in combination with a closed loop system to adjust for the error. The inclusion of a feed forward controller is typically done to respond to changes in the system with minimal overshoot quickly. Since the feed forward controller does not account for errors in the output signal, the controller must be tuned correctly not to escalate the error.

2.7

Simulink and Simscape

MATLAB is a programming language and program often used for technical computation and is developed by MathWorks. The name MATLAB stands for matrix laboratory. MATLAB is, as the name suggests, well suited for matrix calculations. It is common to use MATLAB for signal processing, control systems, AI, and robotics [10]. Simulink is another product made by MathWorks. It is a graphical programming language that is commonly used for system modelling. An example of a mass-spring-damper system, as stated in Equation7, modelled in Simulink can

(16)

be seen in Figure4. The modelling is done by combining blocks to form mathematical equations. F = m¨x + b ˙x + kx (7) 1 s 1 s x ÷ -mass x x b x x k

Figure 4: A mass-spring-damper model made in Simulink.

An alternative to Simulink when creating physical models is Simscape, also created by Math-Works. In Simscape, the models are constructed by connecting components in a schematic. The same mass-spring-damper system modelled in Simulink in Figure4 can be seen again in Figure5, this time modelled in Simscape.

Mass

Damper

Spring

Figure 5: A mass-spring-damper model made in Simscape.

In Simulink, the connections between blocks are generally restricted to one type of connection, e.g. a float containing a measured temperature or a boolean with a control signal. Connections may also be multiplexed to contain multiple signals. In Simscape, on the other hand, the blocks and signals are restricted to domains, e.g. thermal liquid, hydraulics, electrical, and mechanical. The signals contain information needed for that domain. For example, in the thermal liquid domain, the lines contain temperature, pressure, and flow. Lines may be converted from Simulink to Simscape and vice versa via converter blocks. This allows for the construction of custom components. The color of the connections in Simscape indicates which domain the components belong to [11]. The domains and corresponding colors used in this work are stated in Table1.

Color Domain

Blue Electrical Brown Hydraulic

Light Green Mechanical Rotational Dark Green Mechanical Translational Orange Thermal Domain

Roan Rouge Physical Signal

(17)

2.8

Stochastic, Heuristic, and Metaheuristic Algorithms

Optimization algorithms have historically been used to find minimums or maximums for a problem by iteration. Simple examples are hill-climbing and random walk. The hill-climbing algorithm starts at a random point or an estimation and evaluates the points in the vicinity. If the algorithm finds one that is better, it repeats the process for that point. Since not every point is evaluated, the algorithm is prone to get stuck in local optimums. The random walk is also initialized in the same way as hill-climbing, but instead of moving in the direction of the optimum, it has an equal chance to move in any direction. This allows it to escape from local optimums, but at the same time, it is not guaranteed to find an optimum in the first place. Nowadays, more sophisticated algorithms exist. They can be split into two groups; deterministic and stochastic. In deterministic algorithms, the output of the algorithm is known if the input is known. Stochastic algorithms contain some degree of randomness. Given the same starting point, hill climber can be considered heuristic, and random walk can be considered stochastic. Stochastic algorithms are typically for searching globally and heuristic for searching locally [12]. Metaheuristic algorithms have been developed as a method to improve the search space of heuristic functions. It includes some stochastic elements in heuristic functions to handle nonlinear problems [13]. GA and DE are two examples of metaheuristic algorithms.

2.8.1 Genetic Algorithm

GA is an optimization algorithm that is emulating the theory of evolution. GA is a broad term that includes algorithms that uses a population of solutions and from that population makes a selection and some sort of recombination of the selection to create new solutions. This is similar to offspring are created in nature. This is terminology that is reused in GA. The general version of GA is at first initialized with a set population size. This size does not change during the run. The fitness of the population is then evaluated. Based on the fitness, parents are selected. The parents are then used to create offspring. This process is generally done using a crossover method, i.e. some parts of the offspring are copied from each parent. The selection of which parent should be the origin of each individual value of the offspring can be made in multiple ways. The most common are either single point or n point crossover. In single point crossover, a random point is selected. The values from the first parent are selected for the corresponding positions in front of the point. The other values are copied from the second parent. This process can be seen in Figure6. Parent 1 Parent 2 Offspring 1 Offspring 2 crossover point

Figure 6: Illustration of single point crossover for GA. The genes of parent 1 are in blue and the genes of parent 2 are in purple.

(18)

In n point crossover, n odd number of random crossover points are generated instead. The number of parents selected and offspring created are control parameters. The fitness of the offspring is evaluated and the offspring then replaces some of the population to create a new generation. The offspring generally have a chance to mutate in order to avoid local optimums. The newly created offspring then replaces some of the individuals in the population and create a new generation. The offspring replaces a part of the population, equal the amount of offspring, thus the population size does not change [14]. In this work, the worst performing individuals of the population are replaced. 2.8.2 Differential Evolution

DE is a metaheuristic direct search method for finding minimums. It is initialized with random values representing vectors spanning the entire parameter space. One method for initialization such a population is by Nguyen-Widrow initialization [15]. The vectors in the population are used to create so-called donor vectors, which are then used to create a new vector called the trial vector. This is done for each individual in the population and is often called the crossover and mutation of DE. The following text will explain this process for DE/rand/1, DE/current-to-best/1, and DE/current-to-pBest/1. Other mutation methods can be found in [16]. A flowchart of the general process for DE can be seen in Figure7.

Population initialization Mutation Crossover Range check selection Termination condition End Yes No

Figure 7: A general flowchart of DE including the necessary steps. The DE/rand/1 mutation method is given by Equation8.

Vi= Xr1+ F (Xr2− Xr3) r1, r2, r3∈ {1, 2, 3...Np} and r16= r26= r3 (8)

Where Vi denotes the ith donor vector, Xr1, Xr2, Xr3 are three randomly selected individuals from

the population, Npis the population size and F is a user defined parameter called the scaling factor

and it is defined as [0, 2]. Since three randomly selected solutions are needed and r1 6= r2 6= r3,

Np≥ 4. By the fact that the donor vectors receive input from other, randomly selected, individuals

in the population it is possible to break free from local minimums and over time reach the global minimum, this is however not guaranteed. Some dynamic versions of DE improve this probability, such as MPADE and JADE [17]. Since DE is sensitive to which parameters are selected, several adaptive versions exist [13]. The second mutation method DE/current-to-best/1 is defined by

(19)

Equation9.

Vi= Xi+ F (Xbest− Xi) + F (Xr1− Xr2) (9)

Where Vi is the ith donor vector, Xi is the ith individual from the population, Xbest denotes the

best individual in the population, Xr1, Xr2are two randomly selected individuals in the population

and F is a user defined scaling factor defined as [0, 2].

The third and last mutation method DE/current-to-pBest/1 is defined by Equation10

Vi= Xi+ F (X p

best− Xi) + F (Xr1− Xr2) (10)

Equation10is similar to Equation 9mainly differing in the variable Xp

best. The difference here is

that instead of choosing the best individual in the population DE/current-to-pBest/1 chooses one individual from the population randomly from the 100p% best individuals in the population, where pis defined as p ∈ (0, 1]. Crossover is initiated after the mutation process is finished and the donor vectors been created. Crossover is needed in order to increase the diversity within the population. There are mainly two crossover methods, binomial crossover and exponential crossover. In this work, the binomial crossover method will be used, and it is defined as Equation11 since it was used in [17]. The binomial crossover method uses the target vector and the donor vector to create a trial vector. Using Equation11the trial vector is filled with either data from the target vector or the donor vector.

uj = ( vj: if r ≤ P c OR j = δ xj : if r > P c AND j 6= δ (11) Where vj is the jth variable of the donor vector, r is a random value [0, 1], P

c is the cross over

probability defined by the user and is generally defined as [0, 1] and δ is a randomly selected variable within the decision variables. In Figure8, an example of this crossover method can be seen. The crossover probability Pc = 0.8, δ = 3 and the number of decision variables D = 5.

X1 X2 X3 X4 X5 V1 V2 V3 V4 V5 u1 r = 0.9 u2 r = 0.5 u3 r = 0.68 u4 r = 0.74 u5 r = 0.98 Target vector Xi Donor vector Vi Trial vector ui X1 V2 V3 V4 X5 D = 5 Pc = 0.8

Figure 8: Example of binomial crossover with D = 5, δ = 3 and Pc = 0.8. The vector to the

(20)

The next step after the crossover is to check if the trail vector is within the bounds. The bound-ing method is used in order to push back the variable to the bounds if the value of the variable is out of bounds. For example, if the variable is 6 it will be pushed back to the upper bound ub and similarly if the variable is −3 it will be pushed back to the lower bound lb.

The final step of differential evolution is selection. The selection process is used to evaluate each individual’s fitness and determine the composition of the offspring. In this work, greedy selection is used, and the target vector and the trial vector are compared against each other in order to determ-ine which of the two becomes the offspring in the new generation. The comparison between the target and trail vector is done by a minimization problem. In this case, it is the distance between the oil pressure and the oil pressure reference. In Equation12the greedy selection method can be seen. uj = ( vj : Xi= Ui xj : f i= fUi , if fUi < fi

if fUi > fiX and f remain the same.

(12) By using Equation12an example shown in Figure9of the greedy selection can be seen. The most optimum value is chosen for the offspring.

0.324 1.594 1.477 0.057 1.124 1.895 0.014 0.586 1.891 0.145 Target vector Xi Trial vector ui

0.324 0.014 0.586 0.057 0.145 Offspring

Figure 9: Example of the greedy selection method on a minimization problem with random numbers.

(21)

3

Related Work

In this section, previous work of researche related to engine oil system models and engine oil control systems will be described. Special focus will be on models of oil systems with variable displacement vane pumps and AI controllers. The implementation of VDVP in trucks has not been tested before, but similar oil systems in different environments have been examined.

3.1

System Modeling

In [5] a complete simulation model of a marine engine, which has a similar oil system to a truck engine, is developed based on physical and semi-physical equations, as well as mathematical and thermodynamic equations. Nahim et al. describe how the lubrication system was modeled. The lubrication system and the associated components can be seen in Figure10. The engine block outlet was modeled as in Equation13.

Oilpan

Pump Oil-Water heat exchanger Filter

Engine Block

Figure 10: Model of the oil system explained by Nahim et al.

CbT˙hsm= b3

 ˙mf

Ap

b4

− Qhcph(Thsm− Them) (13)

Where Thsmis the oil temperature at the outlet of the engine block and Themis the oil temperature

at the inlet of the engine block. The oil temperature at the outlet of the oil-water exchanger is described by Equation14.

CechhT = Q˙ hcph(Thse− thee) − εechhcedKthQed(Theeh− Teem) (14)

Where Thse is the oil temperature at the oil-water exchanger outlet.

The pressure at the outlet of the oil filter is described by Equation15.

Phsf = Phef − Khf(1 + di) Q2h (15)

Where Phsf is the pressure from the outlet of the filter, and Phef is the inlet pressure of the

filter. Khf is a constant in normal operation, which depends on the characteristics of the oil

filter. In order to calculate the outlet pressure at the pump, the authors used Equation16 and Equation17which are equations for a freshwater pump. The authors modified these equations to fit oil applications as seen in Equations18and19.

Peem= K2W + R˙ deqK1W + Peep (16)

(22)

Where Peem and Peep are the outlet and inlet pressures, respectively, of the freshwater pump.

W is the rotational speed of the crankshaft, and Rdeq is the equivalence resistance of the

fresh-water pump. K1 and K2 are constants in normal operation, which depends on the water density,

viscosity and the relationship between the pump gear diameter and the crankshaft gear diameter. Equation16represents laminar conditions and Equation17represents turbulent conditions.

In order to calculate the outlet pressure at the pump, the above equations were used with some modifications. The constants K1 and K2 are substituted to variables K3 and K4. K3 and K4are

directly proportional to the oil density and oil kinematics viscosity as seen in Equations18and19. ρp= ρ0 1 + a (Thsm− T0) (18) µh= 1010 b−c log 10(T hsm) (19) Where T0 is the ambient temperature and ρ0is the oil density at the ambient temperature.

The by Nahim et al. estimated oil pump outlet pressure showed to be accurate when compared to the to the real measured data [5].

Sun et al. created a simulation of the engine oil and fuel system of an aircraft [6]. Both sys-tems are open-loop control syssys-tems and therefore influenced by each other and other parts of the aircraft. The simulation was made in Simulink [18]. The oil system consisted of three subsys-tems; the ventilation system, oil circuit system, and the thermal calculation system. The authors validated the accuracy of the simulation model, of typical and atypical conditions for the fuel and oil systems, by comparing the Simulink model to one made in Flowmaster [19]. The relative error between the two models was generally less than 3.8% and deemed satisfactory by the authors. When modeling a variable vane pump, it is important to account for leakages. Leakages occur between the vane and rotor, and the vane and stator, as described by Fornarelli et al. [20]. If unaccounted for, the leakages could reduce the pump’s volumetric efficiency, leading to a reduced oil flow rate. The leakage between the vane and rotor is caused by the vane displacement pushing oil into the groove between the components and the pressure gradient between the internal pressure of the pump and the chamber pressure.

Truong et al. [7] estimated the power losses due to oil leakage in an oil pump to be of eight different types. The first type is the leakage between the inner area of the rotor and the oil chamber due to the clearance ζl1. This leakage is expressed in Equation 20, where (αi, αi+1) denotes the

chamber between the αi and αi+1 vane, and η denotes the dynamic viscosity of the oil. Further

notation descriptions can be found in Table2. Notation Description

αi The angular position of vane i

Ql The theoretical leakage as a rate of flow

b The depths of the pump chamber ζli Clearance i causing oil leakage

P Pressure

ηoil Dynamic viscosity of the oil

Rr Radius of the rotor

Rri Radius of the inner area of the rotor

tv Thickness of the vanes

lv Length of vane

ρi The distance from the center of the rotor to the

contact point of the vane i on the stator

Table 2: Notation description of the symbols used by Truong et al. to describe power loss due to oil leakage in an variable vane oil pump.

(23)

Ql1(αi, αi+1) =

l13 (P (αi, αi+1) − Pmin)

12ηoil(Rr− Rri)

(20) The second type of leakage is between the chamber and the inner area of the rotor, depending on the clearance ζl2. This is expressed in Equation21.

Ql2(αi, αi+1) =

[|αi− αi+1|Rri− tv− ζl1] ζl23 (P (αi, αi+1) − Pmin)

12ηoil(Rr− Rri)

(21) The third leakage between the chamber and the inner area of the rotor is dependant on the clearance ζl3is expressed in Equation22.

Ql3(αi, αi+1) =

tvζl33 (P (αi, αi+1) − Pmin)

12ηoil(Rr− Rri)

(22) The fourth leakage is caused by the clearance ζl4≡ ζl3 and is described in Equation23. The

leakage is between the oil chamber and its previous chamber. Ql4(αi, αi+1) =

lv(i+1)ζl43 (P (αi+1, αi+2) − P (αi, αi+1))

12ηoiltv

(23) The fifth leakage is between a chamber and the next one, caused by the clearance ζl5 ≡ ζl3.

This leakage is described in Equation24. Ql5(αi, αi+1) =

lviζl53 (P (αi, αi+1) − P (αi−1, αi))

12ηoiltv (24)

The sixth leakage is the leakage from the chamber to the area outside the ring. It is described in Equation25, where ζl6 is the clearance of the ring.

Ql6(αi, αi+1) =  |αi− αi+1| ρi+ ρi+1 2  ζ3 l6(P (αi, αi+1) − Pmin) 12ηoil(Rse− Rs) (25) The seventh and eighth leakages are the leakage between the previous and next chamber, respectively, due to a clearance between the vane tip and the ring’s inner contour. This clearance is typically very small during normal operation and can be considered negligible. Thus, the leakage of a chamber in between the consecutive vanes (αi, αi+1)can be calculated as shown in Equation26.

∆Qleak(αi, αi+1) = 2Ql4(αi, αi+1) − 6

X

i=1

Qli(αi, αi+1) (26)

One method of modeling is called black-box modeling. The modeling is used when it is unne-cessary to know the properties of each component in the system but rather to find an estimation of the system’s model. For example, the transfer function, state-space model or a linear ARX model [21]. Aruna and Jaya Christa tested Polynomial modeling, ARX, ARMAX, output error model, and the Box-Jenkins model [22] for their fuzzy PID controller for a heating system to maintain the pressure of a metal hydride hydrogen storage bed. In their application, the Box-Jenkins model had the best performance, with a fitness of 80.77% and a correlation between the output residuals and the cross-correlation of input and the output residuals with a 99% confidence interval, which means that the model accurately represents the dynamics of the system. The authors modeled their system with Simulink.

3.2

System Control

A common method for system control is the use of PID controllers. The purpose for each of the three parameters is as follows. Kp is the proportional part of the PID controller, and it is used

to accelerate the system’s response. Ki is the integral part of the controller, and it is used to

increase or decrease the amount of control according to the error. Lastly, the parameter Kd is the

derivative part of the controller, and its purpose is to reduce the amount of overshoot. This type of controller has been used for over 90 years [23].

(24)

3.3

Intelligent Control

Conventional PID controllers are widely used and are easy to implement. For some systems, such as oil pumps, PID controllers are unsuitable since it is hard to accurately and stably control the pump. Yang and Gong developed a fuzzy neural network PID algorithm to combat the control issues when using a traditional PID for oil pump control [24]. The fuzzy neural network PID was divided into three parts. The first part is the PID module, which directly controls the three parameters Kp, Ki, Kd, and the control object. The parameters are online self-tuning.

The second part of the fuzzy neural network PID controller was the fuzzyfication module. The purpose is to fuzzificate and normalize the input according to the fuzzy control. The input parameters are preprocessed according to the control query table and fuzzy rules which results in a reduction in error between the input and output data and the difference between the initial weights and the ideal weights of the neural network can be small. This further results in a time reduction in weight adjustment and control time, thus improving the adjustment efficiency. The third and last part of the fuzzy neural network PID regulator is the neural network module. The network consists of four layers. One input layer, one fuzzyfication layer, one fuzzy inference layer and lastly, the output layer.

The neural network was trained on the data and could dynamically adjust the input and output pressures and flow and adjust the system to achieve optimal results. These three parts resulted in a stable and self-adjusting control system that showed a reduction in overshoot compared to a traditional PID controller and a higher ability to counteract disturbances [24].

The use of fuzzy PID controller has shown promise in other systems when controlling flow, as evident by the control of a Heat, Ventilaiton, and Air Conditioning (HVAC) system by Soyguder et al. [25]. The authors constructed fuzzy rules based on the error and the rate of change of error for the temperature of two rooms. The authors noted one advantage of the system: it keeps the simple structure of the PID, i.e. it does not need any hardware improvements. However, the use of fuzzy logic would not be feasible in this work as there is a need for an expert to construct logic rules. As no such expert exist, other solutions should be explored.

In another work by Leephakpreeda [26] the author developed a fuzzy logic based controller for PWM control for a pneumatic artificial muscle actuator together with a control-variable estimation of a neural network. The fuzzy controller aimed to enable control of the position and the force of the actuator. The air mass flow was regulated with a solenoid depending on the PWM signal. The author used a multilayer neural network to estimate control variables that were hard to measure due to installation constraints etc. The measured variables were fed into the neural network estimator, and the estimated control variables were fed into the fuzzy logic controller, and the output was given as commands for the actuator. The neural network consisted of nonlinear processing nodes, e.g. one hidden layer between the input and output layers. The performances in both position control and force control were shown to be good. Also, the feed forward neural network was shown to be useful when control variables were inaccessible.

In another article by Rameshkumar and Arumugam, the authors imply that linear controllers are not suited for nonlinear applications. The use of artificial intelligence such as fuzzy or multi-valued logic is proposed instead [27].

Another approach for intelligent control was proposed by Shuguang et al. [28]. The use of a Feed Forward Neural Network (FFNN) and GA was investigated for control of the rotor speed of an aero engine. The weights of the neural network were optimized using a GA based on the fitness of the chosen PID controller values. Thus, the neural network could choose the best PID controller parameters for the aero-engine control by iterating. The results show that the use of a Neural Network (NN) together with GA works well for control of nonlinear and varying systems. Similar to GA, DE has been used for its strong global search ability in complex, nonlinear and high dimensional spaces as stated in [17], [29]. As stated by Ortiz et al. [17], it is possible to improve the convergence of DE to a global optimum rather than a local optimum by implementing more sophisticated versions. Examples of such improvements are algorithms such as JADE [30] and multi-populated DE [31]. The JADE algorithm dynamically updates the control variables F and P cof DE over the course of the training. This improves the variation at the start of the search and the precision at the end. In this way, the algorithm covers a wider search area but can still converge to an optimum. The multi-populated DE is constructed by creating multiple smaller populations

(25)

instead of one large. The small populations are commonly called demes or islands. When the islands exchange information with one another, it is called migration. The islands are isolated from each other except when migration occurs. There are different methods for determining when a migration should occur, such as at fixed generation intervals or when an island has converged.

(26)

4

Ethical and Societal Considerations

This section will evaluate the ethical and societal concerns regarding the work presented in this thesis. Since the control system does not interact with or impact individuals and thus does not pose any ethical issues, this section will focus on the societal impact of the work.

The most prominent societal impact of this paper’s work is on reducing the number of emissions from the transport sector due to lower fuel consumption. The transport sector is responsible for nearly a quarter of Europe’s greenhouse emissions, and in 2018 the road transportation was about 71% of the transport emissions [32]. An effect of high greenhouse emissions is the reduction of infrared radiation leaving the atmosphere of the planet. This leads to an increased temperature and thus increased risk of, for example, droughts, floods, heatwaves, and dust storms. Between 1990 and 2016, the average global surface-level increased by 0.57◦C, and the global emission of

greenhouse gasses increased by 41.1% [33]. The development of VDOP implementation in trucks could prove the feasibility to implement similar solutions in other types of heavy machinery. Thus reduce the emissions of greenhouse gases even further, even in other sectors.

(27)

5

Method

This section describes the decisions made during the work. The method used in this thesis work is the hypothetico-deductive method which can be described as follows. By forming a hypothesis, consequences are deduced and tested against experience. If the hypothesis is proven false, then knowledge is collected from that attempt. This may lead to a better hypothesis later on. If the hypothesis instead is proven to be true from the test, it can lead to other tests being conducted [34].

5.1

Methodology

This section describes the methodology that is to be followed in this thesis.

In order to answer RQ1 and RQ2, a comparison between control methods needs to be made. From this comparison, the most suitable control method can be selected for further evaluation. This comparison and motivation can be found in Section5.2 and 5.5. A model of the system is needed since evaluating the control methods in real-time is too time-consuming. This is due to the inability to run multiple systems in parallel, and simulations also offer more flexibility for small changes in the system.

The flowchart of the methodology can be seen in Figure 11. The thesis work is based on a problem to be solved. In this case, the problem is to optimize fuel consumption by controlling the engine’s oil flow. Next, a hypothesis can be developed based on the problem. The hypothesis stated in this work can be seen in Section1.1After the hypothesis is developed, a literature study needs to be done to find the best solutions for similar problems. When sufficient information has been gathered, the implementation can be initiated. The development of the system model and the intelligent controller will be done in parallel, as seen in Figure11, to save time.

5.2

System Modelling

Scania has expressed a desire to know which parameters influence the control system the most. As such, the oil circuit for the control loop is needed to be detailed. At the same time, the model should be simple enough that a handover at the end of the work should be possible. It is not essential to know the details of the engine’s inner workings, such as the routing of the oil and corresponding pressure loss. Therefore, the engine oil loop may be modeled by the usage of the black box principle [22] or simplified to an equivalent geometric shape, e.g. a long thin pipe causing similar resistances. The equations found in Section 2.4and Section 3.1 will be used if needed in order to acquire a detailed model.

Traditional PID controllers have shown to be inadequate for oil pump control, and the current PID investigated by Scania does not perform adequately. In order to evaluate the performance of the control system, some measurable variables need to be considered. In this thesis work, the controller’s performance will be based on its stability, response time, disturbance handling and the amount of overshoot. The intelligent control system will also be compared to the existing PID controller in terms of the variables stated.

5.3

Data Collection and Training of the Neural Network

The data will be provided by Scania and includes sensor measurements from real truck test drives. The data contains measurements of engine Rotations Per Minute (RPM), oil temperature and oil pressure. The neural network training will be done offline since the required resources on the embedded hardware should be kept to a minimum if such a system were to be incorporated in a real truck. The computers in the trucks currently do not have high processing capabilities, and it is therefore of interest to make the neural network as computationally cheap as possible. Several AI algorithms will be evaluated. First, GA will be evaluated on all models. The second algorithm that will be evaluated is DE with the mutation method DE/rand/1. Finally, the last algorithm that will be evaluated is DE with DE/current-to-pBest/1 as the mutation method. All algorithms will be trained on the tree models with 200 generations as a termination condition.

(28)

Problem formulation/ Hypothesis Litterature study Sufficient information? Implementation Modeling of system Development of control system Test of model Data identification

Does the model represent the real

conditions? AI - training

Test control system on model

Does the control system work as intended?

Simulate the whole

system Thesis conclusion

No Yes No Yes No Yes

Figure 11: Flowchart of the methodology in this thesis work. Where green indicates the problem formulation and related work. Red indicates a quality check, blue indicates the implementation and yellow indicates tests.

5.4

Model Creation

The system was modelled in Simscape due to the graphical interface keeping the complexity of the model down. This both improves the ability to debug the code and hand over the code to another user. However, the use of Simscape, and more specifically the Hydraulic Domain, imposed the restriction of not being able to change the temperature of the oil during the simulation run. Another similar model was then constructed in the Thermal Liquid Domain. It was then noted that the blocks in the new model required more parameters specified, increasing the complexity of the model. Even still, the temperature of the oil could not be adjusted directly. The heat sources and losses had to be modeled, together with the associated thermal mass. The model in the Thermal Liquid Domain was then deemed unfeasible to complete in time, and development ceased. Besides the increased parameter selection in the settings, other differences exist. Examples of differences are the input ports for the Thermal Domain in the components in the Thermal Liquid Domain and the nonexistence of some equivalent blocks between the domains.

The controller parts of the models were done using Simulink. Two versions were made for adjusting the PID values. One with a NN and one with lookup tables configured by hand. The weights of the NN were changed by a series of optimization algorithms as stated in section5.5. The Hydraulic Domain model was constructed to be structured graphically similar to Figure1.In total, there will be four different variants of the model, denominated A, B, C, and D, as the model was

(29)

improved in parallel to the training of the network. Model A is a simplified model without pipe connections and simplifications made to the valve openings. Model B contain pipes, and the valve has openings more similar to a possible system. Model C is similar to model B but with different parameter settings for the control chamber and VDVP. It is also unique in the aspect that it was tested with and without a feed forward controller. Model D is the most advanced model that accounts for the mass and dampening of the oil in the valve. Another reason for testing multiple model versions is the hypothetically reduced runtime of a simulation of lower complexity. The relationship between the quality of the training and the complexity of the model will be evaluated. Model C can be seen in Figure12.

The oil is drawn from the oil pan through a pipe and is then pumped through the oil pump. If the oil pressure exceeds 10 bar in this section, a pressure relief valve is opened, and some oil returns to the oil pan. Otherwise, the oil continuous onward through more pipes and then reaches the oil pressure sensor. This sensor is used as input to the controller of the oil control system, described in Section5.4.1. The oil then split in two directions. The majority of the oil passes through a pipe that represents the engine of the truck and the associated pressure and flow restrictions. After the pipe, the oil is returned to the oil pan. The rest of the oil passes through more pipes and then reaches port P of the valve, denoted Pump Flow in the figure. The valve is described in Section5.4.2. The oil from port A, denoted Control Chamber Flow in the figure, in the valve is connected to the control chamber via a series of pipes. The oil from port T, denoted Tank Flow in the figure, is connected to the oil pan through a pipe wide enough not to cause a pressure differential.

(30)

O il p ro pe rtie s C on tro l S ig na l P um p F lo w C on tro l C ha m be r F lo w Ta nk F lo w V alv e s ub sy ste m O il p re ss ur e s en so r f(x ) = 0 O il D is pla ce m en t C on tro l C ha m be r s ub sy ste m pip e v alv e-oil p an en gin e le ak ag e c ha m be r-p um p pip e p um p-filt er va lv e co ntr ol ch am be r pip es v alv e-co ntr ol ch am be r s ub sy ste m pu m p va lv e pip es fil te r-v alv e s ub sy ste m O il F ilte r oil p re ss ur e pw m s ig na l C on tro lle r s ub sy ste m pip e o il p an -p um p ge ar in g

(31)

5.4.1 Control System Modeling

The reading from the pressure sensor is subtracted from a reference pressure imported as a timeser-ies. This results in a pressure error for each given point in time. Suppose the variant of the model that contains the manually tuned PID controller is used. In that case, the error is input into both a subsystem that adjust the weights of the PID, depending on the error and engine temperature, and the PID itself. The sampling frequency of the PID is 20 Hz. The PID then output a signal between 0 and 1000, which is then divided by 1000 and represent the duty cycle of a PWM signal. The frequency of the PWM signal varies depending on the temperature, with a higher frequency if the temperature is higher. The PWM signal is inverted, and then output from the controller and input in the valve control circuit, described in section5.4.2. The control system is illustrated in Figure13.

(32)

P ID (z ) P I D 1-D T (u ) 1 oil p re ss ur e 2 pw m s ig na l N N E T In pu tD ata D uty c yc le O il p re ss ur e r eg ula tio n n eu ra l n etw or k 2-D T (u ) u1 u2 m ea ss ur ed p re ss ure m ea ss ur ed p re ss ure in ve rs e oil p re ss ur e b ar P ID o utp ut er ro r er ro r co ntr ol ou t P ID 2 re fe re nc e

Figure 13: The control system of model C modelled in Simulink. The blue square is the NN. The feed forward controller of model C is the the lookup table under the PID.

(33)

5.4.2 Valve Modeling

The PWM from the control system is used to control a switch block. Once the switch is closed, DC is allowed to flow through a resistor and a coil. When the current flows through the coil, a magnetic field is created, which moves the spool of the valve. This is modeled as a solenoid block. The oil enters the valve from the pump through the P orifice. This opening is modeled using a fixed orifice block. The oil then flows through two variable orifice blocks that are controlled by the control system, described in Section5.4.1. One orifice opens with an extension of the spool, and one orifice closes. The variable orifices represent the area that opens to allow oil to flow through the opening when the spool unblocks the orifice. Between the variable orifice blocks, the oil flow split. One part flows through the orifice A toward the control chamber of the pump, and the other part continues through the second variable orifice block. The oil then leaves the valve through orifice T and returns to the oil pan through a pipe. The valve code is shown in Figure14.

Position of pin 3 Control Chamber Flow 1 Control Signal 2 Pump Flow 4 Tank Flow Spool position sensor P A T P-A A-T

Figure 14: The valve system for model C modelled in Simscape.

5.5

Artificial Intelligence Controller

As evident by Section3.3, an intelligent controller is suitable for usage in a slow nonlinear system, as opposed to a traditional PID controller. Traditional PID controllers are hard to tune and do not perform well in applications where an oil pump is to be controlled [24]. The usage of a fuzzy PID controller is, according to Soyguder et al. [25], able to run on the same hardware as a traditional PID. This is an important aspect, as a finalized product by Scania should be able to be mass-produced and is thus desired to be as cheap as possible. This would also keep the complexity of the system to a minimum. A combination of fuzzy PID controllers and NN has shown improved

(34)

results, compared to only using fuzzy PID controllers [24]. Fuzzy logic needs linguistic terms, and it was concluded that these parameters would be hard to define. Therefore, this thesis work will focus on a combination of a neural network and GA. Another method with a neural network and DE will also be investigated to retrieve the best combination of weights for the neural network and thus the most optimal PID parameters.

5.5.1 Feed Forward Neural Network

The NN was construed using MATLAB and the Neural Network toolbox. The NN is a shallow feed forward net consisting of three layers. The input layer consists of five neurons corresponding to the input parameters, oil temperature, engine RPM, engine torque, oil pressure and the error. The error is the difference between the oil pressure reference and the actual oil pressure. The hidden layer of the NN consists of eight neurons and use a logarithmic sigmoid activation function. The third and last layer is the output layer and consists of three neurons, representing the PID controller Kp, Ki, Kd. The architecture of the NN can be seen in Figure15. The weights and biases of the NN

are initialized using the Nguyen-Widrow initialization method since it is one of the most commonly used methods as described in [15].

Oil temperature Engine RPM Oil pressure Engine torque Error Kp Ki Kd Hidden layer Input layer Output layer

Figure 15: Architecture of the FFNN developed in this work.

5.5.2 Genetic Algorithm

One method of optimized the FFNN’s weights and biases was using GA. The GA starts with an initialization of the population. In this case, each individual is a set of input, hidden and output weights. Each individual runs the simulation and outputs a set of PID values Kp, Ki, Kd. Each

individual’s performance is evaluated using a fitness function that calculates the root mean square error between the oil pressure reference and the measured oil pressure after the valve has been actuated. The fitness of all individuals is transformed into a weighted type of fitness, meaning that the best performing individuals in the population have the largest fitness. In order to evolve the population, crossover is needed. The crossover method used is a simple single point crossover where a crossover point is randomly selected, meaning a point where the weights of two individual are to be exchanged as seen in Figure6, this is done for all layers. By performing the crossover, attributes

(35)

Model type Population Size Number of offspring Number of generations

A 80 30 100

B 100 30 100

C 100 30 200

D 100 30 100

Table 3: User parameters used during training of GA.

from these individuals are merged into a new set of input, hidden, and output weights creating a new individual called offspring. All the offspring are then introduced into the population by replacing the worst-performing individuals in the population and thus creating a new generation. Mutation is needed in order to avoid local optima. The mutation method is based on randomness, where each offspring has a chance to mutate. The mutation chance was set to 30%. If an individual mutates, another randomly generated value between 1 and 10 is generated, determining the number of weights that should be mutated. The values of mutated weights are derived from equation27.

MutatedWeight = (a + (b − a) ∗ rand) (27) Where a and b are equal to −2 and 2 respectively, since the activation function tansig has an input range ∈ [−2, 2] [35], and rand is a randomly generated value ∈ [0, 1].

The process of simulation, evaluation, selection and mutation is iterated for a given amount of generations. In this case, it was set to 200 generations.

The best fitness of the algorithm should improve or maintain the same value as the previous iteration. This was not the case when the GA was used for training the NN on the simulation model, as seen in Section6. Therefore, another similar training method for the NN was needed. The method needed to be similar in order not to have to remake large parts of the code. Thus, DE was also implemented. The user defined parameters can be found in Table3. Contrary to what was intended, model A was time insensitive to train and therefore was assigned a smaller population size to improve the runtime of the training. Model C was allowed to run for more generations due to the fast runtime.

5.5.3 Differential Evolution

The DE algorithm was designed following the methods described by Storn and Price, Leon et al., and Zhang and Sanderson [29], [17], [36]. In total, two variants of DE were designed using different mutation methods. They were DE/rand/1 and DE/current-to-pBest/1 and are explained in Section2.8.2. During training, the DE had most of the parameters set equally. Due to time constraints during the training of the models, not every model was trained with DE/rand/1. In Table4all the user defined parameters for each of the four models can be seen.

Model type Generations Mutation method Np F Pc p lb ub

A 100 DE/rand/1 80 0.9 0.9 - -2 2 A 100 DE/current-to-pBest/1 80 0.9 0.9 0.1 -2 2 B 200 DE/rand/1 100 0.9 0.9 - -2 2 B 200 DE/current-to-pBest/1 100 0.9 0.9 0.1 -2 2 C 200 DE/rand/1 100 0.9 0.9 - -2 2 C 200 DE/current-to-pBest/1 100 0.9 0.9 0.1 -2 2 D 200 DE/current-to-pBest/1 100 0.9 0.9 0.1 -2 2

(36)

6

Results

In this section, the results from the AI controllers compared to the traditional PID controller on the three different models A, B and C will be shown. The results of the training are followed by the progression of the training for GA and DE/current-to-pBest/1. DE/rand/1 is excluded since saving of the best individuals of previous generations was not done properly.

6.1

Model A

In Figure16the results of the algorithms implemented on model A can be seen. In Figure17and18

the best fitness for each generation during training can be seen for GA and DE/current-to-pBest/1 respectively. 0 20 40 60 80 100 120 140 160 180 200

Time (s)

0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000

Pressure (mbar)

Comparison of Controllers - Model A

GA Pressure DE/rand/1 Pressure

DE/current-to-pBest/1 Pressure Lookup Table Pressure Oil Pressure Reference

Figure 16: Comparison between all different algorithms used on model A, where the purple line is the oil pressure reference that the algorithms are trying to follow.

(37)

0 10 20 30 40 50 60 70 80 90 100 Generations 3.4 3.6 3.8 4 4.2 4.4 4.6 4.8 5 5.2 Best Fitness 10-4 GA model A

Figure 17: Best fitness for each generation of GA model A, where a lower value is better.

0 20 40 60 80 100 120 140 Generations 320 340 360 380 400 420 440 460 Best Fitness

DE current to pBest model A

Figure 18: Best fitness for each generation of DE/current-to-pBest/1, where a lower value is better.

(38)

6.2

Model B

In Figure 19 the results of the algorithms implemented on model B can be seen. In Figure 20

the best fitness for each generation during training can be seen for DE/current-to-pBest/1. The training of GA is not displayed since it was not logged properly.

0 20 40 60 80 100 120 140 160 180 200 Time (s) 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Pressure (mbar)

Comparison of Controllers - Model B

GA Pressure DE/rand/1 Pressure

DE/current-to-pBest/1 Pressure Lookup Table Pressure Oil Pressure Reference

Figure 19: Comparison between all different algorithms used in model B, where the purple line is the oil pressure reference that the algorithms are trying to follow.. Note that GA, DE/rand/1 and DE/current-to-pBest/1 are all the same.

0 20 40 60 80 100 120 140 160 180 200 Generations 1254 1254.5 1255 1255.5 1256 1256.5 1257 1257.5 1258 1258.5 1259 Best Fitness

DE current to pBest model B

Figure 20: Best fitness for each generation of DE/current-to-pBest/1, where a lower value is better.

(39)

6.3

Model C

In Figure21the results are shown for the AI algorithms trained and evaluated on the model with the feed forward controller enabled. Figure22display the trained NN and the lookup table PID evaluated without the lookup table. In Figure 23 the results for the AI algorithms trained and evaluated without the feed forward control are shown. In Figure24the best fitness for GA during training can be seen, and in Figure25the progression of the DE/rand/1 training can be seen.

0 20 40 60 80 100 120 140 160 180 200 Time (s) 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Pressure (mbar)

Comparison of Controllers - Model C - Feed Forward Control

GA Pressure DE/rand/1 Pressure

DE/current-to-pBest/1 Pressure Lookup Table Pressure Oil Pressure Reference

Figure 21: Comparison between all different algorithms implemented in model C, where the purple line is the oil pressure reference that the algorithms are trying to follow. Note that the control methods all produced the same result.

Figure

Table 1: Colors of the domains in Simscape used in this work.
Figure 8: Example of binomial crossover with D = 5, δ = 3 and P c = 0.8 . The vector to the right is the trial vector that is to be generated based on the random numbers in the purple vector.
Figure 9: Example of the greedy selection method on a minimization problem with random numbers.
Figure 10: Model of the oil system explained by Nahim et al.
+7

References

Related documents

the armed groups, cults and militias, the Nigerian state and the military, local political elites, youth, ethnic identity movements/associations, oil multinationals (MNCs),

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Syftet eller förväntan med denna rapport är inte heller att kunna ”mäta” effekter kvantita- tivt, utan att med huvudsakligt fokus på output och resultat i eller från

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i

Detta projekt utvecklar policymixen för strategin Smart industri (Näringsdepartementet, 2016a). En av anledningarna till en stark avgränsning är att analysen bygger på djupa

DIN representerar Tyskland i ISO och CEN, och har en permanent plats i ISO:s råd. Det ger dem en bra position för att påverka strategiska frågor inom den internationella