# Energy Optimization of Functionally Redundant Robots through Motion Design
## 2 Energy Consumption Estimation in Robots  
In this section the model used to describe the mechanical and the electric model of the robot under investigation is outlined. The model is defined for the UR5 robot chosen as the testbench, shown in Figure 1, but the same formulation is suitable to describe the dynamics of most serial robots used in industry. The model is used to provide an estimation of the energy consumption associated with the execution of a task.  
Figure 1: Kinematic structure of the Universal Robot UR5 manipulator—global reference frame and end-effector reference frame.  
The dynamic model of the robot can be described, according to the Lagrangian formalism, by the formulation:  
\[\mathbf{M}(\mathbf{q})\ddot{\mathbf{q}}+\mathbf{C}(\mathbf{q},\dot{\mathbf{q}})+ \mathbf{G}(\mathbf{q})+\mathbf{f}_{v}\dot{\mathbf{q}}+\mathbf{F}_{c}(sign(\dot{ \mathbf{q}}))=\mathbf{B}\tau_{m} \tag{1}\]  
\(\mathbf{q}=[q_{1},\dots,q_{6}]^{T}\) is the vector of the independent joint coordinates, \(\mathbf{M}(\mathbf{q})\) is the mass matrix, \(\mathbf{C}(\mathbf{q},\dot{\mathbf{q}})\) collects the centrifugal effects and \(\mathbf{G}(\mathbf{q})\) models gravitational effects. Motor torques are included in vector \(\mathbf{\tau}_{m}\) and \(\mathbf{B}\) is the force distribution matrix, that accounts for the the gear ratios too. Friction in the joints due to the one in the motors and in the speed reducers is included through the diagonal matrix of viscous joint friction coefficients, \(\mathbf{f}_{v}\) and the vector of Coulomb friction forces \(\mathbf{F}_{c}\).  
The inverse dynamic model of Equation (1) is used to compute the instantaneous values of the motor torques as a function of the desired kinematic quantities \(\mathbf{q}(t)\), \(\dot{\mathbf{q}}(t)\) and \(\ddot{\mathbf{q}}(t)\).  
The energy consumption is computed starting from the following equations, as usually done in the literature:  
\[\mathbf{\tau}_{m}(t)=\mathbf{K}_{t}\mathbf{I}(t) \tag{2}\]  
\[\mathbf{V}(t)=\mathbf{R}\;\mathbf{I}(t)+\mathbf{K}_{b}\dot{\mathbf{q}}_{m}(t) \tag{3}\]  
\(\mathbf{K}_{t}\) is the diagonal matrix of motor torque constants, \(\mathbf{K}_{b}\) is the diagonal matrix of the back-emf constants, \(\mathbf{R}\) is the diagonal matrix of motor winding resistances and \(\dot{\mathbf{q}}_{m}(t)\) is the vector of the motor speeds. The effect of inductances is negligible, as widely proved in the literature. This model applies to DC motors, as well as to AC brushless motors, according to [PERSON]'s model [28, 29]. The electric power drawn by the robot can then be represented by the voltage-current product:  
\[\mathbf{W}_{m}(t)=\mathbf{V}(t)^{T}\mathbf{I}(t) \tag{4}\]  
\(\mathbf{W}_{m}\) is the electric power draw by the six actuators. The consumption of the robot as a whole is simply computed as the sum of the aix individual joint motor consumptions, as in;  
\[W_{r}(t)=\sum\limits_{i=1}^{6}W_{m,i}(t) \tag{5}\]  
Finally, the overall energy expenditure associated with a task defined within the time frame \([t_{a},t_{b}]\) can be computed as:  
\[E_{robot}=\int\limits_{t_{a}}^{t_{b}}W_{r}(t)dt \tag{6}\]  
It should be pointed out that a correct application of the expression in Equations (5) and (6) to the test-case used in this work should take into account only the positive values of \(W_{m,i}\), as the robot is not equipped with regenerative motor drives or energy sharing among actuators. As a consequence, when the electric power flows from a motor to the drive, such energy is not stored or shared over a bus, but it is dissipated on a so-called braking resistor [30].