Multi-Body Vehicle Model: Accelerating from v0=0m/s causes problems: Switching from Kinematic STM to Multi-Body Model without correct State-Initialization
Dear commonroad-vehicle-model maintainers,
firstly thank you for providing the vehicle dynamics models as open-source package. We really appreciate it!
While comparing the different vehicle models based on different initial states and input trajectories, I noticed that the Multi-Body Vehicle Model seems to be returning incorrect values, when the model is initialized with zero velocity (v0=0m/s
) and a non-zero acceleration is requested from thereon.
In my analysis of the problem, I found out that the problem lies in the implementation of the Multi-Body Vehicle Model:
- Since the used Pacejka-Tire Model has a singularity at
v=0m/s
, the implementation switches to the Kinematic Single-Track Model forv<0.1m/s
, which is reasonable from my point of view. - However, many of the states of the Multi-Body Model are still computed, even though they are not used until
v>=0.1m/s
is reached. Moreover some of these values are computed wrongly while the Kinematic Single-Track Model is being used. - I noticed that especially the angular velocities of the tires are wrongly computed, while the Kinematic Single-Track Model is used.
- This yields to a extremly high longitudinal tire slip, when the model is switched from the Kinematic Single-Track Model to the Multi-Body Model at
v=0.1m/s
and thus almost no longitudinal force is returned from the tire model, which in turn means, the vehicle does not accelerate anymore (often times it even decelerates).
There are several ways to address this issue in my opinion:
- Easiest fix (not the cleanest solution): While using the Kinematic Single-Track Model, at least compute the angular velocities of each tire based on a kinematic relationship (for example similar to what is being done in the Single-Track-Drift Model: https://gitlab.lrz.de/tum-cps/commonroad-vehicle-models/-/blob/master/MATLAB/vehiclemodels/vehicleDynamics_STD.m#L73-74, or even simpler using the relationship:
d_omega=u(2)/(p.R_w)
). These are the relevant places to change: Python-Implementation: https://gitlab.lrz.de/tum-cps/commonroad-vehicle-models/-/blob/master/PYTHON/vehiclemodels/vehicle_dynamics_mb.py#L344-347, Matlab-Implementation: https://gitlab.lrz.de/tum-cps/commonroad-vehicle-models/-/blob/master/MATLAB/vehiclemodels/vehicleDynamics_MB.m#L300-303 - Sligthly better fix: Apply the easiest fix, but additionally add a functionality, which detects that the vehicle speed passes the threshold from
v<0.1m/s
tov>=0.1m/s
. In the respective time step, call theinit_mb
-function https://gitlab.lrz.de/tum-cps/commonroad-vehicle-models/-/blob/master/MATLAB/vehiclemodels/init_MB.m or https://gitlab.lrz.de/tum-cps/commonroad-vehicle-models/-/blob/master/PYTHON/vehiclemodels/init_mb.py with the current states from the Kinematic Single-Track Model. - Even better fix: Rethink how all the states from the Multi-Body Vehicle Model can be computed for speeds below
0.1m/s
. Maybe it would be a solution to switch to a more simplified tire model, which does not have any singularities atv=0m/s
.
Since we plan on continuing to use the commonroads-vehicle-models, we would be really glad, if this issue could be addressed for a future release and are quite confident, that we are not the only ones, who would benefit from this change. In case the problem description was unclear, or there are additional questions, feel free to reach out to me under: maximilian.steeb@bosch.com.
Thanks in advance. I am looking forward to hearing from you and seeing commonroads evolve! Maximilian Steeb