In this lab session, we will be using the language Julia in something called a notebook. This is an interactive way of presenting code, and in it, we will explore the topic of gain scheduling and optimization based PID controller tuning. If you wish, you could go though the notebook beforehand. You could even install the notebook and try to run parts of it. However, the only prerequisite for the lab is that you have read Chapter 9 in "Adaptive Control" by K.J. Astrom. As an alternative, if you do not have this book, we recommend that you read chapter 9 in the book "The electrical engineering handbook" av C. J. Bett, which is available here: https://www.sciencedirect.com/science/article/pii/B9780121709600500864 If you wish to test the notebook yourselves, then you will need to install Julia. If you are using the Lab computers, they will be preinstalled with Julia 1.0.3 and you can simply proceed from point [1]. If you would like to run the lab on your own computer you will need to install Julia 1.0.3 and then follow the steps from point [2] below. [1] In the terminal, execute the following. ``` cd && git clone https://github.com/JuliaControl/ControlExamples.jl cd ControlExamples.jl mkdir /var/tmp/$USER export JULIA_DEPOT_PATH=/var/tmp/$USER ``` [2] Open Julia and install the necessary packages by running ``` julia using Pkg ``` [3] In the Julia prompt, enter the package manager by writing ], and then ``` dev ControlSystems GR Interact IJulia # Clone and install dev OrdinaryDiffEq Plots ForwardDiff NLopt Roots # Clone and install ``` [4] Next, exist to the Julia prompt, and nbuild IJulia by running ``` Pkg.build("IJulia") ``` [5] Finally, launch the notebook with the lab by running ``` using IJulia notebook() ```