A Power Assistant Algorithm Based on Human–Robot Interaction Analysis for Improving System Efﬁciency and Riding Experience of E-Bikes

: As robots are becoming more accessible in our daily lives, the interest in physical human– robot interaction (HRI) is rapidly increasing. An electric bicycle (E-bike) is one of the best examples of HRI, because a rider simultaneously actuates the rear wheel of the E-bike in close proximity. Most commercially available E-bikes employ a control methodology known as a power assistant system (PAS). However, this type of system cannot offer fully efﬁcient power assistance for E-bikes since it does not account for the biomechanics of riders. In order to address this issue, we propose a control algorithm to increase the efﬁciency and enhance the riding experience of E-bikes by implementing the control parameters acquired from analyses of human leg kinematics and muscular dynamics. To validate the proposed algorithm, we have evaluated and compared the performance of E-bikes in three different conditions: (1) without power assistance, (2) assistance with a PAS algorithm, and (3) assistance with the proposed algorithm. Our algorithm required 5.09% less human energy consumption than the PAS algorithm and 11.01% less energy consumption than a bicycle operated without power assistance. Our algorithm also increased velocity stability by 11.89% and acceleration stability by 27.28%, and decreased jerk by 12.36% in comparison to the PAS algorithm.


Introduction
Robots are becoming more prevalent in our society, not just in industrial fields but also in our daily lives [1]. Examples of robots in the latter category include robot vacuum cleaners, pet robots, service robots, drones, rescue robots, and so on. With easy accessibility to these robots, physical interaction between humans and robots has become a necessity, not an option.
Due to increasing demands for physical interaction between human and robots, the importance of human-robot interaction (HRI) technology has been gaining attention [2][3][4][5]. In general, HRI can be classified into two categories: remote interaction and proximate interaction [6]. Remote interaction is that in which the human and robot are separated spatially or even temporally, and proximate interaction is that in which the human and robot are co-located. In particular, proximate interaction is closely related to human-robot safety, which is particularly emphasized in transportation on roads, as with electric bicycles (E-bikes), autonomous cars, electric kickboards, etc. An E-bike is a system that requires close interaction between a human and a motor. By utilizing the hybrid actuation of human muscles and an in-wheel motor, the riding efficiency of cyclists can be enhanced. In addition, an E-bike is an environmentally friendly and healthy alternative to automobiles, making it a promising candidate for HRI transportation technology [7][8][9][10].
Various studies have been conducted on how to enhance the HRI of E-bikes in practical applications. Generally, PAS (Power Assistant System) control for E-bikes, as the name suggests, provides motor power assistance in proportion to the pedaling power. Thus, this method cannot assure efficient riding performance. To enhance the riding efficiency of E-bikes, various control methodologies have been introduced. Hatada et al. adopted a PAS to supplement human power during a periodic pedaling motion [11]. This PAS simply provides torque assistance to reduce human energy consumption by reducing the human effort required during cycling. Spagnol et al. developed a strategy for change in energy consumption that was dominated by the exercise protocol, not the crank length [12]. Hull and Gonzalez proposed an optimization method to minimize the required joint moment by optimizing the crank length with respect to the pedal velocity [13]. Danny and Williams also attempted to determine the optimal crank length to investigate the maximum force that the rider can exert and acquire increased crank power [14]. It should be noted that these studies were limited to enhancing the riding efficiency in terms of either human kinematics or motor energy. Greater motor energy is required to compensate for reduced human energy and vice versa. Thus, it is necessary to reduce both human energy consumption and motor energy consumption simultaneously to ensure high riding efficiency.
As mentioned above, previous studies have mainly focused on enhancing the riding efficiency of E-bikes with respect to leg kinematics without considering the effect of human muscular dynamics during cycling. Additionally, the human body is a highly complex system consisting of bones as rigid links and muscles as actuators. In order to evaluate the motion of this complex system, inertial measurement units should be used to measure the joint angle [15]. In addition, because muscle force is significantly influenced by variations in muscle length, velocity, and activation, riding efficiency cannot be determined solely from kinematic information. Even if human or motor energy consumption is reduced, it is difficult to ensure that the riding efficiency of E-bikes will be truly enhanced. Thus, it is crucial to consider muscular dynamics to ensure that the riding efficiency of E-bikes (including both human and motor efficiency) has been truly enhanced.
Furthermore, it is essential to note that E-bike use should not sacrifice the riding experience for the sake of higher riding efficiency. The higher efficiency of E-bike systems tends to be achieved at the cost of the riding experience, including considerations such as comfortability, safety, and jerk motions, which are typically underrated in the E-bike industry [16]. While previous studies have considered the comfortability (riding velocity stability) and safety (riding acceleration stability) of E-bikes in improving the riding experience [17][18][19], these studies do not appear to have either taken energy consumption into account or ensured the riding efficiency of E-bikes.
To address this trade-off problem, we propose a power assistant algorithm to not only increase the riding efficiency but also improve the riding experiences of E-bikes. The proposed algorithm consists of feedforward and feedback control. The feedback control is a simple PD (Proportional-Derivative) controller based on bike speed. Meanwhile, the feedforward controller is complemented by riding inefficiency, which is obtained from leg kinematics efficiency and muscular dynamics efficiency. Leg kinematics efficiency is calculated by the power transmission ratio from human joint power to crank power. Leg kinematics efficiency is used to determine the energy loss of human joints with respect to the crank angle as a result of the kinematic constraints of human legs. We should also consider muscular dynamics efficiency, which is calculated by the power transmission ratio from joint power with respect to muscle activation. Muscular dynamics efficiency is used to quantify the level of human energy consumption during muscle force generation at a specific crank angle. By considering human muscle parameters from both the leg kinematics and muscular dynamics perspectives, we can achieve enhanced riding efficiency while improving riding experience, by complementing riding inefficiency.
To build the proposed power assistant algorithm, we analyzed leg kinematics and muscular dynamics. A simulation environment was developed in MATLAB/Simulink (Mathworks, Inc.) using OpenSim API. To validate the concept, we built an E-bike testbed Sustainability 2021, 13, 768 3 of 18 using an in-wheel motor and a real-time controller. Finally, we conducted experiments to evaluate the net metabolic cost, riding experience (by considering the riding velocity and acceleration stability), and jerk associated with the use of our proposed algorithm versus the PAS algorithm and E-bike operation without a motor.
Section 2 describes the analysis of human dynamics performed with respect to muscular dynamics and leg kinematics. Section 3 explains the novel algorithm based on the analysis of Section 2. Experiments have been conducted between the proposed algorithm and the PAS algorithm, and Section 4 summarizes the results, and Section 5 presents the discussion and conclusions.

Human Analysis for E-Bikes
As mentioned previously, we define the E-bike as an HRI system consisting of a rider and a bike ( Figure 1). A human body exhibits highly nonlinear dynamics due to its complex articulations and muscular mechanics. Thus, to achieve mechanical harmony in a system combining a human and a robot, human analysis is essential to minimizing interference between a rider and a bike. As a result, we designed a novel algorithm to control the motor of the E-bike to ensure high efficiency and provide a good riding experience. (Mathworks, Inc.) using OpenSim API. To validate the concept, we built an E-bike testbed using an in-wheel motor and a real-time controller. Finally, we conducted experiments to evaluate the net metabolic cost, riding experience (by considering the riding velocity and acceleration stability), and jerk associated with the use of our proposed algorithm versus the PAS algorithm and E-bike operation without a motor. Section 2 describes the analysis of human dynamics performed with respect to muscular dynamics and leg kinematics. Section 3 explains the novel algorithm based on the analysis of Section 2. Experiments have been conducted between the proposed algorithm and the PAS algorithm, and Section 4 summarizes the results, and Section 5 presents the discussion and conclusions.

Human Analysis for E-Bikes
As mentioned previously, we define the E-bike as an HRI system consisting of a rider and a bike ( Figure 1). A human body exhibits highly nonlinear dynamics due to its complex articulations and muscular mechanics. Thus, to achieve mechanical harmony in a system combining a human and a robot, human analysis is essential to minimizing interference between a rider and a bike. As a result, we designed a novel algorithm to contro the motor of the E-bike to ensure high efficiency and provide a good riding experience. In this section, we analyze the human harmonic motion required for the highly effi cient cycling of an E-bike. The motion of the rider can be analyzed in terms of two biome chanical features: (1) joint kinematics and (2) muscular dynamics. Throughout the analy sis, we employed a "biomechanical efficiency" parameter to compare the kinematic and dynamic characteristics using the same dimension.

Leg Kinematics Efficiency
In this section, we define the leg kinematics efficiency, which represents the trans mission efficiency of human legs in terms of crank output at varying angles. The leg kin ematics efficiency is represented by the ratio of the crank power to the hip, knee, and ankle power of a person riding an E-bike. The leg kinematics efficiency can be expressed in the form of the equation below. In this section, we analyze the human harmonic motion required for the highly efficient cycling of an E-bike. The motion of the rider can be analyzed in terms of two biomechanical features: (1) joint kinematics and (2) muscular dynamics. Throughout the analysis, we employed a "biomechanical efficiency" parameter to compare the kinematic and dynamic characteristics using the same dimension.

Leg Kinematics Efficiency
In this section, we define the leg kinematics efficiency, which represents the transmission efficiency of human legs in terms of crank output at varying angles. The leg kinematics efficiency is represented by the ratio of the crank power to the hip, knee, and ankle power of a person riding an E-bike. The leg kinematics efficiency can be expressed in the form of the equation below. where η LK is the leg kinematics efficiency during the pedaling motion. P crank , P hip , P knee , and P ankle represent the power measured at the crank, hip joint, knee joint, and ankle joint, respectively. Each joint power is calculated by taking the absolute value of the eccentric motion. The eccentric motion is represented as a negative power when generating a muscle force to adjust the joint stiffness. Generally, negative power can be treated as power gain (or energy reservation) during pedaling, but this is not true for humans from a biomechanics perspective. Since a human exerts certain levels of muscle force to maintain the leg stiffness to hold the pedal in the desired position, negative power means that human muscle is using energy.
To calculate the joint power in each joint, we used a Jacobian matrix of a human leg to obtain the joint torque and velocity at human joints. Figure 2 illustrates the configuration of each joint and the corresponding parameters. The joint torques can be calculated as the sums of the joint motion torques and external load torques, as shown below: τ Joint is represented in vector form as [τ hip , τ knee , τ ankle ] T with respect to the joint motion torque, τ Motion , and the external load torque, τ ext . τ Motion can be expressed in the form of Equation (3).
In this Equation (3), A(q) represents the inertial matrix, B . q, q represents the Coriolis and centrifugal matrix, and G(q) represents the gravitational vector. These terms are calculated by Equations (4)- (6). In Equations (4)-(6), m i is scalar mass, and J is the Jacobian matrix containing J leg and J ω . J leg i is the Jacobian column vector of J leg , I i is the inertia matrix of legs, and J ω i is the rotational Jacobian of legs, J ω i = [0, 0, 1] T . Note that these terms are functions of the joint angle vectors q = q hip q knee q ankle T and joint velocity vectors The second term, τ ext , can be calculated from the pedal reaction force and the Jacobian matrix (Equation (7)) of human legs. τ ext is expressed in the form of Equation (8).
where x i , y i , z i , q i (i = hip, knee, ankle) are the position of the hip, knee, ankle, and corresponding joint angles, F ext is the pedal reaction force and J leg is the Jacobian matrix of the human leg, as shown in Figure 2. where , , , ( = ℎ , , ) are the position of the hip, knee, ankle, and corresponding joint angles, is the pedal reaction force and is the Jacobian matrix of the human leg, as shown in Figure 2.
To calculate the leg kinematics efficiency during the pedaling motion, we must first analyze the pedal force output. Because the angle of the pedal changes continuously with respect to the crank angle, the magnitude of the pedal force output in the tangential and radial directions varies constantly. The resulting tangential and radial force exerted on the single side of the pedal during pedaling, acquired from the sensory data, are shown in Figure 3. The sensory data (pedal force) were collected from a loadcell placed within the pedal, while riding the bike at 15 km/h and with constant load friction. The bike saddle was placed at 0.25 m horizontally and 0.70 m vertically from the crank. The magnitude of the pedal force depends on the and the tilt angle of the pedal. It should be noted that the pedal force exerted in the tangential direction is the dominant factor that determines the crank power. Thus, one may assume that the leg kinematics efficiency is highest near a crank angle of 90°. This would, however, not be entirely true without considering the force input at human joints. By inserting the data acquired during pedaling (i.e., pedaling force, pedaling angle, and pedaling velocity) into Equation (8), we can calculate the joint torques of the hip, knee, and ankle. The calculated joint torques are then used to derive the joint power, P Joint = P hip , P knee , P ankle , as shown in Equation (9).
To calculate the leg kinematics efficiency during the pedaling motion, we must first analyze the pedal force output. Because the angle of the pedal changes continuously with respect to the crank angle, the magnitude of the pedal force output in the tangential and radial directions varies constantly. The resulting tangential and radial force exerted on the single side of the pedal during pedaling, acquired from the sensory data, are shown in Figure 3. The sensory data (pedal force) were collected from a loadcell placed within the pedal, while riding the bike at 15 km/h and with constant load friction. The bike saddle was placed at 0.25 m horizontally and 0.70 m vertically from the crank. The magnitude of the pedal force depends on the F ext and the tilt angle of the pedal. It should be noted that the pedal force exerted in the tangential direction is the dominant factor that determines the crank power. Thus, one may assume that the leg kinematics efficiency is highest near a crank angle of 90 • . This would, however, not be entirely true without considering the force input at human joints.
Therefore, it is necessary to consider both the force output and the force input to derive the leg kinematics efficiency. The force data can be acquired by riding a normal bicycle without assistance, which is then computed into the OpenSim API. Then, the necessary parameters acquired via OpenSim API and the sensory data acquired to depict Figure 3 were computed into Equations (1)- (6) to derive the leg kinematics efficiency. The results are shown in Figure 4a. In contrast to Figure 3, we can observe that high leg kinematics efficiency is observed at crank angles of 164 • and 326 • . This is because both the hip and the knee are extended at 164 • and 326 • , resulting in legs with large moment arms. Because the legs function to convert joint power into crank power, the highest leg kinematics efficiency can be acquired with the largest moment arm. On the other hand, a low leg kinematics Sustainability 2021, 13, 768 6 of 18 efficiency is observed at crank angles of 23 • and 217 • . This is because of the antagonistic characteristics of pedaling. While one leg is exerting high pedaling force, the opposing leg exerts a minimal pedaling force to rotate the crank position only. Thus, a subsequent decrease in leg kinematic efficiency is observed, as shown in Figure 4a. Therefore, it is necessary to consider both the force output and the force input to derive the leg kinematics efficiency. The force data can be acquired by riding a normal bicycle without assistance, which is then computed into the OpenSim API. Then, the necessary parameters acquired via OpenSim API and the sensory data acquired to depict Figure 3 were computed into Equations (1)-(6) to derive the leg kinematics efficiency. The results are shown in Figure 4a. In contrast to Figure 3, we can observe that high leg kinematics efficiency is observed at crank angles of 164° and 326°. This is because both the hip and the knee are extended at 164° and 326°, resulting in legs with large moment arms. Because the legs function to convert joint power into crank power, the highest leg kinematics efficiency can be acquired with the largest moment arm. On the other hand, a low leg kinematics efficiency is observed at crank angles of 23° and 217°. This is because of the antagonistic characteristics of pedaling. While one leg is exerting high pedaling force, the opposing leg exerts a minimal pedaling force to rotate the crank position only. Thus, a subsequent decrease in leg kinematic efficiency is observed, as shown in Figure 4a.   Therefore, it is necessary to consider both the force output and the force input to derive the leg kinematics efficiency. The force data can be acquired by riding a normal bicycle without assistance, which is then computed into the OpenSim API. Then, the necessary parameters acquired via OpenSim API and the sensory data acquired to depict Figure 3 were computed into Equations (1)-(6) to derive the leg kinematics efficiency. The results are shown in Figure 4a. In contrast to Figure 3, we can observe that high leg kinematics efficiency is observed at crank angles of 164° and 326°. This is because both the hip and the knee are extended at 164° and 326°, resulting in legs with large moment arms. Because the legs function to convert joint power into crank power, the highest leg kinematics efficiency can be acquired with the largest moment arm. On the other hand, a low leg kinematics efficiency is observed at crank angles of 23° and 217°. This is because of the antagonistic characteristics of pedaling. While one leg is exerting high pedaling force, the opposing leg exerts a minimal pedaling force to rotate the crank position only. Thus, a subsequent decrease in leg kinematic efficiency is observed, as shown in Figure 4a.

Muscular Dynamics Efficiency
Previously, we analyzed the riding efficiency based on human leg kinematics only. However, to examine human inefficiency during pedaling motion, it is crucial to consider human muscular dynamics. To do so, we must analyze how much energy human muscles consume to produce active muscle force. According to Hill's model, active muscle force is determined by muscle length, velocity, and activation [20].
First of all, the muscle capability required to produce the maximum force is observed at the no-contraction state and gradually decreases as the muscle is shortened or lengthened. As shown in Figure 5, the muscle force tendency exhibits a symmetrical shape as muscles shorten and lengthen, with the highest muscle force occurring at a normalized muscle length of 1. For example, the isometric length (for a normalized length of (1)) of the quadriceps is observed when the knee joint angle is close to −30 • [21]. This is the range within which the crank angle changes from 60 • to 120 • , and in this range, the quadriceps can exert the highest muscle force. This implies that the capability of each muscle to produce its maximum muscle force depends on the crank angle.
However, to examine human inefficiency during pedaling motion, it is crucial to consider human muscular dynamics. To do so, we must analyze how much energy human muscles consume to produce active muscle force. According to Hill's model, active muscle force is determined by muscle length, velocity, and activation [20].
First of all, the muscle capability required to produce the maximum force is observed at the no-contraction state and gradually decreases as the muscle is shortened or lengthened. As shown in Figure 5, the muscle force tendency exhibits a symmetrical shape as muscles shorten and lengthen, with the highest muscle force occurring at a normalized muscle length of 1. For example, the isometric length (for a normalized length of (1)) of the quadriceps is observed when the knee joint angle is close to −30° [21]. This is the range within which the crank angle changes from 60° to 120°, and in this range, the quadriceps can exert the highest muscle force. This implies that the capability of each muscle to produce its maximum muscle force depends on the crank angle. Second, we must also consider the muscle velocity, which is another crucial factor in the accurate evaluation of the muscle force. Even when the muscle length and muscle activation are the same, the muscle force can vary with respect to the normalized muscle velocity, as shown in Figure 5. The normalized muscle force exhibits a sigmoid shape with the center positioned at a muscle velocity of 0. During muscle shortening, muscles contract to generate muscle force. Greater muscle force can be generated when the muscle velocity is low (when muscles contract slowly). When the muscle velocity is high (when muscles contract quickly), the muscle force decreases. Muscle lengthening occurs when a muscle is elongated by its antagonistic pair. Unlike muscle shortening, greater muscle force can be generated when the muscle velocity is high (when muscles lengthen quickly). This implies that the muscle force can vary with respect to pedaling velocity, even for the same crank angle.
Finally, it is necessary to consider muscle activation to evaluate the muscle force and energy consumption. Basically, human muscles are activated when the brain sends an ex- Second, we must also consider the muscle velocity, which is another crucial factor in the accurate evaluation of the muscle force. Even when the muscle length and muscle activation are the same, the muscle force can vary with respect to the normalized muscle velocity, as shown in Figure 5. The normalized muscle force exhibits a sigmoid shape with the center positioned at a muscle velocity of 0. During muscle shortening, muscles contract to generate muscle force. Greater muscle force can be generated when the muscle velocity is low (when muscles contract slowly). When the muscle velocity is high (when muscles contract quickly), the muscle force decreases. Muscle lengthening occurs when a muscle is elongated by its antagonistic pair. Unlike muscle shortening, greater muscle force can be generated when the muscle velocity is high (when muscles lengthen quickly). This implies that the muscle force can vary with respect to pedaling velocity, even for the same crank angle.
Finally, it is necessary to consider muscle activation to evaluate the muscle force and energy consumption. Basically, human muscles are activated when the brain sends an excitation signal to the muscles [21]. In general, both the muscle force and energy consumption increase in proportion to the muscle activation. This tendency can be observed in Figure 5, where the normalized muscle force increases with respect to the muscle activation. This implies that a human's capability to exert muscle force, along with energy consumption, can vary (even for the same crank position and velocity) depending on the level of muscle activation. The muscle activation can be expressed in the form of Equation (10).
where F muscle,current represents the current muscle force being exerted by the human and the F muscle,max is the maximum force that the human is capable of exerting. In summary, muscle force can vary with respect to pedaling velocity, even for the same crank angle, because of the muscle velocity. The muscle force may also vary for a given crank angle and pedaling velocity because of muscle activation. Among the three muscle parameters, muscle activation is the key factor that is directly related to both muscle force and energy consumption [19]. Once the muscles are activated, both thermal energy and mechanical energy are required to contract the muscles. When the muscles contract, the hip, knee, and ankle move to produce joint power. As a result, the muscular dynamics efficiency can be represented in the form of the following equation: where ∑ a Muscle is the sum of the muscle activation during pedaling.
After calculating the ∑ a Muscle using the musculoskeletal dynamics simulator OpenSim (by Simbios, Stanford, CA, USA) and MATLAB (Mathworks Inc., Natick, MA, USA), we simulated the muscular dynamics efficiency, as shown in Figure 4b [22]. When riding the E-bike, the activations of the hip, knee, and ankle flexor and extensor groups are used to derive the ∑ a Muscle [23,24], which are determined by the static optimization method in OpenSim. In this simulation, the most recent Lai Arnold Wakeling model was adopted for use in performing the musculoskeletal analysis [25]. Figure 4b shows η MD with respect to the corresponding crank angle. The muscular dynamics efficiency exhibits a wave form similar to that of the leg kinematics efficiency, but exhibits a different phase. This is because human muscles are coupled to one another when executing a pedaling motion. For instance, the quadriceps and hamstring are the large muscles that play a key role in executing the pedaling motion. To execute the pedaling motion, these muscles act antagonistically to move not only the hip joint but also the knee joint. Thus, the phase of the muscular dynamics may differ as a result of the activation of coupled muscles, regardless of the leg kinematics.

Overall Riding Efficiency Analysis
In the previous section, the leg kinematics and the muscular dynamics efficiencies involved in the pedaling motion, which are closely related to one another, were described. The activation process enables muscles to contract and generate joint power, which is then converted to crank power. Based on the correlation between leg kinematics and muscular dynamics, a human's overall riding efficiency η R,Bike can be expressed as a multiplication function of the leg kinematics efficiency η HK and the muscular dynamics efficiency η MD , as expressed in the form of Equation (12).
The sum of the muscle activation ∑ a Muscle is defined as the input, while the crank power P crank is defined as the output.
As mentioned in Section 2.2, the leg kinematics efficiency, and the muscular dynamics efficiency, although closely related to one another, exhibit different tendencies. There are two factors that determine the maximum force that the rider can exert at any crank angle: (1) the crank angle and (2) the cycling velocity. First, the length of the muscle is affected by the change in the crank angle. Second, the contraction speed of the muscle is affected by the change in cycling velocity. Thus, the maximum muscle force that the rider can exert at any crank angle changes continuously. The resulting leg kinematics efficiency and muscular dynamics efficiency, acquired previously in Figure 4, are illustrated in Figure 6 in comparison to the overall riding efficiency.
Due to their distinct characteristics, there is a clear difference between the two efficiencies, as shown in Figure 6a. The overall riding efficiency (the product of the leg kinematics and muscular dynamics efficiencies) is represented by the black line, and the leg kinematics efficiency is represented by the blue line. The overall bike efficiency exhibits a tendency that is similar to that of the muscular dynamics efficiency shown in Figure 6b, but very different from the kinematic efficiency. This tendency shows that the muscular dynamics efficiency has a more dominant effect on the overall riding efficiency. Thus, it is evident that we must consider not only the leg kinematics, but also the muscular dynamics when analyzing cycling activity.
affected by the change in the crank angle. Second, the contraction speed of the muscle is affected by the change in cycling velocity. Thus, the maximum muscle force that the rider can exert at any crank angle changes continuously. The resulting leg kinematics efficiency and muscular dynamics efficiency, acquired previously in Figure 4, are illustrated in Figure 6 in comparison to the overall riding efficiency.
Due to their distinct characteristics, there is a clear difference between the two efficiencies, as shown in Figure 6a. The overall riding efficiency (the product of the leg kinematics and muscular dynamics efficiencies) is represented by the black line, and the leg kinematics efficiency is represented by the blue line. The overall bike efficiency exhibits a tendency that is similar to that of the muscular dynamics efficiency shown in Figure 6b, but very different from the kinematic efficiency. This tendency shows that the muscular dynamics efficiency has a more dominant effect on the overall riding efficiency. Thus, it is evident that we must consider not only the leg kinematics, but also the muscular dynamics when analyzing cycling activity. Because the overall riding efficiency considers both the leg kinematics efficiency and the muscular dynamics efficiency, it can be utilized to compensate for the human inefficiency during the pedaling motion. By taking the inverse of the overall riding efficiency, we can derive the pedaling inefficiency, , = 1/ , , as shown in Figure 7. In contrast to the leg kinematics efficiency (high efficiency at 164° and 326°) and the muscular dynamics efficiency (high efficiency at 125° and 300°), a high overall riding efficiency is observed at crank angles of 103° and 284°. The lowest overall riding efficiency is observed at crank angles of 32° and 197°, while the leg kinematics efficiency and the muscular dynamics efficiency were lowest at 23° and 217° and 0° and 188°, respectively. Thus, it is evident that the human inefficiency cannot be solely determined from the leg kinematics alone, but also depends on the muscular dynamics. Note that the , can be calculated independently from the cycling velocity, as long as we know the muscle activation and the crank power. , represents the magnitude of muscle activation with respect to a unit of crank power. Because muscle activation serves as an indicator when evaluating human energy consumption [20], a greater , indicates that the rider has consumed more energy in exerting an equal muscle force. Therefore, we can visualize the riding efficiency and inefficiency from a human metabolic perspective rather than a kinematics perspective. Because the overall riding efficiency considers both the leg kinematics efficiency and the muscular dynamics efficiency, it can be utilized to compensate for the human inefficiency during the pedaling motion. By taking the inverse of the overall riding efficiency, we can derive the pedaling inefficiency, I R,Bike = 1/η R,Bike , as shown in Figure 7. In contrast to the leg kinematics efficiency (high efficiency at 164 • and 326 • ) and the muscular dynamics efficiency (high efficiency at 125 • and 300 • ), a high overall riding efficiency is observed at crank angles of 103 • and 284 • . The lowest overall riding efficiency is observed at crank angles of 32 • and 197 • , while the leg kinematics efficiency and the muscular dynamics efficiency were lowest at 23 • and 217 • and 0 • and 188 • , respectively. Thus, it is evident that the human inefficiency cannot be solely determined from the leg kinematics alone, but also depends on the muscular dynamics. Note that the η R,Bike can be calculated independently from the cycling velocity, as long as we know the muscle activation and the crank power. I R,Bike represents the magnitude of muscle activation with respect to a unit of crank power. Because muscle activation serves as an indicator when evaluating human energy consumption [20], a greater I R,Bike indicates that the rider has consumed more energy in exerting an equal muscle force. Therefore, we can visualize the riding efficiency and inefficiency from a human metabolic perspective rather than a kinematics perspective. Cycling inefficiency reflects both leg kinematics and muscular dynamics. The black line was fitted using a fifth-order Fourier transformation.

E-Bike Control Based on Human Inefficiency
The E-bike is a system that requires the hybrid actuation of human muscle and an inwheel motor to rotate a single-degree-of-freedom (1-DoF) wheel. In order to do so, the two actuators must work alongside one another in parallel to minimize cross interference. For instance, if an in-wheel motor exerts a large force in the range within which human muscles can perform at high efficiency, the human muscles would have to expend more effort to exert force due to the interference of the in-wheel motor. This is because human muscles need to counterbalance the instantaneous high pedal velocity output (interference) from the in-wheel motor, which requires the muscles to consume more energy as a result of the varying muscle velocity. To minimize the loss in riding efficiency along with the human muscle energy consumption, the in-wheel motor must actuate in the range within which the human muscles perform at low efficiency.
Based on an investigation of the human inefficiency region during the pedaling motion, we developed a new control algorithm to improve the efficiency and riding experience of the E-bike system that addresses the human part and the bike part. As mentioned in Section 1, the proposed algorithm consists of a feedback PD control based on a bike speed and a precalculated feedforward control, which is complemented by the riding inefficiency based on leg kinematics and muscular dynamics. The proposed control schematic for the motor input command is shown in Figure 8. The red box shows the muscular dynamics and leg kinematics of a human, and the blue box shows the motor control and dynamics. The feedforward and feedback motor control schemes are highlighted within the blue dotted line.

E-Bike Control Based on Human Inefficiency
The E-bike is a system that requires the hybrid actuation of human muscle and an in-wheel motor to rotate a single-degree-of-freedom (1-DoF) wheel. In order to do so, the two actuators must work alongside one another in parallel to minimize cross interference. For instance, if an in-wheel motor exerts a large force in the range within which human muscles can perform at high efficiency, the human muscles would have to expend more effort to exert force due to the interference of the in-wheel motor. This is because human muscles need to counterbalance the instantaneous high pedal velocity output (interference) from the in-wheel motor, which requires the muscles to consume more energy as a result of the varying muscle velocity. To minimize the loss in riding efficiency along with the human muscle energy consumption, the in-wheel motor must actuate in the range within which the human muscles perform at low efficiency.
Based on an investigation of the human inefficiency region during the pedaling motion, we developed a new control algorithm to improve the efficiency and riding experience of the E-bike system that addresses the human part and the bike part. As mentioned in Section 1, the proposed algorithm consists of a feedback PD control based on a bike speed and a precalculated feedforward control, which is complemented by the riding inefficiency based on leg kinematics and muscular dynamics. The proposed control schematic for the motor input command is shown in Figure 8. The red box shows the muscular dynamics and leg kinematics of a human, and the blue box shows the motor control and dynamics. The feedforward and feedback motor control schemes are highlighted within the blue dotted line.
First, we implemented a feedforward control associated with leg kinematics and muscular dynamics, based on the human biomechanical model in the red box. When a person drives a bike at the desired speed, the person activates their muscles to track the desired speed. As mentioned in Section 2, muscular dynamics efficiency, and then muscle activation, are needed to activate the muscle, and the necessary muscle activation for activating is transmitted from the brain as the excitation. This process was calculated in advance using experimental data using OpenSim API and MATLAB, because mathematical modeling is very complex and difficult.
For the feedforward control, we aim to improve the riding efficiency and riding experience by compensating for the inefficient pedaling range. Thus, we set the target range for the motor assistance based on I R,Bike , which is the measure of inefficiency, as mentioned in Section 2.3. Sustainability 2021, 13, x FOR PEER REVIEW 11 of 19 Figure 8. Schematic illustration of control algorithm showing block diagram of E-bike velocity control for human-robot interaction (left) and motor control algorithm strategy (right). vdes, vact, and verr represent the E-bike's desired velocity, actual velocity, and velocity error, respectively. Pjoint is the leg joint power; τHuman is the human cycling torque; τcmd is the motor command torque; icmd is the current input for torque command; τmotor is the actual motor torque; crank and ̇c rank are the crank angle and crank angular velocity, respectively; Pcrank is the crank power which is the product of τHuman and ̇c rank; kAl is the control gain for the proposed algorithm; and IR,Bike is the human energy rate for equal cycling power.
First, we implemented a feedforward control associated with leg kinematics and muscular dynamics, based on the human biomechanical model in the red box. When a person drives a bike at the desired speed, the person activates their muscles to track the desired speed. As mentioned in Section 2, muscular dynamics efficiency, and then muscle activation, are needed to activate the muscle, and the necessary muscle activation for activating is transmitted from the brain as the excitation. This process was calculated in advance using experimental data using OpenSim API and MATLAB, because mathematical modeling is very complex and difficult.
For the feedforward control, we aim to improve the riding efficiency and riding experience by compensating for the inefficient pedaling range. Thus, we set the target range for the motor assistance based on , , which is the measure of inefficiency, as mentioned in Section 2.3.
In calculating the , for the proposed feedforward control, ∑ and are crucial parameters that affect human energy consumption during cycling. However, with respect to control, it is very complicated to employ ∑ in real-time as a control parameter, unlike . This is because ∑ must be calculated from the static optimization process in OpenSim. Practically, was not used in static optimization, because it could not be measured. To solve this problem, we used the pre-measured data by requesting the subjects to ride the bike at the desired velocity of 15 km/h. Since the subjects conducted the pedaling motion at the required speed, we can consider the pedaling data as being obtained from conducting the human parts of Figure 8. The static optimization requires a substantial amount of time because the skeletal model, the number of muscles, the pedaling force, the pedaling power and the joint angle of the leg, etc., must be considered. In short, ∑ is not suitable for use as a real-time control parameter in the proposed algorithm.
To solve this problem, we employed a methodology to estimate the human inefficiency , without having to use ∑ . We measured and analyzed the pedaling force, the crank power, the crank angle, and the pedal angle for pedaling with and without the in-wheel motor for five subjects. The magnitudes of the overall riding efficiency differed for the five subjects because of their different muscle characteristics (length, strength, etc.). Although the subjects differed in their overall riding efficiency, the five subjects exhibited similar tendencies in terms of their overall riding efficiency with equal riding conditions (i.e., 15 km/h bike velocity, constant load friction, etc.). We thus con- . v des , v act , and v err represent the E-bike's desired velocity, actual velocity, and velocity error, respectively. P joint is the leg joint power; τ Human is the human cycling torque; τ cmd is the motor command torque; i cmd is the current input for torque command; τ motor is the actual motor torque; θ crank and . θ crank are the crank angle and crank angular velocity, respectively; P crank is the crank power which is the product of τ Human and . θ crank ; k Al is the control gain for the proposed algorithm; and I R,Bike is the human energy rate for equal cycling power.
In calculating the I R,Bike for the proposed feedforward control, ∑ a Muscle and P Crank are crucial parameters that affect human energy consumption during cycling. However, with respect to control, it is very complicated to employ ∑ a Muscle in real-time as a control parameter, unlike P Crank . This is because ∑ a Muscle must be calculated from the static optimization process in OpenSim. Practically, v err was not used in static optimization, because it could not be measured. To solve this problem, we used the pre-measured data by requesting the subjects to ride the bike at the desired velocity of 15 km/h. Since the subjects conducted the pedaling motion at the required speed, we can consider the pedaling data as being obtained from conducting the human parts of Figure 8. The static optimization requires a substantial amount of time because the skeletal model, the number of muscles, the pedaling force, the pedaling power and the joint angle of the leg, etc., must be considered. In short, ∑ a Muscle is not suitable for use as a real-time control parameter in the proposed algorithm.
To solve this problem, we employed a methodology to estimate the human inefficiency I R,Bike without having to use ∑ a Muscle . We measured and analyzed the pedaling force, the crank power, the crank angle, and the pedal angle for pedaling with and without the in-wheel motor for five subjects. The magnitudes of the overall riding efficiency differed for the five subjects because of their different muscle characteristics (length, strength, etc.). Although the subjects differed in their overall riding efficiency, the five subjects exhibited similar tendencies in terms of their overall riding efficiency with equal riding conditions (i.e., 15 km/h bike velocity, constant load friction, etc.). We thus concluded that the human inefficiency can be estimated from the experimental data. The estimated I R,Bike curve was derived using a fifth-order Fourier transformation and is shown in Figure 6 as a black line plotted with respect to the crank angle.
Second, we implemented the feedback control to maintain the desired bike velocity. Because bike velocity changes dynamically, we used a proportional-derivative (PD) controller to prevent overshoot. Feedforward control alone may not be able to maintain the desired velocity, because feedforward control cannot control the rider's velocity accurately.
The proposed control algorithm not only enhances efficiency, but also improves the riding experience. This is because the proposed algorithm prevents an abrupt change in bike velocity and acceleration, whilst reducing human energy consumption, when riding an E-bike. The overall control schematic is depicted in Figure 8. Section 3 describes how the evaluation metrics were used to evaluate the proposed algorithm.

Experimental Setup
An E-bike testbed, shown in Figure 9, was developed to evaluate the performance of the proposed control algorithm. A real-time operational system (RTOS)-embedded Linux PC (STEP PC2, Neuromeka, Inc., Seoul, Republic of Korea) was used with an EPOS4 motor driver (Maxon Motor, Inc., Sachseln, Switzerland) to control the in-wheel motor, the AKM-85SX 250W brushless DC motor (Aikema Electric, Inc., Suzhou City, China). The inwheel motor generates torque at the rear wheel of the E-bike. A bike power measurement device was set up to measure the bike power and apply an external load to the wheel. The external load of 19.8 N*m was induced onto the pedal to match the outdoor road friction condition to that of our testbed. This value was acquired by the smart pedal while riding our E-bike outdoors on a concrete road with minimal slope. The designed smart pedal was composed of a 6six-axis Force/Torque sensor, an inertial measurement unit (IMU), a Bluetooth module, and a Teensy data acquisition board (PJRC). The primary function of the smart pedal was to measure the horizontal and vertical components of the pedal force and pedal angle. The measured data were transmitted via Bluetooth communication and processed by the Teensy board. We also measured the human metabolic cost by employing a K5 mask (COSMED, Inc., Roma, Italy) to evaluate the human energy consumption. desired velocity, because feedforward control cannot control the rider's velocity accu-rately.
The proposed control algorithm not only enhances efficiency, but also improves the riding experience. This is because the proposed algorithm prevents an abrupt change in bike velocity and acceleration, whilst reducing human energy consumption, when riding an E-bike. The overall control schematic is depicted in Figure 8. Section 3 describes how the evaluation metrics were used to evaluate the proposed algorithm.

Experimental Setup
An E-bike testbed, shown in Figure 9, was developed to evaluate the performance of the proposed control algorithm. A real-time operational system (RTOS)-embedded Linux PC (STEP PC2, Neuromeka, Inc., Seoul, Republic of Korea) was used with an EPOS4 motor driver (Maxon Motor, Inc., Sachseln, Switzerland) to control the in-wheel motor, the AKM-85SX 250W brushless DC motor (Aikema Electric, Inc., Suzhou City, China). The inwheel motor generates torque at the rear wheel of the E-bike. A bike power measurement device was set up to measure the bike power and apply an external load to the wheel. The external load of 19.8 N*m was induced onto the pedal to match the outdoor road friction condition to that of our testbed. This value was acquired by the smart pedal while riding our E-bike outdoors on a concrete road with minimal slope. The designed smart pedal was composed of a 6six-axis Force/Torque sensor, an inertial measurement unit (IMU), a Bluetooth module, and a Teensy data acquisition board (PJRC). The primary function of the smart pedal was to measure the horizontal and vertical components of the pedal force and pedal angle. The measured data were transmitted via Bluetooth communication and processed by the Teensy board. We also measured the human metabolic cost by employing a K5 mask (COSMED, Inc., Roma, Italy) to evaluate the human energy consumption.  Five healthy male adults (height, 178.6 ± 5.3 cm; weight, 80.8 ± 7.0 kg; age, 27.8 ± 1.8 years; mean ± SD) were recruited for this experiment. The experimental protocol was approved and regulated by the Chung-Ang University Institutional Review Board (IRB 1041078-201812-HR-229-01). None of the subjects had any history of musculoskeletalrelated impairments or surgical operations that might have affected cycling activity. Details of the subjects are shown in Table 1. For the 5-min experiments conducted, the riding velocity was set to 15 km/h. This speed was based on the average bike speed in urban areas. The selected bike velocity of 15 km/h is an important criterion in evaluating the riding experience of each algorithm during the 5-min experiments. Due to the applied external load, the riders were unable to ride further after the 5-min experiment, thus the riding time was regulated to 5 min to prevent fatigue/injury of the riders. After the riders performed the 5-min experiment, they required at least a 15 min break until their metabolic signs were back to the stable sign again (within the COSMED software). Motor power was restricted to 40 W so that the motor could exert a crank torque up to 6.5 Nm at a bike velocity of 15 km/h, which is equivalent to 25% of the required crank torque. Restriction of the motor power was necessary because using an excessive motor power would result in E-bike operation with motor power rather than manpower. Table 2 summarizes the algorithms we compared and their experimental conditions. There was no change in the slope and external load conditions based on the assumption that the majority of the bike riders prefer to ride their E-bike within the urban or rural area, where slope and road conditions are relatively uniform, and not within the off-road areas with extreme road conditions (e.g., mountain bike). We evaluated the performance of the E-bike for three cases: (1) without a motor (human powered), (2) with the PAS algorithm, and (3) with the proposed algorithm. The PAS algorithm was chosen for comparison because it is the algorithm most commonly employed with commercial E-bikes [11]. The PAS algorithm commands motor torque in proportion to the instantaneous human torque. The P gains for the PAS and the proposed algorithm were set to 4 and 5, respectively. The D gain was set to 0.01 for the proposed algorithm. Since participants were instructed to maintain a constant bike velocity of 15 km/h based on the sensory data, and similar pedaling torque was observed during the experiment for all five subjects. Thus, the same control gains can be applied to each of the subjects. To evaluate performance for the three cases, we evaluated the net metabolic cost, E-bike system energy, riding experience, and riding jerk.

Net Metabolic Cost and Energy Consumption
We compared the net metabolic cost for each case. Figure 10a shows the net metabolic cost data collected during the 5-min experiments. The case without a motor had the highest net metabolic cost of the three cases because the bike was driven by 100% manpower. The net metabolic cost in the PAS case was 6.24% (p = 0.0409) lower than in the case without a motor. The proposed algorithm demonstrated improved performance, as the net metabolic cost was reduced by 11.01% (p = 0.0007) in comparison to that of the case without a motor, and by 5.09% (p = 0.0407) in comparison to the PAS algorithm case. From these results, we conclude that the proposed algorithm successfully reduces human energy consumption by compensating for the human inefficiency. Figure 10b shows the total energy consumption of the human and the motor while cycling. The PAS algorithm aids the rider during pedaling as the motor provides additional rear wheel torque by feedback control. The total energy consumption in the PAS case (518.8 W) was observed to be higher than in the case without a motor (509.1 W). This is because the PAS algorithm does not account for human inefficiency and requires the rider to respond to abrupt changes in pedaling velocity due to the assisted torque. Consequently, there is a sudden increase in muscle velocity, and the rider needs to use more energy. The proposed algorithm, however, consumes less energy (493.9 W), as the assisted torque is provided in the inefficient pedaling range of the human. Therefore, it is necessary to consider both the leg kinematics and the muscular dynamics efficiencies to effectively reduce the energy consumption.

Net Metabolic Cost and Energy Consumption
We compared the net metabolic cost for each case. Figure 10a shows the net metabolic cost data collected during the 5-min experiments. The case without a motor had the highest net metabolic cost of the three cases because the bike was driven by 100% manpower. The net metabolic cost in the PAS case was 6.24% (p = 0.0409) lower than in the case without a motor. The proposed algorithm demonstrated improved performance, as the net metabolic cost was reduced by 11.01% (p = 0.0007) in comparison to that of the case without a motor, and by 5.09% (p = 0.0407) in comparison to the PAS algorithm case. From these results, we conclude that the proposed algorithm successfully reduces human energy consumption by compensating for the human inefficiency.  Figure 10b shows the total energy consumption of the human and the motor while cycling. The PAS algorithm aids the rider during pedaling as the motor provides additional rear wheel torque by feedback control. The total energy consumption in the PAS case (518.8 W) was observed to be higher than in the case without a motor (509.1 W). This is because the PAS algorithm does not account for human inefficiency and requires the rider to respond to abrupt changes in pedaling velocity due to the assisted torque. Consequently, there is a sudden increase in muscle velocity, and the rider needs to use more energy. The proposed algorithm, however, consumes less energy (493.9 W), as the assisted torque is provided in the inefficient pedaling range of the human. Therefore, it is necessary to consider both the leg kinematics and the muscular dynamics efficiencies to effectively reduce the energy consumption.

Riding Experience
We compared both the riding velocity and the acceleration stability achieved in the different cases to evaluate the riding experience. Velocity stability can be a measure of how comfortable the riding experience is, based on the instantaneous velocity during cycling [16][17][18]. When the velocity reduces during cycling, the rider must exert an effort to speed up the E-bike, thus causing discomfort during cycling. Velocity stability is assessed by determining the ratio between the number of velocity measurements that fall within the boundary and the total number of velocity measurements. The boundary is based on an average velocity of 15 km/h (the average bike velocity within the urban area), with a ±2 km/h deviation band [26][27][28].

Riding Experience
We compared both the riding velocity and the acceleration stability achieved in the different cases to evaluate the riding experience. Velocity stability can be a measure of how comfortable the riding experience is, based on the instantaneous velocity during cycling [16][17][18]. When the velocity reduces during cycling, the rider must exert an effort to speed up the E-bike, thus causing discomfort during cycling. Velocity stability is assessed by determining the ratio between the number of velocity measurements that fall within the boundary and the total number of velocity measurements. The boundary is based on an average velocity of 15 km/h (the average bike velocity within the urban area), with a ±2 km/h deviation band [26][27][28].
Acceleration stability is another crucial factor that reflects how safe the rider feels during cycling [17][18][19]. It is a measure of the riding instability, based on instantaneous acceleration and deceleration, which may cause riding imbalance or road accidents. Acceleration stability is determined based on the bike acceleration bounds of −0.4 to 0.4 rad/s 3 [16].
In order to evaluate the riding experience, we conducted experiments to measure the bike velocity and acceleration in each case with respect to the riding distance and subject, as shown in Figure 11. If the bike velocity and acceleration fall within the range bounded by the dashed black lines, high velocity and acceleration stability can be achieved.
Using these data, we calculated velocity and acceleration stability as the proportions of data that fell within the defined boundaries in Table 3. The higher the ratio is, the higher the E-bike is within the velocity and acceleration threshold. The results show that the proposed algorithm achieved a greater riding experience (in both velocity and acceleration stability perspective) than the PAS algorithm. The PAS algorithm achieves relatively low velocity stability because the velocity of the E-bike suddenly increases as the motor provides excessive assistant torque when in the high efficiency range of human pedaling, resulting in inevitable interference between the human and the motor. This effect is closely related to riding efficiency because a sudden increase in velocity results in a sudden increase in muscle length. When this happens, the muscle does not have enough time to provide sufficient muscle force and the overall riding efficiency dramatically decreases. As a result, the rider feels great discomfort during the pedaling motion. It is noted that acceleration stability in this paper has relatively low values when compared to the results in Refs. [17][18][19]. It is observed that our bike's power measurement device could induce a high rolling friction on the wheels, and might cause sudden acceleration spikes, which can increase deviation. Acceleration stability is another crucial factor that reflects how safe the rider feels during cycling [17][18][19]. It is a measure of the riding instability, based on instantaneous acceleration and deceleration, which may cause riding imbalance or road accidents. Acceleration stability is determined based on the bike acceleration bounds of −0.4 to 0.4 rad/s 3 [16].
In order to evaluate the riding experience, we conducted experiments to measure the bike velocity and acceleration in each case with respect to the riding distance and subject, as shown in Figure 11. If the bike velocity and acceleration fall within the range bounded by the dashed black lines, high velocity and acceleration stability can be achieved. Figure 11. Bike velocity and bike acceleration for the five subjects. Based on the data shown in this figure, we calculated velocity and acceleration stability. The dashed black lines and gray shading indicate thresholds for velocity and acceleration stability. Velocity stability is a factor related to determining the rate of instantaneous velocity. Acceleration stability is a factor related to determining the rate of instantaneous acceleration. The ratios of velocity and acceleration stability were evaluated based on the amount of acquired data within the threshold limits relative to the total data acquired.
Using these data, we calculated velocity and acceleration stability as the proportions of data that fell within the defined boundaries in Table 3. The higher the ratio is, the higher the E-bike is within the velocity and acceleration threshold. The results show that the proposed algorithm achieved a greater riding experience (in both velocity and acceleration stability perspective) than the PAS algorithm. The PAS algorithm achieves relatively low velocity stability because the velocity of the E-bike suddenly increases as the motor provides excessive assistant torque when in the high efficiency range of human pedaling, resulting in inevitable interference between the human and the motor. This effect is closely related to riding efficiency because a sudden increase in velocity results in a sudden increase in muscle length. When this happens, the muscle does not have enough time to provide sufficient muscle force and the overall riding efficiency dramatically decreases. As a result, the rider feels great discomfort during the pedaling motion. It is noted that acceleration stability in this paper has relatively low values when compared to the results in Refs. [17][18][19]. It is observed that our bike's power measurement device could induce a high rolling friction on the wheels, and might cause sudden acceleration spikes, which can increase deviation. Figure 11. Bike velocity and bike acceleration for the five subjects. Based on the data shown in this figure, we calculated velocity and acceleration stability. The dashed black lines and gray shading indicate thresholds for velocity and acceleration stability. Velocity stability is a factor related to determining the rate of instantaneous velocity. Acceleration stability is a factor related to determining the rate of instantaneous acceleration. The ratios of velocity and acceleration stability were evaluated based on the amount of acquired data within the threshold limits relative to the total data acquired. On the other hand, riding without a motor results in velocity and acceleration stability levels similar to those achieved with the proposed algorithm. However, as shown in Figure 10, the total energy associated with the proposed algorithm is lower than that associated with the case without a motor. Therefore, we conclude that the proposed algorithm can provide a rider with velocity and acceleration stability similar to that achievable without a motor, while consuming less energy. Overall, energy consumption can be minimized by compensating for the human inefficient range in pedaling. As a result, minimal interference between the two actuators (human muscles and the motor) can be achieved by maximizing the muscles' efficiency, while utilizing the motor's torque assistance in the inefficient range only.

Crank Jerk
The last criterion to be evaluated is the crank jerk, which is a measure of crank motion smoothness during pedaling. High crank jerk may cause discomfort to the rider as a result of a loss in kinetic energy transmission from the human to the bike, and may require more effort for the rider to transmit crank power [29]. Second, a high jerky motion causes disturbance during pedaling, and results in faster muscle fatigue for the rider [30].
Based on the experimental conditions described in Section 4.1, we analyzed the crank jerk during pedaling. Figure 12 shows the crank jerk for the five subjects for each case during 5-min experiments. As Figure 12a shows, by compensating for human inefficiency during pedaling, the proposed algorithm results in smaller crank jerks than the PAS algorithm does. This is consistent with the results shown in Figure 9. As mentioned before, jerky motions cause kinetic energy loss and muscle fatigue. As such, the amount of energy consumed with the PAS algorithm tends to be higher because of the larger jerky motions it produces.

Crank Jerk
The last criterion to be evaluated is the crank jerk, which is a measure of crank motion smoothness during pedaling. High crank jerk may cause discomfort to the rider as a result of a loss in kinetic energy transmission from the human to the bike, and may require more effort for the rider to transmit crank power [29]. Second, a high jerky motion causes disturbance during pedaling, and results in faster muscle fatigue for the rider [30].
Based on the experimental conditions described in Section 4.1, we analyzed the crank jerk during pedaling. Figure 12 shows the crank jerk for the five subjects for each case during 5-min experiments. As Figure 12a shows, by compensating for human inefficiency during pedaling, the proposed algorithm results in smaller crank jerks than the PAS algorithm does. This is consistent with the results shown in Figure 9. As mentioned before, jerky motions cause kinetic energy loss and muscle fatigue. As such, the amount of energy consumed with the PAS algorithm tends to be higher because of the larger jerky motions it produces.  However, the proposed algorithm resulted in a relatively higher crank jerk for Subject 2 than was observed without a motor. This is because Subject 2 was not satisfied with the saddle shape and felt discomfort throughout the experiment, which influenced the crank jerk. The other subjects experienced relatively low crank jerk when riding the E-bike operated with the proposed algorithm. As a result, an average crank jerk reduction of 12.36% was observed relative to operation with the PAS algorithm. The results are shown in Figure 12b.

Discussion
In this paper, in order to address this problem associated with the PAS algorithm, we propose a new control algorithm intended to enable highly efficient pedaling and provide an enhanced riding experience for the rider. We conducted analyses of human leg kinematics and muscular dynamics during bike pedaling using MATLAB and OpenSim. In this analysis process, we defined a term referred to as the overall riding efficiency, η R,Bike , based on the muscle activation concept. For the proposed motor control algorithm, both feedforward and feedback control are used to enhance the system efficiency. While feedforward control compensates for the I R,Bike , feedback control maintains a consistent bike velocity. For the purpose of real-time control, pedaling inefficiency based on muscular dynamics and leg kinematics were predicted using a fifth-order Fourier transformation.
In order to evaluate the proposed control algorithm, we compared its performance with that of the PAS algorithm. The human energy consumption associated with our algorithm was 5.09% lower than that with the PAS algorithm and 11.04% lower than that without a motor. The total average energy consumption associated with the proposed algorithm (493.9 W) was lower than that with PAS (518.8 W) and without a motor. In addition, the proposed algorithm achieved an 11.9% higher velocity stability and a 27.28% higher acceleration stability than PAS.
These results demonstrate that the proposed algorithm makes an E-bike system more efficient, while providing enhanced velocity and acceleration stability. The proposed algorithm also produces 12.36% lower jerk than PAS, which suggests that the proposed algorithm reduces muscle fatigue and energy transmission loss by improving the smoothness of pedaling. These results were possible because our algorithm successfully aids pedaling within the inefficient range and performs velocity feedback effectively.
The proposed approach can enhance the riding efficiency of E-bikes while consuming less energy by minimizing the interference in a system in which a human and robot work in close proximity. The current work with our bike measurement device can generate limited friction conditions, and thus various road conditions, such as gravel, dirt, steep roads, etc., are not fully reflected in the results reported here. In future work, we plan to evaluate the performance of the proposed algorithm in various environments and adjust the control parameters accordingly.

Conclusions
With the growing interest in HRI, the use of robots for both industrial and household applications is increasing rapidly. Among the many applications of HRI, those involving proximate interaction are tasks that involve physical interaction between humans and robots. Safety is the utmost concern for this type of application. Some examples of proximate interaction are E-bikes, autonomous vehicles, and electric scooters. E-bikes have been gaining attention as eco-friendly vehicles for urban transportation. For this reason, E-bikes are widely used in densely populated areas in Europe, China, and other places around the world.
However, the PAS algorithm used for E-bikes does not account for the characteristics of the muscles during the phases of pedaling. Instead, it provides assistance to the rider in the high-efficiency pedaling range. As a result, interference between the human operator and the motor is inevitable. As a result of this inefficient actuation, excessive energy consumption is required for human muscles to compensate for the interference.
Because our approach was developed on the basis of human analysis, the application is not limited to E-bike systems but rather can also be extended to numerous types of systems that involve close physical human-robot interaction, such as smart factory robots, kitchen robots, social robots, and others.