A hierarchical model for external electrical control of an insect, accounting for inter-individual variation of muscle force properties

Cyborg control of insect movement is promising for developing miniature, high-mobility, and efficient biohybrid robots. However, considering the inter-individual variation of the insect neuromuscular apparatus and its neural control is challenging. We propose a hierarchical model including inter-individual variation of muscle properties of three leg muscles involved in propulsion (retractor coxae), joint stiffness (pro- and retractor coxae), and stance-swing transition (protractor coxae and levator trochanteris) in the stick insect Carausius morosus. To estimate mechanical effects induced by external muscle stimulation, the model is based on the systematic evaluation of joint torques as functions of electrical stimulation parameters. A nearly linear relationship between the stimulus burst duration and generated torque was observed. This stimulus-torque characteristic holds for burst durations of up to 500ms, corresponding to the stance and swing phase durations of medium to fast walking stick insects. Hierarchical Bayesian modeling revealed that linearity of the stimulus-torque characteristic was invariant, with individually varying slopes. Individual prediction of joint torques provides significant benefits for precise cyborg control.

. The advantage of biohybrid (cyborg) 34 robots is that they do not require individual "design," "fabrication," and "assembly" processes for which are based on sample averages is very high (Blümel et al., 2012c) and may be halved using 48 individual-specific model (Blümel et al., 2012a). At the level of leg movements, variability has been 49 investigated in lobsters (Thuma et al., 2003) and stick insects (Hooper et al., 2006). The variability of 50 whole-body locomotion arises from step parameter variation of single legs (Theunissen and Dürr,51 2013) but also from variation of coupling strength among legs (Dürr, 2005). One possible approach 52 for accounting for inter-individual variability in cyborg control of single-leg movement is to con-53 struct a feedback control system (Cao et al., 2014). Although the kinematics-control of joint anges 54 (Cao et al., 2014) has exhibited remarkable performance, its applicability to the control of dynamic 55 gaits, such as that for walking, is still controversial. Furthermore, insects have abundant control 56 variables, that is, degrees of freedom in their actuators and sensors. At present, the number of 57 control variables of current insect cyborgs has to be reduced2 owing to system implementation 58 difficulties.

59
A promising approach to overcome the "pitfalls" associated with averaging across individuals is 60 to understand the underlying principles that govern inter-individual variability in insect motor con-61 trol. Especially, the output characteristics of muscle are key for controlling the dynamics of move-  The main objective of this study was to systematically evaluate how muscle force and corre-72 sponding joint torques depend on external electrical stimulation, as a fundamental pre-requisite 73 for precise insect cyborg control. To this end, we measured joint torques induced by stimulat-74 ing one out of three leg muscles in the middle leg of the stick insect species Carausius morosus 75 (de Sinéty, 1901): these were the protractor coxae, retractor coxae, and levator trochanteris. We 76 focused on these three proximal muscles because the retractor coxae is the primary muscle for 77 propulsion34, the pro/retractor coxae contributes to weight-dependent postural adjustment by we simulated burst-like activity of motor neurons in insects and measured the corresponding joint 82 torques generated in response to our electrical stimuli. Using Bayesian statistical modeling and 83 the "widely applied information criterion" (WAIC) index (Watanabe, 2018) for model prediction, we 84 evaluated several model variants to identify the one that explained the experimental data best.

85
In particular, we evaluated the predictive performances of model variants with and without inter-86 individual variation of experimental parameter estimates. A piecewise linear relationship was ob-87 served between the burst duration and the joint torque generated for a given parameter set of the 88 PWM burst. Linearity was found to hold for burst durations of up to 500 ms, which corresponds to 89 the stance phase (300 to 500 ms) and swing phase (to 250 ms) of a stick insect walking at medium 90 to fast speeds (Dürr et al., 2018). Furthermore, the hierarchical Bayesian modeling revealed both 91 invariant and individually varying characteristics of joint torque generation in stick insects. This 92 allows for individual tuning of electrical stimulation parameters for highly precise insect cyborg 93 control.

95
Burst duration and generated joint torque 96 Figure 1 illustrates the obtained relation between the PWM burst duration and the generated joint 97 torques for the protractor (A), retractor (B), and levator (C) muscles from 10 animals ( = 10). The 98 parameters of the PWM signals were set to 2.0 V, 50 Hz, and 30% duty ratio. During one trial, we 99 stimulated one muscle n times with fixed PWM parameters and measured the generated torque 100 at the corresponding joint.

101
The results indicate the input-output relation (burst duration and generated torque) corre-      Figure 4 shows the changes in the muscle characteristic parameters and with respect to changes 129 in the voltage applied. We calculated the changes in and with respect to the applied voltage 130 from the experimental results, using the six Bayesian models.

136
In this study, we investigated externally controlled joint torques induced by external electrical stim-137 ulation of one out of three leg muscles (protractor, retractor, and levator) in the stick insect Carau-138 sius morosus. For a given parameter set for PWM burst stimulation, we found a piecewise linear 139 relationship between the burst duration and generated joint torque. Linearity holds for a burst du-140 ration up to 500 ms. For a more detailed analysis of the joint torques generated by leg muscles, we 141 used Bayesian statistical analysis and modeling to account for inter-individual variation. A compar-142 ison of the six models (with combinations of linear, nonlinear, non-hierarchical, and hierarchical 143 models) showed that the two models that include inter-individual variation of slope parameter 144 performed best. Models 1-2 and 2-1 most accurately predicted the posterior predictive distribu-145 tion.

146
The exponent is a macroscopic property of the generated joint torque, that is the degree of 147 non-linearity of the stimulus-torque characteristic; it is linear when = 1. Conversely, slope pa-148 rameter defines the rate of increase of the generated torque. In a comparison of the prediction 149 performance of models in Fig. 2, the mathematical index WAIC revealed that the two models in 150 which only was a hierarchical parameter (models 1-2 and 2-1), performed best. Since only hierar-151 chical parameters account for inter-individual variation, we conclude that is strongly affected by 152 individual differences, whereas is invariant among specimens. Thus, we found that the macro-  (Dürr et al., 2018). The magnitudes of the joint torques generated by the protractor, retractor, and 183 levator were comparable to those for resisted movement during stick-insect walking, e.g. coxa-184 trochanter joint depression during stance (Dallmann et al., 2016). This suggests that the estimated  In this experiment, the burst duration Ti was varied at random, and the torque was calculated from force measurements with calibrated conversion factor and moment arm (see (C)). The voltage, frequency, and duty ratio of the PWM signals were 2.0 V, 50 Hz, and 30%, respectively. The color of the dots represents the number of stimulations (blue-yellow: 1-74). The orange dotted vertical line indicates at 500ms. substrate contact) and with natural load distribution (i.e., by intervention during free walking). We 237 are confident that these experiments, will provide further support of the Motion Hacking method 238 and will reveal findings that could not be obtained by more conventional experiments without ex-239 ternal stimulation of the neuro-muscular system. This will also contribute to potential applications 240 in highly precise insect cyborg control.  The insect was fixed dorsal side up on a balsa wood platform, using insect pins. The coxa of the 248 right middle leg was located at the platform edge (Fig. 5 A right). We selected three leg muscles (pro-249 tractor, retractor, and levator) in the right middle leg for electrical stimulation (Fig. 5 B). When stick 250 insects walk, they use the protractor to swing the leg forward during the swing phase, the retrac-251 tor to move the leg backward during the stance phase, and levator to initiate the stance-to-swing 252 transition (Rosenbaum et al., 2010; Dallmann et al., 2019; Günzel et al., 2022; Bässler and Weg-253   ner, 1983). Moreover, co-contraction of the protractor and retractor are known to vary based on 254 the overall load distribution, thus being important for postural control by regulating joint stiffness 255 (Dallmann et al., 2019; Günzel et al., 2022). Electrical stimulation of the protractor and retractor 256 muscles generate forward and backward leg movements at the thorax-coxa (ThC) joint, whereas 257 stimulation of the levator muscle generates an upward leg movement at the coxa-trochanter (CTr) 258 joint (Dallmann et al., 2016). To estimate the joint torque generated during the stimulation, we  Two small insect pins attached to the tip of the force transducer held the middle part of the femur 262 of the middle leg ( Fig. 5 A right). The length between the ThC or CTr joints and the attachment 263 point at the femur was measured and used as the moment arm for the calculation of torque.

264
Electrical stimulation 265 We developed a custom-built electrical stimulator for stimulating muscles (Fig. 5 A left). An exten-266 sion circuit board was designed for Raspberry Pi 3 B+ (Raspberry Pi Foundation), including isolated 267 8-channel PWM signal outputs. The parameters of the PWM signals, for example, frequency (1 to 268 120Hz) and duty ratio (0 to 100%), were changed using a Raspberry Pi microprocessor. The ampli-269 tude of the output voltage (0 to 9V) was changed using variable resistors on the circuit board, which 270 enabled the investigation of the effects of these parameters on torque generation due to muscle 271 stimulation. In this study, we systematically analyzed the joint torques generated by muscle con-  cuticle. Holes were pierced using an insect pin, and wires were fixed with dental glue (Fig. 5 B). The  to be drawn from yet another probabilistic distribution. In our case, hierarchical-model variants 308 were used to account for inter-individual differences (Watanabe, 2018). 309 Here, we modeled the relationship between the burst duration of the electrical stimulation and 310 the joint torque generated using a single model (a power function) with six variants (for details, see where represents the inclination of the estimated linear function. where represents the inclination of the estimated linear function on the ( )th animal. Further- where and represent the magnitude of the base on the ( )th animal and the exponent of the where and rrepresent the magnitude of the base and the exponent on the ( )th animal for the 346 estimated nonlinear, power function, respectively. In this model, follows a normal distribution where and represent the magnitude of the base and the exponent of the estimated nonlinear 351 power function, respectively, on the ( )th animal. In this model, and follow normal distributions 352 as described above, where and are the means, and and are the S.D.s of the distribution.

353
Widely Applied Information Criterion (WAIC) 354 We compared the predictive performances of the formulated models using the mathematical index 355 WAIC (Watanabe, 2018, 2005, 2010a,b). The WAIC is a measure of the degree to which an estimate of 356 the predictive distribution is accurate relative to the true distribution (Watanabe, 2018 (Stan Development Team, 2022). 373 From the models described above, the model with the smallest WAIC value was considered the 374 most appropriate predictive model in terms of predictivity for a new animal.