Next Article in Journal
Single-Sensor EMI Source Localization Using Time Reversal: An Experimental Validation
Next Article in Special Issue
On Optimizing a Multi-Mode Last-Mile Parcel Delivery System with Vans, Truck and Drone
Previous Article in Journal
RF Pogo-Pin Probe Card Design Aimed at Automated Millimeter-Wave Multi-Port Integrated-Circuit Testing
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Hardware-in-the-Loop Simulation of Self-Driving Electric Vehicles by Dynamic Path Planning and Model Predictive Control

1
Department of Mechanical Engineering, National Taiwan University, Taipei 10617, Taiwan
2
Mechanical and Mechatronics Systems Research Laboratories, Industrial Technology Research Institute (ITRI), Hsinchu 31057, Taiwan
*
Author to whom correspondence should be addressed.
Electronics 2021, 10(19), 2447; https://doi.org/10.3390/electronics10192447
Submission received: 3 September 2021 / Revised: 29 September 2021 / Accepted: 29 September 2021 / Published: 8 October 2021
(This article belongs to the Special Issue Unmanned Vehicles and Intelligent Robotic Alike Systems)

Abstract

:
This paper applies a dynamic path planning and model predictive control (MPC) to simulate self-driving and parking for an electric van on a hardware-in-the-loop (HiL) platform. The hardware platform is a simulator which consists of an electric power steering system, accelerator and brake pedals, and an Nvidia drive PX2 with a robot operating system (ROS). The vehicle dynamics model, sensors, controller, and test field map are virtually built with the PreScan simulation platform. Both manual and autonomous driving modes can be simulated, and a graphic user interface allows a test driver to select a target parking space on a display screen. Three scenarios are demonstrated: forward parking, reverse parking, and obstacle avoidance. When the vehicle perceives an obstacle, the map is updated and the route is adaptively planned. The effectiveness of the proposed MPC is verified in experiments and proved to be superior to a traditional proportional–integral–derivative controller with regards to safety, energy-saving, comfort, and agility.

1. Introduction

The advanced development of science and technology has made many researchers put their efforts to enhance safety, energy-saving, comfort, and agility in road traffic through vehicle automation. Since the last two decades, many researchers have addressed how the raw images from environment and the steering control states of a vehicle could be used to drive a vehicle autonomously in real time [1]. Nearly 30 years have passed, and we still have not seen the commercialization of autonomous vehicles without a steering wheel. Various advanced driver assistance system (ADAS) modules have been put on the market, such as adaptive cruise control (ACC), autonomous emergency braking system (AEB), lane keeping system (LKS), etc. Although these features can help drivers reduce the burden of driving and improve road safety, they may still not able to solve congestion and parking problems in urban areas.
Recently, research has also focused on parking assist technologies, such as vision-based parking assist systems [2,3], ultrasonic-based auto parking systems [4], laser scanner radar-based parking systems [5], and parking assist systems using hybrid method [6]. While these research efforts ended with the function of assisted parking, more advanced challenges remain, for instance, to build a system that includes path planning and fully automated parking. First, the path planning must convey to the vehicle the knowledge of its surrounding environment so that the vehicle control unit can command its actuators with appropriate actions in real time. A variety of methods of path planning were based on the requirements of the problem to be solved, such as rapidly-exploring random trees (RRT) [7], heuristically-guided RRT [8], potential field algorithm [9], and A-star [10]. By adding kinematic constraints to the A-star, a hybrid A-star algorithm was proposed by Dolgov et al. [11], which had been used by the Stanford team to execute U-turns on blocked roads and to navigate vehicles in parking lots in a grand challenge project supported by the Defense Advanced Research Projects Agency (DARPA).
After the path planning task sends signals to command a vehicle to track the expected path, the vehicle control unit will drive the vehicle by considering its coupled longitudinal and lateral dynamic behaviors. For a small low-speed harvester-assisting vehicle, Loukatos [12] simply used its geometrical model to calculate speed controls to drive motors to reach a specific turning angle. For high-speed normal vehicles with nonlinear and/or time-varying dynamics, traditional PID controller could scarcely be used to maneuver such vehicles of non-holonomic motions. Alternative methods of gain scheduling, parameter adaptation, and auto-tuning might be able to upgrade PID control performances [13] with or without vehicle models. More advanced techniques, such as sliding mode control [14], pure pursuit control [15,16], optimal predictive control [17], iterative linear quadratic regulator (LQR) [18], nonlinear model predictive control [19], and robust control [20] have been proposed to control the vehicle with complex dynamic behaviors.
One of the most promising methods of autonomous vehicle control is model predictive control (MPC), which accommodates both kinematic and dynamic vehicle models to improve the vehicle tracking performance at low and high speeds [21]. Either nonlinear MPC or time-varying linear MPC is attractive to the application of trajectory tracking for self-driving vehicles, and has been proved stable in the sense of Lyapunov theorem [22]. Vougioukas [23] applied a nonlinear model predictive tracking controller to a mobile robot in the presence of obstacles. Only its kinematic model was used to compute an optimal M-step-ahead control sequence in real time, by minimizing the cost of tracking errors and control efforts. However, the computational load may impede fast applications to self-driving vehicles [24].
This paper combines hybrid A-star path planning and time varying linear MPC with vehicle dynamic models for an electric van (e-van) to simulate self-driving and parking on a hardware-in-the-loop (HiL) simulation platform. The HiL simulation technique is often used for testing the proposed path planning and model predictive control strategy before it is implemented on a real vehicle in the real-world environment. In this paper, the hardware part has power steering wheel and motor, accelerator and brake pedals and their control unit, and computers. Other vehicle physical parts, components, subsystems, and vehicle dynamics are replaced by mathematical models coded in the software platform on computers. Since simulations are performed on a virtual plant, no physical plant could be damaged, and no people could be injured.
Section 2 establishes the kinematic and dynamic vehicle models. Section 3 briefs the hybrid A-star path planning algorithm. Section 4 presents the MPC by minimizing a cost function that describes vehicle performance in terms of safety, energy-saving, comfort, and agility. Section 5 introduces experimental results with the HiL platform and Section 6 concludes the research.

2. Vehicle Model

The e-van discussed in this paper is a Chung-Hua Motor Company commercial vehicle with a gross weight of 1.46 tons and 2 seats, which is driven by a 45 kW (rated) interior permanent magnet motor (IPM) and a 32-kWh lithium battery bank.

2.1. Kinematic Model

In Figure 1, the bicycle model of the e-van is introduced with a mass center at C, from which Lf and Lr are, respectively, the distances to the front and rear tires. With respect to the instantaneous center of zero velocity at O, the slip angles of the front and rear tires are denoted by αf and αr, the yaw angle is ψ, the side slip angle of the vehicle is β, and the steering angle is δ.
The velocities Vf and Vr of the front and rear wheels are derived as
V f = v cos β v sin β   + 0 L f ψ ˙ = v f cos ( δ α f ) v f sin δ α f 0
and
V r = v cos β v sin β   0 L r ψ ˙ = v r cos α r v r sin α r 0 ,
where v is the vehicle speed. When both the side slip angle and steering angle are small, i.e., tan ( δ α f ) δ α f ,   β 0 , and tan α r α r , their relationships are simply described as
α f = δ β L f ψ v ˙   and   α r = β + L r ψ v ˙ .  
Therefore, the lateral force on the front tire and the lateral force on the rear tire are derived by the Magic Formula tire model, as follows
F y f = C α f α f   and   F y r = C α r α r ,  
where Cαf is the cornering stiffness of the front tire and Cαr is the cornering stiffness of the rear tire. When the tire side slip angles αf and αr and the vehicle side slip angle β are small, the kinematic equation can be derived as
x ˙ y ˙ ψ ˙ = cos ψ sin ψ tan δ L v r = cos ψ sin ψ 0 v + 0 0 1 ψ ˙ ,
where x ˙ = x ˙ r and y ˙ = y ˙ r are the velocity components at the center of rear wheel. Since the rear tire side slip angle is negligibly small, the velocity of rear axle is equal to the velocity of mass center, i.e., v r = v .

2.2. Dynamic Model

As shown in Figure 2, the longitudinal traction forces are usually simplified as F x r = F x r 1 = F x r 2 and F x f = F x f 1 = F x f 2 when the vehicle moves along a straight line. The force with subscript 1 stands for the force exerted on the left tire, and subscript 2 stands for the force exerted on the right tire. The following equations represent the normal forces Nf and Nr of the front and rear wheels and the tractive force Fx:
N f =   ( m g L r cos θ 1 2 ρ C d A f v x 2 h a m h m v ˙ x ) / 2 L ,
N r =   ( m g L f cos θ + 1 2 ρ C d A f v x 2 h a + m h m v ˙ x ) / 2 L ,
F x =   2 F x f + F x r   = m v ˙ x + m g sin θ + 1 2 ρ C d A f v x 2 + 2 C t N f + N r .
Here, the geometric parameters are: L = L f + L r , Af the frontal area of vehicle, ha the equivalent height of aerodynamic point, hm the height of mass center, and θ the slope angle in degrees. The kinematic and kinetic parameters are: m the vehicle mass, g the gravity acceleration, ρ the air density, vx the longitudinal vehicle velocity, Cd the aerodynamic coefficient, Ct the friction coefficient between tire and ground, Fxf the traction force on the front tire, and Fxr the traction force on the rear tire.
When the vehicle is cornering, the four-wheel model is used to describe the vehicle dynamics equations in the lateral, longitudinal, and yaw directions, as follows:
( F x f 1 + F x f 2 ) cos δ ( F y f 1 + F y f 2 ) sin δ + F x r 1 + F x r 2 = m v ˙ x γ + d β d t v y ,
( F x f 1 + F x f 2 ) sin δ + ( F y f 1 + F y f 2 ) cos δ + F y r 1 + F y r 2 = m v ˙ y + γ + d β d t v x ,
L f   ( F y f 1 + F y f 2 ) cos δ L r ( F y r 1 + F y r 2 ) + L w 2 F y f 1 F y f 2 sin δ + M z = I z d d t γ + d β d t ,
M z = L f ( F x f 1 + F x f 2 ) sin δ + L w 2 ( F x f 1 + F x f 2 ) cos δ + L w 2 F x r 1 + F x r 2 ,
where Fxf1 is the longitudinal traction force on the left front tire and Fxf2 is the longitudinal traction force on the right front tire. They are assumed equal when the steering angle δ is zero. The lateral traction force on the left front tire is denoted by Fyf1 and the lateral traction force on the right front tire is denoted by Fyf2. Similarly, Fxr1 is the longitudinal traction force on the left rear tire, Fxr2 is the longitudinal traction force on the right rear tire, Fyr1 is the longitudinal traction force on the left rear tire, and Fyr2 is the longitudinal traction force on the right rear tire. In the yaw direction, Iz represents the mass moment of inertia, Mz is the yaw moment for cornering, and γ = ψ ˙ is the yaw velocity.
Equations (9)–(12) are used to calculate torque distributions as the vehicle is cornering at low speeds. Then, the pitch and roll motions can be omitted, and the rolling resistance, aerodynamic drag, and hill climbing resistance of the last terms in (6) can be neglected for simplicity.

3. Hybrid A-Star Algorithm

A crucial part for a self-driving vehicle is the path planning system, which typically encompasses different abstract layers, such as mission and motion planning. Mission planning consists of trajectory planning and path planning. The path planning generates a collision free path in an obstacle environment by optimizing it with regard to some rules, while the trajectory planning schedules the vehicle movement on the planned path. The motion planner, on the other hand, operates at a lower level to avoid obstacles while progressing towards local goals.
This paper applies the hybrid A-star algorithm [11,25] of path planning for an auto parking system. The first phase of this approach is different from the well-known A-star algorithm, which uses 3D kinematic states of the vehicle, but we modify the state-update rule to obtain the continuous-state data on the discrete searching grids on a map. The traditional A-star path planning only allows reaching centers of cells connected with piecewise linear lines. However, the hybrid A-star allows expansion towards any continuous point on the grid as a state, as shown in Figure 3. The state is described by x = (x, y, ψ), in which x and y denote the position of the mass center C and ψ the heading of the vertex or the yaw angle of the vehicle in Figure 1.
The non-holonomic constraints of the vehicle are considered for the vertex expansion by taking one of three actions—maximum steering left, maximum steering right, or no steering. In Figure 4, the vertex search starts from the current vehicle state xs to the goal state xg which are provided by the PreScan simulation platform. Then, the hybrid A-star will generate six successor vertices, three of which are driving forward, while three are driving in reverse (not shown in the figure). Each vertex expansion is generated by the minimal turning radius r = L / tan δ based on the vehicle parameters in Figure 1 to make sure that the resulting paths are always drivable. When a new vertex is expanded to a cell already occupied by other vertices, the ones with the higher cost will be deleted and the vertex with the least cost remains.
Any point xn on the planned path satisfies the optimal value of the cost function
f x n   = g x n   +   h x n ,
where g(xn) is the distance or cost between xs and xn, h(xn) is the predicted distance or cost from xn to xg, namely, the heuristic function.
The heuristic function used in the hybrid A-star path planning consists of a constrained heuristic and an unconstrained heuristic. The constrained heuristic ignores environmental obstacles but incorporates the geometric and dynamic constraints of the vehicle. The unconstrained heuristic disregards vehicle constraints but only accounts for obstacles.
In this paper, the Reeds-Shepp curve [26] was used as the constrained heuristic function for searching a path, which referred to the shortest curve that considered the heading and curvature restrictions. Taking the curvature limit of our vehicle into account, the Reeds-Shepp curve could generate drivable way points for the vehicle. As to the unconstrained heuristic function, the traditional A-star with Euclidean distance was introduced. By combining both constraint and unconstraint heuristic functions, the final path was generated to satisfy geometry constraints as well as to avoid obstacles.
In experiments, the size of each grid cell was 0.5 × 0.5 m2 to compose the scene of the test field on the PreScan simulation platform. As the vehicle was entering the parking lot of a size about 65 × 45 m2, it was switched to the self-driving mode. The Nvidia AutoChauffeur PX2, which had a Cortex A57 microarchitecture, took about 0.5–1.5 s to plan the path from the entrance of the parking lot to the selected parking space. During the movement, the vehicle speed was under 10 km/h; the control actions were determined in a sampling period of 100 ms after collecting the real-time information of sensors and waypoints along the path.
Though a vehicle model used to expand vertices might result in an excessive steering action, it can be easily solved by the proposed MPC optimization. Figure 5 illustrates a visualization process of path planning on the parking lot of testing site created in the graphical user interface (GUI) of the ROS visualization tool (RViz).

4. Model Predictive Control

The MPC that imitates the working pattern of the human brain is here applied to autonomous vehicles under various constraints. Figure 6 illustrates the conceptual diagram of MPC. The measured or estimated system states are sent to the MPC block, where the optimal control action is calculated by a system model and constraints to track the pre-filtered set points by minimizing a cost function.

4.1. Vehicle States Prediction Model

The system model in Figure 6 is responsible for vehicle states prediction. The kinematic model (5) can be linearized about a reference state x ¯ = x r ,   y r ,   ψ r T and a reference control input u ¯ = v r ,     δ r T by Taylor series expansion after neglecting high-order terms:
x ^ ˙ t   = A 1 x ^ t   +   B 1 u 1 t ,
A 1 = 0 0 v r sin ψ r 0 0 v r cos ψ r 0 0 1 ,
B 1 = cos ψ r 0 sin ψ r 0 tan ( δ ) L v r L cos 2 δ r ,
where x ^ = x x r ,   y y r ,   ψ ψ r T ,   u 1 = v v r ,   δ δ r T .
Under the assumptions of a small steering angle, s i n   δ 0 , and c o s   δ 1 , and small changing rate of side slip angle, /dt = 0, dynamic Equations (6)–(12) can be simplified with the Magic Formula tire model (4) as
m v ˙ y = m v x ψ + 2 C α f δ v y + L f ψ ˙ v x +   C α r L r ψ ˙ v y v x ,
m v ˙ x = m v y ψ + 2 C t N f + C α f δ v y + L f ψ ˙ v x +   C t N r ,
I Z ψ ¨ = 2 L f C α f δ v y + L f ψ ˙ v x   L r C α r L r ψ ˙ v y v x ,
X ˙ = v x cos ψ v y sin ψ ,
Y ˙ = v x sin ψ + v y cos ψ ,
where 2Ct(Nf + Nr) represents the driving force or braking force exerted between tires and ground. Define a new state z = [vy, vx, ψ, ψ ˙ , Y, X]T, and input u2 = [δ, p], where p = 2Ct(Nf + Nr)/m denotes the pedal angle of accelerator or brake. The linearized state-space model of (17)–(21) is derived as
z ˙ = A 2 t z t   +   B 2 t u 2 t ,
where
A 2 ( t )   =   [ 2 C a f   +   C a r m v x A 12 0 v x + 2 L r C α r     L f C α f m v x 0 0 ψ ˙ 2 C α f m v x A 22 0 v y 2 L f C α f m v x 0 0 0 0 0 1 0 0 2 L r C α r     L f C α f I z v x A 42 0 2 I z v x L f 2 C α f + L r 2 C α r 0 0 cos ψ sin ψ A 53 0 0 0 sin ψ cos ψ A 63 0 0 0 ] ,
A 12 = 2 m v x 2 C α f v y + L f ψ ˙   +   C α r v y L r ψ ˙   ψ ˙ ,
A 22 = 2 C α f m v x 2 v y + L f ψ ˙ ,
A 42 = 2 I z v x 2 L f C α f v y + L f ψ ˙   L r C α r v y L r ψ ˙ ,
A 53 = v x cos ψ v y sin ψ ,
A 63 = v y sin ψ v x cos ψ ,
B 2 t   = 2 C α f m 2 C α f m 0 2 L f C α f I z 0 0 0 1 0 0 0 0 T .

4.2. Cost Function and Constraints

The cost function for the MPC is defined in a quadratic form:
J = w e t e t 2 + w e ψ e ψ 2 + w p p 2 + w p ˙ p ˙ 2 + w δ δ 2 + w Δ δ Δ δ 2 + w v δ v δ 2 + w v v v r 2 ,
where e t = x x r 2 + y y r 2 is the cross-tracking error from reference path, e ψ = ψ ψ r is the heading error from reference path, as shown in Figure 7. The weighting factors w’s account for the importance of vehicle safety, energy-saving, comfort, and agility. For safety and agility, w e t weighs the cross-tracking error from reference path, and w e ψ the heading error from reference path. For energy-saving, w p weighs the pedal angle of accelerator or brake, and w p ˙ the change of the pedal angle of accelerator or brake. For comfort and safety, w δ weighs the steering angle, w Δ δ the change of steering angle, and w v δ the coupling effect of vehicle speed and steering angle. For agility, w v weighs the vehicle speed deviation from the reference.
It is interesting to devise a rule of choosing reasonable values for the eight weighting factors. First, the eight weighting factors can be grouped into two categories: the weightings w e t , w e φ , w v , and w v δ on the importance of vehicle states, and the weightings w δ , w Δ δ , w p , and w p ˙ on the importance of control variables. The former category relates more about vehicle safety by evaluating the trajectory tracking and heading errors as well as speed errors, while the latter relates more about energy-saving and somewhat of driving comfort. Agility has something to do with fast response. In this paper, when we say that the self-driving vehicle is agile, it means that the vehicle returns quickly back to the planned reference trajectory from which the vehicle may deviate. Therefore, the weightings on w e t , w e φ and w v care both tracking errors and fast response to diminish the errors.
Safe driving is always the first rule for a self-driving vehicle. It is suggested in this paper that, in any cases, 60% or more weightings should be assigned to the vehicle states category which emphasizes safe driving, but less weightings be put to the control variables category to consider moderately the energy saving and comfort of driving.
The inequality constraints of control input u and Δ u are hard constraints, while the predicted outputs are usually soft constraints, as follows:
u m i n k     u k + j     u m a x k y m i n k     y k + j     y m a x k .

5. Experiments and Results

The HiL simulation platform for experiments encompasses two parts as shown in Figure 8. The hardware part in quadrants 1 and 2 consists of an Nvidia AutoChauffeur PX2, a power steering wheel with motor, and an accelerator and brake pedal and its controller (Logitech G29). The software part includes:
(1)
ROS on the Nvidia PX2 in quadrant 1, where the proposed hybrid A-star path planning algorithm and MPC algorithm are executed;
(2)
Vehicle kinematic and dynamic models model coded in the Matlab/Simulink platform in quadrant 3;
(3)
Sensor models of GPS, camera, radar, and lidar, and the world map for simulation provided by PreScan platform in quadrant 4.
The test field was on the ITRI campus, whose map was planned off-line by the hybrid A-star algorithm in the PreScan simulation platform. In each sampling period of 100 ms, the proposed MPC took from the map of planned path 20–40 waypoints ahead of the current position to calculate a new control action by applying an open source Interio Point Optimizer (Ipopt) [27]. The experimental setup is illustrated in Figure 9, and parts of the test field are illustrated in Figure 10. This section verifies the feasibility of the hybrid A-star path planning and the proposed MPC strategy through three different simulation scenarios.

5.1. Self-driving Performance

In order to verify the independence and intuitiveness of the weighting factors in the cost function of the MPC strategy, two sets of weighting factors are assigned, as shown in Table 1. As was suggested, that in any cases 60% or more weighting should be assigned to the vehicle states category that emphasized safe driving. Setting 1 has 85% weighting and Setting 2 has 62.5% weighting on the vehicle states category. For more insight into the weighting factors on the tracking and heading errors, Setting 1 puts 27.5% each on w e t and w e ψ , but Setting 2 puts only 17.5% each on w e t and w e ψ . In other words, Setting 1 puts more importance on safety than Setting 2, in terms of 55% versus 35% on the weighting factors w e t and w e ψ .
In contrast, less importance is suggested for the category of control variables, considering the energy saving and comfort of the vehicle. For energy saving, Setting 2 assigns 20% but Setting 1 assigns only 10% weighting to w p and w p ˙ , which means that more importance on energy saving is given in Setting 2 than in Setting 1. For the importance of comfort, Setting 2 allocates 32.5% while Setting 1 allocates only 15% weighting to w δ , w Δ δ , and w v δ , which means that Setting 2 may cause more driving comfort than Setting 1.
Figure 11, marked with driving ordering numbers, shows that on the prescribed route in Figure 10, Setting 1 has better tracking and heading performances than Setting 2, where more erroneous offsets are observed, especially at corners, from the prescribed route. Figure 12 also shows that the self-driving vehicle with Setting 1 ( w v at 20%) follows the prescribed tracking speed at 10 km/h better than that of Setting 2 ( w v at 12.5%). However, Figure 13 shows that the lateral acceleration curve of Setting 2 is much smoother and therefore more comfortable for passengers in the vehicle, than that of Setting 1.

5.2. Double Lane Change (DLC)

The DLC experiment investigated the driving performance of the proposed MPC strategy and compared it to the traditional proportional–integral–derivative (PID) controller. Both the driver’s model and the ISO 3888-2 DLC test scenario were built in in the PreScan simulation platform. Figure 14 shows that the tracking error of the vehicle on the DLC route by the MPC strategy was smaller than that of the traditional PID controller. Similarly, from Figure 15, the MPC strategy resulted in a better DLC performance than the PID controller in terms of vehicle lateral acceleration.

5.3. Energy Efficiency Simulation

Energy saving is often considered a secondary requirement for self-driving vehicles. With the same scenario of the planned path in Figure 11, the energy efficiency is investigated with 10 sets of prescribed weighting factors in Table 2. The weightings on the vehicle states were still assigned with a high percentage within 45–55% to emphasize safe driving. In addition, it is noticed that the weightings on w v and w v δ were given at the same value, and the resultant weightings on w δ and w Δ δ were assigned within a narrow range between 20.5 and 24, so that the agility and driving comfort were equally important for all these cases. Thus, the major difference was between the weightings w e t and w e φ on the tracking and heading errors and the weightings w p and w p ˙ on the energy saving. The range of the resultant values of w p and w p ˙ was between 23 and 34.5.
Figure 16 shows the time histories of the accelerator pedal angle in percentage (%) for the traditional PID controller and for the three selected cases (1, 3, and 10) to investigate energy efficiency by the proposed MPC strategy for self-driving vehiclecontrol. Since the sampling frequency was 10 Hz in the simulation, the energy consumption was estimated by summing 1200 data of pedal angles, each of which corresponds to an equivalent amount of power. Here, the equivalent power per 1% of pedal angle is assumed to be Q in W/% the total energy consumption can be calculated by
E = Q 3600 k = 1 1200 p k Wh .
It is easy to understand that the summation is the estimate of energy consumption that is simply the enclosed area under the curve p(t). The energy efficiency improvement was then calculated by
Δ η = E P I D E M P C E P I D × 100 % ,
where E P I D was 8.96Q (Wh). The E M P C and Δ η of each case are shown in Table 2. The relationship bewteen the energy efficiency improvement and the weighting ( w p + w p ˙ ) on energy saving is given in Figure 17. As was predicted, the energy efficiency was better if the weighting on energy saving was higher.

5.4. Integral Test of Path Planning and Auto-Parking

In this experiment, we tested manual driving mode, self-driving mode, dynamic path planning, obstacle avoidance, and automatic parking. The parking lot map (Figure 10) was created in the PreScan simulation platform. In Figure 18, a driver on the HiL platform drove the “virtual” vehicle manually to the entrance to the parking lot in about 100 s. After selecting a parking space on the graphical user interface in ROS (RViz), the driver switched to self-driving mode. The vehicle automatically followed the prescribed reference path without any obstacle. Around 200 s, the vehicle detected an obstacle via RADAR and made an emergency stop. At this point, the hybrid A-star recalculated and updated a new path to avoid the obstacle. Finally, the vehicle passed the obstacle and parked in the selected space. The corresponding curves of the steering angle, yaw rate, and brake pedal signal during the path planning and auto-parking scenarios are shown, respectively, in Figure 19, Figure 20 and Figure 21, where ordering numbers are provided in correspondence with those in Figure 18.

6. Conclusions

This paper applied a hybrid A-star algorithm for path planning and the MPC strategy for a self-driving e-van on the HiL simulation platform. The hardware of the platform consisted of an electric power steering system, accelerator, and brake pedals, and an Nvidia drive PX2 on ROS. The vehicle dynamics model, sensors, controller, and test field map were virtually built with the PreScan simulation platform. In comparison with the traditional PID control, the path tracking performance was improved by the proposed MPC strategy by minimizing the prescribed cost function which accounted for vehicle safety, energy-saving, comfort, and agility. Three self-driving scenarios were presented. Self-driving performance was first investigated by two different sets of weighting factors for the cost function of MPC, each accounting for different levels of importance on vehicle safety, energy-saving, comfort, and agility. Second, the stability and tracking performance of the ISO 38888-2 DLC test by the proposed MPC was verified to be better than that by the traditional PID controller. Finally, an integral test was executed on the HiL platform to demonstrate the feasibility of the shift from manual to self-driving mode, obstacle avoidance, dynamic path planning, and auto-parking. This HiL platform can be used for future development of path planning, sensing, perception, decision-making, and control for any kind of self-driving vehicles.

Author Contributions

Y.C. and Y.-P.Y. devised and planned the experiments; Y.C. executed the experiments and explained the data; both Y.-P.Y. and Y.C. composed and edited the paper. Both authors have read and agreed to the published version of the manuscript.

Funding

This research was financially supported by the Ministry of Science and Technology (MOST) of Taiwan, Republic of China under contract MOST 109-2221-E-002-153.

Data Availability Statement

This paper used the open source software package Ipopt for large-scale nonlinear optimization from https://coin-or.github.io/Ipopt/ (accessed on 3 September 2021).

Acknowledgments

The authors acknowledge all the engineering support with experimental equipment and HiL simulation platform, from the intelligent mobility division of Mechanical and Mechatronics Systems Research Laboratories, Industrial Technology Research Institute, Hsinchu 31057, Taiwan, China.

Conflicts of Interest

The authors claim no conflict of interest.

References

  1. Baluja, S. Evolution of an artificial neural network based autonomous land vehicle controller. IEEE Trans. Syst. Man Cybern. Part B 1996, 26, 450–463. [Google Scholar] [CrossRef] [PubMed]
  2. Vestri, C.; Bougnoux, S.; Bendahan, R.; Fintzel, K.; Wybo, S.; Abad, F.; Kakinami, T. Evaluation of a vision-based parking assistance system. In Proceedings of the 2005 IEEE Intelligent Transportation Systems, Vienna, Austria, 16 September 2005; IEEE: Piscataway, NJ, USA, 2005; pp. 131–135. [Google Scholar]
  3. Rashid, M.M.; Musa, A.; Rahman, M.A.; Farahana, N.; Farhana, A. Automatic Parking Management System and Parking Fee Collection Based on Number Plate Recognition. Int. J. Mach. Learn. Comput. 2012, 2, 93–98. [Google Scholar] [CrossRef]
  4. Wu, T.-F.; Tsai, P.-S.; Hu, N.-T.; Chen, J.-Y. Research and implementation of auto parking system based on ultrasonic sensors. In Proceedings of the 2016 International Conference on Advanced Materials for Science and Engineering (ICAMSE), Tainan, Taiwan, 12–13 November 2016; Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2016; pp. 643–645. [Google Scholar]
  5. Jung, H.G.; Cho, Y.H.; Yoon, P.J.; Kim, J. Scanning Laser Radar-Based Target Position Designation for Parking Aid System. IEEE Trans. Intell. Transp. Syst. 2008, 9, 406–424. [Google Scholar] [CrossRef]
  6. Tashiro, T. Vehicle steering control with MPC for target trajectory tracking of autonomous reverse parking. In Proceedings of the 2013 IEEE International Conference on Control Applications (CCA), Hyderabad, India, 28–30 August 2013; IEEE: Piscataway, NJ, USA, 2013; pp. 247–251. [Google Scholar]
  7. LaValle, S.M. Rapidly-exploring random trees: A new tool for path planning. Mathematics 1998.
  8. Urmson, C.; Simmons, R. Approaches for heuristically biasing RRT growth. In Proceedings of the 2003 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2003) (Cat. No.03CH37453), Las Vegas, NV, USA, 27–31 October 2003; Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2004; Volume 2, pp. 1178–1183. [Google Scholar]
  9. Barraquand, J.; Latombe, J.-C. Robot Motion Planning: A Distributed Representation Approach. Int. J. Robot. Res. 1991, 10, 628–649. [Google Scholar] [CrossRef]
  10. Clarke, G.; Wright, J.W. Scheduling of Vehicles from a Central Depot to a Number of Delivery Points. Oper. Res. 1964, 12, 568–581. [Google Scholar] [CrossRef]
  11. Dolgov, D.; Thrun, S.; Montemerlo, M.; Diebel, J. Practical search techniques in path planning for autonomous driving. In Proceedings of the First International Symposium on Search Techniques in Artificial Intelligence and Robotics, Chicago, IL, USA, 13–14 July 2008; pp. 32–37. [Google Scholar]
  12. Loukatos, D.; Petrongonas, E.; Manes, K.; Kyrtopoulos, I.-V.; Dimou, V.; Arvanitis, K. A Synergy of Innovative Technologies towards Implementing an Autonomous DIY Electric Vehicle for Harvester-Assisting Purposes. Machines 2021, 9, 82. [Google Scholar] [CrossRef]
  13. Åström, K.J.; Hägglund, T. Advanced PID Control; ISA-The Instrumentation, Systems, and Automation Society: Research Triangle Park, NC, USA, 2006. [Google Scholar]
  14. Ao, D.; Huang, W.; Wong, P.K.; Li, J. Robust Backstepping Super-Twisting Sliding Mode Control for Autonomous Vehicle Path Following. IEEE Access 2021. [CrossRef]
  15. Yu, L.; Yan, X.; Kuang, Z.; Chen, B.; Zhao, Y. Driverless Bus Path Tracking Based on Fuzzy Pure Pursuit Control with a Front Axle Reference. Appl. Sci. 2019, 10, 230. [Google Scholar] [CrossRef] [Green Version]
  16. Elbanhawi, M.; Simic, M.; Jazar, R. Receding horizon lateral vehicle control for pure pursuit path tracking. J. Vib. Control. 2016, 24, 619–642. [Google Scholar] [CrossRef]
  17. Samak, C.V.; Samak, T.V.; Kandhasamy, S. Proximally optimal predictive control algorithm for path tracking of self-driving cars. arXiv 2021, arXiv:2103.13240. [Google Scholar]
  18. Nagariya, A.; Saripalli, S. An Iterative LQR Controller for Off-Road and On-Road Vehicles using a Neural Network Dynamics Model. In Proceedings of the 2020 IEEE Intelligent Vehicles Symposium (IV), Las Vegas, NV, USA, 19 October–13 November 2020; Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2020; pp. 1740–1745. [Google Scholar]
  19. Chowdhri, N.; Ferranti, L.; Iribarren, F.S.; Shyrokau, B. Integrated nonlinear model predictive control for automated driving. Control Eng. Pract. 2021, 106, 104654. [Google Scholar] [CrossRef]
  20. Zhang, W. A robust lateral tracking control strategy for autonomous driving vehicles. Mech. Syst. Signal Process. 2021, 150, 107238. [Google Scholar] [CrossRef]
  21. Farag, W. Complex-Track Following in Real-Time Using Model-Based Predictive Control. Int. J. Intell. Transp. Syst. Res. 2021, 19, 112–127. [Google Scholar] [CrossRef]
  22. Zhang, R.; Rossi, F.; Pavone, M. Model predictive control of autonomous mobility-on-demand systems. In Proceedings of the 2016 IEEE International Conference on Robotics and Automation (ICRA), Stockholm, Sweden, 16–21 May 2016; Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2016; pp. 1382–1389. [Google Scholar]
  23. Vougioukas, S.G. Reactive Trajectory Tracking for Mobile Robots based on Non Linear Model Predictive Control. In Proceedings of the Proceedings 2007 IEEE International Conference on Robotics and Automation, Rome, Italy, 10–14 April 2007; Institute of Electrical and Electronics Engineers (IEEE): Piscataway, NJ, USA, 2007; pp. 3074–3079. [Google Scholar]
  24. Falcone, P.; Borrelli, F.; Tseng, H.E.; Asgari, J.; Hrovat, D. Linear time-varying model predictive control and its application to active steering systems: Stability analysis and experimental validation. Int. J. Robust Nonlinear Control 2008, 18, 862–875. [Google Scholar] [CrossRef]
  25. Kurzer, K. Path Planning in Unstructured Environments: A Real-Time Hybrid A* Implementation for Fast and Deterministic Path Generation for the KTH Research Concept Vehicle. Master’s Thesis, Integrated Transport Research Lab., Karlsruhe Institute of Technology, Baden-Wuerttemberg, Germany, 2016. [Google Scholar]
  26. Reeds, J.; Shepp, L. Optimal paths for a car that goes both forwards and backwards. Pac. J. Math. 1990, 145, 367–393. [Google Scholar] [CrossRef] [Green Version]
  27. Wächter, A.; Biegler, L.T. On the implementation of a primal-dual interior point filter line search algorithm for large-scale nonlinear programming. Math. Program. 2006, 106, 25–57. [Google Scholar] [CrossRef]
Figure 1. Bicycle model of the vehicle.
Figure 1. Bicycle model of the vehicle.
Electronics 10 02447 g001
Figure 2. Vehicle dynamics models in the (a) longitudinal and (b) lateral directions.
Figure 2. Vehicle dynamics models in the (a) longitudinal and (b) lateral directions.
Electronics 10 02447 g002
Figure 3. Traditional A* searching path (left) vs. hybrid A* searching path (right).
Figure 3. Traditional A* searching path (left) vs. hybrid A* searching path (right).
Electronics 10 02447 g003
Figure 4. Forward part in the path planning process on PreScan platform.
Figure 4. Forward part in the path planning process on PreScan platform.
Electronics 10 02447 g004
Figure 5. A visualization process of path planning on the parking lot created by RViz.
Figure 5. A visualization process of path planning on the parking lot created by RViz.
Electronics 10 02447 g005
Figure 6. Structure of model predictive control.
Figure 6. Structure of model predictive control.
Electronics 10 02447 g006
Figure 7. Definition of cross tracking and heading errors.
Figure 7. Definition of cross tracking and heading errors.
Electronics 10 02447 g007
Figure 8. Architecture of HiL simulation platform and experimental rig.
Figure 8. Architecture of HiL simulation platform and experimental rig.
Electronics 10 02447 g008
Figure 9. HiL experimental setup.
Figure 9. HiL experimental setup.
Electronics 10 02447 g009
Figure 10. Self-driving route (red star line) by PreScan and parking lot map on the test field.
Figure 10. Self-driving route (red star line) by PreScan and parking lot map on the test field.
Electronics 10 02447 g010
Figure 11. Tracking performance on the prescribed route with different emphasis on safety and comfort. Setting 1 has better tracking performance than Setting 2.
Figure 11. Tracking performance on the prescribed route with different emphasis on safety and comfort. Setting 1 has better tracking performance than Setting 2.
Electronics 10 02447 g011
Figure 12. Vehicle speed performance on the prescribed route with different emphasis on safety and comfort. Setting 1 follows the reference speed better than Setting 2.
Figure 12. Vehicle speed performance on the prescribed route with different emphasis on safety and comfort. Setting 1 follows the reference speed better than Setting 2.
Electronics 10 02447 g012
Figure 13. Vehicle lateral acceleration curve on the prescribed route with different emphasis on safety and comfort. Setting 2 provides more comfort driving than Setting 1.
Figure 13. Vehicle lateral acceleration curve on the prescribed route with different emphasis on safety and comfort. Setting 2 provides more comfort driving than Setting 1.
Electronics 10 02447 g013
Figure 14. Vehicle tracking error on the DLC test by MPC and PID controllers.
Figure 14. Vehicle tracking error on the DLC test by MPC and PID controllers.
Electronics 10 02447 g014
Figure 15. Vehicle yaw rate on the DLC test by MPC and PID controllers.
Figure 15. Vehicle yaw rate on the DLC test by MPC and PID controllers.
Electronics 10 02447 g015
Figure 16. Accelerator pedal angle (%) history of (a) PID controller, and MPC with (b) Case 1, (c) Case 3, and (d) Case 10 for energy saving simulation. (The area under the curve represents energy consumption).
Figure 16. Accelerator pedal angle (%) history of (a) PID controller, and MPC with (b) Case 1, (c) Case 3, and (d) Case 10 for energy saving simulation. (The area under the curve represents energy consumption).
Electronics 10 02447 g016
Figure 17. Energy efficiency improvement versus the resultant weighing factors ( w p + w p ˙ ).
Figure 17. Energy efficiency improvement versus the resultant weighing factors ( w p + w p ˙ ).
Electronics 10 02447 g017
Figure 18. 2D map of path planning and auto-parking scenario.
Figure 18. 2D map of path planning and auto-parking scenario.
Electronics 10 02447 g018
Figure 19. Vehicle steering angle curve during the path planning and auto-parking scenario.
Figure 19. Vehicle steering angle curve during the path planning and auto-parking scenario.
Electronics 10 02447 g019
Figure 20. Vehicle yaw rate curve during the path planning and auto-parking scenario.
Figure 20. Vehicle yaw rate curve during the path planning and auto-parking scenario.
Electronics 10 02447 g020
Figure 21. Vehicle brake pedal curve during the path planning and auto-parking scenario.
Figure 21. Vehicle brake pedal curve during the path planning and auto-parking scenario.
Electronics 10 02447 g021
Table 1. Weighting factors for self-driving test.
Table 1. Weighting factors for self-driving test.
WeightingsCase 1Case 2Index of Importance *
Unit%%SECA
Vehicle states w e t 27.517.5
w e φ 27.517.5
w v 2012.5
w v δ 1015
Control
variables
w δ 1.57.5
w Δ δ 3.510
w p 4.55
w p ˙ 5.515
* S (safety), E (energy-saving), C (comfort), A (agility). ● means highly while ▲ partially correlated to S, E, C, or A.
Table 2. Weighting factors and energy efficiency improvement.
Table 2. Weighting factors and energy efficiency improvement.
Weighting Factors (%)
Case12345678910
Vehicle states w e t 12.517.515.512.5161817.5141517.5
w e φ 12.515.51312.5151715.5131316
w v 10101010101010101010
w v δ 10101010101010101010
Control
variables
w δ 888108.58.591098
w Δ δ 12.5151514151515141415
Weightings on energy saving
w p 14.51218.51991813211410
w p ˙ 2012101416.5910101513.5
w p + w p ˙ 34.52428.53325.52723312923.5
E M P C (QWh)8.288.688.458.318.648.608.498.328.398.73
Δ η (%)7.53.35.67.33.64.12.57.26.32.6
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Chung, Y.; Yang, Y.-P. Hardware-in-the-Loop Simulation of Self-Driving Electric Vehicles by Dynamic Path Planning and Model Predictive Control. Electronics 2021, 10, 2447. https://doi.org/10.3390/electronics10192447

AMA Style

Chung Y, Yang Y-P. Hardware-in-the-Loop Simulation of Self-Driving Electric Vehicles by Dynamic Path Planning and Model Predictive Control. Electronics. 2021; 10(19):2447. https://doi.org/10.3390/electronics10192447

Chicago/Turabian Style

Chung, Yi, and Yee-Pien Yang. 2021. "Hardware-in-the-Loop Simulation of Self-Driving Electric Vehicles by Dynamic Path Planning and Model Predictive Control" Electronics 10, no. 19: 2447. https://doi.org/10.3390/electronics10192447

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop