Rehabilitation robots for stroke patients have drawn considerable attention because they can reduce the economic and labor costs brought by traditional rehabilitation. Control methods for rehabilitation robots have been developed to stimulate the active motion of patients and to improve the effectiveness of rehabilitation care. However, current control methods can only roughly adjust the system's stiffness and may fail in achieving satisfactory performance. To this end, this paper introduces a novel cost function consisting of the tracking error term and the stiffness term. The cost function contains an interaction factor that represents the patient's motion intention to balance the weight of these two terms. When the patients try to actively do training tasks, the weight of stiffness term increases, which leads to the larger allowable tracking error and lower stiffness eventually. An iterative updating law of the stiffness matrix is given to reduce the proposed cost function. Theoretical analysis based on the Lyapunov theory is given to ensure the feasibility of the proposed algorithm. Furthermore, a force estimation is used to improve interaction control performance. Finally, simulation experiments are provided to show the effectiveness of the proposed algorithm.