# Adaptive Prosthetic Trajectory Estimation Based on Key Points Constraints
## 3 Adaptive Kinematic Estimation Method
### Kinematic Estimation Problem Description  
In our previous work, we used the Gaussian process (GP) to fit a single-motion trajectory [27]. However, we observed that adaptability to speed and slope was weak. When the walking speed changes, the motion trajectory also changes, and, for different users, the joint kinematics have personalized characteristics that cannot be adjusted accordingly. We also found that the GP curve-fitting method has some disadvantages, such as high computational complexity, which increases with the amount of data and requires a lot of computational resources. Additionally, the choices of kernel functions and hyperparameters affect the fitting effect, which requires a lot of experience and debugging. Furthermore, a large amount of sample data is required, which is not feasible for experiments involving human subjects. Therefore, we developed an adaptive kinematic trajectory estimation algorithm for speed and slope that can be used for subsequent personalized adjustment.  
The function for the kinematic modeling of a joint with velocity and slope adaptation is expressed as the following function of the angle of the knee and ankle, with respect to the velocity variable \(v\), slope variable \(\gamma\), and phase variable \(\varphi\):  
\[\theta_{k}^{d}=q_{k}(\varphi,v,\gamma) \tag{8}\]  
\[\theta_{a}^{d}=q_{a}(\varphi,v,\gamma) \tag{9}\]  
where \(q_{k}\) and \(q_{a}\) are the function relationships between the knee and ankle joint angles and the phase variable \(\varphi\). \(\theta_{k}^{d}\) and \(\theta_{a}^{d}\) represent the expected prosthetic joint angles calculated by the gait kinematic model. A unified expression of \(\theta^{d}=q(\varphi,v,\gamma)\) is used in the following section.  
A method based on task function weights was proposed in [10], and the gait model was modeled as a basis function with \(\varphi\) as a variable, and a task function with \(v\) and \(\gamma\) as variables. Although changes in velocity and slope will lead to changes in kinematic trajectory, there is a basic trajectory shape; the basis function represents the invariant part  
Figure 2: Knee and ankle angles at constant speed and varying slopes, and the knee angle at different speeds when the slope changes. The grey dashed line represents 0 degrees.  
of the trajectory, while the changes caused by the changes in velocity and slope are reflected in the task function. Thus, the angle expression is as follows:  
\[q(\varphi,\upsilon,\gamma)=\sum_{k=1}^{N}b_{k}(\varphi)c_{k}(\upsilon,\gamma) \tag{10}\]  
where \(b_{k}\) is an F-order Fourier series with \(\varphi\), \(c_{k}(\upsilon,\gamma)\) is a task function with task variables \(\upsilon\) and \(\gamma\), and \(n\) is the number of basis functions. We set \(F=10\) when \(k=1\). When \(k\in\{2,3,4\}\), the slope variable is 0 and the basis function is weighted by the velocity variable. When \(k\in\{5,6,7,8\}\), slope variables are used to weigh the basis function. It can be seen that if \(N=8\), the unknown parameters of each basis function are \(2F+1=21\), and the total number of unknown parameters in the model is \(N(2F+1)=168\). Due to the large data volume and high computational difficulty, the decipherability of parameters is not exact, and there are certain difficulties in the subsequent adjustment of the model.