CN114861879A - Modeling method for optimizing thermal error of electric spindle of Elman neural network based on longicorn whisker algorithm - Google Patents
Modeling method for optimizing thermal error of electric spindle of Elman neural network based on longicorn whisker algorithm Download PDFInfo
- Publication number
- CN114861879A CN114861879A CN202210480474.5A CN202210480474A CN114861879A CN 114861879 A CN114861879 A CN 114861879A CN 202210480474 A CN202210480474 A CN 202210480474A CN 114861879 A CN114861879 A CN 114861879A
- Authority
- CN
- China
- Prior art keywords
- neural network
- elman neural
- thermal error
- longicorn
- formula
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013528 artificial neural network Methods 0.000 title claims abstract description 60
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 43
- 238000000034 method Methods 0.000 title claims abstract description 25
- 241001481710 Cerambycidae Species 0.000 title claims abstract 17
- 238000012549 training Methods 0.000 claims abstract description 24
- 238000005457 optimization Methods 0.000 claims abstract description 16
- 238000003062 neural network model Methods 0.000 claims abstract description 7
- 238000004458 analytical method Methods 0.000 claims abstract description 6
- 238000012360 testing method Methods 0.000 claims description 8
- 238000007621 cluster analysis Methods 0.000 claims description 5
- 241000283690 Bos taurus Species 0.000 claims 1
- 206010013911 Dysgeusia Diseases 0.000 claims 1
- 238000010606 normalization Methods 0.000 claims 1
- 238000012216 screening Methods 0.000 claims 1
- 238000006467 substitution reaction Methods 0.000 claims 1
- 238000003064 k means clustering Methods 0.000 abstract description 2
- 241000254173 Coleoptera Species 0.000 description 36
- 230000006870 function Effects 0.000 description 25
- 238000009529 body temperature measurement Methods 0.000 description 7
- 210000002569 neuron Anatomy 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 6
- 238000010219 correlation analysis Methods 0.000 description 5
- 238000012546 transfer Methods 0.000 description 4
- 230000006978 adaptation Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 238000003754 machining Methods 0.000 description 2
- 230000000306 recurrent effect Effects 0.000 description 2
- 238000010845 search algorithm Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000004205 output neuron Anatomy 0.000 description 1
- 230000036316 preload Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/10—Geometric CAD
- G06F30/17—Mechanical parametric or variational design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/082—Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2119/00—Details relating to the type or aim of the analysis or the optimisation
- G06F2119/08—Thermal analysis or thermal optimisation
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Evolutionary Computation (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- Geometry (AREA)
- Life Sciences & Earth Sciences (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Molecular Biology (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computer Hardware Design (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Probability & Statistics with Applications (AREA)
- Medical Informatics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种基于天牛须算法优化Elman神经网络的电主轴热误差建模方法,属于高速电主轴热误差分析领域。The invention relates to an electric spindle thermal error modeling method based on the Elman neural network optimization based on the long beetle algorithm, and belongs to the field of high-speed electric spindle thermal error analysis.
背景技术Background technique
电主轴作为高速数控机床的关键部件,运转过程中产生大量的热量,导致主轴零件热膨胀或刀具变形,影响电主轴的精度甚至轴承的预紧力,进而影响机床的加工精度及使用寿命。因此,降低高速电主轴热误差是高速精密加工技术发展的关键。热误差补偿法不需要改变电主轴的机械属性(结构、材料等),基于建立热误差预测模型,提前预知热误差的大小,通过补偿的手段避免误差,是最为经济有效的方法。As a key component of high-speed CNC machine tools, the motorized spindle generates a lot of heat during operation, which leads to thermal expansion of spindle parts or tool deformation, which affects the accuracy of the motorized spindle and even the preload of the bearing, which in turn affects the machining accuracy and service life of the machine tool. Therefore, reducing the thermal error of the high-speed motorized spindle is the key to the development of high-speed precision machining technology. The thermal error compensation method does not need to change the mechanical properties (structure, materials, etc.) of the electric spindle. Based on the establishment of a thermal error prediction model, the size of the thermal error is predicted in advance, and the error is avoided by means of compensation. It is the most economical and effective method.
Elman神经网络是是在BP网络的结构基础上增加了局部记忆单元的动态递归神经网络,通过存储内部状态使其具备映射动态特征的功能,从而使系统具有适应时变特性的能力和更优的学习能力,可以用来解决快速寻优、拟合、回归预测等问题,适用于电主轴热误差建模。Elman neural network is a dynamic recurrent neural network with a local memory unit added to the structure of the BP network. By storing the internal state, it has the function of mapping dynamic features, so that the system has the ability to adapt to time-varying characteristics and better performance. The learning ability can be used to solve problems such as rapid optimization, fitting, regression prediction, etc. It is suitable for modeling the thermal error of the electric spindle.
Elman神经网络同样不可避免的具有容易陷入局部极值,收敛速度慢,效率低等缺点。现有技术中将种群进化算法与神经网络相结合来优化Elman神经网络的权值和阈值,但都存在收敛速度慢、计算量大等缺点,而天牛须算法是一种单体搜索算法,具有原理简单、参数少、计算量小等优点。因此提出利用天牛须算法优化Elman神经网络的权值和阈值,建立了一种基于天牛须算法优化 Elman神经网络的电主轴热误差模型。Elman neural network also inevitably has shortcomings such as easy to fall into local extreme value, slow convergence speed and low efficiency. In the prior art, a population evolution algorithm is combined with a neural network to optimize the weights and thresholds of the Elman neural network, but both have disadvantages such as slow convergence speed and large amount of calculation. It has the advantages of simple principle, few parameters and small amount of calculation. Therefore, it is proposed to optimize the weights and thresholds of the Elman neural network by using the long beetle algorithm, and establish a thermal error model of the electric spindle based on the long beetle algorithm to optimize the Elman neural network.
发明内容SUMMARY OF THE INVENTION
针对现有的电主轴热误差预测方法的不足,本发明提出一种基于天牛须算法优化Elman神经网络的电主轴热误差建模方法,其特点在于利用天牛须算法优化Elman神经网络的权值和阈值,天牛须算法具有实现简单、寻优速度快及全局搜索能力强等优点,弥补Elman神经网络自身连接权值和阈值选择问题上存在的随机性缺陷,从而使Elman神经网络具有较强的收敛性,提高了Elman 神经网络的学习能力和泛化能力,与单一的神经网络模型相比,具有更高的预测精度。In view of the deficiencies of the existing electric spindle thermal error prediction methods, the present invention proposes an electric spindle thermal error modeling method based on the Elman neural network optimized by the beetle algorithm, which is characterized by using the beetle algorithm to optimize the weight of the Elman neural network value and threshold, the beetle algorithm has the advantages of simple implementation, fast optimization speed and strong global search ability, which makes up for the randomness defects in the selection of connection weights and thresholds of Elman neural network itself, so that Elman neural network has better performance. The strong convergence improves the learning ability and generalization ability of Elman neural network, and has higher prediction accuracy than a single neural network model.
本发明解决其技术问题所采用的技术方案是:The technical scheme adopted by the present invention to solve its technical problems is:
本发明提供了一种基于天牛须算法优化Elman神经网络电主轴热误差建模方法,包括如下步骤:The invention provides a method for optimizing the thermal error modeling of Elman neural network electric spindle based on the beetle algorithm, comprising the following steps:
步骤一:采集高速电主轴不同转速下的温度和热误差数据,并将采集的数据划分为训练集和测试集;Step 1: Collect the temperature and thermal error data at different speeds of the high-speed motorized spindle, and divide the collected data into a training set and a test set;
步骤二:利用K-means聚类分析和灰色关联度分析对温度测点进行优化,构造模型的输入和输出;Step 2: Use K-means cluster analysis and gray correlation analysis to optimize the temperature measurement points, and construct the input and output of the model;
步骤三:初始化Elman神经网络模型参数和天牛须算法参数;Step 3: Initialize Elman neural network model parameters and beetle algorithm parameters;
步骤四:利用天牛须算法通过迭代更新优化Elman神经网络的各网络层的连接权值和阈值,建立BAS-Elman神经网络电主轴热误差预测模型。Step 4: Optimize the connection weights and thresholds of each network layer of the Elman neural network through iterative update using the beetle of the beetle algorithm, and establish a BAS-Elman neural network electric spindle thermal error prediction model.
进一步地,所述步骤一具体为:采集高速电主轴不同转速下的若干个温度测点的温度和热误差数据,并根据转速将采集的数据划分为训练集和测试集;。Further, the first step is specifically: collecting temperature and thermal error data of several temperature measuring points at different rotational speeds of the high-speed electric spindle, and dividing the collected data into a training set and a test set according to the rotational speed;
进一步地,所述步骤二具体为:Further, the step 2 is specifically:
(1)利用K-means聚类分析,将若干个温度测点分成所需类数;(1) Using K-means cluster analysis, several temperature measurement points are divided into the required number of categories;
(2)利用灰色关联度分析,从各组中筛选出与热误差关联度最大的温度测点作为温度敏感点;(2) Using the grey correlation analysis, the temperature measuring points with the greatest correlation with the thermal error are selected from each group as the temperature sensitive points;
(3)利用筛选的温度敏感点作为模型的输入,热误差作为输出。(3) Use the screened temperature sensitive points as the input of the model, and the thermal error as the output.
进一步地,所述步骤三具体为:确定Elman神经网络输入层、隐含层、承接层和输出层个数;确定天牛左右须的位置Xl和Xr,天牛初始步长δ0,迭代次数T。Further, the third step is specifically: determining the number of Elman neural network input layer, hidden layer, receiving layer and output layer ; The number of iterations T.
上述确定天牛左右须的位置Xl和Xr前,需要先初始化天牛的空间位置。Before determining the positions X1 and Xr of the left and right whiskers of the beetle, the spatial position of the beetle needs to be initialized first.
进一步地,所述输入层和输出层个数根据输入输出参数确定,所述隐含层和承接层个数通过经验公式h=(m+n)1/2+a,以及试凑法确定;Further, the number of the input layer and the output layer is determined according to the input and output parameters, and the number of the hidden layer and the successor layer is determined by the empirical formula h=(m+n) 1/2 +a, and the trial and error method;
其中,m为输入节点个数,n为输出节点个数,a为1-10之间的常数。Among them, m is the number of input nodes, n is the number of output nodes, and a is a constant between 1 and 10.
进一步地,所述步骤四具体为:Further, the step 4 is specifically:
a、创建天牛须朝向的k维随机向量且做归一化处理,公式为:a. Create a k-dimensional random vector of the direction of the beards of the beetle and normalize it. The formula is:
式中:rands()为随机函数,k表示空间维度;In the formula: rands() is a random function, and k represents the spatial dimension;
b、创建天牛左右须空间坐标,公式为:b. Create the spatial coordinates of the left and right whiskers of the beetle, the formula is:
式中:xrt和xlt分别表示天牛右须和左须在第t次迭代时的位置坐标;xt表示天牛在第t次迭代时的质心坐标;d0表示两须之间的距离;In the formula: x rt and x lt represent the position coordinates of the right and left whiskers in the t-th iteration, respectively; x t represents the center of mass coordinates of the beetle in the t-th iteration; d 0 represents the distance between the two whiskers. distance;
c、确定适应度函数,以训练数据集的均方根误差作为适应度函数,公式为:c. Determine the fitness function, using the root mean square error of the training data set as the fitness function, the formula is:
式中:N为训练集样本数;表示预测输出值,yi表示实际值;In the formula: N is the number of training set samples; represents the predicted output value, and y i represents the actual value;
d、根据适应度函数判断左右须气味强度,决定天牛下一时刻移动位置,公式为:d. Judging the odor intensity of the left and right whiskers according to the fitness function, and determining the moving position of the beetle at the next moment, the formula is:
式中:δt表示在第t次迭代时的步长因子,sign()为符号函数,f(xrt)为天牛右须的适应度值,f(xlt)天牛左须的适应度值;In the formula: δ t represents the step size factor in the t-th iteration, sign() is the sign function, f(x rt ) is the fitness value of the right whisker of the beetle, f(x lt ) is the adaptation of the left whisker of the beetle degree value;
天牛的步长更新公式为:The step size update formula of the beetle is:
δt+1=δt*eta t=(0,1,2,…,n)δ t+1 = δ t* eta t=(0,1,2,…,n)
式中:eta取[0,1]之间靠近1的数;In the formula: eta takes the number close to 1 between [0,1];
计算当下xt+1位置对应的适用度函数值,若适用度函数值优于Ybest,更新Xbest和Ybest,即将xt+1替代xt,保存在Xbest中,xt+1位置对应的适用度函数值替代xt位置对应的适用度函数值,保存在Ybest中;Calculate the fitness function value corresponding to the current x t+1 position. If the fitness function value is better than Y best , update X best and Y best , that is, replace x t with x t+1 and save it in X best , x t+1 The fitness function value corresponding to the position replaces the fitness function value corresponding to the x t position, and is stored in Y best ;
e、判断是否满足终止条件:若当前迭代次数达到最大迭代次数或网络的训练误差达到精度要求,则停止迭代,输出优化结果,否则继续迭代寻优;e. Judging whether the termination condition is met: if the current number of iterations reaches the maximum number of iterations or the training error of the network meets the accuracy requirements, the iteration is stopped and the optimization result is output, otherwise, the iterative optimization is continued;
f、输出优化后的Elman网络的连接权值和阈值,建立BAS-Elman神经网络电主轴热误差预测模型。f. Output the connection weights and thresholds of the optimized Elman network, and establish a BAS-Elman neural network electric spindle thermal error prediction model.
其中,Ybest表示最佳适应度值,Xbest表示神经网络最优的初始权值和阈值。Among them, Y best represents the best fitness value, and X best represents the optimal initial weight and threshold of the neural network.
进一步地,还包括步骤五:利用BAS-Elman神经网络电主轴热误差预测模型对高速电主轴热误差进行预测和验证。Further, it also includes step 5: using the BAS-Elman neural network electric spindle thermal error prediction model to predict and verify the thermal error of the high-speed electric spindle.
进一步地,所述步骤五具体为:将训练集和测试集输入BAS-Elman神经网络电主轴热误差预测模型中,对高速电主轴热误差进行准确预测;采用决定系数(R2)、均方根误差(RMSE)和平均绝对误差(MAE)进行评价:Further, the
具体地,验证部分决定系数(R2)计算公式为:Specifically, the calculation formula of the coefficient of determination of the verification part (R 2 ) is:
均方根误差(RMSE)的计算公式为:The formula for calculating root mean square error (RMSE) is:
平均绝对误差(MAE)的计算公式为:The formula for calculating mean absolute error (MAE) is:
式中:N为训练集样本数;表示预测输出值,yi表示实际值。In the formula: N is the number of training set samples; represents the predicted output value, and y i represents the actual value.
本发明的有益效果是:本发明是一种基于天牛须算法优化Elman神经网络电主轴热误差建模方法,利用K-means算法分析结合灰色关联度分析对预输入变量进行解耦降维,并且将天牛须算法和Elman神经网络相结合,得到的 BAS-Elman热误差预测模型具有结构简单和预测精度高等优点。The beneficial effects of the present invention are as follows: the present invention is a method for optimizing the thermal error modeling of the Elman neural network electric spindle based on the beard beard algorithm, and uses the K-means algorithm analysis combined with the gray correlation analysis to decouple the pre-input variables and reduce the dimension. The BAS-Elman thermal error prediction model obtained by combining the beetle algorithm and Elman neural network has the advantages of simple structure and high prediction accuracy.
相对目前的热误差预测方法,本发明的优点表现在:Compared with the current thermal error prediction method, the advantages of the present invention are as follows:
1、模型结构简单。本发明通过K-means算法结合灰色关联度降低了模型输入,很好的解决了由于庞大的训练数据造成的Elman神经网络训练时间过长,网络信息冗余过大等缺陷;1. The model structure is simple. The present invention reduces the model input through the K-means algorithm combined with the gray correlation degree, and solves the defects of the Elman neural network training time being too long and the network information redundancy being too large due to the huge training data;
2、预测精度高。本发明利用天牛须算法(BAS)优化Elman神经网络的连接权值和阈值,改善了Elman神经网络的学习能力和泛化能力,使得热误差预测模型精度明显提高;2. High prediction accuracy. The present invention optimizes the connection weights and thresholds of the Elman neural network by using the long beetle algorithm (BAS), improves the learning ability and generalization ability of the Elman neural network, and significantly improves the accuracy of the thermal error prediction model;
3、运行时间短。天牛须算法作为一种高效的智能优化算法,只需要一个搜索个体,相较于其他群智能算法,具有参数设置简单,运算量小等突出优势。本发明提出的BAS-Elman能耗预测方法在保证预测精度的同时,具有运行时间短的优点。3. Short running time. As an efficient intelligent optimization algorithm, the beetle algorithm only needs one search individual. Compared with other swarm intelligence algorithms, it has outstanding advantages such as simple parameter setting and small calculation amount. The BAS-Elman energy consumption prediction method proposed by the invention has the advantage of short running time while ensuring the prediction accuracy.
附图说明Description of drawings
图1为Elman神经网络结构图。Figure 1 shows the structure of Elman neural network.
图2为基于天牛须搜索算法优化Elman神经网络的训练流程图。Fig. 2 is the training flow chart of optimizing Elman neural network based on beetle search algorithm.
图3为本实施例BAS-Elman神经网络适应度变化曲线Fig. 3 is the BAS-Elman neural network fitness change curve of the present embodiment
图4为4000r/min时BAS-Elman和Elman预测曲线;Figure 4 shows the BAS-Elman and Elman prediction curves at 4000 r/min;
图5为8000r/min时BAS-Elman和Elman预测曲线。Figure 5 shows the BAS-Elman and Elman prediction curves at 8000 r/min.
具体实施方式Detailed ways
下面将结合本发明实施例以及说明书附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention and the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments.
本发明涉及的一种基于天牛须算法优化Elman神经网络电主轴热误差建模方法,具体包括以下步骤:The present invention relates to a method for optimizing Elman neural network electric spindle thermal error modeling based on the beetle algorithm, which specifically includes the following steps:
步骤一、采集高速电主轴不同转速下的温度和热误差数据,同时将数据划分为训练集和测试集;Step 1: Collect temperature and thermal error data at different speeds of the high-speed motorized spindle, and divide the data into training sets and test sets at the same time;
通过实验获取了高速电主轴在4000r/min、6000r/min和8000r/min的十个测温点的温度和热误差数据,首先对温度测点进行优化,筛选出合适的温度敏感点作为模型的输入向量,轴向热误差作为输出向量;将6000r/min的数据集作为训练集,以4000r/min和8000r/min的数据集作为测试集;The temperature and thermal error data of ten temperature measurement points of the high-speed motorized spindle at 4000r/min, 6000r/min and 8000r/min were obtained through experiments. The input vector, the axial thermal error is used as the output vector; the 6000r/min data set is used as the training set, and the 4000r/min and 8000r/min data sets are used as the test set;
步骤二、利用K-means聚类分析结合灰色关联度分析对温度测点进行优化,构造模型的输入和输出;Step 2, using K-means cluster analysis combined with gray correlation analysis to optimize the temperature measurement points, and construct the input and output of the model;
采用K-means聚类分析将十个温度测点分成所需类数;利用灰色关联度分析,从各组中筛选出与热误差关联度最大的测温度作为温度敏感点;其中筛选的温度敏感点为模型的输入,热误差为输出。K-means clustering analysis was used to divide the ten temperature measurement points into the required number of categories; using grey correlation analysis, the temperature measurement with the greatest correlation with thermal error was selected from each group as the temperature sensitive point; The points are the input to the model and the thermal error is the output.
步骤三、初始化Elman神经网络模型参数和天牛须算法参数;Step 3: Initialize Elman neural network model parameters and beetle algorithm parameters;
图1为Elman神经网络结构图,Elman神经网络是一种典型的递归神经网络,因其内部具有前馈、反馈结构,使其比普通神经网络具有更强的学习能力,非常适合构建热误差预测模型;Figure 1 shows the structure of Elman neural network. Elman neural network is a typical recurrent neural network. Because of its internal feedforward and feedback structure, it has stronger learning ability than ordinary neural networks and is very suitable for constructing thermal error prediction. Model;
模型的输入为温度敏感点,经过温度测点优化选择了四个温度敏感点,即输入层有4个神经元;输出为热误差,即输出层有1个神经元;通过经验公式和试凑法确定了隐含层数为9,即隐含层和承接层各有9个神经元;本实施例中,设定神经网络的输入层与隐含层之间的传递函数为tansig,隐含层与输出层之间的传递函数为purelin;本实施例中,设定天牛须算法初始步长设置为50,左右两须间的初始距离为5,天牛须算法迭代次数为200;The input of the model is temperature-sensitive points, and four temperature-sensitive points are selected through optimization of temperature measurement points, that is, there are 4 neurons in the input layer; the output is thermal error, that is, there is 1 neuron in the output layer; The method determines that the number of hidden layers is 9, that is, the hidden layer and the successor layer each have 9 neurons; in this embodiment, the transfer function between the input layer and the hidden layer of the neural network is set as tansig, the implicit The transfer function between the layer and the output layer is purelin; in this embodiment, the initial step size of the long beard algorithm is set to 50, the initial distance between the left and right two whiskers is 5, and the number of iterations of the long beetle algorithm is 200;
Elman神经网络的学习算法如下:The learning algorithm of Elman neural network is as follows:
y(k)=g(ω3x(k))y(k)=g(ω 3 x(k))
x(k)=f(ω1xc(k)+ω2(u(k-1)))x(k)=f(ω 1 x c (k)+ω 2 (u(k-1)))
xc(k)=x(k-1)x c (k)=x(k-1)
Elman神经网络的学习指标函数采用误差平方和函数,即:The learning indicator function of Elman neural network adopts the error sum of squares function, namely:
其中:y为m维输出节点向量;x为n维中间层节点单元向量;u为r维输入向量;Xc为n维反馈状态向量;ω1为承接层到隐含层连接的权值;ω2为输入层到隐含层连接权值;ω3为隐含层到输出层连接权值;g()为输出神经元的传递函数, f()为中间层神经元的传递函数。Among them: y is the m-dimensional output node vector; x is the n-dimensional intermediate layer node unit vector; u is the r-dimensional input vector; X c is the n-dimensional feedback state vector; ω 1 is the connection weight between the successor layer and the hidden layer; ω2 is the connection weight from the input layer to the hidden layer; ω3 is the connection weight from the hidden layer to the output layer; g() is the transfer function of the output neuron, and f() is the transfer function of the intermediate layer neuron.
步骤四、天牛须算法通过迭代更新优化Elman神经网络的各网络层的连接权值和阈值,建立BAS-Elman神经网络热误差预测模型;图2为基于天牛须搜索算法优化Elman神经网络的训练流程图。具体步骤如下:Step 4. The beetle algorithm optimizes the connection weights and thresholds of each network layer of the Elman neural network through iterative updating, and establishes a BAS-Elman neural network thermal error prediction model; Figure 2 shows the optimization of the Elman neural network based on the beetle search algorithm. Training flowchart. Specific steps are as follows:
a、创建天牛须朝向的k维随机向量且做归一化处理,公式为:a. Create a k-dimensional random vector of the direction of the beards of the beetle and normalize it. The formula is:
式中:rands()为随机函数,k表示空间维度,也是待优化参数个数,搜索空间维度k=M*N+N+N*1+1+N*N,M为输入层神经元个数,N为隐含层神经元个数,输出层神经元个数为1;In the formula: rands() is a random function, k represents the space dimension, which is also the number of parameters to be optimized, the search space dimension k=M*N+N+N*1+1+N*N, M is the number of neurons in the input layer number, N is the number of neurons in the hidden layer, and the number of neurons in the output layer is 1;
b、创建天牛左右须空间坐标,公式为:b. Create the spatial coordinates of the left and right whiskers of the beetle, the formula is:
式中:xrt和xlt分别表示天牛右须和左须在第t次迭代时的位置坐标;xt表示天牛在第t次迭代时的质心坐标;d0表示两须之间的距离;In the formula: x rt and x lt represent the position coordinates of the right and left whiskers in the t-th iteration, respectively; x t represents the center of mass coordinates of the beetle in the t-th iteration; d 0 represents the distance between the two whiskers. distance;
c、确定适应度函数,以训练数据集的均方根误差作为适应度函数,公式为:c. Determine the fitness function, using the root mean square error of the training data set as the fitness function, the formula is:
式中:N为训练集样本数;表示预测输出值,yi表示实际值;In the formula: N is the number of training set samples; represents the predicted output value, and y i represents the actual value;
d、根据适应度函数判断左右须气味强度,决定天牛下一时刻移动位置,公式为:d. Judging the odor intensity of the left and right whiskers according to the fitness function, and determining the moving position of the beetle at the next moment, the formula is:
式中:δt表示在第t次迭代时的步长因子,sign()为符号函数,f(xrt)为天牛右须的适应度值,f(xlt)天牛左须的适应度值;In the formula: δ t represents the step size factor in the t-th iteration, sign() is the sign function, f(x rt ) is the fitness value of the right whisker of the beetle, f(x lt ) is the adaptation of the left whisker of the beetle degree value;
天牛的步长更新公式为:The step size update formula of the beetle is:
δt+1=δt*eta t=(0,1,2,…,n)δ t+1 = δ t* eta t=(0,1,2,…,n)
式中:eta取[0,1]之间靠近1的数;本实施例中设定eta=0.995。In the formula: eta takes the number between [0, 1] close to 1; in this embodiment, eta=0.995 is set.
计算当下xt+1位置对应的适用度函数值,若适用度函数值优于Ybest,更新Xbest和Ybest,即将xt+1替代xt,保存在Xbest中,xt+1位置对应的适用度函数值替代xt位置对应的适用度函数值,保存在Ybest中;Calculate the fitness function value corresponding to the current x t+1 position. If the fitness function value is better than Y best , update X best and Y best , that is, replace x t with x t+1 and save it in X best , x t+1 The fitness function value corresponding to the position replaces the fitness function value corresponding to the x t position, and is stored in Y best ;
e、判断是否满足终止条件:若当前迭代次数达到最大迭代次数或网络的训练误差达到精度要求,则停止迭代,输出优化结果,否则继续迭代寻优;e. Judging whether the termination condition is met: if the current number of iterations reaches the maximum number of iterations or the training error of the network meets the accuracy requirements, the iteration is stopped and the optimization result is output, otherwise, the iterative optimization is continued;
f、输出优化结果,即优化后的Elman网络的连接权值和阈值。f. Output the optimization results, that is, the connection weights and thresholds of the optimized Elman network.
步骤五、利用优化得到的BAS-Elman神经网络预测模型对高速电主轴热误差进行预测和验证。利用优化得到的BAS-Elman神经网络模型,将训练集和测试集输入BAS-Elman模型中,对高速电主轴热误差进行准确预测;采用决定系数(R2)、均方根误差(RMSE)和平均绝对误差(MAE)进行评价。Step 5: Use the BAS-Elman neural network prediction model obtained by optimization to predict and verify the thermal error of the high-speed motorized spindle. Using the optimized BAS-Elman neural network model, the training set and test set are input into the BAS-Elman model to accurately predict the thermal error of the high-speed motorized spindle; the coefficient of determination (R2), the root mean square error (RMSE) and the average The absolute error (MAE) was evaluated.
R2是模型对于样本拟合程度的指标。R2的值越大,表明模型对于样本的拟合程度越高;R2计算公式如下: R2 is an indicator of how well the model fits the sample. The larger the value of R 2 , the higher the fitting degree of the model to the sample; the calculation formula of R 2 is as follows:
RMSE表示回归模型的均方根误差。RMSE计算公式如下:RMSE represents the root mean squared error of the regression model. The RMSE calculation formula is as follows:
MAE表示回归模型的平均绝对误差。MAE的计算公式如下:MAE represents the mean absolute error of the regression model. The formula for calculating MAE is as follows:
式中:N为训练集样本数;表示预测输出值,yi表示实际值。In the formula: N is the number of training set samples; represents the predicted output value, and y i represents the actual value.
图3为本实施例BAS-Elman神经网络适应度变化曲线。FIG. 3 is a change curve of the fitness of the BAS-Elman neural network according to the present embodiment.
由图3可知BAS算法经过14次迭代过程便可找到最优解,算法收敛较快。 BAS算法迭代200代优化Elman神经网络模型预测热误差只需39秒左右,运行时间较短。这是因为天牛须算法作为一种高效的智能优化算法,只需要一个搜索个体,相较于其他群智能算法,具有参数设置简单,运算量小等突出优势。It can be seen from Figure 3 that the BAS algorithm can find the optimal solution after 14 iterations, and the algorithm converges quickly. The BAS algorithm iterates for 200 generations to optimize the Elman neural network model to predict the thermal error in about 39 seconds, and the running time is short. This is because the beetle algorithm, as an efficient intelligent optimization algorithm, only needs one search individual. Compared with other swarm intelligence algorithms, it has outstanding advantages such as simple parameter setting and small computational complexity.
图4和图5分别为4000r/min和6000r/min本申请提供的Elman和BAS-Elman 预测曲线图。Figures 4 and 5 are the Elman and BAS-Elman prediction curves provided by the present application at 4000 r/min and 6000 r/min, respectively.
表1为本申请提供的Elman和BAS-Elman在不同转速下的预测性能参数:Table 1 provides the predicted performance parameters of Elman and BAS-Elman at different speeds for this application:
通过对比不同转速下BAS-Elman和Elman模型预测曲线图,分析表1可得BAS-Elman模型比较与Elman模型的拟合程度更高,均方根误差和平均绝对误差均更小,所以BAS-Elman模型可以提高Elman模型的预测精度,且BAS-Elman 模型具有较高的泛化能力。By comparing the prediction curves of the BAS-Elman and Elman models at different speeds, it can be seen from Table 1 that the BAS-Elman model has a higher degree of fitting compared with the Elman model, and the root mean square error and mean absolute error are both smaller, so BAS-Elman The Elman model can improve the prediction accuracy of the Elman model, and the BAS-Elman model has a high generalization ability.
综上所述,本发明通过BAS算法优化Elman神经网络初始连接权值和阈值,解决了Elman神经网络存在收敛速度慢、易陷入局部极值的缺点。本发明实用性较强,预测结果较为准确,为现有热误差预测提供一种简便方法。To sum up, the present invention optimizes the initial connection weight and threshold of Elman neural network through BAS algorithm, and solves the shortcomings of Elman neural network that the convergence speed is slow and it is easy to fall into local extreme values. The invention has strong practicability and accurate prediction results, and provides a convenient method for the existing thermal error prediction.
以上述依据本发明的理想实施例为启示,通过上述的说明内容,相关工作人员完全可以在不偏离本项发明技术思想的范围内,进行多样的变更以及修改。本项发明的技术性范围并不局限于说明书上的内容,必须要根据权利要求范围来确定其技术性范围。Taking the above ideal embodiments according to the present invention as inspiration, and through the above description, relevant personnel can make various changes and modifications without departing from the technical idea of the present invention. The technical scope of the present invention is not limited to the contents in the specification, and the technical scope must be determined according to the scope of the claims.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210480474.5A CN114861879A (en) | 2022-05-05 | 2022-05-05 | Modeling method for optimizing thermal error of electric spindle of Elman neural network based on longicorn whisker algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210480474.5A CN114861879A (en) | 2022-05-05 | 2022-05-05 | Modeling method for optimizing thermal error of electric spindle of Elman neural network based on longicorn whisker algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114861879A true CN114861879A (en) | 2022-08-05 |
Family
ID=82635051
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210480474.5A Pending CN114861879A (en) | 2022-05-05 | 2022-05-05 | Modeling method for optimizing thermal error of electric spindle of Elman neural network based on longicorn whisker algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114861879A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116174497A (en) * | 2023-01-06 | 2023-05-30 | 北京科技大学 | A data-driven online prediction method for roll bending force in continuous cold rolling |
CN116506307A (en) * | 2023-06-21 | 2023-07-28 | 大有期货有限公司 | Network delay condition analysis system of full link |
CN117077509A (en) * | 2023-07-14 | 2023-11-17 | 哈尔滨理工大学 | Modeling method for optimizing KELM neural network electric spindle thermal error by northern eagle algorithm |
CN117113845A (en) * | 2023-08-31 | 2023-11-24 | 哈尔滨理工大学 | AVOA (automatic Voltage difference) optimized LSTM (least squares) neural network principal axis thermal error modeling method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110579714A (en) * | 2019-07-26 | 2019-12-17 | 西安科技大学 | A battery SOC double-state switching estimation method based on BAS optimization ElmanNN-AH method |
CN110889091A (en) * | 2019-11-18 | 2020-03-17 | 重庆理工大学 | Machine tool thermal error prediction method and system based on temperature sensitive interval segmentation |
CN112767692A (en) * | 2020-12-30 | 2021-05-07 | 兰州理工大学 | Short-term traffic flow prediction system based on SARIMA-GA-Elman combined model |
CN114296396A (en) * | 2021-12-29 | 2022-04-08 | 西安交通大学 | Numerical control lathe spindle thermal error measuring device and modeling method |
-
2022
- 2022-05-05 CN CN202210480474.5A patent/CN114861879A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110579714A (en) * | 2019-07-26 | 2019-12-17 | 西安科技大学 | A battery SOC double-state switching estimation method based on BAS optimization ElmanNN-AH method |
CN110889091A (en) * | 2019-11-18 | 2020-03-17 | 重庆理工大学 | Machine tool thermal error prediction method and system based on temperature sensitive interval segmentation |
CN112767692A (en) * | 2020-12-30 | 2021-05-07 | 兰州理工大学 | Short-term traffic flow prediction system based on SARIMA-GA-Elman combined model |
CN114296396A (en) * | 2021-12-29 | 2022-04-08 | 西安交通大学 | Numerical control lathe spindle thermal error measuring device and modeling method |
Non-Patent Citations (2)
Title |
---|
丁兆云等: "《数控机床热误差及其抑制与补偿》", 重庆大学出版社, pages: 112 - 115 * |
戴野等: "基于ANFIS 的高速电主轴热误差建模研究", 《仪器仪表学报》, pages 112 - 115 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116174497A (en) * | 2023-01-06 | 2023-05-30 | 北京科技大学 | A data-driven online prediction method for roll bending force in continuous cold rolling |
CN116506307A (en) * | 2023-06-21 | 2023-07-28 | 大有期货有限公司 | Network delay condition analysis system of full link |
CN116506307B (en) * | 2023-06-21 | 2023-09-12 | 大有期货有限公司 | Network delay condition analysis system of full link |
CN117077509A (en) * | 2023-07-14 | 2023-11-17 | 哈尔滨理工大学 | Modeling method for optimizing KELM neural network electric spindle thermal error by northern eagle algorithm |
CN117077509B (en) * | 2023-07-14 | 2024-04-05 | 哈尔滨理工大学 | A thermal error modeling method of electric spindle based on KELM neural network optimized by Northern Goshawk algorithm |
CN117113845A (en) * | 2023-08-31 | 2023-11-24 | 哈尔滨理工大学 | AVOA (automatic Voltage difference) optimized LSTM (least squares) neural network principal axis thermal error modeling method |
CN117113845B (en) * | 2023-08-31 | 2024-03-19 | 哈尔滨理工大学 | AVOA (automatic Voltage difference) optimized LSTM (least squares) neural network principal axis thermal error modeling method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114861879A (en) | Modeling method for optimizing thermal error of electric spindle of Elman neural network based on longicorn whisker algorithm | |
CN113051831B (en) | Modeling method of machine tool thermal error self-learning prediction model and thermal error control method | |
CN111738512B (en) | Short-term power load prediction method based on CNN-IPSO-GRU hybrid model | |
CN110597240B (en) | A fault diagnosis method for hydro-generator units based on deep learning | |
CN108416695B (en) | Power load probability density prediction method, system and medium based on deep learning | |
CN108920812B (en) | Machining surface roughness prediction method | |
CN109993270A (en) | Remaining life prediction method of lithium-ion battery based on gray wolf pack optimization LSTM network | |
CN113536696B (en) | Modeling method and migration learning method of STO-TCN thermal error prediction model | |
CN113469426A (en) | Photovoltaic output power prediction method and system based on improved BP neural network | |
CN112433507B (en) | Comprehensive modeling method of thermal error of five-axis CNC machine tool based on LSO-LSSVM | |
CN113760660B (en) | Three-dimensional multi-core chip temperature prediction method and system based on long-short-term memory neural network | |
CN103336992A (en) | FNN learning algorithm | |
CN113408610B (en) | Image identification method based on adaptive matrix iteration extreme learning machine | |
CN114897028B (en) | Numerical control machining surface roughness prediction method and device | |
CN111832839B (en) | Energy consumption prediction method based on sufficient incremental learning | |
CN113807040B (en) | An Optimal Design Method for Microwave Circuits | |
CN105913078A (en) | Multi-mode soft measurement method for improving adaptive affine propagation clustering | |
CN113177675A (en) | Air conditioner cold load prediction method based on optimization neural network of longicorn group algorithm | |
CN110516785A (en) | A Hybrid Algorithm for Solving Bi-Level Linear Programming Based on Particle Swarm and Whale Swarm | |
CN118036809A (en) | Fault current prediction method and medium based on snow melting optimized recurrent neural network | |
CN112613227A (en) | Model for predicting remaining service life of aero-engine based on hybrid machine learning | |
CN112149896A (en) | Attention mechanism-based mechanical equipment multi-working-condition fault prediction method | |
CN114491789B (en) | Blunt-bodied hypersonic vehicle flight parameter prediction method, system and device | |
CN113626177A (en) | CPU resource load condition prediction method based on LSTM | |
Yao et al. | Synthetic error modeling for NC machine tools based on intelligent technology |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |