In lab 5.1, RRR robot simulated in MATLAB using Robotics Matlab Toolbox.
lab5_robot.m file is the RRR robot. 1kg load is applied at the end effector and torques in two different positions are calculated.
planarrobot.m file is for simple simulation of planar RRRRR robot.
video of the robots moving: https://www.youtube.com/embed/EmJKdEb-TOM
In part 5.2 of the lab controllers in simulink were created. First the most simple model was used for RRR robot. Big gains were used to fight gravity. Noticeable error.

next, controller with error feedback was created. The error became almost 0.
The same was done for the RRRRRR planar robot.
In lab 6, ANN was tuned in order to provide lower MSE in FK estimation for the planar robot. The initial error was around 20%. It was reduced to around 3% using an additional fullyConnectedLayer(256) and a tanhLayer().
In lab 7, ANN was tined in order to provide precise estimation of Inverse Kinematics problem solution for the planar robot. The inital error of the untuned model was around 35%.
First, the size of the dataset was increased from 5000 to 20000 entries. The dataset generation took the most time of the training process - around 20 minutes on 2-core 2.4 GHz Intel i5-4258U CPU, 8Gb RAM. The dataset was generated one time and saved.
The initial learning rate was chosen 0.01, and lr schedule was made to be peicewise with decay of 0.2 every 4 epochs. Differen batch sizes were tried, the range of 200-300 showed the best results. 5 fully connected layers with sizes 128, 128, 64, 64, each with relu activation functions and an output layer of size 5 and a Regression. The training took around 30-200 seconds each time, depending on the batch size. About every third training freezed (the training window went unresponsive, MATLAB 2020a. I guess this is just my weak hardware). An error as low as 8.5% was achieved.
The end effector was deliberately moved to the side a little so that both plotted points could be seen. The error is indeed negligible.









