欢迎访问林业科学,今天是

林业科学 ›› 2026, Vol. 62 ›› Issue (8): 179-190.doi: 10.11707/j.1001-7488.LYKX20250628

• 研究论文 • 上一篇    下一篇

基于支持向量机回归误差补偿的机械式木门窗材在线测量系统

曲文,蔡传龙,许启灏,刘吉宇,丁禹程,杨春梅,宋文龙*()   

  1. 东北林业大学机电工程学院 哈尔滨150006
  • 收稿日期:2025-10-17 修回日期:2026-05-18 出版日期:2026-08-10 发布日期:2026-08-20
  • 通讯作者: 宋文龙 E-mail:wlsong139@126.com
  • 基金资助:
    黑龙江省“双一流”学科协同创新成果项目(LJGXCG2024-F16);黑龙江省重大成果转化项目(CG23013)。

Online Measurement System for Mechanical Wooden Door and Window Materials Based on Support Vector Machine Regression Error Compensation

Wen Qu,Chuanlong Cai,Qihao Xu,Jiyu Liu,Yucheng Ding,Chunmei Yang,Wenlong Song*()   

  1. College of Mechanical and Electrical Engineering, Northeast Forestry University Harbin 150006
  • Received:2025-10-17 Revised:2026-05-18 Online:2026-08-10 Published:2026-08-20
  • Contact: Wenlong Song E-mail:wlsong139@126.com

摘要:

目的: 开发一套低成本、高精度的机械式木门窗材长度在线测量系统,以支撑生产线的智能化改造。方法: 提出一种基于现有设备的轻量化改造方案:在推料车同步带传动轴上增设测量轴,并经由联轴器连接增量式旋转编码器采集位移信息,配合光电传感器识别木门窗材起止位置,建立编码脉冲与木门窗材长度的精确映射关系。考虑信号延迟、机械传动、同步带弹性变形等因素引入的系统偏差,采用最小二乘法线性回归(LSLR)和支持向量机回归(SVR)对测量值进行补偿,并基于Python-SNAP7通信协议实现上位机与PLC的实时数据交互,完成测量数据的自动采集和补偿结果的回传。为评估2种模型的补偿性能,分别采用LSLR和SVR对200组测量数据进行训练,利用极坐标误差分布图和误差数据拟合图进行可视化分析,通过决定系数(R2)、均方根误差(RMSE)和平均绝对误差(MAE)等多项统计指标综合评估模型的补偿效果。为确保模型评估的可靠性,在工业现场选取500、1 000、1 500、2 000 mm 4种典型规格木门窗材开展验证试验,每种规格加工20根样品,共采集80组独立试验数据作为模型验证集。以人工卷尺重复测量均值为基准值,与经不同模型补偿后的测量值进行对比,通过归一化处理、观测平均绝对误差变化趋势分析不同模型的补偿效果。结果: 构建的机械式在线测量系统可实现对不同规格木门窗材长度的高精度实时检测。200组数据分析结果表明,SVR模型的所有评价指标均优于LSLR模型,其R2达0.999 8, MAE为0.412 7, RMSE为1.594 8,明显优于LSLR模型的0.989 5(R2)、1.047 4(MAE)和2.359 7(RMSE)。不同规格木门窗材样品对比试验结果显示,系统对1 500 mm木门窗材的测量精度最高,经SVR补偿后数据点几乎完全贴合理想预测线;对于长度为500、1 000、2 000 mm的木门窗材,基于SVR模型的系统测量精度虽略有波动,但仍展现出强鲁棒性,离群点较少。SVR模型补偿后的MAE在整个测量范围内始终低于0.5 mm,显著优于原始测量值和LSLR补偿结果。结论: 本研究提出的在线测量系统为解决定长截断锯与后续码垛间的数据断层问题提供了有效方案,也为后续木门窗材的位置码垛提供了数据基础。

关键词: 木门窗材, 长度测量, 机械式测量, 支持向量机回归, 误差补偿

Abstract:

Objective: Imported fixed-length cut-off saws are widely used in production lines of wood doors and windows. However, due to frequent adoption of closed proprietary control systems and communication protocols by these sawing machines, measurement data remains locked within the equipment. Furthermore, as the actual output sequence is random to ensure optimal wood utilization during production, it is difficult to accurately match the measurement data displayed by the equipment with the actual dimensions. This has resulted in a “data silo” problem that restricts wood door and window manufacturing enterprises from meeting automation upgrade demands, such as intelligent palletizing. To address this dilemma, this study aims to develop a low-cost, high-efficient mechanical online length measurement system for wooden door and window materials to support the intelligent transformation of production lines. Method: A lightweight retrofit solution based on existing equipment was proposed: a measurement shaft was added to the synchronous belt drive shaft of the push cart; displacement information was collected using high-precision rotary encoders, combined with photoelectric sensors to identify the start and end positions of wooden door and window materials, thus establishing a precise mapping relationship between encoder pulses and material length. Taking into account the systematic deviations introduced by factors such as signal delay, mechanical transmission, and elastic deformation of synchronous belts, the least squares linear regression (LSLR) and support vector machine regression (SVR) were employed to compensate for the measured values. Real-time data interaction between the upper computer and PLC was accomplished based on Python-SNAP7 communication protocol, enabling automatic data collection and feedback of error compensation results. To evaluate the error compensation performance of the two models, LSLR and SVR were employed to train on 200 measurement data samples. Polar coordinate error distribution plots and error data fitting curves were used to conduct visual analysis, and multiple statistical metrics including coefficient of determination (R2), root mean square error (RMSE), and mean absolute error (MAE) were used to comprehensively evaluate compensation effects of the models. To ensure the reliability of model evaluation, industrial validation experiments were conducted on four typical dimensional specifications of door and window materials (500, 1 000, 1 500, and 2 000 mm), with 20 samples processed for each specification. A total of 80 independently collected data samples served as the model validation set. The mean value obtained from repeated manual tape measure readings served as the reference standard. This reference was compared with the measured values compensated by different models. Through normalization processing and observation of the trend in mean absolute error, the error compensation effects of different models were analyzed. Result: The mechanized online measurement system constructed in this study was able to achieve high-precision real-time detection of the length of wooden door and window materials across various specifications. Analysis results of 200 data sets demonstrated that the SVR model outperformed the LSLR model across all evaluation metrics: the coefficient of determination R2 reached 0.999 8, the mean absolute error (MAE) was 0.412 7, and the root mean square error (RMSE) was 1.594 8, significantly superior to the LSLR model values of 0.989 5 (R2), 2.359 7 (MAE), and 1.047 4 (RMSE), respectively. Comparative experiments on samples of different-sized door and window materials revealed that the measurement system achieved the highest accuracy for 1 500 mm materials. After SVR compensation, data points nearly perfectly aligned with the ideal prediction line. For 500, 1 000, and 2 000 mm materials, the SVR-based system showed slight fluctuations but maintained strong robustness with few outliers. The mean absolute error after SVR model compensation remained below 0.5 mm across the entire measurement range, significantly outperforming both raw measurements and LSLR-compensated results. Conclusion: The proposed online measurement system provides an effective solution to bridge the data gap between fixed-length cross-cutting saws and subsequent stacking processes, and also lays a data foundation for subsequent positional palletizing and complete set matching of wooden door and window materials.

Key words: wooden door and window materials, length measurement, mechanical measurement, support vector regression, error compensation

中图分类号: