# C-Legged Hexapod Robot Design Guidelines Based on Energy Analysis
## 2 Kinematic and Energy Model of a Single C-Leg System
### Kinematic Model  
Firstly, let us start by placing the robot's hip at the origin (0, 0), as shown in Figure 4. This means that the ground line (in this initial position) is located below the hip at twice the leg radius. This has been done to perform rotation matrix operations. Later in the kinematic model development, a vertical translation will be performed to set the ground to be the origin. In this way, the motion of the robot with respect to the floor will be determined. Figure 4: Starting configuration with the legs rotating point placed in the coordinates (0, 0). As the shape of the leg is a semi-circle and the center coordinates are \((0,-r)\) (Figure 4), its points can be parametrized in terms of the angle \(\alpha\) in the following form:  
\[x=rcos(\alpha) \tag{1}\]  
\[y=rsin(\alpha)\ -\ r \tag{2}\]  
where \(\alpha\in\left[\frac{-\pi}{2},\frac{\pi}{2}\right]\)  
Equations (1) and (2) represent the robot's leg at the position, shown in Figure 4, but the objective is to obtain the leg's position as it rotates. As previously stated, initially, the system's hip is situated at \((0,0)\); therefore, the new legs position when rotated can be calculated by applying a 2D rotation matrix to the legs position equation. That is, if (x, y) is a position of a point in the leg prior to a rotation, the position is given by:  
\[\left[ \begin{array}{c}x_{new}\\ y_{new}\end{array} \right]=\left[ \begin{array}{cc}\cos(\theta)&-\sin(\theta) \\ \sin(\theta)&\cos(\theta)\end{array} \right]\left[ \begin{array}{c}x\\ y\end{array} \right] \tag{3}\]  
where \(\theta\) is the angle of rotation around \((0,0)\), with anticlockwise rotations being positive. To determine the leg's kinematic model, the contact point position with respect to the hip will be first identified. This can be done by finding the minimum in the expression for \(y_{new}\) given in Equation (3). \[\frac{dy_{new}}{d\alpha}=\cos(\alpha+\theta)\ =0 \tag{4}\]  
The solutions to Equation (1) will be denoted by \(\alpha_{e}\); thus:  
\[\alpha_{e}=\frac{n\pi}{2}-\theta,\ n=0,1. \tag{5}\]  
For any leg rotation, there are two solutions, one corresponding to a maximum and another one to a minimum. If \(\frac{d^{2}y_{new}}{d\alpha^{2}}(\alpha_{e})\ <0\) then \(y_{new}\) takes a maximum at \(\alpha_{e}\), in this case \(\alpha_{e}\) will be denoted as \(\alpha_{max}\) and similarly if \(\frac{d^{2}y_{new}}{d\alpha^{2}}>0\ y_{new}\) is a minimum and will be denoted as \(\alpha_{min}\). Once \(\alpha_{min}\) has been determined, the value needs to satisfy the condition of \(\alpha\in\left[\frac{-\pi}{2},\frac{\pi}{2}\right]\) which has been previously established. If \(\alpha_{min}\) lies within this range, then the solution identified belongs to the semicircle specified in the first part of the model. If it lies outside this range, then the minimum lies on the other symmetric semicircle, and the actual contact point corresponds to one of the range limits either \(\frac{-\pi}{2}\) or \(\frac{\pi}{2}\). Figure 5 shows a solution \(\alpha_{min}\) outside the established interval mentioned above, and therefore, belongs to the symmetric semicircle. Figure 5: System representation rotated at an angle where the \(\alpha_{min}\) solution corresponds to the symmetric semi-circle represented in green. Following the procedure described above, one can conclude that in a semicircle shaped leg the \(\alpha_{min}\) angles corresponding to the contact point position are the following:  
\[\alpha_{min}=\left\{ \begin{array}{c}\theta\in\left[0,\frac{\pi}{2}\right]\to \ \alpha_{min}=-\frac{\pi}{2}\\ \theta\in\left[\frac{\pi}{2},\pi\right]\to\alpha_{min}=\frac{\pi}{2}\\ \theta\in\left[\pi,2\pi\right]\to\ \alpha_{min}=\frac{\pi\pi}{2}-\theta,\ n=0,\ 1\end{array} \right. \tag{6}\]  
Hence, combining the equations for the leg representation and the \(\alpha_{min}\) values for each angle the contact position (\(x_{c},\ y_{c}\)) is given by:  
\[\left[ \begin{array}{c}x_{c}\\ y_{c}\end{array} \right]=\left[ \begin{array}{cc}\cos(\theta)&-\sin(\theta)\\ \sin(\theta)&\cos(\theta)\end{array}