Safe and energy efficient predictive cruise control behind a slow-moving vehicle Model predictive control for energy optimization Master’s thesis in Systems, Control and Mechatronics Johnny Truong Venkatraman Nagaraj Department of Electrical Engineering CHALMERS UNIVERSITY OF TECHNOLOGY Gothenburg, Sweden 2019 ii Master’s thesis 2019 Safe and energy efficient predictive cruise control behind a slow-moving vehicle Model predictive control for energy optimization Johnny Truong Venkatraman Nagaraj Department of Electrical Engineering Chalmers University of Technology Gothenburg, Sweden 2019 Safe and energy efficient predictive cruise control behind a slow-moving vehicle Model predictive control for energy optimization Johnny Truong Venkatraman Nagaraj © Johnny Truong, Venkatraman Nagaraj, 2019. Supervisor: Esteban Gelso, Volvo Group Trucks Technology Examiner: Nikolce Murgovski, Department of Electrical Engineering Master’s Thesis 2019 Department of Electrical Engineering Chalmers University of Technology SE-412 96 Gothenburg Telephone +46 31 772 1000 Cover: The Volvo Concept Truck [1] Typeset in LATEX Gothenburg, Sweden 2019 v Safe and energy efficient predictive cruise control behind a slow-moving vehicle Model predictive control for energy optimization Johnny Truong Venkatraman Nagaraj Department of Signal and Systems Chalmers University of Technology Abstract The goal of this project is to develop an MPC (Model Predictive Control) algorithm which minimizes energy consumption for a controlled hybrid electrical vehicle while keeping a safe distance to a leading vehicle. The algorithm consists of two main parts: speed prediction and optimization. An observer is first developed to estimate the power capability of the leading vehicle which is used to predict its driving behaviour. With the information of leading vehicle’s driving, a reference speed trajectory can then be obtained for the controlled vehicle. The controller then minimizes the fuel consumption by finding the optimal control and state trajectories based on the reference speed and the road topography. The control signals include engine power, mechanical braking and power from electric machine. The states include traveling time, speed and battery energy. The work was conducted in Matlab where the control-algorithm was tested in simu- lated driving scenario with measurement data of a heavy-duty leading vehicle driving on a known topography. The obtained results showed decreased fuel consumption with the hybrid electric vehicle compared to the conventional vehicle and manages to keep safe distance from another vehicle in front. However, the significant fuel reduction also exceeds results from previous works related to energy optimization of hybrid electrical vehicle. More measurement data is needed to further validate the performance of the control algorithm. Keywords: Model Predictive Control, energy optimization, hybrid electrical vehi- cle vi Acknowledgements We would like to thank both our examiner, Nikolce Murgovski, and our supervisor, Esteban Gelso, for giving us the opportunity to work on this thesis. We would also like to thank the previous master thesis worker Mattias Hovgard who answered our questions and problems during our work. Johnny Truong, Venkatraman Nagararaj,Gothenburg, June 2019 viii x Contents List of Figures xiii List of Tables xvii 1 Introduction 1 1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4 Delimitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.5 Report outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Theory 5 2.1 Concept of MPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Convex optimization problem . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Vehicle model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3.1 ICE model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3.2 EM model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3.3 Battery model . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3.4 Safety constraint . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.3.5 Aerodynamic drag model . . . . . . . . . . . . . . . . . . . . . 15 3 Methods 17 3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2 Formulation of optimization problem . . . . . . . . . . . . . . . . . . 18 3.3 Control scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.4 Variable change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.5 Linearization and approximations . . . . . . . . . . . . . . . . . . . . 21 3.5.1 ICE model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.5.2 EM model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.5.3 Battery model . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.5.4 Aerodynamic drag model . . . . . . . . . . . . . . . . . . . . . 23 3.6 Reference speed of host vehicle . . . . . . . . . . . . . . . . . . . . . 24 3.6.1 Leading vehicle observer . . . . . . . . . . . . . . . . . . . . . 24 3.6.2 Noise disturbance . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.6.3 Leading vehicle reference speed predictor . . . . . . . . . . . . 28 3.6.4 Host vehicle reference speed predictor . . . . . . . . . . . . . . 28 3.7 Energy management . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 xi Contents 3.8 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.8.1 Power split . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.8.2 Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . 33 3.8.3 Battery costate optimization . . . . . . . . . . . . . . . . . . . 33 3.9 Summary of MPC-algorithm . . . . . . . . . . . . . . . . . . . . . . . 35 4 Results 37 4.1 Validation of control algorithm without LV . . . . . . . . . . . . . . . 38 4.1.1 CV without LV ahead . . . . . . . . . . . . . . . . . . . . . . 38 4.1.2 HEV without LV ahead . . . . . . . . . . . . . . . . . . . . . 40 4.2 Validation of control algorithm with LV . . . . . . . . . . . . . . . . . 41 4.2.1 LV observer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.2.2 CV with LV ahead . . . . . . . . . . . . . . . . . . . . . . . . 42 4.2.3 HEV with LV ahead . . . . . . . . . . . . . . . . . . . . . . . 44 4.3 Length of prediction horizon . . . . . . . . . . . . . . . . . . . . . . . 46 4.4 No observer available . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.5 Benefit of HEV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 4.6 Benefit of having prediction horizon . . . . . . . . . . . . . . . . . . . 53 5 Discussion 55 5.1 Leading vehicle observer and speed prediction . . . . . . . . . . . . . 55 5.2 Measurement data and road topography . . . . . . . . . . . . . . . . 56 5.3 Choice of prediction horizon . . . . . . . . . . . . . . . . . . . . . . . 56 5.4 Ethic and sustainability . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.5 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.5.1 Measurement data . . . . . . . . . . . . . . . . . . . . . . . . 57 5.5.2 Computation time . . . . . . . . . . . . . . . . . . . . . . . . 57 5.5.3 Model and optimization controller . . . . . . . . . . . . . . . . 57 5.5.4 Road traffic and environment . . . . . . . . . . . . . . . . . . 57 6 Conclusion 59 Bibliography 61 xii List of Figures 2.1 Simple block diagram of MPC. . . . . . . . . . . . . . . . . . . . . . . 5 2.2 The powertrain configuration of host vehicle which shows gear box, fi- nal drive, ICE (Internal Combustion Engine), EM (Electric Machine) and their power sources. ICE and EM are connected to same gears. . 6 2.3 Fuel consumption is shown as the function of torque for various engine speeds. The measurements are shown in black and the fitted model is shown as contour. The numbers on the graphs represent the engine speed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.4 Torque limits and efficiency contour of ICE are shown as the function of engine speed. The original torque limits are in black and fitted torque limits are in red. The green line represents the maximum power delivered by ICE. . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.5 Longitudinal force that engine can deliver as function of vehicle speed for different gears. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.6 Torque limits as function of EM speed. The efficiency percentage is shown as contour, original torque limits are in black and fitted torque limits are in red. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.7 Electrical power consumed by EM is shown as the function of torque for various EM speeds. The original model is shown in black and the fitted model is shown as contour. . . . . . . . . . . . . . . . . . . . . 13 2.8 The leading vehicle and host vehicle driving on road with hills which is 7km long. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.9 Comparison between measurement data and fitted model of aerody- namic drag reduction fd(dLH). . . . . . . . . . . . . . . . . . . . . . . 15 3.1 The control scheme divided into two layers, energy and power man- agement. Energy management estimates the optimal trajectories for v and λB, which are then sent to the power management. The power management in turn estimates the optimal trajectories for γ and χ, which are then sent to energy management to estimate its optimal state and control trajectories again. . . . . . . . . . . . . . . . . . . . 19 3.2 Acceleration as function of vehicle speed. The blue star points repre- sent ameas and the black lines represent the speed-clusters. . . . . . . 25 3.3 Acceleration as function of vehicle speed. The blue star points repre- sent ameas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 xiii List of Figures 3.4 Acceleration ameas as function of vehicle speed. The black line is the highest possible amax. The points with red circles are considered as outliers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.5 Acceleration ameas after using the noise reduction approach. . . . . . . 27 3.6 Flow chart of the battery co-state update. The number of update is denoted by c. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.7 Flow chart of the implemented MPC-algorithm . . . . . . . . . . . . 36 4.1 Artificial driving cycle with a road length of 7km. The horizontal axis represents the traveled distance and the vertical axis represents the altitude. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4.2 Road between Alingsås and Gothenburg. The length of the driving cycle is 40.1km. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.3 The state trajectories of CV and the speed limits. The ICE-state is not included since the engine is always on for CV. . . . . . . . . . . . 39 4.4 The control trajectories of CV and ICE limits. EM force and its limits are not displayed since they are not available for CV. . . . . . . . . . 39 4.5 The state trajectories of HEV, including ICE-state and SOC, as func- tion of traveled distance. The limits for SOC and speed are also displayed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.6 The control trajectories of HEV, including EM force, as function of traveled distance. The limits for ICE and EM are also displayed. . . . 41 4.7 The various estimated acceleration limits as function of vehicle speed. The estimation of limits depend on the traveled distance of leading vehicle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.8 The state trajectories of CV as function of traveled distance and the speed limits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.9 The control trajectories of CV as function of traveled distance and the ICE limits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.10 The time gap between the traveling times of leading vehicle and host vehicle (CV) as function of traveled distance. . . . . . . . . . . . . . . 44 4.11 The state trajectories of HEV as function of traveled distance. The limits for SOC and speed are also displayed. . . . . . . . . . . . . . . 45 4.12 The control trajectories of HEV as function of traveled distance. The limits for ICE and EM are also displayed. . . . . . . . . . . . . . . . . 45 4.13 The time gap between the traveling times of leading vehicle and host vehicle (HEV) as function of traveled distance. . . . . . . . . . . . . . 46 4.14 The actual and predicted speed of leading vehicle and its assumed desired speed when the prediction is done once for the entire road. . . 48 4.15 Time gaps for different lengths of prediction horizon as function of traveled distance for CV. Note that the rest of the gap represented by the black line is not displayed as it increases significantly over traveled distance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.16 Time gaps for different lengths of prediction horizon as function of traveled distance for HEV. . . . . . . . . . . . . . . . . . . . . . . . . 49 xiv List of Figures 4.17 The control trajectories as function of traveled distance when the observer is not available. . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.18 The time gap as function of traveled distance when the observer is not available. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.19 The predicted speed trajectory and the assumed desired speed of the leading vehicle for each sample along with the actual speed trajectory when observer is not available. . . . . . . . . . . . . . . . . . . . . . . 51 4.20 The predicted speed trajectory and the assumed desired speed of the leading vehicle for each sample along with the actual speed trajectory when observer is used. . . . . . . . . . . . . . . . . . . . . . . . . . . 52 4.21 Fuel consumption of CV and HEV for different lengths of prediction horizon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 4.22 The final travel time of HEV for different horizons and for the entire road (40.1km). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 4.23 The fuel consumed by HEV for different horizons and for the entire road (40.1km). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 4.24 The final travel time of CV for different horizons and for the entire road (40.1km). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 4.25 The fuel consumed by CV for different horizons and for the entire road (40.1km). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 xv List of Figures xvi List of Tables 4.1 Fuel consumption, final traveling time and tsum of CV for different prediction horizon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.2 Fuel consumption, final traveling time and tsum of HEV for different lengths of prediction horizon. . . . . . . . . . . . . . . . . . . . . . . 47 xvii List of Tables Variable Unit Description α rad Road slope s m Distance t s Time v m/s Vehicle speed ωE rad/s ICE speed ωM rad/s EM speed TE Nm ICE torque TM Nm EM torque FE N Engine force FM N EM force Fbrk N Mechanical braking force Febrk N Engine braking force Fair N Aero dynamic drag force PE W Engine power PM W EM power Pbrk W Mechanical braking power Pebrk W Engine braking power PTd W Total power loss PMd W Power loss from EM Ev J Vehicle kinetic energy EB J Vehicle battery energy λB kg/J Battery costate µ g/s Fuel consumption γ - gears χ - ICE-state uγ - Gear control input uχ - ICE state control input dLH m Distance between leading and host vehicle xviii 1 Introduction Transportation of freight by road plays an important role in the modern global mar- ket. In our daily lives, products are seen everywhere which have been delivered by trucks from various industries. From 2007 to 2016, the total yearly freight being transported by road is approximately 75% in the EU [2] and about 70% in the US [3]. However, the high demand for transportation of freight by road leads to both environmental and financial issues. Despite representing a minority of vehicles on road in the EU, heavy trucks are responsible for approximately 30% of the CO2 emissions according to the International Council on Clean Transportation [4]. Ac- cording to OECD [5], the statistics show that the amount of pollutants emitted by burning every gram of the heavy vehicle fuel and the effects of it are increasing. To address this issue, one solution is to use a PCC (Predictive Cruise Control) which uses information of the road topography and surrounding traffic to predict the optimal speed of the truck [6]. For example, when the vehicle anticipates an uphill on the road that lies ahead, it can start decreasing its speed before reaching the top and then build up the speed when rolling downhill. Thus, more fuel is saved and less energy from applying the service brake is wasted. Despite this, energy consumed through engine brake is inevitable and service brake may still need to be applied when traveling downhill. This solution can therefore be further improved by using an HEV (Hybrid Electrical Vehicle) which includes an additional power source, electric machine (EM). The HEV can use it for braking and converting the kinetic energy into electric energy, which is stored in a battery [7]. The stored energy can later be used for propulsion of the vehicle along with the power from internal combustion engine. This also allows the engine to be turned off during the periods of travel when the vehicle only relies on the electric machine, which reduces the fuel consumption even further. However, the control strategy of HEV is more complex compared to a conventional one as it introduces more states and control signals which must be considered. The additional states include the battery energy and the state of engine (either on or off) and the additional control signals include the power from the electric machine and the input for deciding whether the engine should be on or off. 1 1. Introduction 1.1 Background There are several works related to energy optimization of conventional vehicle as well as HEV. One of the earlier projects worked on optimizing a heavy diesel truck with DP (Dynamic Programming) and MPC (Model Predictive Control) [8]. However, the downside with DP is that the computation time grows exponentially with the number of states and control signals [9]. This may be a problem for an HEV as more states and control signals must be considered compared to a conventional one. In the project presented in [10], a control strategy for a hybrid long-haul truck was examined. In that project, an MPC was developed which consisted of three lay- ers. The first layer optimized the energy of the two power sources in the vehicle by quadratic programming method. The second layer is solved by dynamic pro- gramming method where the integer states such as gear and the state of internal combustion engine were optimized. The obtained control signals and states were used for the current instance in the third layer. Their results showed that up to 4% of fuel could be saved while allowing the vehicle speed to vary around ± 5 km/h by minimizing the service braking. Another work was a master thesis which presented the optimal control strategy for multiple HEVs traveling in platoon [11]. Their control strategy was a predic- tive CACC (Cooperative Adaptive Cruise Control) which utilized road information to optimize the vehicle speed and reduce the fuel consumption of the vehicle pla- toon. Their optimization problem was divided into smaller subproblems, which were solved in two layers. The first layer was the energy management which used convex optimization method and the second layer was the power management which used dynamic programming method. With their implemented control algorithm, their result showed that the average fuel consumption for each vehicle could be reduced by 10% with a platoon of four HEVs compared to a single HEV. For this thesis, the predictive cruise control strategy of an HEV driving on a hilly terrain is further examined. However, in this project, an uncontrolled leading vehicle, driving in front of the controlled host vehicle is also considered. Therefore, the driving behaviour of the leading vehicle must also be predicted to ensure that the host vehicle keeps a safe distance to it. Prediction of a leading vehicle by using MPC has previously been investigated in [12]. In their work, based on driving data obtained by experiments on an urban road with traffic signals, a prediction model of leading vehicle was created which estimated its acceleration/deceleration. By using the information of the predicted driving behaviour of the leading vehicle and the traffic states, their control algorithm could find optimal control input for the host vehicle while still keeping a safe distance to the leading vehicle. However, when driving on a hilly terrain, the heavy-duty leading vehicle may drop speed due to its power limit. Therefore, an observer needs to be developed in this thesis. By collecting measurement data of the leading vehicle, the observer can then 2 1. Introduction estimate the power limit of the leading vehicle which is used to determine its speed trajectory ahead. 1.2 Purpose For this project, an MPC algorithm is developed to decrease the energy consump- tion of the controlled vehicle while ensuring a safe distance is kept to leading vehicle ahead. As it is assumed that there is no vehicle-to-vehicle communication, an ob- server needs to be developed which can estimate parameters such as mass and power to mass ratio of the leading vehicle to predict its driving behaviour. 1.3 Objective The objective of this thesis is to develop an MPC algorithm to minimize the fuel consumption by using an already existing control algorithm as starting point for the development of MPC. The work is divided into the following main tasks: • Design and implement an observer for the host vehicle in order to predict the behaviour of a leading vehicle, including its velocity trajectory. • Implement an MPC algorithm. • Evaluate the performance of the MPC algorithm. 1.4 Delimitations Only one leading vehicle in front of the host vehicle is present in driving scenarios and perfect weather condition is assumed. Other traffic or obstacles are therefore not taken into consideration. The optimisation is only carried out on acceleration and braking. Therefore the steering of host vehicle is not taken into account. The computation time of the control algorithm is not considered. 1.5 Report outline The report starts by describing the necessary theory in Chapter 2, which includes an overview of MPC and the physical model of the vehicle. In Chapter 3, the design of observer, problem formulation and control strategy are explained. In Chapter 4, the results obtained in the thesis are presented, which are discussed in Chapter 5. The report ends with the conclusion in Chapter 6. 3 1. Introduction 4 2 Theory In this chapter, the necessary theories to understand the thesis are presented. The basic concept of MPC is explained. The vehicle model is introduced as well. 2.1 Concept of MPC MPC is a control method that has been applied in industries since late 70s [13]. It is also known as receding horizon control as its concept is based on the receding horizon idea. Unlike most controllers, MPC can effectively handle systems with multiple inputs and outputs which might be depended on each other [14]. Another big advantage with MPC is that constraints can be put for the control signals and the states. Figure 2.1: Simple block diagram of MPC. The procedure of MPC shown in Figure 2.1 can be summarized by the following steps [14][15]: 1. At current sample instance k, the output signals y(k) are predicted with the process model for N instances ahead. The predicted output signals depend on the future control sequence over control horizon M . 2. Based on formulated cost function, objective and constraints for an optimiza- tion problem, the optimal control sequence is obtained and chosen. 3. The first element of the optimal control sequence is applied, and the rest is discarded. The controller then moves to next instance (k + 1) and returns to 5 2. Theory step 1 to repeat the procedure. Normally, the length of control horizon M is set to be shorter than the length of prediction horizon N [15]. If that is the case, the rest of the control sequence after instance k +M is set as either u(k +M) or 0. 2.2 Convex optimization problem A standard form of convex optimization problem can be formulated as [15][16] minimize f(x) s.t. gi(x) ≤ 0, i = 1, 2, ..,m hi(x) = 0, i = 1, 2, .., p (2.1) where f is a cost function and x = {x1, x2, ...xn} represents the optimization vari- ables that should minimize f . The inequality and equality constraint functions are denoted by gi and hi, respectively. Both f and gi are convex, and hi are affine [15]. Another important property is that the local minimum is a global optimum. These properties described for convex optimization problem are important when formulating our optimization problem later. 2.3 Vehicle model Figure 2.2: The powertrain configuration of host vehicle which shows gear box, final drive, ICE (Internal Combustion Engine), EM (Electric Machine) and their power sources. ICE and EM are connected to same gears. The vehicle is modelled as a point mass that has the powertrain as illustrated in Figure 2.2, which is based on the HEV powertrain used in previous work by De- 6 2. Theory partment of Electrical Engineering at Chalmers University of Technology and Volvo Group Trucks Technology [10]. The powertrain is equipped with an ICE (Internal Combustion Engine) and an EM (Electrical Machine) which are connected to the same gear box and powered by fuel and battery, respectively. The clutch is respon- sible of switching between the EM and ICE. The vehicle model has three continuous states which are speed v, traveling distance s and battery energy EB. The model also involves two real valued discrete states, which are the ICE state χ and gear number γ. Thus, the model is a hybrid system with mixed real- and integer states and control signals. The longitudinal vehicle dynamic is modelled as mv̇(t) = FD(t)−mg sin(α)− Fair(v)− Frol(α) (2.2) where m is the mass of the host vehicle. The total traction force delivered to the wheels by ICE and EM is denoted by FD(t). The gravitational force is denoted by g and α is the slope of the road depended on the travel distance s(t), which in turn is depended on the travel time t. The force from the rolling resistance Frol and air resistance Fair are described by Frol(α) = mgcrcos(α) (2.3) Fair(v) = ρaAfcd 2 v2(t) (2.4) where cr is the rolling resistance coefficient, ρa is air density, Af is frontal area of the host vehicle and cd is the aerodynamic drag coefficient. As shown in Figure 2.2, in this parallel configuration the EM and/or ICE transmits mechanical power to wheels. This mechanical power balance is described as PE(t) + PM(t) + Pbrk(t) + PEbrk(t) = FD(t)v(t) + PTd(γ, χ, PE, PM, µγ, µχ) (2.5) where PTd(t) includes power loss due to shifts of gear and ICE and transmission losses. The braking powers Pbrk and PEbrk represent the power consumed from mechanical brake and engine brake, respectively. The power used for propulsion from ICE is denoted by PE(t), while the power from EM is denoted by PM(t). The electrical power balance is described as PB(t) = PM(t) + PMd(v, PM) + PBd(PB) + PA(t) (2.6) where PB(t) is internal battery power, PMd(v, PM) and PBd(PB) are power loss from EM and battery, respectively. The power consumed by auxiliary devices is denoted by PA(t), but it is neglected for this HEV model. The states of gear and ICE are defined as γ and χ, respectively, which can have the following values 7 2. Theory γ ∈ {1, ..., γmax}, χ ∈ {0, 1} (2.7) The values χ can have means it is either off (0) or on (1). Their states for next time instance (γ+, χ+) are described by γ+ = γ + µγ, χ+ = χ+ µχ (2.8) where µγ ∈ {−1, 0, 1} and µχ ∈ {−1, 0, 1} are the switch commands for gear and state of ICE, respectively. When the gear is switched or the state of ICE is changed, additional fuel will be consumed, which are defined as the cost terms Wγ and Wχ, respectively. 2.3.1 ICE model The fuel consumption of ICE, denoted by µ, as the function of engine speed and torque is formulated as µ(ωE(t), TE(t)) = a0+a1ωE(t)+a2ω 3 E(t)+a3ω 5 E(t)+a4ωE(t)TE(t)+a5ωE(t)T 2 E(t) (2.9) where a0−5 are constants used for fitting. By fitting the model with measurements, the best fitted model is to put a1 and a2 as 0. Figure 2.3 illustrates the fuel con- sumption of ICE for different engine speeds and how well the model fits the mea- surements. 0 100 200 300 400 500 600 700 Torque (Nm) 1 2 3 4 5 6 7 8 F u e l C o n s u m p ti o n ( g /s ) 800 1000 1000 1200 1200 1200 1400 1400 1400 1600 1600 1600 1800 1800 1800 20 00 2000 2000 800 1000 1000 1200 1200 1200 1400 1400 1400 1600 1600 1600 1800 1800 1800 2000 2000 2000 Measurements, speed (rpm) Approximated model, speed (rpm) Figure 2.3: Fuel consumption is shown as the function of torque for various engine speeds. The measurements are shown in black and the fitted model is shown as contour. The numbers on the graphs represent the engine speed. 8 2. Theory The speed and torque of ICE, denoted by ωE(t) and TE(t) respectively, are described by ω(t) = v(t)r(γ) (2.10a) TE(t) =  FICE(t) r(γ)η , if FICE(t) ≥ 0 FICE(t)η r(γ) , if FICE(t) < 0 ⇔ TE(t) = 1 r(γ)max { FICE(t) η , ηFICE(t) } (2.10b) where η is the transmission efficiency from engine to wheel and FICE is the force delivered by ICE which can either be used for propulsion (FICE ≥ 0) or braking (FICE < 0). ICE ratio, denoted by r(γ), is defined as r(γ) = rg(γ)rf Rw (2.11) where Rw is the radius of the wheels and rg is the gear ratio. The gear ratio of the differential gears between ICE and EM is denoted by rf. The torque limits of ICE are illustrated in Figure 2.4, where they are plotted as a function of engine speed with the efficiency. The Figure also includes the maximum power that ICE can deliver. 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 Speed (rpm) -600 -400 -200 0 200 400 600 800 T o rq u e ( N m ) 10 1015 1520 2025 2530 3035 35 36 36 37 37 38 38 38 39 3 9 40 4 04 1 41 4 2 Measurements Effieciency [%] Fitted torque limits Power limit Figure 2.4: Torque limits and efficiency contour of ICE are shown as the function of engine speed. The original torque limits are in black and fitted torque limits are in red. The green line represents the maximum power delivered by ICE. Converting engine speed and torque from Figure 2.4 to vehicle speed and force gives Figure 2.5 which illustrates the longitudinal force delivered by the engine to the wheels plotted as function of vehicle speed for different gear numbers. 9 2. Theory 20 40 60 80 100 120 140 160 180 200 220 Speed[km/h] -100 -80 -60 -40 -20 0 20 40 60 80 100 F o rc e [k N ] 2 3 4 5 6 7 8 9 10 11 12 2 3 4 5 6 7 8 9 10 11 12 Force per gear Force limits Figure 2.5: Longitudinal force that engine can deliver as function of vehicle speed for different gears. From now on, the propulsion (FICE ≥ 0) and braking force (FICE < 0) from ICE are referred as FE and FEbrk, respectively. The limit of FE(t) can be described by several constraints. The first one is estimated as function of vehicle speed which is formulated as FE(t) ≤ ( b1 + b2v 2(t)r2(γ) ) r(γ)η (2.12) where b1 and b2 are constant coefficients. The second one is that FE(t) should not exceed the maximum engine torque b0 FE(t) ≤ b0r(γ)η (2.13) The propulsion force is also limited by the maximum engine power PEmax FE(t) ≤ ηPEmax v(t) (2.14) However, the limit for FE, as shown in Figure 2.5, can be estimated by FEmax(t) = F0 + PEmax v(t) (2.15) where F0 is a constant used for fitting the limit. This limit can be used to determine whether the host vehicle is able to reach up to a certain desired speed or not. This 10 2. Theory is useful when predicting the speed trajectories of leading vehicle and host vehicle, which will be later described in Chapter 3. The last constraint is that FE(t) cannot be negative FE(t) ≥ 0 (2.16) The engine braking force FEbrk has two constraints. The first one is formulated as function of v(t) FEbrk ≥ ( c1 + c2v(t)2r(γ)2 ) r(γ) η (2.17) where c1 and c2 are constants used to fit the model. The last one is that FEbrk cannot be positive FEbrk ≤ 0 (2.18) Multiplying (2.12)-(2.16) and (2.17)-(2.18) with v(t) yields the expressions of con- straints in terms of power, which can also be further simplified as PE(t) ≤ ηPEmax (2.19a) PE(t) ∈ [ 0,min { b0, b1 + b2r 2(γ)v2(t) }] r(γ)ηv(t) (2.19b) PEbrk(t) ∈ [( c1 + c2v(t)2r(γ)2 ) , 0 ] r(γ) η v(t) (2.19c) 2.3.2 EM model Since ICE and EM are connected to the same gear box, they share the same gearing ratio (r). This also means that EM has the same speed as ICE (w). The expression of the torque of EM, denoted by TM(t), depends on whether EM is used for propulsion or generation as described by TM(t) =  FM(t) r(γ)η , if FM(t) ≥ 0 FM(t)η r(γ) , if FM(t) < 0 ⇔ TM(t) = 1 r(γ)max { FM(t) η , ηFM(t) } (2.20) where FM is the force delivered by EM to the wheels. Torque limits are shown as the function of EM speed in Figure 2.6. 11 2. Theory 0 500 1000 1500 2000 2500 3000 Speed [rpm] -1500 -1000 -500 0 500 1000 1500 T o rq u e [ N m ] 6060 60 6 0 60 60 7575 75 7 5 75 75 8282 82 8 2 82 82 8686 8 6 8 6 86 86 8888 8 8 8 8 88 88 8989 8 9 8 9 89 89 9090 9 0 9 0 90 90 9191 9 1 9 1 91 91 9292 9 2 9 2 92 92 9393 9 3 9 3 93 93 9494 9 4 9 4 94 94 95 95 9 5 95 95 96 9 6 96 Measurements Efficiency [%] Fitted torque limits Figure 2.6: Torque limits as function of EM speed. The efficiency percentage is shown as contour, original torque limits are in black and fitted torque limits are in red. The black lines represent the torque limits which are fitted by TMmax = min { d1, d2 + d3 ω(t) } (2.21a) TMmin = max { e1, e2 + e3 ω(t) } (2.21b) where d1, d2, d3, e1, e2 and e3 are constants used for fitting. The limits of FM are then expressed as FMmax(t) = min { d1, d2 + d3 v(t)r(γ) } r(γ)η (2.22a) FMmin(t) = max { e1, e2 + e3 v(t)r(γ) } r(γ) η (2.22b) Multiplying Equation (2.22) with v(t) gives the expression of EM limits in terms of power PMmax = min { d1, d2 + d3 v(t)r(γ) } r(γ)ηv(t) (2.23a) PMmin = max { e1, e2 + e3 v(t)r(γ) } r(γ)v(t) η (2.23b) 12 2. Theory The power losses of EM shown in Figure 2.7 is modelled as PMd(t) = h1ω(t) + h2ω 3(t) + h3ω(t)|TM(t)| (2.24) where h1, h2 and h3 are constants for fitted model. -1500 -1000 -500 0 500 1000 1500 Torque [Nm] -150 -100 -50 0 50 100 150 E l. p o w e r [k W ] 500 500 500 1000 1000 1000 15 00 15 00 20 00 20 00 2 5 0 0 2 5 0 0 3 0 0 0 3 0 0 0 500 500 500 1000 1000 1000 15 00 15 00 20 00 20 00 2 5 0 0 2 5 0 0 3 0 0 0 3 0 0 0 Measurements, speed (rpm) Fitted model, speed (rpm) Figure 2.7: Electrical power consumed by EM is shown as the function of torque for various EM speeds. The original model is shown in black and the fitted model is shown as contour. The total power consumed by EM is the sum of PMd and PM. 2.3.3 Battery model Battery energy EB(t) is regulated by the state ĖB(t) = −PB(t) (2.25) The state of charge, denoted by SOC, is defined according to Equation SOC(t) = EB(t) EBmax (2.26) where EBmax is the maximum energy capacity of the battery. The battery energy is limited by 13 2. Theory EB(t) ∈ [SOCmin, SOCmax]EBmax (2.27) where SOCmin and SOCmax are lower and upper bounds of SOC, respectively. The power loss of battery, denoted by PBd, is expressed as PBd(t) = R V 2 oc P 2 B(t) (2.28) where Voc represents constant open circuit voltage of the battery and R represents its constant resistance. 2.3.4 Safety constraint A typical scenario of host vehicle driving on a road with leading vehicle in front of it can be seen in Figure 2.8 where there are both up and downhills. Figure 2.8: The leading vehicle and host vehicle driving on road with hills which is 7km long. A safety constraint needs to be introduced to ensure that a safe distance can be kept between the host and leading vehicle. This can be formulated with their respective traveling times and add a time headway as described by t ≥ tL + ∆t (2.29) where tL and ∆t denote the traveling time of leading vehicle and the time headway, respectively. The safety constraint can also be formulated in traveling distance as described by dLH = sL(t)− s(t) ≥ ∆d (2.30) 14 2. Theory where sL and s are the longitudinal positions of the leading and host vehicle, re- spectively. Thus, dLH is the distance between the vehicles and ∆d is the minimum required distance between them. 2.3.5 Aerodynamic drag model Having a leading vehicle in front leads to an aerodynamic drag reduction of force for the host vehicle. The reduction depends on the distance between the vehicles, their respective speeds and geometries. The aerodynamic drag reduction is modelled as follows, Fair(v, dLH) = F 0 air(v(t)) (1− fd(dLH(t))) (2.31a) where F 0 air is the air resistance force experienced by host vehicle if there is no leading vehicle ahead. The air resistance force in turn is described by F 0 air(v) = ρaAfcd 2 v(t) (2.31b) The expression of aerodynamic drag coefficient for host vehicle, denoted by fd(dLH), is described by fd(dLH) = a1LHexp(−b1LHdLH(t)) + a2LHexp(−b2LHdLH(t)) (2.32) where the coefficients a1LH, a2LH, b1LH and b2LH are adjusted by fitting measurement data. Figure 2.9 illustrates the drag reduction of host vehicle where there is one leading vehicle present. The aerodynamic drag model described by Equation (2.32) fits the measurement data in Figure 2.9. It can be seen that the longer the distance between the vehicles is, the less air drag reduction fd there is. 0 10 20 30 40 50 60 vehicle to vehicle distance [m] 0.1 0.2 0.3 0.4 0.5 0.6 A ir d ra g r e d u c ti o n Measurement Fitted model Figure 2.9: Comparison between measurement data and fitted model of aerody- namic drag reduction fd(dLH). 15 2. Theory 16 3 Methods This chapter describes the procedure for predicting the behaviour of leading ve- hicle and the control strategy used to optimize the fuel consumption of the host vehicle. 3.1 Overview The controller is a PCC (Predictive Cruise Controller), which estimates the optimal trajectories [17][18][19] for the states and control signals of the host vehicle in order to minimize its fuel consumption. For this project, the controller is extended to an MPC where the control horizon M is set as the same length as the prediction horizon N . At current time instance t0, the optimal trajectories are predicted N instances ahead. Thus, the final instance of the predicted horizon becomes tf = t0 +N (3.1) The states are the speed v, traveled distance s, battery energy EB, gear γ and ICE state χ. The control signals are the powers PM, PE PEbrk, Pbrk, gear selection uγ and ICE selection uχ. A constant cruising speed v̄ is assumed to be set for the host vehicle. However, when the road topography and the behaviour of leading vehicle are taken into consideration, it might not be possible to maintain the set cruising speed for certain instances. To predict how the leading vehicle drives, some of its parameters need to be estimated first, including its power to mass-ratio, by a leading vehicle observer. The estimated parameters can then be used to determine if the cruising speed of leading vehicle, denoted by v̄L, is feasible or not (more on this in Section 3.6.1). Based on the road topography and the predicted driving of leading vehicle, a reference speed trajectory of host vehicle can then be obtained. With the reference speed trajectory and a formulated optimization problem, the controller estimates the optimal trajectories for the states and control signals of host vehicle, while ensuring a safe distance to the leading vehicle is kept. Only the first 17 3. Methods elements of the respective trajectories are applied. The rest is then discarded and MPC performs an update with the whole procedure repeated at next instance. 3.2 Formulation of optimization problem The optimization problem that the controller should solve is formulated as minimize J = ∫ tf t0 (χ(t)µ(·) +Wγ(·) +Wχ(·))dt subject to (3.2a) PE(t) + PM(t) + Pbrk(t) + PEbrk(t) = FD(t)v(t) + PTd(·) (3.2b) PB(t) = PM(t) + PMd(v, PM) + PBd(PB) (3.2c) mv̇(t) = FD(t)− Fair(v, dLH)−mg(sin(α) + crcos(α)) (3.2d) ĖB(t) = −PB(t) (3.2e) s(t0) = s0, s(tf) = sf (3.2f) ṡ(t) = v(t) (3.2g) v(t0) = v0 (3.2h) v(t) ∈ [vmin(t), vmax(t)] (3.2i) t ∈ [t0, tf] (3.2j) tf − t0 ≤ tmax (3.2k) PE(t) ≤ ηPEmax (3.2l) PE(t) ∈ [ 0,min { b0, b1 + b2r 2(γ)v2(t) }] r(γ)ηv(t) (3.2m) PM(t) ∈ [PMmin(v, γ), PMmax(v, γ)] (3.2n) Pbrk(t) ≤ 0 (3.2o) PEbrk(t) ∈ [( c1 + c2v(t)2r(γ)2 ) , 0 ] r(γ) η v(t) (3.2p) EB(t0) = EB0, EB(tf) ≥ EBf (3.2q) EB(t) ∈ [SOCmin, SOCmax]EBmax (3.2r) χ+(t) = χ(t) + uχ(t), χ(t) ∈ X, uχ(t) ∈ Uχ (3.2s) γ+(t) = γ(t) + uγ(t), γ(t) ∈ Γ, uγ(t) ∈ Uγ (3.2t) sL(t) ≥ s(t) + ∆d (3.2u) The terms Wγ and Wχ are the penalties added for changing gear-and ICE-state, respectively. This is to avoid shifting too frequently, as it is not desirable. Note 18 3. Methods that µ is multiplied with χ to ensure that fuel consumption only occurs when ICE is on. Since the constant efficiency η already includes the losses from the transmission, only the losses from shifting gear and ICE-state are included in PTd. This optimization problem has both real valued and integer states and variables, making it computationally heavy to solve. Therefore, the problem is divided into two layers, which will be later described in Section 3.3. Equation (3.2k) ensures that even if v deviates from the reference speed vr, the host vehicle should still be able to complete the horizon within the same time frame tmax as if it would have driven with vr. 3.3 Control scheme The optimization problem in Equation (3.2) is solved by two layers, which is illus- trated in Figure 3.1. This is a common method, which has been done in previous works [20][21][9]. Both layers minimize the cost function given in Equation (3.2a), but with different methods and in regards to different states/control signals. The top and bottom layer are referred as energy and power management, respectively. Figure 3.1: The control scheme divided into two layers, energy and power manage- ment. Energy management estimates the optimal trajectories for v and λB, which are then sent to the power management. The power management in turn estimates the optimal trajectories for γ and χ, which are then sent to energy management to estimate its optimal state and control trajectories again. 19 3. Methods After obtaining the reference speed trajectory vr, the energy management solves the optimization problem with convex optimization to estimate the optimal trajectories for the states v, t and EB as well as the control signals PE, PM, PEbrk and Pbrk. The energy management also estimates the battery costate trajectory λB, which will be further described in Section 3.8. Both v and λB are then sent to the power management. The power management estimates the optimal trajectories for the states EB,γ and χ as well for the control signals, including gear selection uγ and ICE-selection uχ, by using dynamic programming. The energy management then receives γ and χ to solve the optimization problem and send v and λB to the power management again. This process is repeated until a solution converges or until a maximum number of iteration has been reached. 3.4 Variable change As data of road topography are usually given in space coordinates, it is more bene- ficial to work in space domain than in time domain. Therefore, the travel distance s replaces the travel time t as the independent variable. Rewriting from time domain to space domain should be done according to t′(s) = dt ds = 1 v(s) (3.3) In space domain, it is easier to work with forces and kinetic energy instead of power and velocity. Therefore, the forces are given as FE = PE(s) v(s) , FM = PM(s) v(s) , FB = PB(s) v(s) , Fbrk = Pbrk(s) v(s) , FEbrk = PEbrk(s) v(s) (3.4) and the speed v(s) is replaced with kinetic energy Ev(s) according to Ev(s) = mv2(s) 2 (3.5) With the variable change, the equation of motion from (2.2) is rewritten as E ′v(s) = mv′(s)v(s) (3.6) The final instance for the predicted horizon described in Equation (3.1) is also modified as sf = s0 + Sp (3.7) 20 3. Methods where s0 and Sp are the current instance and prediction horizon in space domain, respectively. 3.5 Linearization and approximations By changing the variables, the constraints which had 1/v(s) will instead have 1/ √ Ev(s), as seen in the function ft(Ev) described by ft(Ev) = 1 v(s) = √ m 2Ev(s) (3.8) where t denotes the expression in Equation (3.3). However, as those constraints are not convex, this is an issue for the energy management which uses convex op- timization to solve the optimization problem. Therefore, the function needs to be linearized around the reference kinetic energy Êv(s), which is the kinetic energy when the host vehicle drives with reference speed vr. The linearization is described as f lin t (Ev) = ft(Êv(s)) + ∂ft ∂Ev ∣∣∣∣∣ Êv ∆Ev(s) (3.9) where ∆Ev(s) = Ev(s)− Êv(s). 3.5.1 ICE model The fuel consumption µ is modified as µ̃(·) = µ(·) v(s) (3.10) In the beginning of each MPC-update, the gear trajectory has not been updated before solving the optimization problem in energy management (more details de- scribed in Section 3.3). This might lead to infeasible force delivered by ICE, as the current gear trajectory may not have been properly selected to provide suffi- cient force to reach up to the updated speed v. Therefore, FE is reformulated and expressed as FE(s) = χ(s)FE1(s) + FE2(s) (3.11) 21 3. Methods where FE1 is the force from current gear trajectory and FE2 is an abstract force which can be delivered from any other chosen gear and state of ICE. The ICE-state χ is multiplied with FE1 to ensure that the force is only available when ICE is on. If FE1 is not sufficient to fulfill the constraint in Equation (2.12), FE2 is applied to cover up the rest of FE. The constraint for FE from (2.12) is subsequently reformulated as χFE1(s) + FE2(s) ≤ ηPEmax √ m 2Ev(s) (3.12) This however needs to be linearized as χFE1(s) + FE2(s) ≤ ηPEmaxf lin t (Ev(s)) (3.13) The constraint for FE1 is now described by Equation FE1(s) ∈ [ 0,min { b0, b1 + 2b2 m Ev(s)r2(γ) }] r(γ)η (3.14) The constraint for braking force FEbrk is also reformulated as FEbrk(s) ∈ [( c1 + 2c2 m Ev(s)r2(γ) ) , 0 ] r(γ) η (3.15) 3.5.2 EM model The wheel force from EM has the constraints described by FMmax(Ev) = min { d1, d2 + d3 r(γ) √ m 2Ev(s) } r(γ)η (3.16a) FMmin(Ev) = max { e1, e2 + e3 r(γ) √ m 2Ev(s) } r(γ) η (3.16b) However, these Equations are not convex. Therefore, they are linearized as described by Equation (3.9), which gives FMmax(Ev) = min { d1, d2 + d3 r(γ)f lin t (Ev(s)) } r(γ)η (3.17a) FMmin(Ev) = max { e1, e2 + e3 r(γ)f lin t (Ev(s)) } r(γ) η (3.17b) 22 3. Methods The force losses from EM, denoted by FMd, is described by FMd(s) = h1r(γ) + 2h2r 3(γ) m Ev(s) + h3 ∣∣∣∣∣max { FM(s) η , ηFM(s) }∣∣∣∣∣ (3.18) 3.5.3 Battery model The energy battery is reformulated as E ′B(s) = −FB(s) (3.19) Force dissipation from battery, denoted by FBd(s), is described by FBd(s) = R V 2 oc √ 2Ev(s) m F 2 B(s) ≈ R V 2 oc √ 2Êv(s) m F 2 B(s) (3.20) As seen in the Equation, the expression is simplified by replacing Ev(s) with Êv(s). This is to avoid multiplication of different variables, which would otherwise have made it into a non-convex optimization problem. 3.5.4 Aerodynamic drag model The air resistance force Fair in Equation (2.31a) is rewritten in space domain as Fair(Ev, dLH) = F 0 air(Ev(s)) (1− fd(dLH(s))) (3.21) The function fd(dLH(s)) is however both nonlinear and non-convex. Therefore, it is linearized around the distance between the vehicles estimated with their reference speeds, denoted by d̂LH(s)), as seen in F lin air (Ev, dLH) = caEv(s) ( 1− fd(d̂LH(s)) ) − caÊv(s) ( dLH(s)− d̂LH(s)) ) ∂fd ∂dLH ∣∣∣∣∣ d̂LH (3.22) The distance between leading and host vehicle, denoted by dLH, is calculated as dLH(s) = xL(s)− x(s) (3.23) where xL(s)and x(s) are the longitudinal positions of leading and host vehicles, respectively, as function of s. By assigning x(s) = s, the leading vehicle position can be given as x ′ L(s) = vL(s) v(s) (3.24) 23 3. Methods Assuming that leading vehicle speed vL(s) does not deviate much from its desired speed v̄L, Equation (3.24) is simplified as x ′ L(s) = v̄Lt ′(s) (3.25) By integrating Equation (3.25), xL can then be described by Equation xL(s) = v̄L(t(s)− t0) (3.26) Equation (3.23) can therefore be rewritten as dLH(s) = v̄L(t(s)− t0)− s (3.27) 3.6 Reference speed of host vehicle Before solving the optimization problem, a reference speed trajectory of the host vehicle, vr, needs to be obtained. In this section, the process for predicting vr is described. Only the force delivered by ICE is considered to make the comparison of host vehicle as CV (Conventional Vehicle) and as HEV more fair. 3.6.1 Leading vehicle observer The importance of maximum engine power was previously described in Section 2.3.1. However based on the equation of motion, another term is also unknown which is the ratio of aerodynamic drag and mass. Therefore, rather than the maximum longitudinal force FLmax, the limit that needs to be estimated is the acceleration limit amax described by amax = FLmax − FLair mL = FL0 mL + PLmax mL · vL(s) − cLa · v2 L(s) 2mL (3.28) where mL is the mass of leading vehicle, FL0 is a constant force parameter to fit the limit, cLa is its aerodynamic drag coefficient and PLmax is its maximum engine power. Thus, the scalar parameters that need to be obtained are l0 = FL0 mL , l1 = PLmax mL and l2 = cLa 2mL . With the measurement data (including traveling time, speed of leading vehicle as well as the slope of the road topography), the measured acceleration capabilities ameas can be calculated according to ameas = FL mL − ca · v2 L(s) 2mL = v̇L(s) + g · (sinα + crcosα) (3.29) 24 3. Methods To illustrate ameas, an example is shown in Figure 3.2. In this Figure, ameas have been calculated by using measurement data collected with sample distance of 80m from a vehicle which has traveled for 20km. 60 65 70 75 80 Vehicle speed[km/h] 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 A c c e le ra ti o n [m /s 2 ] a meas Speed-clusters Figure 3.2: Acceleration as function of vehicle speed. The blue star points repre- sent ameas and the black lines represent the speed-clusters. Since the ameas-values which operate on amax are relevant for estimating amax, only the highest values of ameas are needed. Therefore, ameas are grouped based on their speeds by several shorter but equally long intervals referred as speed-clusters. In Figure 3.2, the number of speed-clusters is seven. For each speed-cluster, the highest ameas-value is then saved and the rest is discarded. The limit amax can then be estimated by solving LP (Linear Programming) [22] with the cost function formulated as min l0,l1,l2 ∫ vLmax 0 aLmax(vL)dvL = K∑ j=1 amax(vLj) = l0 ·K + l1 K∑ j=1 1 vLj − l2 K∑ j=1 vLj 2 s.t. amax(vLj) ≥ ameasj , j = 1, 2, .., K (3.30) where vLmax denotes the highest measured vehicle speed collected and K denotes the number of relevant points. From what has been previously been studied, amax should be a monotonically decreasing function. Therefore, boundaries for l0,l1 and l2 are put to ensure that the estimated amax does not get an unexpected shape such as concave function. After the vehicle parameters l0, l1 and l2 have been obtained from the observer, they can then be used to estimate amax as described by Equation (3.28). The estimated amax is seen in Figure 3.3. 25 3. Methods 60 65 70 75 80 Vehicle speed[km/h] 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 A c c e le ra ti o n [m /s 2 ] a meas Estimated a max Speed-clusters Figure 3.3: Acceleration as function of vehicle speed. The blue star points repre- sent ameas. 3.6.2 Noise disturbance For the example described in Figures 3.2 and 3.3, simulated measurements with- out noise disturbance were used. However, real measurement data contains noise disturbance which can severely affect the results. To reduce the impact of it, some measures need to be taken. The measured speed is first smoothed with Savitzky-Golay filter [23] before ameas are calculated. A limit for ameas as function of vehicle speed is also introduced in observer to further reduce the noise. If an ameas exceeds this limit, it will be removed and not be considered when amax is estimated. In the observer, a limit for jerk (derivative of acceleration in regards to time) is also put to ensure that one ameas-point does not deviate too much from other points. Figure 3.4 shows an example of ameas-points collected as function of vehicle speed and where there are points which deviate significantly from the rest, which are considered as outliers. The black line represents the highest possible amax. In this example, there are three ameas-points which lie above that limit. There is also another ameas-point which lies just below the limit but deviates significantly from the other points. 26 3. Methods 20 30 40 50 60 70 80 90 Vehicle speed[km/h] 0 5 10 15 A c c e le ra ti o n s [m /s 2 ] a meas outliers Highest possible a max Figure 3.4: Acceleration ameas as function of vehicle speed. The black line is the highest possible amax. The points with red circles are considered as outliers. With the approach to reduce noise impact, the three points above the limit are neglected. The point just below it is solved with the limit put for jerk. Figure 3.5 shows the result of filtering out the outliers. 20 30 40 50 60 70 80 90 Vehicle speed[km/h] 0 5 10 15 A c c e le ra ti o n s [m /s 2 ] a meas outliers Highest possible a max Figure 3.5: Acceleration ameas after using the noise reduction approach. 27 3. Methods 3.6.3 Leading vehicle reference speed predictor After the vehicle parameters l0, l1 and l2 are obtained from the observer, they can then be used to determine if its desired speed v̄L (assumed to be known) is feasible or not. The speed trajectory of the leading vehicle, denoted by vLr, can then be predicted by numerically solving vLr(s) = min { v̄L, ∫ sf s0 min { acom vLr(s) , awLmax(s) vLr(s) } ds } (3.31) with initial value vLr(s0) as the current speed of the leading vehicle. For comfort, a limit for how much the vehicle can accelerate for comfortable driving is also in- troduced, which is denoted by acom. For those instances where v̄L is not considered feasible, the leading vehicle will drive with either acom or maximum vehicle acceler- ation, denoted by awLmax, which is described by awLmax(s) = amax − g · (sin(α) + crcos(α)) (3.32) With the predicted speed trajectory, the traveling time of leading vehicle, denoted by tL, can be calculated which will be used for the safety constraint described by Equation (2.29). The safety constraint will also be taken into account for prediction of speed trajectory of the host vehicle. 3.6.4 Host vehicle reference speed predictor Prediction of speed trajectory of the host vehicle is similar to the case for the leading vehicle as described by Equation (3.31). For the host vehicle however, the safety constraint with tL is also taken into consideration. Therefore, the prediction of the reference speed trajectory of the host vehicle, vr, is calculated by vr(s) = min { v̄, vsafe(s), ∫ sf s0 min { acom vr(s) , awmax(s) vr(s) } ds } (3.33) where the initial value vr(s0 = 0) = v̄ and for the upcoming updates vr(s0 > 0) = v0 (current speed of host vehicle). The highest allowed speed of host vehicle based on the safety constraint, which is denoted by vsafe(s), is calculated by vsafe(s) = ds tL(s+ 1)− tL(s) (3.34) where ds is the sample distance. The maximum acceleration of host vehicle, denoted by awmax, is described by 28 3. Methods awmax(s) = F0 m + PEmax mvr(s) − cav 2 r(s) 2m − g(sin(α) + crcos(α)) (3.35) The reference speed trajectory vr is then sent to the energy management where the optimal state trajectories, including v, will be estimated. 3.7 Energy management After variable change has been made as described in Section 3.4, the optimization problem has turned convex and can finally be solved in energy management. In this layer, the problem is reformulated as minimize J̃ = ∫ sf s0 (χ(s)µ̃)ds subject to (3.36a) t′(s) = f lin t (Ev(s)) (3.36b) E ′v(s) =χ(s)FE1(s) + FE2(s) + FM(s) + Fbrk(s) + χ(s)FEbrk(s)+ + F lin air (Ev, dLH)−mg(sin(α) + crcos(α)) (3.36c) E ′B(s) = −FB(s) (3.36d) FB(s) ≥ max { FM(s) η , ηFM(s) } + FMd(s) + FBd(s) (3.36e) t(sf) ≤ tmax (3.36f) t(s0) = t0, Ev(s0) = mv2 0 2 (3.36g) t(s) ≥ tL(s) + ∆t (3.36h) Ev(s) ∈ m2 [ v2 min(s), v2 max(s) ] (3.36i) χ(s)FE1(s) + FE2(s) ≤ ηPEmaxf lin t (Ev(s)) (3.36j) FE1(s) ∈ ηr(γ) [ 0,min { b0, b1 + 2b2r 2(γ) m Ev(s) }] (3.36k) FEbrk ∈ [( c1 + 2c2 m Ev(s)r2(γ) ) , 0 ] r(γ) η (3.36l) Fbrk(s) ≤ 0, FE2(s) ≥ 0 (3.36m) FM(s) ∈ [ FMmin(Ev), FMmax(Ev) ] (3.36n) EB(s0) = EB0, EB(sf) ≥ EBf (3.36o) EB(s) ∈ [ SOCmin, SOCmax ] EBmax (3.36p) 29 3. Methods There are three states t, Ev and EB, and six control signals FE1, FE2, FM, FB, Fbrk and FEbrk. Note that integer states, such as γ and χ, as well as the penalty terms in Equation (3.2a) have been removed in this layer. There are several options for solving this convex problem. In this project, the problem is solved by quadratic programming [24]. After the optimization problem has been solved, the estimated trajectories for the speed v and battery costate λB are then sent to the power management. The control trajectories are also sent to obtain the demanded force FD (more on this in Section 3.8.1). 3.8 Power management Since power management has received the battery costate and optimal speed trajec- tory, constraints for v and travel time t in the optimization problem can be removed. The problem is thus reformulated as minimize J = ∫ sf s0 (χµ(FE, γ) +Qtot)ds subject to (3.37a) E ′B(FM, γ) = −FB(FM, γ) (3.37b) FD(s) = χ(s)(FE1(s) + FEbrk(s)) + FE2(s) + Fbrk(s) + FM(s) (3.37c) PB(FM, γ) = max { FM(s) η , ηFM(s) } v(s) + PMd(γ, FM) + PBd(PB) (3.37d) χ(s)FE1(s) + FE2(s) ≤ ηPEmax v(s) (3.37e) FE1(s) ∈ [ 0,min { b0, b1 + b2r 2(γ)v2(s) }] r(γ)η (3.37f) FEbrk(s) ∈ [( c1 + c2v(s)2r(γ)2 ) , 0 ] r(γ) η (3.37g) Fbrk(s) ≤ 0, FE2(s) ≥ 0 (3.37h) FMmax(s) = min { d1, d2 + d3 v(s)r(γ) } r(γ)η (3.37i) FMmin(s) = max { e1, e2 + e3 v(s)r(γ) } r(γ) η (3.37j) EB(s0) = EB0, EB(sf) ≥ EBf (3.37k) EB(s) ∈ [SOCmin, SOCmax]EBmax (3.37l) χ+(s) = χ(s) + uχ(s), χ(s) ∈ X, uχ(s) ∈ Uχ (3.37m) 30 3. Methods γ+(s) = γ(s) + uγ(s), γ(s) ∈ Γ, uγ(s) ∈ Uγ (3.37n) However, the demanded force FD in (3.37c) has not been optimally divided between the forces, which will be done in power split. Note that the penalty term Qtot has been introduced, which is described as Qtot = Wγ(γ) +Wχ(χ) + Fbrk(s)2Qbrk + FEbrk(s)2Qebrk + FE2(s)QFe2 (3.38) where Qbrk, Qebrk and QFe2 are the penalties for applying Fbrk, FEbrk and FE2, respectively. As FE2 should be avoided, QFe2 is put relatively high compared to the other penalties. Since it is desirable to apply less Fbrk than FEbrk for braking, Qbrk is put significantly higher than Qebrk. The problem can be solved by first formulating a Hamiltonian which is expressed as H(FE, FB, γ, χ) = χµ̃(γ, FE) +Qtot − λB(s)FB(γ, χ, FM) (3.39) A necessary condition for optimality is described by( ∂H ∂EB )∗ − d ds ( ∂H ∂E ′B )∗ = 0 =⇒ λ′B(s) = 0 (3.40) This means that λB should be constant over traveled distance for each predicted horizon, provided that EB does not hit its limits, though it is likely to happen in real scenario. However, for this project it is assumed that the battery is large enough to avoid hitting the limits. Since λB should penalize the usage of EM as indicated in Equation (3.39), it should also be negative. 3.8.1 Power split When power split is performed, the gear γ and ICE-state χ have already been given (later described in Section 3.8.2). For simplicity, instance s has also been omitted in this section. A set of feasible FM-points (including FMmin and FMmax), which is denoted by FMfeas, is first created FMfeas ∈ {F1, F2, ..., FG} (3.41) where G is the number of feasible FM-points. If FD also lies within the limits of FM, then it also included in FMfeas. 31 3. Methods The battery force FB, as function of FMfeas, needs to be expressed by using following Equations PM(FMfeas) = ωMrFMfeas (3.42) PMd(FMfeas) = h1ωM + h2ω 3 M + h3ωMr ∣∣∣∣∣max { FMfeas η , ηFMfeas }∣∣∣∣∣ (3.43) PBd(PB) = R V 2 oc P 2 B (3.44) PB = PM + PMd(FMfeas) + PBd(PB) = PM + PMd(FMfeas) + R V 2 oc P 2 B (3.45) By solving the quadratic Equation (3.45) for PB, it can be expressed as PB(FMfeas) = V 2 oc 2R − √√√√( V 2 oc 2R2 )2 − V 2 oc R (PMd(FMfeas) + PM(FMfeas)) (3.46) which is then used to express FB as FB(FMfeas) = PB(FMfeas) v (3.47) The rest of the control signals, as function of FMfeas, are calculated as FE2(FMfeas) = max{0, FD − FMfeas − FEmax} (3.48a) FE1(FMfeas) = max{0, FD − FMfeas − FE2(FMfeas)} (3.48b) Fbrk(FMfeas) = min{0, FD − FMfeas − Febrkmin} (3.48c) FEbrk(FMfeas) = min{0, FD − FMfeas − Fbrk(FMfeas)} (3.48d) The limits for the force delivered by ICE in (3.48) are described by FEmax = min { ηPEmax v , b0r(γ)η, (b1 + b2r 2(γ)v2)r(γ)η } (3.49a) Febrkmin = (c1 + c2v 2r(γ)2)r(γ) η (3.49b) The point from FMfeas which gives the least value of Hamiltonian in Equation (3.39) becomes the optimal FM, which can then be used to obtain the rest of the optimal control trajectories. However, the gear and ICE-state trajectories have not been determined, which is done by dynamic programming [25]. 32 3. Methods 3.8.2 Dynamic Programming The states of DP (Dynamic Programming) are the gears and ICE-state, which can be expressed as ζ(s) = [γ, χ]. It first performs backward optimization where the initial instance is s = sf − 1 and then moves backward to reach next instance. For every instance that has been reached and for every state, the optimization calculates the minimum but feasible cost J(ζ(s), s) = min ζ(s+1)∈ζfeas {C(ζ(s), ζ(s+ 1), s) + J(ζ(s+ 1), s+ 1)} (3.50) where ζfeas = [Γfeas, Xfeas] are feasible updates of states at s + 1 and C(ζ(s)) is the cost for being at the state at instance s. The feasible state updates that can be reached at instance s+1 are expressed as Γfeas = Γ ∩ (γ(s) + Uγ), Xfeas = X ∩ (χ(s) + Uχ) (3.51) In the Hamiltonian cost (3.39), the penalties Wγ and Wχ have the weights wγ and wχ, respectively. They are added based on the decision variables yγ and yχ, which are described by yγ(γ(s), γ(s+ 1)) = 1, if γ(s+ 1) < γ(s) 0, otherwise (3.52a) yχ(χ(s), χ(s+ 1)) = 1, if χ(s+ 1) 6= χ(s) 0, otherwise (3.52b) In other words, wγ is added when the selected gear at one instance is higher than the selected gear at next instance due to downshift. The weight wχ is added when the ICE-state is changed from one instance to the next. Both weights are tuned accordingly to avoid frequent shifts. Once the backward optimization has reached s = s0, the forward optimization be- gins. It then chooses the optimal path with minimum cost among the costs of all feasible paths. The optimal state at next instance can be expressed as ζ∗(s+ 1) = arg min ζ(s+1)∈ζfeas {C(ζ∗(s), ζ(s+ 1), s) + J(ζ(s+ 1))} (3.53) where ζ∗(s) is the optimal state at instance s. 3.8.3 Battery costate optimization The battery costate trajectory λB, received from the energy management, is not optimal as there is model miss-match between the two layers. This might lead 33 3. Methods to that the final battery energy EB(sf) deviates significantly from its target EBf. Therefore, λB needs to be adjusted iteratively [11][26] such that the battery energy error ∆EBf satisfies ∆EBf = EB(sf)− EBf ≈ 0 (3.54) Thus, for each iteration the dynamic programming needs to be run again to adjust λB. The adjustment is done by increasing/decreasing with a stepsize δ. For example if ∆EBf < 0, it means that too much EM-force has been applied and λB has to decrease (λB := λB − δ) to penalize more and vice versa. If there has been a sign change of calculated ∆EBf between two iterations, then EB(sf) has passed EBf, and δ can be decreased with a factor to make better adjustments for next iterations. The battery energy EB(s) can be obtained by integrating (3.37b) in space domain. The procedure for updating λB is illustrated by the flow chart in Figure 3.6. It can be described by following pseudocode where c is the iteration for updating λB: 1. Calculate ∆Ec B(sf) after running dynamic programming. 2. If ∆Ec B(sf) ≤ bound, then finish. Else move to step 3. 3. λcB = λc−1 B + sign(∆Ec Bf)δ. 4. If sign(∆Ec Bf) = −sign(∆Ec−1 Bf ) move to step 5. Else move to step 6. 5. δ := δ 2 6. c := c+ 1 and return to step 1. Figure 3.6: Flow chart of the battery co-state update. The number of update is denoted by c. 34 3. Methods Both δ and c are reset to their initial values before the next MPC-update. 3.9 Summary of MPC-algorithm A flowchart of the complete MPC-algorithm is shown in Figure 3.7, which can be summarized by following steps: 1. Starting from the beginning of the road where current instance s0 = 0, the position of leading vehicle is located and a constant cruising speed v̄ is set for the host vehicle. 2. At s0, the host vehicle collects measurement data from the leading vehicle, including its travel time and speed. The data is then sent to the leading vehicle observer which estimates the parameters l0,l1 and l2. 3. Based on the estimated parameters and an assumed cruising speed v̄L, the leading vehicle reference speed predictor obtains the reference speed trajectory vLr. This trajectory is used to estimate the traveling time trajectory of leading vehicle tL, which is then sent to both energy management and the host vehicle speed predictor. The host vehicle speed predictor uses information of tL and road topography to obtain host vehicle reference speed trajectory vr and send it to the energy management. 4. In the energy management, the optimization problem is solved which yields the optimal speed trajectory v and battery costate trajectory λB. Both trajectories are sent to the power management. In the first iteration, the highest gear is selected and ICE-state is on for all predicted instances. 5. The problem is solved in power management to find the optimal trajectories for control signals, gear and ICE-state. It is solved repeatedly, until λB has been updated such that EB(sf) lies within its bounds. The gear and ICE-state trajectories are then sent to energy management. 6. If the solution has not converged or a maximum number of iteration has not been reached, return to step 4. During each iteration, the reference speed trajectory vr is updated as vr := vr + (vr + (v − vr))β (3.55) where β ∈ (0, 1] is a convergence step. 7. Apply the first element of the optimal control trajectories U(s0:sf) and discard the rest. If the final instance of the road, sN, has been reached, finish the procedure. Otherwise, move to the next instance and return to step 2. 35 3. Methods Figure 3.7: Flow chart of the implemented MPC-algorithm 36 4 Results In this chapter, the results obtained in this project are presented. For the driving scenarios, two different road topographies are used: 1. An artificial driving cycle with a length of 7km as seen in Figure 4.1. 2. The second driving cycle is a road between Alingsås and Gothenburg as seen in Figure 4.2. This is primarily used for investigating different case scenarios which involve leading vehicle. The investigations are done with host vehicle, both as CV and HEV. In Section 4.1, the host vehicle driving on the road displayed in Figure 4.1 is shown to see how it behaves without leading vehicle present. For the rest of the results, the driving cycle in Figure 4.2 is used which involves leading vehicle. With leading vehicle present, The length of predicted horizon is also examined. For all results, the sample distance is set as 100m for prediction. 0 1 2 3 4 5 6 7 Traveled length[km] 0 10 20 30 40 50 60 70 R o a d a lt it u d e [m ] Figure 4.1: Artificial driving cycle with a road length of 7km. The horizontal axis represents the traveled distance and the vertical axis represents the altitude. 37 4. Results 0 5 10 15 20 25 30 35 40 Traveled length[km] 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] Figure 4.2: Road between Alingsås and Gothenburg. The length of the driving cycle is 40.1km. 4.1 Validation of control algorithm without LV In this section, the control algorithm is validated both for CV and HEV without a leading vehicle present. Since there is no LV (Leading Vehicle) present, the predic- tion horizon is set as the entire road and MPC needs to be run for one update only. The cruising speed is set as v̄ = 80km/h. The speed tolerance is set as ± 10km/h, meaning that the speed can deviate at most 10km/h from the reference speed. 4.1.1 CV without LV ahead In Figure 4.3, the optimal speed and gear trajectories are shown with the speed limits. There are some instances where the speed hits its limits, but it still remains in the feasible region during the entire travel. The lowest selected gear is nine and its trajectory does not downshift frequently. 38 4. Results 0 10 20 30 40 50 60 70 R o a d a lt it u d e [m ] 0 1 2 3 4 5 6 7 Traveled length[km] 50 60 70 80 90 100 110 120 G e a r 1 0 , s p e e d [k m /h ] Gear Speed limits Speed Figure 4.3: The state trajectories of CV and the speed limits. The ICE-state is not included since the engine is always on for CV. The corresponding control trajectories to Figure 4.3 are depicted in Figure 4.4. In the beginning where there is a very steep downhill, large frictional force by the engine is applied such that it hits its limit. At one instance, the gear even needs to be downshifted to apply even more frictional engine force. When traveling uphill, the host vehicle starts applying engine force. Note that the engine force is never applied at the same time as either braking or frictional engine force is. The abstract force remains zero for the entire travel, so the gear trajectory has been properly selected. 0 10 20 30 40 50 60 70 R o a d a lt it u d e [m ] 0 1 2 3 4 5 6 7 Traveled length[km] -15 -10 -5 0 5 10 15 20 F o rc e s a t w h e e l s id e [k N ] Engine force limit Engine force Abstract engine force Braking force Engine friction force limit Engine friction force Figure 4.4: The control trajectories of CV and ICE limits. EM force and its limits are not displayed since they are not available for CV. 39 4. Results 4.1.2 HEV without LV ahead In this case, EM force and SOC (the battery charge in percentage) are available. The initial battery energy is assumed to be EB0 = 0.6EBmax and the targeted final battery energy is chosen as EBf ≈ 0.4EBmax. Figure 4.5 displays the state trajecto- ries of HEV, including its ICE-state and SOC, and Figure 4.6 displays the control trajectories. Compared to CV, HEV maintains higher gear trajectory as it is able to utilize force from EM. Similar to the speed trajectory of CV, there are some instances where the speed hits its limits but also remains within its feasible region. SOC increases when EM works as generator (negative EM force applied) and decreases when EM works as motor (positive EM force applied). However, SOC never hits its limits for the entire travel. 0 10 20 30 40 50 60 70 R o a d a lt it u d e [m ] 0 1 2 3 4 5 6 7 Traveled length[km] 0 20 40 60 80 100 120 IC E s ta te , G e a r 1 0 , s p e e d [k m /h ] Gear Speed limits Speed SOC limits SOC (%) ON/OFF 10 Figure 4.5: The state trajectories of HEV, including ICE-state and SOC, as func- tion of traveled distance. The limits for SOC and speed are also displayed. In the beginning, ICE is off and only negative EM force is applied. However, since EM force reaches its limit later and more braking is required, an amount of frictional force by the engine is applied as well and ICE has to be turned on. Positive EM force is applied when HEV travels uphill, so that less engine force is needed for propulsion. Note that in the interval 1-2.7km, where neither of the forces from engine is applied, ICE is turned off again. EM force hits its upper limit at numerous instances. 40 4. Results 0 10 20 30 40 50 60 70 R o a d a lt it u d e [m ] 0 1 2 3 4 5 6 7 Traveled length[km] -8 -6 -4 -2 0 2 4 6 8 10 12 F o rc e s a t w h e e l s id e [k N ] Engine force limit Engine force Abstract engine force Braking force Engine friction force limit Engine friction force Em force limits EM force Figure 4.6: The control trajectories of HEV, including EM force, as function of traveled distance. The limits for ICE and EM are also displayed. 4.2 Validation of control algorithm with LV In this section, the control algorithm is evaluated when there is a leading vehicle driving in front of host vehicle. Therefore, the leading vehicle observer has to be used to estimate its power capability. Real measurement data of a leading vehicle driving on the road topography in Figure 4.2 is used. The leading vehicle is assumed to have been detected at 200m from the start of the road. Therefore, a new MPC-update is made for each instance that host vehicle reaches. Since it is unknown of what the desired speed of leading vehicle v̄L is, it is set as the average value of the collected measured speed between updates or as minimum 60km/h. The length of prediction horizon is set as Sp=4km and the desired speed of host vehicle is set as v̄ =90km/h. For the safety constraint, the time headway is set as ∆t =2s. 4.2.1 LV observer Figure 4.7 shows the performance of observer dependent on the traveled distance of leading vehicle along with its actual acceleration limit. The further leading vehicle travels, the more measurements are collected. A sample distance of 5m is used to collect the measurement data. The number of speed clusters is chosen as 10. 41 4. Results 30 40 50 60 70 80 Vehicle speed[km/h] 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 A c c e le ra ti o n s [m /s 2 ] Actual a max 0.2km 1km 5km 10km 20km 39.785km Figure 4.7: The various estimated acceleration limits as function of vehicle speed. The estimation of limits depend on the traveled distance of leading vehicle. All estimated limits are non-concave due to the boundaries put for the parameters. The limit that is obtained after leading vehicle has driven only for 200m is the one that deviates most from the actual limit, as there is not enough measured points collected to make a proper estimation. However, after the leading vehicle has driven further, more measurement data is collected and the observer makes better estimation of the limit. The various estimated accelerations limits obtained after leading vehicle has driven 1km and further are closer to the actual limit compared to the one when the leading vehicle has only driven for 200m. 4.2.2 CV with LV ahead The state trajectories, which include gear and speed, are seen in Figure 4.8. Since the desired speed v̄ is now set higher than in Section 4.1 and the speed needs to be adjusted to not get too close to leading vehicle, the speed limits vary a lot more. The speed hits the limits at some instances, but remains within its feasible region during the entire travel. 42 4. Results 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 0 5 10 15 20 25 30 35 40 Traveled length[km] 40 50 60 70 80 90 100 110 120 G e a r 1 0 , s p e e d [k m /h ] Gear Speed limits Speed Figure 4.8: The state trajectories of CV as function of traveled distance and the speed limits. The control trajectories of host vehicle is seen in Figure 4.9. Note that at instance 7.9km where there is a very steep downhill, the gear has to be downshifted to a much lower level to be able to apply much larger frictional force by the engine. For uphills, the engine force is applied. Neither abstract force nor mechanical braking force (braking force by the service brake) is applied for the entire travel. 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 0 5 10 15 20 25 30 35 40 Traveled length[km] -30 -20 -10 0 10 20 30 F o rc e s a t w h e e l s id e [k N ] Engine force limit Engine force Abstract engine force Braking force Engine friction force limit Engine friction force Figure 4.9: The control trajectories of CV as function of traveled distance and the ICE limits. 43 4. Results Figure 4.10 shows the gap between the traveling times of host and leading vehicle. There are some instances where the gap goes a little bit below the time headway. However, the most important thing is that it never goes to 0, meaning that host ve- hicle never collides with leading vehicle. Note that gap is biggest at around 32.5km. This could be that the calculated desired speed of leading vehicle is significantly lower than the actual desired speed, which makes the gap bigger as host vehicle drives slower. 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 5 10 15 20 25 30 35 40 Traveled length[km] 0 2 4 6 8 10 12 14 16 18 20 T im e [s ] Time gap t Figure 4.10: The time gap between the traveling times of leading vehicle and host vehicle (CV) as function of traveled distance. 4.2.3 HEV with LV ahead In the beginning of the road, the battery energy is assumed to be EB0 = 0.6EBmax. For simplicity, λB should be updated such that the targeted battery energy becomes EBf ≈ 0.6EBmax by the end of horizon. Figure 4.11 shows the state trajectories of host vehicle as HEV. Compared to Figure 4.8, the gear trajectory is higher. The lowest selected gear is 10, but the trajectory remains on gear 12 during most of the travel. SOC varies during travel, but never hits its limits. Except for the instances around 28-29km and in the beginning of the road, the ICE-state does not shift frequently between the updates. 44 4. Results 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 0 5 10 15 20 25 30 35 40 Traveled length[km] 0 20 40 60 80 100 120 IC E s ta te , G e a r 1 0 , s p e e d [k m /h ] Gear Speed limits Speed SOC limits SOC (%) ON/OFF 10 Figure 4.11: The state trajectories of HEV as function of traveled distance. The limits for SOC and speed are also displayed. Figure 4.12 illustrates the control trajectories and their limits. Positive EM force is applied when going uphill and sometimes requires ICE to be turned on to apply engine force as well. There are some instances where negative EM force and engine force are applied at the same time, which is sometimes needed to charge the battery. When traveling downhill, negative EM force is applied to brake and generate energy to the battery. However, since there are some instances where the downhill is very steep, ICE still needs to be turned on to apply frictional engine force as EM force has already reached its limit. Since the abstract force is never applied during the entire travel, the gear trajectory has been properly selected. 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 0 5 10 15 20 25 30 35 40 Traveled length[km] -15 -10 -5 0 5 10 15 F o rc e s a t w h e e l s id e [k N ] Engine force limit Engine force Abstract engine force Braking force Engine friction force limit Engine friction force Em force limits EM force Figure 4.12: The control trajectories of HEV as function of traveled distance. The limits for ICE and EM are also displayed. The time gap is illustrated in Figure 4.13. It is shown in the Figure that the host 45 4. Results vehicle maintains a safe distance to the leading vehicle throughout the driving cycle. There are a few instances where the gap goes a little bit below ∆t, but it never gets close to 0. This means that host vehicle never gets too close or collides with leading vehicle in front. 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 5 10 15 20 25 30 35 40 Traveled length[km] 0 5 10 15 T im e [s ] Time gap t Figure 4.13: The time gap between the traveling times of leading vehicle and host vehicle (HEV) as function of traveled distance. By comparing the results of CV and HEV in Figures 4.8 and 4.11, it is shown that HEV does not need to downshift the gear as frequently as CV. This is because EM supports ICE for delivering demanded force. In Figures 4.9 and 4.12, it can be seen that the HEV applies less frictional force by the engine as it is able to use EM for braking. By using EM for braking, the HEV also recovers energy and stores it in the battery, which is later used for propulsion. 4.3 Length of prediction horizon In this section, the length of prediction horizon is examined to see how it affects the performance of the control algorithm. Same driving scenario with similar settings as described in Section 4.2 are used here. Table 4.1 shows the fuel consumption and final traveling time of host vehicle as CV for other selected lengths of prediction horizon. It also includes tsum, which is the sum of the time gap going below ∆t. In other words, tsum shows how much the safety constraint has been violated during the entire travel. For the case when the prediction horizon is set as the entire road length, MPC is run for one update only. 46 4. Results Table 4.1: Fuel consumption, final traveling time and tsum of CV for different prediction horizon. Sp[km] Fuel[kg] tf[min] tsum[s] Entire road length 6.9163 39.953 0 1 7.7115 30.0816 10.09 2 5.9472 30.0758 5.43 3 5.9576 30.0814 4.05 4 5.402 30.0727 4.83 For the shorter prediction horizons (1-4km), it can be seen that the highest fuel consumption is for the case with Sp=1km and lowest for the case with Sp=4km. Normally, what is expected is that the fuel consumption will monotonically decrease the longer prediction horizon is as more instances of the road topography ahead are taken into consideration. However, the fuel consumption for the case with Sp=3km is slightly higher compared to the one for the case with Sp=2km. It is shown that the host vehicle travels faster and also uses more engine braking in the case with Sp=3km than Sp=2km. This is likely because of uncertainty of the leading vehicle speed prediction at some instances for Sp=3km. For some MPC-updates, the host vehicle predicts that the leading vehicle will travel faster, but then it predicts that the leading vehicle travel will travel significantly slower in the next update. Therefore, the host vehicle drives faster first but then it has to apply more engine brake as it predicts the leading vehicle will drive significantly slower in the next update. Thus, fuel consumption, which is the function of speed and engine force as shown in Equation (2.9), is higher for the case with Sp=3km. A similar table for HEV is shown in Table 4.2. The initial battery energy EB0 and targeted final battery EBf have been set the same as in Section 4.2.3, regardless of length of prediction horizon. Table 4.2: Fuel consumption, final traveling time and tsum of HEV for different lengths of prediction horizon. Sp[km] Fuel[kg] tf[min] tsum[s] Entire road length 1.3408 39.953 0 1 3.5025 30.0824 8.48 2 3.26 30.0728 3.80 3 2.8474 30.0807 0.44 4 2.3425 30.0907 1.1825 With HEV, the fuel consumption decreases the longer horizon that is selected as more instances of the road topography are taken into consideration. Note that for both CV and HEV, tsum is 0 but the final traveling time is much longer when the prediction horizon is set as the entire length and run for one update only. This can be explained by Figure 4.14 which shows a comparison between the 47 4. Results predicted and actual speed of leading vehicle and its constant desired speed which has been assumed to be 60km/h. Since the leading vehicle has been detected at 200m from the beginning of the road, the observer has estimated its acceleration limit as the one shown in Figure 4.7 after it has driven 0.2km. With the acceleration limit, the speed leading vehicle been predicted to maintain its assumed desired speed for the entire road. However, except for the instance around 8km, the predicted speed is considerably lower than the actual one for the entire travel. This means that host vehicle believes that the leading vehicle drives significantly slower than it actually does, which leads to the host vehicle also drives slower. Therefore, the safety constraint is never violated, but the time gap between the vehicles increases over traveled distance and the final travel time of host vehicle is longer compared to the cases with shorter prediction horizons. 5 10 15 20 25 30 35 40 Traveled length[km] 50 55 60 65 70 75 80 85 90 95 S p e e d [k m /h ] Actual speed Predicted speed Assumed desired speed Figure 4.14: The actual and predicted speed of leading vehicle and its assumed desired speed when the prediction is done once for the entire road. Figures 4.15 and 4.16 show the time gaps for different lengths of prediction horizon as function of traveled distance for CV and HEV, respectively. As the results of tsum in Tables 4.1 and 4.2 indicate, the safety constraint has been violated for the shorter prediction horizons. But most importantly, neither of them gets close to or below 0. For both CV and HEV, the safety constraint is never violated for the case where prediction horizon is set as the entire road length, but the gap increases over traveled distance. 48 4. Results 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 5 10 15 20 25 30 35 40 Traveled length[km] 0 5 10 15 20 25 T im e [s ] Sp=1km Sp=2km Sp=3km Sp=4km Entire road t Figure 4.15: Time gaps for different lengths of prediction horizon as function of traveled distance for CV. Note that the rest of the gap represented by the black line is not displayed as it increases significantly over traveled distance. 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 5 10 15 20 25 30 35 40 Traveled length[km] 0 5 10 15 20 25 T im e [s ] Sp=1km Sp=2km Sp=3km Sp=4km Entire road t Figure 4.16: Time gaps for different lengths of prediction horizon as function of traveled distance for HEV. 4.4 No observer available In this section, similar case scenario as described in Section 4.2 is examined when the observer is not available. Only HEV as host vehicle is considered and the same 49 4. Results settings described in Section 4.2.3 are used. This case is important to study the benefit of the observer when comparing with the results in Section 4.2.3. For each MPC-update, only the current speed of leading vehicle is measured and the host vehicle assumes it to be constant over the predicted horizon. If the current speed of leading vehicle is less than 60km/h, the host vehicle assumes that leading vehicle will maintain a constant speed of 60km/h. The control trajectories are seen in Figure 4.17. Compared to Figure 4.12, a sig- nificantly larger frictional force by engine is applied along with force by service brake at around 8km in this case. This is because the host vehicle can only assume that leading vehicle will maintain its current speed over predicted horizon. In the next MPC-update however, the current speed of leading vehicle is measured to be lower and host vehicle needs to slow down significantly by applying more braking force. 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 0 5 10 15 20 25 30 35 40 Traveled length[km] -20 -15 -10 -5 0 5 10 15 20 F o rc e s a t w h e e l s id e [k N ] Engine force limit Engine force Abstract engine force Braking force Engine friction force limit Engine friction force Em force limits EM force Figure 4.17: The control trajectories as function of traveled distance when the observer is not available. The time gap between host and leading vehicle is shown in Figure 4.18. There are some instances where the gap goes below ∆t, but it never reaches 0. However, compared to Figure 4.13, the safety constraint is more violated in this case. 50 4. Results 0 10 20 30 40 50 60 70 80 90 100 R o a d a lt it u d e [m ] 5 10 15 20 25 30 35 40 Traveled length[km] 0 5 10 15 T im e [s ] Time gap t Figure 4.18: The time gap as function of traveled distance when the observer is not available. Figure 4.19 shows the predicted speed trajectories of leading vehicle along with its actual speed trajectory. The assumed desired speed for each sample is also shown. As the current speed of leading vehicle is assumed to be constant over predicted horizon for each update, the predicted speed trajectories deviate significantly from the actual trajectory. 5 10 15 20 25 30 35 40 Traveled length[km] 45 50 55 60 65 70 75 80 85 90 95 S p e e d [k m /h ] Actual speed Predicted speed Assumed desired speed Figure 4.19: The predicted speed trajectory and the assumed desired speed of the leading vehicle for each sample along with the actual speed trajectory when observer is not available. 51 4. Results Note that for those updates where the current speed is lower than 60km/h, the host vehicle assumes that leading vehicle maintains 60km/h over predicted horizon. Figure 4.20 shows the predicted speed trajectories of leading vehicle along with its actual speed trajectory for the case in Section 4.2.3 where observer is used. 5 10 15 20 25 30 35 40 Traveled length[km] 45 50 55 60 65 70 75 80 85 90 95 S p e e d [k m /h ] Actual speed Predicted speed Assumed desired speed Figure 4.20: The predicted speed trajectory and the assumed desired speed of the leading vehicle for each sample along with the actual speed trajectory when observer is used. Compared to Figure 4.19, the predicted speed trajectories are closer to the ac- tual speed trajectory which is shown at some instances such as around 16km and 27km. However, most of the predicted trajectories still do not align with the actual trajec- tory. The main reason is likely that the desired speed of leading vehicle has been wrongly assumed, and not because of the acceleration limit has been poorly esti- mated. The observer seems to give a good estimation of the limit just after leading vehicle has driven 1km which is seen in Section 4.2.1. Since the road topography mainly includes downhills, some of the predicted speed trajectories show that the speed is constant over predicted horizon, similar to the case where observer is not available. 52 4. Results 4.5 Benefit of HEV In this section, the benefit of HEV is discussed. Figure 4.21: Fuel consumption of CV and HEV for different lengths of prediction horizon. Figure 4.21 shows the fuel consumed by CV and HEV for different prediction horizon lengths. It is shown that the HEV consumes less fuel compared to CV regardless of length of the prediction horizon. As explained earlier, the HEV is able to recover energy by using EM for braking. The energy is stored in the battery and is later used for propulsion of HEV. In addition to this, it also allows ICE to be turned off during certain periods where the EM is able to provide all the necessary power, thus decreasing the fuel consumption further. 4.6 Benefit of having prediction horizon In this section, the benefit of having different prediction horizon length is discussed. Tables 4.1 and 4.2 show the fuel consumption and final travel time of CV and HEV for different horizon lengths, respectively. From the tables, it can be seen that choosing an optimal prediction horizon length is necessary. When analysing the benefit of prediction horizon length, it is more reasonable to consider the final travel time along with the fuel consumed for each horizon length. In Figures 4.22 and 4.23, the final travel time and fuel consumed by HEV for different prediction horizons and for the entire road (40.1km) are shown. For the shorter prediction horizons (1-4km), the fuel consumed is higher and it decreases as the prediction horizon length increases. The final travel time does not differ significantly for prediction horizons 1-4km. For the case where the prediction horizon length is set as the entire road, the MPC is run for one update only. It is observed that this case has the lowest fuel consumption, but also the highest final travel time. The reason is that the speed of leading vehicle is predicted lower than its actual speed. Therefore, the host vehicle drives significantly slower, resulting in longer travel time. 53 4. Results Figure 4.22: The final travel time of HEV for different horizons and for the entire road (40.1km). Figure 4.23: The fuel consumed by HEV for different horizons and for the entire road (40.1km). Figure 4.24: The final travel time of CV for different horizons and for the entire road (40.1km). Figure 4.25: The fuel consumed by CV for different horizons and for the entire road (40.1km). The fuel consumption is lowest since ICE remains off for longer periods compared to the other horizons as EM can deliver the demanded force needed for the host vehicle to drive with lower speed. In Figures 4.24 and 4.25 the final travel time and fuel consumed by CV for different prediction horizons and for the entire road (40.1km) are shown. It is observed that fuel consumption and final travel time behaviour for prediction horizon lengths 1- 4km of CV are similar to HEV. But for the case where the prediction horizon is set as entire road length, the travel time is same but fuel consumption behaviour is quite different from the HEV. For CV, it has to maintain lower gear trajectory as it requires more frictional force by the engine to maintain lower speed, leading to higher fuel consumption. 54 5 Discussion This Chapter includes discussion of the results, but also different areas of the work are discussed and how they can be improved for future work. 5.1 Leading vehicle observer and speed predic- tion As seen in Figure 4.7, the estimation of acceleration limit gets better for the limits where leading vehicle has driven further as more data has been collected. However, more collected measurement data does not necessarily mean that it gives better estimation as it can also introduce more noisy measurement points which will affect the estimation negatively if noise-counters miss them. For leading vehicle speed predictor, it has to be assumed that the desired speed of leading vehicle is known. As for the real measurement data, the desired speed of leading vehicle was unknown. As it was also unknown what the maximum allowed speed was for the road, the desired speed was simply assumed to be the average of the collected measured speed during each MPC-update or minimum 60km/h. This greatly influences the results as even if the observer makes a good estimation of the acceleration limit, the prediction can still be bad if the desired speed is guessed poorly. For example, if the actual desired speed is lower than the assumed one, the risk is greater that the host vehicle collides with leading vehicle. If the desired speed of leading vehicle is set as lower than the actual one, host vehicle might drive slower than it should. Knowing the maximum allowed speed of the road would be beneficial, as that could give a hint of what speed leading vehicle wants to maintain. The desired speed could instead be calculated as the average value of the collected measured speed or the maximum allowed speed. The benefit from using observer is explained in Section 4.4. It is indicated that using an observer improves the leading vehicle speed prediction compared to not using it. This leads to reduced energy consumption and less usage of service brakes. In addition, the safety constraint is less violated when using the observer. However, measurement data of road topography with more uphills is needed to further validate the observer. 55 5. Discussion 5.2 Measurement data and road topography As mentioned earlier, the road topography mainly includes downhills, which is likely the main reason for the huge fuel reduction for HEV, regardless of horizon length. As there are mainly downhills included, the observer is also less useful for this kind of topography. If topography mainly consisted of uphills however, it would have been more unlikely for the leading vehicle to maintain its desired speed and an observer would then be more useful. The length of road used for the driving scenarios is also significantly shorter than what a truck normally drives. Measurement data of trucks driving on longer road would therefore be more beneficial to further validate the control algorithm. For this thesis, it is assumed that the only traffic on the road is the leading vehicle. However, we are not certain of whether there were other obstacles that might affect the driving behaviour of the leading vehicle or not with this measurement data, although it is likely to be the case. 5.3 Choice of prediction horizon As discussed in Section 4.6, choosing optimal prediction horizon length is neces- sary. The shorter prediction horizon and the entire road length as the prediction horizon length are not the optimal choice which is shown in Section 4.6 in detail. When choosing the optimal prediction horizon length, it is necessary to compare the parameters such as fuel consumption, final travel time and the safety constraint (tsum) as shown in Tables 4.1 and 4.2. Other parameters such as type of host ve- hicle (HEV or CV) and the road topography also influence the choice of prediction horizon length. Another thing to point out is that the mass was set as 40ton for both CV and HEV. In reality however, an HEV might be heavier as it includes both electric machine and battery, adding additional weight to the vehicle. 5.4 Ethic and sustainability By successfully implementing this kind of control algorithm, better fuel efficiency can be achieved. Increased fuel efficiency reduces fuel consumption which means less emission of greenhouse gases to the environm