Diversified techniques have been applied in many research papers for the optimization of rehabilitation robotic movements in order to maintain smoothness and accuracy. Smooth and precise control is needed necessarily for upper limb rehabilitation robotic applications having five degree of freedom. The preferred parameters which are used for the controlling were validated by mathematical model and these tuning parameters were optimized. Designing optimization algorithms to control complex physical robots has been a challenging task. In this study, a number of optimization techniques will be analyzed to determine the optimal parameters of a PID controller with a dynamic model of the upper limb rehabilitation system. For determining optimal control parameters for PID, there exists a number of tuning methods such as Zeigler Nichols and fuzzy logic which are classical methods. Swarm intelligence-based optimization algorithms are inspired by the behaviors of living things in nature. Several researchers have reported the optimal design of PID controller parameters using optimization techniques. The proposed control technique has been implemented on a 5-DOF RAX hardware and before any clinical trials, six healthy subjects went for trials under strict protocol. It has been discovered that the proposed control technique rejects the external unwanted disturbances as well as keeps the system stable under extreme perturbed and harsh conditions. In this research paper mathematical models have been validated to determine the PID parameters for the optimization. The comparative study is carried out with four different cost functions since a well-designed objective function leads to better performance of the system and indicates control design expectations. These objective functions are an integral squared error (ISE) and integral absolute error (IAE). In this research work, the effects of different cost functions on optimization techniques for controller parameters were analyzed. The performance of the controller with different cost functions has examined for robustness analysis. The cost function of particle swarm optimization, Firefly, Ant Bee Colony and Ant Colony optimization were developed for the better optimization results.