## 1 Introduction  
Nowadays, more people are engaging in various physical activities. Society is increasingly realizing the importance of maintaining health through physical exercise. This trend leads to more injuries, which are hard to avoid even in everyday activities or sports. An additional observable phenomenon is the demographic shift towards an older population, which, combined with deleterious lifestyle modifications in terms of health, precipitates a heightened incidence of cerebrovascular events. These events commonly induce complications, including upper limb dysfunction. This leads to a demand for faster and more effective treatment methods. The effectiveness of therapy can be significantly enhanced by using dedicated supporting devices, which not only reduce treatment time but also improve final outcomes [1,2]. Early studies aimed at enhancing upper extremity rehabilitation were conducted in several centers, including pioneering work at the Massachusetts Institute of Technology (MIT) in the 1990s [3; 4; 5; 6; 7; 8]. Examples of these early mechatronic rehabilitation devices include the MIT-MANUS, Nudelholz, and Bi-Manu-Track systems (Figure 1). These devices were designed with motion parameters explicitly chosen for each patient and could monitor rehabilitation progress. However, a significant limitation of these solutions was the inability to perform the full range of motion required for comprehensive rehabilitation. To address this limitation, exoskeleton systems were developed. These systems feature rotation axes compatible with human anatomical axes, making them resemble human limbs. By attaching to the limb at multiple points, exoskeletons can support movements across different limb segments [9; 10; 11; 12]. Reconfigurable systems offer an alternative approach, notable for their adaptable mobility, often called degrees of freedom (DoF) in kinematic chains. Even with reduced mobility (e.g., W = 3 DoF), these systems can facilitate critical wrist and forearm movements, including palmar and dorsal flexion, wrist adduction and abduction, and forearm pronation and supination [13]. Additionally, systems for tracking and supporting hand movements have been extensively developed [14; 15; 16]. The use of rehabilitation devices in therapy can potentially overcome certain limitations of manual therapy, such as inconsistent movement repetitions and difficulty in tracking progress. The rehabilitation process can be customized to meet individual needs by immersing the patient in a virtual environment. Numerous studies have validated the effectiveness of integrating virtual reality and psychological elements in rehabilitation devices [1; 17]. However, rehabilitation remains a lengthy, complex, and costly process. It requires significant engagement and cooperation from both the patient and the physiotherapist and an individual approach adapted to each patient, complicating the automation of exercises. In systems of this type, the precise replication of motion is critically important. Predictive models are often used to achieve this precision [18]. The issue of the influence of frictional forces and gravity is well known [19] and has been extensively described in the context of surgical manipulators [20; 21]. Despite these advances, significant improvements can be made by directly measuring the actual position of the device and the active torque during operation. In response to these challenges, this study focuses on enhancing the movement quality by addressing the influences of friction forces and gravity. Research on a novel rehabilitation system, the Mechatronic Rehabilitation Device (MWR--named after first letters in polish: Mechanizm Wypomagania Rehabilitacji), began in 2014 at the Wroclaw University of Science and Technology [22]. The MWR system was developed with a modular structure,  
Figure 1: Examples of the first mechatronic rehabilitation supporting devices: (**a**) MIT-MANUS [4], (**b**) Nudelholz [5], (**c**) Bi-Manu-Track [5]. allowing it to function as two separate rehabilitation devices.