Assume the path is approximated by second-order polynominals:
- longitudinal velocity cruise control: PI controller
- lane following control: MPC regulation control, Please refer to another folder Optimal regulation control
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
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.
Please go to Trajectory_generator.m, change the function for "quandratic curve" by adding a negative sign:
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>
Then you are ready to go! See the results below: