Design and Control of a Single-Leg Exoskeleton with Gravity Compensation for Children with Unilateral Cerebral Palsy

Children with cerebral palsy (CP) experience reduced quality of life due to limited mobility and independence. Recent studies have shown that lower-limb exoskeletons (LLEs) have significant potential to improve the walking ability of children with CP. However, the number of prototyped LLEs for children with CP is very limited, while no single-leg exoskeleton (SLE) has been developed specifically for children with CP. This study aims to fill this gap by designing the first size-adjustable SLE for children with CP aged 8 to 12, covering Gross Motor Function Classification System (GMFCS) levels I to IV. The exoskeleton incorporates three active joints at the hip, knee, and ankle, actuated by brushless DC motors and harmonic drive gears. Individuals with CP have higher metabolic consumption than their typically developed (TD) peers, with gravity being a significant contributing factor. To address this, the study designed a model-based gravity-compensator impedance controller for the SLE. A dynamic model of user and exoskeleton interaction based on the Euler–Lagrange formulation and following Denavit–Hartenberg rules was derived and validated in Simscape™ and Simulink® with remarkable precision. Additionally, a novel systematic simplification method was developed to facilitate dynamic modelling. The simulation results demonstrate that the controlled SLE can improve the walking functionality of children with CP, enabling them to follow predefined target trajectories with high accuracy.


Introduction
CP is the most common child-onset mobility disorder [1,2], resulting from injury or damage to the brain before birth or in early childhood [3]. Individuals with CP suffer from inefficient and abnormal gait patterns [4], which can worsen with age, eventually losing ambulatory ability [5]. Abnormal gait patterns resulting from this condition increase the energy consumption in walking and lead to reduced mobility and independence [6,7]. Increased walking energy costs can mitigate engagement in society and negatively affect quality of life [8]. While there is no cure for CP, powered assistance from wearable LLEs has demonstrated significant potential in improving walking efficiency and reducing walking energy expenditure in impaired individuals [9][10][11]. One of the most common symptoms of CP is spasticity, which causes muscle stiffness and involuntary contractions [12]. LLEs can be used to assist children with CP in dealing with spasticity by providing external support to the affected muscles. The devices can help reduce spasticity by reducing the load on the affected muscles and providing assistance as needed [13]. Exoskeletons can also be programmed to provide resistance to certain movements to improve muscle strength and reduce spasticity over time [13].
Although numerous LLEs have been developed, only a limited number of LLEs have been tailored for the pediatric population, particularly for individuals with CP [10]. LLEs        1 Considering the height of a girl with CP and GMFCS level IV to be 110 cm [47], which is similar to the height of a healthy 6-year-old girl (112 cm) [49] (p. 524), we can estimate the leg length (LL) and foot length (FL) using the proportion of LL and FL from a healthy 5-year-old girl: LL = (110 × 63.9)/112 = 62.8 cm and FL = (110 × 16.8)/112 = 16.5 cm. 2 Considering the height of a boy with CP and GMFCS level I to be 143 cm [48], which is similar to the height of a healthy 12year-old boy (141 cm) [49] (p. 524), we can estimate the leg length (LL) and foot length (FL) using the proportion of LL and FL from a healthy 12-year-old boy: LL = (143 × 84.5)/141 = 85.7 cm and FL = (143 × 21.4)/141 = 21.7 cm.

Mechanical Design
The SLE is made of lightweight and durable materials, like aluminum tubes, to reduce the overall weight of the device (5.2 kg). The exoskeleton is equipped with telescopic cylinder mechanisms to ensure adjustable sizing and prevent misalignment and kinematic incompatibility between the user-exoskeleton joints, as children with CP come in various sizes, and their bodies can change over time ( Figure 2D). The vertical cut was made on one end of the outer tube and a clamp was attached to its outside, enabling easy adjustment to the desired length ( Figure 2D). Furthermore, the adjustment process is expedited and simplified by incorporating quick-release skewers ( Figure 2D). These mechanisms on both the upper and lower leg provide maximum adaptability for a wide range of users and ensure that the appropriate level of support is provided.
The device's braces come with adjustable straps and buckles, allowing for a customized fit and level of tightness to provide optimal support tailored to the unique needs of each user, as children with CP can have different and varying levels of muscle tone and spasticity. The SLE has removable and adjustable inserts and pads that can be added or removed to modify the level of support offered by the assistive device. For instance, a child may need extra support at their ankle joint, and an additional insert can be inserted to provide the necessary support. If needed, the exoskeleton design can include heel wedges to correct abnormal gait patterns. The use of padding and straps helps distribute pressure evenly and allows for easy adjustments, resulting in a user-friendly interface that provides comfort for both the user and caregiver while using the exoskeleton. The exoskeleton is equipped with an emergency stop button, a non-slip sole ( Figure 2E), and locking mechanisms that prevent the knee joint from bending too far, reducing the risk of falls and protecting the child from potential injuries. These features improve the overall safety of the exoskeleton, ensuring a safe and comfortable experience for the user.
In the mechanical design of LLEs for children with CP, the range of motion is a critical parameter to consider. Children affected by CP usually exhibit abnormal muscle tone, potentially leading to a reduced range of motion, contractures, and joint deformities. Thus, the design of an exoskeleton needs to take into account the individual needs of each child to ensure the optimal range of motion. The designed SLE in this study provides a range of motion encompassing 30 • of hip flexion and 90 • of extension, 120 • of knee flexion and full extension, as well as 45 • of plantar flexion and 30 • of dorsiflexion in the ankle joints. This enables the child to maintain a natural gait. The exoskeleton's range of motion is adjustable to cater to individual needs and the stage of the child's development as their range of motion is likely to change over time [13,50].

Actuation Unit
Actuators are essential components in the design of exoskeletons for children with CP, as they provide the necessary assistance to the child's leg(s). Brushless DC (BLDC) motors are the most frequently cited type of actuator in the literature for powered LLEs designed for children with CP, owing to their lightweight, compact, accurate, reliable, silent, and sufficiently powerful attributes [11]. TD children can generate a maximum torque of 0.7 Nm/kg at the hip, 0.5 Nm/kg at the knee, and 1.2 Nm/kg at the ankle during overground walking [51,52]. Moreover, they can produce a maximum power of 0.8 W/kg, 0.7 W/kg, and 3 W/kg, respectively, at the hip, knee, and ankle while walking overground [51,52]. For a TD child weighing 30 kg, the hip joint requires a maximum torque of around 21 Nm and power output of 24 W, the knee joint needs approximately 15 Nm and 21 W, and the ankle joint requires about 36 Nm and 90 W during movement. However, a recent study that evaluated the mean and maximum joint torque, power, and velocity of TD children indicates that children can achieve significantly higher maximum values for joint torque and power compared to the values mentioned earlier [20]. The study's findings suggest that these higher maximum values could be taken into consideration while selecting appropriate actuators for pediatric LLEs to provide optimal assistance.
Following an extensive review of the literature and analysis of various motors and reduction ratios to satisfy the specific criteria and essential requirements, an actuator unit was selected. The joint actuation unit is comprised of a high-performance 24 V BLDC motor (EC-flat, Maxon Motor AG, Sachseln, Switzerland) and a state-of-the-art strain-wave gearing system (CPU-17A-M, Harmonic Drive ® AG, Limburg, Germany). The EC-flat series of BLDC motors was chosen for its superior durability, lightweight construction, quiet operation, and high power efficiency, all of which render it an excellent option for use in powered exoskeletons. The particular gearing system, known as CPU-17A-M, is specifically designed to operate seamlessly with the BLDC motor, ensuring smooth and precise movement of the exoskeleton's joint. The CPU-17A-M series is renowned for its compact size, high precision, and low backlash characteristics, making it an ideal choice for joint actuation units in pediatric exoskeletons.
The actuation unit configuration for the three actuated joints is illustrated in Table 2. The table demonstrates that each of the three actuation units is capable of covering the maximum power, torque, and velocity addressed in the literature. For instance, knee and ankle joints have similar actuators with a power rating of 150 W. However, the knee joint has a reduction ratio of 50, while the ankle joint has a reduction ratio of 120. Moreover, it has been observed that TD children can generate a maximum torque of 0.5 Nm/kg at the knee and 1.2 Nm/kg at the ankle during overground walking. The actuation units used in the exoskeleton's knee and ankle joints can produce torques that are fully compatible with the structure of the knee actuator. Additionally, Figure 2A illustrates an exploded view of the strain-wave gearbox, with "WG" representing the wave generator. In order to drive each motor, Maxon EPOS4 50/15 controllers were selected ( Figure 2C). These controllers are specifically designed to support the EtherCAT protocol and operate as a slave in the network. Additionally, they offer high precision and reliability in controlling the motor's speed, position, and torque. The selection of these controllers ensures optimal performance of the joint actuation unit, providing smooth and accurate motion control for the powered SLE. The combination of the BLDC motor, strain-wave gearing system, and high-quality EPOS4 driver results in a sophisticated and efficient actuation unit for the SLE, capable of meeting the demanding requirements of individuals with mobility impairments.

Sensory System
Several different sensors are utilized throughout the SLE to ensure optimal performance and control. These sensors include hall sensors, absolute encoders, pressure sensors, and inertial measurement units (IMUs).
Hall sensors are used to measure the position and speed of the motors, providing real-time feedback to the controller for optimal control of joint movement. This real-time feedback can help reduce spasticity by delivering a consistent and controlled movement pattern, reducing sudden or unexpected movements that can trigger spasms. In addition, the controller can adjust the level of assistance provided by the exoskeleton in real time based on the feedback from the hall sensors, further reducing the likelihood of spasticity.
To provide more accurate joint angle measurement, a magnetic absolute rotary encoder is integrated for each actuated joint (Figure 2A,B). The RLS AksIM-2™ magnetic encoder is directly connected to the Maxon EPOS 4 motor driver using the SSI communication protocol, with a high resolution of up to 20 bits. Absolute encoders offer extremely precise joint angle measurements, resulting in more natural and fluid movements for the exoskeleton while reducing the likelihood of spasms. By providing real-time feedback from hall sensors and highly accurate joint angle measurement from absolute encoders, the exoskeleton can facilitate natural and efficient walking patterns tailored to the user's specific needs.
The foot of the exoskeleton is equipped with an electronic sensor board ( Figure 2E) that tracks the orientation of the foot and monitors the ground reaction force. To accurately measure pressure distribution from multiple directions, the exoskeleton utilizes four FlexiForce A201 force sensors that are connected to the electronic board ( Figure 2E). By monitoring pressure distribution from different directions, the exoskeleton can adjust its movement patterns to provide more natural and controlled movements, which can aid in preventing falls and improving overall safety during walking. The output signals of force-sensitive resistor (FSRs) are typically small, so four op-amp microchips (LF356) are recruited to amplify the force sensors' signals and to make them suitable for an STM32 Nano microcontroller to process the signals and transmit them through high-speed CAN bus ( Figure 2E).
The acquisition of foot orientation is carried out by an embedded IMU (MPU9250) located on the foot electronic board. By utilizing a combination of gyroscope, accelerometer, and magnetometer data, the IMU is able to measure the foot's position and orientation with high precision. This information can be utilized to evaluate gait patterns and detect any asymmetries or abnormal movements, enabling healthcare professionals to customize treatment plans and interventions according to the unique requirements of each child. To ensure accurate gait phase detection, it is necessary to equip both legs with footplates that include electronic sensory boards. Furthermore, each footplate's height is 23 mm, and since both legs are equipped with footplates with the same height, a user will not feel any difference in height between their legs. An EasyCAT EtherCAT Shield is recruited to receive sensory information from both feet through the CAN bus and actuator signals from a series of EPOS 4 drivers via EtherCAT cable to facilitate their transmission to the central controller (EtherCAT Master).

Control Architecture
To ensure precise control of all three motors and enable real-time sensor data collection, we established the control system configuration for the SLE, as illustrated in Figure 3. The control system in the SLE is typically divided into three essential components: local controllers (EtherCAT Slaves); sensory and communication system; and the central controller with local controllers via EtherCAT and FSRs through CAN Bus. Finally, we selected state-of-the-art real-time embedded controller (Unit real-time target machine, Speedgo Köniz, Switzerland) as the central control unit to ensure system stability and optimi performance.
The Unit real-time target machine is renowned for its compact size and ability effectively execute high-performance control applications and conduct small-scale pla simulations. This central control unit is capable of serving as the EtherCAT master an executing the system with a frequency of 1 kHz. One of the key benefits of usi Speedgoat is the ability to design and develop control algorithms in MATLAB Simulin and then compile them into a C executable file for deployment on the target machine. D to the close and direct interaction between Speedgoat and MATLAB, all the SL simulations and control designs were carried out in MATLAB R2021a, which is high compatible with the installed software version on the central controller. To create intuitive and user-friendly interface, a high-performance host computer was connected the Speedgoat target machine via an Ethernet cable to serve as the human-machi interface (HMI).  The Unit real-time target machine is renowned for its compact size and ability to effectively execute high-performance control applications and conduct small-scale plant simulations. This central control unit is capable of serving as the EtherCAT master and executing the system with a frequency of 1 kHz. One of the key benefits of using Speedgoat is the ability to design and develop control algorithms in MATLAB Simulink ® and then compile them into a C executable file for deployment on the target machine. Due to the close and direct interaction between Speedgoat and MATLAB, all the SLE simulations and control designs were carried out in MATLAB R2021a, which is highly compatible with the installed software version on the central controller. To create an intuitive and user-friendly interface, a high-performance host computer was connected to the Speedgoat target machine via an Ethernet cable to serve as the human-machine interface (HMI).
The Unit real-time target machine enables the implementation of adaptive control algorithms that account for varying levels of spasticity and motor function impairments as defined by the GMFCS (Gross Motor Function Classification System). This adaptability ensures that the exoskeleton provides personalized assistance and support to each child based on their specific needs. Furthermore, Speedgoat real-time target machines also support hardware-in-the-loop (HIL) simulation, enabling the testing of control strategies in real time without risking damage to the hardware or causing discomfort to users. This feature is crucial when working with children with CP, ensuring their safety and comfort during the development and testing phases. Lastly, the system's ability to handle multiple control loops and sensor inputs at different rates enables seamless integration and synchronization of various sensors and actuators, which is critical for addressing spasticity and coordinating the exoskeleton's movement with the user's intentions. By utilizing a Speedgoat real-time target machine to control SLEs for children with CP, researchers and engineers can develop more effective, personalized, and responsive assistive devices that improve the mobility and quality of life of affected individuals. Moreover, it is essential to emphasize that the SLE relies on tethered power assistance for its functionality. This method enables the device to maintain a stable and uninterrupted energy supply through a physical connection to a power source.

Kinematic Analysis
Kinematic analysis is essential for understanding the movement of SLEs and their interaction with the human body. It involves examining the relationship between the exoskeleton's component position and orientation and the corresponding joint angles necessary for motion [53]. The presence of misalignment and kinematic incompatibility between the user-exoskeleton joints can lead to the generation of undesired human-robot interaction torques. This underscores the importance of performing a thorough kinematic analysis of SLEs, particularly for children with CP [54][55][56]. Kinematic analysis can help optimize the design of SLEs for children with CP by ensuring that the device provides the appropriate support and assistance based on the child's individual movement patterns and needs. This can lead to improved mobility, function, and quality of life for these children [57].
Kinematic analysis is typically divided into two categories [35]: forward kinematics, which deals with determining the exoskeleton's end-effector (such as the foot) position and orientation based on joint angles, and inverse kinematics, which involves calculating the joint angles needed to achieve a desired end-effector position and orientation. Forward and inverse kinematics are crucial for developing practical and comfortable SLEs that can restore mobility to people with lower-limb impairments.

Forward Kinematic
Forward kinematics involves using the joint angles and segment lengths to calculate the position and orientation of the end effector (e.g., the foot) relative to the starting position of the limb. This information can be used to predict how the limb will move under certain conditions, such as when walking or standing. By using forward kinematics, the movement of the exoskeleton joints can be translated into the movement of the foot, allowing for precise control and monitoring of the gait pattern [35,58]. Moreover, forward kinematics can help determine how the device should be designed to provide a user with appropriate support and assistance. In the case of SLEs for children with CP, forward kinematics can be used to tailor the exoskeleton to the individual child's gait pattern and specific needs. By analyzing the child's gait using motion capture or other techniques, the joint angles of the exoskeleton can be adjusted to provide a more natural and efficient gait pattern [54,59,60].
The Denavit-Hartenberg (D-H) matrix method is commonly used to derive forward kinematics [35], which provides insights into the range of motion, joint limits, and performance of the exoskeleton. Despite its lengthy and intricate mathematical process, the D-H method establishes a systematic framework for modelling the kinematics of robotic mechanisms [61]. In Figure 4, the kinematic configuration of an SLE is shown following the D-H standard form, with each link having specific frames assigned to it. In the figure presented, the starting point O 0 is defined as a stationary base frame, while the terminal coordinate system O 3 is denoted as the foot end effector. The kinematic transformation depicted in this figure adheres to the guidelines and principles outlined by the D-H model. This study entails the independent modelling of the exoskeleton in two distinct environments, namely Simscape and Simulink. As the two models must be compatible with each other, in Figure 4, the reference frame (X 0 , Y 0 , Z 0 ) is chosen to be identical to the global frame (X, Y, Z), thereby ensuring consistent results using two diverse and autonomous methodologies. transformation depicted in this figure adheres to the guidelines and principles out by the D-H model. This study entails the independent modelling of the exoskeleton in distinct environments, namely Simscape and Simulink. As the two models mu compatible with each other, in Figure 4, the reference frame (X0, Y0, Z0) is chosen identical to the global frame (X, Y, Z), thereby ensuring consistent results using diverse and autonomous methodologies. According to Figure 4, Table 3 presents the tabulated form of the D-H param where represents the joint angle, corresponds to the joint offset, denotes th length, and specifies the link twist of the i-th link. The transformation matrix of link is provided below with reference to Table 3. Table 3. D-H robotic SLE parameters. According to Figure 4, Table 3 presents the tabulated form of the D-H parameters, where θ i represents the joint angle, d i corresponds to the joint offset, a i denotes the link length, and α i specifies the link twist of the i-th link. The transformation matrix of each link is provided below with reference to Table 3. Table 3. D-H robotic SLE parameters.
Based on the derived equations, the forward kinematics model for the SLE can be expressed as follows: where P x and P y represent the position of frame 3, which is the forefoot of the exoskeleton (end effector), relative to the global frame, along the x and y axes, respectively. These position values are computed as follows: The transformation matrices are utilized directly and effectively to derive the dynamic equations of the human-SLE system.

Inverse Kinematic
Inverse kinematics involves using the desired position and orientation of the end effector to calculate the joint angles required to achieve that position [35]. This can be particularly useful in designing exoskeletons for children with CP, as the exoskeleton can be programmed to assist with specific movement patterns that are difficult for the child to perform on their own. Moreover, the inverse kinematics model can help optimize the exoskeleton's design, including the size and shape of links and joints, to maximize performance while minimizing energy expenditure and discomfort, which are critical for children with CP. This process involves simulating different gait patterns and evaluating the exoskeleton's ability to reproduce them accurately [15,54,62].
When dealing with an SLE, a geometric approach towards inverse kinematics is considered highly suitable for determining the variables θ 1 , θ 2 , and θ 3 that correspond to the foot's position and orientation, which serves as the end effector. The determination of the inverse trigonometric function does not result in a unique solution, and consequently, it gives rise to multiple solutions in the context of robot inverse kinematics. To address this issue, a common approach involves incorporating the structural properties of the robot and the actual pose. It is established in the literature that an analytical solution for the inverse kinematics problem can be derived when the kinematic chain consists of five or fewer DOF. In such cases, the angle of each joint can be determined through an algebraic method [35,63,64].
The inverse kinematic problem of the SLE involves determining the joint angles needed to achieve the desired position (X, Y) and orientation (Φ) of the end effector (foot) ( Figure 5). Specifically, (7)- (14) show the relationship between the joint angles and the desired position and orientation of the end effector. Equation (7) releases the x and y coordinates of the second link (shank) with respect to the desired position (X, Y) and orientation (Φ) of the end effector (foot).
Equation (8) gives the x and y coordinates of the second link (shank) in terms of the joint angles θ 1 and θ 2 , where a 1 and a 2 are the lengths of the first (thigh) and second (shank) links, respectively.
x = a 1 sin(θ 1 ) + a 2 sin(θ 1 + θ 2 ) y = a 1 cos(θ 1 ) + a 2 cos(θ 1 + θ 2 ) coordinates of the second link (shank) with respect to the desired position (X, Y) and orientation (Φ) of the end effector (foot). sin cos (7) Equation (8) gives the x and y coordinates of the second link (shank) in terms of the joint angles θ₁ and θ₂, where a₁ and a₂ are the lengths of the first (thigh) and second (shank) links, respectively.
By squaring x and y and adding them, we obtain (9): 2 cos By solving (9) for θ₂ using the inverse cosine function, the joint angle θ₂ can be determined.
In the case of the SLE, only the negative value of θ₂ is acceptable. Equation (11) gives the expression for θ₂ in terms of the desired position (X, Y) and orientation (Φ) of the end effector, where a₃ is the length of the third link (foot).
Moreover, for , we obtain the following: Equation (13) gives the expression for θ₁ in terms of the joint angles θ₂ and the desired position (X, Y) and orientation (Φ) of the foot. By squaring x and y and adding them, we obtain (9): By solving (9) for θ 2 using the inverse cosine function, the joint angle θ 2 can be determined.
In the case of the SLE, only the negative value of θ 2 is acceptable. Equation (11) gives the expression for θ 2 in terms of the desired position (X, Y) and orientation (Φ) of the end effector, where a 3 is the length of the third link (foot).
Moreover, for θ 1 , we obtain the following: Equation (13) gives the expression for θ 1 in terms of the joint angles θ 2 and the desired position (X, Y) and orientation (Φ) of the foot.
Finally, (14) gives the expression for the joint angle θ 3 as follows: It is crucial to emphasize that the desired path should be determined by a rehabilitation plan created by a healthcare professional treating the child with CP. Consequently, corresponding inverse kinematic analysis was conducted to improve the understanding of the SLE's motion capabilities.

Dynamic Modelling
In this section, the dynamic model of the coupled human-SLE system is derived using the transformation matrices discussed in the previous section. This helps enhance the understanding of the complex behavior of the coupled human-SLE system and enables the design of a more effective control algorithm. As a result, smoother and more coordinated movements are achieved, preventing the triggering of spasms in CP users. This dynamic model effectively aids in designing the gravity compensator within the control system, considering the complex interaction between the user and the exoskeleton. The gravity compensator minimizes or eliminates the exoskeleton's weight impact on the user, reducing energy expenditure and making the device feel lighter and more comfortable to wear. As mentioned earlier, children with CP have twice the metabolic consumption compared to their healthy peers [41]. Moreover, the weight and mass distribution of exoskeletons directly affect energy expenditure [42][43][44]. Thus, it is crucial for exoskeletons designed for children with CP to incorporate a controller with a gravity compensator, decreasing energy expenditure and enhancing comfort. Moreover, dynamic modeling can be used to develop assist-as-needed control strategies, which provide the appropriate level of assistance based on the user's abilities and needs. By continuously monitoring the user's performance and adapting the level of assistance in real time, these control strategies can help reduce spasticity and improve motor function in children with CP.
This study considers the coupled human-exoskeleton system as an integrated system and tries to model the dynamics of the coupled human-SLE system [65][66][67]. The dynamic models of coupled human-LLEs are usually presented by the inverted pendulum approach, as shown in Figure 6 [68,69]. The robotic SLE can be considered a fixed-base mechanism; therefore, the dynamic modeling and control approaches of fixed-base manipulators can be efficiently employed [65]. The overground gait cycle is divided into two main phases: the swing phase and the stance phase. During the swing phase, the SLE can be simplified as a hanging triple pendulum, operating under the assumption that the hip remains stationary. This simplification allows for a more straightforward analysis and control design for the exoskeleton during this phase of the gait cycle. In the stance phase, on the other hand, the exoskeleton is modeled as an inverted pendulum, with the ankle joint acting as the fixation point. This modeling approach captures the inherent dynamics and stability characteristics of the exoskeleton during the weight-bearing portion of the gait cycle [54]. The Euler-Lagrange (E-L) and the Newton-Euler (N-E) formulations are commonly employed to model multibody dynamics. The former is based on energy, while the latter relies on forces to derive the dynamic model. The literature reveals that the E-L formulation has been extensively utilized to model the dynamics of exoskeletons [65]. The The Euler-Lagrange (E-L) and the Newton-Euler (N-E) formulations are commonly employed to model multibody dynamics. The former is based on energy, while the latter relies on forces to derive the dynamic model. The literature reveals that the E-L formulation has been extensively utilized to model the dynamics of exoskeletons [65]. The E-L equation is presented as follows [35]: the Lagrangian is defined as = K − P, where K represents the kinetic energy and P is the potential energy of the system. In this question, q denotes the variable of generalized coordinates, and τ represents the torque of the system. With (15), the dynamic model of a simplified coupled human-exoskeleton ( Figure 6A) can be presented as follows [35,65]: where M(q) is the inertia matrix, including the exoskeleton inertia M e (q) and the human inertia M h (q). C(q, . q) represents the Coriolis and centripetal matrix, with C e (q, . q) and C h (q, . q) as the exoskeleton and human terms, respectively. G(q) is the gravity vector, encompassing G e (q) and G h (q) for the exoskeleton and the human gravity terms, respectively. Additionally, q is the generalized angular-joint-displacement vector, and τ is the torque vector, including τ e and τ h as the applied torque from the exoskeleton and the human, respectively. The inertia matrix (M(q)), the Coriolis and centripetal matrix (C(q, . q)), and the gravity vector (G(q)) for a fixed-based robot with n-DOF can be achieved based on the following equations [35]: where m i is the mass, J vi and J wi are linear and angular Jacobians, R i is the rotational matrix for the i-th link of the coupled human-SLE system, and P represents the potential energy. The extension of the equations for a 3-DOF coupled human-SLE system ( Figure 6A) is provided in Appendix A. Equation (16) describes the forward dynamics of the coupled human-exoskeleton system. In contrast, the inverse dynamics of the system, which are particularly useful for simulation modeling, is presented below: ..
The presented inverse dynamics model is directly implemented to model the coupled human-exoskeleton system in MATLAB Simulink ® . This approach enables the simulation of the system's behavior under different conditions and facilitates the analysis of its dynamics.
In this section, the dynamic model of the coupled human-exoskeleton system is derived using the transformation matrices discussed in the previous section. This helps enhance the understanding of the complex behavior of the coupled human-exoskeleton system and enables the design of a more effective control algorithm. As a result, smoother and more coordinated movements are achieved, preventing the triggering of spasms in CP users. This dynamic model effectively aids in designing the gravity compensator within the control system, considering the complex interaction between the user and the exoskeleton. The gravity compensator minimizes or eliminates the exoskeleton's weight impact on the user, reducing energy expenditure and making the device feel lighter and more comfortable to wear. As mentioned earlier, children with CP have twice the metabolic consumption compared to their healthy peers [41]. Moreover, the weight and mass distribution of exoskeletons directly affect energy expenditure [42][43][44]. Thus, it is crucial for exoskeletons designed for children with CP to incorporate a controller with a gravity compensator, decreasing energy expenditure and enhancing comfort. In this scenario, the controlled SLE with gravity compensation functions as an assistive device with a zero-gravity effect.
A comprehensive dynamic model facilitates the development of exoskeletons' adaptable to different users, walking patterns, and environments. This adaptability is essential for creating personalized devices catering to the individual needs of users with various physical conditions, particularly for exoskeletons designed for children with CP. Furthermore, this dynamic modeling approach enabled us to create simulations to analyze the exoskeleton's behavior and refine its design before constructing a physical prototype. This effectively saved time and resources during the development process, helping identify potential issues before they become critical, ultimately increasing safety and reliability.

Controller Structure
As discussed in the previous section, the coupled human-SLE system can be simplified as a hanging triple pendulum during the swing phase and as an inverted pendulum during the stance phase. The inverted pendulum exhibits highly unstable dynamics, making it essential to implement a controller to ensure system stability and prevent the user and exoskeleton from falling.
The literature indicates that impedance control is a widely used control algorithm for LLEs, particularly for those designed for children with CP [11]. Impedance controllers are useful for controlling the interaction between the exoskeleton and the user's limb, particularly in situations where the impedance of the limb is not well-defined, such as in individuals with neuromuscular disorders like CP. Impedance control enables exoskeletons to maintain compliant and adaptive interactions with users by regulating force and joint displacement, preventing injury from excessive force.
For children with CP, spasticity and varying GMFCS levels can present challenges in providing effective assistance. Impedance control is particularly effective in addressing these issues. By adjusting impedance parameters, the algorithm can be customized for different users and tasks, accommodating spasticity and varying GMFCS levels, ensuring safer and smoother interactions. Focusing on force control rather than solely on joint positions allows the exoskeleton to react to unexpected forces or changes in user movements, which is especially beneficial for users with spasticity. Impedance control also contributes to the stability of the human-SLE system and provides natural-feeling assistance by mimicking human muscle and joint characteristics. This natural interaction helps children with CP feel more comfortable and confident when using the exoskeleton, ultimately improving their overall experience and outcomes.
It is important to note that children with CP have metabolic consumption rates twice as high as those of their healthy peers [39][40][41], with energy consumption being directly related to the effects of gravity [42][43][44]. As such, the controller should not only ensure system stability but also compensate for gravity, making the controlled human-SLE system suitable for CP users who struggle with the burden of weight.
In general, the dynamic equation of a simplified coupled human-SLE with actuators can be written as follows: where M (q) represents the inertia matrix, which includes both the coupled system inertia and actuator inertia. Furthermore, B is negligible in comparison with C(q, . q), and for simplicity, we will take B = 0. When the input is not saturated, there is no significant difference in simulating with or without friction. Therefore, we obtain the following: According to the PD impedance controller with gravity compensation, we obtain the following control signal: where ∼ q is the angular position error between the joint references and the actual positions ( ∼ q = q re f − q), and K p and K d are positive diagonal matrices. Since q re f is assumed as a step input, . ∼ q = − . q and . q re f = 0. According to (22) and (23), we obtain the following: After removing the gravity term (G(q)), we have: To prove that the designed controller in (23) is stable and results in asymptotic tracking, consider the following Lyapunov function candidate, V represents the total energy and is a positive function, except at the equilibrium position where q = q re f and . q = 0; at this point, V is zero. If we can prove that V decreases during any motion, it will demonstrate that the system approaches the equilibrium position.
From (26) and (27), we obtain the following: From (28) and (25), we can obtain the following: Since . M − 2C is skew-symmetric [35], M − 2C . q = 0. Therefore, we obtain the following: where K d is a positive definite diagonal matrix. This result shows that V decreases as long as . q is non-zero. Furthermore, it is important to demonstrate that once .
V becomes zero, we reach the equilibrium position (q = q re f ). To this end, suppose . V = 0 for all times. Since K d is a positive definite matrix, . q = 0 and hence .. q = 0. By substituting this in (25), we find the following: Finally, La Salle's theorem [35] confirms that the model is a globally asymptotic stable system in the equilibrium position (q = q re f ). It should be noted that if the gravity term (G(q)) is unknown, this controller cannot be applied, and a robust controller must be designed to handle uncertainties.

Simulation and Validation Results
This section aims to simulate the coupled human-SLE system using the PD impedance controller and gravity compensator in MATLAB Simulink ® and Simscape ™ . Our objective is to validate the derived dynamics model of the coupled human-SLE system in the previous sections and demonstrate the controlled system stability. Figure 7 depicts the hierarchical control architecture for the coupled human-SLE system. Within this architecture, the supervisory-level controller provides the desired trajectory to the high-level controller. The high-level controller then employs the PD impedance controller with a gravity compensator to generate the required torque for the low-level controller. In turn, the low-level controller utilizes a PI controller to apply the appropriate control signal to the exoskeleton actuators.
We employed SolidWorks ® Student Edition (2021-2022) and Autodesk ® Fusion 360™ (2020) as the CAD software for the mechanical design and modeling of the SLE. Furthermore, we obtained the Q-6 dummy demo model from [70] and imported it into SolidWorks to represent the user. To model and analyze the dynamics of the coupled human-SLE system and establish a model-based controller, we exported the coupled human-SLE system ( Figure 2) from SolidWorks ® and imported it into MATLAB ® Simscape. It should be noted that MATLAB ® R2021a was used in this study. A fixed-step size of 10 −3 and an auto solver with a relative tolerance of 10 −3 were employed to solve the differential equations.  The imported model in Simscape functioned as a black box system f we had no knowledge of the system's dynamic parameters. In order to d based controller for the gravity compensator, we opted to model the Simulink. In this scenario, we successfully validated the derived dyna comparing the Simulink results with the corresponding Simscape signals to the extreme complexity of the imported model in Simscape, we neede prior to implementing it in Simulink. Therefore, a simplified leg, consis shank, and foot connected by three revolute joints, was modeled in Simsca the complex imported model. Then, we utilized this simplified system model the coupled human-SLE system in Simulink, employing the MAT The controller was designed using a MATLAB Function in Simulink an applied to both Simscape and Simulink to stabilize the system, track the counteract the effects of gravity.
The general architecture of the interaction among SolidWorks, The imported model in Simscape functioned as a black box system for us, meaning we had no knowledge of the system's dynamic parameters. In order to design a modelbased controller for the gravity compensator, we opted to model the system using Simulink. In this scenario, we successfully validated the derived dynamic model by comparing the Simulink results with the corresponding Simscape signals. However, due to the extreme complexity of the imported model in Simscape, we needed to simplify it prior to implementing it in Simulink. Therefore, a simplified leg, consisting of a thigh, shank, and foot connected by three revolute joints, was modeled in Simscape to represent the complex imported model. Then, we utilized this simplified system in Simscape to model the coupled human-SLE system in Simulink, employing the MATLAB Function. The controller was designed using a MATLAB Function in Simulink and subsequently applied to both Simscape and Simulink to stabilize the system, track the trajectory, and counteract the effects of gravity.
The general architecture of the interaction among SolidWorks, Simscape, and Simulink is depicted in Figure 8. This figure illustrates that the coupled human-SLE system is designed in SolidWorks and imported to Simscape. Furthermore, this figure shows that the Simscape model comprises two sub-models: the detailed model and the simplified model, with the latter being derived from the former. Subsequently, this simplified model is utilized for modeling the coupled human-SLE system in Simulink. Finally, the outcomes of the Simulink model and the detailed model in Simscape are compared to validate the derived dynamic model of the system. The controller was designed using a MATLAB Function in Simulin applied to both Simscape and Simulink to stabilize the system, track counteract the effects of gravity.
The general architecture of the interaction among SolidWo Simulink is depicted in Figure 8. This figure illustrates that the co system is designed in SolidWorks and imported to Simscape. Furth shows that the Simscape model comprises two sub-models: the deta simplified model, with the latter being derived from the former. simplified model is utilized for modeling the coupled human-SLE s Finally, the outcomes of the Simulink model and the detailed mod compared to validate the derived dynamic model of the system. In Simscape, we employed an "Inertia Sensor" to measure the i each link, including mass ( ), length ( ), center of mass (ℓ ), and m In Simscape, we employed an "Inertia Sensor" to measure the inertia properties of each link, including mass (m i ), length (l i ), center of mass ( ci ), and moment of inertia in the z-axis (I zzi ), where the index i denotes the link number. The first link represents the thigh, the second link corresponds to the shank, and the third link demonstrates the foot, as depicted in Figure 6. The symbolic calculation of the E-L equation of motion in Appendix A reveals that only the moment of inertia in the z-axis of each link is included in the equations, while other inertia terms are eliminated. Consequently, we focused on measuring I zzi and disregarded the other inertia terms. The inertia properties for the human, SLE, and the detailed model of the coupled human-SLE system were measured in Simscape. These values were used in the simplified model within Simscape and the Simulink model to validate the derived dynamics model of the coupled human-SLE system and confirm its stability under the designed controller. Table 4 presents the numerical values of the mass and the length of each link for both the human and the exoskeleton in Simscape. To enhance the accuracy and minimize the angular position error between the detailed model and the simplified model, we measured each parameter with 15 decimal places to ensure that the Simulink model is a reliable version of the detailed model. This study introduces a novel approach called the "Simscape Multibody Simplification Method" (SMS method), which provides a step-by-step guide for deriving a simplified model from a detailed model. The SMS method is detailed in Appendix C of this paper. According to the SMS method, in the inertia sensor, options for "Span Weld Joints", "Mass", "Center of Mass", and "Centered Inertia Matrix" should be activated, with the "Measurement Frame" set to "Custom". The configuration of the inertia sensor for the hip connection between the detailed model and the simplified model within Simscape is illustrated in Figure 9. Table 5 presents the inertia properties of the detailed model and the simplified model of the coupled human-SLE system in Simscape, enabling comparison. In Table 5, the measured mass of each link (m i ) for the detailed model is equal to the sum of the user's mass and the SLE's mass, as presented in Table 4. Moreover, the measured mass for each link in the simplified model is exactly half that of the detailed model. The same scenario applies to the moment of inertia in the z-axis (I zzi ), where the measured inertia of the simplified model is exactly half that of the detailed model. The center of mass ( ci ) is exactly the same for both the detailed model and the simplified model, where the length of each link (a i ) is approximately equal between the two models. According to Table 5, the numerical values of the inertia matrix (M(q)), Coriolis and centripetal matrix (C(q, . q)), gravity vector (G(q)), and torque vector (τ) for a 3-DOF coupled human-SLE system ( Figure 6A) are provided in Appendix A. The Detailed-Model and the Simplified-Model of the coupled human-SLE system, along with their configurations within Simscape, are depicted in Figure 10. Figure 10A displays the main elements of the detailed model, imported from SolidWorks, while Figure 10B presents the components used in the simplified model. The inputs for the models are torque, and the outputs consist of joint angles, including those of the hip, knee, and ankle. According to Table 5, the mass and inertia of the detailed model are twice those of the simplified model. As a result, it is expected that the torque applied to the detailed model is double the torque applied to the simplified model. This is the reason why the torques applied to the detailed model are multiplied by gains with values of two. According to Table 5, the numerical values of the inertia matrix (M(q)), Coriolis and centripetal matrix ( , ), gravity vector (G(q)), and torque vector (τ) for a 3-DOF coupled human-SLE system ( Figure 6A) are provided in Appendix B. The Detailed-Model and the Simplified-Model of the coupled human-SLE system, along with their configurations within Simscape, are depicted in Figure 10. Figure 10A displays the main elements of the detailed model, imported from SolidWorks, while Figure 10B presents the components used in the simplified model. The inputs for the models are torque, and the outputs consist of joint angles, including those of the hip, knee, and ankle. According to Table 5, the mass and inertia of the detailed model are twice those of the simplified model. As a result, it is expected that the torque applied to the detailed model is double the torque   Figure 11 depicts the controlled human-SLE system in Simulink, where the green box represents a MATLAB function encompassing the inverse dynamics of the coupled human-SLE system. The green box has inputs for torque, angular position, and angular velocity and outputs the angular acceleration for each joint of the hip, knee, and ankle.  Figure 11 depicts the controlled human-SLE system in Simulink, where the green box represents a MATLAB function encompassing the inverse dynamics of the coupled human-SLE system. The green box has inputs for torque, angular position, and angular velocity and outputs the angular acceleration for each joint of the hip, knee, and ankle. The green box contains the numerical values of parameters for the inertia matrix (M(q)), the Coriolis and centripetal matrix (C(q, . q)), and the gravity vector (G(q)) as described in (20) for the inverse dynamics of the 3-DOF coupled human-SLE system, provided in Appendix B. As depicted in Figure 11, the gray box labeled "Desired Leg Angles" generates the reference angular positions, which are subsequently fed into the yellow box labeled "Controller". In addition to the reference trajectories, the yellow box (controller) receives angular positions and angular velocities as inputs, and it utilizes the control laws in (23) to generate desired torque commands, driving the coupled human-SLE system toward the desired angular positions. The controller architecture, given by the equation (23), is displayed in Figure 12. As discussed in Section 5, K p and K d are positive diagonal matrices representing the proportional and derivative gains, respectively, which contribute to the control input. The position error, denoted by ∼ q, and its rate of change, denoted by . ∼ q, are multiplied by these gain matrices. The term G(q) represents gravity compensation. In Figure 12, the proportional gain matrix K p has values of 80, 80, and 50 along its main diagonal, while the derivative gain matrix K d has values of 12, 12, and 2 along its main diagonal.
The green box utilizes the torque provided by the controller and the angular position and angular velocity as feedback to compute the angular acceleration for each joint, employing the inverse dynamics technique in (20) for the coupled human-SLE system. By using this approach, the green box can accurately simulate the behavior of the system and provide insights into its dynamics. After integrating the angular acceleration computed by the green box a couple of times, the angular velocity and angular position for each joint are obtained. Since the computed angular positions are in radians, we used gains with a rate of 180/π to convert them from radians to degrees, as shown in Figure 13. by the green box a couple of times, the angular velocity and angular position for each joint are obtained. Since the computed angular positions are in radians, we used gains with a rate of 180/π to convert them from radians to degrees, as shown in Figure 13. The angular positions of the reference (θRef), the detailed model in Simscape (θSimscape), and the Simulink model (θSimulink) for each joint of the hip, knee, and ankle for two gait cycles are shown in Figure 13A-C. The reference value changes every three seconds, with each gait cycle being completed within six seconds. In these figures, the Simulink and Simscape angular positions precisely overlap for all hip, knee, and ankle joints. Figure  13D displays the angular position error between the detailed model ( Figure 10A) and the simplified model ( Figure 10B) in Simscape, indicating that the error range is within 10 degrees for all hip, knee, and ankle joints. This error range demonstrates the reliability of the simplified model in Simscape, which will be used to design the Simulink model for the coupled human-SLE system. Figure 13E presents the discrepancy in angular positions The angular positions of the reference (θ Ref ), the detailed model in Simscape (θ Simscape ), and the Simulink model (θ Simulink ) for each joint of the hip, knee, and ankle for two gait cycles are shown in Figure 13A-C. The reference value changes every three seconds, with each gait cycle being completed within six seconds. In these figures, the Simulink and Simscape angular positions precisely overlap for all hip, knee, and ankle joints. Figure 13D displays the angular position error between the detailed model ( Figure 10A) and the simplified model ( Figure 10B) in Simscape, indicating that the error range is within 10 −13 degrees for all hip, knee, and ankle joints. This error range demonstrates the reliability of the simplified model in Simscape, which will be used to design the Simulink model for the coupled human-SLE system. Figure 13E presents the discrepancy in angular positions between the detailed model in Simscape ( Figure 10A) and the Simulink model ( Figure 11), with the error margin being within 10 −11 degrees for all hip, knee, and ankle joints. This level of error validates the accuracy of the Simulink model, which will be employed for the development of the gravity compensator ( Figure 12) in the control system. Furthermore, Figure 13E serves to validate the accuracy of the information provided in Appendices A and B.
The discrepancy between the reference angular positions (generated by the gray box in Figure 11) and the controlled detailed model in Simscape (depicted in Figure 10A) is illustrated in Figure 13F. The error range reaches 10 −6 after three seconds for the angular positions of all joints, confirming the accuracy of the derived dynamic model and the controller's effectiveness. In Figure 11, the final output from the green box, labeled "Verification", serves to confirm the accuracy of the derived dynamic model for the coupled human-SLE system, presented in Figure 14. Figure Figure 15 depicts the control signals for the hip, knee, and ankle joints of the coupled human-SLE system. The key observation from this figure is that due to the presence of the gravity vector (G(q)), the control signal during the settling time is non-zero. This nonzero control signal is essential for counteracting the gravitational effects on each link of the system. Furthermore, it is important to note that these control signals are considered safe for use with the actuators in this assistive device.  Figure 15 depicts the control signals for the hip, knee, and ankle joints of the coupled human-SLE system. The key observation from this figure is that due to the presence of the gravity vector (G(q)), the control signal during the settling time is non-zero. This non-zero control signal is essential for counteracting the gravitational effects on each link of the system. Furthermore, it is important to note that these control signals are considered safe for use with the actuators in this assistive device.    Figure 16 presents a three-dimensional isometric visualization of the human-SLE system during a gait cycle, spanning from 6 s to 12 s. This gait cycle is divided into two key phases: the stance phase and the swing phase. The stance phase, occurring between 6 s and 9 s, demonstrates the period when the foot is in contact with the ground, providing support and stability. Conversely, the swing phase, which takes place from 9 s to 12 s, captures the time when the foot is in motion, swinging forward to prepare for the next step. This comprehensive representation offers valuable insights into the biomechanics of human gait and the role of the SLE system in facilitating effective locomotion. Additionally, a Supplementary Video S1 is provided alongside this paper, visually demonstrating the simulation of the human-SLE system while walking through two gait cycles over a duration of 12 s.   Figure 16 presents a three-dimensional isometric visualization of the human-SLE system during a gait cycle, spanning from 6 s to 12 s. This gait cycle is divided into two key phases: the stance phase and the swing phase. The stance phase, occurring between 6 s and 9 s, demonstrates the period when the foot is in contact with the ground, providing support and stability. Conversely, the swing phase, which takes place from 9 s to 12 s, captures the time when the foot is in motion, swinging forward to prepare for the next step. This comprehensive representation offers valuable insights into the biomechanics of human gait and the role of the SLE system in facilitating effective locomotion. Additionally, a Supplementary Video S1 is provided alongside this paper, visually demonstrating the simulation of the human-SLE system while walking through two gait cycles over a duration of 12 s.

Conclusions
This study designed and controlled a novel, size-adjustable exoskeleton tailored for children aged 8-12 with cerebral palsy (CP) across GMFCS levels I-IV. It analyzed a range of body measurements to accommodate the varied physical dimensions of this group. Brushless DC motors and harmonic drive gears were chosen for their efficiency, and an EtherCAT communication protocol was employed to enable high-frequency, responsive operation. The exoskeleton, managed by a high-performance embedded controller, is equipped with distinctive mechanical, sensory, and control features, offering personalized support considering the wide range of muscle tone and spasticity in children with CP. This study used the Denavit-Hartenberg matrix method and a geometric approach to examine the exoskeleton's kinematics. A dynamic model of the coupled humanexoskeleton system was created to design a PD impedance controller with gravity compensation. The system was designed in SolidWorks, then imported into Simscape in MATLAB, known as the "Detailed-Model". A "Simplified-Model" was also developed to provide similar trajectories, using a novel methodology introduced in this study, namely the "Simscape Multibody Simplification Method". The study modelled an independent coupled human-exoskeleton system in Simulink using the Euler-Lagrange formulation and a PD impedance controller with a gravity compensator, which was then applied to three models within the same environment. The minimal discrepancies between the models validated the dynamic model and confirmed the controller's effectiveness. The derived results show that the dynamic model was verified to follow the predefined gait patterns with high accuracy using a hardware-in-the-loop setup.
Supplementary Materials: The following supporting information can be downloaded at: www.mdpi.com/xxx/s1, Video S1:Simulation of Human-SLE System During Two Gait Cycles.

Conclusions
This study designed and controlled a novel, size-adjustable exoskeleton tailored for children aged 8-12 with cerebral palsy (CP) across GMFCS levels I-IV. It analyzed a range of body measurements to accommodate the varied physical dimensions of this group. Brushless DC motors and harmonic drive gears were chosen for their efficiency, and an EtherCAT communication protocol was employed to enable high-frequency, responsive operation. The exoskeleton, managed by a high-performance embedded controller, is equipped with distinctive mechanical, sensory, and control features, offering personalized support considering the wide range of muscle tone and spasticity in children with CP. This study used the Denavit-Hartenberg matrix method and a geometric approach to examine the exoskeleton's kinematics. A dynamic model of the coupled human-exoskeleton system was created to design a PD impedance controller with gravity compensation. The system was designed in SolidWorks, then imported into Simscape in MATLAB, known as the "Detailed-Model". A "Simplified-Model" was also developed to provide similar trajectories, using a novel methodology introduced in this study, namely the "Simscape Multibody Simplification Method". The study modelled an independent coupled human-exoskeleton system in Simulink using the Euler-Lagrange formulation and a PD impedance controller with a gravity compensator, which was then applied to three models within the same environment. The minimal discrepancies between the models validated the dynamic model and confirmed the controller's effectiveness. The derived results show that the dynamic model was verified to follow the predefined gait patterns with high accuracy using a hardware-in-the-loop setup. Informed Consent Statement: Informed consent was obtained from a subject involved in the study.