Implementation and simulation in MATLAB/Simulink of an Iterative Learning Control (ILC) algorithm for trajectory tracking of a 2-DOF planar manipulator. The repository also includes kinematics and dynamics for a 6-DOF anthropomorphic arm with spherical wrist, developed during the thesis work.
Context: Bachelor thesis in Computer Engineering — Algoritmo di apprendimento iterativo per braccio robotico (Roma Tre University, A.Y. 2018/2019).
- Overview
- Project structure
- Results & media
- Getting started
- Main components
- Requirements
- Thesis & references
| Module | Description |
|---|---|
| Planar 2-DOF | Dynamics (Lagrange), ILC and PD control, circular trajectory generation and simulation. |
| Kinematics | Denavit–Hartenberg utilities, direct/inverse kinematics for 2-DOF, 3-DOF and 6-DOF serial arms. |
| 6-DOF arm | Anthropomorphic arm with spherical wrist: DH parameters, forward/inverse kinematics. |
ILC_2DOF_PlanarArm/
├── assets/ # Output images and videos (ILC/PD results, animations)
├── matlab/
│ ├── kinematics/ # DH matrix, dk03, dk06, ik02, ik03, ik06, ik36
│ ├── planar_2dof/ # manipulator2dof, ILC2dof, PD2dof, Traiettoria_Circolare_Corretta
│ └── six_dof/ # SIXDOF_DHparameters
├── simulink/ # Simulink models (controller2.slx, robot2link)
├── docs/ # Thesis PDF and extra documentation
├── startup.m # Adds matlab/ to path (run from project root)
└── README.md
Outputs from the ILC and PD simulations (figures and animations) are stored in assets/.
| Link 1 position | Link 2 position | Position error (Link 1) | Position error (Link 2) |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| Link 1 position (PD) | Link 2 position (PD) | Position error L1 (PD) | Position error L2 (PD) |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| Control position L1 | Control position L2 | 6-DOF workspace |
|---|---|---|
![]() |
![]() |
![]() |
ILC — manipulator motion vs desired trajectory over iterations:
PD — manipulator motion with proportional-derivative control:
- Clone the repository and open MATLAB.
- From the project root, run:
This adds all
startupmatlab/subfolders andsimulink/to your path (socontroller2.slxis found). - Run scripts from the project root :
- Circular trajectory only:
matlab/planar_2dof/Traiettoria_Circolare_Corretta - 2-DOF dynamics (Lagrange, state-space):
matlab/planar_2dof/manipulator2dof - ILC control (uses
simulink/controller2.slx):matlab/planar_2dof/ILC2dof - PD control (uses
controller2.slx):matlab/planar_2dof/PD2dof - 6-DOF arm (DH + visualization):
matlab/six_dof/SIXDOF_DHparameters
- Circular trajectory only:
Note:
ILC2dofandPD2dofcallsim('controller2'). The modelcontroller2.slxis insimulink/;startupadds that folder to the path when you run from the project root.
| File | Description |
|---|---|
DHmatrix.m |
Builds 4×4 DH transformation from a single row of parameters. |
ik02.m |
Inverse kinematics for 2-DOF planar arm (position → joint angles). |
dk03.m |
Direct kinematics for 3-DOF arm (joint angles → end-effector position). |
dk06.m |
Direct kinematics for 6-DOF arm. |
ik03.m, ik06.m, ik36.m |
Inverse kinematics for 3-DOF and 6-DOF (arm + wrist). |
| File | Description |
|---|---|
manipulator2dof.m |
Lagrange equations, state-space form, linearization. |
Traiettoria_Circolare_Corretta.m |
Circular trajectory in Cartesian space and joint space (uses ik02). |
ILC2dof.m |
ILC algorithm with circular reference; iteratively updates control input. |
PD2dof.m |
PD control on the same 2-DOF setup (single run). |
| File | Description |
|---|---|
SIXDOF_DHparameters.m |
Builds 6-DOF robot with DH parameters, solves inverse kinematics and visualizes. |
- MATLAB (tested with Robotics System Toolbox for
RigidBodyTreeand related functions). - Simulink for running
ILC2dofandPD2dof(they call thecontroller2model).
- Thesis PDF: docs/tesi.pdf — Algoritmo di apprendimento iterativo per braccio robotico, Roma Tre, A.Y. 2018/2019.
- ILC updates the control signal from trial to trial using position and velocity error (e.g. ( u_{k+1} = u_k + \phi, e_{\text{pos}} + \gamma, e_{\text{vel}} )).
Bachelor thesis project — Roma Tre University · Computer Engineering












