Personalized Driving Styles in Safety-Critical Scenarios for Autonomous Vehicles: An Approach Using Driver-in-the-Loop Simulations

: This paper explores the use of driver-in-the-loop simulations to detect personalized driving styles in autonomous vehicles. The driving simulator used in this study is modular and adaptable, allowing for the testing and validation of control and data-collecting systems, as well as the incorporation and proof of car models. The selected scenario is a double lane change maneuver to overtake a stationary obstacle at a relatively high speed. The user’s behavior was recorded, and lateral accelerations during the maneuver were used as criteria to compare the user-driven vehicle and the autonomous one. The tuning parameters of the lateral and longitudinal controllers were modiﬁed to obtain different lateral accelerations of the autonomous vehicle. A neural network was developed to ﬁnd the combination of the two controllers’ tuning parameters to match the driver’s lateral accelerations in the same double lane change overtaking action. The results are promising, and this study suggests that driver-in-the-loop simulations can help increase autonomous vehicles’ safety while preserving individual driving styles. This could result in creating more individualized and secure autonomous driving systems that consider the preferences and behavior of the driver.


Introduction
Transport systems, whether for goods or passengers, regardless of their type (railways, roads, ships, air), must meet certain safety conditions.According to the authors of this study [1], the key elements of the road transport system that need to be focused on to enhance safety are (a) the infrastructure, (b) the users, (c) the vehicles, and (d) the facilities.In the last decade, the problem of implementing autonomous vehicles in road transport systems has been raised.Like classic vehicles, these must meet the safety conditions the transport systems impose.In addition, there are other challenges for these vehicles, which are related to replicating their operation and copying the mode of operation from classic vehicles with a driver.
Autonomous vehicles (AVs) are designed with advanced algorithms and sensor systems to behave predictably in various driving situations.On the other hand, human drivers have varied, and unique driving styles influenced by individual experiences and habits [2].This difference can produce uncertainty in scenarios where human drivers and autonomous vehicles interact, especially in the case of safety-critical situations, such as lane changing.This uncertainty requires a deeper approach to personal driving style identification and exploring how such individual skills can be integrated into the operational logic of AVs.
Transferring personal skills to autonomous vehicles would likely involve identifying the specific skills relevant to the task designing algorithms that can replicate those skills and testing and refining those algorithms in various scenarios.In essence, transferring personal

Related Work
In recent years, there has been a notable focus on transforming the driver's role in the context of autonomous vehicles.The aim is to shift the driver's status from an active participant passenger to a completely passive one.According to the SAE definition [9], the levels of autonomous driving range from level 0 (fully human-driven) to level 5 (fully autonomous), with most passenger vehicles currently at levels 1-3.The development of level 4 and 5 vehicles requires the successful implementation of algorithms [10,11] for navigation, path tracking, and control, as well as robustness and self-diagnosis capabilities to handle critical situations.However, a significant challenge in this field is to make autonomous vehicles behave more like human drivers, particularly in safety-critical situations.
Numerous variables, including the driver's personality, driving history, comfort level with technology, and even distractions, have a significant impact on one's driving style [12].Therefore, in the case of safety-critical scenarios, where quick and precise decision-making is vital, there is a delicate balance between maintaining behavior personalization and ensuring optimal safety [13].
Identifying and adapting to personalized driving styles becomes a cornerstone in increasing autonomous driving capabilities.Researchers are investigating ways to transmit personal driving styles to autonomous vehicles and enable them to make human-like decisions without needing real tests [14].
Thus, a personalized AV adapts to the user's driving behavior by constructing driver models from observing manual driver styles and designing vehicle controllers that can be parameterized to be personalized to specific driving styles using these models.The driver model can determine how a human would drive, and it is designed based on users' actual driving behavior in a series of typical traffic scenarios.By incorporating a driver's driving behavior and adjusting the control system accordingly, a personalized AV can provide a system with the ability to personalize each individual driver and gain such drivers' trust.
Driving behavior research based on driving simulators eliminates road test difficulties, allowing the opportunity to test different driving situations in a controlled and safe environment [15].The driving simulator allows for an understanding of driving behavior due to the possibility of realistic interaction in a safe operating environment, generating feedback [16].Several researchers have used this method to implement and verify the driving styles of autonomous vehicles and their reactions in special cases.
In [17], in the driving simulator experiment, the warning type in the head-up display (HUD) varied in its strategy (attention-/reaction-oriented) and specificity (generic/specific) over four warning groups and a control group without a warning.The study investigated how to warn drivers visually to prevent accidents in various safety-critical situations, with collision frequencies, driving behavior, and subjective evaluations of situation criticality and warning understandability being measured.The study results showed that drivers rated the warning concepts more understandable in the second trial than in the first, but the understandability was relatively high both times.The analysis of the warning understandability showed a significant interaction effect of the factor's scenario and warning type, with each of the three factors themselves having a primary effect on the warning understandability.
In [3], a framework for generating safety-critical driving scenarios is proposed: a Conditional Multiple Trajectory Synthesizer (CMTS), which is able to test the autonomous driving algorithms in near-miss scenarios that are rarely found in off-the-shelf datasets.A CMTS connects safe and collision driving data by encoding their distributions into a low-dimensional latent space, embedding road information, and synthesizing risk scenarios from the interpolated intermediate distribution.In other words, a CMTS uses a generative model to represent the distributions of safe and collision data and then combines them to generate safety-critical scenarios.
On the other hand, some authors have researched passengers' acceptance of autonomous vehicles.This study [18] suggests that a personalized AV is more reliable and familiar, which can increase a user's willingness to trust the system.The positive effects of personalized AVs may affect the implementation of AVs to facilitate user trust and production and market penetration.Therefore, a personalized AV design should allow a system to be personalized to each driver and gain the driver's trust.A personalized AV can provide a more socially acceptable and trustworthy system by incorporating a driver's driving behavior and adjusting the control system accordingly.
According to [19], future AVs should be designed to allow users to indicate and adjust the vehicle's driving behavior to their own preferences.This would help to maximize comfort in the traveling experience and ensure that the driving style of the autonomous vehicle matches the user's preferences.The study also highlights the importance of considering individual differences in driving style when designing autonomous vehicles.Finally, the study suggests that further research is needed to explore the relationship between driving style and user experience in autonomous vehicles.
Ref. [20] analyzed driving style preferences for conditional automated driving, considering the participants' driving styles.The study also analyzed how experienced system characteristics impact driving style preferences in automated driving.The study used a new approach to analyze user preferences by calculating the difference between the experienced automated driving style and the participants' driving style.
According to [21], the existing algorithms for safety-critical scenario generation are divided into three categories: data-driven generation, adversarial generation, and knowledgebased generation.Simulation platforms and packages are valuable tools for scenario generation.They allow users to create and test scenarios in a virtual environment, which can be more efficient and cost-effective than real-world testing.Additionally, some simulation platforms provide API support for specific programming languages, which allows users to run batches of scenarios.In Ref. [21], the authors mention five main challenges of current works in safety-critical scenario generation:

•
Fidelity-the accuracy and realism of the generated scenarios; • Efficiency-the need to increase the density of safety-critical scenarios while considering computational efficiency; A comprehensive summary of the topic, methodologies, contributions, and gaps employed in previous studies can be found in Table 1.

Methodology
The proposed driver-in-the-loop simulation analyzes the driver's behavior during a safety-critical scenario and transfers it to an autonomous vehicle.The selected scenario is a double lane change maneuver to overtake a stationary obstacle at a relatively high speed (20 m/s) while driving on a two-lane straight road.A realistic driving simulator was built on a six-legged Stewart platform to obtain the driver's behavior, in which the user can interact with the real-time simulation of an electric vehicle using a steering wheel and pedals.The user was instructed to perform the overtaking in their style, and the lateral accelerations during the maneuver were recorded.
As an autonomous vehicle, the same vehicle was designed to perform a similar maneuver in the same conditions.Obviously, the paths of the user-driven vehicle and the autonomous one are different, and we decided to use lateral accelerations during the overtaking process as the criteria to compare the two.The tuning parameters of the lateral and longitudinal controllers were modified to obtain different lateral accelerations of the autonomous vehicle.Although the same reference path is imposed for the autonomous vehicle, different tuning parameters will lead to different paths and lateral acceleration during the maneuver.The main task of this research is to find the combination of the tuning parameters of the two controllers to match the lateral accelerations of the driver in the same double lane change overtaking action.

The Experimental Setup
The experiments are performed on a driver-in-the-loop simulator with a vehicle model running on real-time hardware.Several software modules are used to design the simulation environment, the vehicle model, and the autonomous vehicle.

Hardware
The driver-in-the-loop simulator architecture (Figure 1) consists of the MOOG Motion System 6DOF 2000E hexapod motion platform (Stewart platform), a driver's seat mounted on the motion platform with a seatbelt, a Logitech G29 steering wheel with pedals, three high-definition monitors, a Speedgoat real-time computing platform, one display for tracking the real-time operation, and one computer with a high-performance graphics card.
(20 m/s) while driving on a two-lane straight road.A realistic driving simulator was built on a six-legged Stewart platform to obtain the driver's behavior, in which the user can interact with the real-time simulation of an electric vehicle using a steering wheel and pedals.The user was instructed to perform the overtaking in their style, and the lateral accelerations during the maneuver were recorded.
As an autonomous vehicle, the same vehicle was designed to perform a similar maneuver in the same conditions.Obviously, the paths of the user-driven vehicle and the autonomous one are different, and we decided to use lateral accelerations during the overtaking process as the criteria to compare the two.The tuning parameters of the lateral and longitudinal controllers were modified to obtain different lateral accelerations of the autonomous vehicle.Although the same reference path is imposed for the autonomous vehicle, different tuning parameters will lead to different paths and lateral acceleration during the maneuver.The main task of this research is to find the combination of the tuning parameters of the two controllers to match the lateral accelerations of the driver in the same double lane change overtaking action.

The Experimental Setup
The experiments are performed on a driver-in-the-loop simulator with a vehicle model running on real-time hardware.Several software modules are used to design the simulation environment, the vehicle model, and the autonomous vehicle.

Hardware
The driver-in-the-loop simulator architecture (Figure 1) consists of the MOOG Motion System 6DOF 2000E hexapod motion platform (Stewart platform), a driver's seat mounted on the motion platform with a seatbelt, a Logitech G29 steering wheel with pedals, three high-definition monitors, a Speedgoat real-time computing platform, one display for tracking the real-time operation, and one computer with a high-performance graphics card.(Figure 2b,d).
The simulation scene, designed in RoadRunner 2022a, is imported into Driving Scenario Designer, a MATLAB 2022a application that allows building the scenario in which the driven and the autonomous vehicles are tested.In this scene, vehicles, their paths, and their speeds are introduced (Figure 2c).Also, sensors like cameras, Lidar, and IMU can be mounted on the tested vehicle.MathWorks MATLAB/Simulink 2022a, a high-performance software package, was chosen to create the vehicle model and calculate the motion platform's displacements to reproduce the driving sensations.This software is also used to determine the vehicle's current position, which will be displayed in the simulation environment (Figure 3).
The vehicle model, presented in Figure 3, was developed in the Virtual Vehicle Composer application and contains the battery model, the electric motor, transmission, steering mechanism, suspension, breaks, wheels, and controllers.
Figure 3 shows the following components: the interface with the steering wheel and pedals, the electric vehicle, the controllers, the simulation environment parameters, the visualization module, the sensors mounted on the vehicle, and the motion cueing module that transfers the hexapod platform to the required displacements.
The trajectory of the autonomous vehicle to overtake the stationary obstacle was imposed by points as a reference trajectory to be followed.The simulation scene, designed in RoadRunner 2022a, is imported into Driving Scenario Designer, a MATLAB 2022a application that allows building the scenario in which the driven and the autonomous vehicles are tested.In this scene, vehicles, their paths, and their speeds are introduced (Figure 2c).Also, sensors like cameras, Lidar, and IMU can be mounted on the tested vehicle.
MathWorks MATLAB/Simulink 2022a, a high-performance software package, was chosen to create the vehicle model and calculate the motion platform's displacements to reproduce the driving sensations.This software is also used to determine the vehicle's current position, which will be displayed in the simulation environment (Figure 3).
The vehicle model, presented in Figure 3, was developed in the Virtual Vehicle Composer application and contains the battery model, the electric motor, transmission, steering mechanism, suspension, breaks, wheels, and controllers.
Figure 3 shows the following components: the interface with the steering wheel and pedals, the electric vehicle, the controllers, the simulation environment parameters, the visualization module, the sensors mounted on the vehicle, and the motion cueing module that transfers the hexapod platform to the required displacements.
The trajectory of the autonomous vehicle to overtake the stationary obstacle was imposed by points as a reference trajectory to be followed.

The Connection between Hardware and Software
The motion platform offers fast response and realistic force feedback [23,24].The data transfer between the vehicle model and the hexapod system is based on commands in the form of user datagram protocol (UDP) packages with a frequency of at least 30 Hz, which contain the type of the command and its parameters (in total, eight simple precision real numbers).The vehicle dynamic model was expanded with an additional module that includes the filtering and motion cueing algorithm (MCA).This allows us to take the calculated accelerations of the vehicle and convert them into displacements of the hexapod system in the three translational degrees of freedom (surge, sway, and heave) and the three rotational degrees of freedom (roll, pitch, and yaw) [25].These displacements are commands that reach the hexapod platform, packaged as UDP commands, through a separate network.The efficiency of the MCA is highlighted by the fact that it does not allow the simulator user to perceive any undesirable motion [26].The MCA contains high-pass filters, first-order low-pass filters, and a rate limiter introduced as a hyperbolic tangent function.More information about the motion platform's functionality and the MCA implementation are presented in previous research [27,28].
To ensure the transfer of UDP packets to the hexapod platform and the real-time and seamless operation of the application with complicated models, it was decided to introduce the Speedgoat real-time hardware module [29].Simulink Real-Time [30] and Speedgoat provide real-time computation performance and allow for easy integration of various MATLAB/Simulink models [10].The vehicle dynamic model is compiled into an executable form and loaded into the memory of the Speedgoat system.The real-time operating system (a modified version of Linux) ensures that the simulation steps are executed smoothly with minimal deviation.This allows the system to accurately simulate the motion and behavior of the vehicle in real time.

Obtaining the Tuning Parameters
The selected critical scenario for obtaining the tuning parameters is the overtaking maneuver to avoid a static obstacle.The autonomous vehicle has the task of starting from a standstill, accelerating up to 20 m/s, and changing the traffic lane twice, thus avoiding a possible obstacle that appeared suddenly.In the simulated scenario, this obstacle is a stationary vehicle.

Stanley Controller
The control system is an imperative part of the path planning process of the autonomous vehicle, and the three most known vehicle control methods are pure pursuit, Stanley The motion platform offers fast response and realistic force feedback [23,24].The data transfer between the vehicle model and the hexapod system is based on commands in the form of user datagram protocol (UDP) packages with a frequency of at least 30 Hz, which contain the type of the command and its parameters (in total, eight simple precision real numbers).The vehicle dynamic model was expanded with an additional module that includes the filtering and motion cueing algorithm (MCA).This allows us to take the calculated accelerations of the vehicle and convert them into displacements of the hexapod system in the three translational degrees of freedom (surge, sway, and heave) and the three rotational degrees of freedom (roll, pitch, and yaw) [25].These displacements are commands that reach the hexapod platform, packaged as UDP commands, through a separate network.The efficiency of the MCA is highlighted by the fact that it does not allow the simulator user to perceive any undesirable motion [26].The MCA contains high-pass filters, first-order low-pass filters, and a rate limiter introduced as a hyperbolic tangent function.More information about the motion platform's functionality and the MCA implementation are presented in previous research [27,28].
To ensure the transfer of UDP packets to the hexapod platform and the real-time and seamless operation of the application with complicated models, it was decided to introduce the Speedgoat real-time hardware module [29].Simulink Real-Time [30] and Speedgoat provide real-time computation performance and allow for easy integration of various MATLAB/Simulink models [10].The vehicle dynamic model is compiled into an executable form and loaded into the memory of the Speedgoat system.The real-time operating system (a modified version of Linux) ensures that the simulation steps are executed smoothly with minimal deviation.This allows the system to accurately simulate the motion and behavior of the vehicle in real time.

Obtaining the Tuning Parameters
The selected critical scenario for obtaining the tuning parameters is the overtaking maneuver to avoid a static obstacle.The autonomous vehicle has the task of starting from a standstill, accelerating up to 20 m/s, and changing the traffic lane twice, thus avoiding a possible obstacle that appeared suddenly.In the simulated scenario, this obstacle is a stationary vehicle.

Stanley Controller
The control system is an imperative part of the path planning process of the autonomous vehicle, and the three most known vehicle control methods are pure pursuit, Stanley controller, and model predictive control.The proposed study uses a Stanley pathfollowing controller that steers the vehicle along a desired trajectory by combining lateral and longitudinal control.
The Stanley controller is a path tracking method used by Stanford University's Darpa Grand Challenge team [31].Compared to the pure pursuit method, this method uses the front axle as its reference point and looks at the heading error to adjust the steering angle, making it a practical and steady method for vehicle path tracking [32].The geometry of the Stanley controller is shown in Figure 4.
Vehicles 2023, 5, FOR PEER REVIEW 8 controller, and model predictive control.The proposed study uses a Stanley path-following controller that steers the vehicle along a desired trajectory by combining lateral and longitudinal control.The Stanley controller is a path tracking method used by Stanford University's Darpa Grand Challenge team [31].Compared to the pure pursuit method, this method uses the front axle as its reference point and looks at the heading error to adjust the steering angle, making it a practical and steady method for vehicle path tracking [32].The geometry of the Stanley controller is shown in Figure 4.The required steering angle is calculated based on [32]: where e(t) is the cross-track error, k is the position gain, v is the velocity, δ represents the angle of the front wheels with respect to the vehicle, and  is the yaw angle (heading) of the vehicle with respect to the closest trajectory segment.
According to [32], the Stanley controller is asymptotically stable for any non-zero velocity and steering angles between 0 and ,  .This indicates the range of steering commands that the controller can safely handle.If the required steering angle value exceeds this range, the controller's behavior may not be guaranteed or performed optimally.Considering this range of steering commands, the steering law can be expressed as: The longitudinal controller selects the lowest speed as the desired reference point based on the recommendations provided by the trajectory planner, a safety speed recommender, and a health monitor [32].This controller computes a single proportional integral (PI) with tracking windup and feed-forward gains, and can be expressed as [33]: The required steering angle is calculated based on [32]: where e(t) is the cross-track error, k is the position gain, v is the velocity, δ represents the angle of the front wheels with respect to the vehicle, and Ψ is the yaw angle (heading) of the vehicle with respect to the closest trajectory segment.
According to [32], the Stanley controller is asymptotically stable for any non-zero velocity and steering angles between 0 and π 2 , δ max .This indicates the range of steering commands that the controller can safely handle.If the required steering angle value exceeds this range, the controller's behavior may not be guaranteed or performed optimally.Considering this range of steering commands, the steering law can be expressed as: The longitudinal controller selects the lowest speed as the desired reference point based on the recommendations provided by the trajectory planner, a safety speed recommender, and a health monitor [32].This controller computes a single proportional integral (PI) with tracking windup and feed-forward gains, and can be expressed as [33]: where y represents the nominal control output magnitude, y sat is the saturated control output magnitude, K p is the proportional gain, K i is the integral gain, K f f is the velocity feed-forward gain, K aw is the anti-windup gain, K g is the grade angle feed-forward gain, v nom is the nominal vehicle speed, v re f is the reference velocity, e re f is the velocity error, e out is the difference between saturated and nominal control outputs, and θ is the grade angle.In Section 3.1.2,we describe the vehicle model and the simulation scenario.The vehicle path and the lateral accelerations during the lane changing maneuver were obtained by choosing four relevant tuning parameters of the trajectory controllers: three parameters of the PI longitudinal controller (different longitudinal acceleration modes) and one for the Stanley lateral controller (different trajectories).The other controller parameters do not influence the lateral accelerations.Table 2 presents some of the main parameters of the electric vehicle.The main purpose of the research was the execution of several simulations.They were carried out to choose the right tuning parameters that will impose similar sensations to manual driving under identical conditions.In the first phase, we identified the parameters that will influence the trajectory of the autonomous vehicle and the resulting accelerations during the overtaking maneuver.Four tuning parameters were selected: proportional gain (K p ), integral gain (K i ), velocity feed-forward (K ff ) for the longitudinal controller, and the position gain of forward motion (k) for the lateral controller.
After conducting simulations and testing several parameters, the values of the tuning parameters, as outlined in Table 3, were selected.There were 4 or 5 different values for each parameter, resulting in 400 combinations.With these values, we could generate 400 unique overtaking trajectories and accompanying lateral acceleration curves.Following the simulations, a series of different paths were obtained (shown with different colors in Figure 5), as well as different lateral accelerations (shown with different colors in Figure 6) and longitudinal accelerations (shown with different colors in Figure 7).The obtained curves are shifted in time, even if the overtaking maneuver always starts in the same position because the longitudinal controller parameters differ for each run.

Defining the Learning Algorithm and Selecting the Tuning Parameters
A neural network was designed and trained to select the proper tuning parameters matching the personal driving style [34].Due to the relatively small number of simulations

Defining the Learning Algorithm and Selecting the Tuning Parameters
A neural network was designed and trained to select the proper tuning parameters matching the personal driving style [34].Due to the relatively small number of simulations (400), the learning algorithm is a two-layer neural network with feed-forward information propagation from input (accelerations) to output (tuning parameters).This algorithm calculates the tuning parameters for autonomous driving using recorded data of lateral acceleration of a similar maneuver under similar conditions (performed in the driving simulator).In other words, it can replicate and transfer a driver's driving style to an autonomous vehicle.
The following structure of the neural network was used: thirty input parameters, which are lateral accelerations obtained in manual driving values obtained after the sampling process, twenty-five elements in the first hidden layer, and four elements in the output layer corresponding to the tuning parameters of the autonomous vehicle in the selected scenario (the four parameters in the longitudinal and lateral controller).

Experimental Results
In the first stage, the autonomous vehicle was analyzed during the double lane change overtaking maneuver (Figure 8).Four hundred simulations were performed with the same reference path but there were different values for the four selected longitudinal and lateral acceleration tuning parameters.In the second stage, the users were instructed to drive the car in the simulator.They were asked to accelerate up to the velocity of 20 m/s and then make a double lane change maneuver by overtaking a stationary vehicle on the road.To force the user to follow the path imposed on the autonomous vehicle and to start the overtaking process as close as possible to the stationary obstacle, another vehicle was introduced in the scenario, moving in the opposite direction (Figure 9).In the second stage, the users were instructed to drive the car in the simulator.They were asked to accelerate up to the velocity of 20 m/s and then make a double lane change maneuver by overtaking a stationary vehicle on the road.To force the user to follow the path imposed on the autonomous vehicle and to start the overtaking process as close as possible to the stationary obstacle, another vehicle was introduced in the scenario, moving in the opposite direction (Figure 9).
In the final stage, the neural network matched the lateral acceleration obtained at manual driving to the autonomous vehicle by selecting the right combination of the tuning parameters, thus obtaining the same lateral acceleration.
In the second stage, the users were instructed to drive the car in the simulator.They were asked to accelerate up to the velocity of 20 m/s and then make a double lane change maneuver by overtaking a stationary vehicle on the road.To force the user to follow the path imposed on the autonomous vehicle and to start the overtaking process as close as possible to the stationary obstacle, another vehicle was introduced in the scenario, moving in the opposite direction (Figure 9).In the final stage, the neural network matched the lateral acceleration obtained at manual driving to the autonomous vehicle by selecting the right combination of the tuning parameters, thus obtaining the same lateral acceleration.

Autonomous Vehicle Simulations during the Overtaking Process
The lateral accelerations were recorded (Figure 10: a-recorded data, b-sample determination) using different tuning parameters (Table 3) for the longitudinal and lateral controllers.
Vehicles 2023, 5, FOR PEER REVIEW 13 The lateral accelerations were recorded (Figure 10: a-recorded data , b-sample determination) using different tuning parameters (Table 3) for the longitudinal and lateral controllers.Since the number of recorded data is very high (8000 values/second, and the entire process lasts for 25 s) and the duration of the overtaking process is different in each simulation, they were re-sampled.The process took three stages until the sampling goal was reached.The first stage involves selecting an interval that covers the lane change maneuvers from all 400 simulations (intervals from 13 s to 22 s; Figure 10a).In the second stage, values close to zero were not considered; thus, the absolute threshold of 0.015 m/s 2 was chosen, below which the values were not considered.In the last stage, the remaining values were sampled by dividing them into 30 intervals of equal length (Figure 10b) and selecting only the first value from each interval.Thus, through these samplings, the obtained curve closely follows the original curve and approximates the sensation offered for each tuning parameter combination during the double lane changing maneuver.

Driving Simulator Simulations
In the driving simulator (see Figure 1), the user was instructed to drive the electric Since the number of recorded data is very high (8000 values/second, and the entire process lasts for 25 s) and the duration of the overtaking process is different in each simulation, they were re-sampled.The process took three stages until the sampling goal was reached.The first stage involves selecting an interval that covers the lane change maneuvers from all 400 simulations (intervals from 13 s to 22 s; Figure 10a).In the second stage, values close to zero were not considered; thus, the absolute threshold of 0.015 m/s 2 was chosen, below which the values were not considered.In the last stage, the remaining values were sampled by dividing them into 30 intervals of equal length (Figure 10b) and selecting only the first value from each interval.Thus, through these samplings, the obtained curve closely follows the original curve and approximates the sensation offered for each tuning parameter combination during the double lane changing maneuver.

Driving Simulator Simulations
In the driving simulator (see Figure 1), the user was instructed to drive the electric vehicle in his own preferred style and perform the double lane change maneuver, as mentioned before.The lateral accelerations during the experience were recorded.
The driver simulator produced lateral accelerations that needed to be re-sampled, as in the previous case, specifically the values during the overtaking maneuver.Figure 11 depicts the lateral accelerations obtained while driving in the simulator and the re-sampled values.The goal is to identify the tuning parameters that will generate similar experiences during autonomous driving.To accomplish this, we must discover a curve that closely matches the lateral accelerations observed during the simulations with those gathered while driving in the simulator.

Testing the Selection Algorithm
Comparing autonomous driving (displayed in Figures 6 and 10, where all lateral accelerations are shown) with manual driving (shown in Figure 11: a-recorded data, bsample determination), the start and end of the maneuver are clearly defined in the lateral acceleration curve for autonomous driving, while it is difficult to estimate them in the curve for manual driving.This is because in the simulator, users have different driving styles, and the start and end time varies from one user to another.
We resolved the discrepancy by varying the moment at which we considered the beginning and end of the overtaking maneuver.Thus, variations of 80 values for the beginning and 100 for the endpoint (on the recorded accelerations) were considered, resulting in 8000 combinations of re-sampled lateral acceleration sets.
For each set, the trained neural network will estimate the controllers' four tuning parameters (Parameter 1 to Parameter 4). Figure 12 presents the obtained results for the 8000 trials with different colors.The resulting values are filtered for valid combinations with each of the parameters belonging to the interval in Table 3. Six combinations of the tuning parameters are obtained as valid ones that give lateral accelerations very close to those obtained with manual driving.The obtained results for the valid tuning parameters are presented in Table 4, and the lateral accelerations in these six cases are in Figure 13.These graphs are very close to the values shown in Figure 10a, and the very few (400) cases that were taken into consideration can be used to explain the modest discrepancies.

Testing the Selection Algorithm
Comparing autonomous driving (displayed in Figures 6 and 10, where all lateral accelerations are shown) with manual driving (shown in Figure 11: a-recorded data, b-sample determination), the start and end of the maneuver are clearly defined in the lateral acceleration curve for autonomous driving, while it is difficult to estimate them in the curve for manual driving.This is because in the simulator, users have different driving styles, and the start and end time varies from one user to another.
We resolved the discrepancy by varying the moment at which we considered the beginning and end of the overtaking maneuver.Thus, variations of 80 values for the beginning and 100 for the endpoint (on the recorded accelerations) were considered, resulting in 8000 combinations of re-sampled lateral acceleration sets.
For each set, the trained neural network will estimate the controllers' four tuning parameters (Parameter 1 to Parameter 4). Figure 12 presents the obtained results for the 8000 trials with different colors.The resulting values are filtered for valid combinations with each of the parameters belonging to the interval in Table 3. Six combinations of the tuning parameters are obtained as valid ones that give lateral accelerations very close to those obtained with manual driving.The obtained results for the valid tuning parameters are presented in Table 4, and the lateral accelerations in these six cases are in Figure 13.These graphs are very close to the values shown in Figure 10a, and the very few (400) cases that were taken into consideration can be used to explain the modest discrepancies.

Discussion
Eight users were asked to assess the hardware setup of the vehicle simulator and perform the lane changing maneuver.All of them have considered that the simulator is useful and can efficiently transfer individual driving styles to an autonomous vehicle.Negative aspects mentioned by the users refer to the lack of specific noise and the highfrequency feedback from the vehicle's tires.
The described case study demonstrated the potential of driver-in-the-loop simulations in recognizing individual driving styles in a critical scenario and transferring them to an AV.This study used a series of lateral and longitudinal accelerations to impose different trajectories in autonomous driving in a double lane change maneuver.Different longitudinal and lateral controller parameters can impose different sensations on the passengers.In the same scenario, lateral accelerations in manual driving were recorded.A neural network was proposed to choose four controller parameters to impose lateral acceleration similar to manual driving.The neural network was trained on a relatively small training set (400 combinations of the controller parameters) and could select 6 combinations within the imposed limits to match the manual driving.These six cases closely follow the lateral accelerations obtained in the simulator.
Virtual automobiles and simulators can be used to research autonomous vehicles by allowing for the testing of different driving situations in a controlled and safe environment.This eliminates the difficulties of road tests and allows for an understanding of driving behavior due to the possibility of realistic interaction in safe operating environment, generating visual and kinesthetic feedback.

Conclusions
This paper analyzes the literature on personalized driving styles and autonomous vehicles and cites several studies that have explored the relationship between human driving behavior and autonomous vehicles, including research on driving styles, driving

Discussion
Eight users were asked to assess the hardware setup of the vehicle simulator and perform the changing maneuver.All of them have considered that the simulator is useful and can efficiently transfer individual driving styles to an autonomous vehicle.Negative aspects mentioned by the users refer to the lack of specific noise and the highfrequency feedback from the vehicle's tires.
The described case study demonstrated the potential of driver-in-the-loop simulations in recognizing individual driving styles in a critical scenario and transferring them to an AV.This study used a series of lateral and longitudinal accelerations to impose different trajectories in autonomous driving in a double lane change maneuver.Different longitudinal and lateral controller parameters can impose different sensations on the passengers.In the same scenario, lateral accelerations in manual driving were recorded.A neural network was proposed to choose four controller parameters to impose lateral acceleration similar to manual driving.The neural network was trained on a relatively small training set (400 combinations of the controller parameters) and could select 6 combinations within the imposed limits to match the manual driving.These six cases closely follow the lateral accelerations obtained in the simulator.
Virtual automobiles and simulators can be used to research autonomous vehicles by allowing for the testing of different driving situations in a controlled and safe environment.This eliminates the difficulties of road tests and allows for an understanding of driving behavior due to the possibility of realistic interaction in a safe operating environment, generating visual and kinesthetic feedback.

Conclusions
This paper analyzes the literature on personalized driving styles and autonomous vehicles and cites several studies that have explored the relationship between human driving behavior and autonomous vehicles, including research on driving styles, driving patterns, and driver-vehicle interactions.This paper also discusses the potential of driver-

Figure 1 .
Figure 1.Hardware configuration of the simulator.

3. 1 . 2 .
Software-Driver Model and Simulation Scenarios Several software programs were involved in developing the simulation scenarios (Figure 2), such as RoadRunner 2022a, Epic Game Unreal Engine 4.26, a compiler C++ (Visual Studio 2019), and the Driving Scenario Designer App from MATLAB 2022a and

Figure 1 .
Figure 1.Hardware configuration of the simulator.

3. 1 . 2 .
Software-Driver Model and Simulation Scenarios Several software programs were involved in developing the simulation scenarios (Figure 2), such as RoadRunner 2022a, Epic Game Unreal Engine 4.26, a compiler C++ (Visual Studio 2019), and the Driving Scenario Designer App from MATLAB 2022a and Simulink 2022a.The simulation environment was created in RoadRunner 2022a (Figure 2a), and the simulation's visualization is based on the Epic Games Unreal Engine 4.26 [22] (Figure 2b,d).

Figure 2 .
Figure 2. Development of the simulation environment and scene: (a) test circuit map; (b) details of the route traveled by the autonomous vehicle; (c) paths and speeds; (d) autonomous vehicle in action using Unreal Engine.

Figure 2 .
Figure 2. Development of the simulation environment and scene: (a) test circuit map; (b) details of the route traveled by the autonomous vehicle; (c) paths and speeds; (d) autonomous vehicle in action using Unreal Engine.

Figure 3 .
Figure 3. Vehicle model and the interface with the other elements.

Figure 3 .
Figure 3. Vehicle model and the interface with the other elements.3.1.3.The Connection between Hardware and Software

7 )
. The obtained curves are shifted in time, even if the overtaking maneuver always starts in the same position because the longitudinal controller parameters differ for each run.Changing the tuning parameters allows us to obtain various behaviors, imposing different sensations on the driver.

Figure 11 .
Figure 11.Recorded lateral accelerations during the maneuver in the simulator.

Figure 11 .
Figure 11.Recorded lateral accelerations during the maneuver in the simulator.

Figure 12 .
Figure 12. Results of Parameters 1-4 when running the neural network with lateral accelerations with various start and endpoints.

Figure 12 . 15 Figure 12 .Figure 13 .
Figure 12. Results of Parameters 1-4 when running the neural network with lateral accelerations with various start and endpoints.

Table 1 .
An overview of related work.

Table 3 .
The selected tuning parameters.

Table 4 .
The values of the tuning parameters for the two controllers.

Table 4 .
The values of the tuning parameters for the two controllers.