## 2 Influence of External Factors and Gravity on the Movement of the MWR Mechanism  
In order to enhance movement quality and address the influence of friction forces and gravity on the Mechatronic Rehabilitation Device (MWR), it was necessary to conduct detailed experimental studies. The study began by planning the experiment and investigating the mechanical parameters of the device. The measurement system of the MWR consists of incremental encoder sensors located on the axes of each supported movement: the pronation and supination \(\varphi_{3}(t)\), palmar and dorsal flexion \(\varphi_{2}(t)\), as well as adduction and abduction \(\varphi_{1}(t)\) of the hand (Figure 3a). These encoders have a 12-bit resolution, which translates into 4096 impulses per rotation. This, in turn, translates into an accuracy of 0.088\({}^{\circ}\). This is a sufficient number for this application. Figure 3: The MWR device: (**a**) view of the device with corresponding axes: \(\varphi_{1}(t)\) is used for support adduction and abduction, \(\varphi_{2}(t)\) for palmar and dorsal flexion, and \(\varphi_{3}(t)\) for pronation and supination of the hand; (**b**) scheme of the sensory grip where \(\varphi_{i}(t)\), \(i=1,2,3\) are axes for supported movements, and S1, S2, and S3 are load sensors [16]. Figure 2: The general concept of the mechatronic system supporting the rehabilitation of upper limbs [23]. In the MWR system, it was possible to measure the active torque in the drives for individual axes by using current sensors (ASC712, IDUINO, Riga, Latvia) and utilizing the characteristics of the motors. A significant advantage of the MWR was the ability to measure external loads thanks to the sensor grip (Figure 3b). The grip had aluminum strain gauge beams S1 and S2 and a torque sensor S3 DFM22 Series (NCTE AG(r), Oberhaching, Germany). This enabled real-time control of the load with which the patient acted on the system. Measurements from the sensors were transferred to a microcontroller, which was responsible for communication between the controlling computer (P.C.) and the sensory system. The measuring system consisted of a microcontroller from the NUCLEO family with an STMF303 RE processor (STMicroelectronics, Geneva, Switzerland) operating at a frequency of 72 MHz. The S3 torque sensor was directly connected to the microcontroller. In order to read the measurements from the strain gauge beams S1 and S2, it was necessary to use an operational amplifier. An industrial WTD-11-U amplifier (P.P.H. WObit E.K. Ober s.c., Pniewy, Poland) with a voltage output was used. The research aimed to determine the actual parameters of the device, particularly the impact of the weight of individual components and friction between the moving elements. In the studies, the object of control (regulation) was the angular position in the axes: \(\varphi_{1}(t)\) (t), \(\varphi_{2}(t)\), and \(\varphi_{3}(t)\). It related to assisted hand movements. Firstly, the characteristics of the device, without patient interference, using four set signals were examined, two of which consisted of achieving a given position (movement starting from the initial to a given position):  
\[\varphi_{lzi}(t)\ =\ \frac{\varphi_{Ki}-\varphi_{Pi}}{T_{1}}t+\varphi_{Pi} \tag{1}\]  
\[\varphi_{szi}(t)\ =\ (\varphi_{Ki}+\varphi_{Pi})(\frac{t}{T_{1}}-\frac{1}{2\pi} \sin(\frac{2\pi t}{T_{1}}))-\varphi_{Pi}, \tag{2}\]  
where \(\varphi_{lzi}(t)\)--linear function describing the end position in \(i\) = 1, 2, 3 axes, \(\varphi_{szi}(t)\)--sinusoidal function describing the end position in the \(I\) axis, \(\varphi_{Ki}\)--end position in the \(I\) axis, \(\varphi_{Pi}\)--initial position in the \(I\) axis, and \(T_{1}\)--duty cycle. The second variant consisted of one complete repetition. This meant achieving the specified angular position \(\varphi_{Ki}\) from the initial position \(\varphi_{Pi}\) in the movement \(T_{1}\) time and then returning in \(T_{2}\) time:  
\[\varphi_{lzpi}(t)\ =\ \left\{