This repository contains the code used in the following manuscript currently under review:
- Chen, S.; Chen, H.; Pletta, A.; Negrut, D. Coupled Lateral and Longitudinal Control for Trajectory Tracking, Lateral Stability, and Rollover Prevention using Minimum-Time Predictive Control in Automated Driving, ASME Journal of Dynamic Systems, Measurement, and Control, submitted October, 2020.
Directory descriptions are as follows:
-
src
MPC controller, vehicle models, reference trajectory, and other functions as described in the paper.
-
plots_5.1_verification
Code to reproduce plots verifying model accuracy against Carsim for a step input (Section 5.1, Figure 6).
-
plots_5.2~5.4.1_tracking
Code to reproduce plots demonstrating controller tracking ability for reference trajectory with continuously varying curvature (Sections 5.2-5.4.1, Figures 7, 8, 10, 11).
-
plots_5.4.2_stability
Code to reproduce plots showing resulting stability margins and bounded outputs (Section 5.4.2, Figure 12).
- Ready-to-use MATLAB code
- 8-DOF MPC Controller
- 14-DOF Plant Model
- Reproducible Figures
- Clone this repository.
git clone https://github.com/uwsbel/LateralRollStabilityMPC.git
- Open MATLAB and navigate to the repository to run files.
- Note that you may have to set your MATLAB working directory to the parent directory of a file you wish to run.
Use the following steps to reproduce the plots generated in the paper.
- In MATLAB, navigate to the
plots_5.1_verification
directory. - Run
plot_veh_verification.m
. The file will automatically load required data and produce the verification plots (Figure 6).
Figure 6 (a,b,c,d)
- In MATLAB, navigate to the
plots_5.2~5.4.1_tracking
directory. - Run
plot_path_tracking.m
. The file will automatically load required data and produce the reference trajectory and curvature (Figure 7), minimum-time speed profile (Figure 8), trajectory tracking results (Figure 10), and control inputs for steering and driving torque (Figure 11).
Figure 7 (a,b)
Figure 8
Figure 10 (a,b,c,d)
Figure 11 (a,b)
- In MATLAB, navigate to the
plots_5.4.2_stability
directory. - Run
plot_stability.m
. The file will automatically load required data and produce the plots demonstrating stability and bounded output (Figure 12).
Figure 12 (a,b,c,d,e)
Use the files in the src
directory to experiment with the controller directly. A short description of each file is as follows:
controller_8dofC14DOF_PID_6c_Ny3_soft.m
is the MPC controller that uses an 8-DOF model for predictions. Model parameters are configured as described in Table 1 of the paper. Run this file to use the controller. Note that it can take up to ~30min on "modern" laptops (ex. 25min on Thinkpad T460s Intel(R) Core(TM) i5-6200U)plant_14DOF_vehicle_4.m
is a function that calculates the 14-DOF model as referenced in Figure 2 of the paper.pathpoints_arc.xlsx
is a spreadsheet of path points used for generating the reference trajectory.references1.m
is a function that generates the reference trajectory from a given set of path points.cal_ay.m
is a function that is used byreferences1.m
to calculate longitudinal velocity along the reference trajectory using an 8-DOF model as referenced in Figure 1 of the paper.- Plotting functions are included to display the results (
plot_veh_validation.m
,plot_path_tracking.m
,plot_veh_validation.m
).