## 2 Materials and Methods
### Optimization Framework
\[T_{t}=\left\{T_{i}:d_{i}<L\right\},\ i=1\ldots N \tag{7}\]  
\[V=Volume(conv(T_{t})) \tag{8}\]  
The reachability ratio is defined as Equation (9), where \(\#[id_{i}<L]\) denotes the number of tracking points for which the distance \(d_{i}\) is less than \(L\). The centroid of the tip points is represented in Equation (10) and the spread of the points is defined in Equation (11). \[r=\frac{\#\{i:d_{i}<L\}}{N} \tag{9}\]  
\[C=\frac{1}{|T|}\sum_{T_{i}\in T}T_{i} \tag{10}\]  
\[\left\{P_{i}\in\mathbb{R}^{3}\ |\ i=1,2,\ldots,N\right\} \tag{2}\]0  
The third step of the algorithm implies the fuzzification of performance metrics. The Fuzzy Inference System (FIS) maps the three inputs (r, V, and S) to a penalty value P. The objective functions are defined in Equation (12); thus, the multi-objective optimization problem is presented in Equation (13), subject to Equation (14). The goal of multi-objectiveoptimization is to find the optimal RCM that maximizes both the reachable workspace volume and reachability ratio \(r\). \[\left\{ \begin{array}{l}f_{1}(R)=-V+P\\ f_{2}(R)=-r\end{array} \right. \tag{12}\]  
\[\underset{R\in\mathbb{R}^{3}}{\min}f(R)=(f_{1}(R),f_{2}(R)) \tag{13}\]  
\[R\in\{R:R\in[x_{\min},x_{\max}]\times[y_{\min},y_{\max}]\times[z_{\min},z_{\max }],R_{z}\geq\max_{i}\{P_{i,z}\}+1\}. \tag{14}\]  
The optimization algorithm was implemented in MATLAB using Global Optimization Toolbox and Fuzzy Logic Toolbox. For the genetic algorithm, the multi-objective function gamultiobj was used while for the fuzzy system, the Type II Mamdani FIS [30] was preferred. The FIS used to assess the fitness of the population during the genetic algorithm I presented in Figure 3. The FIS uses three input functions defined as Ratio, Volume, and Spread, with each function defined by three membership functions, and an output function named Penalty presented in Figure 4. The membership functions were determined based on the input points. Each input/output is a linguistic term for the FIS. A linguistic term in fuzzy logic is characterized by a variable whose values are words or sentences rather than numbers. A common and detailed mathematical formulation for a linguistic term in fuzzy logic is to define it as a five-tuple:  
\[X=(X,T(X),U,G,M) \tag{15}\]  
where X is the name of the linguistic variable (\"Ratio\", \"Volume\", \"Spread\", and \"Penalty\" in our case); T(X) is the term set, i.e., the collection of linguistic values (words) used to describe X (\"Low\", \"Medium\", or \"High\" in our case); U is the universe of discourse over which the variable is defined (Ratio [0,1], Volume [0 mm3,1,000,000 mm3], Spread [0 mm, 450 mm], Penalty [0,100], Figure 4); \(G\) is the syntactic rule or grammar that specifies how the terms in T(X) can be generated or combined. In our case, these values were determined based on input point set of the genetic algorithm. M is the semantic rule that assigns meaning to the linguistic term by mapping each term to a fuzzy set over \(U\). For each \(A\in T(X)\), there is an associated membership function, \(\mu_{A}:U\rightarrow[0,1]\), which quantifies the degree to which any \(x\in A\) is interpreted as the degree \(\mu_{A}(x)\). Thus, for a given \(x\in U\) and a linguistic term \(A\in T(X)\), the semantic evaluation is \"\(x\) is \(A\)\" \(\Leftrightarrow\)\(\mu_{A}(x)\in[0,1]\). The fourth step of the algorithm actually contains the use of the FIS and development of the rules. The fuzzy rules define how the input membership functions influence the output membership functions. These rules are based on expert knowledge and ensure optimal robotic performance. The FIS rules are built as a series of IF- AND/OR -THEN expressions based on the expert's opinion. If the expert's opinion is not available, then the FIS requires a number of rules equivalent to the cubic number of inputs (no_of_inputs3). But through computing, several rules can be eliminated if they do not influence the output.