Analysis of Human Gait Cycle With Body Equilibrium Based on Leg Orientation

Gait analysis identifies the posture during movement in order to provide the correct actions for a normal gait. A person’s gait may differ from others and can be recognized by specific patterns. Healthy individuals exhibit normal gait patterns, while lower limb amputees exhibit abnormal gait patterns. To better understand the pitfalls of gait, it is imperative to develop systems capable of capturing the gait patterns of healthy individuals. In this research, spatio-temporal parameters were computed using the concepts of static and dynamic equilibrium to analyze the gait cycle. A relationship was also developed among static equilibrium, dynamic equilibrium, speed, and body states. A sensing unit was installed on the designed metal-based leg mounting assembly on the lateral side of the leg. An algorithm was proposed based on two variables: the position of the leg in space and the angle of the knee joint measured by using an inertial measurement unit (IMU) sensor and a rotary encoder. It was acceptable to satisfy the static conditions when the body was in a fixed orientation, whether lying down or standing. While walking and running, the orientation was determined by the position and knee angle variables, which fulfill the dynamic condition. High speed reveals a rapid change in orientation, while slow speed reveals a slow change in orientation. The proposed encoder-based feedback system successfully determined the flexion at 47°, extension at 153°, and all seven gait cycle phases were recognized within this range of motion. Computed spatio-temporal parameters may help individuals avoid slipping or falling.


I. INTRODUCTION
Clinicians and researchers have always been required to analyze gait for rehabilitation purposes and it compensates for the lost mobility of amputees wearing prostheses. The use of sensing devices is common for monitoring and analyzing gait. There are significant benefits of both wearable and non-wearable sensing devices. Wearable sensing devices are The associate editor coordinating the review of this manuscript and approving it for publication was Mauro Fadda .
attached to human limbs and may better observe the behavior of the limbs during movements.
In the past, gait analysis was performed with expensive equipment, but now wearable sensors facilitate clinicians and researchers in analyzing the gait with more reliable results. Both IMUs (inertial measurement unit) and rule-based methods are the optimal choices for gait analysis [1]. It seems a convenient way of gait analysis to epitomize the gait constraints like gait parameters, environment, and the walking persons. The specific walking pattern of a person differentiates from the others and they can easily be recognized by VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ their gait. The walking pattern defines human movement in the environment [2]. An environment and surroundings are the 3D spaces in which a body can move. The human gait cycle is the interval between two heel strikes on the same leg. The stance and swing phases are two major sub-phases of the gait cycle. The stance phase occurs when the foot is in contact with the ground while the swing phase is when the foot is in the air. According to a new study, about ''60%'' of the gait cycle consists of the stance phase, and ''40%'' of the gait cycle comprises the swing phase [3], [4], [5]. For a thorough understanding of the gait cycle, the secondary phases of gait are grouped into ''7'' sub-phases including initial contact or heel strike, foot flat, toe-off, pre-swing, initial swing, mid swing, and terminal swing as shown in Figure 1.
It is important to mention that despite the availability of various parameters, the outcome of the research relies mainly on the selection of appropriate gait parameters. In this way, better algorithms and techniques can be chosen for the classification of gait phases [6], [7]. The spatial-temporal measures of gait may be affected by small variations in a person's weight, height, and age, resulting in deviations from an ideal gait cycle [8].
Zhang et al. presented a straight-forward linear model to connect the stride length and typical angular swing speed. An effective method for estimating the parameters was also offered to calibrate the model for various themes [9]. Sizhe et al. offered a useful step-length estimation method that makes use of bend and inertial wearable sensors. An essential step in the diagnosis and treatment of various diseases is gait analysis.
Step length and stride lengths, in particular, offer important information regarding gait quality and rehabilitation [10]. In order to keep a balanced movement avoiding falls, spatio-temporal parameters like step width, step length, stride length, walking speed, cadence, etc. are essential [11]. Figure 2 explains the temporal measures with the following variables; • Gait cycle time (sec): Time between the two successive heel strikes of the same foot.
• Stance phase (%): Phase in which a foot is in contact with the ground within a single gait cycle.
• Stance time (sec): Amount of time between the heel strike and the successive toe-off of the same foot.
• Swing phase (%): Swing phase, during which the foot does not touch the ground.
• Swing time (s): The time between the toe-off and the heel strike of the same foot.
• Stride length (m): Distance between the two successive heel strikes of the same foot.
• Step length (m): Step length is the distance between the point of initial contact of one foot and the point of initial contact of the opposite foot.
• Stride width (m): The distance between the heels of the two feet during double stance.  Figure 1 presents the overall gait cycle consisting of stance and swing phases which are divided further into ''7'' different sub-phases [13]. Figure 2 shows, that spatio-temporal parameters of functional gait performance include step length, step width, stride length, and direction of propagation [8].

FIGURE 2. This
• Stride velocity (m/s): Defined as the ratio between stride length and gait cycle time [12]. As a result of a limb loss, an amputee is unable to perform normal activities without assistance. Amputation is one of the disabilities that may happen at any stage of life. In order to compensate for the lost part, a special device is needed. A prosthesis is a special artificial limb that helps amputees to overcome the functionalities of the lost limb and also facilitates them to minimize the dependency [14], [15].
A great effort is put into prosthetic research around the world to assist amputees with lower limb loss. Due to evolution and advancement in technologies, there have been a number of artificial limbs developed that include active, semiactive, and passive types. However, it still requires more designs to meet the routine needs of prosthetic users despite the advancements [16], [17]. For lower limb amputees who wear a prosthesis, Esmaili et al. created a wearable gait monitoring system with FSR and IMU sensors that are directly connected to the customized algorithm. They evaluated the stance and swing phases of the gait cycle, as well as the stride length [18]. Gait analysis with a focus on the lower limbs explores a variety of new ideas about how to observe the movement of an individual.
This work presents a novel way to analyze the gait cycle by computing spatio-temporal parameters using static and dynamic equilibrium conditions as shown in Figure 3. It comprises a sensing unit installed on a metal-designed assembly to be mounted on the leg of a healthy individual. The average trained parameter values enable individuals to avoid slips or falls while also preventing further injuries. This also results in the emergence of relationships between static and dynamic behaviors based on the speed of the body. As a result, this research work may assist researchers, engineers, and practitioners to improve the gait pattern of lower limb prosthetic wearers in order to enhance their quality of life.
The rest of this paper is structured as follows. Literature review has been presented in section II, methodology in section III, & results and discussions in section IV. Section V describes the conclusion and future work.

II. LITERATURE REVIEW
This section presents the literature studied for the research presented. Background work, importance, and state-of-theart are described in detail. Overall, this presents the gait analysis systems using wearable sensors.
Qiu et al. presented a comprehensive review of wearable sensors, devices, and their applications. The concept of multi-sensor fusion for human activity recognition has been presented. Imbalanced data, complex activities, computation cost, and were the challenges identified [19]. With sensor and data fusion, Celik et al. developed a multi-layer framework for gait analysis. Experimental evaluation of multimodal fusion strategies in both a lab and free-living setting is necessary before feature extraction. The IMU and EMG sensors were utilized for stroke survivors' rehabilitation to identify their gait characteristics, including step length and initial contact [20]. According to Santos et al. individual variables and traces are more relevant for improving the subject's gait recognition performance. The authors investigated the impact of each sensor's characteristics on each subject's performance measure using datasets from multi-sensors [21].
In any unrestricted setting, it is possible to track the 3D trajectory of the legs. Ahmadi et al. presented a revolutionary, low-cost, computationally efficient way to precisely analyze human gait. They used it to quantify the correlation between computed and measured motions for all joints in the sagittal plane [22].
Hessfeld et al. explored examples of the wearable sensor system and type of threshold that are more dependable in a postural shift scenario. Comparison of three sensing systems: pressure insoles system (IS), multiple inertial measurement unit systems (IMU), and a combination of both systems to provide reliable timing for potential biofeedback applied by a wearable device in daily activities [23]. Saboor et al. discussed the two slashing technologies that are essential to contemporary gait analysis. The first was the use of wearable sensors, which offer a practical, effective, and affordable method of gathering data for gait analysis. The second was the use of machine learning techniques, which enable high precision extraction of features for gait analysis [5].
Overuse injuries connected to running can be caused by a variety of intrinsic (like gait biomechanics) and extrinsic (like running surface) risk factors. It is unknown, nevertheless, how variations in the weather have an impact on the biomechanical patterns of running stride. Ahamed et al. concluded that the connection between gait biomechanics and external meteorological conditions is subject-specific, complex, and involves special interactions between intrinsic and extrinsic components [24].
Clinical professionals use gait analysis to provide patients with impaired gaits with optimal care and treatment. Gait analysis is one of the standard components of kinesiology assessments covering movement-related issues of posture and gait. Gait analysis is also used in the treatment of musculoskeletal disorders like polio, muscular destruction, amputation, osteoarthritis, & trauma and neurological disorders like cerebral palsy, stroke, & brain trauma [25]. Lower limb amputees demand wearable devices with more wearing time to enhance their quality of life. The features of costeffective, bio-compatible, cosmic, and durable are still great challenges for the research community [26].
Luksys et al. distinguished gait phases for both normal persons and patients with Parkinson's diseases using IMUs. Their idea was to use the continuous relative phase to measure the coordination between two joints. The raw angular velocity signal was filtered using a low-pass Butterworth filter with a cut-off frequency of 5 Hz [27]. Clinical gait analysis and rehabilitation use two measures to corroborate clinical decisions about treatment, namely the level of improvement in gait and the quantification of body motion. Young people with abnormal gait are receiving increasing attention for gait evaluation and improvement [28]. Gait analysis has required complex systems, such as three-dimensional motion captures and force plates. Using several infrared cameras in a limited space, 3D motion analyzers record body motion in real-time by reading the location coordinate values of sensors attached to the body.
Jung et al. rely on marker-based optical motion capture (MoCap) systems to achieve high accuracy in bio-mechanical gait research. During MoCap-based gait analysis, markers were attached to the lower limbs of subjects, and their trajectories are used to analyze their gait on a treadmill. It was possible to walk continuously on a treadmill, but the MoCap data repeated in a limited space during treadmill walking overlap. As a result, most treadmill-based gait data were analyzed using gait cycle percentages [29].
Han et al. introduced a technique known as the 2-point error estimation algorithm to estimate the pitch, roll, and yaw angles using the accelerometer and gyroscope alone [30]. As sensor technology has advanced, wearable and soft sensors can now be used to perform cost-effective and easy analysis [25]. Spatio-temporal and kinematic variables can be further calculated in gait analysis [31], [32]. The inertial sensors comprise a gyroscope, an accelerometer, and a magnetometer, which enable economical measurements of gravitational force and acceleration. Changes in the Euler angle, yaw, pitch, and angle of the rolling axis can also be measured using the gyroscope. Inertial sensors (IMUs) are being used extensively for gait analysis to detect the gait phases and measure joint angles as well as the stride lengths [33], [34]. Cicirelli et al. presented a review on the gait analysis using IMU sensors due to their low cost and small size. Gyroscopes are used to measure the position of that body in the x, y, and z axes. Three-axis magnetometers measure the earth's magnetic field strength and its direction [35]. Amitrano et al. validated the reliability of the wearable system called SWEET (Smart WEarable E-Textile) for gait analysis. The wearable sensing unit was equipped with a pressure sensing sock, a gyroscope, a microcontroller, and a LiPo battery [36].
Ngamsuriyaroj et al. presented the work to analyze the walking activities of a disabled person. Wearable FSRs, an IMU, and an angular encoder were used to control the assembly of the prosthesis [37]. Gregorio et al. presented their work for the identification of the gait phases for different walking conditions with a load sensor for an active/semi-active prosthesis. Despite advances in prosthetic design, replacing lower-limb segments with a prosthesis affects the efficiency of locomotion. Lower-limb prostheses are designed to minimize the impact of amputation and make the patient more autonomous [3]. Gait phase recognition was presented in [38] using support vector machines with different covariate factors. There are also various gait covariates that can be used to estimate the age of a human, which is valuable for health-related purposes, security, and law enforcement [39]. It is also useful to translate multi-age groups while walking in order to identify and categorize age groups [40].
XEI et al. reviewed the methods of gait tracker using inertial sensors in 3D space [41], while Mobbs et al. preferred a single-point inertial sensor for gait metrics analysis in space [42]. Liu et al. examined the use of wearable devices in motion tracking and gait analysis, as well as its potential to enhance healthcare practices through intelligent data analysis. Smartphones, wearable sensors (IMUs), and sensing fabrics were discussed as wearable devices and their research progress in motion tracking. Wearable devices monitor basic health data, allowing physicians to detect health problems early and provide appropriate treatment and rehabilitation to patients [43].
Hong et al. in [44] estimated and evaluated the human gait phases for normal and amputated persons. It contributed to reducing gait detection errors during the heel-strike phase.
Step 1 shows that the thigh angle profile was a phase-shifted cosine-like function. In step 2 it was like a phase-shifted sinelike function and phase-shifting increased the linearity of the phase variable in step 3. And finally, step 4 showed the phaseshifting implementation, the heel-strike detection error was also reduced.
A pedestrian dead reckoning (PDR) navigation system that uses an inertial measurement unit (IMU) attached to its waist belt instead of GNSS signals or beacons was demonstrated by Hajati et al. In order to calculate the appropriate gains, the system first recognizes the walking pattern of the user. An unscented Kalman filter was then used to estimate the userś attitude. A step detection method was then used to determine the userś three-dimensional position [45]. Ranusa et al. described a better understanding of the dynamic friction evolution in total knee replacement. Their study examined the relationship between the coefficient of friction (CoF) during a gait cycle and its association with kinematics (slide-roll ratio), applied load, and relative velocity. As a result of this study, the coefficient of friction fluctuates with the change in load [13]. Joint coordination was found to be the best method to analyze the movement of the body in space. In gait analysis, many researchers preferred goniometers, potentiometers, and encoders over sensors like (IMUs, soft sensors, etc.) for the coordination of joints. Tao et al. presented the use of a flexible electro-goniometer to detect the gait cycle capable to measure knee movement in multiple planes. It was also capable to measure movements and postures of the body being advantageous at noise-free signals when direct interfaced on clothes and fabrics [46]. Papi et al. demonstrated a correlation between sensor signal and benchmark knee flexion angles. The ability of a novel wearable sensor system to determine peak knee sagittal angles during locomotion was validated using this relationship. This makes it possible to convert sensor voltage outputs to angular measurements [47]. Buttner et al. presented work on both goniometer and potentiometer being the low-cost method to determine the joint angles of the lower limb. They attached the potentiometer assembly to the lateral side of the leg. It performed continuous joint tracking of activities (stair walking, ground walking, and jogging) based on the relative motion of joints. For a bio-mechanical analysis of the knee joint, the potentiometer was implemented on the lateral side of the leg with a sensing assembly and records continuous readings of the angle between the knee joint [48].
There are some disadvantages of the potentiometer assembly during gait analysis. Occasionally, rust in the strips of potentiometers prevents them from detecting small knee angles during locomotion. Besides using IMUs, the encoders are capable to measure small angle variations of knee joints during flexion and extension precisely. According to the literature review, the stuff is less available for spatio-temporal parameters. It is required to address the risk of slipping or falling in gait analysis systems by computing spatio-temporal parameters during static and dynamic conditions of equilibrium. It may facilitate both healthy, and amputees (while wearing the prosthesis in the training phase) protecting them from slipping or falling.

III. MATERIALS AND METHODS
In this section, a comprehensive description of the proposed materials and methods is presented, along with a description of the custom-algorithm that will be used for this work. Detailed information about the sensors and their installation is provided in this section. Listed below are the different subsections of this section.

A. EXPERIMENTAL SETUP
The experimental setup consists of sensors, sensor mounting assemblies, and a controller board. As part of this research, these sensors were interfaced with an Arduino microcontroller, which was used to record and present the results. Here we categorized the experimental setup into three main units enlisted: • Sensing unit • Processing unit/Microcontroller unit • Classified output gait phases  Figure 4 shows the IMU sensor and the rotary encoder installed on the sensing unit in the experimental setup. Arduino UNO processes the input signals to classify the gait phases.
As seen in Figure 4, the primary components of the experimental setup are explained as well as how the input and output are related. This experimental assembly is designed in such a way that the sensing unit can serve as an input transducer to acquire the data.
As a result, the ''controlling unit'' calculates output based on sensor output value by controlling the output electrical signals. In Arduino UNO, signal processing is performed based on the sensor's output. An output signal can be displayed as a graph on a serial plotter, evaluated as numeric data, and a spreadsheet can be generated as a CSV or excel spreadsheet.

B. DESCRIPTION OF SENSORS
Sensors based on inertial measurement units are known for their efficiency and accuracy in capturing complex movements. The lightweight and small size of this sensor make it an excellent choice for motion tracking. The sensing unit consists of two main sensors, an IMU (L3G4200D) and a rotary encoder (KY-040). The IMU is generally equipped with an accelerometer, magnetometer, and gyroscope to measure angular velocity, acceleration, and position of any object based on the specified parameters. This IMU model computes the parameters x, y, & z axes to determine the position of the body in the space.
We are tracking the lower limb in 3D space and evaluating its different phases. We found more suitable for our work the GY-50 IMU model (L3G4200D) more to achieve reliable results. The specifications of our IMU sensors are as follows: operating voltage source is (2.4 → 3.6)V with sensitivity band variations FS → (250 dps, 500 dps, 2000 dps) and temperature range is (−40 ∼ +85) • C.
As the knee joint angle varies during gait, the rotary encoder can be used to determine the knee angle. The relative movement of both thigh and shank gives an angle θ that defines the flexion and extension of the moving leg. Figure 5 shows how the knee angle changes due to the relative movement between the thigh and the shank. In one rotation of the encoder, there are ''40'' pulses displayed as a sampling frequency. Following are the specifications of the rotary VOLUME 10, 2022 FIGURE 5. Metal-designed leg mounting assembly with a sensing unit placed on the lateral side of the leg is used in an experimental setup. The anatomy of the femur, tibia, and fibula bones of the leg has been shown in Figure 5. In the hip, knee, and ankle joints, the knee joint requires special consideration to compute extension and flexion. encoder; (30 × 18 × 30) mm encoder module being operated on a 5V. When we interfaced the encoder to an Arduino board, a 2-bit gray code output was observed.

C. INSTALLATION OF SENSORS
In the data acquisition phase, sensor placement is one of the most important and challenging tasks. It is a fact that the feasible placement of the sensors provides precise results to be evaluated during experiments. In this work, we have installed the IMU sensor and rotary encoder as a sensing unit as shown in Figure 6. After installation, these sensors were interfaced with the Arduino on the designed metallic assembly mounted on the leg. Considering IMU's small size and lightweight characteristics, it is easy to place and mount. The placement of IMU on a shank is the best option for the tracking of the lower limb in 3D space. Therefore, we attached an IMU sensor on the lateral side of the shank that gives good results for flexion and extension of the knee. While the placement of the rotary encoder is a tedious job because the encoder may not be directly attached to any object without a supporting assembly. During rotation, the assembly holds the encoder body, while the knob (shaft) is attached to the knee angle. The encoder assembly can be placed on the lower limb at two optimum locations.
The encoder assembly can be attached to the lateral side of the knee joint, which is most suitable for users when evaluating the results. Therefore, we attached the encoder with this assembly on the lateral side of the body. This assembly also facilitates the user to be useful when in the squatting position.

D. WORKING OF THE CUSTOM-ALGORITHM
The proposed algorithm of this work is described in this section. First, we defined the starting and ending nodes as x 1 and x 2 for our work to relate the main objectives followed FIGURE 6. Labeling of the entire experimental setup from the front and lateral sides of a human leg can be seen in Figure 6. In addition to the IMU attached to the shank, a rotary encoder is mounted on the lateral side of the knee, supported by a bush assembly.
by the outcomes. At the starting point, a person is performing activities like walking, sitting, standing, lying down, and running in their environment. Then it evaluates the body's speed, its state, and the equilibrium conditions. In Figure 7, the algorithm based on the given parameters is presented to evaluate the gait and its phases. The IMU sensor evaluates the first parameter for the complete tracking of the lower limb in 3D space. The second parameter describes the knee joint angle to define the relative motion of the thigh and shank which also serves as feedback in 3D tracking. In a real-time environment, speed describes the actual state/activity that a person performs.
The following possible outcomes are evaluated on the basis of above described parameters, and the body will be in; • Static condition: When there is no change in relative position and angle of the knee joint.
• Dynamic condition: When the change of knee joint angle and 3D movement is observed followed by some distance travelled by the individual.
• Leg movement while sitting on chair: When a change of knee joint angle and position are observed while sitting on a chair.  gait analysis have been discussed in Table 1. If the step length, step width, and stride length deviate from the threshold value, the accuracy decreases. Furthermore, prompt transitions may disrupt sensor responses, thereby affecting recognition accuracy. In addition to low power consumption so that batteries can last longer, environmental conditions such as weather, terrain, and carrying conditions may also limit the accuracy of gait analysis.

E. COMPUTATION OF THE KEY PARAMETERS
Computing the necessary parameters is a key step in the method proposed to build a relationship. The following mathematical relations help to support this work when considering the variables discussed in the working of the algorithm. According to the statistical analysis of the body performing linear path motion, the displacement ''d'' change in position is the difference of final position and the initial position of that body as shown in equation 1 & speed is shown in equation 2. And; On the other hand, angle of knee joint varies with the change in the leg movement as shown in equation 3. Similarly; And; θ can be calculated by given equation.  activity and state of the body by relating both positions and the knee joint angle of the leg. By using these spatio-temporal parameters and the relationships, it is now possible to predict the speed and body state of people walking or running at different speeds. Table 2 describes the detail of the key-value pair of all the major terms used. It summarizes the outcomes computed after experimentation and discussion in the different cases.

IV. RESULTS AND DISCUSSION
As a result of the experiments being conducted in the real world, all possible outcomes were successfully observed. The gait analysis system we developed is equipped with a sensing unit that recognizes gait while calculating the state of equilibrium. Kinematic systems record body orientation, joint angles, linear and angular velocities, and accelerations during gait analysis. Our work involved tracking the lower limb in space using an IMU sensor and a rotary encoder to measure the orientation of the leg. Moreover, the encoder provides feedback for the relative motion of the thigh and shank based on the changing position. Static and dynamic conditions of the body are evaluated using both position and knee angle variables. We also evaluated the speed and state of the body based on its dynamic nature.

A. CASE#1: BODY IN STATIC CONDITION
When the resultant of all forces acting on the body is zero then the body is said to be in static equilibrium. In gait analysis static condition is achieved when all forces acting on the body including weight become equal to the ground reaction force the first condition of equilibrium is satisfied [49]. And it is depicted: As a result of our proposed methodology in our previous work, a body is in static equilibrium when the orientation variables remain constant. There is no change in the orientation of the leg in space in relation to its surroundings.
Due to zero displacement of the body with respect to level ground, there is no change in the orientation of the body.
It satisfies the static condition for the body to be lying down or standing.

B. CASE#2: BODY IN DYNAMIC CONDITION
A body is said to be in dynamic condition when the sum of all forces, torques, and moments is zero. When the body changes orientation with respect to level ground with uniform velocity, it is considered to be dynamic. This condition of equilibrium is satisfied, in our current work.

Knee deflects
A graph is plotted between the changing position of the leg and the time taken by the body as shown in Figure 8. Now, Figure 9 presents the complete analysis of the gait cycle of the body with all the phases as labeled. The change in the angle of the knee joint is measured by using a rotary encoder as shown in Figure 10. In general, the leg orientation is divided into the position of the leg measured by the IMU sensor and flexion/extension measured by the encoder. The stride length, step length, step width, and ROM for the current work are defined: Stride length = (97.8 ± 1) cm Step length = (48.9 ± 0.5) cm Step width = (21 ± 2) cm Range of motion (ROM) = (47 • ∼ 153 • )

C. CASE#3: LEG MOVEMENT WHILE SITTING ON CHAIR
Leg movement with no velocity occurs when knee angle and position variables change while sitting on a chair. It, therefore, defines the dynamic movement of the moving legs. While sitting on a chair and moving the leg, it is observed that the leg is moving in space but without any acceleration because of the ''0'' distance. The IMU still tracks 3 dimensional movement with x, y, and z axes. The custom benchmark for comparative analysis for the state-of-the-art is presented. The current work was compared with those who analyzed gait using wearable sensors on able-bodies on single or both legs. We discussed gait parameters, stance phase, swing phase, knee angle, position, speed, equilibrium, and body states. We proposed an    Figure 9 illustrates the normal gait cycle along with phases and sub-phases for each z-axis plane.
encoder-based feedback system as a special addition. There is no such circuitry/mechanism found in the research presented in Table 3.

D. CASE#4: RELATIONSHIP BETWEEN SPEED AND STATE OF BODY
When a body is in a dynamic state, its position and knee angle variables change over time. And these variables are directly related to the speed and state of the body. It defines the slow, normal, and high speed of the moving body based on the known variables.
• If the frequency of changing position and knee angle is high then the speed is also high reflecting the movement of the body at high speed (running).
• If the frequency of changing position and knee angle is moderate then the speed is also normal and the body is moving with normal speed (normal walk).
• If the frequency of changing position and knee angle is low then the speed is also low and the body is moving with low speed (slow walk).   [41], a gait tracker or 3D tracking and positioning of the lower limb was carried out by installing different IMUs on the thigh, shank, and hip of the body. The sensor installation scheme described above provides a better understanding of gait metrics. Due to the different data sources of sensors; managing and data execution can be challenging. The use of multiple sensors is time taking and requires more time in troubleshooting. As a result of the work in [42], we can replace different inertial sensors on different parts of our bodies with a single inertial sensor mounted on the shank.
It was previously reported that potentiometer assemblies are being used to maintain the static equilibrium of the body during a gait cycle in [49] and [56]. In the current work, the potentiometer assembly is replaced with the encoder assembly. Our custom algorithm identifies the leg's position and knee angle to relate them to body states. By using the above mention case 1, case 2, and case 3 it is summarized that all variables are used for computing speed and state of the body. Equation 9 shows that both position and knee angle are directly related to the speed and state of the body. According to equation 9, when the orientation of the body occurs as it displaces with respect to the surrounding then it indicates that the body is in dynamic conditions of walking and running.
x ∝ θ ∝ speed ∝ state of the body (9) It is essential for individuals to maintain body equilibrium when they are at risk of slipping or falling. Slipping may happen when step length keeps on increasing while walking and there is a danger of falling on the ground when the step width is zero. Amputees being trained to adjust their prosthetic devices are at high risk of falling when the gait analysis model is being tested on them. Consequently, the equilibrium ensures that gait analysis will be safe for both healthy and amputees (while wearing prostheses).

V. CONCLUSION AND FUTURE WORK
During gait analysis, spatio-temporal parameters were calculated by incorporating equilibrium conditions at different speeds. According to the gait analysis, the stride length was calculated to be 97.8 cm, the step length to 48.9 cm, and the step width to be 21 cm. The sensing unit attached to a metaldesigned leg mounting assembly proved an excellent idea due to the feedback system. An encoder-based feedback system defined by ROM validated the gait phases predicted by the IMU placed on the shank. The flexion observed was 47 • and extension was 153 • and this ROM proved the capability to recognize all ''7'' phases of the gait cycle. The custom algorithm computes equilibrium conditions based on the speed using position and knee angle variables received from the sensing unit.
When performed on able bodies, gait analysis may prevent them from falling or slipping, implementing the equilibrium approach. When we test the gait analysis model on amputees, they may be at high risk of falling. Therefore, both healthy and amputated persons are safe in equilibrium conditions.
To relate the gait analysis with the equilibrium, the variables speed and state of the body were computed first. Execution of the algorithm validated the static conditions (case#1, i.e., lying down and standing states) and dynamic conditions (case#2, i.e., normal walking, running, and slow walk). The normal walk was observed at (TV, TF), running with > (TV, TF), and a slow walk with < (TV, TF). Case#3 presents the observation of leg movement while sitting on a chair, which is also a form of static condition as the leg swings with zero velocity. Based on speed, a direct relationship was found between static and dynamic behaviors of the body. It is stated that the frequency of position and knee angle represents the speed and state of body changes concerning time, leading to the prediction of sub-phases of the gait.
The limitations of the body's static and dynamic equilibrium states subject to the current research work are described here. The person didn't carry any special load when considered for gait analysis for different body states. Furthermore, the environment was level ground to analyze the gait of walking persons. Static equilibrium states of the body are achieved only when the subject is not moving concerning level ground. All the dynamic states of the body are restricted unless there is a change in leg orientation.
The individuals may not perform squatting in the current gait analysis system with the defined ROM. It is suggested to increase the range of flexion to perform the squatting. This may be beneficial while in exercise to strengthen the muscles and to offer prayer. Body equilibrium facilitates individuals when they are at risk of falling or slipping.
Considering age, gender, weight, and height factors, the presented experimental setup may be used on a more significant number of individuals. A more natural gait may be achieved by collecting datasets with various features. Passive/active prosthetic knee may be tested after a welltrained gait. A typical prosthetic knee can be judged based on its performance compared to a human's normalized mean gait curve. It may also transform passive prostheses into semiactive or active prosthesis devices. The wearers of lower limb prostheses may benefit from this exercise. WAQAR S. QURESHI received the Doctor of Engineering degree in mechatronics from the Asian Institute of Technology. He was an Engineer by training with over 19 years of experience in research and development in industry and academia. He has a strong passion for automated image analysis and artificial intelligence techniques in robotics and automation with a focus on solving real-world societal problems. After doctorate, he worked for a 3-D printing company in Thailand, and later as an Tenured Track Faculty Member with NUST, Pakistan. He has been awarded several research grants from the Higher Education Commission, Pakistan, as a Principal Investigator (PI) and Co-PI. As an Academic Entrepreneur, he has completed several international and national projects related to robotics, automation, and 3-D printing and scanning. He is currently a Postdoctoral Fellow with Technological University, Dublin, Ireland. VOLUME 10, 2022