# Locomotion Efficiency Optimization of Biologically Inspired Snake Robots
## 3 Optimization of Motion
### Formulation of the Optimization Problem  
Solving an optimization problem entails finding a solution from all feasible solutions to maximize (or minimize) an objective function. In this paper, we define the motion optimization problem to optimize two objective functions, simultaneously: energy consumption, and the forward velocity. This type of optimization problem is called multi-objective optimization, since more than one objective function is involved [32]. In the following, these two objective functions (the energy consumption and the forward velocity) are formulated. To solve the bi-objective optimization problem, the well-known weighted-sum approach is implemented to combine these two objective functions. First, we formulate the total energy consumption as a function of the actuation torque and the angular velocity of the joints:  
\[E_{\text{s}}=\int\limits_{0}^{T}\left(\sum\limits_{i=1}^{n-1}|u_{i}(t)\phi_{i }(t)|\right)dt, \tag{15}\]  
where \(T\) represents the time of a complete motion cycle. The actuation torque \(u_{i}\) and the angular velocity \(\phi_{i}\) for joint \(i\) are calculated by using (14) and \(\phi_{i}=\dot{\theta}_{i}-\dot{\theta}_{i-1}\), respectively, [8; 15]. Note that in this paper, we assume the joint to be ideal. Therefore, the total energy of the system is equal to the summation of kinetic energy and the energy which is dissipated due to either the ground friction for the land-based snake robot or the surrounding fluid for the underwater snake robot. The average power consumption is calculated by using the following expression:  
\[P_{\text{avg}}=\frac{1}{T}\int\limits_{0}^{T}\left(\sum\limits_{i=1}^{n-1}|u_ {i}(t)\phi_{i}(t)|\right)dt. \tag{16}\]  
Note that Equation (16) gives the average power consumption taking into account only the absolute value of the power consumed for the joint motion. However, in order to take into account also the effects of negative work [8], the net joint power can be considered instead. In this case, the average power consumption can be calculated using the following expression:  
\[P_{\text{avg}}=\frac{1}{T}\int\limits_{0}^{T}\left(\sum\limits_{i=1}^{n-1}u_{ i}(t)\phi_{i}(t)\right)dt. \tag{17}\]  
For underwater snake robots, both Equations (16) and (17) are examined. In the latter case which is presented in [8], it is shown that by considering the negative work effect the simulated robot is able to recover energy. However, for the land-based snake robot only the absolute values of the theoretical joint power is considered because the ground friction consumes energy when the robot moves on land, i.e., Equation (16) is used. In addition, the following expression is used to calculate the forward velocity:  
\[\bar{v}=\frac{\sqrt{(p_{x}(T)-p_{x}(0))^{2}+(p_{y}(T)-p_{y}(0))^{2}}}{T}, \tag{18}\]  
where \((p_{x}(0),p_{y}(0))\) and \((p_{x}(T),p_{y}(T))\) denote the initial and final positions of CM of the robot. It is shown in [16] that the motion optimization problem can be formulated by the following objective functions and bound constraints:\[\min_{\alpha,\omega,\beta}J_{\text{opt}}=[P_{\text{avg}},-\bar{v}], \tag{19a}\] \[\text{s.t: }\mid\phi_{i}^{*}\mid\leq\phi_{i}^{max},\mid\phi_{i}^{*} \mid\leq\dot{\phi}_{i}^{max},\mid u_{i}\mid\leq u_{i}^{max},\] (19b) \[0\leq\alpha\leq\alpha^{max},0\leq\omega\leq\omega^{max},0\leq \delta\leq\delta^{max}, \tag{19c}\]  
where Equation (19b) represents the physical limitations of the joints because of the servo motors and special design of the snake robot [33], and Equation (19c) limits the possible range of the parameters of the sinusoidal motion pattern Equation (13). As stated in [16], for the bi-objective optimization problem Equation (19), instead of a single global solution, there are a set of optimal solutions. Moreover, in this problem, the objective functions are in conflict such that minimizing the power consumption clearly results in decreasing the velocity and vice versa. In [16], we suggested using a Pareto optimality concept for the bi-objective optimization problem.