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. The main objective of this research was to introduce a new concept in gait analysis by computing the static and dynamic equilibrium in a real-world environment. A relationship was also presented among the parameters stated as static & 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 an IMU sensor and a rotary encoder. It was acceptable to satisfy the static conditions when the body was in a fixed position and orientation, whether lying down or standing. While walking and running, the orientation is 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. Body equilibrium facilitates individuals when they are at risk of falling or slipping.INDEX TERMS Gait analysis, IMU sensor, rotary encoder, static and dynamic equilibrium, body orientation.