Prediction of residual stress and deformation of 316L multi-layer multi-pass welding based on GA-BP neural network
-
摘要:
残余应力与变形是焊接过程中普遍存在的现象,对焊接结构的性能及使用寿命产生严重影响,是焊接结构发生开裂和失效的主要原因之一. 传统的多层多道焊残余应力和变形预测主要采用有限元分析法,该方法存在预测精度差,数值模拟结果可靠性低等缺点. 针对预测20 mm厚316L平板对接焊的残余应力和变形,提出一种基于遗传算法(genetic algorithm, GA)优化的反向传播(back propagation,BP)神经网络预测模型GA-BP,选取最主要的4个焊接工艺参数作为输入,包括焊接电流、电弧电压、焊接速度和层间温度,以焊后最大横、纵向残余应力和变形作为输出. 结果表明,BP神经网络模型的预测误差在15%以内,优化后的GA-BP网络模型预测误差小于3%,故GA-BP神经网络模型的预测更精准,该方法可为多层多道焊的焊接工艺参数优化以及焊后残余应力与变形的预测和控制提供思路与理论基础,具有一定的指导意义和实际应用价值.
Abstract:Residual stress and deformation are common phenomena in the welding process. Its existence will have a serious impact on the working performance and service life of the welded structure, and is one of the main reasons for the cracking and failure of the welded structure. Traditional methods for predicting residual stress and deformation mainly include finite element analysis. However, these methods have the disadvantages of poor prediction accuracy and low reliability of numerical simulation results. To address the problem of predicting residual stress and deformation in 316L flat plates welding with a thickness of 20 mm, this paper proposes a GA-BP neural network prediction model based on optimized back propagation (BP) by genetic algorithm (GA), which selects the four most important welding process parameters as input parameters, including welding current, electric arc voltage, welding speed, and interpas temperature. The output of the model is the maximum transverse and longitudinal residual stress and deformation after welding. The results show that the error of the BP neural network model is within 15%. The error of GA-BP is less than 3%, indicating that the GA-BP neural network model is more accurate. This method can provide ideas and theoretical basis for optimizing process parameters of multi-layer multi-pass welding, as well as predicting and controlling residual stress and deformation after welding, and has certain practical guidance and application value.
-
0. 序言
磁极是发电机中的核心部件之一,通常由铁心、线圈、铁托板、阻尼绕组及极身绝缘等组成. 磁极焊缝是指铁托板与铁心间的焊缝,通过该焊缝将线圈固定在铁心上,防止机组运行时线圈松散和变形,因此焊缝的质量直接影响磁极结构的稳定性[1]. 目前采用手工的GMAW难以满足高效、稳定的焊接要求.
由于铁托板和铁心组对的加工和装配误差,导致磁极焊缝存在位置不固定,间隙随机变化的问题.对于这种变长度、变间隙的焊缝,依靠示教进行机器人焊接的方式存在加工效率低、精度不可控等问题,如何实现磁极焊缝的自适应焊接,成为了机器人焊接的关键问题[2].
Li等人[3]构造焊缝轨迹特征三角形提取形状特征, 并基于欧几里德距离判别焊缝轨迹, 提高了复杂箱梁构件加工中的焊接制造效率和质量;郭忠峰等人[4]基于关键点检测方法进行焊缝识别, 实现对多种坡口类型焊缝的定位;修延飞等人[5]提出了一种基于双条纹激光视觉传感技术的视觉识别算法.但上述方法均受限于焊缝特征类型,为实现大型工件空间复杂焊缝的自主焊接路径规划建模,Zhang等人[6]通过多段扫描有效获取工件的三维信息,然后通过灰度图像处理提取焊缝特征, 但其识别精度多会受到图像处理的影响;Tian等人[7]通过使用自适应生成动态感兴趣区域, 有效提高焊缝识别精度;梁志敏等人[8]建立了基于单摄像机的双棱镜立体视觉传感系统,基于变分立体匹配算法实现完整熔池表面视差计算和三维重建;Zhang等人[9]提出二阶导数算法对特征点进行初始定位,然后进行线性拟合实现精确定位;余佳杰等人[10]利用质心法提取焊缝中心线, 通过最小二乘法和k均值聚类提取焊缝特征点, 提高了焊缝识别的准确度.
综合以上,并未提出可靠的算法实现大型水电站发电机磁极变长度、变间隙的复杂焊缝识别及机器人轨迹生成. 因此,提出了一种结合机器人工具位姿变换矩阵和迭代最近点算法(ICP)的高精度点云配准算法,基于随机采样一致性(RANSAC)开发了针对磁极焊缝结构的识别算法,实现了磁极焊缝的高精度和可靠性特征的快速提取.
1. 试验平台系统
试验平台由焊接系统、运动机构、视觉系统和上位机系统组成,如图1所示,其中焊接系统由福尼斯TPS 500i数字化焊接电源、送丝机、清枪器和GMAW焊枪等组成;运动机构为FANUC M-20iA六轴工业机器人;视觉系统由工业相机和数字光栅等组成,相机型号为MER-131-75GM/C-P,光栅型号为DLP4500EVM. 上位机软件采用C + + 编程语言,Qt跨平台UI界面库自主开发,系统上位机软件界面如图2所示,可实现焊接姿态设置、自动图像采集、点云生成、自动计算焊接路径. 通过TCP/IP协议实现与机器人通讯,从而获取机器人位姿,控制机器人运动等功能.
2. 磁极焊缝识别算法
磁极焊缝为矩形周向间断角焊缝,如图3所示,长边长度L为1 200 ~ 3 600 mm,宽边长度W为300 ~ 700 mm,每段焊缝长度50 ~ 140 mm.
磁极焊缝视觉识别算法主要包括结合机器人工具位姿变换矩阵和迭代最近点算法(ICP)的点云配准算法和基于随机采样一致性(RANSAC)的磁极焊缝结构识别算法,开发的磁极焊缝识别算法整体流程如图4所示.
2.1 磁极焊缝点云获取
2.1.1 局部点云获取
光栅深度传感器由相机和投影仪组成,由投影仪投射一组正弦相位的光栅条纹,相机同步获取一组图像, 采用四步相移法和多频外差法对图像进行相位解算[11],根据标定的相机内外参数,获取被测区域表面三维点云信息[12],具体原理如下.
二维像素坐标下某一点绝对相位θ与其在相机坐标系中三维坐标(Xc ,Yc ,Zc)存在的关系式为
$$ \theta = \frac{{{a_1}{X_{\mathrm{c}}} + {a_2}{Y_{\mathrm{c}}} + {a_3}{Z_{\mathrm{c}}} + {a_4}}}{{{a_5}{X_{\mathrm{c}}} + {a_6}{Y_{\mathrm{c}}} + {a_7}{Z_{\mathrm{c}}} + {a_8}}} $$ (1) 式中:a1 ~ a8为待标定系统参量.
根据相机成像原理,相机坐标系下的三维坐标(Xc ,Yc ,Zc)与图像坐标系下的二维坐标(m,n)存在关系式为
$$ Z_{\mathrm{c}}\left[ {\begin{array}{*{20}{c}} m \\ n \\ 1 \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {{f_{{x}}}}&{ - {f_{{x}}}\cot \theta }&{{u_0}} \\ 0&{{f_y}\dfrac{1}{{\sin \theta }}}&{{v_0}} \\ 0&0&1 \end{array}} \right]\left[ {\begin{array}{*{20}{c}} {X_{\mathrm{c}}} \\ {Y_{\mathrm{c}}} \\ {Z_{\mathrm{c}}} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {{c_1}}&{{c_2}}&{{c_3}} \\ 0&{{c_4}}&{{c_5}} \\ 0&0&1 \end{array}} \right]\left[ {\begin{array}{*{20}{c}} {{X_{\mathrm{c}}}} \\ {{Y_{\mathrm{c}}}} \\ {{Z_{\mathrm{c}}}} \end{array}} \right] $$ (2) 式中:c1 ~ c5为相机内参,由相机标定过程获得;u0和v0为图像所在平面与相机光轴交点横纵坐标值;fx和fy为相机像素在图像坐标系下x和y方向放大系数.综合式(1)和式(2),可以求得三维坐标,即
$$ \left\{ {\begin{array}{*{20}{l}} {{{{Z}}_{\text{c}}} = \dfrac{{( - {a_8}{c_1}{c_4})\theta + {a_4}{c_1}{c_4}}}{{\left[ {\left( {a{}_5{c_2} - {a_6}{c_1}} \right)\left( {{c_5} - n} \right) + {a_5}{c_4}\left( {m - {c_3}} \right) + {a_7}{c_1}{c_4}} \right]\theta + \left( {{a_2}{c_1} - {a_1}{c_2}} \right)\left( {{c_5} - n} \right) + {a_1}{c_4}\left( {{c_3} - m} \right) - {a_3}{c_1}{c_4}}}} \\ {{X_{\mathrm{c}}} = \dfrac{{{Z_{\mathrm{c}}}({c_2}{c_5} - {c_3}c{}_4 + {c_4}m - {c_2}n)}}{{{c_1}{c_4}}}} \\ {{Y_{\mathrm{c}}} = - \dfrac{{{Z_{\mathrm{c}}}({c_5} - n)}}{{{c_4}}}} \end{array}} \right. $$ (3) 2.1.2 点云配准
由于磁极尺寸大,相机单次识别的为局部区域,需要进行点云配准, 整体点云的三维重建调用PCL点云库进行点云处理,在点云配准中采用了粗配准与精配准结合的方式.
粗配准:利用采集点云的机器人位姿,将点云转换到机器人坐标系下,实现点云的粗配准.
精配准:根据ICP算法进行点云的精配准. 文中将首次获取的点云作为基准,后续点云(源点云S)与前一个点云(目标点云D)进行配准并变换位置,实现整体点云的建立,实现ICP配准步骤如下.
第一步,寻找最近点,将源点云S中的点找到与目标点云最近的点.
第二步,计算精确变换矩阵$ {T}^{{'}} $,通过最小化源点云与目标点云之间的距离计算,即
$$ {T}^{{'}} = {{\mathrm{argmin}}}_{T}{\sum }_{i}{\left\|T({s}_{i}-{d}_{i})\right\|}^{2} $$ (4) 式中:$ {s}_{i} $为源点云中的点;$ {d}_{i} $为目标点云中的点;$ {T}^{{'}} $和$ T $为变换矩阵.
第三步,迭代计算,将$ {T}^{{'}} $应用到源点云,并不断重复上述三步,直到收敛.
利用粗配准与精配准相结合的方式,有效避免了ICP算法累计误差和收敛的问题,提高了点云配准的计算速度. 整体点云如图5所示. 通过均方误差分析,得到ICP配准均方误差为0.119.
2.2 基于RANSAC的磁极焊缝识别
考虑磁极焊缝为长直角焊缝,且工件焊缝区域可视为平面,人工选定ROI区域,通过RANSAC方法多次分离并保存点云中可组成平面的部分,提取出点云中焊缝的上下表面,具体步骤如下.
在三维点云中随机选择3个点,然后计算平面模型参数$A,B,C,D $,即
$$ \mathit{A\cdot X_{\mathrm{w }}+ B\cdot Y_{\mathrm{w }} + C\cdot Z_{\mathrm{w }} = D} $$ (5) 式中:$X_{\mathrm{w }} $,$Y_{\mathrm{w }} $,$Z_{\mathrm{w }} $为点在机器人坐标系中的三维坐标.
根据估计的平面模型,确定平面内部点和平面外部点,计算该参数模型下平面内点的个数并记录.重复上面两步,不断迭代, 直到达到设置的最大迭代次数, 找到平面内点个数最多的模型参数, 最后用平面内点再次对模型参数进行估计,得到最终的模型参数.
使用RANSAC算法分离得到多个平面点云,点云Z值最小的平面为工作台平面,比工作台平面稍高的为铁托板平面(PA),比焊缝平面稍高的为铁心平面(PB),通过铁托板平面和铁心平面,可进行边界即焊缝位置的提取,步骤如下.
第一步,获取PA和PB的质心$ {{\mathrm{C}}}_{\mathrm{P}\mathrm{A}}\mathrm{和}{{\mathrm{C}}}_{\mathrm{P}\mathrm{B}} $.
第二步,在PA中遍历,最外侧轮廓$ {\mathrm{P}\mathrm{A}}^{{{'}}}. $
第三步,在$ {\mathrm{P}\mathrm{A}}^{{{'}}} $中遍历,如满足以下关系则提取点P(点P是$ {\mathrm{P}\mathrm{A}}^{{{'}}} $中的一点,即$ {\mathrm{P}\mathrm{A}}^{{{'}}} $中遍历的当前点),即
$$ \left\{\begin{array}{c}{{{\boldsymbol{C}}}_{{\bf{PA}}}{\boldsymbol{P}}}\cdot {{{\boldsymbol{C}}}_{\bf{PA}}{{\boldsymbol{C}}}_{\bf{PB}}} > 0\\ {{{\boldsymbol{C}}}_{{\bf{PB}}}{\boldsymbol{P}}}\cdot {{{\boldsymbol{C}}}_{{\bf{PB}}}{{\boldsymbol{C}}}_{\bf{PA}}} > 0\end{array} \right.$$ (6) 第四步,确定焊缝点,对获得的点集进行RANSANC直线拟合,其中与$ {{\mathrm{C}}}_{\mathrm{P}\mathrm{A}} $和$ {{\mathrm{C}}}_{\mathrm{P}\mathrm{B}} $接近垂直的,即为焊缝.
通过重复上述过程,实现对整个配准点云的遍历,即可获取整体焊缝的位置,如图6所示,随后可以根据焊接要求进行分段处理.
3. 试验结果
试验采用的磁极焊缝模拟件,长边L为1 200 mm,宽边W为330 mm,周向间断焊缝共18条,长边7条,短边2条,焊缝长度50 mm,间隔长度100 mm.
应用文中提出的算法,识别的完整磁极焊缝模拟试验件点云图如图7所示.
获得焊缝轨迹中每段焊缝的起始点坐标和结束点坐标,利用上述轨迹进行焊接试验,最终试验结果如图8所示.
为验证焊缝定位精度,进行37 组试验,计算机器人识别调整后的坐标x,y,z轴的测量值与实际焊缝坐标的绝对误差,计算其均方差,如图9所示,x,y,z轴的误差都在±0.4 mm范围之内,计算得到的均方差分别为x轴0.223 mm,y轴0.278 mm,z轴0.198 mm. 以上数据表明,焊接路径的获取较为理想,可以满足焊接机器人对焊接精度的要求.
4. 结论
(1) 结合磁极焊缝结构特点,开发了一套机器人焊缝识别的视觉识别系统,可应用于磁极自主焊接.
(2) 建立了基于改进ICP算法,实现焊缝点云配准,基于RANSAC的点云焊缝自主识别,实现了对焊缝长度、间隙等多维度信息进行快速高精度识别.
(3) 经过对比采样数据对算法的识别精度进行了误差分析,结果表明,焊缝起点、终点的误差都在±0.4 mm的范围之内,实现了磁极焊缝视觉识别的高精度和可靠性.
-
图 6 BP和GA-BP神经网络训练和预测结果
Figure 6. Training and prediction results of BP and GA-BP neural networks. (a) maximum lateral residual stress of the training sample; (b) maximum longitudinal residual stress of training sample; (c) training sample deformation angle; (d) test the maximum lateral residual stress of the sample; (e) longitudinal maximum residual stress of the sample is tested; (f) test sample deformation angle
表 1 因素水平表L16(44)
Table 1 Factor level table for L16(44)
水平
编号焊接电流
I/A电弧电压
U/V焊接速度
v/(mm·min−1)层间温度
T/℃1 A1(140) B1(14) C1(50) D1(80) 2 A2(165) B2(16) C2(90) D2(120) 3 A3(190) B3(18) C3(120) D3(160) 4 A4(215) B4(20) C4(150) D4(200) 表 2 正交试验结果
Table 2 Results of the orthogonal experiment
序号 焊接电流
I/A电弧电压
U/V焊接速度
v/(mm·min−1)层间温度
T/℃横向最大残余应力
σx-max/MPa纵向最大残余应力
σy-max/MPa角变形
θ/(°)1 140 14 50 80 124.4 386.7 6.18 2 140 16 90 120 287.6 275.8 7.56 3 140 18 120 160 237.3 241.9 6.93 4 140 20 150 200 413.3 187.6 7.42 5 165 14 90 200 397.6 284.3 7.12 6 165 16 50 160 444.5 365.8 7.88 7 165 18 120 120 315.3 397.2 9.33 8 165 20 150 80 274.3 426.3 8.52 9 190 14 120 120 356.1 468.4 8.78 10 190 16 150 80 333.1 494.3 8.81 11 190 18 50 200 297.6 412.6 9.24 12 190 20 90 160 183.7 471.8 8.38 13 215 14 150 160 244.2 356.1 9.56 14 215 16 120 200 174.3 337.1 9.84 15 215 18 90 120 211.3 387.5 9.36 16 215 20 50 80 193.5 434.8 9.21 17 163 17 120 88 163.1 136.7 8.41 18 175 18 110 165 123.9 256.8 8.65 19 185 15 100 95 263.4 313.7 8.93 20 210 19 135 145 309.8 351.8 9.43 表 3 神经网络预测平均相对误差
Table 3 Average relative error of neural network prediction
输出结果 BP GA-BP 训练样本 测试样本 训练样本 测试样本 横向最大残余应力 12.15% 14.56% 2.51% 2.38% 纵向最大残余应力 12.52% 14.35% 2.01% 2.84% 角变形 6.8% 8.53% 1.28% 1.32% -
[1] Ragavendran M, Vasudevan M, Hussain N. Study of the microstructure, mechanical properties, residual stresses, and distortion in type 316LN stainless steel medium thickness plate weld joints[J]. Journal of Materials Engineering and Performance, 2022, 31(6): 5013 − 5025.
[2] Banik S D, Kumar S, Singh P K, et al. Distortion and residual stresses in thick plate weld joint of austenitic stainless steel: Experiments and analysis[J]. Journal of Materials Processing Technology, 2021, 289: 116944.
[3] 马建国, 陶嘉, 刘志宏, 等. 退火温度对50 mm厚316L电子束焊接头微观组织与力学性能的影响[J]. 焊接学报, 2022, 43(12): 72 − 78. Ma Jianguo, Tao Jia, Liu Zhihong, et al. Effect of annealing temperature on microstructure and mechanical properties of 50 mm thickness 316L electron beam welded joint[J]. Transactions of the China Welding Institution, 2022, 43(12): 72 − 78.
[4] Li R, Dong M, Gao H. Prediction of bead geometry with changing welding speed using artificial neural network[J]. Materials, 2021, 14(6): 1494. doi: 10.3390/ma14061494
[5] 乌日根, 王玉荣. 基于RBF人工神经网络的机器人焊缝成形质量预测[J]. 焊接技术, 2022, 51(9): 102 − 105,144. Wu Rigen, Wang Yurong. Quality prediction of robot welding seam molding basic on RBF artificial neural network[J]. Welding Technology, 2022, 51(9): 102 − 105,144.
[6] Liu L, Xue M, Guo N, et al. Investigating the path tracking algorithm based on BP neural network[J]. Sensors, 2023(9): 4533.
[7] Han Xiaohui, Dong Jianping. Applications of fractional gradient descent method with adaptive momentum in BP neural networks [J]. Applied Mathematics and Computation, 2023, 408: 127944.
[8] Shanavas S, Dhas J. Weld quality prediction of AA5052-H32 aluminium alloy using neural network approach[J]. Materials Today: Proceedings, 2018, 5(2): 8256 − 8262. doi: 10.1016/j.matpr.2017.11.516
[9] 马思群, 刘选, 金辉, 等. BP及RBF神经网络铝合金车体焊接残余应力预测[J]. 大连交通大学学报, 2018, 39(6): 30 − 34. Ma Siqun, Liu Xuan, Jin Hui, et al. Study of neural network prediction of welding residual stresses in high speed train bodywork[J]. Dalian Transportation University Journal, 2018, 39(6): 30 − 34.
[10] 陈树友. 基于马尔可夫优化的深度双向LSTM视频流行度预测方法研究[D]. 合肥: 合肥工业大学, 2021. Cheng Shuyou. Research on deep bidirectional LSTM video popularity prediction method based on markov optimization[D]. Hefei: Hefei University of Technology, 2021.
[11] Yang J, Hu Y, Zhang K, et al. An improved evolution algorithm using population competition genetic algorithm and self-correction BP neural network based on fitness landscape[J]. Soft Computing, 2021, 25: 1751 − 1776.
[12] 张天鹏, 赵亚东. 基于主轴动态特性的GA-BP网络预测FSW接头性能[J]. 特种铸造及有色合金, 2022, 42(7): 814 − 818. Zhang Tianpeng, Zhao Yadong. GA-BP neural network prediction of FSW joint properties based on dynamic characteristics of spindle[J]. Speciality Casting, 2022, 42(7): 814 − 818.
[13] 关子奇, 朱玉龙, 刘晓光, 等. 基于GA优化BP神经网络的焊接熔池照度建模[J]. 热加工工艺, 2019, 48(7): 216 − 220,223. Guan Ziqi, Zhu Yulong, Liu Xiaoguang, et al. Modeling of weld pool illumination based on GA optimizing BP neural network[J]. Hot Processing, 2019, 48(7): 216 − 220,223.
[14] 张永波, 朱英韬. 基于主成分分析和GA-BP神经网络的带钢焊接质量预测[J]. 热加工工艺, 2020, 49(17): 128 − 132. Zhang Yongbo, Zhu Yingtao. Prediction of welding quality of strip steel based on principal component analysis and GA-BP neural network[J]. Hot Working Technology, 2020, 49(17): 128 − 132.
[15] Zhang L, Wang F, Sun T, et al. A constrained optimization method based on BP neural network[J]. Neural Computing and Applications, 2018, 29(2): 413 − 421.
[16] 郑斌. 基于卷积神经网络融合扩展卡尔曼滤波的拖缆姿态解算算法研究[D]. 长春: 吉林大学, 2022. Zheng Bin. Research on drag cable attitude solving algorithm based on convolutional neural network fusion extended kalman filter [D]. Changchun: Jilin University, 2022
[17] 李长安, 卢雪琴, 吴忠强, 等. 基于蚁群算法优化反向传播神经网络的港口吞吐量预测[J]. 计量学报, 2020, 41(11): 1398 − 1403. Li Chang'an, Lu Xueqin, Wu Zhongqiang, et al. Throughput prediction of port based on back propagation neural network optimized by ant colony algorithm[J]. Acta Metrologica Sinica, 2020, 41(11): 1398 − 1403.
[18] Yin Xinzhe, Li Jinghua, Huang Shoujun. The improved genetic and BP hybrid algorithm and neural network economic early warning system[J]. Neural Computing & Applications, 2022, 34(5): 3365 − 3374.