The traditional Proportional-Integral-Derivative (PID) controller is a feedback control loop that is commonly used in industrial control systems with fixed parameters, whereas the adaptive PID (APID) controller is based on the analysis of traditional PID controllers. It utilizes an online parameter adjustment method built on the state of the system resulting in better system adaptability. In this paper, the APID controller that is suggested by (Ebel, 2011) is used firstly to control a 2-degree of freedom (DOF) lower limb rehabilitation robot. The structure of this controller is then modified to perform a Modified Adaptive PID (MAPID) control in order to improve the efficiency of APID controller and hence improve the performance of the rehabilitation robot. The parameters of APID and the suggested MAPID controllers are optimized by using Grey Wolf Optimization (GWO) algorithm. Linear and non-linear desired trajectories are used to test the performance of the controlled rehabilitation robot. Simulation results show that the obtained performance of the rehabilitation robot is more efficient with the MAPID than with the APID having no overshoot and very small steady state error. The controller has settling time of (0.463) and (0.851) seconds, and rise time of (0.485) and (0.752) seconds respectively for link1 and link2.