{'fraction_non_alphanumeric': 0.032173119541128926, 'fraction_numerical': 0.015121887628731586, 'mean_word_length': 4.663910218546958, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Biomechanical knee energy harvester: Design optimization and testing

Biomechanical energy harvesters are designed to generate electrical energy from human locomotion (e.g., walking) with minimal or no additional effort by the users. These harvesters aim to carry out the work of the muscles during phases in locomotion where the muscles are acting as brakes. Currently, many harvesters focus on the knee joint during late swing, which is only one of three phases available during the gait cycle. For the device to be successful, there is a need to consider design components such as the motor/generator and the gear ratio. These components influence the amount of electrical energy that could be harvested, metabolic power during harvesting, and more. These various components make it challenging to achieve the optimal design. This paper presents a design of a knee harvester with a direct drive that enables harvesting both in flexion and extension using optimization. Subsequently, two knee devices were built and tested using five different harvesting levels. Results show that the 30% level was the best, harvesting approximately 5 W of electricity and redacting 8 W of metabolic energy compared to walking with the device as a dead weight. Evaluation of the models used in the optimization showed a good match to the system model but less for the metabolic power model. These results could pave the way for an energy harvester that could utilize more of the negative joint power during the gait cycle while reducing metabolic effort.


Introduction
Biomechanical energy harvesters are exoskeletons designed to generate electrical energy from human locomotion (e.g., walking) and provide an alternative to batteries as an electrical power source for portable electronics (GPS, laptops, etc.). Many current harvesting devices aim to carry out part of the work of the muscles during phases in human locomotion where the muscles are acting as brakes (i.e., negative muscle work) (Donelan et al., 2008), (Niu et al., 2004), see Figure 2. This leads to regenerative braking, which generates electrical energy in a similar way to a hybrid car and may reduce the user's effort. For energy-harvesting devices to be useful, it is important that the addition of effort (metabolic rate) required to carry the device on the body and to generate electrical energy is minimal or negative (Schertzer and Riemer, 2015).
While the exact conditions required for achieving harvesting while reducing metabolic energy are unknown, there where evidence in the past that this is possible (Donelan et al., 2008), (Shepertycky and Li, 2015). Further, a recently developed energy harvester utilized late swing to produce 0.25 W of electrical energy while reducing the metabolic energy (relative to walking with no device) by 6 W (Shepertycky et al., 2021). There could be several types of biomechanical energy; the main ones are a backpack that uses the oscillation of the center of mass, a shoe base that uses sole compression to generate electrical energy, and a joint base that uses the relative motion between the segments (Riemer and Shapiro, 2011). Currently, the most successful harvesters are devices that target negative muscle work performed at the knee, as this is a joint with a relatively large amount of negative work performed at that location ( Figure 2). However, current knee devices [(Donelan et al., 2008), (Shepertycky and Li, 2015), (Shepertycky et al., 2021)] are focused on the late swing (end on K4), which means that they can only make use of less than half of the potential energy that could be harvested during a full gait cycle (Riemer and Shapiro, 2011). Moreover, the ability of these devices in harvesting is limited, due to their mechanical design, which uses a roller clutch (Donelan et al., 2008) or a combination of a roller clutch and cable (Shepertycky and Li, 2015;Shepertycky et al., 2021). In this context, they can harvest only at the flexion of the knee.
During device design, several parameters must be considered. First, the device must be attached to the body, and carrying its mass requires additional metabolic power from the user. The metabolic rate required to carry the device is based on the user's walking speed and the device's mass and location (Browning et al., 2007)- (Schertzer and Riemer, 2014) (Stuempfle et al., 2004;Soule and Goldman, 1969). Other important design components and their specifications include the motor/ generator and the gear ratio. (Note that since the electrical motor is also used as the generator in this study, we use these terms interchangeably). All the aforementioned components have an effect on the other components as well as on the overall performance. Further, some of the design parameters improve the device in one domain, but make it worse in another. For example, the combination of gear, motor, and current determine the resistance torque of the device; a higher gear ratio may produce more electricity, but it might lower the conversion efficiency of the system due to increased friction (higher gear ratios are less efficient). Further, a higher gear ratio will increase the inertia and require more effort from users, especially in non-harvesting phases of the gait. Harvesting more electrical energy will increase the applied torque and forces working on the system, which affects the stress on the structure, its dimensions and mass. All of the above make the task of finding the optimal design challenging.
To address this issue, Li et al. (2009) used a static model (i.e., one that did not include system dynamics) to optimize device efficiency as a function of the gear ratio and the external electrical load of the motor. However, they found that dynamic effects can account for as much as half of the resistance torque applied by the device, which means that the device parameters chosen by their optimization might not have been optimal. Martin et al. (2016) proposed a model that included dynamic effects for a lower limb-driven energy harvester. However, they did not suggest a framework for optimizing the design parameters of the harvester.
The aim of this study is to design and build a knee energyharvesting device that could generate electricity during joint mechanical negative work phases of the gait, both at flexion and extension. To achieve the best design, we used an optimization process that considers the design parameters of our device, such as the generator's electrical specification, mass, and gear ratio. The optimization framework was based on a dynamic model of the electromechanical system. Further, we were able to control the torque applied to the knee by the device using technology from our previous study (Cervera et al., 2016). The optimization objective is to minimize the total cost of harvesting (TCOH), which consists of the change in metabolic power when walking with the device vs. without it divided by the electrical power produced (Shepertycky and Li, 2015).

Overview
The design of the device entailed the following steps 1) Conceptual design of the system, 2) Optimization to minimize the total cost of harvesting, and 3) Calculation of the TCOH using three models. The models were a) a) Model for the electrical power generated during the system's operation b) A dynamic model of the electromechanical system, including prediction of the device's applied torque profile; and c) A prediction model for the change in the metabolic power as a function of the device's mass, location on the body, and torque.

Conceptual design of device
The device is based on a gear train that increases the angular velocity of the knee to rotate a brushless DC motor (functioning as an electrical generator). The apparatus of the harvesting device is mounted on an orthopedic knee brace (Figure 1). Using a micro-controller, the device controls the torque applied to the knee, which in turn controls the amount of energy to be harvested (Cervera et al., 2016). To reduce the metabolic cost of carrying the device, the gear and generator are located as high as possible on the thigh. Energy harvesting occurs during negative joint work periods, specifically during phases K1, K3, and K4 of the gait cycle ( Figure 2). To enable harvesting during both knee flexion and extension, the motor is connected with no clutch mechanism (direct drive). We also tested an option for two oppositely oriented roller clutches that could enable harvesting in both directions, but similar to (Donelan et al., 2008), we found that this design was too heavy.

Objective function
The objective function is to minimize the total cost of harvesting (TCOH, where the optimization parameters are the generator model (from a list of possible generators), the gear ratio, and the torque/ current profile. The general optimization formula is where c k (v) ≥ 0 and k ∈ I are inequality constraints representing the physical limitations of the electromechanical system and the user's ability, respectively, and ] is a vector of optimization variables (i.e., torque/current profile, gear ratio, and motor model). The TCOH is defined as where ΔP met is the estimated additional metabolic rate for using the harvester relative to the metabolic rate during walking without the device, defined in (14), and P eff is the effective harvested electric power, defined in (3).

Models
This section describes the mathematical derivation of the three models: 1) system power model, 2) system torque model,

FIGURE 1
General mechanical design of the harvesting device mounted on the knee brace.

FIGURE 2
The mechanics of the knee joint during a walking gait cycle from heel strike to heel strike. The shaded areas (i.e., K1, K3, and K4) are the phases of negative net muscle work at joint level [based on (Winter, 2009)].
Frontiers in Robotics and AI frontiersin.org 03 and 3) change in metabolic rate due to carrying the device and change in the net joint work [based on (Margaria, 1968)].

System's electrical power model
The power model estimates the effective electrical power that the harvester will be able to produce. We define the system's effective power as P eff P gen − P lost where P gen is the total electrical power produced by the generator, and P lost is the total power lost during the system's energy conversion. The total power produced by the generator, P gen , is given by where i g is the equivalent DC current that flows through the generator, which is controlled by a closed-loop circuit proportional-integral-derivative (PID) controller, and E g is the generator electromotive force (EMF). In our models, we used the single-phase DC equivalent of our generator constants. Thus, the generator EMF is given by where ω k is the angular velocity of the knee, and G.R is the gear ratio of the system. Multiplying ω k by G.R results in the generator's angular velocity. K e is the generator speed constant. The total power lost due to conversion, P lost , is where E d is the reverse current voltage that is lost on the threephase diode bridge (where two of the diodes conduct at any given timepoint), and R i is the DC equivalent internal resistance. To use these equations with a brushless direct current (BLDC) generator, the parameters from the specification data sheet need to be converted to single-phase DC equivalent constants (see Appendix A).

System's torque model
This model calculates the torque applied by the harvesting device to the knee during the negative joint mechanical power phase of walking, which is formulated as where T sys is the torque applied by the device to the knee, T I is the torque due to the angular acceleration and moment of inertia (MOI) of the system, T f is the friction torque, and T g is the contribution of the generator to the total applied torque at the knee. T g is given by where K m is the generator's DC equivalent torque constant. T I is given by where α k is the equivalent angular acceleration, and I sys is the equivalent of the MOI of the harvester, as experienced at the user's knee level. It is comprised of the MOI due to different parts of the harvester, where each part experiences different angular acceleration. Hence, I sys is given by I sys I g @knee + I a @knee + I b I sys I g @knee + I a @knee + I b where I g is the MOI of the generator, which is driven by the total gear ratio, G.R tot ; this includes the planetary gear ratio and the bevel gear ratio. I a is the sum of the MOI of the main axis and the planetary gear, which is driven by the gear ratio G.R b , that is, the bevel gear ratio. Finally, I b is the MOI of the knee brace and the harvester structural base. T f is the friction torque due to the gear trains and bearings. Both the bevel gear and the planetary gear cause a viscous friction, which is modeled as a single viscous friction factor. The various bearings cause an additional constant friction torque, which is modeled as a constant friction factor. Thus, where C 1 is the viscous friction coefficient, _ θ k is the angular velocity at knee level, C 2 is the constant friction coefficient, and the sign function determines the direction of the torque based on the angular velocity. However, none of the manufacturers of gears provide the above coefficients. Thus, we modified our torque model, (7), as follows where η is the system efficiency rate, which is mainly a function of the gear ratio. To determine the system efficiency, we used the vendor's specification document where efficiency is defined as a function of gear ratio. Note that the bevel gear and the planetary gear were chosen from among the options provided by the vendor so that the dimensions and weights would be reasonable for a wearable device.

Estimation of user's additional metabolic power
ΔP met is the estimated additional metabolic consumption of the user when wearing the harvester in comparison to his/her metabolic rate when walking without the device. Hence, The model for ΔP met is given as where P POS mech is the mechanical power that the device requires from the user during the positive phases, which is multiplied by Frontiers in Robotics and AI frontiersin.org four to estimate the change in metabolic rate. P NEG mech is the mechanical power (has negative values) that the device provides at the joint level, thus reducing muscular effort.
ΔP mass is the power that the user expends as a result of carrying the harvester due to its weight and location on the body. The coefficients for converting mechanical work to metabolic rate in (14) were based on (Margaria, 1968).
To model the effect of carrying the mass on the body, we used equations from (Schertzer and Riemer, 2015), which resulted in where ΔP mass is the difference in the metabolic rate for a given location of the additional mass on the body, dm is the device mass, S is the walking speed, and L is the location of the device mass on the body. In the optimization, the different combinations of motor and gear only affect the device mass and the location of the center of mass on the thigh. To calculate the difference in the metabolic rate of walking with and without the exoskeleton mass at a given speed of 1.3 m/s, the following metabolic rate prediction equations from (Schertzer and Riemer, 2015) were used: where P back mass is the metabolic rate for carrying a mass on the back (at waist level), and P knee mass is the corresponding metabolic rate for the knee. As can be seen, these equations apply to masses carried at the back/waist and knee levels; thus, interpolation was required to make them applicable to the thigh. The metabolic rate for wearing the device was calculated using a linear interpolation that takes into consideration the location of the center of mass between the knee and the back (waist).
Finally, to calculate P mech (14), the mechanical power (either negative or positive) that the user either expends or receives due to the harvester mechanism, the following equation is used: where T I is the torque caused by the inertia and angular acceleration, as given in (9); T f is the friction torque, as given in (11); and T gen is the generator active torque, as given in (8).

Optimization formulation and constraints
The goal of the optimization is to minimize the TCOH. Thus, the optimization problem, given in (2) and repeated here for convenience, is as follows: subject to Main Constraint: T sys n ≤ bT human Secondary Constraints: Where TCOH is the cost function. The optimization is bounded by the main constraint (19), where T sys n is the total torque that the system applies to the knee at time sample n, given in (7), and T human n is the average torque profile of a human for normal walking at time sample n of their gait cycle, as given in (Winter, 2009). b is a scaler that defines the ratio between the torque that the device applies on the user and the torque produced by the user when walking without the device. Although the optimal ratio (b) is unknown (Shepertycky et al., 2021), (Riemer and Shapiro, 2011), based on preliminary testing with earlier prototypes in our lab as well as the results of Collins et al. (2015) (who found that the optimal spring stiffness for their device was slightly less than half of the ankle stiffness), we defined the optimal ratio as b 0.5.
The inequality constraints in (20) represent the physical limitations of the harvester system components. The upper bound of the gear ratio was selected based on the data sheet of the Apex planetary gearbox-AM032 series with three stages (Apex Dynamics, Long Island, NY, United States). These planetary gearboxes are suitable for our harvester since they enable the application of a maximum torque of 15 Nm at the knee, which is more than half of the maximum of the knee joint torque at the K3 and K4 phases. In addition, they have weights and sizes that are suitable for a wearable device. Note that we did not harvest at K1, as it requires a higher gear ratio than K3 and K4.
The optimization controls the harvester torque profile. This torque profile was designed based on our own electric controller (Cervera et al., 2016), (Rubinshtein et al., 2014) and on our experimental results for walking. e sys is the harvester voltage at the generator's output, and it is bound by the maximum conversion ratio of the power stage (A conv MAX ) and the maximum output voltage (e C MAX ). Thus, the minimum harvest voltage is given by It should be noted that if the storage capacitor is not full, it might still be possible to harvest, but this condition cannot be guaranteed. Therefore, in the optimization algorithm, we chose not to harvest energy when e sys was less than 3 V. The last constraint is i sys MAX , which is the maximum current that the converter is rated for (i sys MAX 10) We applied our optimization for level walking where the input for motion is the knee joint average angular data. The timing of the harvesting algorithm was based on mapping the average knee joint angle profile to the average negative power profile. In a previous experiment, we found significant variation between subjects with regard to the start and end times of the Frontiers in Robotics and AI frontiersin.org phases where the knee was performing negative work (Shkedy Rabani et al., 2022). Thus, to avoid applying an incorrect torque profile during the gait (i.e., one that would lead to harvesting during positive power phases), the harvesting started at one standard deviation after our algorithm detected the start of the negative phase and ended at one standard deviation before the end of the negative phase. The optimization was solved using an in-house algorithm that is based on a grid search of the discretized parameter space. The optimization parameters are the electrical current through the generator (vector of 100 data points, where each point can be assigned a value from 0 to 10 A), the gear ratio (from 50 to 512 in steps of 1), and the motor (e.g., rotor inertia, torque constant, terminal resistance, nominal maximum current, speed constant, and mass). The algorithm was implemented in Matlab (MathWorks, Natick, MA, United States) and is represented in Figure 3. To demonstrate our optimization algorithm, we tested 11 different DC brushless motors that, according to our engineering judgment as well as the experience of others (Donelan et al., 2008), (Shepertycky and Li, 2015), could be good candidates. Thus, we tested motors from (Donelan et al., 2008) and other motors that met the following criteria: mass of less than 250 g, electrical power ranging from 10 to 100 W, and voltage ranging from 10 to 60 V (our system could not function with a higher input voltage). This framework could be used by developers of other devices to test different motors and find the best motor for their application. For convenience, all motors were manufactured by Maxon (Sachseln, Switzerland). They differed in their mechanical and electrical characteristics, as shown in Table 1.

Building and testing the energy harvester
To evaluate our model, two exoskeletons, one for each leg, were built based on the optimization results (the list of the components and their masses is provided in Appendix B). Two experiments were then performed. The first was with a single male subject (1.8 m, 85 kg) walking with the device while a torque meter (mini 45, ATI, Apex, NC, United States) was installed at the knee joint (Appendix C).
This experiment aimed to validate our modeling predictions (torque profile and energy harvested). In the next experiment, we studied the effect of different harvesting levels on the change in metabolic effort. Four male subjects (181.5 ± 2.6 cm, 85.3 ± 7.5 kg, 28-32 years) wore two harvesters, one on each leg, with each device controlled separately (the torque meter was removed to reduce device mass). They walked on a treadmill at a speed of 1.3 m/s under six different conditions: mechanically disconnected (wearing the device as a dead weight) and five harvesting states (15%, 22.5%, 30%, 37.5%, and 50%), each one representing a ratio of resistance torque applied to the knee joint based on normal gait data (Shkedy Rabani et al., 2022). Each condition was applied for a duration of 7 min of walking, where the last 3 min of the condition were used to calculate the metabolic rate. Between each condition, there was a 5-min resting period. The order of the harvesting states was randomized. The subjects completed the experiment twice; the first session was for training purposes, allowing the subjects to get used to the device, while the second session is the one reported here. The time interval between the two sessions ranged from 1 to 3 weeks. The harvester controller was an embedded device that used the PIC24FJ32GA102 microcontroller to control the torque

FIGURE 3
Block diagram of the optimization algorithm that ran through all the states and found the best one.

Frontiers in Robotics and AI
frontiersin.org of the generator and to run the detection algorithm (which determined the harvesting phases based on the real-time knee joint angle). The microcontroller consumed approximately 0.25 W for its operation. Since a specific load-oriented voltage control loop has not been realized, and to prevent overvoltage when unloaded, a dumping resistor with autonomous control was used. We also used this resistor to calculate the electrical power output (average of the last 3 min). Further information on the harvesting system can be found in (Cervera et al., 2016), (Rubinshtein et al., 2014). Metabolic rates were measured using the Quark system (Cosmed, Rome, Italy). Figure 4 shows the experimental setup.

Statistical analysis
We first tested whether, for the group, there was an effect of condition (i.e., harvesting state) on electrical power and metabolic rate. Next, for each individual subject, we used their breath-to-breath data to determine whether there was an effect of condition on metabolic rate. In both cases, we used single-factor ANOVA with a post hoc Tukey Honest Significant Difference HSD test and a significance level of p less than 0.05.

Optimization
The optimization process yielded the optimal gear ratio and torque profile to minimize the cost function (TCOH) for each of the motors. Figure 5 presents the results for motor no. 323218, which achieved the best TCOH. The comparison between the motors is presented in Table 2. Even though all the motors were considered good candidates for the device, there was approximately a six-fold difference in the value of the optimization cost function across the different models. The changes in gear and motor combination mass resulted in a difference of less than one metabolic W between the different combinations.
In the conceptual design used by the optimization, the generator is rigidly connected to the brace mechanism at all gait phases and causes mechanical torque resistance during the positive work phases (in these phases, more torque resistance will increase the metabolic effort). Thus, the optimization favors generators with low effective MOI (function of both the motor and the gear ratio), as this decreases the mechanical resistance during positive joint work phases, when the generator is not active (zero current; see Figure 6). Hence, the top seven generators had relatively low MOIs. The top three had the same motor design with different electrical properties. These results of preference for motors with a gear combination are in line with the changes that Shepertycky et al. (2021) made to improve their previous device (Shepertycky and Li, 2015) and the results from (Rubinshtein et al., 2012;Cervera et al., 2016). Further, it should be noted that the optimizations considered the user's effort. Solutions such as higher gear ratios may produce more electricity, but they lower the conversion efficiency of the system, increasing the inertia and thus requiring more effort from users, especially in the nonharvesting phases of the gait. This was avoided by the optimization.

Model validation
A harvesting device was built using motor no. 323218 (EC-4pole 22 Ø22 mm) and a gear ratio of 243:1, with a 3: 1 bevel gear and 81:1 planetary gear. To validate the system torque model, an external torque meter was mounted on the harvester. The torque meter readings were then   Figure 7. Further, two calculations were performed for the total efficiency of the device: 1) Calculated based on specifications of the two gears (Apex 85%, Bevel 95%) of the electrical harvesting system 88% (Cervera et al., 2016). Thus, this calculation results in approximately 71% efficiency. 2) Using the torque meter to calculate mechanical energy input, the electrical power-generated efficiency was calculated to be approximately 65%.

Experimental results
For all the subjects, an increase in the harvesting torque level resulted in an increase in electrical power output ( Figure 8A), where the ANOVA showed that there was a significant difference in electrical power output between conditions (p < 0.05), and post hoc Tukey HSD tests revealed that there were significant differences only between non-neighboring conditions. For example, the 22.5% harvesting level was not significantly different from the 15% or the 30% levels, but it was different from the 37.5% and 50% levels. The metabolic change relative to walking with the device disconnected was calculated for each of the subjects at each of the harvesting levels ( Figure 8B). The ANOVA results revealed that overall (i.e., across all subjects), the effect of the harvesting level on the metabolic change FIGURE 4 The experimental system included the Matlab graphical user interface (GUI), which sets the harvesting level and collects the experiment data; metabolic system; energy harvester for each leg; and harvesting controller for each leg, which determines when to harvest and how much (based on the harvesting level).
Frontiers in Robotics and AI frontiersin.org was significant, and the post hoc tests revealed that the 30% level was significantly different from the 50% condition. When testing the metabolic rate at the different experimental conditions for each of the subjects, the following results were obtained. For Subject 1, the 30% harvesting level (corresponding to the lowest value of metabolic change) was significantly different from all the other conditions. For Subject 2, the 15% condition was statistically different from the 22.5%, 30%, and 50% conditions but not from the 37.5% condition. For Subject 3, the 30% condition was different from all other conditions except 37.5%. For Subject 4, all the conditions were different from the 50% condition. Note that negative values in Figure 8B indicate that electrical energy was generated while the metabolic power (effort) was reduced (compared to the disconnected condition). These results suggest that the harvesting level of the device should be subject specific. This is in line with the findings of, which showed that different levels of harvesting resulted in different changes in metabolic power values for different individuals (Donelan et al., 2008), (Shepertycky and Li, 2015)].
As well as with the findings of, which showed that individual optimization of the actuation using the human-in-the-loop method could improve the performance of exoskeletons relative to a generic mode (Zhang et al., 2017), (Lee et al., 2018). Thus, future harvesters should customize their final torque profile using this method. Further, many exoskeletons that attach to the body are custom-made for each subject [e.g., 16], which improves the energy transfer between the exoskeleton and enhances users' comfort. Comparison of the model prediction and the average experimental results ( Figure 9A) revealed that the harvesting energy was similar in both cases, albeit with slightly higher values for the experimental results at low harvesting levels. This could be explained by the fact that the device managed to harvest at a lower voltage than the limit in the simulation. Regarding the metabolic differences between the harvesting and mechanically disconnected conditions ( Figure 9B), while the model predicted a continuous reduction in metabolic power with an increase in the harvesting level, the experimental results showed a complex shape with a minimum at 30% and a large increase in metabolic power at 50%.

Limitations and future work
In this study, we used a model based on the work of Margaria et al. (1968), which relates mechanical work performed by the body to metabolic rate. This model was evaluated using experimental data of walking on sloped and level ground and was found to be a good fit (R2 > 0.9) compared to more complex models that include muscle (Koelewijn et al., 2019). However, in our experiments, as was also observed by Collins et al. (2015), at some point there was an increase in metabolic rate as the device provided more assistance at the joint level. We believe that this could be due to several mechanisms. First, recent work shows that even with more complex models with muscle (Umberger et al., 2003) the simulation failed to find the same optimal assistance torque that was found in the experiments in (Franks et al., 2020). Second, as was also the case in previous studies (Uchida et al., 2016), (Dembia et al., 2017), in our optimization there is an assumption that the walking  Generator no: the model number from Maxon's catalog; Peff: the average electrical power per cycle; ΔP met : the average change in the metabolic power.
Frontiers in Robotics and AI frontiersin.org kinematics and kinetics do not change with the load. Yet, while this holds true for lower loads, for higher loads, there appears to be an effect of the load on the walking patterns at all joints (Donelan et al., 2008), (Shepertycky and Li, 2015). An alternative to the above method might be to use the experimental results to create a function that relates the level of harvesting to the change in metabolic power and to use this relation during the optimization for the design of the next device.

FIGURE 6
Optimal torque profile example for a 50% harvesting level (generator no. 323218), where T h is the standard human walking gait torque profile (Winter, 2009) scaled for an 83-kg human, T g is the optimal generator torque profile that is applied to the knee, T I is the torque felt by the user due to the moment of inertia, T f is the friction braking torque, and T sys is the total torque that the system applies to the knee. The shaded areas are the phases of energy harvesting. Note that we did not attempt to harvest for the entire durations of K3 and K4 due to variation in the population. The x-axis is normalized to the percentage of the gait cycle from heel contact (HC) to HC.

FIGURE 7
Example of the comparison between the torque meter results and the model over three gait cycles. T sys is the predicted torque that the system applies on the knee.
Frontiers in Robotics and AI frontiersin.org Regarding future work, Shepertycky et al. (2021) recently built and tested a device that reduced metabolic effort compared to walking without a device while producing 0.25 W of electricity from the late swing motion. The current device was unable to reduce the overall metabolic effort (i.e., walking with no device compared with walking with the activated device). However, the design (with the motor connected with no clutch mechanism) enabled harvesting energy during both flexion and extension. This enables more potential energy to be harvested, for example, in our 30% condition, in which the best for most of the subject. The device harvested an average electrical power of 4.8 W while reducing the metabolic power by 8.26 W compared to walking with the harvester as a dead weight. Using the framework proposed by Schertzer and Riemer et al. (2015), we found that in theory, a harvester with a mass of less than 0.5 kg could produce approximately 5 W, which is 40 times more than the best result achieved in (Shepertycky et al., 2021) and would reduce the metabolic effort. It should be noted that our current energy harvester is a prototype that was designed to test a concept. When using the device in these pilot experiments, we were able to generate an average of 12 W during walking at a torque level of approximately 80%. Thus, a design for 30% of this torque level could be achieved using a smaller motor and a lighter structure, as the force and torque would be smaller. A further reduction in the device's mass could be achieved by using a material such as carbon fiber, which has a tensile strength-to-mass ratio that is between two and four times higher than the aluminum 7075 T6 that we employed. This means that a structure that could hold the same load would be two to four times lighter.
This study tested a knee energy-harvesting device that could generate electricity during the joint's mechanical negative work phases of the gait, both at flexion and extension. Thus, it could  Frontiers in Robotics and AI frontiersin.org harvest in K1, K3, and K4, as opposed to previous harvesters, which could only harvest during the late swing (K4, Figure 2). Our optimization preferred generators with effective low MOI. This is advantageous for designing with direct drive, as a one-way roller clutch with high MOI (Donelan et al., 2008;Shepertycky and Li, 2015) that might result in disengagement of the generator towards the end of the late swing phase. This disengagement is due to large kinetic energy stored that electrical harvesting needs to remove to slow down the angular velocity of the generator, at a rate needed to follow the angular velocity provided to the generator by the knee (Rubinshtein et al., 2012). Further, the highly effective MOI means that the system is designed for one specific gait and will not work as well in other conditions (e.g., slower walking steps or running). Thus, the direct-drive approach with low MOI should enable harvesting more energy and other conditions with more negative joint work than level walking (e.g., running) (Riemer et al., 2021). A recent development in exoskeletons is a device with regenerative braking (Zhu et al., 2019), which can harvest and return energy and provide assistance when the joint is performing either positive or negative work. Therefore, our results might support the effort to build exoskeletons that have a minimal need for external power yet can change their assistive torque profiles as needed.

Conclusion
In this study, we presented an optimization method for the design of an energy harvester system during level walking. This method enabled testing many different motor and gear combinations and could be used by developers of other devices to achieve the best design for their application. Further, our device enabled us to harvest energy from all gait phases and not only from late swing phase. Our experiments revealed that for all the subjects, there was at least one harvesting condition where the metabolic power required for generating electrical energy was close to zero or less than zero. These results suggest that a lighter, similar design might be able to improve user metabolic performance in the future.

Data availability statement
The raw data supporting the conclusion of this article will be made available by the authors, without undue reservation.

Ethics statement
The studies involving human participants were reviewed and approved by Ben-Gurion University of the Negev, Beer-Sheva, Israel. The patients/participants provided their written informed consent to participate in this study.

Author contributions
MG did the simulation and building the device and code for the controller, BL-A improve the design of the energy harvester and wrote code for the controller and performed the experimental work. AS help with some of the grant writing and advisor of MG and BL-A and CB-D worked on data analysis. RR wrote all the grants for funding was the initiator of the study worked with all the student as their advisor on simulation, design, manufacturing, control, running the experiment an analysis. All authors worked on the paper writing.

Funding
This study was partially supported by BSF (2011152) MAFAT and the Helmsley Charitable Trust through the Agricultural, Biological and Cognitive Robotics Initiative of Ben-Gurion University of the Negev and Israel ministry of science and technology.