## 4 Study Cases in the Mechanism Synthesis for Lower Limb Rehabilitation
### Case 2: Cam-Linkage Mechanism
Moreover, the design variable vector \(x\) is bounded by \(x_{min}\) and \(x_{max}\). The limit values used in this work are shown in \[g_{1} :r_{1}+r_{2}-r_{3}-\sqrt{s_{min}^{2}+e^{2}}\leq 0 \tag{35}\]3  
The precision points \((\bar{x}_{p}^{i},\bar{y}_{p}^{i})\) are presented in Table 2 of Appendix A. These coordinates define the standard ankle trajectory in the human gait. The precision points are obtained by the leg kinematics (53) considering an angular displacement of the hip and knee joint in the sagittal plane. The thigh and shank lengths are defined as \(L_{thigh}=0.3984\) [m], \(L_{shank}=0.3956\) [m], respectively. The knee angles \(\theta_{knee}^{i}\) and the hip angles \(\theta_{hip}^{i}\)\(\forall\)\(i=\{1,2,...,n_{f}\}\) are found in [57]. \[ \begin{bmatrix}\bar{x}_{p}^{i}\\ \bar{y}_{p}^{i}\end{bmatrix} = \begin{bmatrix}-sin\theta_{hip}^{i}&sin(\theta_{ knee}^{i}-\theta_{hip}^{i})\\ -cos\theta_{hip}^{i}&-cos(\theta_{hnee}^{i}-\theta_{hip}^{i})\end{bmatrix} \begin{bmatrix}L_{thigh}\\ L_{shank}\end{bmatrix}  \tag{53}\]  
The computation of the displacement angle \(\theta_{1}^{i}\) and the cam radius \(R_{0}\) in the optimization problem are obtained by inverse kinematics analysis of the mechanism. Therefore, \(R_{0}\) is given in (54) and \(\theta_{1}^{i}\) in (55). \[R_{0} = max\left(\sqrt{\left(\frac{dh(\theta_{1})/d\theta_{1}\mp e}{ \tan\pi/6}-h(\theta_{1})\right)^{2}+e^{2}}\right) \tag{54}\] \[\theta_{1} = 2\atan2\left(-\bar{B}_{2}\pm\sqrt{\bar{B}_{2}^{2}+\bar{A}_{2}^{2} -\bar{C}_{2}^{2}},\bar{C}_{2}-\bar{A}_{2}\right) \tag{55}\]  
where  
\[h(\theta_{1})=s(\theta_{1})-s_{min}\] \[\theta_{2}=atan2\left(\frac{y_{D}-r_{1}\sin\theta_{1}-y_{0}}{x_{ D}-r_{1}\cos\theta_{1}-x_{0}}\right)-\eta\] \[\bar{A}_{2}=-2r_{1}(x_{D}-x_{0})\] \[\bar{B}_{2}=-2r_{1}(y_{D}-y_{0})\] \[\bar{C}_{2}=r_{1}^{2}-r_{4}^{2}+(y_{D}-y_{0})^{2}+(x_{D}-x_{0})^ {2}\] \[x_{D}=x_{p}+r_{8}\cos(\pi+\varphi_{2}-\gamma)+r_{5}\cos(\varphi _{2})\]  
\[y_{D}=x_{p}+r_{8}\sin(\pi+\varphi_{2}-\gamma)+r_{5}\sin(\varphi _{2})\] \[\varphi_{2}=2 atan2\left(\frac{\bar{B}_{1}\pm\sqrt{\bar{A}_{1}^{2} +\bar{B}_{1}^{2}-\bar{C}_{1}^{2}}}{\bar{A}_{1}+\bar{C}_{1}}\right)+\gamma\] \[\theta_{1} = 2\atan2\left(-\bar{B}_{2}\pm\sqrt{\bar{B}_{2}^{2}+\bar{A}_{2}^{2} -\bar{C}_{2}^{2}},\bar{C}_{2}-\bar{A}_{2}\right) \tag{55}\]0 \[\theta_{1} = 2\atan2\left(-\bar{B}_{2}\pm\sqrt{\bar{B}_{2}^{2}+\bar{A}_{2}^{2} -\bar{C}_{2}^{2}},\bar{C}_{2}-\bar{A}_{2}\right) \tag{55}\]1 \[\theta_{1} = 2\atan2\left(-\bar{B}_{2}\pm\sqrt{\bar{B}_{2}^{2}+\bar{A}_{2}^{2} -\bar{C}_{2}^{2}},\bar{C}_{2}-\bar{A}_{2}\right) \tag{55}\]2  
\begin{table}
\begin{tabular}{c c c c c c} \hline \(x\) & \(x_{min}\) & \(x_{max}\) & \(x\) & \(x_{min}\) & \(x_{max}\) \\ \hline \(x_{1}\) & 0.1 [m] & 0.4 [m] & \(x_{9}\) & \(-\)2.0944 [rad] & 2.0944 [rad] \\ \(x_{2}\) & 0.3 [m] & 0.6 [m] & \(x_{10}\) & \(-\)1.0472 [rad] & 3.1416 [rad] \\ \(x_{3}\) & 0.4 [m] & 0.9 [m] & \(x_{11}\) & \(-\)1.0472 [rad] & 3.1416 [rad] \\ \(x_{4}\) & 0.3 [m] & 0.7 [m] & \(x_{12}\) & \(-\)2.0944 [rad] & 2.0944 [rad] \\ \(x_{5}\) & 0.4 [m] & 0.8 [m] & \(x_{13}\) & \(-\)0.5 [m] & 0.5 [m] \\ \(x_{6}\) & 0.3 [m] & 0.7 [m] & \(x_{14}\) & \(-\)0.7 [m] & 0.3 [m] \\ \(x_{7}\),\(x_{8}\) & 0.3 [m] & 0.8 [m] & \(x_{15}\) & \(-\)0.2 [m] & 0.2 [The above equations are obtained according to the original design problem [15]. Except for the Equation (55), which is rewritten in this work from a two-argument arctangent. Equation (55) has two solutions that define the direction of crank rotation \(\theta_{1}\). In this case, the clockwise turn in the crank link is chosen. Then, the solution in (55) that presents a positive increment between two different consecutive crank positions is selected. On the other hand, the cam profile is obtained in (56) with respect to the coordinate system \(x_{0}-y_{0}\). \[\rho= \begin{bmatrix}e\cos(\alpha-\theta_{1})-\left(\sqrt{R_{0}^{2}-e^{2}}+h( \theta_{1}))\right)\sin(\alpha-\theta_{1})\\ e\sin(\alpha-\theta_{1})+\left(\sqrt{R_{0}^{2}-e^{2}}+h(\theta_{1}))\right) \cos(\alpha-\theta_{1})\end{bmatrix}  \tag{56}\]