Robot manipulator modeling in Matlab-SimMechanics with PD control and online gravity compensation

The objective of this article is to present a method to model the mechanics of robot manipulators. A complete description of the procedure to model and control a two-link planar robot arm is detailed and simulated using Matlab/Simulink from the generation of a mechanical model in SimMechanics Toolbox. One of the simplest position controllers for robot manipulators is the PD control with desired gravity compensation. The implementation of this method was verified on this model. The results of simulation show that SimMechanics can be used to model the mechanics of robot and the better performance can be obtained with the online gravity compensation method as compared to the case of constant gravity compensation method.