The person can easy to cause ankle injuries in daily activities. Therefore, the demand for ankle rehabilitation treatment is increasing. Due to the long rehabilitation cycle of the ankle joint and there is a shortage of rehabilitation therapists in China, making it difficult to receive timely rehabilitation treatment. Therefore, designing an ankle rehabilitation robot can alleviate the above situation. This thesis first studies the movement space that human ankles can reach. Secondly, determine the robot mechanism as the Stewart mechanism. To calculate the inverse solution of Stewart joint length by Matlab, using Newton method and PSO algorithm to perform forward solution to verify the accuracy of the inverse solution. Finally, the designed Stewart mechanism is imported into Simscape for dynamic simulation and its joint extension is controlled through a PID controller. The simulation results verify that the rehabilitation robot can stably achieve the required posture under PID control.