# Fuzzy Logic-Based Controller for Bipedal Robot
## 2 Kinematics of Robot and Motion Trajectory Planning
### Kinematic Equations of Robot  
When a robot moves, one leg will act as the supporting leg, the other leg will swing in the direction of travel to take a step. These will be called supporting (leg, foot) and swinging (leg, foot), respectively. To set up the kinematic equations of the robot, the coordinates systems and kinematic parameters were derived as shown in Figure 1c, in which the coordinate system \(x_{0}y_{0}z_{0}\) was attached to the background, which was the base coordinate system. The \(x_{0}y_{0}z_{0}\) coordinate system was also attached to the background, which was used to represent the robot position at each step. The \(x_{1}y_{1}z_{1}\) coordinate system was attached to the foot of the supporting leg, having its origin at the toe of the foot. The \(x_{2}y_{2}z_{2}\) coordinate system was attached to the robot body, whose origin was at the hip joint. The angles \(\theta_{2}\),..., \(\theta_{7}\) are the joint coordinates, where \(\theta_{7}\) is joint coordinate between the thigh, axis \(x_{3}\), and body, axis \(x_{7}\). These coordinates, together with \(\theta_{1}\), i.e., \(\theta_{1}\), \(\theta_{2}\),..., \(\theta_{7}\), are independent generalized coordinates, defining the robot's state and motion. On the other hand, in space, the factors that characterize the robot's state are the position of the robot body and the positions of the supporting foot and the swinging foot. At each step, the coordinate system \(x_{0}y_{0}z_{0}\) was determined with respect to the coordinate system \(x_{0}y_{0}z_{0}\). The robot body position is represented by the hip joint coordinates \(x_{b}\), \(y_{b}\), and angle \(\theta_{b}\) between the \(x_{7}\) axis, which is the axis mounted along the robot body, relative to the vertical, axis \(z_{b}\). The position of the supporting foot is determined by the coordinates of the supporting foot \(x_{1}\), \(y_{1}\), and angle \(\theta_{1}\). The coordinates of the ankle, \(x_{k}\), \(y_{k}\), and \(\theta_{k}\), are used to represent the swinging foot position. Where, \(\theta_{k}\) is the angle between the swinging foot, \(x_{6}\) axis, and the vertical, axis \(z_{k}\). In the calculation, the coordinates \(x_{0f}\), \(y_{0f}\), \(z_{0f}\) are determined by the coordinate system \(x_{0}y_{0}z_{0}\) with respect to the base coordinate system \(x_{0}y_{0}z_{0}\); the coordinates \(x_{b}\), \(y_{b}\), \(\theta_{b}\), \(x_{1}\), \(y_{1}\), \(\theta_{1}\), \(x_{k}\), \(y_{k}\), \(\theta_{k}\) are determined in each step and are represented with respect to the \(x_{0}y_{0}z_{0f}\) coordinate system. In general, when the robot is operating, from the operation request, the robot's attitude is determined by the position of the robot's body, supporting foot, and the swinging foot. Therefore, the coordinates locating the above components are called operational (task) coordinates and are denoted as follows:  
\[p=[p_{1},p_{2},\ldots,p_{12}]^{T}=\left[x_{0f},y_{0f},z_{0f},x_{b},y_{b}, \theta_{b},x_{1},y_{1},\theta_{1},x_{k},y_{k},\theta_{k}\right]^{T} \tag{1}\]  
Figure 1: Bipedal robot model: (**a**) human-like bipedal robot; (**b**,**c**) robot’s kinematic scheme and coordinate systems. The independent generalized coordinates are denoted as follows:  
\[q=[q_{1},q_{2},\ldots,q_{7}]^{T}=[\theta_{1},\theta_{2},\ldots,\theta_{7}]^{T} \tag{2}\]  
In addition to the time-varying parameters, which are the coordinates mentioned above, there are also geometric parameters of the robot, including the robot's foot dimensions \(h_{r}\), \(d_{f}\), \(d_{h}\) (Figure 1c), and the length of the legs calves and thighs are \(a_{c}\) and \(a_{t}\), respectively. The operational coordinates (1) are the parameters for designing the motion trajectory, while the independent coordinates (2) are the basis for controlling the robot's motion. However, only six generalized coordinates, which are the joint coordinates \(\theta_{2}\), \(\ldots\), \(\theta_{7}\) are driven and controlled, while the number of independent generalized coordinates is seven. Thus, the bipedal robot is an underactuated system.