The step by step of the main control algorithm of an ADEFID project in which the developer is able to set five positions of a 4R manipulator to accomplish a pick and place task.