## 3 Cascaded Fuzzy Reward System (CFRS)
### Fuzzy System  
In this study, we use these defined parameters as input for fuzzy evaluation: safety distance cost \(r_{aff}\), motion range cost \(r_{lim}\), and positional error \(r_{pos}\). We have segmented the fuzzy sets of the FRS into five intervals: {VB, B, M, G, VG}, corresponding, respectively, to Very Bad, Bad, Medium, Good, and Very Good. For an FRS with three inputs, the number of fuzzy rules can be as high as 125. Managing such a large rule set is complex and time-consuming, potentially impacting the algorithm's learning efficiency. Therefore, we adopt a two-layer FS, reducing the rule number for a 3-input FRS to 50. As shown in Figure 4, the first layer of the two-layer FRS includes an independent FS, taking \(r_{aff}\) and \(r_{lim}\) as inputs. The output of the first layer, combined with \(r_{pos}\), serves as the input for the second-layer FS, allowing further inference. The output of the second-layer FS represents the reward value integrating all three input factors. Within this two-layer FRS, the total number of rules in the system is reduced to 50. The aforementioned parameters are normalized within the range (0, 1) and input into the system. Triangular MFs, as per Equation (5), are used for fuzzification, transforming each parameter into five fuzzy values: VG, G, M, B, and VB. \[f(x)= \begin{cases}0&x\leq a\\ \frac{x-a}{b-a}&a\leq x\leq b\\ \frac{c-a}{c-b}&b\leq x\leq c\\ 0&x\geq c\end{cases}  \tag{5}\]  
The parameters \(a\), \(b\), and \(c\) in Equation (5) represent values within the triangular MFs, where a and c determine the width of the function, and b determines its position. After parameter fuzzification, fuzzy inference is conducted based on the established rule base. A rule base, as shown in Table 1, is formulated based on the experiences of path planning for textile robotic arms. Additionally, the AND operation it is used for fuzzy inference. \[R_{i}(x)=\min\Bigl{(}\mu_{A(i)}(x),\mu_{B(i)}(x)\Bigr{)} \tag{6}\]  
In this context, A and B represent fuzzy sets. The AND operation computes the minimum of the membership degrees of both sets, and the output fuzzy value's membership degree is determined based on the rule base. Subsequently, the obtained fuzzy values undergo a defuzzification process. Since numerous fuzzy values are produced following fuzzy inference, which are not directly usable; a defuzzification method is employed to obtain clear values that meet our requirements. In our study, the centroid method is utilized for defuzzification. Concurrently, we introduce reward weights to balance the importance among different objectives. The weights for the safety distance cost, motion range cost, and positional error are designated as \(C_{1}\), \(C_{2}\), and \(C_{3}\), respectively. The selection of \(C_{i}\) typically depends on the specific task requirements and environmental conditions. For instance, in a variable industrial environment where a robotic arm might need to respond to sudden situations, such as emergency obstacle avoidance in a task site, safety may take precedence over motion time, thereby prioritizing \(C_{3}\) over \(C_{1}\). Conversely, if motion time is more critical than energy consumption then \(C_{1}\) would be favored over \(C_{2}\). In an open warehouse environment where the robotic arm is responsible for moving heavy objects, the efficiency of the motion range becomes more significant, thus necessitating an increased weight for \(C_{1}\) to optimize path-planning efficiency. Meanwhile, due to less stringent safety requirements in such open spaces, the weight for \(C_{3}\) is comparatively lower. In a high-risk textile-workshop environment, where the robotic arm operates in tight spaces, safety is paramount. Therefore, \(C_{3}\) is assigned the highest weight to ensure the robotic arm maintains a safe distance and prevents collisions with surrounding objects. In contrast, the weights for \(C_{1}\) and \(C_{2}\) are relatively low in this scenario.