# Research on Process Quality Prediction and Control of Spindle Housings in Flexible Production Lines
## 5 Process Quality Monitoring and Evaluation of Flexible Production Line for Spindle Housing  
### Joint Control Based on EWMA  
An SPC control chart is a tool to monitor process quality and record quality data to achieve control. However, a control chart application analysis requires many data samples to support it, and there are problems such as weak detection ability and leakage due to the influence of data changes in time and space. Compared with the principle of a conventional control chart, an exponentially weighted moving average (EWMA) control chart is a control chart constructed using time weights and the number of restricted S, which can achieve the detection and analysis of any size offset in the process. Therefore, a joint EWMA and process quality control method is adopted to effectively improve the SPC quality control method.  
The quality data are organized into subgroups, and each subgroup's mean and extreme deviation R are calculated. The control chart is built according to the principle to monitor the production line's processing quality status. Let this sample subgroup's total number of observations be n and the individual observation be x, as shown in Equation (17):  
\[\overline{X}=\frac{\sum\limits_{i=1}^{n}x_{i}}{n};R=x_{\text{max}}-x_{\text{ min}};(n=1,2,\ldots,n) \tag{17}\]  
where \(x_{i}\) is the sample detection value, \(x_{max}\) is the maximum value in subgroup samples, and \(x_{min}\) is the minimum value in subgroup samples. Then, in order to obtain the control line of the mean control chart, it is necessary to calculate the average value of the subgroup mean and the average value of the subgroup extreme difference, as in Equation (18):  
\[\overline{X}=\frac{\sum\limits_{i=1}^{n}\overline{X_{i}}}{n};\overline{R}= \frac{\sum\limits_{i=1}^{n}\overline{R_{i}}}{n};(n=1,2,\ldots,n) \tag{18}\]  
Then, the control line of the control chart is drawn as shown in Equation (19):  
\[\left\{\begin{array}{l}UCL_{\overline{x}}=\overline{\overline{X}}+A_{3} \overline{R}\\ CL_{\overline{x}}=\overline{\overline{X}}\\ LCL_{\overline{x}}=\overline{\overline{X}}-A_{3}\overline{R}\end{array}\right. \tag{19}\]  
Then, the control line of the control chart is drawn as shown in Equation (20):  
\[\left\{\begin{array}{l}UCL_{s}=D_{4}\overline{S}\\ CL_{s}=\overline{S}\\ LCL_{s}=D_{3}\overline{S}\end{array}\right. \tag{20}\]  
A3, D3, and D4 are unbiased constants corresponding to the sample mean or extreme deviation.  
In order to more precisely identify minor deviations of the quality data in the monitored area, the exponentially weighted moving average method is used to weigh the measured values for each data set to build the EWMA control chart. To construct an attribute-specific control chart applicable to the spindle box based on this principle, first, it is necessary to calculate the statistic Zi that determines the control chart, as shown in Equation (21):  
\[Z_{i}=\lambda X_{i}+(1-\lambda)Z_{i-1} \tag{21}\]  
where \(\lambda\) is the weight constant, which is usually 0 \(<\lambda<\) 1. The initial value \(Z_{0}\) takes the target value of process quality control, which is \(Z_{0}=\text{E}(\text{x})=\mu_{0}\).  
When the observations are independent random variables, the EWMA statistic's variance is as shown in Equation (22):\[\sigma_{zi}^{2}=\sigma(\frac{\lambda}{2-\sigma})\Big{[}1-(1-\lambda)^{2i}\Big{]} \tag{22}\]  
where \(\sigma\) is the standard deviation of the sample data.  
The control chart is constructed based on the statistics of EWMA and its variance, where the control line of the control chart is as shown in Equation (23):  
\[\left\{\begin{array}{l}UCL=\mu_{0}+L\sigma\sqrt{\frac{\lambda}{2-\lambda} \Big{[}1-(1-\lambda)^{2i}\Big{]}}\\ CL=\mu_{0}\\ LCL=\mu_{0}-L\sigma\sqrt{\frac{\lambda}{2-\lambda}\Big{[}1-(1-\lambda)^{2i} \Big{]}}\end{array}\right. \tag{23}\]  
where L is the width coefficient of the control line, which generally takes the value L = 3; and \(0.05\leq\lambda\leq 0.25\), the smaller \(\lambda\) value in the range applies to smaller offsets.