RO47017 HW03 Description
RO47017 HW03 Description
RO47017 HW03 Description
1) To use the provided template, you need to conduct the following actions:
https://docs.microsoft.com/en‐gb/visualstudio/releasenotes/vs2017‐relnotes
If you don’t have a Visual Studio Subscription, you can create one for free by clicking on “Create a
new Microsoft account” on the login page.
a) Once a compiler is installed it needs to be linked to MATLAB. Open MATLAB and run in
command window:
mex ‐setup
Note: Type this command and not copy‐paste!
MATLAB returns:
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n?
Type “y” and hit enter.
a) unzip the archive to the preferable folder. Note: a very long path of a folder can lead to some
issues. A shorter path is preferable.
You are now ready to compile the ACADO interface. This compilation will take 10‐15 minutes but needs
to be done only once. Run the following command in your command window:
Making ACADO...
and after a while when the compilation is finished:
c) If you need to restart Matlab, run this make file again to set all paths or run savepath in your
console to save the current search path for future sessions.
ACADO has now been compiled. As the text indicated every time you restart MATLAB you need to run
“make” again to set all paths. When running “make” again no new files need to be compiled and the
process will only take a few seconds. However, it is easier to save your paths for future Matlab session.
Do so by running “savepath” in your command window (this step is optional).
savepath;
cd examples/ocp/getting_started/
The file getting_started.m contains the ACADO syntax to setup and execute a simple Optimal Control
Problem. Run “getting_started” in your terminal to test the execution:
getting_started;
Download the template from Brightspace and check that it is working. For this, you need to run the
file “HW03_template_run.m” to compile the solver. After this, you can open the Simulink file
“HW03_template.slx” and run it.
The implementation of template model describes the kinematic model representing by:
l
tan 1 r tan
L
u 0
u
sin
lr
x u cos
y u sin
2) Investigate the influence of weight tuning for lateral position and control input (default 5e‐3 and 1e‐
1 correspondingly) achieving better performance or MPC fails. Also, check how realistic is the steering
input from the controller (no chattering during the manoeuvre).
Note: The actual manoeuvre starts after 5s, therefore, the steering input chattering between 0 to 5
sec can be ignored.
3) Extend the controller plant model by implementing a bicycle model instead of a kinematic model
and add a constraint regarding steering rate.
Hints:
Extra states are needed
The control input will be steering rate d_delta and you need extra state equation:
dot(delta) == d_delta
x t Ax t Bu t , x t0 x0
where A and B are matrices of appropriate dimensions describing LTI system of bicycle model with
constant speed.
4) Simulate both variants 2 and 3 and compare the tracking performance using RMS error for lateral
error and control input.
5) Comment on the behaviour of the controllers in terms of input demands and the tracking
performance and in terms of practical application.
6) Provide your self‐reflection regarding the learning elements and main challenges faced during the
controller design.
Grading policy:
“Early bird submission”, 3 days in advance before the actual deadline: Bonus points (20% of
the final grade) will be provided.
“Normal submission”, before the deadline: Regular assessment.
“Delayed submission”, after the deadline: Reduction of the final grade by 20% for each day.
Note: deviation from the report structure may reflect on the grade.