# Trajectory Classification and Recognition of Planar Mechanisms Based on ResNet18 Network
## 2 Sample Construction
### Construction of Samples for Single-Loop Hinge Six-Bar Mechanism  
The single-loop hinge six-bar mechanism is a mechanism with three degrees of freedom, structurally more complex, and capable of meeting some intricate design tasks. Among them, the structure with three cranks as active components is very common. There are three common types of three-crank single-loop hinge six-bar mechanisms, as shown in Figure 5, referred to as Class A, Class B, and Class C.  
For Class A and Class B mechanisms, it is necessary to solve for \(\varphi_{3}\) and \(\varphi_{4}\). After derivation, the following formulas are obtained:  
\[\varphi_{3}=2 tan^{-1}(\frac{B_{0}\mp\sqrt{A_{0}^{2}+B_{0}^{2}-C_{0}^{2}}}{A_{ 0}+C_{0}})\]  
\[\varphi_{4}=tan^{-1}\frac{asin\varphi_{1}+bsin\varphi_{2}+csin\varphi_{3}-esin \varphi_{5}}{acos\varphi_{1}+bcos\varphi_{2}+ccos\varphi_{3}-ecos\varphi_{5}-f}\]  
\[A_{0}=2c(-ecos\varphi_{5}-f+acos\varphi_{1}+bcos\varphi_{2})\]  
\[B_{0}=2c(-esin\varphi_{5}+asin\varphi_{1}+bsin\varphi_{2})\]  
\[C_{0}=a^{2}+b^{2}+c^{2}-d^{2}+e^{2}+f^{2}+2 efcos\varphi_{5}-2 afcos\varphi_{1} -2 bfcos\varphi_{2}-\]  
\[2 aecos(\varphi_{1}-\varphi_{5})+2 abcos(\varphi_{1}-\varphi_{2})-2 becos(\varphi _{2}-\varphi_{5})\]  
where the positive configuration is denoted by '\(-\)' and the inverted configuration is denoted by '+'.  
Thus, the coordinates of the trajectory point P in the Class A mechanism can be expressed as shown in Equation (6).  
\[\left\{\begin{aligned} x_{p}&=acos\varphi_{1}+bcos \varphi_{2}+gcos(\alpha+\varphi_{3})\\ y_{p}&=asin\varphi_{1}+bsin\varphi_{2}+gsin(\alpha+ \varphi_{3})\end{aligned}\right. \tag{6}\]  
In the Class B mechanism, the coordinates of the trajectory point P can be expressed as shown in Equation (7).  
\[\left\{\begin{aligned} x_{p}&=f+ecos\varphi_{5}+gcos (\varphi_{4}-\alpha)\\ y_{p}&=esin\varphi_{5}+gsin(\varphi_{4}-\alpha) \end{aligned}\right. \tag{7}\]  
Similarly, for the Class C mechanism, it is necessary to solve for \(\varphi_{4}\). After derivation, the following formula is obtained:  
\[\varphi_{4}=2 tan^{-1}(\frac{B_{0}\mp\sqrt{A_{0}^{2}+B_{0}^{2}-C_{0}^{2}}}{A_ {0}+C_{0}})\]  
\[A_{0}=2d(-f+acos\varphi_{1}+bcos\varphi_{2}+ccos\varphi_{3})\]  
Figure 5: Hinge six-bar mechanism model diagram. (**a**) Class A. (**b**) Class B. (**c**) Class C.  
\[B_{0}=2d(asin\varphi_{1}+bsin\varphi_{2}+csin\varphi_{3})\]  
\[C_{0}=a^{2}+b^{2}+c^{2}+d^{2}-e^{2}+f^{2}-2 cfcos\varphi_{3}-2 afcos\varphi_{1}-2 bf cos \varphi_{2}+\]  
\[2 accos(\varphi_{1}-\varphi_{3})+2 abcos(\varphi_{1}-\varphi_{2})+2 becos(\varphi_ {2}-\varphi_{3})\]  
where the positive configuration is denoted by '\(-\)' and the inverted configuration is denoted by '\(+\)'.  
So, for the Class C mechanism, the trajectory of point P is given by Equation (8).  
\[\left\{\begin{aligned} x_{P}&=f+ecos\varphi_{5}+ gcos(\varphi_{4}-\alpha)\\ y_{P}&=esin\varphi_{5}+gsin(\varphi_{4}-\alpha) \end{aligned}\right. \tag{8}\]  
In the single-loop hinge six-bar mechanisms, Class A and Class B need to satisfy the constraint condition shown in Equation (9), while Class C needs to satisfy the constraint condition shown in Equation (10). In this way, these mechanisms can all meet the link length requirements for six-bar mechanisms and ensure that the three prime movers are all cranks.  
\[\left\{\begin{aligned} c+d\geq a+b+e+f\\ |c-d|&\leq min\{|a-b-e-f|,\\ |b-a-e-f|,|e-a-b-f|,\\ |f-a-b-e|\}\end{aligned}\right. \tag{9}\]  
\[\left\{\begin{aligned} d+e\geq a+b+c+f\\ |d-e|&\leq min\{|a-b-c-f|,\\ |b-a-c-f|,|c-a-b-f|,\\ |f-a-b-c|\}\end{aligned}\right. \tag{10}\]  
The samples of the single-loop hinge six-bar mechanism include four classes for regular and inverted configurations. When the transmission ratio of the three actuators is 1, the ranges of various parameters are limited to \(0<(a,b,c,d,e,f,g)\leq 1,0\leq\alpha\leq 2\pi\). The coordinate axis of the image is set to \((-3,\,3)\). For the six-bar mechanism with three actuators having a speed ratio of 1:1:1, samples are generated using Class A, Class B, and Class C mechanisms.