## 4 Study Cases in the Mechanism Synthesis for Lower Limb Rehabilitation
### Case 3: Eight-Bar Linkage Mechanism  
Case 3 includes an eight-bar linkage mechanism for rehabilitation of the lower limbs. This mechanism has been designed for rehabilitation routines for the average anthropometry for the Mexican population [3]. The integration among the kinematic synthesis, the link shape design, and the mechanism dynamics are considered for its design. The schematic diagram of the mechanism is displayed in Figure 3(a).  
According to Figure 3(a), the design variables vector \(x\) is defined by (57).  
\[x=[\bar{p}_{ki},\bar{p}_{sh}]\in R^{107} \tag{57}\]  
This vector is split into two kinds of parameters, the kinematic parameter vector \(\bar{p}_{ki}=[l_{1},l_{2},\dots,l_{9},l_{6}^{\prime},l_{6}^{\prime},\theta_{1},\theta_{9},\bar{\theta}_{6},\bar{\theta}_{8},x_{ini},y_{ini},\theta_{1}^{2}, \theta_{2}^{2},\dots,\theta_{2}^{n_{f}}]^{T}\in R^{17+n_{f}}\) and the shape parameter vector \(\bar{p}_{sh}=[b_{2},\dots,b_{8},\)\(c_{2},\dots,c_{8},d_{2},\dots,d_{8},e_{2},\dots,e_{8},f_{2},\dots,f_{8},g_{2},\)\(\dots,g_{8},h_{2},\dots,h_{8},\)\(i_{2},\dots,i_{8},j_{2},\dots,j_{8},k_{2},\dots,k_{8}]^{T}\in R^{70}\). The shape parameters define the octagonal link shape shown in Figure 3(b) and the link dynamic parameters, such as the masses, the mass centers, and the inertia of links.  
The synthesis problem for the eight-bar linkage mechanism is presented in (58)-(84).  
The design objectives in (58) are weighted by parameters \(w_{1}=1\) and \(w_{2}=1e-6\). The first term refers to the average error between the precision points \((x_{E}^{i},y_{E}^{i})\) and the points \((x_{E}^{i},y_{E}^{i})\) generated by the mechanism's coupler link. The desired precision points \([x_{E}^{i},y_{E}^{i}]\) are defined as a semi-elliptical rehabilitation trajectory. Those points are shown in Table A3 of Appendix A. On the other hand, the points \([x_{E}^{i},y_{E}^{i}]\) are set by the direct kinematics of the mechanism, as shown in (85). For more details of the analysis, see [3].  
Figure 4: Eight-bar linkage mechanism and the link shape.  
\[\underset{x}{\text{Min}}\,w_{1}\frac{\sum_{i=1}^{n_{f}}[(\hat{\pi}_{E}^{i}-x_{E}^{i })^{2}+(\hat{g}_{E}^{i}-y_{E}^{i})^{2}]}{n_{f}}+w_{2}\frac{\sum_{i=1}^{n_{f}} \tau^{2}}{n_{f}} \tag{58}\]  
subject to:  
\[g_{1}:l_{2}+l_{1}-l_{3}-l_{4}\leq 0 \tag{59}\] \[g_{2}:-l_{4}-l_{1}+l_{2}+l_{3}\leq 0\] (60) \[g_{3}:-l_{3}-l_{1}+l_{2}+l_{4}\leq 0\] (61) \[g_{4}:l_{2}+l_{9}-l_{3}-l_{6}^{\prime}\leq 0\] (62) \[g_{5}:-l_{6}^{\prime}-l_{9}+l_{2}+l_{3}\leq 0\] (63) \[g_{6}:-l_{3}-l_{9}+l_{2}+l_{6}^{\prime}\leq 0\] (64) \[g_{7}:\frac{\pi}{4}-\cos^{-1}\left(\frac{l_{3}^{2}+l_{4}^{2}-(l _{1}-l_{2})^{2}}{2l_{3}l_{4}}\right)\leq 0\] (65) \[g_{8}:\frac{\pi}{4}-\cos^{-1}\left(\frac{l_{5}^{2}+{l_{6}^{ \prime}}^{2}-(l_{9}-l_{2})^{2}}{2l_{5}l_{6}^{\prime}}\right)\leq 0\] (66) \[g_{9}:\cos^{-1}\left(\frac{l_{3}^{2}+l_{4}^{2}-(l_{1}+l_{2})^{2} }{2l_{3}l_{4}}\right)-\frac{3\pi}{4}\leq 0\] (67) \[g_{10}:\cos^{-1}\left(\frac{l_{5}^{2}+{l_{6}^{\prime}}^{2}-(l_{9 }+l_{2})^{2}}{2l_{5}l_{6}^{\prime}}\right)-\frac{3\pi}{4}\leq 0\] (68) \[g_{11}:\theta_{8}-\theta_{7}+2\pi-\frac{3\pi}{4}\leq 0\] (69) \[g_{12}:\frac{\pi}{4}-\theta_{8}-\theta_{7}+2\pi\leq 0\] (70) \[g_{1328}:Fc_{min}-\frac{\sigma_{adm}}{\sigma_{k_{s}}}\leq 0\] (71) \[g_{29:35}:h_{s}+i_{s}-b_{s}-l_{s}-d_{s}\leq 0\] (72) \[g_{36:42}:j_{s}+k_{s}-b_{s}-l_{s}-d_{s}\leq 0\] (73) \[g_{43:44}:\psi_{s}-\sqrt{x_{K_{s}}^{2}+y_{K_{s}}^{2}}+\phi_{s}\leq 0\] (74) \[g_{45:46}:\psi_{s}-\sqrt{(x_{K_{s}}-x_{B_{s}})^{2}+(y_{K_{s}}-y_{ B_{s}})^{2}}+\phi_{s}\leq 0\] (75) \[g_{47:62}:-y_{K_{s}}-\frac{c_{s}}{2}-g_{s}+\zeta_{s}+\frac{\phi_ {s}}{2}\leq 0 \tag{76}\]