Skip to content

Implementations of Control (PID, LQ, MPC, ...) and AI (fuzzy logic, Q-learner, SARSA, ...) algorithms

Notifications You must be signed in to change notification settings

mr-d-self-driving/Control-and-AI-Algorithms

Repository files navigation

Control-and-AI-Algorithms

Implementations of Control (PID, LQ, MPC, ...) and AI (fuzzy logic, Q-learner, SARSA, ...). The algorithms are briefly discussed in this readme, and some results are shown. For detailed explanation, see the readme's of each project.

Overview:

  1. Fuzzy Logic
  2. LQ Control
  3. Model Predictive Control
  4. PID Control
  5. Q-learners and SARSA
  6. System Analysis

Implementation of Fuzzy Logic in MATLAB. In Fuzzy Logic, the truth values of variables may be any real number between 0 and 1. Therefore, it can handle 'partial truth', where the truth value may range between completely true and completely false.

LQ control is implemented using Simulink and MATLAB.

First the situation without control. All variables will go towards their equilibrium values.

With LQ control, the controllable variables (k and v) will go towards the desired value. Uncontrollable variables (s) cannot be controlled.

Sometimes, some variables cannot be measered directly. An observer will estimate these values.

The observer can be combined with LQ control.

Finally, a reduced order observer can be used as well.

To achieve optimal control, the controlmatrix can be optimized (on an other system).

Implementation of MPC on a basic system with the following uncontrolled step response.

After optimization of the parameters, the model predictive control algorithm will accurately responds on a change in the set point. Left the response, right the taken control action.

The calculations done by the MPC around the change in stepoint are visualised below:

The impact of the parameters m and p is visualised:

A standard PID controller is implemented in Simulink and MATLAB. The influence of the different control settings is studied.

The PID tuning will perform less optimal if their is a measurement delay.

To efficiently tune the system, control margins are plotted on a BODE-plot for a system of respectively first, second and third order.

We will now tune the PID controller. First the state without control.

The open loop response.

And then the calculated optimal PID control.

Lastly, a PID-feedbackward controller is combined with a feedforward controller. We assume the noise distrubing the system is perfectly characterised. This combination effectively maintains the desire state.

Q-Learning and SARSA algorithms are used to let an imaginary cat (red) through a maze. Besides not running into the walls, the cat tries to locate the mouse (blue).

Several systems are investigated with Bode and Nyquist plots.

A first order system.

A second order system.

A third order system.

Root locus analysis is performed on these three systems.

About

Implementations of Control (PID, LQ, MPC, ...) and AI (fuzzy logic, Q-learner, SARSA, ...) algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published