Knee Angle Generation with Walking Speed Adaptation Ability for a Powered Transfemoral Prosthetic Leg Prototype

: This paper presents a microcontroller-based solution for generating real-time normal walking knee angle of a powered transfemoral prosthetic leg prototype. The proposed control algorithm was used to determine the prosthetic knee angle by utilizing seven hip angle movement features generated from only the inertia measurement unit (IMU) deployed on the prosthetic socket on the thigh of the same side. Then, a proportional–integral–derivative (PID) controller is developed to control the motor to reach the desired knee angle in real time. Furthermore, a novel parallel four-bar linkage-based master–slave validation framework combining a motion capture system was introduced to evaluate the performance of the knee angle generation on a speed-adjustable treadmill with able-bodied subjects. In the framework evaluation, 3 different walking speeds were applied to the treadmill to validate different speed adaptation capabilities of the prosthetic leg control system, precisely 50 cm/s, 60 cm/s, and 70 cm/s. Through the proposed 4-bar linkage framework, the prosthesis’s movement can simulate able-bodied subjects well with maximum RMSE never exceeding 0.27 ◦ in the swing ﬂexion phase, 4.4 ◦ to 5.8 ◦ in the stance phase, and 1.953 ◦ to 13.466 ◦ in the swing extension phase. The treadmill results showed that the prosthetic leg is able to perform a normal walking gait following different walking speeds of the subject. Finally, a corridor walking experiment with a bypass adapter was successfully performed to examine the feasibility of real prosthetic walking situations.


Introduction
Transfemoral prosthetic legs are necessary technical aids for above-the-knee amputees, partially fabricated regarding artificial knee mechanics [1][2][3]. Conventional transfemoral prosthetic legs are pin-joint-based designs or polycentric designs. Various efforts to obtain a higher performance in achieving a normal gait for powered transfemoral prosthetic legs have been reported. To achieve a normal gait walking, the transfemoral prosthesis system should be able to detect or predict the current gait phase based on the input information from the amputee. Then, a proper knee angle motion can be generated based on the detected or predicted gait phase. Thus, the motion of the healthy and the amputated side could become synchronized. It is crucial to maintain the balance of the amputee during walking.
To adapt to joint movement, the microprocessor-controlled prosthetic legs are modern prostheses that use the sensor information to obtain natural knee function for transfemoral amputees. In general, there are two main types of microprocessor-controlled prosthetic legs [4]: passive (variable damping) and active (powered). Compared with the passive proposed an indirect volitional prosthetic control mechanism for above-knee amputation. Their study aimed to achieve the control of prostheses adaptable to different walking speeds when walking over obstacles. Wen et al. [19] investigated the influence on the gait symmetry of human wearers based on a robotic transfemoral prosthesis. Tommaso et al. [20] utilized the shank orientation derived from the accelerometer combined with the knee and ankle angles of the prosthetic leg to estimate the walking speed. Meanwhile, Quintero et al. [21] and Kevin et al. [22] transformed the gait cycle into a single variable, and the model could be trained with able-bodied joint trajectories under various tasks and speeds to generate desired joint angles as a function of the phase variable. However, most studies focused on designing a control framework that utilized information collected from multiple sensors. For algorithms with low computational complexity considerations, Naber et al. [23] developed a low-cost embedded system for myoelectric pattern recognition. Their solution was based on stationary wavelet processing and data imputing for real-time prosthesis implementation. Tran et al. [24] proposed a new active variable transmission (AVT) to adjust speed and torque for different ambulation activities in terms of a hierarchical control system with three nested layers.
Besides the advantages in stability, gait, or metabolic rate of prosthetic legs, the high cost is also essential, making prosthetic devices inaccessible to most amputees. Through surveys of commercial prostheses [25], Ossur Power Knee can range from 70,000-90,000 USD for a complete solution. The Ottobock C-Leg Bionic Knee costs 40,000-50,000 USD (including the socket, prosthetic foot, and all extra fees). The Ottobock Genium X3 Knee typically is more than 100,000 USD (including the socket, prosthetic foot, and other fees). Therefore, a simple and light computational solution by configuring an IMU and a low-cost microcontroller equipped with a motorized above-knee prosthetic leg to perform natural walking patterns is desirable for developing a low-cost solution.
To evaluate the validity of the algorithm, most current studies utilize bypass sockets to verify the result by healthy participants for the performance evaluation of the prosthetic legs. Some researchers have been working on the design of an open-source, low-cost bypass socket [26,27], allowing more convenient simulation. However, this tool lacks the simultaneous reference of the actual walking pattern, which may lead to inaccuracy of comparison between natural and prosthesis-assisted walking. To analyze the walking gait, some motion-capturing frameworks were introduced. Goldfarb et al. [28] proposed an opensource toolkit to ingest, parse, and analyze Vicon mocap data and perform gait analysis. Moreover, Refs. [29,30] took advantage of the vision system for gait spatial-temporal parameters. However, these frameworks only analyze human gait. To pursue a more convincing evaluation, tools that allow synchronized walking trajectory tracking on both the human leg and prosthetic leg are desired. Thus, this paper introduced a novel parallel four-bar linkage-based prosthetic master-slave validation framework, which can verify the similarity between the prosthetic leg and natural human leg walking patterns. According to the importance of prosthetic gait model classification and self-adaption, this study proposes a simple yet sufficient method to control the prosthesis while performing a normal walking gait motion and being able to adapt to different walking speeds automatically.
In general, this study aims to design an empowered transfemoral prosthetic leg prototype, which is manipulated by a control framework to extract seven hip movement features extracted from only the attached thigh's IMU sensor. The proposed control framework is based on the definition of phase in a normal gait cycle, which only requires a relatively small dataset for investigating patterns and low-cost computational complexity. Moreover, the proposed novel parallel four-bar linkage-based prosthetic master-slave validation framework is desired to connect able-bodied subjects and the distal prosthetic leg module, and such an assessment mechanism is able to quantitatively evaluate the synchronization and trajectory tracking between the subject's knee angle and the prosthetic knee angle exactly with a motion capture system. Finally, the overall structure of our proposed control framework and the proposed four-bar linkage-based prosthetic validation framework is illustrated in Figure 1. knee angle exactly with a motion capture system. Finally, the overall structure of our pro posed control framework and the proposed four-bar linkage-based prosthetic validation framework is illustrated in Figure 1.

Knee Angle Characteristics of Normal Walking
In this paper, since the hip angle is the primary input of our system to generate the knee angle, it is essential to comprehend the characteristics of the hip angle during a nor mal walking cycle. Generally, the pa erns of hip angle during normal walking are similar and only the amplitude and the frequency are slightly different in each person [31]. The walking gait cycle involves two main phases: the stance phase (60% of the gait cycle) and the swing phase (40% of the gait cycle) [32]. The leg posture of each event during a gai cycle is shown in Figure 2.   In this paper, since the hip angle is the primary input of our system to generate the knee angle, it is essential to comprehend the characteristics of the hip angle during a normal walking cycle. Generally, the patterns of hip angle during normal walking are similar, and only the amplitude and the frequency are slightly different in each person [31]. The walking gait cycle involves two main phases: the stance phase (60% of the gait cycle) and the swing phase (40% of the gait cycle) [32]. The leg posture of each event during a gait cycle is shown in Figure 2. knee angle exactly with a motion capture system. Finally, the overall structure of our proposed control framework and the proposed four-bar linkage-based prosthetic validation framework is illustrated in Figure 1.

Knee Angle Characteristics of Normal Walking
In this paper, since the hip angle is the primary input of our system to generate the knee angle, it is essential to comprehend the characteristics of the hip angle during a normal walking cycle. Generally, the pa erns of hip angle during normal walking are similar, and only the amplitude and the frequency are slightly different in each person [31]. The walking gait cycle involves two main phases: the stance phase (60% of the gait cycle) and the swing phase (40% of the gait cycle) [32]. The leg posture of each event during a gait cycle is shown in Figure 2.  The walking gait cycle has traditionally been divided into eight events or periods [33]. Five events occur during the stance phase, and three events occur during the swing phase. The stance phase events are heel strike, foot-flat, mid-stance, heel-off, and toe-off. It is noted that the push off indicated in Figure 2 represents a combination of the heel-off and toe-off events. The swing phase events are early swing (or acceleration), mid-swing, and late swing (or deceleration). According to [34], the resultant force experienced by the hip joint depends on an individual's body weight and muscle strength. During the act of walking, this force has been estimated to be approximately three times the individual's body weight. The highest magnitude of force occurs when the foot is flat on the ground, while the force is at its minimum during the swing phase.
To investigate the eight gait events for identification, the hip and knee angles of normal walking gaits collected from able-bodied subjects were experimentally arranged. Two walking cycles were investigated, as shown in Figure 3a, with each gait event corresponding to the data in Figure 2 labeled with a blue circle, starting from number 1 to number 8. The identification was performed heuristically during normal walking to find the related angle relationships shown in the graph. The main aim of the proposed algorithm is to generate a proper knee angle value based on the hip angle value. In this paper, the knee angle pattern sequences are divided into essential parts to ease the construction of our algorithm. Then, a comprehensive exploration of the role in each part is performed. Finally, an appropriate and feasible algorithm is constructed to generate the knee angle. Therefore, this study divides the knee angle pattern into three main parts, as shown in Figure 3b, including stance, swing flexion, and swing extension phases.
The walking gait cycle has traditionally been divided into eight events or periods [33]. Five events occur during the stance phase, and three events occur during the swing phase. The stance phase events are heel strike, foot-flat, mid-stance, heel-off, and toe-off. It is noted that the push off indicated in Figure 2 represents a combination of the heel-off and toe-off events. The swing phase events are early swing (or acceleration), mid-swing, and late swing (or deceleration). According to [34], the resultant force experienced by the hip joint depends on an individual's body weight and muscle strength. During the act of walking, this force has been estimated to be approximately three times the individual's body weight. The highest magnitude of force occurs when the foot is flat on the ground, while the force is at its minimum during the swing phase.
To investigate the eight gait events for identification, the hip and knee angles of normal walking gaits collected from able-bodied subjects were experimentally arranged. Two walking cycles were investigated, as shown in Figure 3a, with each gait event corresponding to the data in Figure 2 labeled with a blue circle, starting from number 1 to number 8. The identification was performed heuristically during normal walking to find the related angle relationships shown in the graph. The main aim of the proposed algorithm is to generate a proper knee angle value based on the hip angle value. In this paper, the knee angle pa ern sequences are divided into essential parts to ease the construction of our algorithm. Then, a comprehensive exploration of the role in each part is performed. Finally, an appropriate and feasible algorithm is constructed to generate the knee angle. Therefore, this study divides the knee angle pa ern into three main parts, as shown in Figure 3b, including stance, swing flexion, and swing extension phases. Based on this categorization, the target knee angle can be divided into two essential sections: the maximum straight when the knee angle is 0 degrees and the maximum swing angle. During the stance phase, angle variations are found in the knee angle pa ern. The angle variation is due to the heel strike phase, the transition from single-support to double-support, and the mid-stance phase when the entire body mass rests on the stepping leg. Since external factors cause the angle variation, our system does not need to calculate or produce such an angle variation. Consequently, the proposed system only needs to give the default angle for the stance phase. The maximum swing angle needs to be calculated by the walking speed.
Along with the change in the walking speed and the maximum swing angle, the speed of the actuator could be adjusted to achieve an appropriate gait phase at the right Based on this categorization, the target knee angle can be divided into two essential sections: the maximum straight when the knee angle is 0 degrees and the maximum swing angle. During the stance phase, angle variations are found in the knee angle pattern. The angle variation is due to the heel strike phase, the transition from single-support to doublesupport, and the mid-stance phase when the entire body mass rests on the stepping leg. Since external factors cause the angle variation, our system does not need to calculate or produce such an angle variation. Consequently, the proposed system only needs to give the default angle for the stance phase. The maximum swing angle needs to be calculated by the walking speed.
Along with the change in the walking speed and the maximum swing angle, the speed of the actuator could be adjusted to achieve an appropriate gait phase at the right time. However, in the proposed system, the instruction to perform the swing flexion phase begins at the heel-off phase, and it occurs two phases earlier than the swing phase during normal walking, as mentioned previously. The reason is that when the prosthesis shank moves from a stationary position and the direction of motion against gravity, there will be a delay of several milliseconds during the acceleration time of the actuator. Therefore, if the swing flexion instruction is given at the toe-off phase, the lagging swing phase will be longer, and the prosthesis movement will not be appropriate. Another important aspect is determining when to give the target knee angle instructions.
From Figure 4, the heel-off phase begins when the following conditions are satisfied: (1) hip angle is decelerating; (2) thigh direction is swinging backward; and (3) hip angle is smaller than 0 • . In addition, the swing extension phase begins if the following conditions occur: (1) hip angle is decelerating; (2) thigh direction is swinging forward; and (3) hip angle is greater than 0 • . time. However, in the proposed system, the instruction to perform the swing flexion phase begins at the heel-off phase, and it occurs two phases earlier than the swing phase during normal walking, as mentioned previously. The reason is that when the prosthesis shank moves from a stationary position and the direction of motion against gravity, there will be a delay of several milliseconds during the acceleration time of the actuator. Therefore, if the swing flexion instruction is given at the toe-off phase, the lagging swing phase will be longer, and the prosthesis movement will not be appropriate.
Another important aspect is determining when to give the target knee angle instructions.
From Figure 4, the heel-off phase begins when the following conditions are satisfied: (1) hip angle is decelerating; (2) thigh direction is swinging backward; and (3) hip angle is smaller than 0°. In addition, the swing extension phase begins if the following conditions occur: (1) hip angle is decelerating; (2) thigh direction is swinging forward; and (3) hip angle is greater than 0°. Based on the previous descriptions, a finite-state machine (FSM) representing the conditions could be desirable. Therefore, a threshold is added to divide the thigh position into two parts: the front and rear. This threshold value is set initially to be smaller than 0° to prevent reading errors of the deceleration conditions. The reason is that one's thigh can generally still move a few degrees greater or less than 0° while standing or at the stance phase. The proposed finite-state machine (FSM) diagram is shown in Figure 5. Based on the previous descriptions, a finite-state machine (FSM) representing the conditions could be desirable. Therefore, a threshold is added to divide the thigh position into two parts: the front and rear. This threshold value is set initially to be smaller than 0 • to prevent reading errors of the deceleration conditions. The reason is that one's thigh can generally still move a few degrees greater or less than 0 • while standing or at the stance phase. The proposed finite-state machine (FSM) diagram is shown in Figure 5.

Hip Angle Features According to Walking Phases
Based on the FSM, the essential features of the hip angle could be extracted for the target knee angle and the actuator speed limit calculation. The definitions of hip and knee angles are illustrated in the left part of Figure 6. In addition, the positions of the markers for the motion-capturing system are mounted on the hip, knee, and ankle joints of the subject's right leg and the prosthetic leg, as shown in the middle and right parts of Figure  6. Therefore, there are seven essential features to be extracted from the hip angle, as illustrated in Figure 7: 1. Smallest hip angle;

Hip Angle Features According to Walking Phases
Based on the FSM, the essential features of the hip angle could be extracted for the target knee angle and the actuator speed limit calculation. The definitions of hip and knee angles are illustrated in the left part of Figure 6. In addition, the positions of the markers for the motion-capturing system are mounted on the hip, knee, and ankle joints of the subject's right leg and the prosthetic leg, as shown in the middle and right parts of Figure 6. Therefore, there are seven essential features to be extracted from the hip angle, as illustrated in Figure 7: Smallest hip angle; 2.
The peak-to-peak value of the hip angle (Hip p−p ); 4.
The starting point of deceleration in the backward direction; 7.
The starting point of deceleration in the forward direction.

Hip Angle Features According to Walking Phases
Based on the FSM, the essential features of the hip angle could be extracted for the target knee angle and the actuator speed limit calculation. The definitions of hip and knee angles are illustrated in the left part of Figure 6. In addition, the positions of the markers for the motion-capturing system are mounted on the hip, knee, and ankle joints of the subject's right leg and the prosthetic leg, as shown in the middle and right parts of Figure  6. Therefore, there are seven essential features to be extracted from the hip angle, as illustrated in Figure     The smallest and the largest hip angle features are used to calculate the hip's peakto-peak value ( ). The other feature is the angular velocity or of the hip angle during the swing forward, which is essential to find the speed limit for the actuator. This feature is affected by the Δ value and value. The primary purpose of se ing this speed limit value is to consider the actuator's PID control for practical considerations. By giving a limit value for the maximum speed of the actuator, the speed of the actuator will not surpass the limit value. This limit speed value will always be the initial speed for the actuator when the target knee angle changes. The speed value will then change until the accumulated speed that results from each PID gain is smaller than the limit speed value. Finally, starting points of backward hip deceleration and forward hip deceleration are shown as Features 6 and 7. The backward hip deceleration feature represents deceleration when the thigh direction is swinging backward, while the forward hip deceleration feature represents deceleration when the thigh direction is swinging forward, as mentioned The smallest and the largest hip angle features are used to calculate the hip's peakto-peak value (Hip p−p ). The other feature is the angular velocity or ω hip of the hip angle during the swing forward, which is essential to find the speed limit for the actuator. This feature is affected by the ∆t value and Hip p−p value. The primary purpose of setting this speed limit value is to consider the actuator's PID control for practical considerations. By giving a limit value for the maximum speed of the actuator, the speed of the actuator will not surpass the limit value. This limit speed value will always be the initial speed for the actuator when the target knee angle changes. The speed value will then change until the accumulated speed that results from each PID gain is smaller than the limit speed value. Finally, starting points of backward hip deceleration and forward hip deceleration are shown as Features 6 and 7. The backward hip deceleration feature represents deceleration when the thigh direction is swinging backward, while the forward hip deceleration feature represents deceleration when the thigh direction is swinging forward, as mentioned previously. These features indicate the beginning of the swing flexion phase and the swing extension phase. The timing of performing the swing phase is needed to make foot clearance during the swing phase, and such foot clearance is also a vital factor in the swing phase to prevent stumbling [35].
The Hip p−p value is also used to calculate the target knee angle (A knee ). This consideration is based on the observation that when the walking speed increases, the knee angle amplitude and the hip's peak-to-peak value also increase. Thus, the ratio between the knee angle amplitude and the hip peak-to-peak value in both walking and running patterns is similar, as shown in Figure 8 and Table 1. In detail, Table 1 shows that the ratio values during walking and running are close, and the empirical ratio is approximately 1.82, which is the average ratio of the sample data. Consequently, this value can be further used to calculate the target knee angle or the amplitude knee value.  * Notice that due to the limitation of the prosthetic leg that the minimum knee angle value is 0°, the lowest knee angles recorded in the table are all set to 0° for evaluation.

Knee Angle Amplitude and Actuator Speed Limit
By knowing the ratio between the hip's peak-to-peak value and knee amplitude value, this ratio value can be used as a parameter with a constant value to calculate the target knee angle. To ease the use of the calculated ratio parameter, the ratio value is named as constant in this study. Since an individual's physical posture and walking habits are different, the ratio between the hip's peak-to-peak and knee angle amplitude of each person could be different. Thus, the value could be adjusted to obtain the best fit for the walking gait habit of the user.
The target knee angle can be calculated by multiplying the hip's peak-to-peak value ( ) with the value, as expressed by the following: To calculate the speed limit for the actuator, it is necessary to know the correlation between the given motor's PWM value of the brushless DC motor as well as the angular velocity of the hip swing ( ). To obtain the required PWM to actuate the knee angle from a straight position to the maximum swing flexion angle, several pieces of information, such as the maximum angular velocity value of the brushless DC motor, the total gear reduction ratio, the lead value of the ball screw, and the kinematics of the prosthesis, must be known. For example, the required PWM value to actuate a knee angle from 0 to 60° in 400 ms is 135 in a 255 PWM range value. The value of the hip swing in the same gait cycle is 4.4 deg/0.1 s. Then, the correlation value is the ratio between the required PWM value and the value, and the result can be used as a parameter with a constant  By knowing the ratio between the hip's peak-to-peak value and knee amplitude value, this ratio value can be used as a parameter with a constant value to calculate the target knee angle. To ease the use of the calculated ratio parameter, the ratio value is named as CA knee constant in this study. Since an individual's physical posture and walking habits are different, the ratio between the hip's peak-to-peak and knee angle amplitude of each person could be different. Thus, the CA knee value could be adjusted to obtain the best fit for the walking gait habit of the user. The target knee angle A knee can be calculated by multiplying the hip's peak-to-peak value (Hip p−p ) with the CA knee value, as expressed by the following: To calculate the speed limit for the actuator, it is necessary to know the correlation between the given motor's PWM value of the brushless DC motor as well as the angular velocity of the hip swing (ω hip ). To obtain the required PWM to actuate the knee angle from a straight position to the maximum swing flexion angle, several pieces of information, such as the maximum angular velocity value of the brushless DC motor, the total gear reduction ratio, the lead value of the ball screw, and the kinematics of the prosthesis, must be known. For example, the required PWM value to actuate a knee angle from 0 to 60 • in 400 ms is 135 in a 255 PWM range value. The ω hip value of the hip swing in the same gait cycle is 4.4 deg/0.1 s. Then, the correlation value is the ratio between the required PWM value and the ω hip value, and the result can be used as a parameter with a constant value to calculate the speed limit for the actuator. This parameter is called CM lim , which is expressed as follows: If the CM lim value is known, the maximum limit speed (M lim ) of the actuator can be calculated as follows: Since this value is set as the PWM value for a practical motor driver, the minimum and maximum values cannot surpass the system's minimum and maximum PWM values. In this system, the maximum PWM value is 255; thus, if the M lim value is greater than 255, the value of M lim will be set as 255.

Whole Process Integration
The proposed system is shown in Figure 9, consisting of (a) the software architecture and (b) the system block diagram. For the software architecture, two subroutines are implemented. The first subroutine executes at a high frequency (1 kHz), and it deals with the data collection of hip angle (via an IMU) and knee angle (via an encoder) as well as the PID knee actuator (via a DC brushless motor) control. The second subroutine is executed at a frequency of 100 Hz, and it addresses the knee angle generation and speed limitations. Two subroutines collect sensor data and generate knee angle control commands. A timeout timer is desired to prevent the prosthesis from staying in a swing flexion position if the user stops their thigh movement in the swing flexion position. If this occurs, the timeout timer can send the parameter values, resulting in the desired knee angle of 0 • ; hence, the prosthesis will be straightened. Moreover, when the target knee angle and speed limit value have been determined, the next step is deploying those values to the PID controller as the information to actuate the knee angle, as indicated in the first subroutine. The following describes the details of generating the target knee angle and the maximum speed limit for the DC motor, as indicated in (4) to (6).
decel is a variable that indicates the detection status of the deceleration event of the hip angle, .. θ hip is the deceleration of the hip angle, and T is the threshold close to 0.
dir represents the swing direction of the thigh; its value will be 0 if the thigh is backward swinging and 1 for forward swinging. Such an operation follows the system block diagram shown in Figure 9b.
is a variable that indicates the detection status of the deceleration event of the hip angle, is the deceleration of the hip angle, and is the threshold close to 0.
represents the swing direction of the thigh; its value will be 0 if the thigh is backward swinging and 1 for forward swinging. Such an operation follows the system block diagram shown in Figure 9b.

Design of the Prosthetic Leg Prototype
Although prosthetic gait model classification and self-adaption are the major research topics, a physical transfemoral prosthesis prototype is still necessary for practical validation. Hence, this work designed and fabricated a 4-bar linkage artificial knee mechanism driven by a DC brushless motor and a ball screw with a 15 mm pitch. The combination of a gearbox and timing pulley was used to increase the torque of the motor with a reduction ratio of 1:22.4. The overall mechanical structure of the prosthesis consists of three main sections: the knee section, the actuator section, and the suspension section. The knee section consists of a knee joint, an absolute encoder, a thigh-to-knee connector, a shank-to-knee connector, and a lever arm for connecting the ball screw. The knee part is designed to perform knee angles ranging from 0° (straight posture) to 90°. The rotor of the

Design of the Prosthetic Leg Prototype
Although prosthetic gait model classification and self-adaption are the major research topics, a physical transfemoral prosthesis prototype is still necessary for practical validation. Hence, this work designed and fabricated a 4-bar linkage artificial knee mechanism driven by a DC brushless motor and a ball screw with a 15 mm pitch. The combination of a gearbox and timing pulley was used to increase the torque of the motor with a reduction ratio of 1:22.4. The overall mechanical structure of the prosthesis consists of three main sections: the knee section, the actuator section, and the suspension section. The knee section consists of a knee joint, an absolute encoder, a thigh-to-knee connector, a shank-to-knee connector, and a lever arm for connecting the ball screw. The knee part is designed to perform knee angles ranging from 0 • (straight posture) to 90 • . The rotor of the absolute encoder (12-bit data output resolution) should be the same angle as the knee joint angle. The actuator section consists of a Maxon motor with a gearbox and ball screw (Maxon EC-4pole/309757/320247) which is able to run longer at higher power values without overheating; a Maxon motor control 1-Q-EC amplifier DEC module 50/5 (380200) is able to drive EC-motor with power up to 250 W and a maximum speed of 1 pole pair EC-motor up to 80,000 rpm and a timing pulley. The suspension section consists of extension springs, lever arms for connecting springs, and spring extension tuners. Most of the parts for the mechanical structure of the prosthesis are made of aluminum alloy, where the mass and length of the powered transfemoral prosthetic leg are 3 kg and 350 mm, respectively. The design details can be seen in Figure 10. Since the prosthetic prototype is attached to amputee's thigh using a bypass, the actuator section of the prosthetic is used to generate a target knee angle when amputee starts moving. Thus, the proposed prosthetic prototype has 1 degree of freedom (DOF) in X-axis, as illustrated in Figure 11. out overheating; a Maxon motor control 1-Q-EC amplifier DEC module 50/5 (380200) is able to drive EC-motor with power up to 250 W and a maximum speed of 1 pole pair ECmotor up to 80,000 rpm and a timing pulley. The suspension section consists of extension springs, lever arms for connecting springs, and spring extension tuners. Most of the parts for the mechanical structure of the prosthesis are made of aluminum alloy, where the mass and length of the powered transfemoral prosthetic leg are 3 kg and 350 mm, respectively. The design details can be seen in Figure 10. Since the prosthetic prototype is a ached to amputee's thigh using a bypass, the actuator section of the prosthetic is used to generate a target knee angle when amputee starts moving. Thus, the proposed prosthetic prototype has 1 degree of freedom (DOF) in X-axis, as illustrated in Figure 11.  An IMU sensor (MPU6050) should be mounted on the top of the knee part to read the hip angle of the prosthesis. The IMU sensor data is the information used to generate the target knee angle. The knee angle is obtained via an absolute encoder mounted on the knee joint. The primary design theme is to produce a real-time (100 Hz in this study); hence, each sensor data point is individually processed by a slave microcontroller to reduce the processing burden of the main microcontroller so that the response and processing time of the prosthesis can be faster and more efficient. The acquired sensor values will then be sent to the main microcontroller through serial communication. The main tasks of the main microcontroller are signal processing, target knee angle calculations, and actuator control. The main microcontroller uses a 32-bit Arduino with an 84 MHz processing speed.
The prosthesis control scheme uses a three-interrelated-level control architecture, in- Figure 11. The degree of freedom schematic of our prosthetic prototype. Our prosthetic leg has 1 DOF at knee joint.
An IMU sensor (MPU6050) should be mounted on the top of the knee part to read the hip angle of the prosthesis. The IMU sensor data is the information used to generate the target knee angle. The knee angle is obtained via an absolute encoder mounted on the knee joint. The primary design theme is to produce a real-time (100 Hz in this study); hence, each sensor data point is individually processed by a slave microcontroller to reduce the processing burden of the main microcontroller so that the response and processing time of the prosthesis can be faster and more efficient. The acquired sensor values will then be sent to the main microcontroller through serial communication. The main tasks of the main microcontroller are signal processing, target knee angle calculations, and actuator control. The main microcontroller uses a 32-bit Arduino with an 84 MHz processing speed.
The prosthesis control scheme uses a three-interrelated-level control architecture, including low-level, mid-level, and high-level controllers. In the low-level controller, the combination of the PID control and the feedback knee angle from the absolute encoder is used to control the knee angle toward the calculated target knee angle. In the midlevel controller, a finite-state machine (FSM) determines the timing to activate the stance, swing-flexion, and swing-extension phases and evokes the PID control system. Finally, in the high-level controller, the target knee angle and speed of the gait are generated. The algorithms for this controller's level are the core focus of this paper, and the details are elaborated on in the following sections. The final mechatronic integrated fabrication with the deployments of sensors and microcontrollers is shown in Figure 12.

Experimental Setup
To validate the natural walking gait simulation from hip angle data, the experiment will be assisted by a mechanical thigh connected to a rigid aluminum frame by a 1 DoF (Degree of Freedom) revolute joint in the X-axis. The thigh motion of the prosthesis leg will be controlled by an able-bodied subject walking on a treadmill. The able-bodied subject's thigh motion will be transferred to the mechanical thigh of the prosthesis rough an aluminum bar. The connections of the aluminum bar are 2 DoF for rotation in Z-axis and X-axis; thus, only the motion in the Y-axis direction will be transferred to the mechanical thigh. The prosthesis's electronic connection and sensor alignment also needs to be appropriately set. The environment setup for the experiment is shown in Figure 13.

Experimental Setup
To validate the natural walking gait simulation from hip angle data, the experiment will be assisted by a mechanical thigh connected to a rigid aluminum frame by a 1 DoF (Degree of Freedom) revolute joint in the X-axis. The thigh motion of the prosthesis leg will be controlled by an able-bodied subject walking on a treadmill. The able-bodied subject's thigh motion will be transferred to the mechanical thigh of the prosthesis rough an aluminum bar. The connections of the aluminum bar are 2 DoF for rotation in Z-axis and X-axis; thus, only the motion in the Y-axis direction will be transferred to the mechanical thigh. The prosthesis's electronic connection and sensor alignment also needs to be appropriately set. The environment setup for the experiment is shown in Figure 13.
The experiment involves 5 able-bodied subjects, including young males and females from 21-to 27-year-olds, whose body height ranges from 160 to 185 cm and weight ranges from 50 to 80 kg, with 172.67 cm and 62.91 kg on average and 1.498 cm and 5.418 kg in standard deviation, respectively. The biometric information of experimental subjects can be found in Table 2.
(Degree of Freedom) revolute joint in the X-axis. The thigh motion of the prosthesis leg will be controlled by an able-bodied subject walking on a treadmill. The able-bodied subject's thigh motion will be transferred to the mechanical thigh of the prosthesis rough an aluminum bar. The connections of the aluminum bar are 2 DoF for rotation in Z-axis and X-axis; thus, only the motion in the Y-axis direction will be transferred to the mechanical thigh. The prosthesis's electronic connection and sensor alignment also needs to be appropriately set. The environment setup for the experiment is shown in Figure 13.   According to Section 2.2.1, there are two critical parameters that need to be set for the prosthesis leg: knee amplitude gain CA knee and motor limit value CM lim . To establish a proper value for each parameter, it is necessary to know the walking characteristics of able-bodied subjects. Hence, motion data acquisition, as shown in Figure 14, is required to find the best value parameters. IMU sensors are placed on the link of the target limb. The microcontrollers will receive the angle data from IMU and then send it to PC. In this experiment, Matlab software was used to process the angle data and obtain the joint angle of the target limb (A knee ): Then, the estimated CA knee and CM lim can be obtained by Equations (1) and (2). For CA knee value, it is acceptable if it has a small difference between the theoretical value and actual values, as long as the main purpose of the knee motion during walking has been fulfilled. The CA knee value may differ for each person, even when performing at the same walking speed, because of the person's physical posture and walking habits. Therefore, to verify our proposed methods, we chose able-bodied subjects with similar walking behaviors in similar biometric information, as described in Table 2. In this paper, we select the CA knee is 1.8.
Moreover, according to the proposed finite state machine of the prosthesis in Section 2.1, to determine the interchanging moment between the stance phase (straight leg) and swinging phases, a threshold is defined iteratively. In particular, the threshold value is required to be less than the peak-to-peak value of the hip angle (Hip p−p ), i.e., around half of Hip p−p , and will be updated in every step cycle. The current threshold value will be applied to the knee angle calculation for the next walking cycle.

Experimental Results without Using a Bypass Adapter
For the first experiment, we are going to validate that the actuated prosthetic knee pattern can follow the subject's knee pattern well. It is challenging for most researchers because it is difficult to obtain the ground of the prosthetic knee pattern when the experiments are applied to a healthy subject wearing a bypass adaptor or to an amputee wearing a prosthetic socket. Our paper proposes a four-bar linkage measurement solution. The con-struction of the four-bar linkage mechanism connecting an able-bodied subject and a distal prosthetic leg module is able to quantitatively evaluate the synchronization and trajectory tracking between the subject's knee angle and the prosthetic knee angle with a motion capture system. Hence, the experiment constructed with a four-bar linkage mechanism configuration provided strong evidence of the knee angle following and synchronization performance based on confident knee pattern ground truth.

Experimental Results without Using a Bypass Adapter
For the first experiment, we are going to validate that the actuated prosthetic knee pa ern can follow the subject's knee pa ern well. It is challenging for most researchers because it is difficult to obtain the ground of the prosthetic knee pa ern when the experiments are applied to a healthy subject wearing a bypass adaptor or to an amputee wearing a prosthetic socket. Our paper proposes a four-bar linkage measurement solution. The construction of the four-bar linkage mechanism connecting an able-bodied subject and a distal prosthetic leg module is able to quantitatively evaluate the synchronization and trajectory tracking between the subject's knee angle and the prosthetic knee angle with a motion capture system. Hence, the experiment constructed with a four-bar linkage mechanism configuration provided strong evidence of the knee angle following and synchronization performance based on confident knee pa ern ground truth.
The preliminary experiments were conducted by an able-bodied subject walking on a powered treadmill. A parallel four-bar linkage was constructed for master-slave operation. During the experiment, the prosthesis was hung on a mechanical thigh with one degree of freedom to revolute the joint at the hip joint, as shown in the top part of Figure 15. The parallel four-bar linkage connects the subject's thigh limb and the upper link of the powered transfemoral prosthetic leg module so that the pose of the subject's thigh limb would be the same as that of the upper link of the powered transfemoral prosthetic leg module. Such an experimental setup is convenient and helpful for validating the synchronization of knee angle generation and control of the powered transfemoral prosthetic leg module without using any bypass adapter dressing on the able-bodied subjects. The preliminary experiments were conducted by an able-bodied subject walking on a powered treadmill. A parallel four-bar linkage was constructed for master-slave operation. During the experiment, the prosthesis was hung on a mechanical thigh with one degree of freedom to revolute the joint at the hip joint, as shown in the top part of Figure 15. The parallel four-bar linkage connects the subject's thigh limb and the upper link of the powered transfemoral prosthetic leg module so that the pose of the subject's thigh limb would be the same as that of the upper link of the powered transfemoral prosthetic leg module. Such an experimental setup is convenient and helpful for validating the synchronization of knee angle generation and control of the powered transfemoral prosthetic leg module without using any bypass adapter dressing on the able-bodied subjects.
Validation of the transfemoral prosthetic leg's knee angle motion can be performed by comparing the able-bodied subject's knee angle trajectory via a conventional motion capture system PhaseSpace System, powered by PhaseSpace Inc., San Leandro, CA, USA. Six LED trackers were mounted on the subject's lower limb and the transfemoral prosthetic leg to dynamically calculate the synchronization of the subject and transfemoral prosthetic leg knee angles.
The experimental protocol is as follows. The subject connects his thigh limb to the parallel four-bar linkage to form a mechanical master-slave operational mechanism. Hence, the thigh motion of the prosthetic leg will be controlled by the distal able-bodied subject walking on a treadmill. The subject's thigh motion will then be transferred to the mechanical thigh of the prosthesis through an aluminum bar. The treadmill's speed is controlled by a microcontroller using a PID control scheme; thus, the treadmill's speed could be stable for validation. This experiment was programmed to have 3 levels of speed: 50 cm/s, 60 cm/s, and 70 cm/s. The speed of the treadmill was changed manually, but no resetting parameter values of the prosthesis were needed for the different walking speeds. The performance of the prosthesis was evaluated using the aforementioned motion capture system. The root mean squared error (RMSE) was evaluated between the subject knee angle and the prosthetic knee angle. The video for this experiment can be found at https: //youtu.be/1nBAY_vKAwI (accessed on 3 November 2022). Validation of the transfemoral prosthetic leg's knee angle motion can be performed by comparing the able-bodied subject's knee angle trajectory via a conventional motion capture system PhaseSpace System, powered by PhaseSpace Inc., San Leandro, CA, USA. Six LED trackers were mounted on the subject's lower limb and the transfemoral prosthetic leg to dynamically calculate the synchronization of the subject and transfemoral prosthetic leg knee angles.
The experimental protocol is as follows. The subject connects his thigh limb to the parallel four-bar linkage to form a mechanical master-slave operational mechanism. Hence, the thigh motion of the prosthetic leg will be controlled by the distal able-bodied subject walking on a treadmill. The subject's thigh motion will then be transferred to the mechanical thigh of the prosthesis through an aluminum bar. The treadmill's speed is controlled by a microcontroller using a PID control scheme; thus, the treadmill's speed could be stable for validation. This experiment was programmed to have 3 levels of speed: 50 cm/s, 60 cm/s, and 70 cm/s. The speed of the treadmill was changed manually, but no rese ing parameter values of the prosthesis were needed for the different walking speeds. The performance of the prosthesis was evaluated using the aforementioned motion capture system. The root mean squared error (RMSE) was evaluated between the subject knee angle and the prosthetic knee angle. The video for this experiment can be found at h ps://youtu.be/1nBAY_vKAwI.

Treadmill and Real-Taking Experiment Using a Bypass Adapter
Although the four-bar linkage configuration experiment provided a confident ground comparison for the actuated knee angle, real walking with a bypass adaptor is still necessary to know the actual walking performance from the investigation of walking. Hence, two bypass adaptor walking experiments are arranged on both treadmill and indoorway experiments. To examine the performance of wearing the powered transfemoral prosthetic leg for able-bodied subjects, a bypass adapter was produced along with a transfemoral prosthetic leg for real walking validation and then was worn on the right leg of the experiment subject. The validations were performed by walking on a treadmill and in a corridor. The time-lapse captured video of the bypass adapter prosthesis walking experiment on a treadmill, as shown in Figure 16, was recorded via a video available at h ps://youtu.be/4QpOG4WMoXg (accessed on 3 November 2022).

Treadmill and Real-Taking Experiment Using a Bypass Adapter
Although the four-bar linkage configuration experiment provided a confident ground comparison for the actuated knee angle, real walking with a bypass adaptor is still necessary to know the actual walking performance from the investigation of walking. Hence, two bypass adaptor walking experiments are arranged on both treadmill and in-doorway experiments. To examine the performance of wearing the powered transfemoral prosthetic leg for able-bodied subjects, a bypass adapter was produced along with a transfemoral prosthetic leg for real walking validation and then was worn on the right leg of the experiment subject. The validations were performed by walking on a treadmill and in a corridor. The time-lapse captured video of the bypass adapter prosthesis walking experiment on a treadmill, as shown in Figure 16, was recorded via a video available at https://youtu.be/4QpOG4WMoXg (accessed on 3 November 2022). Another natural walking experiment was conducted in a corridor. The able-bodied subject wore a transfemoral prosthetic leg with a bypass adapter and walked at non-specified speeds. Hence, this experiment investigated the transfemoral prosthetic leg's knee angle generation and speed adaptation in a real walking scenario. The time-lapse captured video of the bypass adapter prosthesis walking experiment in a corridor environment with a total of 20 m walking distance is shown in Figure 17. The experimental process was recorded by video, which is available at h ps://youtu.be/39bIanPwsIQ (accessed on 3 November 2022). Another natural walking experiment was conducted in a corridor. The able-bodied subject wore a transfemoral prosthetic leg with a bypass adapter and walked at nonspecified speeds. Hence, this experiment investigated the transfemoral prosthetic leg's knee angle generation and speed adaptation in a real walking scenario. The time-lapse captured video of the bypass adapter prosthesis walking experiment in a corridor environment with a total of 20 m walking distance is shown in Figure 17. The experimental process was recorded by video, which is available at https://youtu.be/39bIanPwsIQ (accessed on 3 November 2022).
Another natural walking experiment was conducted in a corridor. The able-bodied subject wore a transfemoral prosthetic leg with a bypass adapter and walked at non-specified speeds. Hence, this experiment investigated the transfemoral prosthetic leg's knee angle generation and speed adaptation in a real walking scenario. The time-lapse captured video of the bypass adapter prosthesis walking experiment in a corridor environment with a total of 20 m walking distance is shown in Figure 17. The experimental process was recorded by video, which is available at h ps://youtu.be/39bIanPwsIQ (accessed on 3 November 2022).

Discussion of Experiment with Four-Bar Linkage Mechanism
This experiment aims to evaluate the performance of the transfemoral prosthetic leg prototype in performing natural walking gait motions based on the hip angle motion input given by the distal subject. The results collected from commercial motion capture system LED trackers were evaluated to simultaneously calculate the hip and knee angles of the subject and the prosthesis. Figure 18 shows the results of 3 different walking speeds of 50 cm/s, 60 cm/s, and 70 cm/s with the same 330 data frames. It is noted that the walking speeds are referred to as 0.55 steps/s, 0.6 steps/s, and 0.65 steps/s, respectively. From these comparison charts, the prosthetic knee angle tracked the subject's knee angle well, representing RMSEs of 9.9°, 11.3°, and 13.0°, respectively. The results prove that our proposed

Discussion of Experiment with Four-Bar Linkage Mechanism
This experiment aims to evaluate the performance of the transfemoral prosthetic leg prototype in performing natural walking gait motions based on the hip angle motion input given by the distal subject. The results collected from commercial motion capture system LED trackers were evaluated to simultaneously calculate the hip and knee angles of the subject and the prosthesis. Figure 18 shows the results of 3 different walking speeds of 50 cm/s, 60 cm/s, and 70 cm/s with the same 330 data frames. It is noted that the walking speeds are referred to as 0.55 steps/s, 0.6 steps/s, and 0.65 steps/s, respectively. From these comparison charts, the prosthetic knee angle tracked the subject's knee angle well, representing RMSEs of 9.9 • , 11.3 • , and 13.0 • , respectively. The results prove that our proposed four-bar linkage mechanism helps the actuated prosthetic knee pattern to follow the able-bodied subject's knee pattern well on the same side when walking on the treadmill.

Discussion of RMSE Investigations on Knee Actuator Speed Limitation and the Initial Knee Angle Offset
The knee angle tracking data show that a higher walking speed results in a larger RMSE. Such a phenomenon is mainly due to the performance limitation of the DC brush motor and the ball screw actuators. The combination of a 1:22.4 speed reduction and a 15 mm ball screw pitch limits the maximum speed of the prosthetic knee. In addition, it might be caused by several other factors, such as parameter settings, the initial posture of the prosthesis, and variations in the subject condition. The error induced by the parameter setting is crucial-the calculation to obtain the parameters only considered specific known factors. Nevertheless, practically speaking, many factors could affect the prosthesis's performance, such as friction on the lead screw, gravity, moment, and inertia during the motion and power supply.
The other factor is the initial posture difference between the subject's knee and prosthetic knee angles [36]. The initial posture of the prosthesis during the experiment was not straight or at 0 • . This was due to the shock damper placed between the knee angle limiter on the knee part, with such a condition illustrated in Figure 19b. This condition caused the initial angle of the knee to become more than 0 • , as indicated by the motion capture result shown in Figure 19a. In this figure, the initial knee angle of the prosthesis is approximately 16.15 • , and the initial knee angle of the subject is approximately 9.55 • ; hence, the difference between the knee angle of the prosthesis and the knee angle of the subject is approximately 6.6 • . Since this initial knee angle offset is not a system bias parameter, it would not affect the target knee angle calculation. This was why the prosthesis's maximum swing flexion angle was almost the same as the maximum swing flexion angle of the subject. If this error value roughly subtracts the RMSE value of each walking speed, then the RMSE error could be smaller than 6.6 • . Particularly, the calculation of the RMSEs on three separate phases of stance, swing flexion, and swing extension in the abovementioned experiments are also evaluated, as indicated in Table 3. The table discussed the original RMSE value and compensated RMSE with 6.6 • to see the tracking performance of actuated prosthetic knee angles. The performance of the swing flexion phase is good, with a maximum RMSE never exceeding 0.27 • ; the RMSE of the stance phase is relatively consistent, around 4.4 • to 5.8 • . Nevertheless, the RMSE of the swing extension phase increases with the walking speed, ranging from 1.953 • to 13.466 • . Because of actuating more significant strokes in a limited time interval, the speed limit of the motor results in significant effects on the actuated tracking performance. four-bar linkage mechanism helps the actuated prosthetic knee pa ern to follow the ablebodied subject's knee pa ern well on the same side when walking on the treadmill.

Discussion of RMSE Investigations on Knee Actuator Speed Limitation and the Initial Knee Angle Offset
The knee angle tracking data show that a higher walking speed results in a larger RMSE. Such a phenomenon is mainly due to the performance limitation of the DC brush motor and the ball screw actuators. The combination of a 1:22.4 speed reduction and a 15 mm ball screw pitch limits the maximum speed of the prosthetic knee. In addition, it might be caused by several other factors, such as parameter se ings, the initial posture of the prosthesis, and variations in the subject condition. The error induced by the parameter se ing is crucial-the calculation to obtain the parameters only considered specific known factors. Nevertheless, practically speaking, many factors could affect the prosthesis's performance, such as friction on the lead screw, gravity, moment, and inertia during the motion and power supply.  original RMSE value and compensated RMSE with 6.6° to see the tracking performance of actuated prosthetic knee angles. The performance of the swing flexion phase is good, with a maximum RMSE never exceeding 0.27°; the RMSE of the stance phase is relatively consistent, around 4.4° to 5.8°. Nevertheless, the RMSE of the swing extension phase increases with the walking speed, ranging from 1.953° to 13.466°. Because of actuating more significant strokes in a limited time interval, the speed limit of the motor results in significant effects on the actuated tracking performance.
(a) (b) Figure 19. Initial knee angle of the prosthesis and subject investigation: motion capture trajectory (a) and the picture of the initial posture of the prosthesis and shock damper position (b).

Discussion of Experiment with Using a Bypass Adapter
We have analyzed the knee angles of the prosthetic side (i.e., wearing a bypass socket side) and healthy limb side (i.e., not wearing a bypass socket side) for comparisons based on the treadmill experiment with wearing a bypass adopter. The purpose is to evaluate the gait similarity of both sides. The knee angles of both sides are measured from the video frames with marked feature points, and some possible label error would be possible. The knee angle definition of labeling in the video is different from Figures 18 and 20. The angle ranges from 160 • around (straight) to 80 • around (maximum flexion). Such a definition differs from 0 • to 60 • around addressed in Figures 18-20. It is noted that the data shown in this figure are processed by a curve smoothing operation.
Moreover, the evaluation of the gait similarity of both side legs is illustrated in Figure 21. The results with the offset knee angles represent a high degree of similarity of gait patterns of both sides, which shows the Pearson correlation coefficient of 0.6866. With the high similarity of the gait patterns on both sides of the legs, it makes the prosthetic prototype generate the appropriate knee angle at different speed levels, helping amputees use less force during the gait loading stage (the second stage in the stance phase, i.e., Figure 2) [37,38].

Limitation and Future Work
This study proposes an algorithm regarding the desired knee angle as the multiplication of the peak-to-peak value of the hip angle Hip p−p and CA knee constant. Although this method ensures an extremely low computational complexity, the constant comes from the average value of the subjects, meaning that the value might not be suitable for every subject. Additionally, the current experiment contains a limited variety of experimental subjects with similar ages and lengths of legs, and the amputees have not been considered in the experiment yet.
For future work, the multiplier may be considered a tunable parameter and can be optimized based on the physical information of the different users of the prosthetic legs. Additionally, the prosthetic legs should be tested on a wider variety of amputees to ensure the actual performance of the natural walking of practical users. Moreover, adopting computational simulation [39,40] in improving prosthesis legs should be the potential further study since it brings several benefits, such as giving low-cost and rapid results compared to designing experimental tests. side) and healthy limb side (i.e., not wearing a bypass socket side) for comparisons based on the treadmill experiment with wearing a bypass adopter. The purpose is to evaluate the gait similarity of both sides. The knee angles of both sides are measured from the video frames with marked feature points, and some possible label error would be possible. The knee angle definition of labeling in the video is different from Figures 18 and 20. The angle ranges from 160° around (straight) to 80° around (maximum flexion). Such a definition differs from 0° to 60° around addressed in Figures 18-20. It is noted that the data shown in this figure are processed by a curve smoothing operation. Moreover, the evaluation of the gait similarity of both side legs is illustrated in Figure  21. The results with the offset knee angles represent a high degree of similarity of gait patterns of both sides, which shows the Pearson correlation coefficient of 0.6866. With the high similarity of the gait patterns on both sides of the legs, it makes the prosthetic prototype generate the appropriate knee angle at different speed levels, helping amputees use less force during the gait loading stage (the second stage in the stance phase, i.e., Figure  2) [37,38].

Limitation and Future Work
This study proposes an algorithm regarding the desired knee angle as the multiplication of the peak-to-peak value of the hip angle and constant. Although this method ensures an extremely low computational complexity, the constant comes from the average value of the subjects, meaning that the value might not be suitable for

Conclusions
This paper investigated the relationship between hip and knee angle trajectories during normal walking to form an algorithm that can dynamically generate natural walking gait patterns. In the lightweight microprocessor-control prosthetic leg prototype, we proposed to use a simple IMU to obtain the hip angle and an absolute encoder to obtain the current prosthetic knee angle as inputs for calculation. This study evaluated the overall prosthetic control system's performance using an adjustable-speed treadmill with a master-slave validation configuration. Such a master-slave validation configuration can be obtained by directly driving the thigh part of the prosthetic through a parallel four-bar linkage mechanism to synchronize with the able-bodied subject's motion. At the walking speeds of 50 cm/s, 60 cm/s, and 70 cm/s, the RMSE values of prosthetic knee angle tracking are 9.9 • , 11.3 • , and 13.0 • , respectively. However, the fabricated powered transfemoral prosthetic leg is a prototype used only for validation, and a higher walking speed results in a larger RMSE due to the saturation phenomenon resulting from the combination of a 1:22.4 speed reduction and a 15 mm ball screw pitch that limits the maximum speed of the prosthetic knee. Therefore, a revised powered prosthesis could be designed and fabricated in future work to improve the knee angle tracking performance. The initial knee angle difference (i.e., initial offset) could be given consideration to further reduce the RMSE during a small knee angle operation range. Moreover, implementing computational simulation for improving prosthesis legs could be a potential future work since its benefits compared to designing experimental tests.