###### Abstract
A fuzzy-impedance control law was developed to estimate the human-robot interaction force [33]. A robotic system providing fuzzy-based adaptive assistance was presented in [34]. In contrast to the studies cited above, by adopting fuzzy logic as a control law for trajectory tracking [31; 32] or for assistance [33; 34], the proposed solution integrates the concept of fuzzy logic into the control architecture to build a safety system that takes into account pain that could be felt by the patient. In this study, a fuzzy logic controller was employed with the proposed rehabilitation architecture in order to model patient pain during rehabilitation therapy. Incorporating the fuzzy controller into the developed rehabilitation system gives the system the ability to adapt efficiently and reliably to changes in the rehabilitation conditions, including patients' conditions. By using IoT concepts, a system's parts/objects can be accessed anytime anywhere. Remote rehabilitation can be adopted to relieve stress in healthcare facilities by limiting patient numbers in clinics [35]. Indeed, remote rehabilitation via the Internet allows therapists to control and monitor their patients at home. We note that in the current situation where humanity is fighting against COVID-19, the most used keywords are \"stay at home\" and \"do not touch.\" The proposed solution includes these two goals: gesture control, which means no direct contact, and Internet-based control, which means rehabilitation while staying at home. The main contribution is to integrate vision-based gesture control, a cascade fuzzy logic-based decision system and IoT to help therapists remotely take care of patients efficiently and reliably. In fact, the proposed solution not only allows remote, in-home rehabilitation but also incorporates a fuzzy logic-based decision support system which takes into consideration the pain felt by the patient. The available rehabilitation systems are very large, complicated, immobile, unwieldy and very expensive. In contrast to the previously cited works [1; 2; 36; 37], the proposed solution is light and portable since the objective was to design small robots with a well-defined target in order to be accessible for use at home. Compared to [14; 23; 24; 25; 26], the developed system is a vision-based telemanipulation solution that avoids the inconveniences of the EMG-based solutions, such as signal sensitivity. Many studies on robotic rehabilitation have not taken into account the pain felt by the patient in the robot control architecture; see [38; 39; 40; 41; 42], to name a few. However, this pain can prevent a person from interacting positively with therapy. Continued rehabilitation beyond pain could cause material and moral damage. In addition to the possibility of complicating the situation of the affected member, one could create a state of refusal of rehabilitation by the subject who suffered enormously. To cope with this problem, some studies suggest incorporating a current return, where the peak may reflect resistance exerted by the patient due to a feeling of pain [28]. However, this solution seems limited because the engine starting already presents a current peak which can mislead the decision system. In other works, the authors rely on the detection of muscle contraction to estimate fatigue and therefore pain [43; 44]. On the other hand, one cannot avoid certain pain in the advanced steps of rehabilitation. Therefore, the decision-making system must allow the robot to go ahead even in the presence of a current peak. In this situation, we need a combination of inputs and a table of rules. In this developed control architecture, we propose a sensor fusion to estimate the degree of pain. Indeed, the patient's safety during the therapy is achieved by integrating a cascaded fuzzy logic controller that estimates patient's pain. EMG signal, current sensor feedback and the position encoder feedback are used to provide the fuzzy controller with the data needed to estimate pain.