## 4 A Workspace Visualization Method Based on a 3D-Printing Layering Concept
### Extraction of the Workspace Boundary Based on 3D-Layering Concept  
In order to simplify the problem, the concept of 3D-printing layering was used to divide the workspace into many slices along the Z direction, so that the three-dimensional space problem can be converted to a two-dimensional plane. The set of point P is defined as the workspace of the robot, and the generalized joint variables are written as parametric equations, namely  
\[\mathrm{W}=\left\{ \begin{array}{l}\mathrm{P_{x}(\theta_{i})}\\ \mathrm{P_{y}(\theta_{i})}\\ \mathrm{P_{z}(\theta_{i})}\end{array} \right.\qquad\theta_{imin}\leq\theta_{i} \leq\theta_{imax} \tag{19}\]  
where \(\theta_{i}=(\alpha_{i},\ \beta_{i},\ \gamma_{i})\). From the kinematics Equation (5), the contour boundary equation can be derived as  
\[\left(\mathrm{P_{x}+U_{x}}\right)^{2}+\left(\mathrm{P_{y}+U_{y}}\right)^{2}= \left[\mathrm{a_{3}\cos(\beta+\gamma)+a_{2}\cos\beta+a_{1}+a_{4}}\right]^{2} \tag{20}\]  
From the boundary equation, it can be seen that the boundary of the contour should be a circle or annulus in the XY plane, of which the center is  
\[\left\{ \begin{array}{l}\mathrm{r_{x}=-U_{x}}\\ \mathrm{r_{y}=-U_{y}}\end{array} \right. \tag{21}\]  
and the radius is  
\[\mathrm{r=a_{3}\cos(\beta+\gamma)+a_{2}\cos\beta+a_{1}+a_{4}} \tag{22}\]  
In order to solve the minimum and maximum problems of r, \(\gamma\) is expressed as \(\beta\) by the kinematics Equation (8), namely  
\[\cos(\beta+\gamma)=\pm\sqrt{1-\left(\frac{\mathrm{P_{z}-a_{2}\sin\beta-d_{1}+ a_{5}+U_{z}}}{\mathrm{a_{3}}}\right)^{2}} \tag{23}\]  
The above expression is substituted into Equation (22), giving  
\[\mathrm{r=\pm\sqrt{a_{3}^{2}-\left(\mathrm{P_{z}-a_{2}\sin\beta-d_{1}+a_{5}+U_ {z}}\right)^{2}}+a_{2}\cos\beta+a_{1}+a_{4}} \tag{24}\]  
As can be seen from the expression of radius r, the radius is only related to the variable \(\beta\) at a given height. According to the kinematics Formula (5) of the multijoint industrial robot, the relationship between \(\beta\) and \(\gamma\) can be obtained as  
\[\beta=\arcsin\frac{a_{3}(\mathrm{P_{z}-d_{1}+a_{5}+U_{z}})}{\sqrt{a_{2}^{2}+2 a_{2}a_{3}\cos\gamma+a_{3}^{2}}}-\arctan\frac{a_{3}\sin\gamma}{a_{2}+a_{3} \cos\gamma} \tag{25}\]  
Figure 8 is a contour of the workspace in the XZ plane. The contour is divided into four parts: FG, GM, ME, and EF. The maximum radius of the boundary of each layer of the workspace in the XY plane is on the contour segment EF, and the minimum radius is on the contour segments FG, GM, and ME. According to the structural parameters and the joint-angle stroke range of the multijoint industrial robot, the condition for forming the contour segment EF (i.e., the outer contour of the workspace) is that when the joint angle \(\gamma\) of the robot takes the maximum, that is, \(\gamma=\gamma_{\mathrm{max}}\). \[\beta=\arcsin\frac{a_{3}(\mathrm{P_{z}-d_{1}+a_{5}+U_{z}})}{\sqrt{a_{2}^{2}+2a _{2}a_{3}\cos\gamma_{\mathrm{max}}+a_{3}^{2}}}-\arctan\frac{a_{3}\sin\gamma_{ \mathrm{max}}}{a_{2}+a_{3}\cos\gamma_{\mathrm{max}}} \tag{26}\]  
Through calculation, it is found that the critical point cannot be found, that is, (\(\beta\), \(\gamma\)) cannot be found to make the above two equations simultaneously true. So the maximum and minimum of f(\(\beta\), \(\gamma\)) has to be on the boundary of D, as follows:  
\[\left\{ \begin{array}{l}\mathrm{z}_{\mathrm{max}}=\mathrm{max}\{\mathrm{f}( \beta_{\mathrm{min}},\gamma_{\mathrm{min}}),\mathrm{f}(\beta_{\mathrm{max}}, \gamma_{\mathrm{min}}),\mathrm{f}(\beta_{\mathrm{min}},\gamma_{\mathrm{max}}),\mathrm{f}(\beta_{\mathrm{max}},\gamma_{\mathrm{max}})\}\\ \mathrm{z}_{\mathrm{min}}=\mathrm{min}\{\mathrm{f}(\beta_{\mathrm{min}},\gamma _{\mathrm{min}}),\mathrm{f}(\beta_{\mathrm{max}},\gamma_{\mathrm{min}}), \mathrm{f}(\beta_{\mathrm{min}},\gamma_{\mathrm{max}}),\mathrm{f}(\beta_{ \mathrm{max}},\gamma_{\mathrm{max}})\}\end{array} \right.