# High-Efficiency Closed-Loop Control of a Robotic Fish via Virtual Musculoskeletal Methodology
## 3 The Virtual Musculoskeletal Methodology
### Virtual Musculoskeletal Method  
Abstracting the strategy from the bionic model, we design the virtual musculoskeletal methodology for the activation of the joints.  
Equation (18) contains the mechanics of the muscle and the activation of CNS. Suppose that the agonist and antagonist muscles have the same stiffness, maximum force, and spindle signal, then the torques generated by both muscles at the joint are  
\[M_{ag}=(K_{L}^{CE}K_{v}^{CE}(a+e(t))+K^{PE})M_{\text{max}}, \tag{19}\]  
\[M_{an}=-(K_{L}^{CE}K_{v}^{CE}(a+e(t))+K^{PE})M_{\text{max}}, \tag{20}\]  
where \(M_{\text{max}}\) is the maximum torque of each muscle.  
Equation (19) subtracts Equation (20), and therefore the torque of the muscular joint is  
\[M=(2K_{L}^{CE}K_{v}^{CE}a+2K_{L}^{CE}K_{v}^{CE}e(t)+2K^{PE})M_{\text{max}}, \tag{21}\]  
In Equation (21), \(K_{L}^{CE}\) and \(K^{PE}\) indicate the relationship between the length of the muscle and the torque, and \(M_{\text{max}}\) is a constant. We set \(K\Delta\theta\) to take the place of \(2K_{L}^{CE}M_{\text{max}}\) and \(2K^{PE}M_{\text{max}}\). Thus, the torque of the joint is  
\[M=(KK_{v}^{CE}a+KK_{v}^{CE}e(t)+K)\Delta\theta, \tag{22}\]  
where \(\Delta\theta\) represents the position of the muscle to the equilibrium.  
The torque of the joint includes three parts; parameter \(K\) is the stiffness of the joint and \(KK_{v}^{CE}a\) represents the response of the muscle to the control signal from CNS. As our goal is to control the robotic fish to follow a given speed, this part could be replaced by adjusting the speed. The feedback from the spindle \(e(t)\) contains the nonlinearity, \(KK_{v}^{CE}\) is replaced by a coefficient \(H\) to adjust the feedback intensity of the spindle. Therefore, the equation of the torque of the joint is simplified as  
\[M=(K_{v}(v^{*}-v)+He(t)+K)\Delta\theta, \tag{23}\]  
where \(v^{*}\) is the planned swimming speed of the robotic fish and \(v\) is the real swimming speed of the fish.  
Equation (23) shows that the torque of the joint contains three parts of activation: (1) the adjustment from the CNS which is dependent on the task planning and the real swimming state, (2) the feedback signal from the muscle spindle, and (3) the stiffness of the joints set by the task planning. To control the robotic fish, \(\Delta\theta\) represents the deviation of a given angle and the real angle. Therefore, the virtual musculoskeletal control method is  
\[M=\left[K_{v}(v^{*}-v)+He(\theta,\dot{\theta})+K\right](\theta^{*}-\theta), \tag{24}\]  
where \(e(\theta,\dot{\theta})\) indicates the spindle-like feedback in the controller and \(H\) is the coefficient of this feedback. The spindle-like feedback is designed as a fuzzy controller, whose inputs are the angle and the angular velocity. This controller imitates the nonlinearity of the muscle feedback well [23]. This controller needs three kinds of information from the planning algorithm: a given swimming speed, a set stiffness, and a given angle of the joint.  
As the signals delay in the spinal cord and nerve system, a low-pass filter in Equation (25) is added after the given signal to the joint.  
\[d(s)=\frac{1}{\tau_{cd}s+1} \tag{25}\]