J Global Clinical Engineering Vol.6 Special Issue 6: 2024 62 Conference Paper Kinematic and Dynamic Analysis of Lower Limb Movement: Towards the Design of a Wearable Rehabilitation Assistant Device Filippos Margaritis1,*, Konstantinos Mitsopoulos1, Kostas Nizamis2, Alkinoos Athanasiou1 and Panagiotis D. Bamidis1 1 Medical Physics and Digital Innovation Laboratory, School of Medicine, Aristotle University of Thessaloniki, Greece. 2 Systems Engineering and Multidisciplinary Design, University of Twente, Netherlands. * Corresponding Author Email: filimarg@ece.auth.gr ABSTRACT This study outlines a comprehensive approach to the kinematic and dynamic analysis of lower limb movement, with the express purpose of designing an efficient wearable rehabilitation assistant device for the lower body. The approach begins by conducting a kinematic analysis of the lower limbs, presenting the degrees of freedom and each joint’s range of motion. A kinematic model is designed by deciding on a kinematic chain configuration and calculating the Denavit Hartenberg (DH) parameters. Next, dif- ferential kinematic analysis is employed to calculate the velocity of the limbs, generated by the corresponding muscle groups during different types of movements. This can provide significant insights into the design of a device that can accurately track and assist these movements. Furthermore, a dynamic analysis is performed to calculate joint moments and forces. This analysis provides insights into the forces that the joints experience during movement. When combined with electromyography (EMG) data, it allows for a more holistic description of muscle activity and a more accurate estimation of individual muscle forces and joint loads. The research also lays out a plan for the wearable device’s implementation. Based on OpenSenseRT1 an open-source software and hardware project, that utilized the OpenSim2 API, real-time inverse kinematics of a movement can be calculated using data from inertial measurement units (IMUs). This data is then used to compute the error in a person’s movement during lower limb rehabilitation exercises. This error, along with the error derived from real-time dynamic analysis and EMG data, can be integrated to improve the control accuracy of the wearable device. Keywords—Lower limb kinematic analysis, Lower limb dynamic analysis, OpenSim, OpenSenseRT system, IMU inverse kinematics, Real-time inverse kinematics, Real-time motion analysis, Wearable rehabilitation assistant device. Copyright © 2024. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY): Creative Commons - Attribution 4.0 International - CC BY 4.0. The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduc- tion is permitted which does not comply with these terms. http://www.globalce.org http://globalce.org http://globalce.org mailto:filimarg@ece.auth.gr https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/ 63 J Global Clinical Engineering Vol.6 Special Issue 6: 2024 INTRODUCTION The human body is a complex system, comprising of various interconnected parts that function in harmony to enable mobility. The lower limbs, particularly, play a crucial role in locomotion and maintaining balance. Understanding the movement of these limbs, especially in scenarios such as injury or disease, is vital to develop- ing effective rehabilitation strategies. This study delves into this subject, presenting a comprehensive approach to analyzing the kinematics and dynamics of lower limb movement and designing an implementation plan for the wearable device. KINEMATIC ANALYSIS To calculate the kinematic model of the lower body, first, the Degrees of Freedom (DoF) and the Range of Motion (RoM) of each joint were found. The selection of DoF for each joint was influenced by the project’s current focus on individuals with tetraplegia or paraplegia, thus excluding the need to maintain a standing balance. The lower limb can be modeled as a sequence of rigid links connected by one universal rotary joint representing the hip and two revolute joints representing the knee, and ankle joints. The DoF of a joint defines the number of independent movements it can make. In our model the hip has three DoF allowing flexion—extension, adduction—abduction, and the internal—external rotation of the joint, the knee has one DoF allowing flexion/extension motions, and the ankle also has one DoF allowing dorsiflexion and plantar flexion. For the sake of simplicity, without loss of general- ity, the hip joint is equivalently modeled as three closely placed revolute joints instead of a spherical joint.3 AThe Range of Motion (RoM) of a joint, on the other hand, refers to the total amount of movement that can occur at a joint in each of its possible planes of move- ment. From Range of Joint Motion Evaluation Chart4 and Kinesiology: Scientific Basis of Human Motion (B&B PHYSICAL EDUCATION)5, the RoM of the lower limb joints is shown in Table 1. The kinematic analysis is performed using the Rigid Body Segment Model Approach, assuming that the bones are completely rigid while they may have some flexibility. Each body segment is linked to the next by a joint, allowing specific degrees of freedom. This forms a chain of rigid bodies, also known as a kinematic chain. The kinematic chain consists of local reference frames for each joint’s motion, which helps us identify the posi- tion and orientation of each body segment. In Figure 1, these local frames are then expressed relative to a fixed global reference frame, Frame {0}, located at the pelvis’s center between the hip joints. Our model incorporates seven frames, labeled {0} to {6}. Frame {0} serves as a stable global reference positioned at the pelvis center. Frames {1}, {2}, and {3} are associated with the hip joint’s three movements. Frame {4} corresponds to the knee joint’s flexion and extension, while Frame {5} is linked to dorsiflexion and plantar flexion. Frame {6}, finally, is the end-effector frame, marking the kinematic chain’s terminal point. TABLE 1. Range of Motion (RoM) of lower limb joints. Joint Movement Degree Hip Flexion/Extension 100°/30° Hip Abduction/Addaction 40°/20° Hip Internal/External Rotation 40°/50° Knee Flexion/Extension 150°/0° Ankle Dorsiflexion/Plantar Flexion 20°/40° FIGURE 1. Representation of the lower limb’s kinematic chain: Featuring the frames of joint movements, θ angle variables, and the coordinate systems for each frame, in accordance with the Denavit-Hartenberg convention. http://www.globalce.org http://globalce.org http://globalce.org J Global Clinical Engineering Vol.6 Special Issue 6: 2024 64 The design of the kinematic chain necessitates the definition of the rotation axes for each frame and the direction of motion for each segment, while also taking into consideration any anatomical constraints or joint limitations that affect the range of motion at each joint. This procedure is guided by the principles of the Denavit Hartenberg (DH) convention, which provides a system- atic method for representing the kinematic equations of a manipulator. This convention is particularly useful in the context of serial manipulators, where a matrix is used to represent the pose (position and orientation) of one body relative to another. Applying the DH parameters to Figure 1, we can produce the Table 2: Variable angles φ change based on the position of the lower limbs and are constrained by the range of motion at each joint. In particular, the angle φ1 is within the interval [−50°, 40°], φ2 in [−20°, 40°], φ3 in [−30°, 100°], φ4 in [0°, 150°] and φ5 in [−40°, 20°]. The DH parameters are used to find the homoge- neous transformation matrix and solve the forward and inverse kinematics problems. Transformation matrices and coordinate systems are utilized to find any position and orientation for any frame relative to the base frame. In particular, the homogeneous transformation matrices allow us to combine 3 × 3 rotation matrices and 3 × 1 displacement vectors into a single 4 × 4 matrix, adding an additional row: [0 0 0 1]. The general form of the Transfor- mation Matrix (T), according to Introduction to robotics: mechanics and control6, that defines frame {i} relative to the frame {i−1}, in accord with the DH convention, is: By chaining together the transformation matrices of each joint starting from the base of the robot, we can ob- tain the overall transformation matrix of the lower limb. This matrix can then be used to calculate the position and orientation of the end-effector for a given set of joint angles (forward kinematics) or to determine the joint angles required to achieve a desired end-effector position and orientation (inverse kinematics). From the transformation matrix calculated previously, we obtain: where R is the rotation matrix and P is the position vec- tor of frame 5 with respect to the reference base frame 0.7 The position vector P provides the position of the desired frame, and the rotation matrix R provides the orientation, those two are the solutions to the forward kinematics problem. On the other hand, solving the inverse kinematics prob- lem involves determining the joint angles. A frequently used method for this involves multiplying each side of the transformation equation (2) by the corresponding inverse transformation matrix, depending on the frame’s angle we are aiming to solve for.8 However, the solution to the inverse kinematics problem is not pertinent to this study, and we will not delve into it further. DIFFERENTIAL KINEMATIC ANALYSIS Differential kinematics focuses on the relationship between the joint velocities and the corresponding end- effector’s linear and angular velocity. It provides a way to TABLE 2. Denavit Hartenberg (DH) parameters of the lower limb model. Joint i αi-1 ai-1 di θi Pelvis 0 - - d0 0° (x1‖x2) Hip 1 α0 0 0 φ1 + 90° Hip 2 −90° 0 0 φ2 + 90° Hip 3 +90° 0 0 φ3 + 90° Knee 4 0° (z3‖z4) l1 0 φ4 Ankle 5 0° (z4‖z5) l2 0 φ5 End-effector 6 0° (z5‖z6) l3 - - http://www.globalce.org http://globalce.org http://globalce.org 65 J Global Clinical Engineering Vol.6 Special Issue 6: 2024 analyze how changes in joint velocities affect the motion of the end-effector. To facilitate this analysis, we introduce a matrix quantity known as the Jacobian, which maps velocities in joint space to velocities in Cartesian space. There are two types of Jacobian matrices: Geometric and Analytical. The Geometric Jacobian is based on the pose matrix of the lower body end-effector. On the other hand, the Analytical Jacobian is based on a minimal parametrized form for representing the position and the orientation of the end-effector frame. In our case, Geometric Jacobian is more suitable since the pose matrix is available, rather than the minimal representation form that would be required for an analytical approach. As such, when we refer to the Jacobian, we will be referring specifically to the Geometric Jacobian.7,9 The rotation matrix, denoted as R, and the position vec- tor, P, are dependent solely on the variables of the joints. In our specific scenario, where the joints are revolute, these variables correspond to the angles θ of the model and are represented as q, where qi = θi. The relationship between these joint variables, the Jacobian matrix, and the velocity of the end-effector, can be expressed as fol- lows7 (on page 107): where q and are given by: The matrix is a 6 × 5 matrix where 5 is the number of links. The angular velocity of the end-effector can be ex- pressed relative to the rotation matrix R as follows: Through the computations described7 (on page 108 and 111) it is retrieved that the angular velocities’ Jaco- bian Jω is being expressed, for every i−th revolute joint, as follows: The total lower half of the Jacobian is thus given as: On the other hand, the linear velocity of the end-effector is just the derivative of the position vector and by the chain rule for differentiation: Again, following the computation described7 (on page 110) is retrieved that the linear velocities’ Jacobian Ju is being expressed, for every i−th revolute joint, as it follows: The total upper half of the Jacobian is thus given as: Combining the upper and lower halves of the Jacobian, we can deduce that the Jacobian of the lower limb model is of the form: where the i-th column is given by: The above procedure works not only for computing the velocity of the end-effector but also for computing the velocity of any frame on the model. DYNAMIC ANALYSIS While the kinematic equations outline the motion of the robot without considering the forces and moments causing the motion, the dynamic equations explicitly describe the relationship between force and motion. The dynamic equations of motion can be calculated using Newtonian, Lagrangian, or Hamiltonian mechanics. In our case, the Lagrangian approach was selected mainly because is based on the system’s kinetic and dynamic energy, rather than forces. This can simplify the analysis of complex systems and avoid the need for complex force equations. Assuring that the constraint forces satisfy http://www.globalce.org http://globalce.org http://globalce.org J Global Clinical Engineering Vol.6 Special Issue 6: 2024 66 the principle of virtual work we can introduce the Euler Lagrange equations of motion: where L = K − P is the Lagrangian function, K is the kinetic energy, P is the dynamic energy, and forces τ represent the generalized forces’ function. As shown in Robot modeling and control7 (on page 205), the kinetic energy of the manipulator can be computed using the calculated Jacobian matrices. The form of it equals: Similarly, can be expressed as: where D(q) is a symmetric positive definite matrix that is called an inertia matrix. Assuming that the mass of every link is concentrated at its center, the potential energy of the i−th link of the lower body can be computed as follows: where the vector g represents the direction of gravity in the inertial frame and the vector rci denotes the coor- dinates of the center of mass of the i-th link. The total potential energy of our model is given by the sum: Having the kinetic energy in the quadratic form of the vector q̇ and assuming that the potential energy of every link of the model is independent of q̇ the Euler-Lagrange equations of motion can be specialized as: where k = 1, ... ,5. IMPLEMENTATION PLAN The goal of the wearable device is to aid in rehabilita- tion exercises by utilizing electrostimulations. To control the electrostimulator (EMS), it is necessary to compute the error of the person's motion. This is achieved through the analysis of joints’ angle errors provided by kinematic analysis and the forces and torque errors computed by dynamic analysis. Additionally to these errors, EMG data can be utilized by analyzing them using the CEINMS software.10 The real-time kinematic analysis will be implemented based on OpenSenseRT (as shown in Fig- ure 2), an open-source software and hardware project that utilizes the IMU inverse kinematics algorithm from OpenSim. ACKNOWLEDGEMENTS This research project was supported by the Hellenic Foundation for Research and Innovation (H.F.R.I.) https:// www.elidek.gr under the “2nd Call for H.F.R.I. Research Projects to support Faculty Members & Researchers” (Project Number: 4391). REFERENCES 1. Slade, P., Ayman, H., Jennifer, L.H., et al. An open- source and wearable system for measuring 3D hu- man motion in real-time. IEEE Trans Biomed Eng. 2022;69(2):678–688. https://doi.org/10.1109/ TBME.2021.3103201. FIGURE 2. Block diagram of the project’s implementation. http://www.globalce.org http://globalce.org http://globalce.org https://www.elidek.gr https://www.elidek.gr https://doi.org/10.1109/TBME.2021.3103201 https://doi.org/10.1109/TBME.2021.3103201 67 J Global Clinical Engineering Vol.6 Special Issue 6: 2024 2. Seth, A., Hicks, J.L., Uchida, T.K., et al. OpenSim: Simu- lating musculoskeletal dynamics and neuromuscular control to study human and animal movement. PLoS Comput Biol. 2018;14(7):e1006223. https://doi. org/10.1371/journal.pcbi.1006223. 3. Ziegler, J., Reiter, A., Gattringer, H., et al. Simultaneous identification of human body model parameters and gait trajectory from 3D motion capture data. Med Eng Phys. 2020;84:193–202. https://doi.org/10.1016/j. medengphy.2020.08.009. 4. Range of Joint Motion Evaluation Chart. Washington State Department of Social and Health Services (2014). Available online: https://www.dshs.wa.gov/sites/ default/files/forms/pdf/13-585a.pdf. 5. Hamilton, N., Weimar, W., Luttgens, K. Kinesiology: Sci- entific Basis of Human Motion (B&B PHYSICAL EDUCA- TION), McGraw-Hill Education: New York, USA; 2011. 6. Craig, J.J. Introduction to robotics: mechanics and control. Addison-Wesley Publishing Company; 2005; pp. 303. 7. Spong, M.W., Hutchinson, S., Vidyasagar, M. Robot mod- eling and control, 2nd ed. John Wiley & Sons: Hoboken, NJ, USA; 2020; pp. 107–205. 8. Baluch, T.H., Masood, A., Iqbal, J., et al. Kinematic And Dynamic Analysis Of A Lower Limb Exoskeleton. IJMME. 2012;6(9):1945–1949. https://doi.org/10.5281/ zenodo.1072880. 9. Siciliano, B., Sciavicco, L., Villani, L., et al. Robotics: modelling, planning and control. Springer Science & Business Media: Berlin, Germany; 2010. 10. Pizzolato, C., Lloyd, D.G., Sartori, M., et al. CEINMS: A toolbox to investigate the influence of different neural control solutions on the prediction of muscle excitation and joint moments during dynamic motor tasks. J Biomech. 2015;48(14):3929–3936. https:// doi.org/10.1016/j.jbiomech.2015.09.021. http://www.globalce.org http://globalce.org http://globalce.org https://doi.org/10.1371/journal.pcbi.1006223 https://doi.org/10.1371/journal.pcbi.1006223 https://doi.org/10.1016/j.medengphy.2020.08.009 https://doi.org/10.1016/j.medengphy.2020.08.009 https://www.dshs.wa.gov/sites/default/files/forms/pdf/13-585a.pdf https://www.dshs.wa.gov/sites/default/files/forms/pdf/13-585a.pdf https://doi.org/10.5281/zenodo.1072880 https://doi.org/10.5281/zenodo.1072880 https://doi.org/10.1016/j.jbiomech.2015.09.021 https://doi.org/10.1016/j.jbiomech.2015.09.021 Editor’s Corner Biomedical Technology and Clinical Engineering in Greece after the Pandemic: Highlighted Works from the Panhellenic Conference of Biomedical Technology Aris Dermitzakis1,2,*, Vasiliki Zilidou1,3, Eleftheria Vellidou1,4, Alkinoos Athanasiou1,3 Digital Transformation Management in Health Services: Health Professionals Perceptions as an Implementation Factor Theodoros S. Tanis*, Chryssoula Chatzigeorgiou, Ioanna Simeli, and Evangelia Stalika Validating the ID-GAMING e-Training Toolkit for People with Intellectual Disabilities in Greece Niki Pandria*, Anastasia Barboudi, Vasileia Petronikolou, Panagiotis Antoniou and Panagiotis D. Bamidis Novel Functional Electrical Stimulation Parameter Optimization for Neurorehabilitation Using Both Conventional and AI Techniques Arsenios Arsenidis1, Alexandros Moraitopoulos2, Alkinoos Athanasiou2, Alexandros Vildiridis3, Panagiotis Bamidis2, Petros Stefaneas4 and Alexandros Astaras5 Leveraging Web Scraping and API Integration for Efficient Medical Device Data Management Agapi Konstantina Liontou1,*, Spilios Zisimopoulos2 and Aris Dermitzakis1 Human Muscle State Machine Using Electromyography Classification with Machine Learning George Lyssas1,*, Konstantinos Mitsopoulos1, Dimitris Zantzas2, Anestis Kalfas2, Panagiotis D. Bamidis1 Kinematic and Dynamic Analysis of Lower Limb Movement: Towards the Design of a Wearable Rehabilitation Assistant Device Filippos Margaritis1,*, Konstantinos Mitsopoulos1, Kostas Nizamis2, Alkinoos Athanasiou1 and Panagiotis D. Bamidis1 A Novel Dermatological Diagnosis Support Device Based on Electrical Impedance Spectroscopy Alexandros Moraitopoulos1,*, Konstantinos Mitsopoulos1, Christina Kemanetzi2, Panagiotis Bamidis1 and Alexandros Astaras3 Software Skills Identification: A Multi-Class Classification on Source Code Using Machine Learning Dimitris Bamidis, Ilias Kalouptsoglou, Apostolos Ampatzoglou, Alexandros Chatzigeorgiou* Improvement of Aortic Valve Stenosis Classification in Patients Through Computational Fluid Dynamics Model Ioannis Makropoulos, Dimitris Zantzas, Vasilis Gkoutzamanis, Anestis Kalfas* Kinematic and Dynamic Analysis of the Human Hand’s Articulation for Wearable Soft-Robotic Device Applications Paschalina-Danai Sarra, Vasiliki Fiska, Konstantinos Mitsopoulos, Diamanto Mylopoulou, and Panagiotis D. Bamidis* Deep Learning Classification of Epileptic Magnetoencephalogram Andreas Stylianou1, Lefteris Koumakis2, Maria Hadjinicolaou3, Adam Adamopoulos1,* and Alkinoos Athanasiou4