当前位置:网站首页>Calculation formula related to tolerance analysis

Calculation formula related to tolerance analysis

2022-04-23 16:53:00 Tassel 1990

1、 Analysis of dimension chain formula : The inverse Polish algorithm is used to solve the parsing of string expression , for example K=A+B-C

2、 According to the dimension chain formula, each factor is obtained , And get the component number and the number of factors

3、 Fill in the average and standard deviation of each component ( If there is sample data, use the sample data for effective calculation to obtain the mean value and standard deviation )

4、 Generate simulation data according to the average value and standard deviation of each component ( The number of simulations should be filled in )

4.1、 use boost High quality library generation Random number conforming to normal distribution

5、 Loop traversal Simulation times , And according to the dimension chain formula , obtain K An array of values , as follows :

// Number of factors 
int factorCount = this.keyPairDataList.Keys.Count;
// According to the formula K value 
double[] kValueList = new double[sumCount];
RPN rpn = new RPN();
string formula = string.Empty;
for (int index = 0; index < sumCount; index++)
{
    formula = "A+B-C";
    foreach (string strPair in this.keyPairDataList.Keys)
        formula = formula.Replace(strPair, this.keyPairDataList[strPair].ElementAt(index).ToString());
    if (rpn.Parse(formula))
        kValueList[index] = Convert.ToDouble(rpn.Evaluate());
}

6、 Calculation K The standard deviation and average of the value array

7、 According to the upper specification limit 、 Lower specification limit 、 The goal is CPK Calculate the reference standard deviation and the reference average . The formula is as follows :

7.1、 Reference average :( Upper specification limit + Lower specification limit )/2

7.2、 Reference standard deviation :( Upper specification limit - Lower specification limit )/( The goal is CPK*6)

8、 The variance is calculated according to the standard deviation , The formula is as follows :

8.1、 Reference variance : The standard deviation of the reference square

9、 Calculate sensitivity

9.1、 Determine the sensitivity formula ( The formula 1: Sensitivity = Difference value /(∑Math.abs( Difference value )+0.00001), The formula 2: Sensitivity =( Difference value / Math.Abs( Difference value )) * Math.Pow( Difference value , 2) * Math.Pow( The standard deviation of the current number of factors , 2) / Reference variance )

9.2、 Difference calculation :

9.2.1、 According to the dimension chain formula and the average value of each component ( Bring the average value into the formula ), To calculate the Y value ;

9.2.2、 To calculate the y1 ,

9.2.2.1、 Calculate the current component, then the average value of the current component +1, Bring in dimension chain formula , To calculate the y1 value .

9.2.2.2、 Difference value =Y It's worth it y1 The difference between the values ;

9.2.3、∑Math.abs( Difference value )= The sum of the difference of each component ;

9.2.4、 Sensitivity = Sensitivity = Component difference /(∑Math.abs( Difference value )+0.00001)

10、 optimal design

10.1、 Select the project with the largest sensitivity factor for optimization , Adjusted mean 、 Adjust the standard deviation

10.1.1、 Adjusted mean , Then regenerate the simulation data for calculation obtain CPK The value of is within a reasonable range ( And target CPK The difference is 0.01 about )

10.1.2、 Adjust the standard deviation , Then regenerate the simulation data for calculation obtain CPK The value of is within a reasonable range ( And target CPK The difference is 0.01 about )

10.1.3、 First determine the adjustment direction , Make numerical adjustment in turn .

10.2、 When multiple factors are selected, they can be adjusted according to the proportion , If each factor is adjusted 50%

10.3、 The calculation logic is listed below :

10.3.1、 The absolute value of sensitivity is arranged from large to small , And exclude the factor of freezing adjustment

10.3.2、 Even if the target value , The goal is CPK=( Manual input ), Target average =( Upper specification limit + Lower specification limit )/2, Target standard deviation =( Target average - Lower specification limit )/(3* The goal is CPK)

10.3.4、 Calculate how many factors need to be adjusted

10.3.4.1、 Loop through the current factor

10.3.4.2、 Sets the standard deviation of the current factor = The lower limit of the standard deviation of the current factor

10.3.4.3、 Generate simulation data , To calculate the Y The average value of is equal to Y Standard deviation , as well as CPK

10.3.4.4、 When it is determined that the calculated standard deviation is less than the target standard deviation, proceed to break, And get how many factors need to be changed

10.3.5、 Confirm the number of factors to be changed , And traverse

10.3.6、while(true) Cycle calculation , The simulation data is generated by the average value of the factor and the standard deviation of the factor , And calculate Y The average value of is equal to Y Standard deviation , as well as CPK

10.3.7、 Calculate the difference in the average =Y Average value - Target average ;

10.3.8、 progress step=( The difference in the average /2)/ Sensitivity of current factor

10.3.9、 Set the average value of the next calculation = The average value of the current factor + progress step;

10.3.10、 Calculate the standard deviation difference =Math.Sqrt(Math.Abs(Math.Pow(Y Standard deviation , 2) - Math.Pow( Target standard deviation , 2)));

10.3.11、 Standard deviation improvement step=Math.Sqrt(Math.Pow( Standard deviation difference , 2) / 2);

10.3.12、Y If the standard deviation of is less than the target standard deviation, then , Take the opposite direction

10.3.13、 Set the standard deviation of the next calculation = The standard deviation of the current factor - Standard deviation improvement step

10.3.4、 Set the calculated CPK When it is greater than the target standard deviation, the cycle is pushed out

版权声明
本文为[Tassel 1990]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231359253569.html