Skip to content

Latest commit

 

History

History
54 lines (45 loc) · 4.04 KB

readme.md

File metadata and controls

54 lines (45 loc) · 4.04 KB

Vehicle Dynamical model:

Lateral dynamical model:

Crosstrack error Calculation

Assume the path is approximated by second-order polynominals:

Controller design:

  • longitudinal velocity cruise control: PI controller
  • lane following control: MPC regulation control, Please refer to another folder Optimal regulation control

Simulation 1: Single lane following

Process:

  • Run run_model_MPC.m: initialize the simulation variable, define trajectory, solve MPC control gain
  • Run microNole_MPC.slx: lane following simulation
  • Run plotting_file.m: plot all results for you

Stright lane tracking

#### counter clockwise tracking Want to try other trajectory? - Please go to **Trajectory_generator.m**, comment the line defineing "straight line" function, then uncomment the line defining "quandratic curve", shown below:


See tracking error did not converge to 0?

  • increase the simulation time, the error is decreasing
  • Please go to run_model_MPC.m, play with the horizon length (line 113, variable h) for MPC.

clockwise tracking

Please go to Trajectory_generator.m, change the function for "quandratic curve" by adding a negative sign:

Simulation 2:

I use two second-order polynominal path fit a sin cruve, like:
The goal is to control MicroNole to track the blue trajectory first, then switch to red trajectory! Some steps you need to do in order to run simulation:

  • Go to Trajectory_generator.m, comment everything below "single second-order polynominal trajectory", and uncomment everything below "Double Second-order polynominal trajectory" ,br>

- Go to simulink model (**microNole_MPC.slx** - Block **Crosstrack Error Calculation*), change the input augements as shown below, and set the extra inputs as parameters:


Then you are ready to go! See the results below: