Towards the Mechatronic Development of a New Upper-Limb Exoskeleton (SAMA)

: Modern neuromuscular rehabilitation engineering and assistive technology research have been constantly developing in the last 20 years. The upper body exoskeleton is an example of an assistive rehabilitation device. However, in order to solve its technological problems, interdisci-plinary research is still necessary. This paper presents a new three-degrees of freedom (DOF) active upper-body exoskeleton for medical rehabilitation named “SAMA”. Its mechanical structure is inspired by the geometry and biomechanics of the human body, particularly the ranges of motion (ROM) and the needed torque. The SAMA exoskeleton was manufactured and assembled into an ergonomic custom-made wheelchair in a sitting posture in order to provide portability and subject comfort during experimental testing and rehabilitation exercises. Dynamic modeling using MATLAB– Simulink was used for calculating the inverse kinematics, dynamic analysis, trajectory generation and implementation of proportional–integral–derivative (PID) computed torque control (PID-CTC). A new framework has been developed for rapid prototyping (the dynamic modeling, control, and experimentation of SAMA) based on the integration between MATLAB–Simulink and the Robot Operating System (ROS) environment. This framework allows the robust position and torque control of the exoskeleton and real-time monitoring of SAMA and its subject. Two joints of the developed exoskeleton were successfully tested experimentally for the desired arm trajectory. The angular position and torque controller responses were recorded and the exoskeleton joints showed a maximum delay of 200 ◦ and a maximum steady state error of 0.25 ◦ . These successful results encourage further development and testing for different subjects and more control strategies.


Introduction
Stroke is among the leading causes of adult disability [1]. It is caused by an interruption of the blood flow to the brain, which results in brain cell damage, and it can be fatal. Stroke patients may endure paralysis or loss of physical strength on one side of the body (hemiparesis), as well as memory impairments, making activities of daily living (ADL) challenging. The most common treatment for these deficits is rehabilitation, which helps stroke victims to relearn the best possible use of their limbs and reclaim their independence [2].
Most of the stroke burden worldwide is experienced by countries with less developed economies and lower incomes. Recent reports from the World Health Organization (WHO) state that low and middle-income countries have a high number of stroke patients; seven times the number of patients in high-income countries. It is worth mentioning that 80% of these stroke cases cause death [3].
Egypt is the most populated nation in the Middle East and the third most populous on the African Continent. Although there are physiotherapy units in most major healthcare However, this technology is still challenged in the areas of mechanical design, control, and human-robot interaction, despite its high utility and its growing demand. Dynamic and kinematic analyses are two issues in developing an ergonomic exoskeleton system [25]. Since wearable exoskeletons interact with humans directly, careful analysis and control are always pursued. Robot kinematics' application to human body kinematics is a complex matter due to the availability of multiple solutions to joint variables and due to its iterative, non-unique, and time-consuming calculations. Dynamic analysis is also a complex matter. In this analysis, the forces and torques causing the motion of the upper body exoskeletons are calculated, which is also a time-consuming and complicated calculation. Different methodologies of position and torque control are sought after to provide robust and smooth control trajectories for the intended subjects, such as those for upper limb exoskeletons [26]. Recently, rapid prototyping software has been developed to calculate the kinematics and dynamics and to deploy robust control methodologies. A. Caballero et al. proposed a rapid prototyping solution for exoskeleton control. The developed software was tested and achieved accurate and fast responses [27].
Various linear-nonlinear control algorithms have been proposed by researchers to increase robot maneuverability and perform various forms of physical rehabilitation efficiently [28]. Nonlinear robot dynamics have been addressed using both linear and nonlinear control techniques. Most nonlinear control system algorithms are based on the plant's mathematical model (robot dynamics model). Hence, it is critical to construct an accurate plant model because it is an element of the control architecture.
Although proportional-integral-derivative (PID) controllers and their derivative approaches are simple and classical, they are dependable controllers in most systems due to their ease of generating controller gains and accurate performance evaluation. Some other control algorithms are vulnerable to modeling errors, while others are more resistant to parameter or modeling uncertainty. Many researchers use PID controllers and enhance their performance by adding other control methods, such as modern control or artificial intelligence techniques [29]. One of these methods is the PID-CTC, which is designed around the robot's dynamic model. Due to its ability to provide asymptotic stability with fixed positive definite gain matrices, it is a popular robot motion-control approach [30]. Moreover, CTC is notable for its reliability and robust performance [31], especially when it is used for non-linear, dynamically coupled, and complex robotic systems [32]. CTC solves these problems by utilizing two functions. First, it uses the feedback linearization technique to linearize the nonlinear system and, second, it generates a control input that matches the performance criteria.
Other problems for upper exoskeletons lie in the excessive weight of their parts and actuators, which form an effort-consuming problem for the wearer. A compact and lightweight wearable exoskeleton is always a desirable option. Falkowski et al. presented a light exoskeleton design [33] without losing any advantage in the load-carrying capacity or the number of joints.
In the proposed prototype, SAMA, a new upper limb exoskeleton, is presented. In this prototype, solutions to the previously mentioned problems are addressed and implemented. The proposed design is light and compact with electrical actuators for three DOF of the arm. The kinematic and dynamic complexity of the mechanism was solved by using dynamic modeling software. A position/torque control framework was built to drive the mechanism in the simulation and generate the necessary trajectories and torques for SAMA's joints. In addition, the generated torques and trajectories were sent to SAMA using the MATLAB-ROS bridged environment. This paper is organized as follows. The anatomy of the human arm is detailed in Section 2, followed by the proposed design of SAMA. In Section 3, there is a description of the rapid prototyping software that was used to model the exoskeleton, calculate its kinematics, generate its dynamic model, and implement the PID-CTC for position tracking and torque generation. The selection of the actuators, sensors, and system assembly are discussed in Section 4. The control system architecture is presented in Section 5. The system Designs 2022, 6, 80 4 of 25 framework controller is shown including the MATLAB-ROS bridged communication environment [34]. In Section 6, there is a description of the SAMA exoskeleton's testing on a human subject in order to evaluate the joint movements, torques, designed control framework, and system responses. Finally, in Section 7, the paper is concluded with a discussion of the obtained results and possible future work.

Anatomy of the Human Arm
The upper limb is the part of the body that connects to the trunk through the shoulder. The upper limb is composed of three parts: the arm, forearm, and hand. The elbow connects the forearm to the arm. As can be seen in Figure 1, the wrist links the forearm to the hand [35].
kinematics, generate its dynamic model, and implement the PID-CTC for position tracking and torque generation. The selection of the actuators, sensors, and system assembly are discussed in Section 4. The control system architecture is presented in Section 5. The system framework controller is shown including the MATLAB-ROS bridged communication environment [34]. In Section 6, there is a description of the SAMA exoskeleton's testing on a human subject in order to evaluate the joint movements, torques, designed control framework, and system responses. Finally, in Section 7, the paper is concluded with a discussion of the obtained results and possible future work.

Anatomy of the Human Arm
The upper limb is the part of the body that connects to the trunk through the shoulder. The upper limb is composed of three parts: the arm, forearm, and hand. The elbow connects the forearm to the arm. As can be seen in Figure 1, the wrist links the forearm to the hand [35]. The human arm has seven DOF: three on the shoulder, one on the elbow, and three on the wrist [36,37]. The shoulder is regarded as a ball and socket joint that allows three rotations: flexion/extension (Figure 2a  The human arm has seven DOF: three on the shoulder, one on the elbow, and three on the wrist [36,37]. The shoulder is regarded as a ball and socket joint that allows three rotations: flexion/extension (Figure 2a According to the Hanavan model, the joint dimensions and angles can be generated by using the subject geometry, as is illustrated in Figure 3 [37]. A male subject was chosen for the implementation of SAMA. He was 25 years old, weighed 800 N, and was 1.85 m tall at the time of the experiment. His arm measurements and the ranges of motion of his arm joints are listed in Table 1. These data were later used to perform the kinematic study of the arm and joint motions of SAMA, as will be illustrated in Section 3. These measurements depend on a certain posture of the arm where the subject's upper arm is in the horizontal position. According to the Hanavan model, the joint dimensions and angles can be generated by using the subject geometry, as is illustrated in Figure 3 [37]. A male subject was chosen for the implementation of SAMA. He was 25 years old, weighed 800 N, and was 1.85 m tall at the time of the experiment. His arm measurements and the ranges of motion of his arm joints are listed in Table 1. These data were later used to perform the kinematic study of the arm and joint motions of SAMA, as will be illustrated in Section 3. These measurements depend on a certain posture of the arm where the subject's upper arm is in the horizontal position.   According to the Hanavan model, the joint dimensions and angles can be generated by using the subject geometry, as is illustrated in Figure 3 [37]. A male subject was chosen for the implementation of SAMA. He was 25 years old, weighed 800 N, and was 1.85 m tall at the time of the experiment. His arm measurements and the ranges of motion of his arm joints are listed in Table 1. These data were later used to perform the kinematic study of the arm and joint motions of SAMA, as will be illustrated in Section 3. These measurements depend on a certain posture of the arm where the subject's upper arm is in the horizontal position.

Mechanical Design Considerations
In this research, the SAMA exoskeleton was intended to have three DOF. Two active DOF for shoulder rehabilitation and one active DOF for elbow rehabilitation. Several ergonomic features were prioritized during the mechanical design. The exoskeleton arm was mounted on a wheeled rehabilitation chair for the placement and testing of the arm and portability if needed as shown in Figure 4. A light aluminum alloy was chosen as the design material of the exoskeleton due to its considerably low weight, low cost, and modularity in reshaping. Flexible medical straps were fixed on the shoulder and the forehand for the easy fixation of the human arm. The back of the chair was designed using reinforced plastic with lumbar support and a cushioning aid in order to decrease strain and provide relief for the human back.

Mechanical Design Considerations
In this research, the SAMA exoskeleton was intended to have three DOF. Two a DOF for shoulder rehabilitation and one active DOF for elbow rehabilitation. Severa gonomic features were prioritized during the mechanical design. The exoskeleton was mounted on a wheeled rehabilitation chair for the placement and testing of the and portability if needed as shown in Figure 4. A light aluminum alloy was chosen a design material of the exoskeleton due to its considerably low weight, low cost, and m ularity in reshaping. Flexible medical straps were fixed on the shoulder and the foreh for the easy fixation of the human arm. The back of the chair was designed using forced plastic with lumbar support and a cushioning aid in order to decrease strain provide relief for the human back.

Modeling of the SAMA Exoskeleton
Modeling was necessary for our prototype in order to evaluate the behavior o system and to analyze and validate applicable control methods in a secure environm Both the kinematics and the dynamics of the prototype are illustrated in this section.

Kinematic Calculations
Forward kinematic analysis was performed using Denavit-Hartenberg (DH) con tion. The kinematic scheme of the SAMA exoskeleton is shown in Figure 5. The calcu DH parameters are given in Table 2.

Modeling of the SAMA Exoskeleton
Modeling was necessary for our prototype in order to evaluate the behavior of the system and to analyze and validate applicable control methods in a secure environment. Both the kinematics and the dynamics of the prototype are illustrated in this section.

Kinematic Calculations
Forward kinematic analysis was performed using Denavit-Hartenberg (DH) convection. The kinematic scheme of the SAMA exoskeleton is shown in Figure 5. The calculated DH parameters are given in Table 2.
Where is the joint angle, is the joint distance, is the link length the link twist angle. Additionally, the general transformation matrices definin relative to frame are given as: Where θ i is the joint angle, d i is the joint distance, a i is the link length, and α i is the link twist angle. Additionally, the general transformation matrices defining frame R i relative to frame R i−1 are given as: where the following symbols are used: Moreover, the position of any arbitrary point P can be represented in frame "j" concerning frame "i" using the transformation matrix T j i , where P j = T j i P i . Hence, the position of the end effector concerning frame "3" can be represented concerning frame "0" by P 0 = T 0 3 P 3 . When the range of motions was compared to the bio-mechanical data in Table 1, it was observed that the exoskeleton had a ROM that is suitable for the test subject. For further verification, the obtained ROM was compared with that of the shoulder and elbow joints of other upper limb exoskeletons, as can be seen in Table 3.

Dynamic Modeling
The dynamic modeling was carried out using Simscape Multibody library in MATLAB-Simulink. Dynamic multi-body modeling is a safe way to test exoskeleton control systems because it allows both the human limb's and exoskeleton's dynamics to be modeled together [40]. The mass and inertial characteristics of a typical adult's upper limb were used in the model, as shown in Table 4. The masses and inertial characteristics of the test subject's upper limb were exported to MATLAB-Simulink. Moreover, the dynamic physical model was constructed from the CAD model and exported to the MATLAB-Simulink environment using the Simscape Multibody library, as shown in Figure 6. Table 4. Mass of body segments as % of total body mass [15]. SAMA's dynamic model is composed of rigid body subsystems that are connected by revolute joints. It also includes a reference frame, a mechanism configuration (which specifies the mechanical and simulation characteristics that apply to the complete machine), and a solver configuration (which specifies the solver settings for the simulation). Figure 7 illustrates the dynamic multi-body physical model of the SAMA exoskeleton. SAMA's dynamic model is composed of rigid body subsystems that are connected by revolute joints. It also includes a reference frame, a mechanism configuration (which specifies the mechanical and simulation characteristics that apply to the complete machine), and a solver configuration (which specifies the solver settings for the simulation). Figure 7 illustrates the dynamic multi-body physical model of the SAMA exoskeleton. The rigid body tree model of the SAMA exoskeleton was imported from Simscape Multibody, so the robotics system toolbox could be used for inverse kinematics, trajectory generation, and dynamics analysis. The robot's structure was represented by the rigid body tree model.

Inverse Kinematics
Humans have a remarkable ability to plan and execute a motion in both the task space and the joint space [41]. The ability to move between these two planning processes allows humans to perform a wide range of complex motions in order to achieve several functional goals. The most popular method of controlling robots is joint space control, which uses a single motor for each degree of freedom. By transforming motion from the task space to the joint space, inverse kinematics attempts to assist in bridging the gap between motor control and end-effector motion.
Inverse kinematic analysis is an iterative, non-unique, and time-consuming process. So, in this research, MATLAB-Robotics System Toolbox was used to perform the inverse kinematics analysis. The defined XYZ coordinates were converted to homogeneous transformations and input as the desired pose and a [1 × 6] vector of the weights on the tolerance for the orientation and position of the end effector was defined as an input for the  SAMA's dynamic model is composed of rigid body subsystems that are connected by revolute joints. It also includes a reference frame, a mechanism configuration (which specifies the mechanical and simulation characteristics that apply to the complete machine), and a solver configuration (which specifies the solver settings for the simulation). Figure 7 illustrates the dynamic multi-body physical model of the SAMA exoskeleton. The rigid body tree model of the SAMA exoskeleton was imported from Simscape Multibody, so the robotics system toolbox could be used for inverse kinematics, trajectory generation, and dynamics analysis. The robot's structure was represented by the rigid body tree model.

Inverse Kinematics
Humans have a remarkable ability to plan and execute a motion in both the task space and the joint space [41]. The ability to move between these two planning processes allows humans to perform a wide range of complex motions in order to achieve several functional goals. The most popular method of controlling robots is joint space control, which uses a single motor for each degree of freedom. By transforming motion from the task space to the joint space, inverse kinematics attempts to assist in bridging the gap between motor control and end-effector motion.
Inverse kinematic analysis is an iterative, non-unique, and time-consuming process. So, in this research, MATLAB-Robotics System Toolbox was used to perform the inverse kinematics analysis. The defined XYZ coordinates were converted to homogeneous transformations and input as the desired pose and a [1 × 6] vector of the weights on the tolerance for the orientation and position of the end effector was defined as an input for the The rigid body tree model of the SAMA exoskeleton was imported from Simscape Multibody, so the robotics system toolbox could be used for inverse kinematics, trajectory generation, and dynamics analysis. The robot's structure was represented by the rigid body tree model.

Inverse Kinematics
Humans have a remarkable ability to plan and execute a motion in both the task space and the joint space [41]. The ability to move between these two planning processes allows humans to perform a wide range of complex motions in order to achieve several functional goals. The most popular method of controlling robots is joint space control, which uses a single motor for each degree of freedom. By transforming motion from the task space to the joint space, inverse kinematics attempts to assist in bridging the gap between motor control and end-effector motion.
Inverse kinematic analysis is an iterative, non-unique, and time-consuming process. So, in this research, MATLAB-Robotics System Toolbox was used to perform the inverse kinematics analysis. The defined XYZ coordinates were converted to homogeneous transformations and input as the desired pose and a [1 × 6] vector of the weights on the tolerance for the orientation and position of the end effector was defined as an input for the inverse kinematics block. The output inverse-kinematic solution was the feedback and an initial guess for the next solution. This initial guess helped to track the end-effector pose and generate smooth configurations. The Broyden-Fletcher-Goldfarb-Shanno (BFGS) gradient projection solver was used. Figure 8 shows the inverse kinematics model for the SAMA exoskeleton.
inverse kinematics block. The output inverse-kinematic solution was the feedback and an initial guess for the next solution. This initial guess helped to track the end-effector pose and generate smooth configurations. The Broyden-Fletcher-Goldfarb-Shanno (BFGS) gradient projection solver was used. Figure 8 shows the inverse kinematics model for the SAMA exoskeleton.

Actuator Sizing Calculations
In order to size the actuators for the exoskeleton, the maximum torque must be calculated. The maximum torque T is considered when the component force is positioned perpendicular to the vector of gravity force, as is indicated in equation: ∑ = − = 0, where m is the mass of the link, g is the gravity acceleration, and L is the distance that maximizes the torque around the joint. This is considered the worst possible scenario. A free body diagram was used to place the exoskeleton's torque and positions, as shown in Figure 9. The weight of the adult limb that was previously discussed in Table 4 was added to the approximate weight of the exoskeleton in order to determine the component's overall mass. It was assumed that the center of mass was in the middle of section . Furthermore, Equations (5) and (6) were used to calculate the torque that each motor produced in order to maintain an equilibrium.

Actuator Sizing Calculations
In order to size the actuators for the exoskeleton, the maximum torque must be calculated. The maximum torque T is considered when the component force is positioned perpendicular to the vector of gravity force, as is indicated in equation: ∑ T = mgL − T = 0, where m is the mass of the link, g is the gravity acceleration, and L is the distance that maximizes the torque around the joint. This is considered the worst possible scenario. A free body diagram was used to place the exoskeleton's torque and positions, as shown in Figure 9. The weight of the adult limb that was previously discussed in Table 4 was added to the approximate weight of the exoskeleton in order to determine the component's overall mass. It was assumed that the center of mass was in the middle of section L 2 . Furthermore, Equations (5) and (6) were used to calculate the torque that each motor produced in order to maintain an equilibrium.
Designs 2022, 6, x FOR PEER REVIEW 10 of 26 inverse kinematics block. The output inverse-kinematic solution was the feedback and an initial guess for the next solution. This initial guess helped to track the end-effector pose and generate smooth configurations. The Broyden-Fletcher-Goldfarb-Shanno (BFGS) gradient projection solver was used. Figure 8 shows the inverse kinematics model for the SAMA exoskeleton. Figure 8. SAMA inverse kinematics model.

Actuator Sizing Calculations
In order to size the actuators for the exoskeleton, the maximum torque must be calculated. The maximum torque T is considered when the component force is positioned perpendicular to the vector of gravity force, as is indicated in equation: ∑ = − = 0, where m is the mass of the link, g is the gravity acceleration, and L is the distance that maximizes the torque around the joint. This is considered the worst possible scenario. A free body diagram was used to place the exoskeleton's torque and positions, as shown in Figure 9. The weight of the adult limb that was previously discussed in Table 4 was added to the approximate weight of the exoskeleton in order to determine the component's overall mass. It was assumed that the center of mass was in the middle of section . Furthermore, Equations (5) and (6) were used to calculate the torque that each motor produced in order to maintain an equilibrium.  When the exoskeleton's arm was horizontally positioned, only the static forces were taken into consideration in the presented equations. However, this is not always the most accurate representation. Acceleration is required for the arm to move from its resting where τ is the vector of the applied joint torques; M(q) is the inertial matrix; C q, . q is the Coriolis matrix; G(q) is the gravity matrix, and q, . q, and .. q are the joint positions, velocities, and acceleration respectively. Normally, theoretical calculations that use Equation (7) require complex and time-consuming computations. In this paper, the MATLAB-Robotics System Toolbox was used in order to determine the dynamics of the three joints. The inverse dynamics block diagram for the SAMA exoskeleton is shown in Figure 10  When the exoskeleton's arm was horizontally positioned, only the static forces w taken into consideration in the presented equations. However, this is not always the m accurate representation. Acceleration is required for the arm to move from its resting sition. The dynamics of a robotic arm exoskeleton can be simplified in the following fo according to the Lagrange formula:

( ) ̈+ ( , ̇) + ( ) =
where is the vector of the applied joint torques; ( ) is the inertial matrix; ( , the Coriolis matrix; ( ) is the gravity matrix, and , ̇, and ̈ are the joint positi velocities, and acceleration respectively. Normally, theoretical calculations that use Eq tion (7) require complex and time-consuming computations. In this paper, the MATLA Robotics System Toolbox was used in order to determine the dynamics of the three joi The inverse dynamics block diagram for the SAMA exoskeleton is shown in Figure  where   Three polynomial signals of the third order were the input for the inverse dynam block, as shown in Figure 11. The peak and RMS torque values for the exoskeleton jo were calculated by assuming that the maximum joint velocity is 90 °/s. Three polynomial signals of the third order were the input for the inverse dynamics block, as shown in Figure 11. The peak and RMS torque values for the exoskeleton joints were calculated by assuming that the maximum joint velocity is 90 • /s. The dynamic torque scores of the three joints, based on the input trajectories, were calculated and are shown in Figure 12a-c. Hence, the static and dynamic torque requirements were calculated for the subject in Equation (8). Table 5 shows the peak and root mean square (RMS) torque for each joint using a factor of safety (FS) = 1.1. The dynamic torque scores of the three joints, based on the input trajectories, were calculated and are shown in Figure 12a-c. Hence, the static and dynamic torque requirements were calculated for the subject in Equation (8). Table 5 shows the peak and root mean square (RMS) torque for each joint using a factor of safety (FS) = 1.1.
The dynamic torque scores of the three joints, based on the input trajectories, were calculated and are shown in Figure 12a-c. Hence, the static and dynamic torque requirements were calculated for the subject in Equation (8). Table 5 shows the peak and root mean square (RMS) torque for each joint using a factor of safety (FS) = 1.1.

PID Computed Torque Control
The derived dynamic model that is described in Section 3.2 paved the way to implement the CTC on the SAMA exoskeleton. The dynamic modeling equation that describes the system dynamics is shown in Equation 7. In order to track a desired joint trajectory

PID Computed Torque Control
The derived dynamic model that is described in Section 3.2 paved the way to implement the CTC on the SAMA exoskeleton. The dynamic modeling equation that describes the system dynamics is shown in Equation 7. In order to track a desired joint trajectory with the desired position q d , velocity . q d , and acceleration .. q d , the computed torque controller calculated the torque that was needed to obtain a given configuration and velocity, provided the robot dynamics variables M(q) .. q + C q, q d (0), the trajectory tracking can be solved by: Both Equations (7) and (9) are fulfilled by the same initial conditions of q and q d . This follows from the fact that differential equation solutions are unique in that q(t) = q d (t) for all t ≥ 0, which is an open-loop control law and it is not robust. In order to avoid this, the robot's current state was utilized in order to select the control input as feedback and the exoskeleton's real trajectory converged with the desired trajectory. By canceling all of the nonlinearities and generating precisely the torque that was required to overcome the actuator's inertia: By substituting this control law Equation (10) into the dynamic Equation (7), the following control law was obtained, in which the exoskeleton's starting position and velocity match the desired position and velocity. As a result, the computed torque control model is: ..
where ε(t) is the integral of tracking error e(t) and K p , K d , and K i are the PID controller gains. A block diagram that describes the implementation of CTC on the SAMA exoskeleton is shown in Figure 13. The complete dynamic model of SAMA, in addition to the CTC model, is shown in Figure 14.
Designs 2022, 6, x FOR PEER REVIEW 14 o ( ) for all ≥ 0, which is an open-loop control law and it is not robust. In order to av this, the robot's current state was utilized in order to select the control input as feedb and the exoskeleton's real trajectory converged with the desired trajectory. By cance all of the nonlinearities and generating precisely the torque that was required to overco the actuator's inertia: By substituting this control law Equation (10) into the dynamic Equation (7), the lowing control law was obtained, in which the exoskeleton's starting position and velo match the desired position and velocity. As a result, the computed torque control mo is: where ( ) is the integral of tracking error ( ) and , , and are the PID cont ler gains. A block diagram that describes the implementation of CTC on the SAMA skeleton is shown in Figure 13. The complete dynamic model of SAMA, in addition to CTC model, is shown in Figure 14.

Motor Selection
The main actuator module unit for SAMA consists of a dual shaft motor and a gearbox. A dual-shaft DC motor was selected as the actuator for the three joints. The nominal torque of this motor was = 3.86 . . A harmonic drive was used for the gearbox selection. The harmonic drive gearbox was chosen because of its greater torque rating, repeatable torque, lightweight, and small moment of inertia. The selected gearbox provides a

Motor Selection
The main actuator module unit for SAMA consists of a dual shaft motor and a gearbox. A dual-shaft DC motor was selected as the actuator for the three joints. The nominal torque of this motor was τ = 3.86 N.m. A harmonic drive was used for the gearbox selection. The harmonic drive gearbox was chosen because of its greater torque rating, repeatable torque, lightweight, and small moment of inertia. The selected gearbox provides a reduction ratio of 50/1, the maximum allowable value of average load torque is 31 N.m, and the allowable instantaneous maximum torque is 82 N.m. A high-performance motor controller was used which supplied 12 V to 24 V with a peak current of up to 120 A per motor. Moreover, it had three control modes: position control, velocity control, and current control. In this way, the selected actuator units met the recommended power, angular speed, and torque of the required daily life activities of the human arm joints.

Sensor Selection
A capacitive increment encoder was chosen for angular position/velocity feedback. It had an 8192 CPR resolution and an index pulse. Furthermore, a linear magnetic hall switch sensor module was used for the joint limits as a safety precaution. It used a known reference point. The actuator module units for both shoulder rotations (flexion/extension and abduction/adduction) are shown in Figure 15. All of the system components and their design housings are characterized by their compactness and lightweight. The actuator module's dimensions were 50 mm × 50 mm × 74 mm and it weighed 1.6 kg.

Sensor Selection
A capacitive increment encoder was chosen for angular position/velocity feedback. It had an 8192 CPR resolution and an index pulse. Furthermore, a linear magnetic hall switch sensor module was used for the joint limits as a safety precaution. It used a known reference point. The actuator module units for both shoulder rotations (flexion/extension and abduction/adduction) are shown in Figure 15. All of the system components and their design housings are characterized by their compactness and lightweight. The actuator module's dimensions were 50 mm × 50 mm × 74 mm and it weighed 1.6 kg. Figure 15. Actuator module unit for SAMA shoulder rotations. The CAD design is shown on the left (a), while the whole actuator module assembly is shown on the right (b).

Control System Framework
A system control framework was developed for the SAMA exoskeleton. It mainly consists of two control layers: low-level and high-level. In addition, a user interface was developed for MATLAB-Simulink to respond to therapists' decisions, decide on the plan of action, and aid subjects in completing rehabilitation tasks and exercises [42]. A low-

Control System Framework
A system control framework was developed for the SAMA exoskeleton. It mainly consists of two control layers: low-level and high-level. In addition, a user interface was developed for MATLAB-Simulink to respond to therapists' decisions, decide on the plan of action, and aid subjects in completing rehabilitation tasks and exercises [42]. A low-level controller dealt with the actuator control and the position feedback. PID control was used to maintain the desired angles for the joints. A personal computer was used as the user interface, for system monitoring, kinematics calculations, real-time simulation, and hardware implementation. A middle layer existed between the previous two layers that included MATLAB-ROS bridge software. A diagram that describes the system control architecture is shown in Figure 16. The details of this framework will be discussed in the following subsections.

Rapid Prototyping Software
Rapid prototyping software has been developed for model simulation, real-time testing, and control method implementation. In supplement to the exoskeleton dynamic model that is discussed in Section 3, the dynamic model of the actuator modules was added. The DC motor model with its harmonic drive is shown in Figure 17 and a PID controller was added for angular position control. The step responses for the shoulder abduction/adduction and shoulder flexion/extension joints are shown in Figure 18a,b, respectively. The resultant simulation responses of the dynamic model joints are shown in Table 6.

Rapid Prototyping Software
Rapid prototyping software has been developed for model simulation, real-time testing, and control method implementation. In supplement to the exoskeleton dynamic model that is discussed in Section 3, the dynamic model of the actuator modules was added. The DC motor model with its harmonic drive is shown in Figure 17 and a PID controller was added for angular position control. The step responses for the shoulder abduction/adduction and shoulder flexion/extension joints are shown in Figure 18a,b, respectively. The resultant simulation responses of the dynamic model joints are shown in Table 6.

Middleware
In order to provide robust and real-time prototyping between the system control layers, Robot Operating System (ROS) was chosen as the middleware interface for controlling the system motors and acquiring the sensor's feedback [43]. In order to incorporate the system dynamics and control methods that were developed in the highlevel controller, the MATLAB bridge was added to the ROS network so as to connect the low-level hardware components with the high-level layer. The communication between the system layers was carried out using ROSSERIAL. A diagram that describes the ROS-MATLAB middleware is shown in Figure 19.

Middleware
In order to provide robust and real-time prototyping between the system control layers, Robot Operating System (ROS) was chosen as the middleware interface for controlling the system motors and acquiring the sensor's feedback [43]. In order to incorporate the system dynamics and control methods that were developed in the high-level controller, the MATLAB bridge was added to the ROS network so as to connect the low-level hardware components with the high-level layer. The communication between the system layers was carried out using ROSSERIAL. A diagram that describes the ROS-MATLAB middleware is shown in Figure 19.

Middleware
In order to provide robust and real-time prototyping between the system control lay ers, Robot Operating System (ROS) was chosen as the middleware interface for controllin the system motors and acquiring the sensor's feedback [43]. In order to incorporate th system dynamics and control methods that were developed in the high-level controller the MATLAB bridge was added to the ROS network so as to connect the low-level hardwar components with the high-level layer. The communication between the system layers wa carried out using ROSSERIAL. A diagram that describes the ROS-MATLAB middleware i shown in Figure 19. Subscriber nodes were added to relay the desired positions of the high-level controller and send them to the motor. Similarly, other nodes were running, which received all of the sensor readings from the low-level controller. ROS enabled communication amongst the devices that were working for the same master and MATLAB acted as a node under its command. ROS nodes were added to the developed dynamic model and are shown in Figure 20.  Primary validation trials were performed for the developed framework on the SAMA exoskeleton. For safety precautions, the control system architecture was tested freely without a human subject at first. The maximum speed was fixed at 0.3 rad/s and could be modified by the user at any time. The achieved workspace for SAMA was a dexterous workspace and it is shown in Figure 21. There are two types of comparable workspaces. The first one is the reachable workspace, which is the region that the end effector can reach with at least one orientation. The second one is the dexterous workspace; this is a subspace of the reachable workspace and it allows several orientations of the end-effector pose. A dexterous workspace always guarantees flexible and smooth movements of the arm exoskeleton [44]. Primary validation trials were performed for the developed framework on the SAMA exoskeleton. For safety precautions, the control system architecture was tested freely without a human subject at first. The maximum speed was fixed at 0.3 rad/s and could be modified by the user at any time. The achieved workspace for SAMA was a dexterous workspace and it is shown in Figure 21. There are two types of comparable workspaces. The first one is the reachable workspace, which is the region that the end effector can reach with at least one orientation. The second one is the dexterous workspace; this is a subspace of the reachable workspace and it allows several orientations of the end-effector pose. A dexterous workspace always guarantees flexible and smooth movements of the arm exoskeleton [44]. modified by the user at any time. The achieved workspace for SAMA was a dexterous workspace and it is shown in Figure 21. There are two types of comparable workspaces. The first one is the reachable workspace, which is the region that the end effector can reach with at least one orientation. The second one is the dexterous workspace; this is a subspace of the reachable workspace and it allows several orientations of the end-effector pose. A dexterous workspace always guarantees flexible and smooth movements of the arm exoskeleton [44].

Experimental Results and System Evaluation
The prototype SAMA exoskeleton was tested with a human subject in order to check the joint movements, torque, developed control framework, and system responses. Two joints were utilized in the experimental work: shoulder A/A and shoulder F/E . The required trajectories were those which enabled the human subject to move their arm from coordinate to and back to . Cubic polynomial algorithms were utilized for the

Experimental Results and System Evaluation
The prototype SAMA exoskeleton was tested with a human subject in order to check the joint movements, torque, developed control framework, and system responses. Two joints were utilized in the experimental work: shoulder A/A θ 1 and shoulder F/E θ 2 . The required trajectories were those which enabled the human subject to move their arm from coordinate P 1 to P 2 and back to P 1 . Cubic polynomial algorithms were utilized for the robot's trajectory planning with controlled parameters. The starting pose of the robot was transformed into the corresponding joint angles by inverse kinematics calculations, which were done on the high control layer in order to obtain the trajectory in joint space.
For each joint whose motion was planned individually, the trajectories were published to the controller at the low control level and, at the same time, to the dynamic model. The full dynamic model with the middleware nodes in addition to the computed torque controller is shown in Figure 22. The SAMA exoskeleton was tested with a healthy subject (31 years old, measuring 1.85 m tall, and weighing 80 kg). Screenshots for the experimental testing are shown in Figure 23 wherein both shoulder joints F/E and A/A were tested against the desired trajectory. robot's trajectory planning with controlled parameters. The starting pose of the robot was transformed into the corresponding joint angles by inverse kinematics calculations, which were done on the high control layer in order to obtain the trajectory in joint space. For each joint whose motion was planned individually, the trajectories were published to the controller at the low control level and, at the same time, to the dynamic model. The full dynamic model with the middleware nodes in addition to the computed torque controller is shown in Figure 22. The SAMA exoskeleton was tested with a healthy subject (31 years old, measuring 1.85 m tall, and weighing 80 kg). Screenshots for the experimental testing are shown in Figure 23 wherein both shoulder joints F/E and A/A were tested against the desired trajectory.   The experimental trajectory tracking has shown that and have followed the desired trajectory with a maximum angle of 45° and 90°, respectively, as can be seen in Figure 24. The output steady state position error was 0.25° for and 0.05° for . Moreover, the velocity responses to the same trajectory are shown in Figure 25 where the joints exhibited a maximum velocity of 3.82 rpm and 7.48 rpm for joints 1 and 2, respectively. Additionally, the maximum generated torques were 14.19 N.m for and 18.73 N.m for ; these are displayed in Figure 26. The experimental trajectory tracking has shown that θ 1 and θ 2 have followed the desired trajectory with a maximum angle of 45 • and 90 • , respectively, as can be seen in Figure 24. The output steady state position error was 0.25 • for θ 1 and 0.05 • for θ 2 . Moreover, the velocity responses to the same trajectory are shown in Figure 25 where the joints exhibited a maximum velocity of 3.82 rpm and 7.48 rpm for joints 1 and 2, respectively. Additionally, the maximum generated torques were 14.19 N.m for θ 1 and 18.73 N.m for θ 2 ; these are displayed in Figure 26.     From the obtained experimental results, the proposed control technique has provided good tracking performance with finite-time convergence. The experimental dynamic responses to the SAMA exoskeleton are shown in Table 7. In order to evaluate the obtained results, the results were compared to the responses of similar exoskeletons named Harmony upper body exoskeleton [45], Gravity balanced exoskeleton [46], NEURO-Exos elbow module [47], EAsoftM [48], MIT-MANUS [49], and ORTE [50]. SAMA's joint responses were found to be as robust as the aforementioned exoskeletons. The details of this comparison are shown in Table 8.

Conclusions and Future Work
In this paper, the details of a new lightweight and compact rehabilitation exoskeleton named SAMA that was developed for the shoulder-arm complex are described. The biomechanics of a healthy human subject were studied and these data were used for the mechanical design of the exoskeleton's structure, DOF, and ROM. The kinematics and dynamics of the exoskeleton were calculated in order to pave the way for the implementation of control schemes. A PID-CTC technique was used for SAMA, wherein a complete control architecture was developed for this system, which consisted of two main layers in addition to the middleware communication layer. The high-level controller was rapid prototyping software that was also an interface for the user. Desired trajectories and different control strategies can be added in this layer wherein the output can be shown in real-time simulation or real-time hardware testing. The low-level controller was concerned with the actuator's control and sensory feedback. Between those two layers, a middleware layer was added so as to handle the communication between the layers and ensure robustness and accurate control; this was based on a MATLAB-ROS bridge. The system was tested experimentally through the actuation of two shoulder joints along a planned trajectory. The output responses of the shoulder joints showed high accuracy and responsiveness as the steady state error for θ 1 was 0.25 • and 0.05 • for θ 2 . The output generated torques were 14.19 N.m and 18.73 N.m for joint 1 and joint 2, respectively, which are sufficient torques for the aforementioned joints. The dynamic responses were calculated and were found to be comparable to those of other rehabilitation exoskeletons that are mentioned in the literature.
The promising results that were obtained for this prototype encourage several research efforts in the future. Additional DOF are expected to be added so as to emulate the human arm and provide more dexterity in rehabilitation exercises during therapy. Furthermore, more sensors, such as electromyography (EMG) sensors, are planned to be added to the system in further development in order to enhance the control loops and provide comprehensive information about the muscle signals and the exerted effort during actuation. The developed control framework was mainly tested for a PID-CTC controller of the joints. Additional force/torque controllers are planned to be implemented in forthcoming research in order to broaden the usage of the exoskeleton against different loads. Several adaptive and machine learning-based controllers are planned for implementation in further research for better control responses against several subjects with different biomedical parameters and different loads.